From 51ba0af8b615cc710ab49e3c87ad930a58df4ca5 Mon Sep 17 00:00:00 2001 From: xuyu <1272542526@qq.com> Date: Sat, 11 May 2024 22:45:47 +0800 Subject: [PATCH] xg --- .idea/php.xml | 19 +++++++++++++++++++ manifest.json | 2 +- pages/special/order.vue | 9 +++++---- utils/utils.js | 34 ++++++++++++++++++++++++++-------- 4 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 .idea/php.xml diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..f324872 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json index a78115e..fa7e183 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "梦航学习宝", - "appid" : "__UNI__640EC10", + "appid" : "__UNI__411F00F", "description" : "1.1.5", "versionName" : "1.0.15", "versionCode" : 115, diff --git a/pages/special/order.vue b/pages/special/order.vue index 592eec0..90026c4 100644 --- a/pages/special/order.vue +++ b/pages/special/order.vue @@ -350,7 +350,8 @@ this.extendOrder(data.msg); break; case "WECHAT_PAY": - this.wechatPay(data.data.result.jsConfig); + // this.wechatPay(data.data.result.jsConfig); + this.$util.weixinAppPay(data.data.result.jsConfig,this); break; case "WECHAT_ROUTINE_PAY": this.$util.wechatRoutinePay(data.data.result.jsConfig, this); @@ -433,7 +434,7 @@ .showNavBg { background: #fff!important; } - // #ifdef MP-WEIXIN + // #ifdef MP-WEIXIN .base-container { background: transparent!important; padding-bottom: calc(0rpx + var(--safe-top))!important; @@ -571,7 +572,7 @@ font-size: 26rpx; color: #868686; } - + .order-detail .section.goods { width: 690rpx; margin: 20rpx auto 0; @@ -827,4 +828,4 @@ .footer-btn+.footer-btn { margin-left: 8rpx; } - \ No newline at end of file + diff --git a/utils/utils.js b/utils/utils.js index 295adec..1cdcbdc 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -171,10 +171,10 @@ export default { }); }, /** - * + * * @param {int} support_type 咨询内容类型 * @param {int} id 商品/订单ID - * @param {int} type 商品/订单类型 + * @param {int} type 商品/订单类型 */ goSupport(support_type = 0, type = 0, id = 0 ,mer_id = 0) { this.checkLogin(() => { @@ -262,7 +262,7 @@ export default { // #ifdef MP-TOUTIAO setTimeout(() => { this.showMsg("请点击头像登录") - }, 1000); + }, 1000); return uni.switchTab({ url: "/pages/mine/index" }); @@ -529,6 +529,24 @@ export default { }, 1000); }, + weixinAppPay(jsConfig, vm) { + uni.showLoading({ + title: '支付中' + }); + uni.requestPayment({ + provider: 'wxpay', + orderInfo: jsConfig, + success: function (res) { + vm.successOrder(); + }, + fail: function (err) { + vm.extendOrder() + }, + complete: () => { + uni.hideLoading(); + }, + }) + }, weixinpay(config, vm) { WeixinJSBridge.invoke( 'getBrandWCPayRequest', config, @@ -601,7 +619,7 @@ export default { userInfo.code = code; userInfo.spread_spid = app.globalData.spid || 0; //获取推广人ID userInfo.currentAvatar = currentAvatar || ''; - userInfo.username = username || ''; + userInfo.username = username || ''; userInfo.agent_id=app.globalData.agent_id || 0 console.log(userInfo) Routine.authUserInfo(userInfo).then(res => { @@ -616,7 +634,7 @@ export default { vm.tipIsVisable = true } }) - + }) .catch(res => { uni.hideLoading(); @@ -765,7 +783,7 @@ export default { userInfo.code = loginRes.code; userInfo.spread_spid = app.globalData.spid || 0; //获取推广人ID userInfo.agent_id=app.globalData.agent_id || 0; - // #ifdef MP-WEIXIN + // #ifdef MP-WEIXIN userInfo.type = 'weixin' // #endif // #ifndef MP-WEIXIN @@ -824,7 +842,7 @@ export default { /*#ifdef MP-KUAISHOU */ return this.getKSUserProfile(vm) /* #endif */ - // #ifdef APP-PLUS + // #ifdef APP-PLUS console.log('APP-PLUS'); // vm.loginShow = true; uni.navigateTo({ @@ -855,4 +873,4 @@ export default { let u = navigator.userAgent; return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; } -} \ No newline at end of file +}