zhaojs
2023-07-27 280bbc8fca6c6b52a334996258cd7d86532369d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<template>
    <view class="classify-wrapper wrapperLayer borderBox">
        <titleBar titleText='买买卡' :pageForm='"buycard"'></titleBar>
        <view class="pageContent-container rowEndBet">
            <view class="leftContent-container borderBox">
                <scroll-view scroll-y scroll-with-animation class="classifyList">
                    <block v-for="(items,index) in classifyList" :key='index'>
                        <view class="classify-items rowCenCen" :class="leftCurrent==index?'classify-items-active':''" @click="leftChange(index,items.id)">
                            <view class="active-box rowCenCen">
                                <view class="nameBox">
                                    {{items.cname}}
                                </view>
                            </view>
                        </view>
                    </block>
                </scroll-view>
            </view>
            <view class="rightContent-container borderBox">
                <view class="banner-container rowCen">
                    <swiper class="swiper-container" :autoplay="true" :interval="3000" :duration="1000" circular>
                        <swiper-item v-for="(items,index) in topBannerList" :key='index'>
                            <view class="swiper-box defIcon">
                                <image :src="items.pic" mode=""></image>
                            </view>
                        </swiper-item>
                    </swiper>
                </view>
                <scroll-view scroll-y scroll-with-animation class="rightScroll" @scroll='scroll' :scroll-top="scrollTop">
                    <view class="rightList rowCen">
                        <block v-for="(items,index) in dataList" :key='index'>
                            <view class="itmcard colCen" @tap="gowebview(items.hurl)">
                                <view class="imagePic defIcon">
                                    <image :src="items.cpic" mode="aspectFill"></image>
                                </view>
                                <view class="itmName">
                                    {{items.cname}}
                                </view>
                            </view>
                        </block>
                    </view>
                </scroll-view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import titleBar from '../../components/backTitlebar.vue'
    import common from '../../utils/common.js';
    export default {
        components: {
            titleBar
        },
        data() {
            return {
                cusConfig: {
                    mineTopColor: '#7D0DFC',
                    mineEndColor: '#D116FD'
                },
                sysInfo: '',
                titleBarHeight: 0,
                leftCurrent: 0,
                scrollTop: 0,
                oldscrollTop: 0,
                classifyList: [],
                dataList:'',
                topBannerList: []
            }
        },
        onLoad() {
            this.getequipmentInfo();
            this.getBannerInfo()
            this.initData();
        },
        mounted() {},
        methods: {
            getBannerInfo() {
                // banner数据
                this.$http.get('banner/list/8').then((res) => {
                    console.log(res, '========>轮播图数据');
                    this.topBannerList = res;
                })
            },
            initData() {
                this.$http.post('buyBuyCard/getList', {
                    parentId: 0
                }, 'application/json').then((res) => {
                    console.log(res, '========>左侧数据');
                    this.classifyList = res;
                    this.getdataList(this.classifyList[0].id)
                })
            },
            getdataList(id) {
                this.dataList = []
                this.$http.post('buyBuyCard/getList', {
                    parentId: id
                }, 'application/json').then((res) => {
                    console.log(res, '========>右侧数据');
                    this.dataList = res;
                })
            },
            scroll(e) {
                this.oldscrollTop = e.detail.scrollTop
            },
            getequipmentInfo() {
                uni.getSystemInfo({
                    success: res => {
                        console.log(res);
                        this.sysInfo = res;
                    }
                });
            },
            leftChange(idx, id) {
                this.scrollTop = this.oldscrollTop
                this.$nextTick(() => {
                    this.scrollTop = 0
                });
                this.leftCurrent = idx;
                this.getdataList(id)
            },
            gowebview(url){
                uni.navigateTo({
                    url: '../webView/webView?url=' + url
                })
            }
        }
    }
</script>
 
<style lang="scss">
    .classify-wrapper {
        width: 750rpx;
 
        .pageContent-container {
            width: 100%;
            height: calc(100vh - 90rpx);
 
            .leftContent-container {
                width: 170rpx;
                height: 100%;
                background-color: #E6E8ED;
 
                .classifyList {
                    width: 100%;
                    height: 100%;
 
                    .classify-items {
                        width: 100%;
                        height: 90rpx;
 
                        .active-box {
                            width: 100%;
 
                            .nameBox {
                                font-size: 26rpx;
                                font-weight: 400;
                                color: #333333;
                            }
                        }
                    }
 
                    .classify-items-active {
                        background-color: #FFFFFF;
 
                        .active-box {
                            width: 100%;
                            border-left: 6rpx solid #FE3A33;
 
                            .nameBox {
                                color: #FE3A33;
                            }
                        }
                    }
                }
            }
 
            .rightContent-container {
                width: 580rpx;
                height: 100%;
                background-color: #FFFFFF;
 
                .banner-container {
                    width: 100%;
                    height: 180rpx;
 
                    .swiper-container {
                        width: 100%;
                        height: 160rpx;
 
                        .swiper-box {
                            padding: 0 20rpx;
                            width: 100%;
                            height: 100%;
                        }
                    }
                }
 
                .rightScroll {
                    width: 100%;
                    height: 100%;
 
                    .rightList {
                        width: 100%;
                        flex-wrap: wrap;
                        padding: 0 22rpx;
 
                        .itmcard {
                            width: 33.33333%;
                            margin-bottom: 30rpx;
 
                            .imagePic {
                                width: 96rpx;
                                height: 96rpx;
                                margin: 20rpx 0;
                            }
 
                            .itmName {
                                font-size: 24rpx;
                                font-weight: 400;
                                color: #333333;
                            }
                        }
                    }
                }
            }
        }
    }
</style>