lilei 4 months ago
parent
commit
debdb1f918
3 changed files with 20 additions and 13 deletions
  1. 12 0
      pages/index/index.vue
  2. 3 12
      pages/morePage/morePage.vue
  3. 5 1
      pagesB/balanceSetting/balanceSetting.vue

+ 12 - 0
pages/index/index.vue

@@ -181,6 +181,7 @@
 	import { getCartCount } from '@/api/cart.js'
 	import { getCartCount } from '@/api/cart.js'
 	import { getShopStatus, getShopUserParam } from '@/api/bizParam.js'
 	import { getShopStatus, getShopUserParam } from '@/api/bizParam.js'
 	import { getShopCategory, getShopProductList } from '@/api/shop.js'
 	import { getShopCategory, getShopProductList } from '@/api/shop.js'
+	import { ticketQueryCount, storeAccount } from '@/api/user.js'
 	import { openWebView, clickTab, toAuthStore, clickBannerList, toLogin } from "@/utils/index.js"
 	import { openWebView, clickTab, toAuthStore, clickBannerList, toLogin } from "@/utils/index.js"
 	export default {
 	export default {
 		components: {
 		components: {
@@ -382,6 +383,8 @@
 				if(a!=b&&a){
 				if(a!=b&&a){
 					// 获取抵扣支付权限
 					// 获取抵扣支付权限
 					this.getPayBalanceAuth()
 					this.getPayBalanceAuth()
+					// 抵扣余额,充值余额
+					this.getStoreAccount()
 				}
 				}
 			}
 			}
 		},
 		},
@@ -392,6 +395,13 @@
 					url: '/pages/storeManage/storeAuth'
 					url: '/pages/storeManage/storeAuth'
 				})
 				})
 			},
 			},
+			// 抵扣余额
+			getStoreAccount(){
+				const data = this.$store.state.vuex_storeShelf
+				storeAccount({storeSn:data.storeSn}).then(res => {
+					this.$store.state.vuex_storeAccount = res.data
+				})
+			},
 			// 初始化页面
 			// 初始化页面
 			pageInit(flag){
 			pageInit(flag){
 				// 已登录
 				// 已登录
@@ -404,6 +414,8 @@
 						if(this.hasShopiing){
 						if(this.hasShopiing){
 							// 获取抵扣支付权限
 							// 获取抵扣支付权限
 							this.getPayBalanceAuth()
 							this.getPayBalanceAuth()
+							// 抵扣余额,充值余额
+							this.getStoreAccount()
 						}
 						}
 					}else{// 游客
 					}else{// 游客
 						this.getHasShopping()
 						this.getHasShopping()

+ 3 - 12
pages/morePage/morePage.vue

@@ -48,13 +48,13 @@
 					<uni-grid :column="4" :highlight="true" :show-border="false" :square="false" @change="e=>openDataList(e)">
 					<uni-grid :column="4" :highlight="true" :show-border="false" :square="false" @change="e=>openDataList(e)">
 						<uni-grid-item v-if="hasBalaceAuth" :index="0" :key="0">
 						<uni-grid-item v-if="hasBalaceAuth" :index="0" :key="0">
 							<view class="grid-item-box">
 							<view class="grid-item-box">
-								<text class="value">{{Number(storeAccount.rechargeBalance).toFixed(2)}}</text>
+								<text class="value">{{storeAccount?Number(storeAccount.rechargeBalance).toFixed(2):'0.00'}}</text>
 								<text class="text">充值余额</text>
 								<text class="text">充值余额</text>
 							</view>
 							</view>
 						</uni-grid-item>
 						</uni-grid-item>
 						<uni-grid-item v-if="hasBalaceAuth" :index="1" :key="1">
 						<uni-grid-item v-if="hasBalaceAuth" :index="1" :key="1">
 							<view class="grid-item-box">
 							<view class="grid-item-box">
-								<text class="value">{{Number(storeAccount.giveBalance).toFixed(2)}}</text>
+								<text class="value">{{storeAccount?Number(storeAccount.giveBalance).toFixed(2):'0.00'}}</text>
 								<text class="text">抵扣余额</text>
 								<text class="text">抵扣余额</text>
 							</view>
 							</view>
 						</uni-grid-item>
 						</uni-grid-item>
@@ -120,7 +120,7 @@
 	import UniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'
 	import UniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'
 	import { queryQplsConfig,getProductfindByScanCode } from '@/api/shelf.js'
 	import { queryQplsConfig,getProductfindByScanCode } from '@/api/shelf.js'
 	import { findUserReward } from '@/api/rewardRule.js'
 	import { findUserReward } from '@/api/rewardRule.js'
-	import { ticketQueryCount, storeAccount } from '@/api/user.js'
+	import { ticketQueryCount } from '@/api/user.js'
 	import { clickTab, toLogin } from "@/utils/index.js"
 	import { clickTab, toLogin } from "@/utils/index.js"
 	export default {
 	export default {
 		components: {
 		components: {
@@ -372,21 +372,12 @@
 			if(!this.hasLogin){
 			if(!this.hasLogin){
 				this.hidePromoTab()
 				this.hidePromoTab()
 			}
 			}
-			// 抵扣余额,充值余额
-			this.getStoreAccount()
 		},
 		},
 		// 页面卸载
 		// 页面卸载
 		onUnload() {
 		onUnload() {
 			uni.$off('refashProm')
 			uni.$off('refashProm')
 		},
 		},
 		methods: {
 		methods: {
-			// 抵扣余额
-			getStoreAccount(){
-				const data = this.$store.state.vuex_storeShelf
-				storeAccount({storeSn:data.storeSn}).then(res => {
-					this.$store.state.vuex_storeAccount = res.data
-				})
-			},
 			// 获取优惠券数量
 			// 获取优惠券数量
 			getCouponCount(){
 			getCouponCount(){
 				if(this.userInfo.sysUserFlag == '1'){
 				if(this.userInfo.sysUserFlag == '1'){

+ 5 - 1
pagesB/balanceSetting/balanceSetting.vue

@@ -74,6 +74,7 @@
 					  item.paramCode = st && st.paramCode
 					  item.paramCode = st && st.paramCode
 					  item.paramName = st && st.paramName
 					  item.paramName = st && st.paramName
 					  item.status = st && st.status
 					  item.status = st && st.status
+					  item.id = st && st.id
 				  })
 				  })
 				  if(_this.pageNo>1){
 				  if(_this.pageNo>1){
 					  _this.list = _this.list.concat(list)
 					  _this.list = _this.list.concat(list)
@@ -115,7 +116,10 @@
 						item.show = !e ? 1 : 0
 						item.show = !e ? 1 : 0
 					}
 					}
 					this.list.splice()
 					this.list.splice()
-					uni.showToast(res.message)
+					uni.showToast({
+						title: res.message,
+						icon: 'none'
+					})
 				})
 				})
 			}
 			}
 		}
 		}