C端小程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

64 строки
1.6 KiB

  1. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  2. const util = require("../../../utils/util");
  3. const config = require("../../../config/config.js");
  4. const Http = require("../../../utils/HttpBasics");
  5. //券详情页面
  6. Page({
  7. data: {
  8. navigationBarHeight,
  9. data: {},
  10. createDate: "",
  11. expiredTime: "",
  12. updateDate: "",
  13. //存储计时器
  14. setInter: "",
  15. showPage:false
  16. },
  17. onUnload: function () {
  18. let that = this;
  19. clearInterval(that.data.setInter);
  20. },
  21. onHide: function () {
  22. let that = this;
  23. clearInterval(that.data.setInter);
  24. },
  25. onLoad: function (options) {
  26. let that = this;
  27. console.log(options.quancode)
  28. Http.get({
  29. url: config.api.couponOrderDetail,
  30. data: {
  31. couponOrderId: options.quancode
  32. }
  33. }).then(res => {
  34. that.setData({
  35. data: res.data,
  36. showPage:true
  37. });
  38. that.setData({
  39. expiredTime: util.fmtDate(that.data.data.expiredTime),
  40. updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
  41. createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss")
  42. });
  43. // util.barcode("barcode", options.quancode, 510, 100);
  44. util.qrcode("qrcode", options.quancode, 350, 350);
  45. })
  46. .catch(err => {
  47. wx.showToast({
  48. title: err.errMsg,
  49. icon: 'none',
  50. duration: 2000,
  51. mask: false
  52. });
  53. })
  54. },
  55. phone: function () {
  56. let that = this;
  57. if (that.data.data.merchantLinkPhone) {
  58. wx.makePhoneCall({
  59. phoneNumber: that.data.data.merchantLinkPhone
  60. });
  61. }
  62. }
  63. });