Commit 006e965473afaea3f2de6ccab1e84b768c74f29e
1 parent
b83c44fe1f
Exists in
master
详情添加购物车
Showing
1 changed file
with
9 additions
and
17 deletions
Show diff stats
src/pages/frameDetail/frameDetail.vue
... | ... | @@ -302,7 +302,6 @@ |
302 | 302 | </block> --> |
303 | 303 | </view> |
304 | 304 | </view> |
305 | - | |
306 | 305 | <!-- 底部菜单 --> |
307 | 306 | <view class="botton"> |
308 | 307 | <view |
... | ... | @@ -336,7 +335,8 @@ export default { |
336 | 335 | pid: 0, |
337 | 336 | // 购物车数据 |
338 | 337 | addCartList: { |
339 | - mp_id: 335, | |
338 | + mp_id: 0, | |
339 | + uid: 0, | |
340 | 340 | sk_id: 0, |
341 | 341 | num: 1, |
342 | 342 | price: '' |
... | ... | @@ -394,10 +394,15 @@ export default { |
394 | 394 | this.parameter[4].slength = `${this.goodInfo.leg_long}mm` |
395 | 395 | this.parameter[5].slength = `${this.goodInfo.weight}mm` |
396 | 396 | this.tag = this.goodInfo.tag |
397 | - this.addCartList.price = this.goodInfo.p_sale_price | |
398 | 397 | this.test = this.goodInfo.prodIntro1 |
399 | 398 | this.test = this.test.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ') |
399 | + // addCart | |
400 | + this.addCartList.price = this.goodInfo.p_sale_price | |
401 | + this.addCartList.sk_id = this.goodInfo.skuList[0].sk_id | |
402 | + this.addCartList.mp_id = this.goodInfo.glassData.mp_id | |
403 | + this.addCartList.uid = this.$store.state.user.userInfo.uid | |
400 | 404 | }) |
405 | + // console.log(this.$store.state.user.userInfo.uid + 'ssss') | |
401 | 406 | }, |
402 | 407 | computed: { |
403 | 408 | updateGoodType () { |
... | ... | @@ -427,8 +432,7 @@ export default { |
427 | 432 | sk_id: this.addCartList.sk_id, |
428 | 433 | num: this.addCartList.num, |
429 | 434 | pid: this.pid, |
430 | - price: this.addCartList.price, | |
431 | - checkedSKU: {} | |
435 | + price: this.addCartList.price | |
432 | 436 | }) |
433 | 437 | store.dispatch('cart/getCartList', { |
434 | 438 | uid: this.$store.state.user.userInfo.uid // 用户id |
... | ... | @@ -473,18 +477,6 @@ export default { |
473 | 477 | // break |
474 | 478 | // } |
475 | 479 | }, |
476 | - // 加入购物车 | |
477 | - addCart () { | |
478 | - store.dispatch('cart/addCart', { | |
479 | - uid: this.$store.state.user.userInfo.uid, | |
480 | - openid: this.$store.state.user.userInfo.openid, | |
481 | - pid: this.pid, | |
482 | - checkedSKU: {} | |
483 | - }) | |
484 | - store.dispatch('cart/getCartList', { | |
485 | - uid: this.$store.state.user.userInfo.uid // 用户id | |
486 | - }) | |
487 | - }, | |
488 | 480 | tabChange (e) { |
489 | 481 | if (this.current !== e) { |
490 | 482 | this.current = e | ... | ... |