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.

130 rivejä
2.9 KiB

  1. var config = require("../../config/config.js");
  2. var app = getApp();
  3. const Http = require("../../utils/HttpBasics");
  4. const util = require("../../utils/util");
  5. const imgurl = require("../../utils/imgurl");
  6. Page({
  7. data: {
  8. fenxiangUrl: imgurl.fenxiang.url,
  9. clockUrl: imgurl.clock.url,
  10. teljpgUrl: imgurl.teljpg.url,
  11. closedUrl: imgurl.closed.url,
  12. quesGouUrl: imgurl.ques_gou.url,
  13. headbgUrl: imgurl.headbg.url,
  14. quesBgUrl: imgurl.ques_bg.url,
  15. dingdanUrl: imgurl.dingdan.url,
  16. cardDetail:null,
  17. data: {
  18. title: null
  19. },
  20. showPage: false,
  21. questions1: null,
  22. questions2: null,
  23. carList: [],
  24. couponChannelId: null,
  25. couponId: null,
  26. orderId: "",
  27. hour: null,
  28. minute: "",
  29. tempFilePaths: null,
  30. userInfo: {},
  31. hasUserInfo: false,
  32. canIUse: wx.canIUse('button.open-type.getUserInfo'),
  33. id: null,
  34. result: [],
  35. end_time: null,
  36. checked: false,
  37. clock: "已经截止",
  38. questionnaire: {},
  39. questionId: null,
  40. widthScreen: null,
  41. moveData: null,
  42. rotateData: null,
  43. alphaData: null,
  44. scaleData: null,
  45. skewData: null,
  46. matrixData: null,
  47. opacity: 0,
  48. queueData: null,
  49. zIndex: 11,
  50. display: "none",
  51. showbutton: false
  52. },
  53. phone: function (e) {
  54. let that = this;
  55. wx.makePhoneCall({
  56. phoneNumber: e.target.dataset.merchantlinkphone
  57. });
  58. },
  59. onLoad(options) {
  60. let that = this;
  61. console.log(options.cardId)
  62. that.cardpayList(options.cardId);
  63. that.cardDetail(options.cardId);
  64. },
  65. cardpayList: function (cardId) {
  66. let that = this;
  67. wx.showLoading({
  68. title: "加载中..."
  69. });
  70. var parmer = {
  71. url: config.api.cardpayList,
  72. data: {
  73. cardId: cardId,
  74. pageNum: 1,
  75. pageSize: 100
  76. }
  77. };
  78. Http.get(parmer)
  79. .then(res => {
  80. console.log(res);
  81. if (res.code == 200 && res.data.list.length > 0) {
  82. that.setData({
  83. showPage: true
  84. })
  85. } else {
  86. }
  87. wx.hideLoading();
  88. res.data.list.map(file => {
  89. file.updateDate = util.formatTime(file.updateDate, "yyyy-MM-dd hh:mm:ss")
  90. })
  91. that.setData({
  92. data: res.data.list
  93. });
  94. }).catch(err => {
  95. wx.showToast({
  96. title: err.message,
  97. icon: 'none',
  98. duration: 2000,
  99. mask: false
  100. });
  101. })
  102. },
  103. cardDetail: function (couponOrderId) {
  104. let that = this;
  105. Http.get({
  106. url: config.api.cardDetail,
  107. data: {
  108. couponOrderId: couponOrderId
  109. }
  110. })
  111. .then(res => {
  112. console.log(res)
  113. if (res.code == 200) {
  114. res.data.expiredTime = util.formatTime(res.data.expiredTime, "yyyy-MM-dd hh:mm:ss")
  115. that.setData({
  116. showPage: true,
  117. cardDetail:res.data
  118. })
  119. }
  120. })
  121. .catch(err => {
  122. console.log(err)
  123. })
  124. },
  125. onShow() {
  126. this.setData({
  127. showbutton: false
  128. })
  129. },
  130. });