|
@@ -74,6 +74,7 @@ import { ref } from 'vue'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
import { formatName } from '@/utils/getText'
|
|
|
import payPopup from '@/components/payPopup'
|
|
|
+import { userStore } from '@/store/user'; const useUserStore = userStore()
|
|
|
import {
|
|
|
topJobAdvertisedCancel,
|
|
|
topJobAdvertised,
|
|
@@ -81,7 +82,6 @@ import {
|
|
|
closeJobAdvertised,
|
|
|
enableJobAdvertised
|
|
|
} from '@/api/new/position'
|
|
|
-import { userStore } from '@/store/user'; const useUserStore = userStore()
|
|
|
const emit = defineEmits(['entClick', 'refresh'])
|
|
|
const props = defineProps({
|
|
|
tab: { type: Number, default: 0 },
|
|
@@ -99,7 +99,7 @@ const toPay = async (val) => {
|
|
|
// 待发布且有额度的激活职位即可
|
|
|
if (userInfo.value.entitlement?.publishJobCount > 0) {
|
|
|
await enableJobAdvertised([val.id])
|
|
|
- emit('refresh', true)
|
|
|
+ emit('refresh', { reset: true, updatePublishJobCount: true })
|
|
|
setTimeout(() => { uni.showToast({ title: '发布成功', icon: 'success' }) }, 1000)
|
|
|
return
|
|
|
}
|
|
@@ -134,12 +134,12 @@ const handleAction = async (index, type, { id }, item) => {
|
|
|
|
|
|
// 没有可发布额度激活职位需重新付款
|
|
|
userInfo.value = await useUserStore.getUserInfos()
|
|
|
- if (index === 1 && userInfo.value?.entitlement.publishJobCount <= 3990039900) {
|
|
|
+ if (index === 1 && userInfo.value?.entitlement?.publishJobCount-0 <= 0) {
|
|
|
toPay(item)
|
|
|
return
|
|
|
}
|
|
|
await apiList[index](ids)
|
|
|
- emit('refresh', true)
|
|
|
+ emit('refresh', { reset: true })
|
|
|
setTimeout(() => { uni.showToast({ title: '操作成功', icon: 'success' }) }, 1000)
|
|
|
//
|
|
|
} catch (error) {
|
|
@@ -174,7 +174,7 @@ const closeJob = async () => {
|
|
|
try {
|
|
|
uni.showLoading({ title: '关闭中...', mask: true })
|
|
|
await apiList[handleActionInfo?.index](handleActionInfo?.ids)
|
|
|
- emit('refresh', true)
|
|
|
+ emit('refresh', { reset: true })
|
|
|
setTimeout(() => { uni.showToast({ title: '关闭成功', icon: 'success' }) }, 1000)
|
|
|
} catch (error) {
|
|
|
uni.showToast({ title: '关闭失败', icon: 'error' })
|
|
@@ -208,7 +208,7 @@ const handleToResume = (val) => {
|
|
|
}
|
|
|
|
|
|
const paySuccess = () => {
|
|
|
- emit('refresh', true)
|
|
|
+ emit('refresh', { reset: true })
|
|
|
setTimeout(() => { uni.showToast({ title: '发布成功', icon: 'success', duration: 2000 }) }, 1000)
|
|
|
}
|
|
|
|