Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
f9c23c43
Commit
f9c23c43
authored
Apr 03, 2026
by
yuzhenWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接拉起小程序支付
parent
028a53b5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
49 deletions
+35
-49
index.html
+2
-13
pages/courseDetail/courseDetail.vue
+18
-18
pages/lanch/index.vue
+4
-2
pages/orderConfirm/orderConfirm.vue
+9
-14
util/fiveshare.ts
+2
-2
No files found.
index.html
View file @
f9c23c43
...
...
@@ -41,18 +41,6 @@
<!--app-html-->
</div>
<script
type=
"module"
src=
"/main.js"
></script>
<!-- uni 的 SDK,必须引用。 -->
<!-- <script type="text/javascript" src="/static/uni.webview.1.5.4.js"></script>
<script type="text/javascript">
// 验证脚本是否加载成功(调试关键:控制台打印 webViewJs 确认)
const webViewJs = window.uni?.webView;
if (!webViewJs) {
console.error('uni.webview.js 加载失败!请检查路径是否正确');
} else {
console.log('uni.webview.js 加载成功', webViewJs);
// 将 webViewJs 挂载到 window 全局,供 Vue 组件访问
window.webViewJs = webViewJs;
}
</script> -->
</body>
</html>
\ No newline at end of file
pages/courseDetail/courseDetail.vue
View file @
f9c23c43
...
...
@@ -747,25 +747,25 @@
// 如果是商城跳转到cffp得购买直接弹出海报框
if
(
this
.
mpCffp
){
// if(uni.getStorageSync('posterItem')){
// this.shareItem = JSON.parse(JSON.stringify(uni.getStorageSync('posterItem')))
// if(this.mpCffp){
// // if(uni.getStorageSync('posterItem')){
// // this.shareItem = JSON.parse(JSON.stringify(uni.getStorageSync('posterItem')))
// // }
// // 因为是从家办商城小程序跳转到cffp的,所以这里购买要带家办商城的token,
// let dataToken = uni.getStorageSync('dataToken')
// console.log('家办商城dataToken',dataToken);
// this.posterShareTxt = '保存图片扫码下单'
// this.posterDesTxt = '扫码下单'
// let newLink = shareURL + `/pages/orderConfirm/orderConfirm?fileId=${this.fileId}&orderId=${this.orderId}&userId=${this.userId}&dataToken=${encodeURIComponent(dataToken)}`
// // let newLink = shareURL + `/pages/lanch/index?fileId=${this.fileId}&orderId=${this.orderId}&userId=${this.userId}&dataToken=${encodeURIComponent(dataToken)}&landingPage=orderConfirm`
// console.log('newLink',newLink);
// this.qrCodeUrl = newLink
// this.showImg = true
// this.isOrderLoading = true,
// this.posterImgType = 'orderPoster'
// return
// }
// 因为是从家办商城小程序跳转到cffp的,所以这里购买要带家办商城的token,
let
dataToken
=
uni
.
getStorageSync
(
'dataToken'
)
console
.
log
(
'家办商城dataToken'
,
dataToken
);
this
.
posterShareTxt
=
'保存图片扫码下单'
this
.
posterDesTxt
=
'扫码下单'
let
newLink
=
shareURL
+
`/pages/orderConfirm/orderConfirm?fileId=
${
this
.
fileId
}
&orderId=
${
this
.
orderId
}
&userId=
${
this
.
userId
}
&dataToken=
${
encodeURIComponent
(
dataToken
)}
`
// let newLink = shareURL + `/pages/lanch/index?fileId=${this.fileId}&orderId=${this.orderId}&userId=${this.userId}&dataToken=${encodeURIComponent(dataToken)}&landingPage=orderConfirm`
console
.
log
(
'newLink'
,
newLink
);
this
.
qrCodeUrl
=
newLink
this
.
showImg
=
true
this
.
isOrderLoading
=
true
,
this
.
posterImgType
=
'orderPoster'
return
}
uni
.
navigateTo
({
url
:
`/pages/orderConfirm/orderConfirm?fileId=
${
this
.
fileId
}
&orderId=
${
this
.
orderId
}
&userId=
${
this
.
userId
}
`
})
...
...
pages/lanch/index.vue
View file @
f9c23c43
...
...
@@ -93,8 +93,6 @@
}
else
if
(
landingPage
==
'sfpIndex'
)
{
uni
.
reLaunch
({
url
:
`/sfp/index/index`
})
}
else
if
(
landingPage
==
'orderStatus'
)
{
uni
.
reLaunch
({
url
:
`/pages/orderStatus/orderStatus?orderStatus=2`
})
}
else
if
(
landingPage
==
'courseDetail'
)
{
if
(
jumpInfo
.
value
.
noShare
){
uni
.
reLaunch
({
url
:
`/pages/courseDetail/courseDetail?fileId=
${
jumpInfo
.
value
.
fileId
}
&noShare=1`
})
...
...
@@ -123,6 +121,10 @@
uni
.
reLaunch
({
url
:
'/pages/personalCenter/personalCenter'
})
}
else
if
(
landingPage
==
'orderStatus'
){
uni
.
reLaunch
({
url
:
`/pages/orderStatus/orderStatus?orderId=
${
jumpInfo
.
value
.
orderId
}
&fileId=
${
jumpInfo
.
value
.
fileId
}
&orderStatus=2&userId=
${
res
.
data
.
userId
}
`
})
}
}
else
{
uni
.
showToast
({
...
...
pages/orderConfirm/orderConfirm.vue
View file @
f9c23c43
...
...
@@ -255,7 +255,6 @@
isPayOrAuth
:
''
,
fileId
:
this
.
fileId
,
companyType
:
companyInfo
.
companyType
,
hiddenPage
:
'cffpH5Pay'
}
if
(
this
.
paymentMethod
==
1
)
{
// APP:微信app支付
...
...
@@ -314,20 +313,15 @@
//deviceType:PC为1,移动端为2,微信为3
if
(
this
.
deviceType
==
3
)
{
// 向小程序通信
// if(dataHandling.h5RuntimeEnv()=='wechat-miniprogram'){
// uni.setStorageSync('pendingPayOrder',JSON.stringify(param))
// console.log('向小程序通信');
// // 跳转到小程序消息接收中转页面,拉起小程序的支付
// wx.miniProgram.navigateTo({
// url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}`
// })
if
(
dataHandling
.
h5RuntimeEnv
()
==
'wechat-miniprogram'
){
this
.
paymentBtnDisabled
=
false
;
// 跳转到小程序消息接收中转页面,拉起小程序的支付
wx
.
miniProgram
.
navigateTo
({
url
:
`/myPackageA/h5Pay/appYdhomeofficePay?param=
${
encodeURIComponent
(
JSON
.
stringify
(
param
))}
`
})
//
return
//
}
return
}
let
_this
=
this
param
.
isPayOrAuth
=
1
;
api
.
wxAuthorize
(
param
).
then
((
res
)
=>
{
...
...
@@ -471,6 +465,7 @@
}).
then
(
res
=>
{
if
(
res
[
'success'
])
{
this
.
courseInfoItem
=
res
[
'data'
][
'data'
];
console
.
log
(
'this.courseInfoItem'
,
this
.
courseInfoItem
);
}
})
},
...
...
util/fiveshare.ts
View file @
f9c23c43
...
...
@@ -15,7 +15,7 @@ export function initJssdkShare(callback, url) {
url
:
url
,
systemType
:
uni
.
getStorageSync
(
'addSystemType'
)
||
'1'
};
// 后端的自定义分享接口,拿到分享的appId、signature等信息
api
.
Wxshare
(
WxConfigRequestVO
).
then
(
res
=>
{
jWeixin
.
config
({
debug
:
false
,
// 生产环境关闭调试
...
...
@@ -81,7 +81,7 @@ export function setWechatShare(data) {
});
});
}
// data是穿的参数 url是当前页面的链接
//
在页面上直接调用此方法实现h5的自定义分享
data是穿的参数 url是当前页面的链接
export
function
hshare
(
data
,
url
){
console
.
log
(
'data,url'
,
data
,
url
);
// 确保分享的链接不包含时间戳
...
...
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