Skip to content

Commit

Permalink
购物车数量1->0 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
woniudiancang committed Oct 9, 2020
1 parent 15ed72b commit 12d6b68
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ QQ群:926321567
| :------: | :------: | :------: | :------: |
| <img src="https://dcdn.it120.cc/2020/10/08/f7d15bc6-c366-4688-92f4-62183d87c898.png" width="200px"> | <img src="https://dcdn.it120.cc/2020/10/08/31c7fd0c-4cbe-4702-b318-02eccbc1d41f.png" width="190px"> | <img src="https://dcdn.it120.cc/2020/10/08/2ebad9a2-39d1-4c3b-8f9d-a64628e1dd86.png" width="190px"> | <img src="https://dcdn.it120.cc/2020/10/08/f935fb79-7565-41ee-a2b4-5c9a50348479.png" width="190px">

| 待确认 | 共享购物车 | 查看已点 |
| 待确认 | 已下厨 | 已上菜 |
| :------: | :------: | :------: |
| <img src="https://dcdn.it120.cc/2020/10/09/21a75f2c-75c2-495b-bdbf-505e75b516ce.png" width="200px"> | <img src="https://dcdn.it120.cc/2020/10/09/b1277a38-044b-433d-92b3-8ecf8f433769.png" width="190px"> | <img src="https://dcdn.it120.cc/2020/10/09/3fb83702-8093-4530-ac28-95ba912a7cff.png" width="190px">

Expand Down
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
version: "3.1.0",
note: '扫码点餐,增加菜品状态:待确认、已下厨、已上菜',
version: "3.1.1",
note: '购物车数量1->0 bug',
subDomain: "beeorder", // 根据教程 https://www.it120.cc/help/qr6l4m.html 查看并设置你自己的 subDomain
}
26 changes: 21 additions & 5 deletions pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ Page({
},
async shippingCarInfo() {
const res = await WXAPI.shippingCarInfo(wx.getStorageSync('token'))
if (res.code == 700) {
this.setData({
shippingCarInfo: null,
showCartPop: false
})
return
}
if (res.code == 0) {
this.setData({
shippingCarInfo: res.data
Expand Down Expand Up @@ -457,14 +464,23 @@ Page({
})
const res = await WXAPI.shippingCarInfoRemoveItem(token, item.key)
wx.hideLoading()
if (res.code != 0) {
wx.showToast({
title: res.msg,
icon: 'none'
if (res.code == 700) {
this.setData({
shippingCarInfo: null,
showCartPop: false
})
return
}
this.shippingCarInfo()
if (res.code == 0) {
this.setData({
shippingCarInfo: res.data
})
} else {
this.setData({
shippingCarInfo: null,
showCartPop: false
})
}
} else {
// 修改数量
wx.showLoading({
Expand Down

0 comments on commit 12d6b68

Please sign in to comment.