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
525d682d
Commit
525d682d
authored
Nov 29, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加虚拟支付
parent
3c628534
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
35 deletions
+100
-35
coin-popup.vue
vedio/components/coin-popup/coin-popup.vue
+69
-4
my.vue
vedio/pages/my/my.vue
+31
-31
No files found.
vedio/components/coin-popup/coin-popup.vue
View file @
525d682d
...
...
@@ -71,7 +71,8 @@
</
template
>
<
script
>
import
common
from
'@/mixins/common'
;
import
common
from
'@/mixins/common'
;
import
{
message
}
from
'@/utils/fun'
;
export
default
{
name
:
'coinPopup'
,
mixins
:
[
common
],
...
...
@@ -103,7 +104,7 @@
this
.
$emit
(
'paySuccess'
,
largeType
);
this
.
handleClose
();
},
handleShow
()
{
handleShow
()
{
let
that
=
this
;
this
.
$refs
.
coinPop
.
open
(
'bottom'
);
...
...
@@ -153,7 +154,7 @@
let
vipBean
=
this
.
vipList
[
this
.
selectedIndex
];
this
.
post
({
url
:
'/vip/getVipPayParams'
,
url
:
'/vip/getVipPayParams
/xpay
'
,
data
:
{
vedioId
:
that
.
point
<=
0
?
null
:
that
.
vedioId
,
pid
:
vipBean
.
pid
,
...
...
@@ -163,7 +164,7 @@
success
:
({
data
})
=>
{
that
.
wxPay
(
data
,
vipBean
.
largeType
);
that
.
wx
Virtually
Pay
(
data
,
vipBean
.
largeType
);
}
});
},
...
...
@@ -182,6 +183,70 @@
},
fail
(
res
)
{}
})
},
wxVirtuallyPay
(
wxData
,
largeType
)
{
// 虚拟支付
let
wxParams
=
wxData
.
params
;
let
signDataParams
=
wxData
.
params
.
sigData
;
let
that
=
this
;
const
SDKVersion
=
wx
.
getSystemInfoSync
().
SDKVersion
;
if
(
this
.
compareVersion
(
SDKVersion
,
'2.19.2'
)
>=
0
||
wx
.
canIUse
(
'requestVirtualPayment'
))
{
wx
.
requestVirtualPayment
({
signData
:
JSON
.
stringify
({
offerId
:
signDataParams
.
offerId
,
buyQuantity
:
signDataParams
.
buyQuantity
,
env
:
signDataParams
.
env
,
currencyType
:
signDataParams
.
currencyType
,
platform
:
signDataParams
.
platform
,
productId
:
signDataParams
.
productId
,
goodsPrice
:
signDataParams
.
goodsPrice
,
outTradeNo
:
signDataParams
.
outTradeNo
,
attach
:
signDataParams
.
attach
,
}),
paySig
:
wxParams
.
paySign
,
signature
:
wxParams
.
signature
,
mode
:
wxParams
.
mode
,
success
(
res
)
{
that
.
paySuccess
(
largeType
);
},
fail
({
errMsg
,
errCode
})
{
message
.
notify
(
errMsg
);
console
.
log
(
'虚拟支付异常:errMsg='
+
errMsg
+
' errCode='
+
errCode
);
},
})
}
else
{
message
.
notify
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
);
}
},
compareVersion
(
_v1
,
_v2
)
{
if
(
typeof
_v1
!==
'string'
||
typeof
_v2
!==
'string'
)
return
0
const
v1
=
_v1
.
split
(
'.'
)
const
v2
=
_v2
.
split
(
'.'
)
const
len
=
Math
.
max
(
v1
.
length
,
v2
.
length
)
while
(
v1
.
length
<
len
)
{
v1
.
push
(
'0'
)
}
while
(
v2
.
length
<
len
)
{
v2
.
push
(
'0'
)
}
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
const
num1
=
parseInt
(
v1
[
i
],
10
)
const
num2
=
parseInt
(
v2
[
i
],
10
)
if
(
num1
>
num2
)
{
return
1
}
else
if
(
num1
<
num2
)
{
return
-
1
}
}
return
0
}
},
watch
:
{
...
...
vedio/pages/my/my.vue
View file @
525d682d
...
...
@@ -171,38 +171,38 @@
},
handlePhone
()
{
// 联系我们
// this.post({
// url: '/vedio/customerServiceNumbers',
// showLoading: false,
// success: ({
// data
// }) => {
// let datas = data.customerServiceNumbers.split(',')
// let corpid = datas[0]
// let curl = datas[1]
// wx.openCustomerServiceChat({
// extInfo: {
// url: curl
// },
// corpId: corpid,
// success(res) {},
// fail(e) {
// console.log(e)
// }
// })
// }
// });
wx
.
makePhoneCall
({
phoneNumber
:
'4000969950'
,
success
:
function
(
res
)
{
console
.
log
(
'拨打电话成功!'
);
},
fail
:
function
(
res
)
{
console
.
log
(
'拨打电话失败!'
);
this
.
post
({
url
:
'/vedio/customerServiceNumbers'
,
showLoading
:
false
,
success
:
({
data
})
=>
{
let
datas
=
data
.
customerServiceNumbers
.
split
(
','
)
let
corpid
=
datas
[
0
]
let
curl
=
datas
[
1
]
wx
.
openCustomerServiceChat
({
extInfo
:
{
url
:
curl
},
corpId
:
corpid
,
success
(
res
)
{},
fail
(
e
)
{
console
.
log
(
e
)
}
})
}
})
});
// wx.makePhoneCall({
// phoneNumber: '4000969950',
// success: function(res) {
// console.log('拨打电话成功!');
// },
// fail: function(res) {
// console.log('拨打电话失败!');
// }
// })
},
paySuccess
(
largeType
)
{
// largeType=vip 开通vip
...
...
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