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
da5ff8fc
Commit
da5ff8fc
authored
Mar 29, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义水印优化
parent
69f776e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
60 deletions
+63
-60
setting.vue
take-order/pages/photo/setting.vue
+63
-60
No files found.
take-order/pages/photo/setting.vue
View file @
da5ff8fc
...
...
@@ -12,16 +12,16 @@
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lower_right'
][
'title_text'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lower_right']['title_text']"
@
c
hange=
"itemChange(
{},-1)
" color="#007AFF" />
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lower_right']['title_text']
!= ''
"
@
c
lick=
"handleClickTitleSwitch
"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<text
class=
"itemTitle"
>
{{
item
[
'watemark_text'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemark_value'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
:
disabled=
"!item['enable']"
:checked=
"item['enable']
"
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
/>
<switch
class=
"itemSwitch"
:
checked=
"item['enable']"
@
change=
"itemChange(item, ikey)
"
color=
"#007AFF"
/>
</view>
<view
class=
"shadowBackView"
v-if=
"isPopShow"
>
<view
class=
"popCenterView"
>
...
...
@@ -29,16 +29,17 @@
<view
class=
"inputBackView"
>
<view
class=
"ph-pop-left-view"
>
<view
class=
"leftInputView"
>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark_text']"
@
input=
"leftInput()"
:disabled=
"currenItem.type === 'title_text'"
placeholder=
"请输入"
maxlength=
"10"
/>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark_text']"
@
input=
"leftInput()"
:disabled=
"currenItem.type === 'title_text'"
placeholder=
"请输入"
maxlength=
"10"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipLeft"
>
*必填项
</view>
</view>
<view
class=
"ph-pop-mid-view"
>
:
</view>
<view>
<view
class=
"rightInputView"
>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark_value']"
@
input=
"rightInput()"
placeholder=
"请输入内容"
maxlength=
"30"
/>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark_value']"
@
input=
"rightInput()"
placeholder=
"请输入内容"
maxlength=
"30"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipRight"
>
*必填项
</view>
</view>
...
...
@@ -76,8 +77,8 @@
'watemark_text'
:
''
,
'watemark_value'
:
''
},
editingItem
:
{},
showTipLeft
:
false
,
editingItem
:
{},
showTipLeft
:
false
,
showTipRight
:
false
}
},
...
...
@@ -109,14 +110,15 @@
getItemList
:
function
()
{
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
uni
.
showLoading
();
this
.
$u
.
cloudApi
.
getUserWatermark
({
this
.
$u
.
cloudApi
.
getUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'system_id'
:
this
.
systemId
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
&&
res
.
result
)
{
this
.
result
=
res
.
result
this
.
result
=
res
.
result
this
.
result
[
'lower_right'
][
'title_text'
]
=
''
}
this
.
$nextTick
(
function
()
{
uni
.
hideLoading
();
...
...
@@ -125,16 +127,16 @@
})
},
saveUserWatermark
:
function
()
{
uni
.
showLoading
();
uni
.
showLoading
();
this
.
$u
.
cloudApi
.
saveUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'watermark'
:
this
.
result
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
result
==
true
)
{
const
photo
=
getApp
().
globalData
.
photo
photo
.
waterSetting
=
this
.
result
}
console
.
log
(
res
)
if
(
res
.
result
==
true
)
{
const
photo
=
getApp
().
globalData
.
photo
photo
.
waterSetting
=
this
.
result
}
this
.
$nextTick
(
function
()
{
uni
.
hideLoading
();
...
...
@@ -145,29 +147,29 @@
//保存原图 开关
handleOrigineChange
:
function
(
e
)
{
this
.
result
[
'has_origin'
]
=
!
this
.
result
[
'has_origin'
]
this
.
result
[
'has_origin'
]
=
!
this
.
result
[
'has_origin'
]
this
.
saveUserWatermark
()
},
handleClickTitleSwitch
:
function
(
e
)
{
var
string
=
this
.
result
[
'lower_right'
][
'title_text'
]
?
'水印标题不可关闭'
:
'请先编辑该自定义项'
uni
.
showToast
({
icon
:
'none'
,
title
:
string
})
},
//自定义 开关
itemChange
:
function
(
item
,
ikey
)
{
if
(
ikey
===
-
1
)
{
// 水印标题
// if (this.result['lower_right']['title_text']) {
if
(
item
[
'watemark_value'
])
{
// 修改
item
[
'enable'
]
=
!
item
[
'enable'
]
this
.
saveUserWatermark
()
// } else {
// // 弹出修改框
// this.itemClick(item, ikey)
// }
}
else
{
// 其他自定义
// if (item['watemark_value']) {
// 修改
this
.
saveUserWatermark
()
// } else {
// // 弹出修改框
// this.itemClick(item, ikey)
// }
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'请先编辑该自定义项'
})
}
},
...
...
@@ -191,16 +193,16 @@
//左侧输入框
leftInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemark_text'
])
{
this
.
showTipLeft
=
false
}
if
(
this
.
currenItem
[
'watemark_text'
])
{
this
.
showTipLeft
=
false
}
},
//右侧输入框
rightInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemark_value'
])
{
this
.
showTipRight
=
false
if
(
this
.
currenItem
[
'watemark_value'
])
{
this
.
showTipRight
=
false
}
},
...
...
@@ -226,12 +228,12 @@
}
this
.
saveUserWatermark
()
}
else
{
// 提示
if
(
!
this
.
currenItem
[
'watemark_text'
])
{
this
.
showTipLeft
=
true
}
if
(
!
this
.
currenItem
[
'watemark_value'
])
{
this
.
showTipRight
=
true
// 提示
if
(
!
this
.
currenItem
[
'watemark_text'
])
{
this
.
showTipLeft
=
true
}
if
(
!
this
.
currenItem
[
'watemark_value'
])
{
this
.
showTipRight
=
true
}
}
...
...
@@ -341,13 +343,13 @@
.inputBackView
{
margin-top
:
52
rpx
;
width
:
100%
;
width
:
100%
;
height
:
90
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
display
:
flex
;
justify-content
:
space-between
;
display
:
flex
;
align-items
:
flex-start
;
}
...
...
@@ -355,7 +357,7 @@
width
:
220
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
...
...
@@ -364,17 +366,18 @@
.leftInput
{
width
:
180
rpx
;
height
:
32
rpx
;
}
.ph-pop-left-view
{
margin-left
:
30
rpx
;
}
.ph-pop-tip-view
{
color
:
#F56C6C
;
}
.ph-pop-mid-view
{
margin-top
:
20
rpx
;
}
.ph-pop-left-view
{
margin-left
:
30
rpx
;
}
.ph-pop-tip-view
{
color
:
#F56C6C
;
}
.ph-pop-mid-view
{
margin-top
:
20
rpx
;
}
.rightInputView
{
...
...
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