Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
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
android
uniapp_vedio
Commits
7d4fae55
Commit
7d4fae55
authored
Jul 17, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
c2120915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
88 deletions
+35
-88
coin-popup.vue
vedio/components/coin-popup/coin-popup.vue
+34
-87
utils.js
vedio/utils/utils.js
+1
-1
No files found.
vedio/components/coin-popup/coin-popup.vue
View file @
7d4fae55
...
...
@@ -27,9 +27,8 @@
</view>
<view
class=
"section"
>
<view
class=
"pack-box"
>
<view
class=
"pack-item"
:class=
"[
{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)">
<view
class=
"pack-item"
:class=
"[
{active: index==selectedIndex}]"
v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)">
<view
style=
"display: flex;flex-direction: column;align-items: center;"
>
<view
class=
"price row"
>
...
...
@@ -130,7 +129,6 @@
})
=>
{
this
.
vipList
=
data
.
list
;
if
(
data
.
list
!=
null
)
{
// this.selectedIndex = data.list[0].activityType;
for
(
let
i
=
0
;
i
<
data
.
list
.
length
;
i
++
)
{
if
(
data
.
list
[
i
].
activityType
==
1
)
{
this
.
selectedIndex
=
i
;
...
...
@@ -169,92 +167,41 @@
this
.
handlePay
();
},
handlePay
()
{
if
(
this
.
os
==
'ios'
)
{
message
.
notify
(
'iOS暂不支持购买'
);
return
}
let
that
=
this
;
let
vipBean
=
this
.
vipList
[
this
.
selectedIndex
];
// 抖音支付
this
.
post
({
url
:
'/vip/getVipPayParams/douyin'
,
data
:
{
bookId
:
that
.
vedioId
,
os
:
that
.
os
,
pid
:
vipBean
.
pid
},
showLoading
:
true
,
success
:
({
data
})
=>
{
that
.
ttPrePay
(
data
,
vipBean
.
largeType
);
}
});
},
ttPrePay
(
ttData
,
largeType
)
{
if
(
!
tt
.
canIUse
(
'requestOrder'
))
{
message
.
notify
(
'请升级抖音APP版本.'
);
return
var
vipBean
=
this
.
vipList
[
this
.
selectedIndex
];
if
(
this
.
os
==
'ios'
)
{
message
.
notify
(
'暂不支持ios系统~'
);
}
else
{
this
.
post
({
url
:
'/vip/getVipPayParams/wechat'
,
data
:
{
pid
:
vipBean
.
pid
,
payChannel
:
'WEIXIN'
},
showLoading
:
true
,
success
:
({
data
})
=>
{
that
.
wxPay
(
data
,
vipBean
.
largeType
);
}
});
}
uni
.
showLoading
({
title
:
'加载中...'
});
},
wxPay
(
wxData
,
largeType
)
{
let
wxParams
=
wxData
.
params
;
let
that
=
this
;
tt
.
requestOrder
({
data
:
ttData
.
params
.
data
,
byteAuthorization
:
ttData
.
params
.
byteAuthorization
,
// 发起微信支付
wx
.
requestPayment
({
timeStamp
:
wxParams
.
timeStamp
,
nonceStr
:
wxParams
.
nonceStr
,
package
:
wxParams
.
packageStr
,
signType
:
wxParams
.
signType
,
paySign
:
wxParams
.
paySign
,
success
(
res
)
{
that
.
ttPay
(
largeType
,
res
.
orderId
,
ttData
);
},
fail
(
res
)
{
uni
.
hideLoading
();
console
.
log
(
'ttPrePay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
that
.
queryOrderStatus
(
largeType
,
wxParams
.
sigData
.
outTradeNo
);
},
});
},
ttPay
(
largeType
,
oid
,
ttData
)
{
uni
.
hideLoading
();
if
(
!
tt
.
canIUse
(
'getOrderPayment'
))
{
message
.
notify
(
'请升级抖音APP版本!'
);
return
}
let
that
=
this
;
if
(
this
.
os
==
'ios'
)
{
if
(
!
tt
.
canIUse
(
'getOrderPayment.object.imId'
))
{
message
.
notify
(
'请升级抖音APP版本~'
);
return
}
tt
.
getOrderPayment
({
orderId
:
oid
,
imId
:
ttData
.
imId
,
success
(
res
)
{
that
.
queryOrderStatus
(
largeType
,
ttData
.
tidStr
);
},
fail
(
res
)
{
console
.
log
(
'ios pay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
});
}
else
{
tt
.
getOrderPayment
({
orderId
:
oid
,
success
(
res
)
{
that
.
queryOrderStatus
(
largeType
,
ttData
.
tidStr
);
},
fail
(
res
)
{
console
.
log
(
'android pay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
});
}
fail
(
res
)
{}
})
},
queryOrderStatus
(
largeType
,
tid
)
{
let
that
=
this
;
...
...
@@ -309,7 +256,7 @@
align-items
:
center
;
flex-wrap
:
wrap
;
.active
{
.active
{
background-color
:
#f4c98b
!
important
;
border
:
6rpx
solid
#fd5350
!
important
;
}
...
...
@@ -337,7 +284,7 @@
}
.name
{
width
:
calc
(
90%
);
width
:
calc
(
90%
);
text-align
:
center
;
font-size
:
29rpx
;
color
:
#333
;
...
...
vedio/utils/utils.js
View file @
7d4fae55
export
const
PAKEAGE_NAME
=
'com.mingce.wxhelibook'
export
const
VERSION_CODE
=
'1.0.
2
'
export
const
VERSION_CODE
=
'1.0.
3
'
// export const PAKEAGE_NAME = 'com.test.test'
export
function
trim
(
str
)
{
...
...
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