From 58ae2ba21efcd85df331cf996a94038a77302b51 Mon Sep 17 00:00:00 2001 From: Mr Ke <kelq@hugeinfo.com.cn> Date: Wed, 27 May 2020 17:07:48 +0800 Subject: [PATCH] 修改报错问题 --- SunshineLnsMinApp/pages/zhgk/zhgk.js | 63 ++++++++++++++++++++++++------- 1 files changed, 49 insertions(+), 14 deletions(-) diff --git a/SunshineLnsMinApp/pages/zhgk/zhgk.js b/SunshineLnsMinApp/pages/zhgk/zhgk.js index 886c494..370bfd9 100644 --- a/SunshineLnsMinApp/pages/zhgk/zhgk.js +++ b/SunshineLnsMinApp/pages/zhgk/zhgk.js @@ -42,44 +42,72 @@ // var article = res.data.data; // WxParse.wxParse('article', 'html', article, that, 5); var attList = res.data.data.maps; - var attList21 = app.where(attList, { type: 21 }) || []; + var attList21 = app.where(attList, { + type: 21 + }) || []; attList21.forEach(e => { e.iconSrc = that.data.mp4Src }) - var attList22 = app.where(attList, { type: 22 }) || []; + var attList22 = app.where(attList, { + type: 22 + }) || []; attList22.forEach(e => { e.iconSrc = that.data.pictureSrc }) - var attList23 = app.where(attList, { type: 23 }) || []; + var attList23 = app.where(attList, { + type: 23 + }) || []; attList23.forEach(e => { e.iconSrc = that.data.wordSrc }) - var attList24 = app.where(attList, { type: 24 }) || []; + var attList24 = app.where(attList, { + type: 24 + }) || []; attList24.forEach(e => { e.iconSrc = that.data.excelSrc }) - var attList25 = app.where(attList, { type: 25 }) || []; + var attList25 = app.where(attList, { + type: 25 + }) || []; attList25.forEach(e => { e.iconSrc = that.data.pptSrc }) - var attList26 = app.where(attList, { type: 26 }) || []; + var attList26 = app.where(attList, { + type: 26 + }) || []; attList26.forEach(e => { e.iconSrc = that.data.pdfSrc }) - var attList27 = app.where(attList, { type: 27 }) || []; + var attList27 = app.where(attList, { + type: 27 + }) || []; attList27.forEach(e => { e.iconSrc = that.data.zipSrc }) - var attList28 = app.where(attList, { type: 28 }) || []; + var attList28 = app.where(attList, { + type: 28 + }) || []; attList28.forEach(e => { e.iconSrc = that.data.fileSrc }) - var attList99 = app.where(attList, { type: 99 }) || []; + var attList99 = app.where(attList, { + type: 99 + }) || []; attList99.forEach(e => { e.iconSrc = that.data.fileSrc }) - var attList = { attList21, attList22, attList23, attList24, attList25, attList26, attList27, attList28, attList99 }; - + var attList = { + attList21, + attList22, + attList23, + attList24, + attList25, + attList26, + attList27, + attList28, + attList99 + }; + console.log(attList) that.setData({ data: res.data.data, @@ -95,17 +123,24 @@ }) }, + //预览图片 + previewImage: function(e) { + console.log('预览') + app.previewImage(e) + }, + // 预览附件 - open: function (e) { + open: function(e) { var path = e.currentTarget.dataset.path; console.log(path) wx.downloadFile({ url: path, - success: function (res) { + success: function(res) { + console.log(res) const filePath = res.tempFilePath wx.openDocument({ filePath: filePath, - success: function (res) { + success: function(res) { console.log('打开文档成功') } }) -- Gitblit v1.8.0