// pages/tabber/my/index.js
const app =getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        btnInfo: null,
        menuList: [
            {
                icon: '/image/my/youhuiquan.png',
                text: '优惠券',
                url:'/pages/my/coupon/coupon'
            },
            {
                icon: '/image/my/fenxianghaoyou.png',
                text: '分享好友'
            }, {
                icon: '/image/my/dizhiguanli.png',
                text: '地址管理',
                url:'/pages/my/address/address'

            }, {
                icon: '/image/my/fuwuliucheng.png',
                text: '服务流程'
            }, {
                icon: '/image/my/yonghuxieyi.png',
                text: '用户协议'
            }, {
                icon: '/image/my/lipeixize.png',
                text: '理赔细则'
            }, {
                icon: '/image/my/kefurexian.png',
                text: '客服热线'
            }
        ],
        active: false
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.getBtnInfo()
        if (this.data.active == true) {
            this.data.menuList.shift()
            this.setData({
                menuList:this.data.menuList
            })

        }
    },

    getBtnInfo() {
        this.setData({
            btnInfo: app.globalData.btnInfo
        })
    },

    toUrl(e){
        let url = e.currentTarget.dataset.url
        wx.navigateTo({
          url,
        })
    }

})