|
@@ -7,6 +7,7 @@
|
7
|
7
|
:refresher-enabled="true"
|
8
|
8
|
:refresher-triggered="triggered"
|
9
|
9
|
@refresherrefresh="refresherrefresh"
|
|
10
|
+ @scrolltolower="getMoreGoods"
|
10
|
11
|
:scroll-into-view="scroll"
|
11
|
12
|
>
|
12
|
13
|
<swiper
|
|
@@ -16,11 +17,34 @@
|
16
|
17
|
>
|
17
|
18
|
<swiper-item
|
18
|
19
|
class="swiper__item"
|
19
|
|
- v-for="(item, index) in goods.pictureUrls"
|
20
|
|
- :key="index"
|
|
20
|
+ v-if="goods.videos.orgVideoUrl"
|
21
|
21
|
>
|
22
|
|
- <my-image class="swiper__img" :src="item"></my-image>
|
|
22
|
+ <video
|
|
23
|
+ id="goodVideo"
|
|
24
|
+ class="swiper__video"
|
|
25
|
+ :src="goods.videos.orgVideoUrl"
|
|
26
|
+ :poster="goods.videos.orgCoverUrl"
|
|
27
|
+ :show-mute-btn="true"
|
|
28
|
+ ></video>
|
23
|
29
|
</swiper-item>
|
|
30
|
+ <block v-if="goods.detailUrlList && goods.detailUrlList.length">
|
|
31
|
+ <swiper-item
|
|
32
|
+ class="swiper__item"
|
|
33
|
+ v-for="(item, index) in goods.detailUrlList"
|
|
34
|
+ :key="index"
|
|
35
|
+ >
|
|
36
|
+ <my-image class="swiper__img" :src="item"></my-image>
|
|
37
|
+ </swiper-item>
|
|
38
|
+ </block>
|
|
39
|
+ <block v-else>
|
|
40
|
+ <swiper-item
|
|
41
|
+ class="swiper__item"
|
|
42
|
+ v-for="(item, index) in goods.pictureUrls"
|
|
43
|
+ :key="index"
|
|
44
|
+ >
|
|
45
|
+ <my-image class="swiper__img" :src="item"></my-image>
|
|
46
|
+ </swiper-item>
|
|
47
|
+ </block>
|
24
|
48
|
</swiper>
|
25
|
49
|
<div class="info">
|
26
|
50
|
<div class="info__top">
|
|
@@ -202,7 +226,20 @@
|
202
|
226
|
</li>
|
203
|
227
|
</ul>
|
204
|
228
|
|
205
|
|
- <div class="images">
|
|
229
|
+ <div
|
|
230
|
+ class="images"
|
|
231
|
+ v-if="goods.detailUrlList && goods.detailUrlList.length"
|
|
232
|
+ >
|
|
233
|
+ <my-image
|
|
234
|
+ class="images__item"
|
|
235
|
+ mode="widthFix"
|
|
236
|
+ :src="item"
|
|
237
|
+ v-for="(item, index) in goods.detailUrlList"
|
|
238
|
+ :key="index"
|
|
239
|
+ ></my-image>
|
|
240
|
+ </div>
|
|
241
|
+
|
|
242
|
+ <div class="images" v-else>
|
206
|
243
|
<my-image
|
207
|
244
|
class="images__item"
|
208
|
245
|
mode="widthFix"
|
|
@@ -272,9 +309,9 @@
|
272
|
309
|
class="goods__present"
|
273
|
310
|
@click="jumpGoodsDetail(item)"
|
274
|
311
|
>
|
275
|
|
- <span class="goods__big">¥{{
|
276
|
|
- item.minPrice / 100
|
277
|
|
- }}</span>
|
|
312
|
+ <span class="goods__big"
|
|
313
|
+ >¥{{ item.minPrice / 100 }}</span
|
|
314
|
+ >
|
278
|
315
|
</div>
|
279
|
316
|
<div
|
280
|
317
|
class="goods__original"
|
|
@@ -286,7 +323,16 @@
|
286
|
323
|
</div>
|
287
|
324
|
</li>
|
288
|
325
|
</ul>
|
289
|
|
- <div class="more-text" v-if="goodsList.length && !isHaveMore">
|
|
326
|
+ <div
|
|
327
|
+ class="more-text"
|
|
328
|
+ v-if="goodsList.length && !isHaveMore && goodListLoading"
|
|
329
|
+ >
|
|
330
|
+ - 加载中 -
|
|
331
|
+ </div>
|
|
332
|
+ <div
|
|
333
|
+ class="more-text"
|
|
334
|
+ v-if="goodsList.length && !isHaveMore && !goodListLoading"
|
|
335
|
+ >
|
290
|
336
|
- 没有更多了 -
|
291
|
337
|
</div>
|
292
|
338
|
<div class="null" v-if="loading && !goodsList.length">
|
|
@@ -452,13 +498,15 @@ export default {
|
452
|
498
|
goodsList: [],
|
453
|
499
|
loading: false,
|
454
|
500
|
isHaveMore: false,
|
|
501
|
+ goodListLoading: true,
|
455
|
502
|
};
|
456
|
503
|
},
|
457
|
504
|
|
458
|
505
|
async onShow() {
|
459
|
506
|
const self = this;
|
460
|
|
-
|
|
507
|
+ console.log(1122);
|
461
|
508
|
await self.fn.init();
|
|
509
|
+ console.log("after");
|
462
|
510
|
|
463
|
511
|
this.deliveryConfig = this.$store.state.common.storeConfig.deliveryConfig;
|
464
|
512
|
self.fn.shareMenu();
|
|
@@ -529,7 +577,7 @@ export default {
|
529
|
577
|
console.log(self.goods);
|
530
|
578
|
self.creationShare2();
|
531
|
579
|
self.getGoodsList();
|
532
|
|
- if(data.skuList && data.skuList.length ===1){
|
|
580
|
+ if (data.skuList && data.skuList.length === 1) {
|
533
|
581
|
self.spec = data.skuList[0];
|
534
|
582
|
self.spec.active = true;
|
535
|
583
|
}
|
|
@@ -1123,6 +1171,7 @@ export default {
|
1123
|
1171
|
uni.showLoading({
|
1124
|
1172
|
title: "加载中...",
|
1125
|
1173
|
});
|
|
1174
|
+ this.goodListLoading = true;
|
1126
|
1175
|
self.api
|
1127
|
1176
|
.get("/Product/GetRelevant", {
|
1128
|
1177
|
keyword: self.goods.name,
|
|
@@ -1130,6 +1179,7 @@ export default {
|
1130
|
1179
|
pageSize: 20,
|
1131
|
1180
|
})
|
1132
|
1181
|
.then((res) => {
|
|
1182
|
+ this.goodListLoading = false;
|
1133
|
1183
|
uni.hideLoading();
|
1134
|
1184
|
uni.stopPullDownRefresh();
|
1135
|
1185
|
let data = JSON.parse(res.data.list);
|
|
@@ -1148,7 +1198,7 @@ export default {
|
1148
|
1198
|
// 获取更多商品
|
1149
|
1199
|
getMoreGoods() {
|
1150
|
1200
|
const self = this;
|
1151
|
|
-
|
|
1201
|
+ this.goodListLoading = true;
|
1152
|
1202
|
self.api
|
1153
|
1203
|
.get("/Product/GetRelevant", {
|
1154
|
1204
|
keyword: self.goods.name,
|
|
@@ -1156,6 +1206,7 @@ export default {
|
1156
|
1206
|
pageSize: 20,
|
1157
|
1207
|
})
|
1158
|
1208
|
.then((res) => {
|
|
1209
|
+ this.goodListLoading = false;
|
1159
|
1210
|
let data = JSON.parse(res.data.list);
|
1160
|
1211
|
if (data.length) {
|
1161
|
1212
|
self.page++;
|
|
@@ -2169,11 +2220,11 @@ page {
|
2169
|
2220
|
font-size: px(34);
|
2170
|
2221
|
color: #999;
|
2171
|
2222
|
}
|
2172
|
|
-.bg-white{
|
|
2223
|
+.bg-white {
|
2173
|
2224
|
background-color: #fff;
|
2174
|
2225
|
margin-top: px(30);
|
2175
|
2226
|
}
|
2176
|
|
-.everybody{
|
|
2227
|
+.everybody {
|
2177
|
2228
|
text-align: center;
|
2178
|
2229
|
padding: px(30);
|
2179
|
2230
|
font-size: px(44);
|