wuwenjie 5 anni fa
parent
commit
aa6a08409f
3 ha cambiato i file con 37 aggiunte e 13 eliminazioni
  1. +28
    -12
      pages/coupon/coupon.js
  2. +2
    -1
      pages/coupon/coupon.wxml
  3. +7
    -0
      pages/coupon/coupon.wxss

+ 28
- 12
pages/coupon/coupon.js Vedi File

@@ -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',

+ 2
- 1
pages/coupon/coupon.wxml Vedi File

@@ -41,7 +41,8 @@
<input placeholder="输入短信验证码" placeholder-style="color:#FFFFFF;font-size:30rpx;" value="{{code_num}}" bindinput="changeCode"></input>
<view class="countBox">
<text>核销</text>
<view class="countContent">{{nums}}
<view class="countContent">
<input type="number" value="{{nums}}" bindinput="changeNums"></input>
<image class="symbolBox" src="../../static/coupon/symbolLeft.png" style="left:-5rpx;" bindtap="reduceCoupon"></image>
<image class="symbolBox" src="../../static/coupon/symbolRight.png" style="right:-5rpx;" bindtap="addCoupon"></image>
</view>

+ 7
- 0
pages/coupon/coupon.wxss Vedi File

@@ -222,6 +222,13 @@
display: inline-block;
margin-left: 25rpx;
}
#vCodeBox>.countBox>.countContent>input{
position: relative;
width: 100%;
height: 100%;
text-align: center;
line-height: 44rpx;
}
#vCodeBox>.countBox>.countContent>.symbolBox{
position: absolute;
text-align: center;

Loading…
Annulla
Salva