vipdetail.js 2.2 KB
// pages/vipdetail/vipdetail.js
var WxParse = require('../../wxParse/wxParse.js');
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    hui:'',
    typek:1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    console.log(options)
    if(options.hui!=undefined){
      this.setData({
        hui: options.hui
      })
    }
    this.getvipdetail()
  },

  getvipdetail() {
    let that = this;
    let url = 'user/vipdesc';

    app.post(url, '', 'post').then((res) => {
      console.log(res);

      WxParse.wxParse('article', 'html', res.content, that, 5);



    }).catch((err) => {

    })
  },

  // 购买会员
  buyhuiyuan() {
    // wx.navigateTo({
    //   url: '/pages/huiyuanknow/huiyuanknow',
    // })
    if(this.data.hui==1){
      wx.redirectTo({

        url: '/pages/chongzhi/chongzhi?hui=' + 1,
      })
    }else{
      wx.redirectTo({

        url: '/pages/chongzhi/chongzhi',
      })
    }
  },

  joinhui(){
    let that = this;
    let url = 'user/duan_send';

    app.post(url, '', 'post').then((res) => {
      console.log(res);
    }).catch((err) => {

    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    let that=this;
    wx.getSystemInfo({
      success(res) {
        console.log(res)
        if (res.platform == 'ios') {
          that.setData({
            typek: 0
          })

        } else if (res.platform == "android") {
          that.setData({
            typek: 1
          })
        } else if (res.platform == 'devtools') {
          // that.setData({
          //   typek:0
          // })

        }


      }
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})