Commit f9c23c43 by yuzhenWang

对接拉起小程序支付

parent 028a53b5
......@@ -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
......@@ -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}`
})
......
......@@ -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({
......
......@@ -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);
}
})
},
......
......@@ -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);
// 确保分享的链接不包含时间戳
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment