let Common = require('../../../common/common.js') var app = getApp() Page({ data: { list:{}, couponId:null }, onLoad(e) { console.log(e.id) Common.getCouponDetail(e.id) .then(res =>{ console.log(res) this.setData({ list: res.data.data, couponId: e.id }) }) }, aaa(){ wx.showLoading({ title: '加载中...', }) console.log(this.data.couponId) Common.orderSave(''+this.data.couponId) .then(res => { wx.hideLoading(); console.log(res) if (res.data.code == 200) { wx.showToast({ title: '购买成功', }) wx.navigateBack({ delta: 2 }) setTimeout(() => { wx.hideToast(); }, 2000) } }) } })