Browse Source

[授权][修改]:[点击兑换授权手机号]

tags/福建版C.9.1.08欢乐城
meo 5 years ago
parent
commit
36f9c05343
3 changed files with 34 additions and 6 deletions
  1. +18
    -4
      pages/exchange/exchange.js
  2. +1
    -1
      pages/exchange/exchange.wxml
  3. +15
    -1
      pages/getphoneInfo/index.js

+ 18
- 4
pages/exchange/exchange.js View File

@@ -9,7 +9,15 @@ Page({
* 页面的初始数据
*/
data: {
navigationBarHeight
navigationBarHeight,
exchange:""
},
onLoad(options){
if (options&&options.exchange){
this.setData({
exchange: options.exchange
})
}
},
// 兑换
exchange(e){
@@ -24,7 +32,7 @@ Page({
})
return;
}
that.checkPhoneStatus(e.detail.value.code,formId = e.detail.formId);
that.checkPhoneStatus(e.detail.value.code,e.detail.formId);
},
checkPhoneStatus: function (password, formId) {
let that = this;
@@ -42,7 +50,7 @@ Page({
*
*/
wx.redirectTo({
url: "/pages/getphoneInfo/index",
url: `/pages/getphoneInfo/index?exchange=${password}`,
})
} else {
wx.showToast({
@@ -55,10 +63,16 @@ Page({
},
getCouponOrderByPassword(password, formId) {
let that = this;
let passwords;
if(that.data.exchange){
passwords = that.data.exchange
}else{
passwords = password
}
Http.post({
url: config.api.getCouponOrderByPassword,
data: {
password: password,
password: passwords,
formId: formId
}
})


+ 1
- 1
pages/exchange/exchange.wxml View File

@@ -1,7 +1,7 @@
<navbar text="兑换" home back background='#FD832D' color="white"></navbar>
<form bindsubmit='exchange' report-submit='true'>
<view class="section" style="padding-top:{{navigationBarHeight}};">
<input name='code'placeholder="请输入兑换码" clearable/>
<input name='code' value="{{exchange}}" placeholder="请输入兑换码" clearable/>
<button size="{{primarySize}}" style="background:#FD832D;color:#fff;" hover-class="opcaity" form-type="submit">兑换</button>
</view>
</form>


+ 15
- 1
pages/getphoneInfo/index.js View File

@@ -25,7 +25,11 @@ Page({
couponChannelId: options.couponChannelId
});
}

if (options && options.exchange) {
that.setData({
exchange: options.exchange
});
}
if (options && options.mineFlag) {
that.setData({
mineFlag: options.mineFlag
@@ -123,6 +127,16 @@ Page({
wx.switchTab({
url: '/index/user'
});
}
// 兑换
else if (that.data.exchange) {
wx.redirectTo({
url: `/pages/exchange/exchange?exchange=${that.data.exchange}`
})
} else if (that.data.mineFlag == 'mine') {
wx.switchTab({
url: '/index/user'
});
} else {
wx.showToast({
title: res.data.msg,


Loading…
Cancel
Save