Commit a2ff24f9434f5fd033fc487a9a2088cc2a921c75
1 parent
081c50da0c
Exists in
master
修改未选择使用人不提示的问题
Showing
1 changed file
with
42 additions
and
31 deletions
Show diff stats
src/components/BottomSheet/BottomSheet.vue
| ... | ... | @@ -493,35 +493,45 @@ import store from '@/store' |
| 493 | 493 | }, |
| 494 | 494 | updateMylove(){ |
| 495 | 495 | const loveItem = this.loveList[this.loveCurrent] |
| 496 | - const glassWidth = this.glassInfo.glassWidth | |
| 497 | - const norseWidth = this.glassInfo.norseWidth | |
| 498 | - const legWidth = this.glassInfo.legWidth | |
| 499 | - if(loveItem.glassWidth !== glassWidth){ | |
| 500 | - store.dispatch('myLoveList/updateMylove', { | |
| 501 | - uid: this.$store.state.user.userInfo.uid, | |
| 502 | - openid: this.$store.state.user.userInfo.openid, | |
| 503 | - mp_id: this.mp_id, | |
| 504 | - keyname: 'glassWidth', | |
| 505 | - keyvalue: glassWidth | |
| 506 | - }); | |
| 507 | - } | |
| 508 | - if(loveItem.norseWidth !== norseWidth){ | |
| 509 | - store.dispatch('myLoveList/updateMylove', { | |
| 510 | - uid: this.$store.state.user.userInfo.uid, | |
| 511 | - openid: this.$store.state.user.userInfo.openid, | |
| 512 | - mp_id: this.mp_id, | |
| 513 | - keyname: 'norseWidth', | |
| 514 | - keyvalue: norseWidth | |
| 515 | - }); | |
| 516 | - } | |
| 517 | - if(loveItem.legWidth !== legWidth){ | |
| 518 | - store.dispatch('myLoveList/updateMylove', { | |
| 519 | - uid: this.$store.state.user.userInfo.uid, | |
| 520 | - openid: this.$store.state.user.userInfo.openid, | |
| 521 | - mp_id: this.mp_id, | |
| 522 | - keyname: 'legWidth', | |
| 523 | - keyvalue: legWidth | |
| 524 | - }); | |
| 496 | + // console.log(this.loveList) | |
| 497 | + // console.log(this.loveCurrent) | |
| 498 | + // console.log(loveItem) | |
| 499 | + if(loveItem != undefined){ | |
| 500 | + const glassWidth = this.glassInfo.glassWidth | |
| 501 | + const norseWidth = this.glassInfo.norseWidth | |
| 502 | + const legWidth = this.glassInfo.legWidth | |
| 503 | + if(loveItem.glassWidth !== glassWidth){ | |
| 504 | + store.dispatch('myLoveList/updateMylove', { | |
| 505 | + uid: this.$store.state.user.userInfo.uid, | |
| 506 | + openid: this.$store.state.user.userInfo.openid, | |
| 507 | + mp_id: this.mp_id, | |
| 508 | + keyname: 'glassWidth', | |
| 509 | + keyvalue: glassWidth | |
| 510 | + }); | |
| 511 | + } | |
| 512 | + if(loveItem.norseWidth !== norseWidth){ | |
| 513 | + store.dispatch('myLoveList/updateMylove', { | |
| 514 | + uid: this.$store.state.user.userInfo.uid, | |
| 515 | + openid: this.$store.state.user.userInfo.openid, | |
| 516 | + mp_id: this.mp_id, | |
| 517 | + keyname: 'norseWidth', | |
| 518 | + keyvalue: norseWidth | |
| 519 | + }); | |
| 520 | + } | |
| 521 | + if(loveItem.legWidth !== legWidth){ | |
| 522 | + store.dispatch('myLoveList/updateMylove', { | |
| 523 | + uid: this.$store.state.user.userInfo.uid, | |
| 524 | + openid: this.$store.state.user.userInfo.openid, | |
| 525 | + mp_id: this.mp_id, | |
| 526 | + keyname: 'legWidth', | |
| 527 | + keyvalue: legWidth | |
| 528 | + }); | |
| 529 | + } | |
| 530 | + }else{ | |
| 531 | + uni.showToast({ | |
| 532 | + title:'请选择使用人', | |
| 533 | + icon:'none' | |
| 534 | + }) | |
| 525 | 535 | } |
| 526 | 536 | }, |
| 527 | 537 | glassInfoInput(e,type){ |
| ... | ... | @@ -564,8 +574,9 @@ import store from '@/store' |
| 564 | 574 | }, |
| 565 | 575 | addCart(){ |
| 566 | 576 | this.checkGlassInfo() |
| 567 | - if(this.glassInfoRight){ | |
| 568 | - this.updateMylove() | |
| 577 | + // console.log(this.glassInfoRight) | |
| 578 | + this.updateMylove() | |
| 579 | + if(this.glassInfoRight&&this.mp_id!==''){ | |
| 569 | 580 | const that = this |
| 570 | 581 | const checkedSKUName = [that.goodInfo.attrList[0].meta_name,that.goodInfo.attrList[1].meta_name] |
| 571 | 582 | const checkedSKU = [] | ... | ... |