提交 03e94973 编写于 作者: X xjb

修复a标签打开文档的bug

上级 f60c9586
...@@ -87,7 +87,8 @@ Component({ ...@@ -87,7 +87,8 @@ Component({
{ {
wx.openEmbeddedMiniProgram({ wx.openEmbeddedMiniProgram({
appId: appid, appId: appid,
path: path path: path,
allowFullScreen:true
}) })
} }
......
...@@ -149,7 +149,7 @@ Page({ ...@@ -149,7 +149,7 @@ Page({
let isDoc = /\.(doc|docx|xls|xlsx|ppt|pptx|pdf)$/.test(href) let isDoc = /\.(doc|docx|xls|xlsx|ppt|pptx|pdf)$/.test(href)
if (isDoc) { if (isDoc) {
this.openLinkDoc(e) this.openLinkDoc(e.detail)
return return
} }
...@@ -287,7 +287,7 @@ Page({ ...@@ -287,7 +287,7 @@ Page({
let fileType let fileType
// 如果是a标签href中插入的文档 // 如果是a标签href中插入的文档
let src = e.currentTarget.dataset.src let src = e.src || e.href
var n=0; var n=0;
for (var i = 0; i < self.data.downloadFileDomain.length; i++) { for (var i = 0; i < self.data.downloadFileDomain.length; i++) {
...@@ -310,8 +310,8 @@ Page({ ...@@ -310,8 +310,8 @@ Page({
url = src url = src
fileType = /doc|docx|xls|xlsx|ppt|pptx|pdf$/.exec(src)[0] fileType = /doc|docx|xls|xlsx|ppt|pptx|pdf$/.exec(src)[0]
} else { } else {
url = e.currentTarget.dataset.filelink url = e.filelink || e.href
fileType = e.currentTarget.dataset.filetype fileType = e.filetype
} }
wx.downloadFile({ wx.downloadFile({
......
...@@ -668,7 +668,7 @@ Page({ ...@@ -668,7 +668,7 @@ Page({
let isDoc = /\.(doc|docx|xls|xlsx|ppt|pptx|pdf)$/.test(href) let isDoc = /\.(doc|docx|xls|xlsx|ppt|pptx|pdf)$/.test(href)
if (isDoc) { if (isDoc) {
this.openLinkDoc(e) this.openLinkDoc(e.detail)
return return
} }
...@@ -697,7 +697,8 @@ Page({ ...@@ -697,7 +697,8 @@ Page({
{ {
wx.openEmbeddedMiniProgram({ wx.openEmbeddedMiniProgram({
appId: appid, appId: appid,
path: path path: path,
allowFullScreen:true
}) })
} }
...@@ -816,7 +817,7 @@ Page({ ...@@ -816,7 +817,7 @@ Page({
let fileType let fileType
// 如果是a标签href中插入的文档 // 如果是a标签href中插入的文档
let src = e.currentTarget.dataset.src let src = e.src || e.href
var n=0; var n=0;
for (var i = 0; i < self.data.downloadFileDomain.length; i++) { for (var i = 0; i < self.data.downloadFileDomain.length; i++) {
...@@ -839,8 +840,8 @@ Page({ ...@@ -839,8 +840,8 @@ Page({
url = src url = src
fileType = /doc|docx|xls|xlsx|ppt|pptx|pdf$/.exec(src)[0] fileType = /doc|docx|xls|xlsx|ppt|pptx|pdf$/.exec(src)[0]
} else { } else {
url = e.currentTarget.dataset.filelink url = e.filelink || e.href
fileType = e.currentTarget.dataset.filetype fileType = e.filetype
} }
wx.downloadFile({ wx.downloadFile({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册