小程序之激活码

原文地址为: 小程序之激活码

wxml:

< view class= "receive-btn" bindtap= "modalinput" >激活 view >
< modal hidden= "{{hiddenmodalput}}" title= "请输激活码" confirm-text= "提交" cancel-text= "取消" bindcancel= "cancel" bindconfirm= "confirm">
< input bindinput= "bindactivationcode" type= 'text' placeholder= "请输入内容" / >
modal >

js:

Page({
data: {
hiddenmodalput: true,
activationcode: '',
},

// 输入激活码
modalinput: function(e) {
this.setData({
hiddenmodalput: ! this.data.hiddenmodalput
})
},
//取消按钮
cancel: function() {
this.setData({
hiddenmodalput: true
});
},
// 获取激活码
bindactivationcode: function(e) {
this.setData({
activationcode: e.detail.value
})
},
//确认
confirm: function(e) {
var that = this
util.ly_request({
url: '/person/person/activation', //接口
method: 'post',
data: {
vipcode: that.data.activationcode,
},
success: function(res) {
var data = res.data;
if (data.status == '1') {
wx.showToast({
title: data.info,
icon: 'success',
duration: 1000
});
} else {
wx.showModal({
title: '提示',
content: data.info,
success: function(res) {}
});
}
}
})
this.setData({
hiddenmodalput: true
})
}



})


转载请注明本文地址: 小程序之激活码

你可能感兴趣的:(小程序之激活码)