lilei 4 months ago
parent
commit
a481cad447
3 changed files with 32 additions and 20 deletions
  1. 26 20
      pages/index/index.vue
  2. 3 0
      pagesB/procureOrder/creatOrder.vue
  3. 3 0
      pagesB/shopiing/productDetail.vue

+ 26 - 20
pages/index/index.vue

@@ -344,12 +344,17 @@
 			uni.$on("refashCart",()=>{
 				this.cartCount()
 			})
+			// 刷新抵扣和充值余额
+			uni.$on("refashPayBalance",()=>{
+				this.getPayBalanceAcount()
+			})
 		},
 		// 页面卸载
 		onUnload() {
 			uni.$off('refashHome')
 			uni.$off('refashProm')
 			uni.$off('refashCart')
+			uni.$off('refashPayBalance')
 		},
 		onHide() {
 			// 用户头像
@@ -381,19 +386,17 @@
 		watch:{
 			hasShopiing(a,b){
 				if(a!=b&&a){
-					// 获取抵扣支付权限
-					this.getPayBalanceAuth()
-					// 抵扣余额,充值余额
-					this.getStoreAccount()
+					this.getPayBalanceAcount()
 				}
 			}
 		},
 		methods: {
-			// 去认证
-			authStore(){
-				uni.navigateTo({
-					url: '/pages/storeManage/storeAuth'
-				})
+			// 获取抵扣和充值余额
+			getPayBalanceAcount(){
+				// 获取抵扣支付权限
+				this.getPayBalanceAuth()
+				// 抵扣余额,充值余额
+				this.getStoreAccount()
 			},
 			// 抵扣余额
 			getStoreAccount(){
@@ -402,6 +405,19 @@
 					this.$store.state.vuex_storeAccount = res.data
 				})
 			},
+			// 抵扣支付权限
+			getPayBalanceAuth(){
+				queryBalancePaymentParam({userId:this.userInfo&&this.userInfo.userid}).then(res => {
+					const data = res.data[0]
+					this.$store.state.vuex_showBalanceAuth = data && data.storeParamList&&data.storeParamList[0]&&data.storeParamList[0].paramValue == 1
+				})
+			},
+			// 去认证
+			authStore(){
+				uni.navigateTo({
+					url: '/pages/storeManage/storeAuth'
+				})
+			},
 			// 初始化页面
 			pageInit(flag){
 				// 已登录
@@ -412,10 +428,7 @@
 						this.getStoreShelf(flag)
 						// 如果已开通商城
 						if(this.hasShopiing){
-							// 获取抵扣支付权限
-							this.getPayBalanceAuth()
-							// 抵扣余额,充值余额
-							this.getStoreAccount()
+							this.getPayBalanceAcount()
 						}
 					}else{// 游客
 						this.getHasShopping()
@@ -520,13 +533,6 @@
 					this.getRedPacketRule()
 				}
 			},
-			// 抵扣支付权限
-			getPayBalanceAuth(){
-				queryBalancePaymentParam({userId:this.userInfo&&this.userInfo.userid}).then(res => {
-					const data = res.data[0]
-					this.$store.state.vuex_showBalanceAuth = data && data.storeParamList&&data.storeParamList[0]&&data.storeParamList[0].paramValue == 1
-				})
-			},
 			// 显示开通商城的页面
 			showShopPage(flag){
 				// 隐藏tab 视频,显示tab购物车

+ 3 - 0
pagesB/procureOrder/creatOrder.vue

@@ -372,11 +372,14 @@
 										icon: 'none'
 									})
 								}
+								uni.$emit("refashPayBalance")
 							})
 						}else{
+							uni.$emit("refashPayBalance")
 							this.payComplete(null,true)
 						}
 					}else{
+						uni.$emit("refashPayBalance")
 						uni.showToast({
 							title: res.message,
 							icon: 'none'

+ 3 - 0
pagesB/shopiing/productDetail.vue

@@ -738,6 +738,7 @@
 										icon: 'none'
 									})
 								}
+								uni.$emit("refashPayBalance")
 								uni.hideLoading()
 							})
 						}else{
@@ -745,8 +746,10 @@
 							this.showPopu = false
 							this.submitOk = true
 							uni.hideLoading()
+							uni.$emit("refashPayBalance")
 						}
 					}else{
+						uni.$emit("refashPayBalance")
 						uni.hideLoading()
 						uni.showToast({
 							title: res.message,