| @@ -17,8 +17,6 @@ Page({ | |||||
| userInfo: {}, | userInfo: {}, | ||||
| hasUserInfo: false, | hasUserInfo: false, | ||||
| canIUse: wx.canIUse('button.open-type.getUserInfo'), | canIUse: wx.canIUse('button.open-type.getUserInfo'), | ||||
| id: '', | id: '', | ||||
| result: [], | result: [], | ||||
| end_time: '', | end_time: '', | ||||
| @@ -402,7 +400,7 @@ Page({ | |||||
| console.log(options) | console.log(options) | ||||
| var eData = options.target.dataset.id; | var eData = options.target.dataset.id; | ||||
| var couponId = options.target.dataset.couponid; | 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 | // 返回shareObj | ||||
| return shareObj; | return shareObj; | ||||
| @@ -65,6 +65,7 @@ Page({ | |||||
| else { | else { | ||||
| var address = null; | var address = null; | ||||
| } | } | ||||
| console.log(e.detail.value.username) | |||||
| if (e.detail.value.username) { | if (e.detail.value.username) { | ||||
| var username = e.detail.value.username; | var username = e.detail.value.username; | ||||
| } else if (that.data.username) { | } else if (that.data.username) { | ||||
| @@ -136,8 +137,6 @@ Page({ | |||||
| flag: 2 | flag: 2 | ||||
| }); | }); | ||||
| if (options.sex == "1") { | if (options.sex == "1") { | ||||
| console.log(that.data.items); | |||||
| that.data.items[0].checked = true; | |||||
| var checked = 'items[' + 0 + '].checked' | var checked = 'items[' + 0 + '].checked' | ||||
| that.setData({ | that.setData({ | ||||
| [checked]: true | [checked]: true | ||||
| @@ -146,7 +145,6 @@ Page({ | |||||
| flagsex: 1 | flagsex: 1 | ||||
| }) | }) | ||||
| } else if (options.sex == "2") { | } else if (options.sex == "2") { | ||||
| that.data.items[1].checked = true; | |||||
| var checked = 'items[' + 1 + '].checked' | var checked = 'items[' + 1 + '].checked' | ||||
| that.setData({ | that.setData({ | ||||
| [checked]: true | [checked]: true | ||||
| @@ -1,7 +1,7 @@ | |||||
| <form bindsubmit="formSubmit"> | <form bindsubmit="formSubmit"> | ||||
| <view class='section'> | <view class='section'> | ||||
| <text>姓名</text> | <text>姓名</text> | ||||
| <input wx:if="{{username}}" type="text" placeholder='{{username}}'/> | |||||
| <input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}'/> | |||||
| <input wx:if="{{!username}}" type="text" placeholder='请填写名字' disabled/> | <input wx:if="{{!username}}" type="text" placeholder='请填写名字' disabled/> | ||||
| </view> | </view> | ||||
| <view class="section sec"> | <view class="section sec"> | ||||
| @@ -28,6 +28,8 @@ Page({ | |||||
| */ | */ | ||||
| onLoad: function(options) { | onLoad: function(options) { | ||||
| var that = this; | var that = this; | ||||
| console.log(options); | |||||
| console.log("这是options") | |||||
| var scene = decodeURIComponent(options.scene); | var scene = decodeURIComponent(options.scene); | ||||
| that.setData({ | that.setData({ | ||||
| scene:scene | scene:scene | ||||
| @@ -35,7 +37,11 @@ Page({ | |||||
| console.log(that.data.scene) | console.log(that.data.scene) | ||||
| console.log(scene); | console.log(scene); | ||||
| app.getLocation(); | app.getLocation(); | ||||
| that.userLogin(); | |||||
| if (options.couponChannelId && options.couponId){ | |||||
| that.userLogin(options.couponChannelId, options.couponId); | |||||
| }else{ | |||||
| that.userLogin() | |||||
| } | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.getWeapNote, | url: config.api.getWeapNote, | ||||
| data: { | data: { | ||||
| @@ -88,7 +94,7 @@ Page({ | |||||
| /** | /** | ||||
| * 用户登录 | * 用户登录 | ||||
| */ | */ | ||||
| userLogin: function() { | |||||
| userLogin: function (couponChannelId,couponId) { | |||||
| var that = this; | var that = this; | ||||
| // 登录 | // 登录 | ||||
| wx.login({ | wx.login({ | ||||
| @@ -127,6 +133,11 @@ Page({ | |||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| app.globalData.token = res.data.token; | 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){ | if (res.data.token){ | ||||
| that.setData({ | that.setData({ | ||||
| showGame: true | showGame: true | ||||