// pages/welfareMall/refund/refund.js import WelfareMall from '../../../api/welfareMall' import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user' Page({ /** * 页面的初始数据 */ data: { orderSn: '', orderStatus: null, orderDetail: null, }, getModal() { wx.showModal({ title: '退款说明', content: '福利社优惠券退款说明,福利社优惠券退款说明,福利社优惠券退款说明,福利社优惠券退款说明,福利社优惠券退款说明,福利社优惠券退款说明', showCancel: false,//是否显示取消按钮 cancelText:"否",//默认是“取消” cancelColor:'skyblue',//取消文字的颜色 confirmText:"我知道了",//默认是“确定” confirmColor: 'black',//确定文字的颜色 success: res => {if (res.cancel) { //点击取消,默认隐藏弹框 } else { //点击确定 } }, fail: function (res) { },//接口调用失败的回调函数 }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var that = this; that.orderSn = options.orderSn; this.setData({ orderSn: options.orderSn, }) this.getRefundOrderStatus(that.orderSn); this.getOrder(that.orderSn); this.data.orderSn = options.orderSn; }, /** * 获取订单的退款单状态 */ getRefundOrderStatus: function(data) { WelfareMall.getRefundOrderStatus({ mobile: getMobileCache(), orderSn: data, }).then(res => { if (res.code == 200) { this.userOrderStatusView(res.data) } }).catch(err => { console.log(err) }) }, userOrderStatusView: function(data) { if (!data) { console.log("订单状态详情数据为空"); return } //对象转换 this.data.orderStatus = data this.setData({ mobileTop:getMobileCache(), orderStatus: this.data.orderStatus }) }, /** * * 订单数据 */ getOrder: function(data) { WelfareMall.getOrder({ mobile: getMobileCache(), orderSn: data, }).then(res => { if (res.code == 200) { this.userOrderistView(res.data) } this.data.lock = false }).catch(_ => { console.log(_) this.data.lock = false }) }, userOrderistView: function(data) { if (!data) { console.log("订单详情数据为空"); return } //对象转换 this.data.orderDetail = data this.setData({ mobileTop:getMobileCache(), orderDetail: this.data.orderDetail }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })