C端小程序
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

55 行
1.3 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. onLoad: function (options) {
  20. console.log(options);
  21. let that = this;
  22. that.setData({
  23. code: options.quancode
  24. });
  25. Http.get({
  26. url: config.api.couponOrderDetail,
  27. data: {
  28. couponOrderId: options.quancode
  29. }
  30. }).then(res => {
  31. console.log(res);
  32. that.setData({
  33. data: res.data
  34. });
  35. that.setData({
  36. expiredTime: util.fmtDate(that.data.data.expiredTime),
  37. updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
  38. createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss")
  39. });
  40. util.barcode("barcode", options.quancode, 510, 100);
  41. util.qrcode("qrcode", options.quancode, 350, 350);
  42. });
  43. },
  44. phone: function () {
  45. let that = this;
  46. console.log(that.data);
  47. if (that.data.data.merchantLinkPhone) {
  48. wx.makePhoneCall({
  49. phoneNumber: that.data.data.merchantLinkPhone
  50. });
  51. }
  52. }
  53. });