|
- const util = require("../../../utils/util");
- const config = require("../../../config/config.js");
- const Http = require("../../../utils/HttpBasics");
-
- //券详情页面
- Page({
- data: {
- data: {},
- createDate: "",
- expiredTime: "",
- updateDate: "",
- //存储计时器
- setInter: "",
- showPage:false
- },
- onUnload: function () {
- let that = this;
- clearInterval(that.data.setInter);
- },
- onHide: function () {
- let that = this;
- clearInterval(that.data.setInter);
- },
- onLoad: function (options) {
- let that = this;
- console.log(options.quancode)
- Http.get({
- url: config.api.couponOrderDetail,
- data: {
- couponOrderId: options.quancode
- }
- }).then(res => {
- that.setData({
- data: res.data,
- showPage:true
- });
- that.setData({
- expiredTime: util.fmtDate(that.data.data.expiredTime),
- updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
- createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss")
- });
- // util.barcode("barcode", options.quancode, 510, 100);
- util.qrcode("qrcode", options.quancode, 350, 350);
- })
- .catch(err => {
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000,
- mask: false
- });
- })
- },
- phone: function () {
- let that = this;
- if (that.data.data.merchantLinkPhone) {
- wx.makePhoneCall({
- phoneNumber: that.data.data.merchantLinkPhone
- });
- }
- }
- });
|