C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
752 B

  1. let Common = require('../../../common/common.js')
  2. var app = getApp()
  3. Page({
  4. data: {
  5. list:{},
  6. couponId:null
  7. },
  8. onLoad(e) {
  9. console.log(e.id)
  10. Common.getCouponDetail(e.id)
  11. .then(res =>{
  12. console.log(res)
  13. this.setData({
  14. list: res.data.data,
  15. couponId: e.id
  16. })
  17. })
  18. },
  19. aaa(){
  20. wx.showLoading({
  21. title: '加载中...',
  22. })
  23. Common.orderSave(''+this.data.couponId)
  24. .then(res => {
  25. wx.hideLoading();
  26. console.log(res)
  27. if (res.data.code == 200) {
  28. wx.showToast({
  29. title: '购买成功',
  30. })
  31. wx.navigateBack({
  32. delta: 2
  33. })
  34. setTimeout(() => {
  35. wx.hideToast();
  36. }, 2000)
  37. }
  38. })
  39. }
  40. })