|
@@ -14,8 +14,8 @@
|
|
|
<!-- 赏金所需 -->
|
|
|
<div class="pt-3 pb-5" style="color: var(--v-error-base); font-weight: bold; text-align: center;">
|
|
|
<!-- <span class="font-size-13">¥</span> -->
|
|
|
- <span class="font-size-30">{{ cost }}</span>
|
|
|
- <!-- <span class="font-size-13 ml-1">点数</span> -->
|
|
|
+ <span class="font-size-30"> {{ cost }}</span>
|
|
|
+ <span class="font-size-15 ml-1">{{ unit }}</span>
|
|
|
</div>
|
|
|
<template v-if="payTypeList?.length">
|
|
|
<v-chip-group v-model="payType" selected-class="text-primary" column mandatory @update:modelValue="payTypeChange">
|
|
@@ -29,16 +29,14 @@
|
|
|
<!-- 钱包支付 -->
|
|
|
<div v-if="isWalletPay" class="py-10" style="text-align: center;">
|
|
|
<div>
|
|
|
- <!-- <span >{{ $t('enterprise.account.accountBalances') }}:</span> -->
|
|
|
- <span>剩余点数:</span>
|
|
|
+ <span>剩余点数:</span>
|
|
|
<span style="color: var(--v-primary-base);">{{ balance }}</span>
|
|
|
</div>
|
|
|
<div class="my-3" v-if="balanceNotEnough">
|
|
|
<!-- <v-icon color="warning">mdi-information</v-icon> -->
|
|
|
<!-- <span class="color-warning">{{ props.params?.txt || '当前余额不足,请选择其他支付方式' }}</span> -->
|
|
|
- <span class="color-warning">
|
|
|
- 当前点数不足
|
|
|
- <div class="recharge">充值</div>
|
|
|
+ <span class="color-error">
|
|
|
+ 当前剩余点数不足,<span class="text-decoration-underline cursor-pointer" @click="showRecharge = true">去充值</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -60,6 +58,10 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</v-card>
|
|
|
+
|
|
|
+ <CtDialog :visible="showRecharge" :widthType="1" titleClass="text-h6" title="点数充值" :footer="false" submitText="确认" @close="handleClose">
|
|
|
+ <Recharge @finish="handleFinish"></Recharge>
|
|
|
+ </CtDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -72,6 +74,7 @@ import { createTradeOrder } from '@/api/position'
|
|
|
import { useSharedState } from '@/store/sharedState'
|
|
|
import { rechargeOrderCreate } from '@/api/recruit/enterprise/member/points'
|
|
|
// import { payCalculation } from '@/utils/position'
|
|
|
+import Recharge from '@/views/recruit/enterprise/memberCenter/myMembers/components/pointsAndBalance.vue'
|
|
|
|
|
|
const emit = defineEmits(['payTypeChange', 'paySuccess'])
|
|
|
const props = defineProps({
|
|
@@ -107,8 +110,13 @@ const props = defineProps({
|
|
|
type: Number,
|
|
|
default: 2 // 订单类型 0平台订单| 1发布职位订单| 2发布众聘职位订单,示例值(1)
|
|
|
},
|
|
|
+ unit: {
|
|
|
+ type: String,
|
|
|
+ default: '点数'
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
+const showRecharge = ref(false)
|
|
|
const loading = ref(true)
|
|
|
const tip = ref('')
|
|
|
|
|
@@ -120,12 +128,12 @@ const tip = ref('')
|
|
|
// 如果是点数支付也要走上面的步骤,只是不生成二维码
|
|
|
|
|
|
|
|
|
-const balance = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
|
|
|
+const balance = ref(JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0)
|
|
|
const balanceNotEnough = computed(() => {
|
|
|
+ console.log(props.cost, balance.value, 'balanceNotEnough')
|
|
|
return (Number(props.cost) > Number(balance))
|
|
|
})
|
|
|
|
|
|
-
|
|
|
// 生成二维码内容
|
|
|
const timer = ref(null)
|
|
|
onUnmounted(() => {
|
|
@@ -218,7 +226,7 @@ const payTypeChange = (value) => {
|
|
|
isQrCodePay.value = qrCodePay.includes(payType.value)
|
|
|
isWalletPay.value = walletPay.includes(payType.value)
|
|
|
paySubmit() // 生成二维码内容
|
|
|
- emit('payTypeChange', value, balanceNotEnough)
|
|
|
+ // emit('payTypeChange', value, balanceNotEnough)
|
|
|
}
|
|
|
// 1.支付方式
|
|
|
const payType = ref('')
|
|
@@ -292,15 +300,18 @@ const payStatus = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const handleClose = () => {
|
|
|
+ showRecharge.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const handleFinish = () => {
|
|
|
+ showRecharge.value = false
|
|
|
+ console.log(localStorage.getItem('enterpriseUserAccount'), '------')
|
|
|
+ balance.value = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
|
|
|
+ console.log(balance.value, 'balance.value')
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.font-size-30 { font-size: 30px; }
|
|
|
-.recharge {
|
|
|
- margin: 12px;
|
|
|
- color: red;
|
|
|
- cursor: pointer;
|
|
|
- &:hover {
|
|
|
- color: rgba(255, 0, 0, 0.6);
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|