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

修复a标签打开文档的bug

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