// pages/returnofdetail/returnofdetail.js const app = getApp(); const api = require('../../api/api'); Page({ /** * 页面的初始数据 */ data: { navbarData: { showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 title: '退款详情', //导航栏 中间的标题, capsuleMode: 'navBack', //显示模式(navBack:返回上一页;navHome:返回首页) }, id: 0, //订单id billdata: {} }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ id: Number(options.id) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { let that = this; wx.showLoading({ title: '加载中', mask: true }) wx.request({ url: api.ReturnGoods_info, header: { 'Authorization': wx.getStorageSync('token') }, data: { id: that.data.id }, method: 'POST', success(res) { console.log(res); if (res.data.code === 1) { that.setData({ billdata: res.data.data }) } else { wx.showToast({ title: res.data.msg, mask: true, icon: 'none' }) } }, fail(err) { wx.showToast({ title: '发起网络请求失败', icon: 'none', mask: true }) }, complete() { wx.hideLoading() } }) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, // 拨打电话 callTuanYuan() { wx.makePhoneCall({ phoneNumber: this.data.billdata.phone }) }, // 复制编号 fuzhi() { wx.setClipboardData({ data: '1123580', }) }, })