hh-doctor-sdk 0.7.8 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -108,11 +108,13 @@ module.exports = Behavior({
|
|
|
108
108
|
},
|
|
109
109
|
|
|
110
110
|
pdfData(url) {
|
|
111
|
-
|
|
111
|
+
// 展示用文件名去掉 query,下载地址保留签名参数
|
|
112
|
+
let path = url || ''
|
|
113
|
+
const index = path.indexOf('?')
|
|
112
114
|
if (index >= 0) {
|
|
113
|
-
|
|
115
|
+
path = path.substring(0, index)
|
|
114
116
|
}
|
|
115
|
-
const name =
|
|
117
|
+
const name = path.substring(path.lastIndexOf('/') + 1)
|
|
116
118
|
return {
|
|
117
119
|
url: url,
|
|
118
120
|
name: name
|
|
@@ -7,10 +7,15 @@ function viewPdfs(files) {
|
|
|
7
7
|
this.viewPdf(files[0].url)
|
|
8
8
|
} else {
|
|
9
9
|
const items = files.map((file) => {
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
let path = file.url || ''
|
|
11
|
+
const q = path.indexOf('?')
|
|
12
|
+
if (q >= 0) {
|
|
13
|
+
path = path.substring(0, q)
|
|
14
|
+
}
|
|
15
|
+
const last = path.lastIndexOf('/')
|
|
16
|
+
const fullFileName = path.substring(last + 1)
|
|
17
|
+
const dot = fullFileName.lastIndexOf('.')
|
|
18
|
+
return dot >= 0 ? fullFileName.substring(0, dot) : fullFileName
|
|
14
19
|
})
|
|
15
20
|
wx.showActionSheet({
|
|
16
21
|
itemList: items,
|