C端小程序
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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