Ver Fonte

submitGoods toast

andy há 1 ano atrás
pai
commit
86f206c563
1 ficheiros alterados com 13 adições e 0 exclusões
  1. 13 0
      pages/shoppingMall/shoppingMall.vue

+ 13 - 0
pages/shoppingMall/shoppingMall.vue

@@ -41,6 +41,19 @@ export default {
             console.log('用户点击确定')
             submitGoods({ id: goods.id }).then((res) => {
               console.log(res)
+              if (res.errno === 0) {
+                wx.showToast({
+                  title: '兑换成功',
+                  icon: 'success',
+                  duration: 2000,
+                })
+              } else {
+                // wx.showToast({
+                //   title: res.msg,
+                //   icon: 'none',
+                //   duration: 2000,
+                // })
+              }
             })
           } else if (res.cancel) {
             console.log('用户点击取消')