From 2a93afc95dda6afd1479af042e178b3e84a0c8c4 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期四, 13 六月 2024 14:03:36 +0800
Subject: [PATCH] feat(支付): 修改接口统一前缀

---
 common/api/shuaka.js      |    8 ++--
 pages/pay/scanpay.vue     |    9 ++--
 manifest.json             |    3 +
 pages/pay/discountpay.vue |    9 +++-
 common/config.js          |   18 ++++----
 common/api/index.js       |   60 +++++++++++++++---------------
 6 files changed, 57 insertions(+), 50 deletions(-)

diff --git a/common/api/index.js b/common/api/index.js
index 063a7f4..4776e01 100644
--- a/common/api/index.js
+++ b/common/api/index.js
@@ -6,116 +6,116 @@
 
 /* 鑾峰彇鍟嗛摵淇℃伅 */
 export const queryShop = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/queryShopById', params, config)
+	'/payfour-merchant/v1/web/aggregatePayAllin/queryShopById', params, config)
 
 /* 鑾峰彇鎴愬姛椤甸潰閰嶇疆 */
 export const getPayCompleteUrl = (params, config = {}) => http.get(URL +
-	'/service-base/v1/base/pc/global/config/getPayCompleteUrl', params, config)
+	'/payfour-base/v1/base/pc/global/config/getPayCompleteUrl', params, config)
 
 /* 鑾峰彇绉垎浠峰�� */
 export const getScoreWorth = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getScoreWorth', params, config)
+	'/payfour-merchant/v1/web/aggregatePayAllin/getScoreWorth', params, config)
 
 /* 鑾峰彇鐢ㄦ埛閾惰鍗� */
 export const myBankCard = (params, config = {}) => http.get(URL +
-	'/service-shop/v1/shop/wechat/h5/bankCard/myBankCard', params, config)
+	'/payfour-shop/v1/shop/wechat/h5/bankCard/myBankCard', params, config)
 
 /* 鑾峰彇鍟嗛摵寰俊閰嶇疆 */
 export const getWechatInfo = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getWechatInfo', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/getWechatInfo', params, config = {});
 /* 闈欓粯鎺堟潈鐧诲綍 */
 export const getOpenIdBase = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getOpenIdBase', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/getOpenIdBase', params, config = {});
 
 /* 寰俊鏅�氭巿鏉冪櫥褰� */
-export const getOpenId = (params, config = {}) => http.get(URL + '/service-merchant/v1/web/aggregatePayAllin/getOpenId',
+export const getOpenId = (params, config = {}) => http.get(URL + '/payfour-merchant/v1/web/aggregatePayAllin/getOpenId',
 	params, config = {});
 /* 鏀粯瀹濇櫘閫氭巿鏉冪櫥褰� */
-export const getUserId = (params, config = {}) => http.get(URL + '/service-merchant/v1/web/h5PayAli/getUserIdByCode',
+export const getUserId = (params, config = {}) => http.get(URL + '/payfour-merchant/v1/web/h5PayAli/getUserIdByCode',
 	params, config = {});
 export const userLogin = (params, config = {}) => {
-	let path = '/service-merchant/v1/web/aggregatePayAllin/getOpenId'
+	let path = '/payfour-merchant/v1/web/aggregatePayAllin/getOpenId'
 	if(params.platform==5){
-		path = '/service-merchant/v1/web/h5PayAli/getUserIdByCode'
+		path = '/payfour-merchant/v1/web/h5PayAli/getUserIdByCode'
 	}
 	return http.get(URL + path,
 		params, config = {})
 };
 /* 鑾峰彇鐢ㄦ埛绉垎 */
 export const queryScore = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/queryScore', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/queryScore', params, config = {});
 /* 鑾峰彇鐢ㄦ埛鍙敤浼樻儬鍒� 闈㈠�兼渶澶х殑*/
 export const queryMyUseSweepPayMaxCoupon = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/queryMyUseSweepPayMaxCoupon', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/queryMyUseSweepPayMaxCoupon', params, config = {});
 /* 鑾峰彇鐢ㄦ埛鍙敤浼樻儬鍒� */
 export const queryUseSweepPayCoupon = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/queryUseSweepPayCoupon', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/queryUseSweepPayCoupon', params, config = {});
 
 /* 鑾峰彇寰俊js sdk閰嶇疆 */
 export const getWechatConfigInfo = (params, config = {}) => http.post(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getWechatConfigInfo', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/getWechatConfigInfo', params, config = {});
 
 /* 寰俊鏀粯 */
 export const saveWxOrder = (params, config = {}) => http.post(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/saveWxOrder', params, config = {});
-export const saveWxOrder1 = (params, config = {}) => http.post(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/saveOrder', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/saveWxOrder', params, config = {});
+export const saveOrder = (params, config = {}) => http.post(URL +
+	'/payfour-merchant/v1/web/aggregatePayAllin/saveOrder', params, config = {});
 
 /* 鍥惧舰楠岃瘉鍚� */
 export const getVerify = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getVerify', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/getVerify', params, config = {});
 
 /* 鐭俊楠岃瘉鐮� */
 export const getH5PayCheckVerifyCode = (params, config = {}) => http.post(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getH5PayCheckVerifyCode', params, config = {});
+	'/payfour-merchant/v1/web/aggregatePayAllin/getH5PayCheckVerifyCode', params, config = {});
 
 /* 寰俊鏀粯 */
