You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
project/bd/bd.ts

135 lines
2.5 KiB

// const app = getApp()
Page({
data: {
realName: '',
number: '',
isDisabled: true //表示页面加载完成时disabled为禁用状态
},
onLoad: function(options) {
let number = options.number
let realName = options.realName
this.setData({
number,
realName
})
},
save: function() {
let realName = this.data.realName;
let number=this.data.number
let skey = wx.getStorageSync('skey')
wx.request({
url: 'http://192.168.58.210:81/save',
method: 'GET',
data: {
skey:skey,
number:number,
realName:realName
},
success: function(res :any) {
if (res.data.error == true) {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 2000
})
} else {
wx.showToast({
title: res.data.message,
icon: 'success',
duration: 5000
})
wx.removeStorageSync('info')
wx.navigateBack({
delta: 2
})
}
}
})
},
inputRealName: function(e :any) {
var realName = e.detail.value
this.setData({
realName
})
console.log(realName)
if (realName !== '') {
this.setData({
isDisabled: false
})
} else {
this.setData({
isDisabled: true
})
}
},
inputNumber: function(e :any) {
var number = e.detail.value
this.setData({
number
})
// console.log()
if (number !== '') {
this.setData({
isDisabled: false
})
} else {
this.setData({
isDisabled: true
})
}
},
onReady: function() {
},
/**
* --
*/
onShow: function() {
},
/**
* --
*/
onHide: function() {
},
/**
* --
*/
onUnload: function() {
},
/**
* --
*/
onPullDownRefresh: function() {
},
/**
*
*/
onReachBottom: function() {
},
/**
*
*/
onShareAppMessage: function() {
}
})