|
|
@@ -3,8 +3,8 @@
|
|
3
|
3
|
<view class="lab-content">
|
|
4
|
4
|
<scroll-view scroll-x="true" class="lab-item">
|
|
5
|
5
|
<view class="lab-item-x" v-for="(item,index) in tabList" :key="'lab-item-x-'+index">
|
|
6
|
|
- <view class="lab-item-small" @click="onTabClick(index)">
|
|
7
|
|
- <text :class="currentIndex==index?'lab-title':'lab-default-title'">111</text>
|
|
|
6
|
+ <view class="lab-item-small" @click="onTabClick(index,item.merchant_category_id)">
|
|
|
7
|
+ <text :class="currentIndex==index?'lab-title':'lab-default-title'">{{item.category_name}}</text>
|
|
8
|
8
|
<view :class="currentIndex==index?'lab-line':'lab-default-line'"></view>
|
|
9
|
9
|
</view>
|
|
10
|
10
|
</view>
|
|
|
@@ -15,19 +15,20 @@
|
|
15
|
15
|
</view>
|
|
16
|
16
|
|
|
17
|
17
|
<view class="fuc-content">
|
|
18
|
|
- <view class="fuc-item" v-for="(item,index) in MU_TABLE_LIST">
|
|
|
18
|
+ <view @click="onFucClick" class="fuc-item" v-for="(item,index) in MU_TABLE_LIST" :key="'fuc-item-'+index">
|
|
19
|
19
|
<text class="item-title">{{item.title}}</text>
|
|
20
|
20
|
<text class="item-des">{{item.des}}</text>
|
|
21
|
21
|
<image class="item-img" :src="item.icon" mode=""></image>
|
|
22
|
22
|
</view>
|
|
23
|
23
|
</view>
|
|
24
|
24
|
|
|
25
|
|
- <view v-for="(item,index) in goodsList">
|
|
26
|
|
- <view class="vip-content">
|
|
|
25
|
+ <view v-if="goodsList&& goodsList.length!=0" v-for="(item,index) in goodsList" :key="'goods-x-'+index">
|
|
|
26
|
+ <view class="vip-content" v-if="item.childList&& item.childList.length!=0"
|
|
|
27
|
+ @click="goShopClick(item.mer_id)">
|
|
27
|
28
|
<image class="vip-bg" src="/static/img/item_smq_bg.png" mode="aspectFill"></image>
|
|
28
|
29
|
<view class="left-lab-content">
|
|
29
|
|
- <image class="lab-icon" src="" mode=""></image>
|
|
30
|
|
- <text class="lab-title">会员专区</text>
|
|
|
30
|
+ <image class="lab-icon" :src="item.mer_avatar" mode="widthFix"></image>
|
|
|
31
|
+ <text class="lab-title">{{item.mer_name}}</text>
|
|
31
|
32
|
<view class="small-lab">补充养老</view>
|
|
32
|
33
|
</view>
|
|
33
|
34
|
|
|
|
@@ -39,24 +40,22 @@
|
|
39
|
40
|
|
|
40
|
41
|
<view class="goods-scoll-content">
|
|
41
|
42
|
<scroll-view scroll-x="true" class="goods-scoll-item">
|
|
42
|
|
- <view class="goods-scoll-item-x" v-for="(item,index) in goodsList"
|
|
43
|
|
- :key="'goods-scoll-item-x-'+index">
|
|
|
43
|
+ <view @click="onDetailClick(childItem.product_id)" class="goods-scoll-item-x"
|
|
|
44
|
+ v-for="(childItem,childIndex) in item.childList" :key="'goods-scoll-item-x-'+childIndex">
|
|
44
|
45
|
<view class="goods-item">
|
|
45
|
|
- <image class="goods-img" src="" mode="aspectFill"></image>
|
|
46
|
|
- <text class="goods-title">11</text>
|
|
|
46
|
+ <image class="goods-img" :src="childItem.image" mode="aspectFill"></image>
|
|
|
47
|
+ <text class="goods-title">{{childItem.store_name}}</text>
|
|
47
|
48
|
<view class="price-content">
|
|
48
|
|
- <text class="goods-des">20</text>
|
|
49
|
|
- <text class="goods-des">pv:0</text>
|
|
|
49
|
+ <text class="goods-des">{{childItem.price}}</text>
|
|
|
50
|
+ <text class="goods-des">pv:{{childItem.pv?childItem.pv:0}}</text>
|
|
50
|
51
|
</view>
|
|
51
|
52
|
</view>
|
|
52
|
53
|
</view>
|
|
53
|
54
|
</scroll-view>
|
|
54
|
55
|
</view>
|
|
55
|
56
|
</view>
|
|
56
|
|
-
|
|
57
|
|
-
|
|
58
|
|
-
|
|
59
|
|
-
|
|
|
57
|
+
|
|
|
58
|
+ <CXBEmpty v-else />
|
|
60
|
59
|
</view>
|
|
61
|
60
|
</template>
|
|
62
|
61
|
|
|
|
@@ -64,14 +63,47 @@
|
|
64
|
63
|
import {
|
|
65
|
64
|
MU_TABLE_LIST
|
|
66
|
65
|
} from "./constants.js"
|
|
67
|
|
- import { getCategoryList } from '~/apis/quickLink'
|
|
|
66
|
+ import {
|
|
|
67
|
+ apiGetCategoryList,
|
|
|
68
|
+ apiGetProductType,
|
|
|
69
|
+ apiGetProductList
|
|
|
70
|
+ } from '~/apis/quickLink'
|
|
|
71
|
+ import { getProductShare } from "~/apis/common";
|
|
68
|
72
|
const currentIndex = ref(0)
|
|
69
|
|
- const tabList = ref([1, 1, 1, 1])
|
|
70
|
|
- const goodsList = ref([1, 1, 1, 1, 1, 1])
|
|
|
73
|
+ const tabList = ref([])
|
|
|
74
|
+ const goodsList = ref([])
|
|
71
|
75
|
|
|
72
|
76
|
|
|
73
|
77
|
onLoad((option) => {
|
|
74
|
|
- console.log("===onLoad");
|
|
|
78
|
+ console.log();
|
|
|
79
|
+ getCategoryList()
|
|
|
80
|
+ getProductType()
|
|
|
81
|
+
|
|
|
82
|
+ if (option && option.shareId) {
|
|
|
83
|
+ userStore.setShareId(option.shareId)
|
|
|
84
|
+ }
|
|
|
85
|
+ getProductShare().then(res => {
|
|
|
86
|
+ if (res) userStore.setShareId(res.share_id)
|
|
|
87
|
+ }).catch(message => {
|
|
|
88
|
+ })
|
|
|
89
|
+ })
|
|
|
90
|
+
|
|
|
91
|
+ onShareAppMessage(() => {
|
|
|
92
|
+ const shareId = Cache.get('SHARE_ID')
|
|
|
93
|
+ return {
|
|
|
94
|
+ title: `消费储蓄 保障未来`,
|
|
|
95
|
+ path: `/pages/vip/index?shareId=${shareId}`,
|
|
|
96
|
+ imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-09/20231009202402136.png'
|
|
|
97
|
+ }
|
|
|
98
|
+ })
|
|
|
99
|
+
|
|
|
100
|
+ onShareTimeline(() => {
|
|
|
101
|
+ const shareId = Cache.get('SHARE_ID')
|
|
|
102
|
+ return {
|
|
|
103
|
+ title: `消费储蓄 保障未来`,
|
|
|
104
|
+ query: `from=share&shareId=${shareId}`,
|
|
|
105
|
+ imageUrl: 'https://cdn.bjtdba.com/vod/image/2023-10-11/20231011062523504.png'
|
|
|
106
|
+ }
|
|
75
|
107
|
})
|
|
76
|
108
|
|
|
77
|
109
|
onReachBottom(() => {
|
|
|
@@ -82,15 +114,67 @@
|
|
82
|
114
|
uni.stopPullDownRefresh()
|
|
83
|
115
|
})
|
|
84
|
116
|
|
|
85
|
|
-
|
|
86
|
|
- function onTabClick(position) {
|
|
|
117
|
+ function onTabClick(position, id) {
|
|
87
|
118
|
currentIndex.value = position
|
|
|
119
|
+ getProductType(id)
|
|
|
120
|
+ }
|
|
|
121
|
+
|
|
|
122
|
+ function goShopClick(id) {
|
|
|
123
|
+ uni.navigateTo({
|
|
|
124
|
+ url: `/pages/store/home/index?id=${id}`
|
|
|
125
|
+ })
|
|
88
|
126
|
}
|
|
89
|
|
- function getategoryCList(){
|
|
90
|
|
- getCategoryList().then((res)=>{
|
|
91
|
|
- console.log("===res",res);
|
|
|
127
|
+
|
|
|
128
|
+ function onDetailClick(id) {
|
|
|
129
|
+ uni.navigateTo({
|
|
|
130
|
+ url: `/pages/store/product/detail?id=${id}`
|
|
92
|
131
|
})
|
|
93
|
132
|
}
|
|
|
133
|
+
|
|
|
134
|
+ function onFucClick() {
|
|
|
135
|
+ uni.showToast({
|
|
|
136
|
+ title: '升级中',
|
|
|
137
|
+ icon: 'none'
|
|
|
138
|
+ })
|
|
|
139
|
+ }
|
|
|
140
|
+
|
|
|
141
|
+ function getCategoryList() {
|
|
|
142
|
+ apiGetCategoryList().then((res) => {
|
|
|
143
|
+ let _list = new Array()
|
|
|
144
|
+ _list.push({
|
|
|
145
|
+ category_name: '全部',
|
|
|
146
|
+ merchant_category_id: ''
|
|
|
147
|
+ })
|
|
|
148
|
+ if (res.merchantCategory && res.merchantCategory.length != 0) {
|
|
|
149
|
+ _list.push(...res.merchantCategory)
|
|
|
150
|
+ }
|
|
|
151
|
+ tabList.value = _list
|
|
|
152
|
+ })
|
|
|
153
|
+ }
|
|
|
154
|
+
|
|
|
155
|
+ function getProductType(id) {
|
|
|
156
|
+ uni.showLoading({
|
|
|
157
|
+ title:'加载中...'
|
|
|
158
|
+ })
|
|
|
159
|
+ apiGetProductType(id).then((res) => {
|
|
|
160
|
+ if (res && res.pageInfo && res.pageInfo.list) {
|
|
|
161
|
+ goodsList.value = res.pageInfo.list
|
|
|
162
|
+ dealData()
|
|
|
163
|
+ }
|
|
|
164
|
+ uni.hideLoading()
|
|
|
165
|
+ })
|
|
|
166
|
+ }
|
|
|
167
|
+
|
|
|
168
|
+ function dealData() {
|
|
|
169
|
+ for (let i = 0; i < goodsList.value.length; i++) {
|
|
|
170
|
+ let _id = goodsList.value[i].mer_id
|
|
|
171
|
+ apiGetProductList(_id).then(resx => {
|
|
|
172
|
+ if (resx.pageInfo.list && resx.pageInfo.list.length != 0) {
|
|
|
173
|
+ goodsList.value[i].childList = resx.pageInfo.list
|
|
|
174
|
+ }
|
|
|
175
|
+ })
|
|
|
176
|
+ }
|
|
|
177
|
+ }
|
|
94
|
178
|
</script>
|
|
95
|
179
|
|
|
96
|
180
|
<style lang="scss" scoped>
|
|
|
@@ -219,7 +303,6 @@
|
|
219
|
303
|
.lab-icon {
|
|
220
|
304
|
width: 30rpx;
|
|
221
|
305
|
height: 30rpx;
|
|
222
|
|
- background-color: #333;
|
|
223
|
306
|
margin-left: 10rpx;
|
|
224
|
307
|
}
|
|
225
|
308
|
|