// pages/to-pay-order/index.js let app = getApp() Page({ /** * 页面的初始数据 */ data: { goodsList: [], allGoodsAndYunPrice: 0, name: '', tel: '', zuowei: '', remark: '', oid:'', imgurl: app.data.resturl, state:'', psinfo:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ oid:options.id }) }, /** * 生命周期函数--监听页面显示 */ onShow: function () { this.showDetail() }, back(){ wx.navigateBack(); }, showDetail() { let that = this let oid = that.data.oid wx.request({ url: app.data.resturl + '/odetail.action', method: 'post', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { oid: oid }, success: function (res) { that.setData({ goodsList: res.data.items, name: res.data.order.name, tel:res.data.order.tel, zuowei: res.data.order.zuowei, remark: res.data.order.remark, allGoodsAndYunPrice: res.data.order.sjfk, state: res.data.order.orderZhuangtai }) } }) }, comment: function (e) { let that = this let url = e.currentTarget.dataset.url wx.navigateTo({ url: url, }) } })