my-order.js 742 Bytes
import {
  getBindtapData
} from '../../utils/util';

let app = getApp();
Page({
  data: {
    authorizeVisible: false,
    navIndex: 0
  },
  onShareAppMessage() {},
  showAuth() {
    this.setData({
      authorizeVisible: true
    })
  },
  onLoad(options) {
    let {
      navIndex
    } = options;
    console.log("navIndex:", navIndex);
    if (navIndex) {
      this.setData({
        navIndex: navIndex
      })
    }
  },
  /**
   * 选择导航
   * @param {*} evt
   */
  onNavSelectHandler(evt) {
    let navIndex = this.data.navIndex;
    let curIndex = getBindtapData(evt, "index");
    console.log("curIndex:", curIndex);
    if (navIndex != curIndex) {
      this.setData({
        navIndex: curIndex
      })
    }
  },

})