|
- var config = require("../../config/config.js");
- var app = getApp();
- const Http = require("../../utils/HttpBasics");
- const util = require("../../utils/util");
- const imgurl = require("../../utils/imgurl");
- Page({
- data: {
- fenxiangUrl: imgurl.fenxiang.url,
- clockUrl: imgurl.clock.url,
- teljpgUrl: imgurl.teljpg.url,
- closedUrl: imgurl.closed.url,
- quesGouUrl: imgurl.ques_gou.url,
- headbgUrl: imgurl.headbg.url,
- quesBgUrl: imgurl.ques_bg.url,
- cardDetail:null,
- data: {
- title: null
- },
- showPage: false,
- questions1: null,
- questions2: null,
- carList: [],
- couponChannelId: null,
- couponId: null,
- orderId: "",
- hour: null,
- minute: "",
- tempFilePaths: null,
- userInfo: {},
- hasUserInfo: false,
- canIUse: wx.canIUse('button.open-type.getUserInfo'),
- id: null,
- result: [],
- end_time: null,
- checked: false,
- clock: "已经截止",
- questionnaire: {},
- questionId: null,
- widthScreen: null,
- moveData: null,
- rotateData: null,
- alphaData: null,
- scaleData: null,
- skewData: null,
- matrixData: null,
- opacity: 0,
- queueData: null,
- zIndex: 11,
- display: "none",
- showbutton: false
- },
- phone: function (e) {
- let that = this;
- wx.makePhoneCall({
- phoneNumber: e.target.dataset.merchantlinkphone
- });
- },
- onLoad(options) {
- let that = this;
- console.log(options.cardId)
- that.cardpayList(options.cardId);
- that.cardDetail(options.cardId);
- },
- cardpayList: function (cardId) {
- let that = this;
- wx.showLoading({
- title: "加载中..."
- });
- var parmer = {
- url: config.api.cardpayList,
- data: {
- cardId: cardId,
- pageNum: 1,
- pageSize: 100
- }
- };
- Http.get(parmer)
- .then(res => {
- console.log(res);
- if (res.code == 200 && res.data.list.length > 0) {
- that.setData({
- showPage: true
- })
- } else {
- }
- wx.hideLoading();
- res.data.list.map(file => {
- file.updateDate = util.formatTime(file.updateDate, "yyyy-MM-dd hh:mm:ss")
- })
- that.setData({
- data: res.data.list
- });
- }).catch(err => {
- wx.showToast({
- title: err.message,
- icon: 'none',
- duration: 2000,
- mask: false
- });
- })
- },
- cardDetail: function (couponOrderId) {
- let that = this;
- Http.get({
- url: config.api.cardDetail,
- data: {
- couponOrderId: couponOrderId
- }
- })
- .then(res => {
- console.log(res)
- if (res.code == 200) {
- res.data.expiredTime = util.formatTime(res.data.expiredTime, "yyyy-MM-dd hh:mm:ss")
- that.setData({
- showPage: true,
- cardDetail:res.data
- })
- }
- })
- .catch(err => {
- console.log(err)
- })
- },
- onShow() {
- this.setData({
- showbutton: false
- })
- },
- });
|