Page({ /** * 页面的初始数据 */ data: { items:[ { name: "6", value: "0.01", select: 0}, { name: "12", value: "0.02", select: 1}, { name: "25", value: "0.03", select: 2}, { name: "50", value: "0.04", select: 3}, { name: "100", value: "0.05", select: 4} ], selectStyle:"", inputVal:"", rechargeAmount:"", disabled:false }, radioChange: function (e) { //console.log(e) this.setData({ selectStyle:e.detail.value, rechargeAmount: e.detail.value, inputVal:"" }) }, inputFocus:function(e){ this.setData({ selectStyle:"input" }) }, inputBlur:function(e){ this.setData({ rechargeAmount: e.detail.value }) }, switchChange:function(e){ if (e.detail.value === true){ this.setData({ disabled: false }) } else if (e.detail.value === false){ this.setData({ disabled: true }) } //console.log(e.detail.value) }, onRecharge:function(e){ if (this.data.rechargeAmount){ //console.log(this.data.rechargeAmount) }else{ //console.log() } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { } })