|
@@ -40,12 +40,29 @@
|
|
|
</view>
|
|
|
<view class="d-flex font-size-13 color-666 ss-m-t-10">
|
|
|
<!-- <view class="ss-m-t-10 ss-m-r-15">到期时间:{{ item.expireTime ? timesTampChange(item.expireTime, 'Y-M-D') : '长期有效' }}</view> -->
|
|
|
- <view class="ss-m-t-10">刷新时间:{{ item.refreshTime ? timesTampChange(item.refreshTime, 'Y-M-D h:m') : '暂无' }}</view>
|
|
|
+ <view class="ss-m-t-10" v-if="tab !== 0">刷新时间:{{ item.refreshTime ? timesTampChange(item.refreshTime, 'Y-M-D h:m') : '暂无' }}</view>
|
|
|
</view>
|
|
|
<view class="sub-li-bottom ss-m-t-20">
|
|
|
- <view v-if="tab === 0" class="sub-li-bottom-item color-primary" style="width: 100%;" @tap.stop="toPay(item)">发布</view>
|
|
|
- <view v-if="tab !== 0" class="sub-li-bottom-item color-primary" style="width: 45%;" @tap.stop="handleToResume(item)">{{ item.count || 0 }} 已投递简历</view>
|
|
|
- <view v-if="tab === 1" class="sub-li-bottom-item color-warning" @tap.stop="handleAction(item.top ? 4 : 3, '', item)">{{ item.top ? '取消置顶' : '置顶' }}</view>
|
|
|
+ <view
|
|
|
+ v-if="tab === 0 && jobNum && +jobNum > 0"
|
|
|
+ class="sub-li-bottom-item color-primary"
|
|
|
+ style="width: 33%;"
|
|
|
+ @tap.stop="handleRelease(item)"
|
|
|
+ >使用额度发布</view>
|
|
|
+ <view v-if="tab === 0" class="sub-li-bottom-item color-primary" style="width: 33%;" @tap.stop="toPay(item)">支付发布</view>
|
|
|
+ <view v-if="tab === 0" class="sub-li-bottom-item color-error" style="width: 33%;" @tap.stop="handleDelete(item)">删除</view>
|
|
|
+
|
|
|
+ <view
|
|
|
+ v-else
|
|
|
+ class="sub-li-bottom-item color-primary"
|
|
|
+ style="width: 45%;"
|
|
|
+ @tap.stop="handleToResume(item)"
|
|
|
+ >{{ item.count || 0 }} 已投递简历</view>
|
|
|
+ <view
|
|
|
+ v-if="tab === 1"
|
|
|
+ class="sub-li-bottom-item color-warning"
|
|
|
+ @tap.stop="handleAction(item.top ? 4 : 3, '', item)"
|
|
|
+ >{{ item.top ? '取消置顶' : '置顶' }}</view>
|
|
|
<view v-if="tab === 1" class="sub-li-bottom-item color-666" @tap.stop="handleAction(0, '', item, item)">关闭</view>
|
|
|
<view v-if="tab === 2" class="sub-li-bottom-item color-warning" @tap.stop="handleAction(1, '', item, item)">激活</view>
|
|
|
</view>
|
|
@@ -76,7 +93,6 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref } from 'vue'
|
|
|
-// import { commissionCalculation } from '@/utils/position'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
import { formatName } from '@/utils/getText'
|
|
|
import payPopup from '@/components/payPopup'
|
|
@@ -86,7 +102,9 @@ import {
|
|
|
topJobAdvertised,
|
|
|
refreshJobAdvertised,
|
|
|
closeJobAdvertised,
|
|
|
- enableJobAdvertised
|
|
|
+ enableJobAdvertised,
|
|
|
+ updatePositionStatus,
|
|
|
+ deletePosition
|
|
|
} from '@/api/new/position'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
|
|
@@ -97,20 +115,41 @@ const props = defineProps({
|
|
|
noMore: { type: Boolean, default: false },
|
|
|
showWelfareTag: { type: Boolean, default: true },
|
|
|
payable: { type: Boolean, default: false },
|
|
|
+ jobNum: { type: Number, default: 0 }
|
|
|
})
|
|
|
|
|
|
const userInfo = ref(useUserStore?.userInfo || {})
|
|
|
|
|
|
+// 使用额度发布职位
|
|
|
+const handleRelease = async (val) => {
|
|
|
+ if (!val.id) return
|
|
|
+ try {
|
|
|
+ await updatePositionStatus(val.id)
|
|
|
+ uni.showToast({ title: '发布成功', icon: 'success', duration: 2000 })
|
|
|
+ emit('refresh', { reset: true })
|
|
|
+ } catch {}
|
|
|
+}
|
|
|
+
|
|
|
+// 删除待支付职位
|
|
|
+const handleDelete = async (val) => {
|
|
|
+ if (!val.id) return
|
|
|
+ try {
|
|
|
+ await deletePosition(val.id)
|
|
|
+ uni.showToast({ title: '删除成功', icon: 'success', duration: 2000 })
|
|
|
+ emit('refresh', { reset: true })
|
|
|
+ } catch {}
|
|
|
+}
|
|
|
+
|
|
|
const payRef = ref()
|
|
|
// 支付
|
|
|
const toPay = async (val) => {
|
|
|
// 待发布且有额度的激活职位即可
|
|
|
- if (userInfo.value.entitlement?.publishJobCount > 0) {
|
|
|
- await enableJobAdvertised([val.id])
|
|
|
- emit('refresh', { reset: true, updatePublishJobCount: true })
|
|
|
- setTimeout(() => { uni.showToast({ title: '发布成功', icon: 'success' }) }, 1000)
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (userInfo.value.entitlement?.publishJobCount > 0) {
|
|
|
+ // await enableJobAdvertised([val.id])
|
|
|
+ // emit('refresh', { reset: true, updatePublishJobCount: true })
|
|
|
+ // setTimeout(() => { uni.showToast({ title: '发布成功', icon: 'success' }) }, 1000)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
payRef.value && payRef.value.handleOpen({ spuId: val?.id||'', spuName: val?.name||'', price: 1, type: 1 })
|
|
|
}
|
|
|
|