From 4496721cd3af3c68ed4d55218d3e83ea0664c57e Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期一, 29 四月 2024 17:53:10 +0800 Subject: [PATCH] bug3 --- packageDomain/pages/resourceDetails/document/index.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 56 insertions(+), 1 deletions(-) diff --git a/packageDomain/pages/resourceDetails/document/index.js b/packageDomain/pages/resourceDetails/document/index.js index 9cf27f2..2449ab4 100644 --- a/packageDomain/pages/resourceDetails/document/index.js +++ b/packageDomain/pages/resourceDetails/document/index.js @@ -1,4 +1,5 @@ // pages/resourceDetails/document/index.js +import Toast from 'tdesign-miniprogram/toast/index'; const app = getApp() Page({ @@ -6,6 +7,11 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + visible: false, + showIndex: false, + closeBtn: false, + deleteBtn: false, + images: [], webpageSrc: '', navBarHeight: '', barHeight: '', @@ -283,6 +289,7 @@ showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile, }) + console.log(this.data.showData, 'showData'); } // 涓嬭浇鏂囦欢zip if (item.selectType == 'zip') { @@ -324,10 +331,58 @@ naturalResources.forEach(function (item) { // console.log(item); }); - } + }, + onClick() { + this.setData({ + images: [ + this.data.showData, + // 'https://tdesign.gtimg.com/mobile/demos/swiper2.png', + ], + showIndex: true, + visible: true, + }); + }, + onChange(e) { + const { + index + } = e.detail; + console.log('change', index); + }, + + onDelete(e) { + const { + index + } = e.detail; + + Toast({ + context: this, + selector: '#t-toast', + message: `鍒犻櫎绗�${index + 1}涓猔, + }); + }, + + onClose(e) { + const { + trigger + } = e.detail; + console.log(trigger); + this.setData({ + visible: false, + }); + }, + //棰勮鍥剧墖锛屾斁澶ч瑙� + preview(event) { + console.log(event.currentTarget.dataset.src) + let currentUrl = event.currentTarget.dataset.src + + wx.previewImage({ + current: currentUrl, // 褰撳墠鏄剧ず鍥剧墖鐨刪ttp閾炬帴 + // urls: this.data.showData // 闇�瑕侀瑙堢殑鍥剧墖http閾炬帴鍒楄〃 + }) + }, }) \ No newline at end of file -- Gitblit v1.9.1