-export const h5PayLogin = (params, config = {}) => http.post(URL + '/service-shop/v1/shop/web/wechat/h5PayLogin',
+export const h5PayLogin = (params, config = {}) => http.post(URL + '/payfour-shop/v1/shop/web/wechat/h5PayLogin',
 	params, config = {});
 
 /* 閫氳仈蹇嵎鏀粯 */
 export const tlPay = (params, config = {}) => http.post(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/payagreeconfirm',
+	'/payfour-merchant/v1/web/aggregatePayAllin/payagreeconfirm',
 	params, config = {});
 
 /* 寰俊鏀粯缁撴灉 */
 export const getWxOrderInfo = (params, config = {}) => http.post(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/getWxOrderInfo',
+	'/payfour-merchant/v1/web/aggregatePayAllin/getWxOrderInfo',
 	params, config = {});
 
 /* 鍒ゆ柇鏄惁鍦ㄥ崱娈靛唴 */
 export const isContain = (params, config = {}) => http.get(URL +
-	'/service-base/v1/base/pc/bankCardPeriod/isContain',
+	'/payfour-base/v1/base/pc/bankCardPeriod/isContain',
 	params, config = {});
 
 /* 鑾峰彇閾惰鍗¢厤缃� */
 export const bankCardStyle = (params, config = {}) => http.get(URL +
-	'/service-base/v1/base/pc/global/config/bankCardStyle',
+	'/payfour-base/v1/base/pc/global/config/bankCardStyle',
 	params, config = {});
 
 /* 鑾峰彇鐢ㄦ埛淇℃伅 */
 export const getUserInfo = (params, config = {}) => http.post(URL +
-	'/service-shop/v1/shop/wechat/h5/bankCard/noEnc',
+	'/payfour-shop/v1/shop/wechat/h5/bankCard/noEnc',
 	params, config = {});
 /* 鑾峰彇搴楅摵浼樻儬淇℃伅 */
 export const queryMyDiscount = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/queryMyDiscount',
+	'/payfour-merchant/v1/web/aggregatePayAllin/queryMyDiscount',
 	params, config = {});
 /* 绛剧害鐢宠缁戝崱 */
 export const signUpToApply = (params, config = {}) => http.post(URL +
-	'/service-shop/v1/shop/wechat/h5/bankCard/signUpToApply',
+	'/payfour-shop/v1/shop/wechat/h5/bankCard/signUpToApply',
 	params, config = {});
 
 /* 绛剧害鐢宠纭 */
 export const bindCard = (params, config = {}) => http.post(URL +
-	'/service-shop/v1/shop/wechat/h5/bankCard/bindCard',
+	'/payfour-shop/v1/shop/wechat/h5/bankCard/bindCard',
 	params, config = {});
 
 /* 鑾峰彇缁戝崱娲诲姩璧犻�佺殑浼樻儬鍒� */
 export const getMyCoupUseDetail = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/aggregatePayAllin/headBand/getMyCoupUseDetail',
