浏览代码

fixed #56

ali 3 年之前
父节点
当前提交
5fe68ad8c9
共有 1 个文件被更改,包括 9 次插入 和 1 次删除
  1. 9 1
      src/components/InvoicePaymentCard.vue

+ 9 - 1
src/components/InvoicePaymentCard.vue

@@ -71,7 +71,12 @@
                class="btn-pay"
                :loading="invoice.loading || wallet.loading"
                @click="onAccept">
-          افزایش موجودی و پرداخت
+          <template v-if="amountOfDepositWalletNeeded > 0">
+            افزایش موجودی و پرداخت
+          </template>
+          <template v-else>
+            برداشت از کیف پول و برداشت
+          </template>
         </q-btn>
       </div>
       <div v-if="showInvoiceLinkBtn"
@@ -117,6 +122,9 @@ export default {
   computed: {
     showInvoiceLinkBtn () {
       return this.$route.name !== 'UserPanel.Invoice.Show'
+    },
+    amountOfDepositWalletNeeded () {
+      return this.invoice.amount - this.wallet.inventory
     }
   },
   mounted() {