prize-detail.js 1.26 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) {
    app.queryIndex().then((result) => {
      let couponInfo = this.data.couponInfo;
      couponInfo.startDateStr = new Date(couponInfo.startDate).toString("yyyy.MM.dd");
      couponInfo.endDateStr = new Date(couponInfo.endDate).toString("yyyy.MM.dd");
      this.setData({
        userInfo: app.globalData.userInfo,
        couponInfo: couponInfo
      })
      this.initData();
    })

  },
  initData() {
    // this.setData({
    //   couponInfo: app.globalData.curCoupon
    // })
  },
  // 查看可用门店
  onNearbyStoreHandler() {

  },
  // 子组件事件
  evtcomp(evt) {
    let {
      name,
      data
    } = evt.detail;
    switch (name) {

      case "_evt_hide":
        break;

      default:
        break;
    }
  },
})