shish 2 лет назад
Родитель
Сommit
3a046fc344
2 измененных файлов с 18 добавлено и 15 удалено
  1. 13 15
      hdApp/src/admin/ghs/pay.vue
  2. 5 0
      hdApp/src/api/custom-recharge/index.js

+ 13 - 15
hdApp/src/admin/ghs/pay.vue

@@ -31,7 +31,7 @@
 	import ModalModule from '@/components/plugin/modal'
 	import ModalModule from '@/components/plugin/modal'
 	import AppCouponSel from '@/components/app-coupon-sel'
 	import AppCouponSel from '@/components/app-coupon-sel'
 	import { share } from '@/mixins'
 	import { share } from '@/mixins'
-	import { fastPay } from '@/api/pay'
+	import { rechargeFn } from '@/api/custom-recharge'
 	import { getGhsData } from '@/api/ghs'
 	import { getGhsData } from '@/api/ghs'
 	import { recharge } from '@/api/member'
 	import { recharge } from '@/api/member'
 	import { getOrderShop } from '@/utils/config'
 	import { getOrderShop } from '@/utils/config'
@@ -48,7 +48,7 @@
 				constant: this.$constant,
 				constant: this.$constant,
 				inpFocus: false,
 				inpFocus: false,
 				amount: '',
 				amount: '',
-				form: { payWay: 0 },
+				payWay: 0,
 				payCallData: null,
 				payCallData: null,
 				id:0,
 				id:0,
 				salt:'',
 				salt:'',
@@ -92,12 +92,12 @@
 						title: `点我付款`, // 分享标题
 						title: `点我付款`, // 分享标题
 						desc: '享随机优惠,最高20元', // 分享内容
 						desc: '享随机优惠,最高20元', // 分享内容
 						imgUrl: '',
 						imgUrl: '',
-						pagePath: `/pages/pay/index?account=${res.shop.id}&store=0&fromType=3`
+						pagePath: `/pages/pay/index?account=${res.shop.id}&store=0`
 					}
 					}
                     // #ifdef MP-WEIXIN
                     // #ifdef MP-WEIXIN
 					this.jweixinFn(shareParams)
 					this.jweixinFn(shareParams)
                     // #endif
                     // #endif
-					console.log(`/pages/pay/index?account=${res.shop.id}&store=0&fromType=3`)
+					console.log(`/pages/pay/index?account=${res.shop.id}&store=0`)
 				})
 				})
 			},
 			},
 			toPay() {
 			toPay() {
@@ -107,25 +107,23 @@
 				}
 				}
 				let params = {}
 				let params = {}
 				params = {
 				params = {
-					prePrice: this.amount,
-					payWay: this.form.payWay,
+					actPrice: this.amount,
+					payWay: this.payWay,
 				}
 				}
-				if (this.option.store) {
-					params.store = this.option.store
-				}
-				params.fromType = this.option.fromType || 1
 				let miniOpenId = uni.getStorageSync('miniOpenId')
 				let miniOpenId = uni.getStorageSync('miniOpenId')
 				params.miniOpenId = miniOpenId
 				params.miniOpenId = miniOpenId
-				fastPay(params).then(res => {
+				params.ghsId = this.id
+				params.salt = this.salt
+				rechargeFn(params).then(res => {
 					this.payCallData = res.data
 					this.payCallData = res.data
 					//错误返回判断
 					//错误返回判断
 					if(res.code == 0){
 					if(res.code == 0){
 						this.$msg(res.msg)
 						this.$msg(res.msg)
 						return false
 						return false
 					}
 					}
-					if (this.form.payWay == 0) {
+					if (this.payWay == 0) {
 						wexinPay(res.data, this.paySuccess, this.payFail)
 						wexinPay(res.data, this.paySuccess, this.payFail)
-					} else if (this.form.payWay == 1) {
+					} else if (this.payWay == 1) {
 						window.location.href = res.data.url;
 						window.location.href = res.data.url;
 					} else {
 					} else {
 						this.paySuccess()
 						this.paySuccess()
@@ -145,12 +143,12 @@
 			},
 			},
 			// 支付宝支付
 			// 支付宝支付
 			aliPayFn() {
 			aliPayFn() {
-				this.form.payWay = 1
+				this.payWay = 1
 				this.toPay()
 				this.toPay()
 			},
 			},
 			// 微信支付
 			// 微信支付
 			wexinPayFn() {
 			wexinPayFn() {
-				this.form.payWay = 0
+				this.payWay = 0
 				this.toPay()
 				this.toPay()
 			},
 			},
 			// 暂未设置密码
 			// 暂未设置密码

+ 5 - 0
hdApp/src/api/custom-recharge/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const rechargeFn = data => {
+	return https.post('/custom-recharge/recharge', data)
+}