shish hace 1 año
padre
commit
f3d4afb5f3

+ 1 - 1
hdApp/src/admin/member/detail.vue

@@ -364,7 +364,7 @@ export default {
         this.$msg('充值金额要大于0')
         return false
       }
-      toManRecharge({amount:this.rForm.rechargeAmount,remark:this.rForm.rechargeRemark,payWay:this.rForm.rechargePayWay}).then(res=>{
+      toManRecharge({amount:this.rForm.rechargeAmount,remark:this.rForm.rechargeRemark,payWay:this.rForm.rechargePayWay,customId:this.option.id}).then(res=>{
         if(res.code == 1){
           this.rechargeModal = false
           this.$msg('充值成功')

+ 1 - 1
hdApp/src/ext.json

@@ -4,7 +4,7 @@
   "directCommit": false,
   "ext": {
     "account": 12362,
-    "apiHost": "https://api.shop.huaml.com",
+    "apiHost": "http://api.shop.huaml.com",
     "socketApiHost": "api.shop.huaml.com",
     "imgHost": "https://img.huaml.com",
     "name":"花美玲"

+ 2 - 4
mallApp/src/api/recharge/index.js

@@ -1,11 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-//示例,要删除
-export const rechargeBalance = data => {
-    return https.get('/rechage/balance', data)
+export const rechargeFn = data => {
+    return https.post('/recharge/recharge', data)
 }
 
-//示例,要删除
 export const updateShop = data => {
     return https.post('/shop/update', data)
 }

+ 1 - 1
mallApp/src/pages/home/recent.vue

@@ -161,7 +161,7 @@ export default {
       this.pageTo({ url:'/pages/item/item?account='+item.shopId})
     },
     recharge(item){
-      this.pageTo({ url:'/pages/member/recharge?account='+item.shopId})
+      this.pageTo({ url:'/pages/member/recharge?account='+item.shopId+'&id='+item.id+'&salt='+item.salt})
     },
     init () {
         this.getShopList()

+ 45 - 14
mallApp/src/pages/member/recharge.vue

@@ -54,7 +54,7 @@ import wexinPay from '@/utils/pay/wxPay'
 import ModalModule from '@/components/plugin/modal'
 import AppCouponSel from '@/components/app-coupon-sel'
 import { share } from '@/mixins'
-import { rechargeBalance } from '@/api/recharge'
+import { rechargeFn } from '@/api/recharge'
 import { postWxCode } from '@/api/mini'
 import { getHdInfo } from '@/api/hd'
 import { getMemberWeal } from '@/api/member'
@@ -122,7 +122,38 @@ export default {
 			this.beginInit();
 		},
 		beginInit() {
-			getHdInfo().then(res=>{
+
+			let that = this
+			let id = 0
+			let salt = ''
+			if(this.option.id && this.option.salt){
+				id = this.option.id?this.option.id:0
+				salt = this.option.salt?this.option.salt:''
+			}else{
+				if(this.option.q){
+					let currentUrl = decodeURIComponent(this.option.q)
+					let str = currentUrl.substring(currentUrl.lastIndexOf("?") + 1)
+					var sceneItem = str.split("&");
+					var arr, name, value;
+					var sceneArray = new Array();
+					for (var i = 0, l = sceneItem.length; i < l; i++) {
+						arr = sceneItem[i].split("=");
+						name = arr[0];
+						value = arr[1];
+						sceneArray[name] = value;
+					}
+					if(sceneArray.id){
+						id =sceneArray.id
+					}
+					if(sceneArray.salt){
+						salt = sceneArray.salt
+					}
+				}
+			}
+			this.id = id
+			this.salt = salt
+
+			getHdInfo({id:this.id}).then(res=>{
 				let that = this
 				if(res.code == 1){
 					that.hdInfo = res.data.hd ? res.data.hd : []
@@ -148,11 +179,11 @@ export default {
 				actPrice: this.amount,
 				payWay: this.payWay,
 			}
-			let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+			let currentMiniOpenId = uni.getStorageSync('miniOpenId')
 			params.currentMiniOpenId = currentMiniOpenId
-			params.ghsId = this.id
+			params.hdId = this.id
 			params.salt = this.salt
-			rechargeBalance(params).then(res => {
+			rechargeFn(params).then(res => {
 				this.payCallData = res.data
 				//错误返回判断
 				if(res.code == 0){
@@ -195,20 +226,20 @@ export default {
 
 			this.payWay = 0
 			let that = this
-			let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+			let currentMiniOpenId = uni.getStorageSync('miniOpenId')
 			if (this.$util.isEmpty(currentMiniOpenId)){
 				uni.showLoading({mask:true})
 				uni.login({
 					provider: 'weixin',
 					success: res => {
-					postWxCode({ code: res.code }).then(subRes => {
-						uni.hideLoading()
-						if(subRes.data.currentMiniOpenId){
-							let thisMiniOpenId = subRes.data.currentMiniOpenId
-							uni.setStorageSync('currentMiniOpenId',thisMiniOpenId)
-							that.toPay()
-						}
-					})
+						postWxCode({ code: res.code }).then(subRes => {
+							uni.hideLoading()
+							if(subRes.data.currentMiniOpenId){
+								let thisMiniOpenId = subRes.data.currentMiniOpenId
+								uni.setStorageSync('miniOpenId',thisMiniOpenId)
+								that.toPay()
+							}
+						})
 					}
 				})
 			}else{