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
db441034
Commit
db441034
authored
Feb 24, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改余额不足弹窗
parent
fe0692b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
9 deletions
+65
-9
publishArticle.vue
pagesArticle/publishArticle.vue
+65
-9
No files found.
pagesArticle/publishArticle.vue
View file @
db441034
...
...
@@ -20,11 +20,16 @@
</view>
</view>
</view>
<ELM
ref=
"elm"
:msg=
"tipMsg"
:isConfirm=
"isConfirm"
@
confirm=
"confirm"
></ELM>
</view>
</
template
>
<
script
>
import
{
publishArticle
}
from
'../api/article/index'
import
ELM
from
'@/components/elm-toast/index.vue'
;
import
{
getDict
}
from
"../api/system/dict/data"
;
export
default
{
data
()
{
return
{
...
...
@@ -39,10 +44,15 @@
h
:
0
,
focus
:
false
,
isLoginPop
:
false
,
//动态字典配置
articleOptions
:{},
//话题id
topicId
:
null
,
}
},
components
:
{
ELM
},
computed
:
{
heightFn
()
{
return
`
${
this
.
h
}
px`
...
...
@@ -50,6 +60,7 @@
},
onLoad
(
value
){
this
.
topicId
=
value
.
topicId
this
.
getArticleDict
()
},
methods
:
{
//发布
...
...
@@ -64,7 +75,9 @@
const
params
=
{
content
:
this
.
content
,
pictureId
:
JSON
.
stringify
(
this
.
uploadImgJSON
),
topicId
:
this
.
topicId
topicId
:
this
.
topicId
,
wxOpenid
:
uni
.
getStorageSync
(
'userInfo'
).
wxOpenid
,
isPay
:
'0'
}
//将params转成json
publishArticle
(
params
).
then
(
res
=>
{
...
...
@@ -79,19 +92,59 @@
url
:
'/pages/tab/article'
,
});
},
1000
)
}
else
{
}
else
if
(
res
.
data
.
code
===
1002
){
//留言超出限制 是否采用金币进行留言
uni
.
showModal
({
title
:
'提示'
,
content
:
'已超出免费发动态次数,是否花费'
+
this
.
payCount
+
'金币再进行发布'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
const
form
=
{
content
:
this
.
content
,
pictureId
:
JSON
.
stringify
(
this
.
uploadImgJSON
),
topicId
:
this
.
topicId
,
wxOpenid
:
uni
.
getStorageSync
(
'userInfo'
).
wxOpenid
,
isPay
:
'1'
}
publishArticle
(
form
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
title
:
'发表成功'
,
icon
:
'success'
})
uni
.
setStorageSync
(
"isRefresh"
,
true
)
setTimeout
(()
=>
{
uni
.
switchTab
({
url
:
'/pages/tab/article'
,
});
},
1000
)
}
else
if
(
res
.
data
.
code
===
1003
)
{
this
.
isConfirm
=
true
;
this
.
tipMsg
=
res
.
data
.
message
;
this
.
$refs
.
elm
.
showDialog
();
}
})
}
else
if
(
res
.
cancel
)
{
}
}
});
}
else
if
(
res
.
data
.
code
===
1001
){
uni
.
showToast
({
title
:
'发表失败,请稍后再试'
,
icon
:
'
error
'
title
:
res
.
data
.
message
,
icon
:
'
none
'
})
setTimeout
(()
=>
{
uni
.
switchTab
({
url
:
'/pages/tab/article'
});
},
1000
)
}
})
},
//获取动态字典配置
getArticleDict
(){
getDict
(
'article_config'
).
then
(
res
=>
{
this
.
articleOptions
=
res
.
data
.
data
//过滤出dictLabel等于pay_count的dictValue
this
.
payCount
=
this
.
articleOptions
.
find
(
item
=>
item
.
dictLabel
===
'pay_count'
).
dictValue
;
})
},
// 删除图片
deletePic
(
event
)
{
this
[
`fileList
${
event
.
name
}
`
].
splice
(
event
.
index
,
1
)
...
...
@@ -144,6 +197,9 @@
},
confirm
()
{
this
.
isConfirm
=
false
;
uni
.
navigateTo
({
url
:
"/pagesme/goldCoin/recharge"
})
},
focusFn
(
e
)
{
this
.
h
=
e
.
detail
.
height
...
...
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