|
- let Http = require('../../../utils/http.js')
- var app = getApp()
- Page({
- data: {
- list:{},
- cuponId:null
- },
- onLoad(e) {
- console.log(e.id)
- Http.getResquest('/wxCoupon/findById','加载中',{
- id: e.id
- },(res)=>{
- console.log(res)
- this.setData({
- list: res.data,
- cuponId:e.id
- })
- })
- },
- aaa(){
- Http.postResquest('/wxOrder/save', '加载中', {
- couponId: this.data.cuponId,
- openId: app.globalData.openId
- }, (res) => {
- console.log(res)
- if (res.code == 200) {
- wx.showToast({
- title: '购买成功',
- })
- wx.navigateBack({
- delta: 2
- })
- }
- })
- }
- })
|