odc.xiaohui
2023-04-12 4139482e75000140f6e28a95c550e76620b88a60
miniprogram/pages/user/pubulicty/index.ts
@@ -4,6 +4,7 @@
Page({
    data: {
        autoplay:true,
        cardFig:true,
        swcurrent: 0,
        causeList: [],
@@ -75,15 +76,40 @@
                // header: { 'token': wx.getStorageSync('token') },
                success: (res) => {
                    res.data.data.map(i => {
                        let imgarr=[]
                        if (i.photoStr != null) {
                            i.photoStr = i.photoStr.split(",").map(i => userCause.globalData.imageUrl + "/img/" + i),
                                this.data.images = i.photoStr
                                i.photoStr.map(j=>{
                                    let type=j.substring(j.lastIndexOf(".")+1)
                                    let obj={
                                        url: j,
                                        type:'png'
                                     }
                                     if (type=='mp4') {
                                        obj.type = 'mp4'
                                    }else{
                                        obj.type = 'png'
                                    }
                                    imgarr.push(obj)
                                })
                                i.imagarr=imgarr
                        }
                        i.releaseTime = i.releaseTime.replace(/-/g,"/")
                    })
                    this.setData({
                        causeList: res.data.data
                    })
                }
            })
    }
    },
    videoplay(e){
        console.log(e);
        this.setData({
            autoplay:false
        })
    },
})