|
|
@@ -14,9 +14,24 @@ Page({ |
|
|
|
coupon_name: '', //优惠券名称 |
|
|
|
couponTime: '', //优惠券购买时间 |
|
|
|
code_num: '', //核销短信验证码 |
|
|
|
couponCode:'',//券号 |
|
|
|
couponType:'',//券类型 |
|
|
|
duration:'',//券期间 |
|
|
|
couponCode: '', //券号 |
|
|
|
couponType: '', //券类型 |
|
|
|
duration: '', //券期间 |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 核销数修改 |
|
|
|
*/ |
|
|
|
changeNums(event) { |
|
|
|
var nums |
|
|
|
if (event.detail.value > this.data.totalNums) { |
|
|
|
nums = this.data.totalNums |
|
|
|
} |
|
|
|
if (event.detail.value < 1) { |
|
|
|
nums = 1 |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
nums: nums |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 验证码修改 |
|
|
@@ -34,13 +49,13 @@ Page({ |
|
|
|
return |
|
|
|
} |
|
|
|
var data; |
|
|
|
if (this.data.type==1){//券核销 |
|
|
|
if (this.data.type == 1) { //券核销 |
|
|
|
data = { |
|
|
|
check_type: 1, |
|
|
|
coupon_code: this.data.couponCode, |
|
|
|
check_num: 1 |
|
|
|
} |
|
|
|
}else{//手机号核销 |
|
|
|
} else { //手机号核销 |
|
|
|
if (this.data.code_num.length != 6) { |
|
|
|
wx.showToast({ |
|
|
|
title: '验证码错误', |
|
|
@@ -62,12 +77,12 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
state: 1 |
|
|
|
}) |
|
|
|
var that=this; |
|
|
|
var that = this; |
|
|
|
app.requestPost('couponbuy/check', data, res => { |
|
|
|
var state; |
|
|
|
if (res.code == 200) { |
|
|
|
state = 2; |
|
|
|
if (that.data.type == 2) {//手机号核销 |
|
|
|
if (that.data.type == 2) { //手机号核销 |
|
|
|
wx.switchTab({ |
|
|
|
url: '../record/record' |
|
|
|
}) |
|
|
@@ -108,7 +123,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 返回核销大厅 |
|
|
|
*/ |
|
|
|
goHome(){ |
|
|
|
goHome() { |
|
|
|
wx.switchTab({ |
|
|
|
url: '../home/home' |
|
|
|
}) |
|
|
@@ -125,7 +140,7 @@ Page({ |
|
|
|
if (code) { //券码查询 |
|
|
|
this.setData({ |
|
|
|
type: 1, |
|
|
|
couponCode:code, |
|
|
|
couponCode: code, |
|
|
|
coupon_name: couponData.coupon_name, |
|
|
|
couponTime: couponData.buy_date, |
|
|
|
couponType: couponData.coupon_type, |
|
|
@@ -143,9 +158,10 @@ Page({ |
|
|
|
/** |
|
|
|
* 发送验证码 |
|
|
|
*/ |
|
|
|
app.requestGet('couponbuy/check/smscode', { user_phone: pohone},res=>{ |
|
|
|
if(res.code==200){ |
|
|
|
}else{ |
|
|
|
app.requestGet('couponbuy/check/smscode', { |
|
|
|
user_phone: pohone |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) {} else { |
|
|
|
wx.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'none', |