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
1ed284c2
Commit
1ed284c2
authored
Mar 26, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
水印设置页面交互和接口调试
parent
2b1099d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
400 additions
and
313 deletions
+400
-313
pages.json
take-order/pages.json
+6
-4
setting.vue
take-order/pages/photo/setting.vue
+394
-309
No files found.
take-order/pages.json
View file @
1ed284c2
...
@@ -128,9 +128,11 @@
...
@@ -128,9 +128,11 @@
"path"
:
"pages/photo/setting"
,
"path"
:
"pages/photo/setting"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"水印设置"
,
"navigationBarTitleText"
:
"水印设置"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"navigationBarTextStyle"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
"disableScroll"
:
true
//
"navigationBarBackgroundColor"
:
"#333333"
,
//
"navigationBarTextStyle"
:
"#FFFFFF"
,
//
"disableScroll"
:
true
}
}
},
},
{
{
...
...
take-order/pages/photo/setting.vue
View file @
1ed284c2
<
template
>
<
template
>
<view
class=
"backView"
>
<view
class=
"backView"
>
<view
class=
"
firstItemView"
>
<view
class=
"
itemView firstItem"
>
<view
class=
"itemTitleView
"
>
<view
class=
"itemTitleView
"
>
<text
class=
"itemTitle"
>
保存原图
</text>
<text
class=
"itemTitle"
>
保存原图
</text>
<text
class=
"itemNotice"
>
拍照后另保存一张无水印的图片
</text>
<text
class=
"itemNotice"
>
拍照后另保存一张无水印的图片
</text>
</view>
</view>
<switch
class=
"itemSwitch"
:checked=
"isSaveOrigine"
@
change=
"saveOrigineChange"
color=
"#007AFF"
style=
"transform:scale(0.8)"
/>
<switch
class=
"itemSwitch"
:checked=
"result['has_origin']"
@
change=
"handleOrigineChange"
color=
"#007AFF"
style=
"transform:scale(0.8)"
/>
</view>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemView"
v-if=
"showTitleSwitch"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(
{},-1)">
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lower_right'
][
'title_text'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"result['lower_right']['title_text']"
@
change=
"itemChange(
{},-1)"
color="#007AFF" style="transform:scale(0.8)" />
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<text
class=
"itemTitle"
>
{{
item
.
title
}}
</text>
<text
class=
"itemTitle"
>
{{
item
[
'watemark_text'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
.
notice
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemark_value'
]
||
'点击可编辑更改'
}}
</text>
</view>
</view>
<switch
class=
"itemSwitch"
:checked=
"item.isSelect"
@
change=
"itemChange"
color=
"#007AFF"
style=
"transform:scale(0.8)"
/>
<switch
class=
"itemSwitch"
:checked=
"item['watemark_value']"
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
style=
"transform:scale(0.8)"
/>
</view>
</view>
<view
class=
"shadowBackView"
v-if=
"isPopShow"
>
<view
class=
"shadowBackView"
v-if=
"isPopShow"
>
<view
class=
"popCenterView"
>
<view
class=
"popCenterView"
>
<text
class=
"popTitle"
>
设置自定义项
</text>
<text
class=
"popTitle"
>
设置自定义项
</text>
<view
class=
"inputBackView"
>
<view
class=
"inputBackView"
>
<view
class=
"leftInputView"
>
<view
class=
"leftInputView"
>
<input
class=
"leftInput"
type=
"text"
value=
""
placeholder=
"请输入"
@
input=
"leftInput"
/>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark_text']"
:disabled=
"currenItem.type === 'title_text'"
placeholder=
"请输入"
maxlength=
"10"
/>
</view>
</view>
:
:
<view
class=
"rightInputView"
>
<view
class=
"rightInputView"
>
<input
class=
"rightInput"
type=
"text"
value=
""
placeholder=
"请输入内容"
@
input=
"rightInput"
/>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark_value']"
placeholder=
"请输入内容"
maxlength=
"30"
/>
</view>
</view>
</view>
</view>
<text
class=
"popNoticeText u-m-t-40"
>
示例:
</text>
<text
class=
"popNoticeText u-m-t-40"
>
示例:
</text>
...
@@ -45,87 +57,157 @@
...
@@ -45,87 +57,157 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
isSaveOrigine
:
true
,
systemId
:
''
,
itemList
:[],
isSaveOrigine
:
true
,
isPopShow
:
false
,
isPopShow
:
false
,
icon_close_new
:
''
icon_close_new
:
''
,
result
:
{
has_origin
:
true
,
lower_right
:
{
body
:
[]
}
},
currenItem
:
{
'watemark_text'
:
''
,
'watemark_value'
:
''
},
editingItem
:
{}
}
},
computed
:
{
itemList
()
{
if
(
this
.
result
[
'lower_right'
])
{
var
arr
=
this
.
result
[
'lower_right'
][
'body'
]
return
arr
.
filter
((
item
)
=>
{
return
item
.
watemark_type
===
'备注'
})
}
else
{
return
[]
}
},
showTitleSwitch
()
{
return
this
.
result
[
'lower_right'
].
hasOwnProperty
(
'title_text'
)
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
getApp
().
trackPage
(
'水印设置页'
)
getApp
().
trackPage
(
'水印设置页'
)
this
.
icon_close_new
=
getApp
().
globalData
.
icon_close_new
this
.
icon_close_new
=
getApp
().
globalData
.
icon_close_new
if
(
e
&&
e
.
product_code
){
if
(
e
&&
e
.
systemId
)
{
this
.
product_code
=
e
.
product_code
this
.
systemId
=
e
.
systemId
}
}
this
.
getItemList
()
this
.
getItemList
()
},
},
methods
:
{
methods
:
{
getItemList
:
function
()
{
getItemList
:
function
()
{
this
.
itemList
=
[
this
.
systemId
=
'79550af260555cc20afb34156c94b32c'
// 测试数据
{
uni
.
showLoading
();
title
:
'自定义1'
,
this
.
$u
.
cloudApi
.
getUserWatermark
({
notice
:
'点击可编辑更改'
,
'system_id'
:
this
.
systemId
isSelect
:
false
}).
then
(
res
=>
{
},
console
.
log
(
res
)
{
title
:
'自定义2'
,
if
(
res
&&
res
.
result
)
{
notice
:
'点击可编辑更改'
,
this
.
result
=
res
.
result
isSelect
:
true
},
{
title
:
'自定义3'
,
notice
:
'点击可编辑更改'
,
isSelect
:
false
},
{
title
:
'自定义4'
,
notice
:
'点击可编辑更改'
,
isSelect
:
false
},
{
title
:
'自定义5'
,
notice
:
'点击可编辑更改'
,
isSelect
:
false
}
}
]
this
.
$nextTick
(
function
()
{
uni
.
hideLoading
();
})
})
},
saveUserWatermark
:
function
()
{
uni
.
showLoading
();
this
.
$u
.
cloudApi
.
saveUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'watermark'
:
this
.
result
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
$nextTick
(
function
()
{
uni
.
hideLoading
();
})
})
},
},
//保存原图 开关
//保存原图 开关
saveOrigineChange
:
function
(
e
)
{
handleOrigineChange
:
function
(
e
)
{
console
.
log
(
'保存原图 开关 发生 change 事件,携带值为'
,
e
.
target
.
value
)
this
.
result
[
'has_origin'
]
=
!
this
.
result
[
'has_origin'
]
console
.
log
(
'保存原图 开关 发生 change 事件,携带值为'
,
this
.
result
[
'has_origin'
])
},
},
//自定义 开关
//自定义 开关
itemChange
:
function
(
e
)
{
itemChange
:
function
(
item
,
ikey
)
{
console
.
log
(
'自定义 开关 发生 change 事件,携带值为'
,
e
.
target
.
value
)
if
(
ikey
===
-
1
)
{
// 水印标题
if
(
this
.
result
[
'lower_right'
][
'title_text'
])
{
// 修改
this
.
saveUserWatermark
()
}
else
{
// 弹出修改框
this
.
itemClick
(
item
,
ikey
)
}
}
else
{
// 其他自定义
if
(
item
[
'watemark_value'
])
{
// 修改
this
.
saveUserWatermark
()
}
else
{
// 弹出修改框
this
.
itemClick
(
item
,
ikey
)
}
}
},
},
//自定义 点击
//自定义 点击
itemClick
:
function
(
item
,
ikey
)
{
itemClick
:
function
(
item
,
ikey
)
{
console
.
log
(
'自定义 开关 发生 click 事件,携带值为'
,
item
,
ikey
)
if
(
ikey
===
-
1
)
{
this
.
currenItem
=
{
'watemark_text'
:
'水印标题'
,
'watemark_value'
:
this
.
result
[
'lower_right'
][
'title_text'
],
'type'
:
'title_text'
}
}
else
{
this
.
editingItem
=
item
this
.
currenItem
=
{
...
item
}
}
this
.
isPopShow
=
true
this
.
isPopShow
=
true
},
},
//左侧输入框
//左侧输入框
leftInput
:
function
(
e
){
leftInput
:
function
(
e
)
{
console
.
log
(
'左侧输入框 发生 input 事件,携带值为'
,
e
.
detail
.
value
)
console
.
log
(
'左侧输入框 发生 input 事件,携带值为'
,
e
.
detail
.
value
)
},
},
//右侧输入框
//右侧输入框
rightInput
:
function
(
e
){
rightInput
:
function
(
e
)
{
console
.
log
(
'右侧输入框 发生 input 事件,携带值为'
,
e
.
detail
.
value
)
console
.
log
(
'右侧输入框 发生 input 事件,携带值为'
,
e
.
detail
.
value
)
},
},
//自定义弹窗 关闭
//自定义弹窗 关闭
popCancelClick
:
function
()
{
popCancelClick
:
function
()
{
this
.
currenItem
=
{
'watemark_text'
:
''
,
'watemark_value'
:
''
}
this
.
isPopShow
=
false
this
.
isPopShow
=
false
},
},
//自定义弹窗 保存
//自定义弹窗 保存
popSaveClick
:
function
()
{
popSaveClick
:
function
()
{
this
.
isPopShow
=
false
this
.
isPopShow
=
false
debugger
if
(
this
.
currenItem
.
type
===
'title_text'
)
{
this
.
result
[
'lower_right'
][
'title_text'
]
=
this
.
currenItem
[
'watemark_value'
]
}
else
{
this
.
editingItem
[
'watemark_text'
]
=
this
.
currenItem
[
'watemark_text'
]
this
.
editingItem
[
'watemark_value'
]
=
this
.
currenItem
[
'watemark_value'
]
}
this
.
saveUserWatermark
()
}
}
...
@@ -134,7 +216,7 @@
...
@@ -134,7 +216,7 @@
</
script
>
</
script
>
<
style
>
<
style
>
.backView
{
.backView
{
background-color
:
#FAFAFA
;
background-color
:
#FAFAFA
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
...
@@ -145,6 +227,7 @@
...
@@ -145,6 +227,7 @@
align-items
:
center
;
align-items
:
center
;
}
}
/*
.firstItemView{
.firstItemView{
background-color: #FFFFFF;
background-color: #FFFFFF;
width: 100%;
width: 100%;
...
@@ -155,9 +238,9 @@
...
@@ -155,9 +238,9 @@
padding-top: 80rpx;
padding-top: 80rpx;
padding-bottom: 80rpx;
padding-bottom: 80rpx;
border-bottom: 2rpx solid #F4F5F7;
border-bottom: 2rpx solid #F4F5F7;
}
}
*/
.itemView
{
.itemView
{
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
...
@@ -169,8 +252,11 @@
...
@@ -169,8 +252,11 @@
}
}
.itemView.firstItem
{
border-bottom
:
2
rpx
solid
#F4F5F7
;
}
.itemTitleView
{
.itemTitleView
{
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
width
:
80%
;
width
:
80%
;
display
:
flex
;
display
:
flex
;
...
@@ -178,25 +264,25 @@
...
@@ -178,25 +264,25 @@
padding-left
:
30
rpx
;
padding-left
:
30
rpx
;
}
}
.itemTitle
{
.itemTitle
{
font-size
:
32
rpx
;
font-size
:
32
rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#333333
;
color
:
#333333
;
}
}
.itemNotice
{
.itemNotice
{
font-size
:
26
rpx
;
font-size
:
26
rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#666666
;
color
:
#666666
;
margin-top
:
4
rpx
;
margin-top
:
4
rpx
;
}
}
.itemSwitch
{
.itemSwitch
{
margin-right
:
30
rpx
;
margin-right
:
30
rpx
;
}
}
.shadowBackView
{
.shadowBackView
{
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
...
@@ -208,7 +294,7 @@
...
@@ -208,7 +294,7 @@
}
}
.popCenterView
{
.popCenterView
{
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
width
:
690
rpx
;
width
:
690
rpx
;
height
:
600
rpx
;
height
:
600
rpx
;
...
@@ -219,14 +305,14 @@
...
@@ -219,14 +305,14 @@
}
}
.popTitle
{
.popTitle
{
font-size
:
36
rpx
;
font-size
:
36
rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
margin-top
:
50
rpx
;
margin-top
:
50
rpx
;
padding-left
:
30
rpx
;
padding-left
:
30
rpx
;
}
}
.inputBackView
{
.inputBackView
{
margin-top
:
52
rpx
;
margin-top
:
52
rpx
;
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
...
@@ -235,7 +321,7 @@
...
@@ -235,7 +321,7 @@
justify-content
:
space-between
;
justify-content
:
space-between
;
}
}
.leftInputView
{
.leftInputView
{
width
:
220
rpx
;
width
:
220
rpx
;
height
:
72
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
border
:
2
rpx
solid
#666666
;
...
@@ -245,12 +331,12 @@
...
@@ -245,12 +331,12 @@
justify-content
:
center
;
justify-content
:
center
;
}
}
.leftInput
{
.leftInput
{
width
:
180
rpx
;
width
:
180
rpx
;
height
:
32
rpx
;
height
:
32
rpx
;
}
}
.rightInputView
{
.rightInputView
{
width
:
360
rpx
;
width
:
360
rpx
;
height
:
72
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
border
:
2
rpx
solid
#666666
;
...
@@ -260,18 +346,18 @@
...
@@ -260,18 +346,18 @@
justify-content
:
center
;
justify-content
:
center
;
}
}
.rightInput
{
.rightInput
{
width
:
320
rpx
;
width
:
320
rpx
;
height
:
32
rpx
;
height
:
32
rpx
;
}
}
.popNoticeText
{
.popNoticeText
{
font-size
:
26
rpx
;
font-size
:
26
rpx
;
color
:
#666666
;
color
:
#666666
;
padding-left
:
30
rpx
;
padding-left
:
30
rpx
;
}
}
.popBtnView
{
.popBtnView
{
margin-top
:
110
rpx
;
margin-top
:
110
rpx
;
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
...
@@ -279,7 +365,7 @@
...
@@ -279,7 +365,7 @@
justify-content
:
space-between
;
justify-content
:
space-between
;
}
}
.popCancelBtn
{
.popCancelBtn
{
background-color
:
#D1D4D4
;
background-color
:
#D1D4D4
;
width
:
280
rpx
;
width
:
280
rpx
;
height
:
96
rpx
;
height
:
96
rpx
;
...
@@ -290,7 +376,7 @@
...
@@ -290,7 +376,7 @@
justify-content
:
center
;
justify-content
:
center
;
}
}
.popSaveBtn
{
.popSaveBtn
{
background-color
:
#2272FF
;
background-color
:
#2272FF
;
width
:
280
rpx
;
width
:
280
rpx
;
height
:
96
rpx
;
height
:
96
rpx
;
...
@@ -301,10 +387,9 @@
...
@@ -301,10 +387,9 @@
justify-content
:
center
;
justify-content
:
center
;
}
}
.popBtnText
{
.popBtnText
{
font-size
:
32
rpx
;
font-size
:
32
rpx
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
font-weight
:
600
;
font-weight
:
600
;
}
}
</
style
>
</
style
>
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