Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
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
李伟
cust-app
Commits
059d8162
Commit
059d8162
authored
Feb 20, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改留言
parent
2463041b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
17 deletions
+65
-17
addMessage.vue
pagesUser/addMessage.vue
+65
-17
No files found.
pagesUser/addMessage.vue
View file @
059d8162
...
...
@@ -13,6 +13,7 @@
<
script
>
import
ELM
from
'@/components/elm-toast/index.vue'
;
import
{
addMessage
}
from
"../api/user"
;
import
{
getDict
}
from
"../api/system/dict/data"
;
export
default
{
data
()
{
...
...
@@ -21,7 +22,9 @@
message
:
''
,
type
:
0
,
tipMsg
:
''
,
isConfirm
:
false
isConfirm
:
false
,
//金币支付金额
payCount
:
0
}
},
components
:
{
...
...
@@ -33,30 +36,75 @@
uni
.
setNavigationBarTitle
({
title
:
"留言"
})
this
.
getLeaveMessageDict
()
},
onPageScroll
(
e
)
{
if
(
e
.
scrollTop
>
50
)
{}
else
{}
},
methods
:
{
async
saveAbout
()
{
uni
.
showLoading
({
title
:
'保存中...'
})
const
data
=
{
targetId
:
this
.
userId
,
content
:
this
.
message
}
addMessage
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
isConfirm
=
true
;
this
.
tipMsg
=
"发送成功"
;
this
.
$refs
.
elm
.
showDialog
();
}
else
{
this
.
tipMsg
=
res
.
data
.
message
;
this
.
$refs
.
elm
.
showDialog
();
if
(
this
.
message
===
''
){
this
.
tipMsg
=
"请输入内容"
;
this
.
$refs
.
elm
.
showDialog
();
}
else
{
uni
.
showLoading
({
title
:
'保存中...'
})
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
const
data
=
{
targetId
:
this
.
userId
,
content
:
this
.
message
,
isPay
:
'0'
,
//1花费 0不花费,
wxOpenid
:
userInfo
.
wxOpenid
}
})
addMessage
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
isConfirm
=
true
;
this
.
tipMsg
=
"发送成功"
;
this
.
$refs
.
elm
.
showDialog
();
}
else
if
(
res
.
data
.
code
===
1001
){
//留言超出限制 是否采用金币进行留言
uni
.
showModal
({
title
:
'提示'
,
content
:
'已超出留言次数,是否花费'
+
this
.
payCount
+
'金币再进行留言'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
const
form
=
{
targetId
:
this
.
targetId
,
//目标id
content
:
this
.
message
,
//输入的内容
isPay
:
'1'
,
//1花费 0不花费
wxOpenid
:
userInfo
.
wxOpenid
}
addMessage
(
form
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
this
.
isConfirm
=
true
;
this
.
tipMsg
=
"发送成功"
;
this
.
$refs
.
elm
.
showDialog
();
}
})
}
else
if
(
res
.
cancel
)
{
}
}
});
this
.
inputTemp
=
''
}
else
if
(
res
.
data
.
code
===
1002
){
uni
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
})
}
})
}
},
//获取留言字典配置
getLeaveMessageDict
(){
getDict
(
'leave_message_config'
).
then
(
res
=>
{
this
.
leaveMessageOptions
=
res
.
data
.
data
//过滤出dictLabel等于pay_count的dictValue
this
.
payCount
=
this
.
leaveMessageOptions
.
find
(
item
=>
item
.
dictLabel
===
'pay_count'
).
dictValue
;
})
},
confirm
()
{
this
.
isConfirm
=
false
;
uni
.
navigateBack
({
...
...
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