Parcourir la source

更新

master
wuwenjie il y a 5 ans
Parent
révision
aa6a08409f
3 fichiers modifiés avec 37 ajouts et 13 suppressions
  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 Voir le fichier

coupon_name: '', //优惠券名称 coupon_name: '', //优惠券名称
couponTime: '', //优惠券购买时间 couponTime: '', //优惠券购买时间
code_num: '', //核销短信验证码 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
})
}, },
/** /**
* 验证码修改 * 验证码修改
return return
} }
var data; var data;
if (this.data.type==1){//券核销
if (this.data.type == 1) { //券核销
data = { data = {
check_type: 1, check_type: 1,
coupon_code: this.data.couponCode, coupon_code: this.data.couponCode,
check_num: 1 check_num: 1
} }
}else{//手机号核销
} else { //手机号核销
if (this.data.code_num.length != 6) { if (this.data.code_num.length != 6) {
wx.showToast({ wx.showToast({
title: '验证码错误', title: '验证码错误',
this.setData({ this.setData({
state: 1 state: 1
}) })
var that=this;
var that = this;
app.requestPost('couponbuy/check', data, res => { app.requestPost('couponbuy/check', data, res => {
var state; var state;
if (res.code == 200) { if (res.code == 200) {
state = 2; state = 2;
if (that.data.type == 2) {//手机号核销
if (that.data.type == 2) { //手机号核销
wx.switchTab({ wx.switchTab({
url: '../record/record' url: '../record/record'
}) })
/** /**
* 返回核销大厅 * 返回核销大厅
*/ */
goHome(){
goHome() {
wx.switchTab({ wx.switchTab({
url: '../home/home' url: '../home/home'
}) })
if (code) { //券码查询 if (code) { //券码查询
this.setData({ this.setData({
type: 1, type: 1,
couponCode:code,
couponCode: code,
coupon_name: couponData.coupon_name, coupon_name: couponData.coupon_name,
couponTime: couponData.buy_date, couponTime: couponData.buy_date,
couponType: couponData.coupon_type, couponType: couponData.coupon_type,
/** /**
* 发送验证码 * 发送验证码
*/ */
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({ wx.showToast({
title: res.message, title: res.message,
icon: 'none', icon: 'none',

+ 2
- 1
pages/coupon/coupon.wxml Voir le fichier

<input placeholder="输入短信验证码" placeholder-style="color:#FFFFFF;font-size:30rpx;" value="{{code_num}}" bindinput="changeCode"></input> <input placeholder="输入短信验证码" placeholder-style="color:#FFFFFF;font-size:30rpx;" value="{{code_num}}" bindinput="changeCode"></input>
<view class="countBox"> <view class="countBox">
<text>核销</text> <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/symbolLeft.png" style="left:-5rpx;" bindtap="reduceCoupon"></image>
<image class="symbolBox" src="../../static/coupon/symbolRight.png" style="right:-5rpx;" bindtap="addCoupon"></image> <image class="symbolBox" src="../../static/coupon/symbolRight.png" style="right:-5rpx;" bindtap="addCoupon"></image>
</view> </view>

+ 7
- 0
pages/coupon/coupon.wxss Voir le fichier

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

Chargement…
Annuler
Enregistrer