Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(wallet): 修复没有设置钱包推荐充值金额时进入充值页面报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Oct 12, 2018
1 parent 16a8f15 commit b2d4e7b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/page/currency/CurrencyRecharge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<main class="m-box-model m-aln-center m-justify-center">
<div class="m-box-model m-lim-width m-main">
<div class="m-pinned-amount-btns">
<div v-if="items.length" class="m-pinned-amount-btns m-bb1">
<p class="m-pinned-amount-label">选择充值金额</p>
<div class="buttons">
<button
Expand All @@ -28,7 +28,7 @@
</button>
</div>
</div>
<div class="m-box m-aln-center m-justify-bet m-bb1 m-bt1 m-pinned-row plr20 m-pinned-amount-customize">
<div class="m-box m-aln-center m-justify-bet m-pinned-row plr20 m-pinned-amount-customize">
<span>自定义金额</span>
<div class="m-box m-aln-center">
<input
Expand Down
4 changes: 2 additions & 2 deletions src/page/wallet/WalletRecharge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<main class="m-box-model m-aln-center m-justify-center">
<div class="m-box-model m-lim-width m-main">
<div class="m-pinned-amount-btns">
<div v-if="rechargeItems.length" class="m-pinned-amount-btns m-bb1">
<p class="m-pinned-amount-label">选择充值金额</p>
<div class="m-box m-aln-center ">
<button
Expand All @@ -17,7 +17,7 @@
@click="chooseDefaultAmount(item)">{{ item.toFixed(2) }}</button>
</div>
</div>
<div class="m-box m-aln-center m-justify-bet m-bb1 m-bt1 m-pinned-row plr20 m-pinned-amount-customize">
<div class="m-box m-aln-center m-justify-bet m-pinned-row plr20 m-pinned-amount-customize">
<span>自定义金额</span>
<div class="m-box m-aln-center">
<input
Expand Down
3 changes: 2 additions & 1 deletion src/stores/module/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const state = {

const getters = {
rechargeItems: state => {
return state.recharge.items.map(item => item / 100);
const { items = [] } = state.recharge;
return items.map(item => item / 100);
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/stores/module/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const getters = {
return state.cashes.filter(wallet => wallet.id === id).pop() || {};
},
rechargeItems: state => {
return state.items.map(item => item / 100);
const { items = [] } = state;
return items.map(item => item / 100);
}
};

Expand Down

0 comments on commit b2d4e7b

Please sign in to comment.