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.

couponDetail.js 1.5 KiB

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