mpVideo.js 1.4 KB
// pages/tab/shopMall/pages/discover/components/common/mpVideo/mpVideo.js
Component({
  /**
   * 组件的属性列表
   */
  externalClasses: ["custom-class"],
  properties: {
    fileList: {
      type: Array,
      value: []
    },
    curIdx: {
        type: Number,
        value: 0,
        observer:function(val,n){
            this.setData({
                currentIdx: val,
            });
        }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    currentIdx: 0,
    curPicIdx: 0,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    changeSwiperItem(e) {
      this.setData({
        currentIdx: e.detail.current,
        curPicIdx: 0
      });
    },
    changePic(e) {
        console.log(e.detail.current)
        this.setData({
            curPicIdx: e.detail.current,
        });
    },
    clickProd(e){
        const {pagePathType,id,marketingType} = e.currentTarget.dataset.prodinfo
        if(pagePathType==1){
          // marketingType 4膨胀金 3众筹
            if(marketingType == 4){
             wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/index/index', {id,isBack:true, notIntercept:true})
            }else{
              wx.$router.go('/pages/crowdfunding/index/index', {id, notIntercept:true})
            }
        }else{
            wx.$router.go('/packageShopmall/packageMall/pages/detail/detail', {id, notIntercept:true})
        }
    },
  },
});