|
- 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,
- 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;
- wx.showLoading({
- title: "加载中..."
- });
- var parmer = {
- url: config.api.cardpayList,
- data: {
- cardId: options.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.showModal({
- title: '抱歉',
- content: '暂无数据',
- showCancel:false,
- success:function(res){
- if(res.confirm){
- wx.navigateBack({
- url: '/pages/cardorder/index'
- })
- }
- }
- })
- }
- 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
- });
- })
- },
- onShow(){
- this.setData({
- showbutton:false
- })
- },
- });
|