From d53f5e02793bcbf51bd40adfe007b24207ec8b42 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Mon, 19 May 2025 09:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 + components/payment/payment.vue | 267 ++-- main.js | 10 +- manifest.json | 545 ++++---- pages.json | 17 +- pages/buy/buy.css | 1 + pages/buy/buy.vue | 82 +- pages/buy/wu_you_status.vue | 352 ++++++ pages/index/index.vue | 2129 ++++++++++++++++++++++---------- pages/index/index3.vue | 665 ++++++++++ static/icon_paying.svg | 1 + 11 files changed, 3010 insertions(+), 1061 deletions(-) create mode 100644 pages/buy/wu_you_status.vue create mode 100644 pages/index/index3.vue create mode 100644 static/icon_paying.svg diff --git a/App.vue b/App.vue index 3fe5a0f..576a6e8 100644 --- a/App.vue +++ b/App.vue @@ -8,10 +8,12 @@ data: { // 基础配置 // 数据接口请求地址 + // request_url: 'http://192.168.1.43:7777/', // request_url: env == 'development' ? '/api/' : 'https://store.sxczgkj.com/', request_url: 'https://store.sxczgkj.com/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) + // static_url: 'http://192.168.1.43:7777/', // static_url: env == 'development' ? '/api/' : 'https://store.sxczgkj.com/', static_url: 'https://store.sxczgkj.com/', diff --git a/components/payment/payment.vue b/components/payment/payment.vue index f2785cf..1f9a4fe 100644 --- a/components/payment/payment.vue +++ b/components/payment/payment.vue @@ -301,8 +301,10 @@ cancelText: self.$t('common.not_yet'), success(res) { if (res.confirm) { + console.log('1111111111111111'); self.pay_handle_event(order_id, payment_id); } else { + console.log('22222222222222'); self.order_item_pay_fail_handle(null, order_id, self.$t('paytips.paytips.6mpsl7')); } }, @@ -317,6 +319,8 @@ // 支付处理 pay_handle_event(order_id, payment_id = 0) { + console.log('pay_handle_event===', order_id); + // 没有指定支付方式则不匹配支付标识 var payment = null; if ((payment_id || 0) != 0) { @@ -338,128 +342,138 @@ } } - // 请求数据 - var post_data = { - [this.propPayDataKey]: order_id, - payment_id: payment_id || this.payment_id, - }; - // h5自定义重定向地址 - // #ifdef H5 - var redirect_url = app.globalData.page_url_protocol(this.propToAppointPage || app.globalData.get_page_url(false)); - post_data['redirect_url'] = encodeURIComponent(base64.encode(redirect_url)); - // 存在支付标识、指定支付方式使用respond_url返回地址、移除重定向地址 - if (payment != null) { - var respond_arr = ['PayPal', 'UniPayment']; - if (respond_arr.indexOf(payment.payment) != -1) { - post_data['respond_url'] = post_data['redirect_url']; - delete post_data['redirect_url']; - } - } - // #endif - // 请求支付接口 - uni.showLoading({ - title: this.$t('payment.payment.e1f54e'), - mask: true, - }); - if (this.propPayUrl) { - uni.request({ - url: this.propPayUrl, - method: 'POST', - data: { - ...post_data, - wechat_open_id: localStorage.getItem('web_openid'), - }, - dataType: 'json', - success: (res) => { - uni.hideLoading(); - var data = res.data.data; - this.setData({ - pay_response_data: data || {}, - }); - if (res.data.code == 0) { - // 是否直接支付成功 - if ((data.is_success || 0) == 1) { - // 数据设置 - this.order_item_pay_success_handle(data, order_id, false); - app.globalData.showToast(this.$t('paytips.paytips.679rxu'), 'success'); - setTimeout(() => { - this.to_success_page_event(); - }, 2000); - } else { - // 支付方式类型 - let payment_type = Number(data.is_payment_type || 0); - switch (payment_type) { - // 正常线上支付 - case 0: - // #ifdef APP - this.app_pay_handle(this, data, order_id); - // #endif - // #ifdef MP-TOUTIAO - // 头条是否非普通版本支持 - if (parseInt(data.data.pay_type || 0) == 1) { - this.toutiao_transaction_pay_handle(this, data, order_id); - } else { - this.mp_pay_handle(this, data, order_id); - } - // #endif - // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU - this.mp_pay_handle(this, data, order_id); - // #endif - // #ifdef MP-KUAISHOU - this.kuaishou_pay_handle(this, data, order_id); - // #endif - // #ifdef MP-QQ - this.qq_pay_handle(this, data, order_id); - // #endif - // #ifdef H5 - this.h5_pay_handle(this, data, order_id); - // #endif - break; - // 线下支付 - case 1: - // 现金支付 - let self = this; - uni.showModal({ - content: res.data.msg, - showCancel: false, - confirmText: self.$t('common.confirm'), - success(res) { - if (res.confirm) { - self.to_other(order_id); - } else { - self.order_item_pay_fail_handle(data, order_id, self.$t('paytips.paytips.6mpsl7')); - } - }, - }); - break; - // 钱包支付 - case 2: - this.order_item_pay_success_handle(data, order_id); - break; - // 默认 - default: - app.globalData.showToast(this.$t('payment.payment.vhx5dv')); - } - } - } else { - // 是否返回html代码展示、则提示错误 - if (res.data.code == -6666 && (data || null) != null) { - this.setData({ - popup_view_pay_data: data, - popup_view_pay_html_is_show: true, - }); - } else { - this.order_item_pay_fail_handle(data, order_id, res.data.msg); - } - } - }, - fail: (res) => { - uni.hideLoading(); - app.globalData.showToast(this.$t('common.internet_error_tips')); - }, + // 从一开始就判断支付方式,如果是无忧支付直接进入支付状态判断页面 + console.log('payment===', payment); + if (payment.payment == 'IEPayPoli') { + console.log('直接进入无忧支付,开始跳转'); + uni.setStorageSync('wuyouPay', ''); + uni.redirectTo({ + url: `/pages/buy/wu_you_status?payment_id=${payment.id}&order_id=${order_id}`, }); } else { - app.globalData.showToast(this.$t('payment.payment.597s8b')); + // 请求数据 + var post_data = { + [this.propPayDataKey]: order_id, + payment_id: payment_id || this.payment_id, + }; + // h5自定义重定向地址 + // #ifdef H5 + var redirect_url = app.globalData.page_url_protocol(this.propToAppointPage || app.globalData.get_page_url(false)); + post_data['redirect_url'] = encodeURIComponent(base64.encode(redirect_url)); + // 存在支付标识、指定支付方式使用respond_url返回地址、移除重定向地址 + if (payment != null) { + var respond_arr = ['PayPal', 'UniPayment']; + if (respond_arr.indexOf(payment.payment) != -1) { + post_data['respond_url'] = post_data['redirect_url']; + delete post_data['redirect_url']; + } + } + // #endif + // 请求支付接口 + uni.showLoading({ + title: this.$t('payment.payment.e1f54e'), + mask: true, + }); + if (this.propPayUrl) { + uni.request({ + url: this.propPayUrl, + method: 'POST', + data: { + ...post_data, + wechat_open_id: localStorage.getItem('web_openid') || '', + }, + dataType: 'json', + success: (res) => { + uni.hideLoading(); + var data = res.data.data; + this.setData({ + pay_response_data: data || {}, + }); + if (res.data.code == 0) { + // 是否直接支付成功 + if ((data.is_success || 0) == 1) { + // 数据设置 + this.order_item_pay_success_handle(data, order_id, false); + app.globalData.showToast(this.$t('paytips.paytips.679rxu'), 'success'); + setTimeout(() => { + this.to_success_page_event(); + }, 2000); + } else { + // 支付方式类型 + let payment_type = Number(data.is_payment_type || 0); + switch (payment_type) { + // 正常线上支付 + case 0: + // #ifdef APP + this.app_pay_handle(this, data, order_id); + // #endif + // #ifdef MP-TOUTIAO + // 头条是否非普通版本支持 + if (parseInt(data.data.pay_type || 0) == 1) { + this.toutiao_transaction_pay_handle(this, data, order_id); + } else { + this.mp_pay_handle(this, data, order_id); + } + // #endif + // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU + this.mp_pay_handle(this, data, order_id); + // #endif + // #ifdef MP-KUAISHOU + this.kuaishou_pay_handle(this, data, order_id); + // #endif + // #ifdef MP-QQ + this.qq_pay_handle(this, data, order_id); + // #endif + // #ifdef H5 + this.h5_pay_handle(this, data, order_id); + // #endif + break; + // 线下支付 + case 1: + // 现金支付 + let self = this; + uni.showModal({ + content: res.data.msg, + showCancel: false, + confirmText: self.$t('common.confirm'), + success(res) { + if (res.confirm) { + self.to_other(order_id); + } else { + self.order_item_pay_fail_handle(data, order_id, self.$t('paytips.paytips.6mpsl7')); + } + }, + }); + break; + // 钱包支付 + case 2: + this.order_item_pay_success_handle(data, order_id); + break; + // 默认 + default: + app.globalData.showToast(this.$t('payment.payment.vhx5dv')); + } + } + } else { + // 是否返回html代码展示、则提示错误 + if (res.data.code == -6666 && (data || null) != null) { + this.setData({ + popup_view_pay_data: data, + popup_view_pay_html_is_show: true, + }); + } else { + this.order_item_pay_fail_handle(data, order_id, res.data.msg); + } + } + }, + fail: (res) => { + uni.hideLoading(); + app.globalData.showToast(this.$t('common.internet_error_tips')); + }, + }); + } else { + app.globalData.showToast(this.$t('payment.payment.597s8b')); + } } }, // APP支付 @@ -668,6 +682,7 @@ }, // h5支付处理 h5_pay_handle(self, data, order_id) { + console.log('h5_pay_handle===', order_id); // 字符串则为跳转地址直接进入 if (typeof data.data == 'string') { window.location.href = data.data; @@ -729,6 +744,18 @@ // onBridgeReady(); // } } + + // 无忧支付 + if (data.payment.payment == 'IEPayPoli') { + console.log('无忧支付order_id===', order_id); + console.log('无忧支付===', data); + uni.setStorageSync('wuyouPay', ''); + uni.redirectTo({ + url: `/pages/buy/wu_you_status?payment_id=${data.payment.id}&order_id=${order_id}`, + }); + return; + } + // 二维码展示 if ((data.data.qrcode_url || null) != null && (data.data.name || null) != null && (data.data.order_no || null) != null) { status = true; diff --git a/main.js b/main.js index 8f91fb6..e392297 100644 --- a/main.js +++ b/main.js @@ -11,9 +11,15 @@ import i18n from './locale/index' // 全局icon组件 import iconfont from './components/iconfont/iconfont.vue' -// #ifdef MP-WEIXIN +// #ifdef H5 +// 在组件或JS文件中使用 import Vconsole from 'vconsole'; -new Vconsole() +if (process.env.NODE_ENV === 'development') { + console.log('当前是开发环境'); +} else { + console.log('当前是生产环境'); + // new Vconsole() +} // #endif diff --git a/manifest.json b/manifest.json index 39bc4d4..a510737 100644 --- a/manifest.json +++ b/manifest.json @@ -1,279 +1,278 @@ { - "name" : "ShopXO", - "appid" : "__UNI__F095115", - "description" : "ShopXO开源商城、MIT协议、可商用、可二次开发、满足99%电商运营需求", - "versionName" : "1.0.0", - "versionCode" : 100, - "transformPx" : false, - "app-plus" : { - "usingComponents" : true, - "nvueCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - "modules" : { - "Payment" : {}, - "Barcode" : {}, - "OAuth" : {}, - "Maps" : {}, - "Geolocation" : {}, - "Share" : {}, - "VideoPlayer" : {}, - "Camera" : {} - }, - "distribute" : { - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "targetSdkVersion" : 30, - "minSdkVersion" : 23 - }, - "ios" : { - "dSYMs" : false, - "privacyDescription" : { - "NSPhotoLibraryUsageDescription" : "获取用户手机相册用于提供相册图片素材", - "NSPhotoLibraryAddUsageDescription" : "将图片保存至手机相册", - "NSCameraUsageDescription" : "获取用户手机相册用于快捷拍照功能", - "NSLocationWhenInUseUsageDescription" : "该应用需要您的地理位置,以便为你提供当前位置信息", - "NSLocationAlwaysUsageDescription" : "该应用需要您的地理位置,以便为你提供当前位置信息", - "NSLocationAlwaysAndWhenInUseUsageDescription" : "该应用需要持续获取用户地理位置,以便为您提供实时的位置信息" - } - }, - "sdkConfigs" : { - "payment" : { - "alipay" : { - "__platform__" : [ "ios", "android" ] - }, - "weixin" : { - "__platform__" : [ "ios", "android" ], - "appid" : "wx3bac19ff90c0a976", - "UniversalLinks" : "https://d1.shopxo.vip/.well-known/" - }, - "paypal" : { - "__platform__" : [ "ios", "android" ], - "returnURL_ios" : "com.shopxo.mm://paypal", - "returnURL_android" : "com.shopxo.mm://paypal" - } - }, - "ad" : {}, - "oauth" : { - "univerify" : {}, - "apple" : {}, - "weixin" : { - "appid" : "wx3bac19ff90c0a976", - "appsecret" : "91f132b39c5c575fe61b04993c57c734", - "UniversalLinks" : "https://d1.shopxo.vip/.well-known/" - }, - "qq" : { - "appid" : "102076195", - "UniversalLinks" : "https://d1.shopxo.vip/.well-known/" - }, - "google" : { - "clientid" : "510187709509-fq3t5grcfh81t4ub491tiadrtfjbaes1.apps.googleusercontent.com" - } - }, - "maps" : { - "amap" : { - "name" : "amapu9VF72Gg", - "appkey_ios" : "f55e9099897821681f5c74051e4527bd", - "appkey_android" : "ebe9f1d84f8ceb8b3c4ba6ead2bfa78b" - } - }, - "geolocation" : { - "system" : { - "__platform__" : [ "ios", "android" ] - } - }, - "share" : { - "weixin" : { - "appid" : "wx3bac19ff90c0a976", - "UniversalLinks" : "https://d1.shopxo.vip/.well-known/" - }, - "qq" : { - "appid" : "102076195", - "UniversalLinks" : "https://d1.shopxo.vip/.well-known/" - } - }, - "push" : {} - }, - "icons" : { - "android" : { - "hdpi" : "unpackage/res/icons/72x72.png", - "xhdpi" : "unpackage/res/icons/96x96.png", - "xxhdpi" : "unpackage/res/icons/144x144.png", - "xxxhdpi" : "unpackage/res/icons/192x192.png" - }, - "ios" : { - "appstore" : "unpackage/res/icons/1024x1024.png", - "ipad" : { - "app" : "unpackage/res/icons/76x76.png", - "app@2x" : "unpackage/res/icons/152x152.png", - "notification" : "unpackage/res/icons/20x20.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "proapp@2x" : "unpackage/res/icons/167x167.png", - "settings" : "unpackage/res/icons/29x29.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "spotlight" : "unpackage/res/icons/40x40.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png" - }, - "iphone" : { - "app@2x" : "unpackage/res/icons/120x120.png", - "app@3x" : "unpackage/res/icons/180x180.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "notification@3x" : "unpackage/res/icons/60x60.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "settings@3x" : "unpackage/res/icons/87x87.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png", - "spotlight@3x" : "unpackage/res/icons/120x120.png" - } - } - }, - "splashscreen" : { - "useOriginalMsgbox" : true - } - } - }, - "quickapp" : {}, - "mp-weixin" : { - "requiredPrivateInfos" : [ - "chooseLocation", - "getLocation", - "chooseAddress", - "onLocationChange", - "startLocationUpdate", - "startLocationUpdateBackground" - ], - "appid" : "wxda7779770f53e901", - "setting" : { - "urlCheck" : false, - "es6" : true, - "minified" : true, - "ignoreDevUnusedFiles" : false, - "ignoreUploadUnusedFiles" : false - }, - "usingComponents" : true, - "permission" : { - "scope.userLocation" : { - "desc" : "你的位置将用于小程序中相应业务位置服务使用" - } - }, - "__usePrivacyCheck__" : true, - "plugins" : {} - }, - // 腾讯地图路线规划插件(需要到小程序后台设置->第三方设置->插件管理里面添加【腾讯位置服务路线规划】插件,教程 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a) - // "routePlan" : { - // "version" : "1.0.19", - // "provider" : "wx50b5593e81dd937a" - // }, - // 直播(需要到小程序后台设置->第三方设置->插件管理里面添加【小程序直播组件】插件,教程 https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx2b03c6e691cd7370) - // "live-player-plugin" : { - // "version" : "1.3.5", - // "provider" : "wx2b03c6e691cd7370" - // } - "mp-alipay" : { - "usingComponents" : true, - "appid" : "2021001173639600" - }, - "mp-baidu" : { - "usingComponents" : true, - "appid" : "", - "setting" : { - "urlCheck" : false - } - }, - "mp-toutiao" : { - "usingComponents" : true, - "appid" : "ttfb628ddf6458b04f", - "setting" : { - "urlCheck" : false - } - }, - "networkTimeout" : { - "request" : 10000, - "downloadFile" : 10000 - }, - "mp-qq" : { - "appid" : "1110736292", - "setting" : { - "urlCheck" : false - }, - "permission" : { - "scope.userLocation" : { - "desc" : "你的位置将用于小程序中相应业务位置服务使用" - } - } - }, - "mp-kuaishou" : { - "appid" : "ks669910446353970565" - }, - "h5" : { - "sdkConfigs" : { - "maps" : { - "qqmap" : { - "key" : "56SBZ-PCC3G-US2QM-IXYFE-4DE5H-GRBDK" - } - } - }, - "devServer" : { - "https" : false, - "port" : 8082 - // "proxy" : { - // "/api" : { - // // "target": "http://192.168.1.43:7777/", - // "target" : "https://store.sxczgkj.com/", - // "changeOrigin" : "true", - // "pathRewrite" : { - // "^/api" : "" - // } - // } - // } - }, - "router" : { - "mode" : "history", - "base" : "/h5_store/" - }, - "title" : "czg_shop", - "template" : "template.h5.html" - }, - "app" : { - "router" : { - "mode" : "history" - } - }, - "vueVersion" : "2", - "locale" : "auto" + "name": "ShopXO", + "appid": "__UNI__F095115", + "description": "ShopXO开源商城、MIT协议、可商用、可二次开发、满足99%电商运营需求", + "versionName": "1.0.0", + "versionCode": 100, + "transformPx": false, + "app-plus": { + "usingComponents": true, + "nvueCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 + }, + "modules": { + "Payment": {}, + "Barcode": {}, + "OAuth": {}, + "Maps": {}, + "Geolocation": {}, + "Share": {}, + "VideoPlayer": {}, + "Camera": {} + }, + "distribute": { + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "targetSdkVersion": 30, + "minSdkVersion": 23 + }, + "ios": { + "dSYMs": false, + "privacyDescription": { + "NSPhotoLibraryUsageDescription": "获取用户手机相册用于提供相册图片素材", + "NSPhotoLibraryAddUsageDescription": "将图片保存至手机相册", + "NSCameraUsageDescription": "获取用户手机相册用于快捷拍照功能", + "NSLocationWhenInUseUsageDescription": "该应用需要您的地理位置,以便为你提供当前位置信息", + "NSLocationAlwaysUsageDescription": "该应用需要您的地理位置,以便为你提供当前位置信息", + "NSLocationAlwaysAndWhenInUseUsageDescription": "该应用需要持续获取用户地理位置,以便为您提供实时的位置信息" + } + }, + "sdkConfigs": { + "payment": { + "alipay": { + "__platform__": ["ios", "android"] + }, + "weixin": { + "__platform__": ["ios", "android"], + "appid": "wx3bac19ff90c0a976", + "UniversalLinks": "https://d1.shopxo.vip/.well-known/" + }, + "paypal": { + "__platform__": ["ios", "android"], + "returnURL_ios": "com.shopxo.mm://paypal", + "returnURL_android": "com.shopxo.mm://paypal" + } + }, + "ad": {}, + "oauth": { + "univerify": {}, + "apple": {}, + "weixin": { + "appid": "wx3bac19ff90c0a976", + "appsecret": "91f132b39c5c575fe61b04993c57c734", + "UniversalLinks": "https://d1.shopxo.vip/.well-known/" + }, + "qq": { + "appid": "102076195", + "UniversalLinks": "https://d1.shopxo.vip/.well-known/" + }, + "google": { + "clientid": "510187709509-fq3t5grcfh81t4ub491tiadrtfjbaes1.apps.googleusercontent.com" + } + }, + "maps": { + "amap": { + "name": "amapu9VF72Gg", + "appkey_ios": "f55e9099897821681f5c74051e4527bd", + "appkey_android": "ebe9f1d84f8ceb8b3c4ba6ead2bfa78b" + } + }, + "geolocation": { + "system": { + "__platform__": ["ios", "android"] + } + }, + "share": { + "weixin": { + "appid": "wx3bac19ff90c0a976", + "UniversalLinks": "https://d1.shopxo.vip/.well-known/" + }, + "qq": { + "appid": "102076195", + "UniversalLinks": "https://d1.shopxo.vip/.well-known/" + } + }, + "push": {} + }, + "icons": { + "android": { + "hdpi": "unpackage/res/icons/72x72.png", + "xhdpi": "unpackage/res/icons/96x96.png", + "xxhdpi": "unpackage/res/icons/144x144.png", + "xxxhdpi": "unpackage/res/icons/192x192.png" + }, + "ios": { + "appstore": "unpackage/res/icons/1024x1024.png", + "ipad": { + "app": "unpackage/res/icons/76x76.png", + "app@2x": "unpackage/res/icons/152x152.png", + "notification": "unpackage/res/icons/20x20.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "proapp@2x": "unpackage/res/icons/167x167.png", + "settings": "unpackage/res/icons/29x29.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "spotlight": "unpackage/res/icons/40x40.png", + "spotlight@2x": "unpackage/res/icons/80x80.png" + }, + "iphone": { + "app@2x": "unpackage/res/icons/120x120.png", + "app@3x": "unpackage/res/icons/180x180.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "notification@3x": "unpackage/res/icons/60x60.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "settings@3x": "unpackage/res/icons/87x87.png", + "spotlight@2x": "unpackage/res/icons/80x80.png", + "spotlight@3x": "unpackage/res/icons/120x120.png" + } + } + }, + "splashscreen": { + "useOriginalMsgbox": true + } + } + }, + "quickapp": {}, + "mp-weixin": { + "requiredPrivateInfos": [ + "chooseLocation", + "getLocation", + "chooseAddress", + "onLocationChange", + "startLocationUpdate", + "startLocationUpdateBackground" + ], + "appid": "wxda7779770f53e901", + "setting": { + "urlCheck": false, + "es6": true, + "minified": true, + "ignoreDevUnusedFiles": false, + "ignoreUploadUnusedFiles": false + }, + "usingComponents": true, + "permission": { + "scope.userLocation": { + "desc": "你的位置将用于小程序中相应业务位置服务使用" + } + }, + "__usePrivacyCheck__": true, + "plugins": {} + }, + // 腾讯地图路线规划插件(需要到小程序后台设置->第三方设置->插件管理里面添加【腾讯位置服务路线规划】插件,教程 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a) + // "routePlan" : { + // "version" : "1.0.19", + // "provider" : "wx50b5593e81dd937a" + // }, + // 直播(需要到小程序后台设置->第三方设置->插件管理里面添加【小程序直播组件】插件,教程 https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx2b03c6e691cd7370) + // "live-player-plugin" : { + // "version" : "1.3.5", + // "provider" : "wx2b03c6e691cd7370" + // } + "mp-alipay": { + "usingComponents": true, + "appid": "2021001173639600" + }, + "mp-baidu": { + "usingComponents": true, + "appid": "", + "setting": { + "urlCheck": false + } + }, + "mp-toutiao": { + "usingComponents": true, + "appid": "ttfb628ddf6458b04f", + "setting": { + "urlCheck": false + } + }, + "networkTimeout": { + "request": 10000, + "downloadFile": 10000 + }, + "mp-qq": { + "appid": "1110736292", + "setting": { + "urlCheck": false + }, + "permission": { + "scope.userLocation": { + "desc": "你的位置将用于小程序中相应业务位置服务使用" + } + } + }, + "mp-kuaishou": { + "appid": "ks669910446353970565" + }, + "h5": { + "sdkConfigs": { + "maps": { + "qqmap": { + "key": "56SBZ-PCC3G-US2QM-IXYFE-4DE5H-GRBDK" + } + } + }, + "devServer": { + "https": false, + "port": 8082 + }, + // "proxy": { + // "/api": { + // "target": "http://192.168.1.43:7777/", + // // "target": "https://store.sxczgkj.com/", + // "changeOrigin": "true", + // "pathRewrite": { + // "^/api": "" + // } + // } + // }, + "router": { + "mode": "history", + "base": "/h5/" + }, + "title": "czg_shop", + "template": "template.h5.html" + }, + "app": { + "router": { + "mode": "history" + } + }, + "vueVersion": "2", + "locale": "auto" } // 匹配以 /api 开头的请求 // target: 'https://test.invoice.sxczgkj.cn/', // 替换为你的后端 API 域名 //192.168.1.43:7777/', // 替换为你的后端 API 域名 // 允许跨域 -// 重写路径,去掉 /api 前缀 - +// 重写路径,去掉 /api 前缀 \ No newline at end of file diff --git a/pages.json b/pages.json index 4bf3d1f..945884b 100644 --- a/pages.json +++ b/pages.json @@ -125,12 +125,19 @@ { "root": "pages/buy", "pages": [{ - "path": "buy", - "style": { - "enablePullDownRefresh": true, - "navigationBarTitleText": "" + "path": "buy", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "" + } + }, + { + "path": "wu_you_status", + "style": { + "navigationBarTitleText": "支付中..." + } } - }] + ] }, { "root": "pages/goods-search", diff --git a/pages/buy/buy.css b/pages/buy/buy.css index 46dd7a0..86b5207 100644 --- a/pages/buy/buy.css +++ b/pages/buy/buy.css @@ -64,6 +64,7 @@ */ .payment-list .item-content { padding: 20rpx 0; + display: flex; } .payment-list .item-content .icon { width: 40rpx; diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue index f231dfe..7082c52 100644 --- a/pages/buy/buy.vue +++ b/pages/buy/buy.vue @@ -268,7 +268,7 @@ - + {{ item.name }} {{ item.tips }} @@ -508,7 +508,7 @@ is_realstore_model: (params.realstore_id || null) != null, plugins_points_status: app.globalData.get_config('plugins_base.points.data.is_default_use_points', null) == 1, // pay_url: app.globalData.get_request_url('pay', 'order'), - pay_url: app.globalData.get_request_url('getpayment', 'xo'), + // pay_url: app.globalData.get_request_url('getpayment', 'xo'), qrcode_url: app.globalData.get_request_url('paycheck', 'order'), }); @@ -625,44 +625,54 @@ }, // 发起支付请求 async onPay(order_id, payment_id = 0, payment_list) { - console.log('发起支付请求', `${order_id}+${payment_id}+${JSON.stringify(payment_list)}`); + let payment = payment_list.find((item) => item.id == payment_id).payment; + if (payment == 'Weixin') { + let web_openid = localStorage.getItem('web_openid'); + this.pay_url = app.globalData.get_request_url('getpayment', 'xo'); + if (!web_openid) { + // 获取code换取web_openid + const code = this.getCodeFromUrl(); + console.log('code===', code); + if (!code) { + this.handleAuthLogin(); + return; + } + uni.request({ + url: app.globalData.get_request_url('getwechatuserinfo', 'xo'), + method: 'GET', + data: { + code: code, + }, + dataType: 'json', + success: (res) => { + console.log('获取微信web_openid===', res.data); + if (res.data.code == 0) { + let data = res.data.data; + localStorage.setItem('web_openid', data.openid); - let web_openid = localStorage.getItem('web_openid'); - console.log('onPay.web_openid===', web_openid); - if (!web_openid) { - // 获取code换取web_openid - const code = this.getCodeFromUrl(); - console.log('code===', code); - if (!code) { - this.handleAuthLogin(); - return; + this.$refs.payment.pay_handle(order_id, payment_id, payment_list); + } else { + this.setData({ + data_list_loding_status: 2, + data_list_loding_msg: res.data.msg, + }); + } + }, + }); + } else { + // 直接走支付流程 + console.log('直接走支付流程'); + this.$refs.payment.pay_handle(order_id, payment_id, payment_list); } - uni.request({ - url: app.globalData.get_request_url('getwechatuserinfo', 'xo'), - method: 'GET', - data: { - code: code, - }, - dataType: 'json', - success: (res) => { - console.log('获取微信web_openid===', res.data); - if (res.data.code == 0) { - let data = res.data.data; - localStorage.setItem('web_openid', data.openid); + } - this.$refs.payment.pay_handle(order_id, payment_id, payment_list); - } else { - this.setData({ - data_list_loding_status: 2, - data_list_loding_msg: res.data.msg, - }); - } - }, + if (payment == 'IEPayPoli') { + console.log('开始无忧支付===', order_id); + + this.pay_url = app.globalData.get_request_url('wuYouPay', 'xo'); + this.$nextTick(() => { + this.$refs.payment.pay_handle(order_id, payment_id, payment_list); }); - } else { - // 直接走支付流程 - console.log('直接走支付流程'); - this.$refs.payment.pay_handle(order_id, payment_id, payment_list); } }, // 初始化配置 diff --git a/pages/buy/wu_you_status.vue b/pages/buy/wu_you_status.vue new file mode 100644 index 0000000..410441f --- /dev/null +++ b/pages/buy/wu_you_status.vue @@ -0,0 +1,352 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index dff2f97..8b9c677 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,665 +1,1544 @@ + + diff --git a/pages/index/index3.vue b/pages/index/index3.vue new file mode 100644 index 0000000..dff2f97 --- /dev/null +++ b/pages/index/index3.vue @@ -0,0 +1,665 @@ + + + diff --git a/static/icon_paying.svg b/static/icon_paying.svg new file mode 100644 index 0000000..5ac9fe6 --- /dev/null +++ b/static/icon_paying.svg @@ -0,0 +1 @@ + \ No newline at end of file