+	'/payfour-merchant/v1/web/aggregatePayAllin/headBand/getMyCoupUseDetail',
 	params, config = {});
 /* 鑾峰彇棣栫粦鏈夌ぜ */
 export const headBand = (params, config = {}) => http.get(URL +
-	'/service-shop/v1/shop/wechat/activity/headBand/detail',
+	'/payfour-shop/v1/shop/wechat/activity/headBand/detail',
 	params, config = {});
diff --git a/common/api/shuaka.js b/common/api/shuaka.js
index 426f956..3872998 100644
--- a/common/api/shuaka.js
+++ b/common/api/shuaka.js
@@ -6,13 +6,13 @@
 
 /* 鑾峰彇鍒峰崱娲诲姩淇℃伅 */
 export const activityInfo = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/monthBrush/info', params, config)
+	'/payfour-merchant/v1/web/monthBrush/info', params, config)
 /* 鍙備笌娲诲姩 */
 export const signActivity = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/monthBrush/sign', params, config)
+	'/payfour-merchant/v1/web/monthBrush/sign', params, config)
 /* 鑾峰彇鐢ㄦ埛鍙備笌淇℃伅 */
 export const myBrushDetail = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/monthBrush/myBrushDetail', params, config)
+	'/payfour-merchant/v1/web/monthBrush/myBrushDetail', params, config)
 /* 鏌ヨ浼樻儬鍒� */
 export const orderRefBrushNode = (params, config = {}) => http.get(URL +
-	'/service-merchant/v1/web/monthBrush/orderRefBrushNode', params, config)
\ No newline at end of file
+	'/payfour-merchant/v1/web/monthBrush/orderRefBrushNode', params, config)
\ No newline at end of file
diff --git a/common/config.js b/common/config.js
index 3a4d60a..e2ebe1d 100644
--- a/common/config.js
+++ b/common/config.js
@@ -2,27 +2,27 @@
 
 // 寮�鍙�
 const dev = {
-	webURL: 'https://jmy.jinmingyuan.com/pay',
+	webURL: 'https://sfzf.cpbtsoft.cn/pay',
 	baseURL: '/dev-api',
 	sftpURL: 'https://yqzx.jinmingyuan.com/file',
-	wx_appid: 'wxe4a1e9fddc509c46',
-	ali_appid: '2021003199690698'
+	wx_appid: 'wx4c146dba764dcb05',
+	ali_appid: '2021004144693340'
 }
 // 娴嬭瘯
 const test = {
 	webURL: 'https://sfzf.cpbtsoft.cn/pay',
-	baseURL: 'https://sfzf.cpbtsoft.cn',
+	baseURL: 'https://sfzf.cpbtsoft.cn/prod-api',
 	sftpURL: 'https://sfzf.cpbtsoft.cn/file',
-	wx_appid: 'wxe4a1e9fddc509c46',
-	ali_appid: '2021003199690698'
+	wx_appid: 'wx4c146dba764dcb05',
+	ali_appid: '2021004144693340'
 }
 // 姝e紡
 const prod = {
 	webURL: 'https://jmy.jinmingyuan.com/pay',
 	baseURL: 'https://yqzx.jinmingyuan.com',
 	sftpURL: 'https://yqzx.jinmingyuan.com/file',
-	wx_appid: 'wxad8cc511da676bd4',
-	ali_appid: '2021003199690698'
+	wx_appid: 'wx4c146dba764dcb05',
+	ali_appid: '2021004144693340'
 }
 
 const cardType = {
@@ -30,7 +30,7 @@
 	'02': '淇$敤鍗�'
 }
 module.exports = {
-	config: test,
+	config: dev,
 	ACCESSTOKEN: "Authorization",
 	/* 鏄惁鎵撳嵃璇锋眰鏃ュ織 */
 	DEBUG: false,
diff --git a/manifest.json b/manifest.json
index ec9b69c..7b3df3e 100644
--- a/manifest.json
+++ b/manifest.json
@@ -86,7 +86,8 @@
                         "^/dev-api" : ""
                     }
                 }
