diff --git a/App.vue b/App.vue index 935025d..21a69d4 100644 --- a/App.vue +++ b/App.vue @@ -11,6 +11,44 @@ }, onShow: function() { console.log('App Show') + // 1. uni-app 中通过 uni.getEnterOptionsSync() 调用(和微信小程序API一致,只是前缀改为uni) + const options = uni.getEnterOptionsSync(); + console.log("查询到的返回数据") + console.log(options) + + // 2. 注意:scene 返回的是数字类型,不是字符串!原生代码中写 '1038' 会导致判断失败 + if (options.scene === 1038 && + options.referrerInfo?.appId === 'wxef277996acc166c3') { + + // 从收银台小程序返回的逻辑 + const extraData = options.referrerInfo.extraData; + + if (!extraData) { + uni.showToast({ + title: '当前通过物理按键返回,未接收到返参,建议自行查询交易结果', + icon: 'none', + duration: 3000 + }); + } else { + if (extraData.code === 'success') { + uni.showToast({ + title: '支付成功', + icon: 'success' + }); + } else if (extraData.code === 'cancel') { + uni.showToast({ + title: '支付已取消', + icon: 'none' + }); + } else { + uni.showToast({ + title: `支付失败:${extraData.errmsg || '未知错误'}`, + icon: 'none', + duration: 3000 + }); + } + } + } }, onHide: function() { console.log('App Hide') @@ -19,7 +57,7 @@ // 检查登录状态 checkLoginStatus() { const token = uni.getStorageSync('token') - + // 如果有token,且当前在登录页,则跳转到首页 if (token) { // 延迟一下,确保页面已经初始化 @@ -27,7 +65,7 @@ const pages = getCurrentPages() const currentPage = pages[pages.length - 1] const currentRoute = currentPage ? currentPage.route : '' - + // 如果当前在登录页,跳转到首页 if (currentRoute === 'pages/login/login') { uni.switchTab({ @@ -49,4 +87,4 @@ + \ No newline at end of file diff --git a/api/service.js b/api/service.js index faaefd3..199c854 100644 --- a/api/service.js +++ b/api/service.js @@ -46,4 +46,12 @@ export function getMessagePage(params = {}) { method: 'GET', data: params, }) +} +// 获取支付的签名 +export function getPaySign(params = {}){ + return request({ + url: '/app-api/member/labor-union-pay-record/sign', + method: 'GET', + data: params, + }) } \ No newline at end of file diff --git a/manifest.json b/manifest.json index a2ccaed..eeff3f4 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { - "name" : "demo", - "appid" : "wxa3c0e1381f643f59", + "name" : "司机公会用户端", + "appid" : "__UNI__BD011FB", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -52,12 +52,11 @@ "mp-weixin" : { "appid" : "wxa3c0e1381f643f59", "setting" : { - "urlCheck" : false + "urlCheck" : false, + "minified" : true }, "usingComponents" : true, - "requiredPrivateInfos" : [ - "getLocation" - ], + "requiredPrivateInfos" : [ "getLocation" ], "permission" : { "scope.userLocation" : { "desc" : "你的位置信息将用于小程序位置接口的效果展示" @@ -71,7 +70,8 @@ "usingComponents" : true }, "mp-toutiao" : { - "usingComponents" : true + "usingComponents" : true, + "appid" : "" }, "uniStatistics" : { "enable" : false diff --git a/pages/detail/serviceDetail.vue b/pages/detail/serviceDetail.vue index 8dfdd21..b5ae9e9 100644 --- a/pages/detail/serviceDetail.vue +++ b/pages/detail/serviceDetail.vue @@ -118,7 +118,7 @@