// pages/order_details/order_details.js Page({ /** * 页面的初始数据 */ data: { tuikuan: '退 款', }, async onClickRefund(e) { if(this.data.tuikuan == "已退款"){ return } let res = await wx.showModal({ title: '确认退款', }) console.log(res) if (res.cancel) return; wx.showToast({ title: '退款成功', icon: 'success' }) this.setData({ tuikuan: '已退款' }) }, changValue() { if(onClickRefund(e)){ this.setData({ tuikuan: '已退款' }) } }, // // // }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { wx.setNavigationBarTitle({ title: '订单详情' }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, })