From d20bb7973641b8f0e127558ed966d917eba9db79 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 3 Apr 2023 14:50:36 +0800 Subject: [PATCH] optimize charge --- components/account/account.vue | 2 +- pages/account/preStoreAccount.vue | 8 +++----- pages/machine/machineToCharge.vue | 12 ++++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/components/account/account.vue b/components/account/account.vue index ddbf007..0677c9a 100644 --- a/components/account/account.vue +++ b/components/account/account.vue @@ -33,7 +33,7 @@ }; }, created() { - this.loadOwnerAccount(); + //this.loadOwnerAccount(); }, methods: { loadOwnerAccount: function(_communityId) { diff --git a/pages/account/preStoreAccount.vue b/pages/account/preStoreAccount.vue index 10e0e4c..fe7cd77 100644 --- a/pages/account/preStoreAccount.vue +++ b/pages/account/preStoreAccount.vue @@ -52,6 +52,7 @@ queryOwnerAccount } from '../../api/user/userApi.js'; import {getCommunityId} from '@/api/community/communityApi.js'; + import {getWAppId} from '../../lib/java110/utils/StorageUtil.js' import {payFeeApp,payFeeWechat} from '@/api/fee/feeApi.js'; export default { @@ -71,7 +72,7 @@ this.appId = accountInfo.miniProgram.appId; // #endif // #ifdef H5 - this.appId = uni.getStorageSync(constant.mapping.W_APP_ID) + this.appId = getWAppId(); // #endif }, methods: { @@ -79,9 +80,6 @@ let _that = this; context.getOwner(function(_ownerInfo) { if (_ownerInfo) { - if(!_that.communityId){ - _that.communityId = _ownerInfo.communityId; - } queryOwnerAccount({ page: 1, row: 20, @@ -131,7 +129,7 @@ payFeeWechat(this,{ business: "preStoreOnline", - communityId: getCommunityId(), + communityId: this.communityId, acctId: this.account.acctId, feeName: '账户充值', receivedAmount: _receivedAmount, diff --git a/pages/machine/machineToCharge.vue b/pages/machine/machineToCharge.vue index 391691b..adb9935 100644 --- a/pages/machine/machineToCharge.vue +++ b/pages/machine/machineToCharge.vue @@ -7,7 +7,7 @@ - + {{item.portName}} @@ -103,10 +103,18 @@ this.communityId = options.communityId; this._loadChargeMachines(); this._loadChargeMachinePorts(); + let _that = this; + setTimeout(function(){ + _that.$refs.accRef.loadOwnerAccount(_that.communityId); + },1000); }, onShow: function(options) { this._dealChargeCoupons(); - this.$refs.accRef.loadOwnerAccount(this.communityId); + + if(this.$refs.accRef){ + this.$refs.accRef.loadOwnerAccount(this.communityId); + } + }, methods: { _loadChargeMachines: function() {