C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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