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.

41 lines
788 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. console.log(this.data.couponId)
  24. Common.orderSave(''+this.data.couponId)
  25. .then(res => {
  26. wx.hideLoading();
  27. console.log(res)
  28. if (res.data.code == 200) {
  29. wx.showToast({
  30. title: '购买成功',
  31. })
  32. wx.navigateBack({
  33. delta: 2
  34. })
  35. setTimeout(() => {
  36. wx.hideToast();
  37. }, 2000)
  38. }
  39. })
  40. }
  41. })