C端小程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

64 linhas
1.5 KiB

  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. code: "",
  8. data: {},
  9. createDate: "",
  10. expiredTime: "",
  11. updateDate: "",
  12. //存储计时器
  13. setInter: ""
  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. that.setData({
  26. code: options.quancode
  27. });
  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. });
  37. that.setData({
  38. expiredTime: util.fmtDate(that.data.data.expiredTime),
  39. updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
  40. createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss")
  41. });
  42. util.barcode("barcode", options.quancode, 510, 100);
  43. util.qrcode("qrcode", options.quancode, 350, 350);
  44. })
  45. .catch(err => {
  46. wx.showToast({
  47. title: err.errMsg,
  48. icon: 'none',
  49. duration: 2000,
  50. mask: false
  51. });
  52. })
  53. },
  54. phone: function () {
  55. let that = this;
  56. if (that.data.data.merchantLinkPhone) {
  57. wx.makePhoneCall({
  58. phoneNumber: that.data.data.merchantLinkPhone
  59. });
  60. }
  61. }
  62. });