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
ced880c6
Commit
ced880c6
authored
May 11, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
水印缓存
parent
7b457c5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
32 deletions
+46
-32
setting.vue
take-order/pages/photo/setting.vue
+46
-32
No files found.
take-order/pages/photo/setting.vue
View file @
ced880c6
...
...
@@ -62,7 +62,8 @@
</view>
</
template
>
<
script
>
<
script
>
import
cache
from
'../../common/cache.js'
export
default
{
data
()
{
return
{
...
...
@@ -138,38 +139,51 @@
getItemList
:
function
()
{
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
this
.
loading
=
true
this
.
$u
.
cloudApi
.
getUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'system_id'
:
this
.
systemId
}).
then
(
res
=>
{
if
(
res
&&
res
.
result
)
{
if
(
res
.
result
.
error_code
){
uni
.
showToast
({
title
:
res
.
result
.
error_msg
})
}
else
{
this
.
result
=
res
.
result
}
}
else
{
uni
.
showToast
({
title
:
'网络异常'
})
}
this
.
loading
=
false
})
// this.loading = true
// this.$u.cloudApi.getUserWatermark({
// 'token': getApp().globalData.token,
// 'system_id': this.systemId
// }).then(res => {
// if (res && res.result) {
// if(res.result.error_code){
// uni.showToast({title: res.result.error_msg})
// }else{
// this.result = res.result
// }
// }else{
// uni.showToast({title: '网络异常'})
// }
// this.loading = false
// })
// 离线处理方案
this
.
loading
=
false
const
photo
=
getApp
().
globalData
.
photo
const
data
=
cache
.
getCache
(
this
.
systemId
)
this
.
result
=
data
.
result
[
photo
.
topIndex
].
userWatermark
},
saveUserWatermark
:
function
()
{
this
.
loading
=
true
this
.
$u
.
cloudApi
.
saveUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'watermark'
:
this
.
result
}).
then
(
res
=>
{
if
(
res
.
result
.
code
==
true
)
{
const
photo
=
getApp
().
globalData
.
photo
photo
.
waterSetting
=
this
.
result
}
else
{
uni
.
showToast
({
title
:
res
.
result
.
msg
})
}
this
.
loading
=
false
})
saveUserWatermark
:
function
()
{
// this.loading = true
// this.$u.cloudApi.saveUserWatermark({
// 'token': getApp().globalData.token,
// 'watermark': this.result
// }).then(res => {
// if (res.result.code == true) {
// const photo = getApp().globalData.photo
// photo.waterSetting = this.result
// }else{
// uni.showToast({title: res.result.msg})
// }
// this.loading = false
// })
// 离线处理方案
const
photo
=
getApp
().
globalData
.
photo
const
data
=
cache
.
getCache
(
this
.
systemId
)
data
.
result
[
photo
.
topIndex
].
userWatermark
=
this
.
result
cache
.
setCache
(
this
.
systemId
,
data
)
photo
.
waterSetting
=
this
.
result
},
//保存原图 开关
...
...
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