// components/My_BannerSwiper/index.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        swiperBannerList: {
            type: Array
        },
        type: {
            type: String,
            value: "banner" //advertising
        },
        marTop: {
            type: Number,
            value: 0
        },
        marBot: {
            type: Number,
            value: 0
        },
    },

    /**
     * 组件的初始数据
     */
    data: {

    },

    /**
     * 组件的方法列表
     */
    methods: {
        /* 轮播跳转 */
        clickToPage(e) {
            const {
                index
            } = e.target.dataset;
            const bannerData = this.data.swiperBannerList[index];
            if (bannerData.flinktype == 'URL') {
                //url类型内部跳转
                wx.navigateTo({
                    url: bannerData.fhyperlink,
                })
            } else if (bannerData.flinktype == 'DATA' && bannerData.fdatatable == "tactivity") {
                let url = (wx.getStorageSync('userData').token) ? '/pages/tradeShow/index?id=' : '/pages/scanQRCodes/register?id='
                //活动类型跳转展会
                wx.navigateTo({
                    url: url + bannerData.fdataid,
                })
            }
        }
    }
})