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
992b34ca
Commit
992b34ca
authored
Feb 08, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加了金币相关接口
parent
f242803e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
6 deletions
+76
-6
index.js
api/user/index.js
+23
-0
my.vue
pages/tab/my.vue
+1
-0
recharge.vue
pagesme/goldCoin/recharge.vue
+52
-6
No files found.
api/user/index.js
View file @
992b34ca
...
...
@@ -130,3 +130,26 @@ export function telMessage(data){
data
,
});
}
/**
* 充值金币
*/
export
function
payGoldCoins
(
data
){
return
request
({
method
:
"post"
,
url
:
'/app/memGoldCoinFlow/add'
,
data
,
});
}
/**
* 查询金币余额
*/
export
function
getBalance
(
data
){
return
request
({
method
:
"get"
,
url
:
'/app/memGoldCoinFlow/balance'
,
data
,
});
}
pages/tab/my.vue
View file @
992b34ca
...
...
@@ -270,6 +270,7 @@ import {articleList, getOssUrl} from "../../api/article";
if
(
this
.
info
.
memAuthCount
==
2
){
this
.
authShow
=
false
}
this
.
button
[
0
].
num
=
this
.
info
.
goldCoinsCount
})
},
//获取动态列表,只获取最新的一条
...
...
pagesme/goldCoin/recharge.vue
View file @
992b34ca
...
...
@@ -29,11 +29,13 @@
</view>
</view>
<view
class=
"bottom"
>
<button
class=
"btn"
:loading=
"loading"
@
click=
"
iosPayHandler
"
>
立即充值
</button>
<button
class=
"btn"
:loading=
"loading"
@
click=
"
Pay
"
>
立即充值
</button>
</view>
</view>
</
template
>
<
script
>
import
{
getBalance
,
payGoldCoins
}
from
"../../api/user"
;
let
iapChannel
=
null
// 苹果内部支付渠道
export
default
{
data
()
{
...
...
@@ -55,9 +57,14 @@ export default {
price
:
0
,
// 支付金额
courseIds
:
[],
// 支付的课程ids
applePrice
:
30
,
// ios充值金额
userId
:
null
,
//用户id
memberId
:
null
//会员id
}
},
onLoad
:
function
(
option
)
{
onLoad
(
option
)
{
const
userInfo
=
uni
.
getStorageSync
(
"userInfo"
);
this
.
userId
=
userInfo
.
businessId
this
.
memberId
=
userInfo
.
memberId
// // 获取支付金额
// if (option.params) {
// const params = JSON.parse(option.params)
...
...
@@ -83,7 +90,50 @@ export default {
// this.errorMsg()
// });
},
onShow
(){
this
.
getCoinBalance
()
},
methods
:
{
//查询金币余额
getCoinBalance
(){
getBalance
().
then
(
res
=>
{
this
.
balance
=
res
.
data
.
data
}).
catch
(
e
=>
{
console
.
log
(
e
)
})
},
//点击充值选项
clickItem
(
index
,
item
)
{
this
.
activeIndex
=
index
this
.
coinCount
=
item
.
coin
this
.
payMoney
=
item
.
price
},
//立即充值
Pay
(){
const
params
=
{
type
:
'1'
,
//类型 1充值 2消费
balance
:
this
.
balance
,
//当前用户余额
count
:
this
.
coinCount
,
//充值的金币数
actionType
:
'10'
,
//行为类型 10:用户充值 11:系统充值 20:点赞 21:发动态 22:留言 23:要微信联系方式 24:接收微信请求
targetId
:
this
.
userId
,
//目标用户id
memberId
:
this
.
memberId
//当前用户会员id
}
payGoldCoins
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
title
:
'充值成功'
,
icon
:
'success'
})
//调用查余额接口
this
.
getCoinBalance
()
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
})
}
})
},
// requestOrder() {
// uni.showLoading({
// title: '检测支付环境...'
...
...
@@ -130,10 +180,6 @@ export default {
// showCancel: false
// })
// },
clickItem
(
index
,
item
)
{
this
.
activeIndex
=
index
this
.
payMoney
=
item
.
price
},
async
loadData
()
{
},
...
...
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