|
@@ -2,7 +2,7 @@ |
|
@@ -2,7 +2,7 @@ |
2
|
<div class="layout">
|
2
|
<div class="layout">
|
3
|
<LayoutHeader class="layout-header" :show-back="true" :title="'\u200E'"></LayoutHeader>
|
3
|
<LayoutHeader class="layout-header" :show-back="true" :title="'\u200E'"></LayoutHeader>
|
4
|
<div class="layout-context fixscroll">
|
4
|
<div class="layout-context fixscroll">
|
5
|
- <cube-scroll :data="imageList" ref="pageScroll">
|
5
|
+ <cube-scroll ref="pageScroll">
|
6
|
<div class="slide">
|
6
|
<div class="slide">
|
7
|
<cube-slide ref="slide" :data="imageList">
|
7
|
<cube-slide ref="slide" :data="imageList">
|
8
|
<cube-slide-item v-for="(item, index) in imageList" :key="index">
|
8
|
<cube-slide-item v-for="(item, index) in imageList" :key="index">
|
|
@@ -80,16 +80,16 @@ |
|
@@ -80,16 +80,16 @@ |
80
|
<cube-button class="sell" @click="sell">出售</cube-button>
|
80
|
<cube-button class="sell" @click="sell">出售</cube-button>
|
81
|
<cube-button class="buy active" @click="buy">购买</cube-button>
|
81
|
<cube-button class="buy active" @click="buy">购买</cube-button>
|
82
|
</div>
|
82
|
</div>
|
83
|
- <buy-sheet v-if="showBidSheet" @hidden="onBidSheet" :productId="productId"/>
|
|
|
84
|
- <size-request-sheet v-if="showSizeRequestSheet" @hidden="onSizeRequestHidden" :productId="productId"/>
|
83
|
+ <buy-sheet v-if="showBidSheet" @hide="onBidSheetHide" :productId="productId"/>
|
|
|
84
|
+ <size-request-sheet v-if="showSizeRequestSheet" @hide="onSizeRequestHide" :productId="productId"/>
|
85
|
</div>
|
85
|
</div>
|
86
|
- <activity-list-sheet v-if="showActivitySheet" :list="activity" @hidden="onActivitySheetHidden"/>
|
86
|
+ <activity-list-sheet v-if="showActivitySheet" :list="activity" @hide="onActivitySheetHide"/>
|
87
|
<size-select-sheet v-if="showSizeSelectSheet"
|
87
|
<size-select-sheet v-if="showSizeSelectSheet"
|
88
|
:list="sizeList"
|
88
|
:list="sizeList"
|
89
|
:product="productDetail"
|
89
|
:product="productDetail"
|
90
|
:image-list="imageList"
|
90
|
:image-list="imageList"
|
91
|
:config="selectSizeConfig"
|
91
|
:config="selectSizeConfig"
|
92
|
- @hidden="onSizeSelectSheetHidden"
|
92
|
+ @hide="onSizeSelectSheetHide"
|
93
|
@select="onSelectTradeProduct"
|
93
|
@select="onSelectTradeProduct"
|
94
|
@add="onRequestSize"/>
|
94
|
@add="onRequestSize"/>
|
95
|
</div>
|
95
|
</div>
|
|
@@ -194,20 +194,25 @@ export default { |
|
@@ -194,20 +194,25 @@ export default { |
194
|
|
194
|
|
195
|
// 在action-sheet显示控制与对应关闭方法
|
195
|
// 在action-sheet显示控制与对应关闭方法
|
196
|
this.actionSheetCloseMap = {
|
196
|
this.actionSheetCloseMap = {
|
197
|
- showActivitySheet: 'onActivitySheetHidden',
|
|
|
198
|
- showBidSheet: 'onBidSheet',
|
|
|
199
|
- showSizeSelectSheet: 'onSizeSelectSheetHidden',
|
|
|
200
|
- showSizeRequestSheet: 'onSizeRequestHidden',
|
197
|
+ showActivitySheet: 'onActivitySheetHide',
|
|
|
198
|
+ showBidSheet: 'onBidSheetHide',
|
|
|
199
|
+ showSizeSelectSheet: 'onSizeSelectSheetHide',
|
|
|
200
|
+ showSizeRequestSheet: 'onSizeRequestHide',
|
201
|
};
|
201
|
};
|
202
|
},
|
202
|
},
|
203
|
asyncData({store, router}) {
|
203
|
asyncData({store, router}) {
|
204
|
const productId = parseInt(router.params.productId, 10);
|
204
|
const productId = parseInt(router.params.productId, 10);
|
205
|
|
205
|
|
|
|
206
|
+ if (isNaN(productId)) {
|
|
|
207
|
+ throw new Error('无效的商品ID');
|
|
|
208
|
+ }
|
|
|
209
|
+
|
206
|
return store.dispatch('product/fetchProductInfo', {productId});
|
210
|
return store.dispatch('product/fetchProductInfo', {productId});
|
207
|
},
|
211
|
},
|
208
|
activated() {
|
212
|
activated() {
|
209
|
this.$refs.pageScroll && this.$refs.pageScroll.scrollTo(0, 0, 0);
|
213
|
this.$refs.pageScroll && this.$refs.pageScroll.scrollTo(0, 0, 0);
|
210
|
this.loadData(this.productId);
|
214
|
this.loadData(this.productId);
|
|
|
215
|
+ this.refresh();
|
211
|
},
|
216
|
},
|
212
|
beforeRouteUpdate(to, from ,next) {
|
217
|
beforeRouteUpdate(to, from ,next) {
|
213
|
if (this.historyBackGuard() === false) {
|
218
|
if (this.historyBackGuard() === false) {
|
|
@@ -236,7 +241,7 @@ export default { |
|
@@ -236,7 +241,7 @@ export default { |
236
|
return true;
|
241
|
return true;
|
237
|
},
|
242
|
},
|
238
|
refresh() {
|
243
|
refresh() {
|
239
|
- this.$refs.slide.refresh();
|
244
|
+ this.$refs.slide && this.$refs.slide.refresh && this.$refs.slide.refresh();
|
240
|
},
|
245
|
},
|
241
|
sizeImg(src, width = 360, height = 72) {
|
246
|
sizeImg(src, width = 360, height = 72) {
|
242
|
if (src) {
|
247
|
if (src) {
|
|
@@ -312,12 +317,12 @@ export default { |
|
@@ -312,12 +317,12 @@ export default { |
312
|
},
|
317
|
},
|
313
|
|
318
|
|
314
|
// 关闭活动列表
|
319
|
// 关闭活动列表
|
315
|
- onActivitySheetHidden() {
|
320
|
+ onActivitySheetHide() {
|
316
|
this.showActivitySheet = false;
|
321
|
this.showActivitySheet = false;
|
317
|
},
|
322
|
},
|
318
|
|
323
|
|
319
|
// 选择尺寸
|
324
|
// 选择尺寸
|
320
|
- onSizeSelectSheetHidden() {
|
325
|
+ onSizeSelectSheetHide() {
|
321
|
this.showSizeSelectSheet = false;
|
326
|
this.showSizeSelectSheet = false;
|
322
|
},
|
327
|
},
|
323
|
|
328
|
|
|
@@ -424,7 +429,7 @@ export default { |
|
@@ -424,7 +429,7 @@ export default { |
424
|
},
|
429
|
},
|
425
|
|
430
|
|
426
|
// 添加尺寸关闭
|
431
|
// 添加尺寸关闭
|
427
|
- onSizeRequestHidden() {
|
432
|
+ onSizeRequestHide() {
|
428
|
this.showSizeRequestSheet = false;
|
433
|
this.showSizeRequestSheet = false;
|
429
|
},
|
434
|
},
|
430
|
|
435
|
|
|
@@ -434,7 +439,7 @@ export default { |
|
@@ -434,7 +439,7 @@ export default { |
434
|
},
|
439
|
},
|
435
|
|
440
|
|
436
|
// 购买
|
441
|
// 购买
|
437
|
- onBidSheet() {
|
442
|
+ onBidSheetHide() {
|
438
|
this.showBidSheet = false;
|
443
|
this.showBidSheet = false;
|
439
|
},
|
444
|
},
|
440
|
},
|
445
|
},
|
|
@@ -576,7 +581,7 @@ export default { |
|
@@ -576,7 +581,7 @@ export default { |
576
|
flex-direction: column;
|
581
|
flex-direction: column;
|
577
|
justify-content: center;
|
582
|
justify-content: center;
|
578
|
align-items: center;
|
583
|
align-items: center;
|
579
|
- overflow: hidden;
|
584
|
+ overflow: Hide;
|
580
|
|
585
|
|
581
|
div {
|
586
|
div {
|
582
|
font-size: 28px;
|
587
|
font-size: 28px;
|