| | |
| | |
|
| | | },
|
| | | //update 关注
|
| | | async updateGz(type) {
|
| | | async updateGz(type) { |
| | | if(!this.currentInfo.id){ |
| | | this.$message.showToast('请先登录') |
| | | return |
| | | }
|
| | | this.$message.showLoading()
|
| | | const {
|
| | | code
|
| | |
| | | }
|
| | | if (!item.shopnum) {
|
| | | item.shopnum = 0
|
| | | } |
| | | if (!item.stock) { |
| | | item.stock = 0 |
| | | } |
| | | if (item.shopnum + addnum > item.stock) { |
| | | this.$message.showToast('库存不足,无法添加') |
| | | return |
| | | }
|
| | | if (item.shopnum + addnum >= 0) {
|
| | |
|
| | |
| | | })
|
| | | this.$message.hideLoading()
|
| | | if (code === 0) {
|
| | | item.shopnum += addnum
|
| | | item.shopnum += addnum |
| | | this.$forceUpdate()
|
| | | }
|
| | | this.$forceUpdate()
|
| | | },
|
| | |
|
| | | }
|