C端小程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

54 satır
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. },
  12. onLoad: function(options) {
  13. console.log(options);
  14. let that = this;
  15. that.setData({
  16. code: options.quancode
  17. });
  18. //获得优惠券的详情
  19. if (
  20. options.quancode != null &&
  21. (options.quancode != "" && options.quancode) != undefined
  22. ) {
  23. Http.get({
  24. url: config.api.couponOrderDetail,
  25. data: {
  26. couponOrderId: options.quancode
  27. }
  28. }).then(res => {
  29. console.log(res);
  30. that.setData({
  31. data: res.data.data
  32. });
  33. that.setData({
  34. expiredTime: util.fmtDate(that.data.data.expiredTime),
  35. createDate: util.fmtDate(that.data.data.createDate)
  36. });
  37. });
  38. }
  39. util.barcode("barcode", options.quancode, 680, 100);
  40. util.qrcode("qrcode", options.quancode, 400, 400);
  41. },
  42. phone: function() {
  43. let that = this;
  44. console.log(that.data);
  45. if (that.data.data.merchantLinkPhone) {
  46. wx.makePhoneCall({
  47. phoneNumber: that.data.data.merchantLinkPhone //仅为示例,并非真实的电话号码
  48. });
  49. }
  50. }
  51. });