-            }
+            },
+            "port" : ""
         },
         "optimization" : {
             "treeShaking" : {
diff --git a/pages/pay/discountpay.vue b/pages/pay/discountpay.vue
index 15038c8..59773f7 100644
--- a/pages/pay/discountpay.vue
+++ b/pages/pay/discountpay.vue
@@ -120,6 +120,7 @@
 		queryUseSweepPayCoupon,
 		getWechatConfigInfo,
 		saveWxOrder,
+    saveOrder,
 		tlPay
 	} from '@/common/api/index'
 	import wx from 'weixin-js-sdk'; // 浣跨敤js-sdk
@@ -244,7 +245,10 @@
 		onLoad(opt) {
 			this.isNew = uni.getStorageSync('IS_NEW')
 			this.cid = uni.getStorageSync('CID')
-			this.discountInfo = uni.getStorageSync('DISCOUNT_INFO')
+      if(uni.getStorageSync('DISCOUNT_INFO')){
+        this.discountInfo = uni.getStorageSync('DISCOUNT_INFO')
+      }
+
 			const token = uni.getStorageSync(ACCESSTOKEN) || null
 			if (opt.shopInfo) {
 				this.shopInfo = JSON.parse(decodeURIComponent(opt.shopInfo))
@@ -258,6 +262,7 @@
 			if (opt.money) {
 				this.money = parseFloat(opt.money).toFixed(2)
 				let dis = this.money * 100 * (1 - this.discountInfo.shopDiscount)
+        console.log('dis',dis)
 				let money = parseInt((this.money * 100 * this.discountInfo.shopDiscount))
 				if (dis < 1) {
 					money = parseInt((this.money * 100))
@@ -332,7 +337,7 @@
 				if (this.payWay == 3) {
 					params.bankCardId = this.bankCardId
 				}
-				saveWxOrder(params).then(res => {
+        saveOrder(params).then(res => {
 					uni.hideLoading()
 					try {
 						this.orderId = res.orderId
diff --git a/pages/pay/scanpay.vue b/pages/pay/scanpay.vue
index e4d5af6..dd713a0 100644
--- a/pages/pay/scanpay.vue
+++ b/pages/pay/scanpay.vue
@@ -173,6 +173,7 @@
 		queryMyUseSweepPayMaxCoupon,
 		getWechatConfigInfo,
 		saveWxOrder,
+		saveOrder,
 		tlPay
 	} from '@/common/api/index'
 	import wx from 'weixin-js-sdk'; // 浣跨敤js-sdk
@@ -418,9 +419,9 @@
 			},
 			// 鑾峰彇浼氬憳鐩稿叧淇℃伅
 			getUserInfo() {
-				this.end += 2
+				this.end += 1
 
-				queryMyDiscount({
+				/*queryMyDiscount({
 					shopId: this.shopInfo.id
 				}).then(res => {
 					this.count++
@@ -435,7 +436,7 @@
 					if (this.count >= this.end) {
 						uni.hideLoading()
 					}
-				})
+				})*/
 				/* //鑾峰彇鐢ㄦ埛閾惰鍗�
 				myBankCard().then(res => {
 					this.count++
@@ -560,7 +561,7 @@
 						params.bankCardId = this.bankCardId
 					}
 					//鐢熸垚璁㈠崟
-					saveWxOrder(params).then(res => {
+          saveOrder(params).then(res => {
 						uni.hideLoading()
 						try {
 							this.orderId = res.orderId

--
Gitblit v1.9.1