From 70eec5b1f85967c5f6d87310102e0655bb45b3c1 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Wed, 17 Oct 2018 19:02:19 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=88=86=E4=BA=AB=EF=BC=8C=E7=BC=96=E8=BE=91]?= =?UTF-8?q?[=E4=BF=AE=E6=94=B9]:=E4=BF=AE=E6=94=B9=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/coupon/detail/index.js | 4 +--- pages/edit/edit.js | 4 +--- pages/edit/edit.wxml | 2 +- pages/index/index.js | 15 +++++++++++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index edf811f..371ac17 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -17,8 +17,6 @@ Page({ userInfo: {}, hasUserInfo: false, canIUse: wx.canIUse('button.open-type.getUserInfo'), - - id: '', result: [], end_time: '', @@ -402,7 +400,7 @@ Page({ console.log(options) var eData = options.target.dataset.id; var couponId = options.target.dataset.couponid; - shareObj.path = `/pages/coupon/detail/index?couponChannelId=${eData}&couponId=${couponId}`; + shareObj.path = `/pages/index/index?couponChannelId=${eData}&couponId=${couponId}`; } // 返回shareObj return shareObj; diff --git a/pages/edit/edit.js b/pages/edit/edit.js index c13db5c..7e86e21 100644 --- a/pages/edit/edit.js +++ b/pages/edit/edit.js @@ -65,6 +65,7 @@ Page({ else { var address = null; } + console.log(e.detail.value.username) if (e.detail.value.username) { var username = e.detail.value.username; } else if (that.data.username) { @@ -136,8 +137,6 @@ Page({ flag: 2 }); if (options.sex == "1") { - console.log(that.data.items); - that.data.items[0].checked = true; var checked = 'items[' + 0 + '].checked' that.setData({ [checked]: true @@ -146,7 +145,6 @@ Page({ flagsex: 1 }) } else if (options.sex == "2") { - that.data.items[1].checked = true; var checked = 'items[' + 1 + '].checked' that.setData({ [checked]: true diff --git a/pages/edit/edit.wxml b/pages/edit/edit.wxml index c4ed0fa..952c31f 100644 --- a/pages/edit/edit.wxml +++ b/pages/edit/edit.wxml @@ -1,7 +1,7 @@
姓名 - + diff --git a/pages/index/index.js b/pages/index/index.js index 529c16a..17913f1 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -28,6 +28,8 @@ Page({ */ onLoad: function(options) { var that = this; + console.log(options); + console.log("这是options") var scene = decodeURIComponent(options.scene); that.setData({ scene:scene @@ -35,7 +37,11 @@ Page({ console.log(that.data.scene) console.log(scene); app.getLocation(); - that.userLogin(); + if (options.couponChannelId && options.couponId){ + that.userLogin(options.couponChannelId, options.couponId); + }else{ + that.userLogin() + } Http.get({ url: config.api.getWeapNote, data: { @@ -88,7 +94,7 @@ Page({ /** * 用户登录 */ - userLogin: function() { + userLogin: function (couponChannelId,couponId) { var that = this; // 登录 wx.login({ @@ -127,6 +133,11 @@ Page({ }) .then(res => { app.globalData.token = res.data.token; + if (res.data.token && couponChannelId && couponId){ + wx.navigateTo({ + url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, + }) + } if (res.data.token){ that.setData({ showGame: true