|  | const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
let config = require("../../config/config.js");
let app = getApp();
const Http = require("../../utils/HttpBasics");
const util = require("../../utils/util");
const imgurl = require("../../utils/imgurl");
Page({
  data: {
    navigationBarHeight,
    data: {
      bgColor:"#fff"
    },
    wmhome: imgurl.wmhome.url,
    couponId: null,
    orderId: "",
    day: "",
    hour: "",
    minute: "",
    nodes: ''
  },
  onLoad(options){
    console.log(options)
    if(options&&options.id){
      this.setData({
        id:options.id
      })
      this.topicShow(options.id)
    }
  },
  goback: function () {
    wx.switchTab({
      url: '/index/index',
    })
  },
  topicShow(id){
    let that = this;
    Http.get({
      url: config.api.topicFindById,
      data: {
        id: id
      }
    }).then(res => {
      console.log(res)
      if (res&&res.data) {
        that.setData({
          data: res.data
        });
        /**
         * 获取屏幕的高度
         * 
         */
        let query = wx.createSelectorQuery();
        query.select('.coupons').boundingClientRect();
        query.selectViewport().scrollOffset();
        query.exec((res) => {
          let listHeight = res[0].height; // 获取list高度
          let windowHeight = wx.getSystemInfoSync().windowHeight;
          if (windowHeight >= listHeight){
            that.setData({
              winHeight:'100%'
            })
          }
        })
      }
    }).catch(err => {
      wx.showToast({
        title: err.errMsg,
        icon: 'none',
        duration: 2000,
        mask: false
      });
    })
  },
  gotoDetail:function(e){
    if (e.currentTarget.dataset.type == 9){
      wx.navigateTo({
        url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${e.currentTarget.dataset.couponchannelid}`,
      })
    }else{
      wx.navigateTo({
        url: `/pages/coupon/detail/index?couponChannelId=${e.currentTarget.dataset.couponchannelid}&couponId=${e.currentTarget.dataset.couponid}`,
      })
    }
  },
});
 |