diff --git a/app.js b/app.js index 6f270c5..c5d9e16 100644 --- a/app.js +++ b/app.js @@ -90,6 +90,7 @@ App({ data: {code: that.globalData.code}, success: function(res) { if (!res.data.token) { + wx.hideToast() wx.showModal({ title: '未登录', content: '请前往 “我的” 页面绑定手机号', diff --git a/pages/show_product/show_product.js b/pages/show_product/show_product.js index f71029b..8aae962 100644 --- a/pages/show_product/show_product.js +++ b/pages/show_product/show_product.js @@ -9,7 +9,8 @@ Page({ windowWidth: 375, windowHeight: 667, pixelRatio: 2, - accountType: '' + accountType: '', + from_share: false }, onShareAppMessage: function () { @@ -41,6 +42,7 @@ Page({ productUtil.getProduct(id, function(result){ var data = app.store.sync(result.data) that.setData({ + from_share: true, id: data.id, product: data, title: data.name @@ -59,6 +61,7 @@ Page({ })[0] this.setData({ + from_share: false, id: id, product: product, title: product.name @@ -117,5 +120,11 @@ Page({ key: 'cartItems', data: cartItems }) + + if (this.data.from_share) { + wx.switchTab({ + url: '../cart/cart' + }) + } } })