From 45ebc09c939956fdf3595eb7a3e457424df72809 Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Mon, 9 Jan 2017 17:02:09 +0800 Subject: [PATCH] =?UTF-8?q?from=5Fshare=20=E5=8A=A0=E5=85=A5=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E8=A6=81=E8=B7=B3=E8=BD=AC=E5=88=B0=20cart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + pages/show_product/show_product.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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' + }) + } } })