Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
和慭琛
take_order
Commits
6cde5207
Commit
6cde5207
authored
May 18, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离线图片使用临时文件
parent
f2474220
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
25 deletions
+19
-25
list.vue
take-order/pages/photo/list.vue
+11
-11
preview.vue
take-order/pages/photo/preview.vue
+8
-14
No files found.
take-order/pages/photo/list.vue
View file @
6cde5207
...
...
@@ -261,17 +261,17 @@
const
self
=
this
const
photo
=
getApp
().
globalData
.
photo
const
data
=
cache
.
getCache
(
self
.
systemId
)
let
path
=
[]
data
.
result
.
forEach
(
v
=>
{
v
.
list
.
forEach
(
item
=>
{
if
(
item
.
imageList
.
length
>
0
)
path
=
path
.
concat
(
item
.
imageList
)
})
})
for
(
let
i
of
path
)
{
uni
.
removeSavedFile
({
filePath
:
i
})
}
//
let path = []
//
data.result.forEach(v => {
//
v.list.forEach(item => {
//
if (item.imageList.length > 0) path = path.concat(item.imageList)
//
})
//
})
//
for (let i of path) {
//
uni.removeSavedFile({
//
filePath: i
//
})
//
}
cache
.
removeCache
(
self
.
systemId
)
self
.
isPopShow
=
false
self
.
getListData
()
...
...
take-order/pages/photo/preview.vue
View file @
6cde5207
...
...
@@ -109,22 +109,16 @@
saveToStroage
(
path
)
{
const
photo
=
getApp
().
globalData
.
photo
const
currentItem
=
photo
.
currentItem
uni
.
saveFile
({
tempFilePath
:
path
,
success
(
e
)
{
const
{
savedFilePath
}
=
e
currentItem
.
imageList
.
unshift
(
savedFilePath
)
// 从缓存数据中找到修改对象并替换
const
data
=
cache
.
getCache
(
currentItem
.
system_id
)
data
.
result
.
forEach
(
v
=>
{
const
index
=
v
.
list
.
findIndex
(
item
=>
item
.
_id
===
currentItem
.
_id
)
if
(
index
>
-
1
)
{
v
.
list
[
index
]
=
currentItem
}
})
cache
.
setCache
(
currentItem
.
system_id
,
data
)
currentItem
.
imageList
.
unshift
(
path
)
// 从缓存数据中找到修改对象并替换
const
data
=
cache
.
getCache
(
currentItem
.
system_id
)
data
.
result
.
forEach
(
v
=>
{
const
index
=
v
.
list
.
findIndex
(
item
=>
item
.
_id
===
currentItem
.
_id
)
if
(
index
>
-
1
)
{
v
.
list
[
index
]
=
currentItem
}
})
cache
.
setCache
(
currentItem
.
system_id
,
data
)
},
saveLocal
(
path
){
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment