unknown
7 months ago
15 changed files with 243 additions and 203 deletions
-
35App.vue
-
6README.md
-
32common/js/qqLatLng.js
-
4config/request.js
-
4config/site.config.js
-
23manifest.json
-
10pages.json
-
62pages/indexEntry/enroll/payment/payh5.vue
-
89pages/indexEntry/enroll/payment/payment.vue
-
2pages/indexEntry/enroll/registInfo/registInfo.vue
-
99pages/indexEntry/enroll/signContract/webView.vue
-
1pages/tabbar/index/index.vue
-
4pages/tabbar/learnCar/comp/topInfo.vue
-
19pages/tabbar/mine/index.vue
-
48store/modules/user.js
@ -0,0 +1,6 @@ |
|||
|
|||
易收宝对接文档: [](https://docs.qq.com/doc/DSFJKS01tTlVVUkZU) |
|||
|
|||
小程序的appid:wx9e7d9eea420f6541 |
|||
|
|||
中原聚端的appid: wxe8bb3f7b8cf30362 |
@ -0,0 +1,62 @@ |
|||
<template> |
|||
<view class=""> |
|||
<web-view :src="$store.state.webViewUrl" @onPostMessage="postMessage" @message="postMessage"></web-view> |
|||
<!-- <web-view src="http://192.168.1.44:92/vue/wxStudentCertificate3" @onPostMessage="postMessage" @message="postMessage"></web-view> --> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
onLoad() { |
|||
this.initWx() |
|||
}, |
|||
methods: { |
|||
postMessage(res) { |
|||
console.log('监听到了') |
|||
let item = res.detail.data[0] |
|||
console.log(res) |
|||
console.log('监听到的发送事件') |
|||
console.log(item) |
|||
if(item.action=='lyxc-wxPay') { |
|||
this.$u.toast('用户点击了微信支付') |
|||
this.wxPay(item) |
|||
}else if(item.action=='lyxc-paySuccess') { |
|||
this.$u.toast('支付完成,app跳转页面吧') |
|||
} |
|||
}, |
|||
// "action": "lyxc-wxPay", |
|||
// "miniProgramType": 2, |
|||
// "miniAppId": "gh_89b377cbc340", |
|||
// "path": "/pages/wxPayOnly/wxPayOnly?channelNo=QD202404083509&orderNo=20240423170705024771&inpartNo=820198016000045&merchantName=中原智慧新校园&amount=1&redMsg=&payType=04" |
|||
wxPay(item) { |
|||
console.log(item) |
|||
// #ifdef APP-PLUS |
|||
this.sweixin ? this.sweixin.launchMiniProgram({ |
|||
path: item.path, //跳转小程序页面路径 pages/index/index |
|||
type: item.miniProgramType, //可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0。 |
|||
id: item.miniAppId //小程序的原始id |
|||
}) : plus.nativeUI.alert('当前环境不支持微信操作!'); |
|||
// #endif |
|||
}, |
|||
initWx() { |
|||
// #ifdef APP-PLUS |
|||
plus.share.getServices((s) => { |
|||
var shares = {}; |
|||
for (var i = 0; i < s.length; i++) { |
|||
var t = s[i]; |
|||
console.log("...........", t); |
|||
shares[t.id] = t; |
|||
} |
|||
var sweixin = shares['weixin']; |
|||
this.sweixin = sweixin |
|||
}, function(e) { |
|||
console.log("获取分享服务列表失败:" + e.message); |
|||
}); |
|||
// #endif |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -1,99 +0,0 @@ |
|||
<template> |
|||
<view class="page-web"> |
|||
<!-- 签署合同webview --> |
|||
<view class="page-inner"> |
|||
<web-view :src="$store.state.webViewUrl" @message="message" @onPostMessage="handlePostMessage"></web-view> |
|||
</view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import learnDriveApi from '@/api/learnDrive.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
title: '加载中...', |
|||
trainingApplyId: '' |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
this.trainingApplyId = options.id |
|||
let _this = this |
|||
// const currentWebview = _this.$mp.page.$getAppWebview(); |
|||
|
|||
this.shang() |
|||
}, |
|||
mounted() { |
|||
|
|||
}, |
|||
methods: { |
|||
shang() { |
|||
let _this = this |
|||
var currentWebview = this.$scope.$getAppWebview(); |
|||
setTimeout(()=>{ |
|||
console.log('currentWebview') |
|||
console.log(currentWebview) |
|||
let wv = currentWebview.children()[0] |
|||
wv.addEventListener('loaded', async function () { |
|||
let webVeiwUrl = wv.getURL() |
|||
console.log(webVeiwUrl) |
|||
var reg = RegExp(/wait/i);//signaturecallback |
|||
if(reg.test(webVeiwUrl)){ |
|||
console.log('匹配成功了') |
|||
uni.navigateTo({ |
|||
url: '/pages/learnDriveStep/payMoney/payMoney?trainingApplyId='+_this.trainingApplyId |
|||
}) |
|||
} |
|||
|
|||
console.log('监听到了————————————————————') |
|||
|
|||
}, false); |
|||
},500) |
|||
|
|||
}, |
|||
|
|||
|
|||
handlePostMessage(e) { |
|||
console.log('好消息' + e) |
|||
} |
|||
}, |
|||
onReady() { |
|||
// #ifdef APP-PLUS |
|||
// var wv; |
|||
// var height = 0; |
|||
|
|||
// uni.getSystemInfo({ |
|||
// //成功获取的回调函数,返回值为系统信息 |
|||
// success: (sysinfo) => { |
|||
|
|||
// height = sysinfo.windowHeight; //自行修改,自己需要的高度 此处如底部有其他内容,可以直接---(-50)这种 |
|||
// }, |
|||
// complete: () => {} |
|||
// }); |
|||
// var currentWebview = this.$scope |
|||
// .$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效 |
|||
// console.log(height) |
|||
// setTimeout(function() { |
|||
// wv = currentWebview.children()[0] |
|||
// wv.setStyle({ |
|||
// top: 70, |
|||
// height: height |
|||
// }) |
|||
// }, 1000); //如果是页面初始化调用时,需要延时一下 |
|||
// #endif |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.page-web { |
|||
flex: 1; |
|||
width: 100%; |
|||
flex-direction: column; |
|||
} |
|||
|
|||
.page-inner { |
|||
flex: 1; |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue