prize-detail.js 1.3 KB
import {
  getBindtapData
} from '../../utils/util';
import Date from '../../utils/date';
let app = getApp();
Page({
  data: {
    userInfo: {},
    used: false, //优惠券已使用,另外的样式
    couponInfo: {
      "couponId": "20839",
      "couponCode": "RLLL1IHG",
      "rule": "RLLL1IHG",
      "startDate": 1564479217000,
      "endDate": 1567094399000,
      "type": 4,
      "name": "眼部护理体验券-7月24日",
      "state": 0,
      "endDateStr": "19-08-29"
    }
  },
  onShareAppMessage() {},
  onLoad(options) {
    let couponInfo = options;
    couponInfo.startDateStr = new Date(couponInfo.startDate).toString("yyyy.MM.dd");
    couponInfo.endDateStr = new Date(couponInfo.endDate).toString("yyyy.MM.dd");
    this.setData({
      couponInfo: couponInfo
    })
    console.log("couponInfo:", couponInfo);
    this.initData();
  },
  initData() {
    app.queryIndex().then((result) => {
      this.setData({
        userInfo: app.globalData.userInfo
      })
    })
  },
  // 查看可用门店
  onNearbyStoreHandler(evt) {
    console.log("onNearbyStoreHandler couponInfo:", this.data.couponInfo);
  },
  // 子组件事件
  evtcomp(evt) {
    let {
      name,
      data
    } = evt.detail;
    switch (name) {

      case "_evt_hide":
        break;

      default:
        break;
    }
  },
})