const util = require("../../../utils/util.js"); Page({ data: { wheelId:'', content:'', imagelist:[], theam:'redContent', showQrcode:false, video:[] }, onLoad: function (options) { if (!util.isEmpty(options.wheelId)) { this.setData({ wheelId:options.wheelId }) this.getHtml() } if (!util.isEmpty(options.theam)) { this.setData({theam:options.theam}) } }, onReady: function () { }, onShow: function () { }, // 点击图片放大 lookImg(e) { let picurl = e.currentTarget.dataset.pic let urls = []; // urls.push(data) urls = this.data.content.sharePisList wx.previewImage({ current: picurl, // 当前显示图片的http链接 urls: urls // 需要预览的图片http链接列表 }); }, // 复制内容 copyContent(e){ let that=this,article=e.currentTarget.dataset.article; wx.setClipboardData({ data: article, success: function (res) { console.log(res) } }) }, // 复制图片 savePic(e){ let self = this,picList=e.currentTarget.dataset.pic; picList.forEach((el,index) => { wx.downloadFile({ url:el, success(res) { wx.saveImageToPhotosAlbum({ filePath:res.tempFilePath, success:(res)=>{ setTimeout(() => { util.showTips('已保存至相册!') }, 100); } }) }, fail(res){ util.showTips('保存失败!') } }) }); }, getHtml(){ let that=this; util.ajax({ func: "v2/market/wheel/info", data: {wheelId:that.data.wheelId} }, function (res) { if (res.code==0) { let data = res.data; data.rules = data.rules.replace(/section/g, "div"); data.rules = data.rules.replace(/