瀏覽代碼

取消置顶

lifanagju_citu 1 月之前
父節點
當前提交
f1b3a0ffaf
共有 2 個文件被更改,包括 27 次插入4 次删除
  1. 26 4
      components/PositionList/index.vue
  2. 1 0
      static/svg/topUp.svg

+ 26 - 4
components/PositionList/index.vue

@@ -12,6 +12,7 @@
               <rich-text v-if="item.name?.indexOf('style') !== -1" class="job-name" :nodes="item.name"></rich-text>
               <view v-else class="job-name">{{ formatName(item.name) }}</view>
             </view>
+            <image v-if="item.top && tab === 1" src="/static/svg/topUp.svg" class="TopUpSvg ss-m-r-10" @tap.stop="topUpSvgClick(item)"></image>
           </view>
           <!-- 职位类型 -->
           <view class="font-size-13 ellipsis ss-m-5" style="color: #808080;">
@@ -36,8 +37,8 @@
             <view class="ss-m-t-10">到期时间:{{ item.expireTime ? timesTampChange(item.expireTime, 'Y-M-D') : '长期有效' }}</view>
           </view>
           <view class="sub-li-bottom ss-m-t-20">
-            <view v-if=" tab !== 0" class="sub-li-bottom-item color-primary" @tap.stop="handleToResume(item)">{{ item.count || 0 }} 已投递简历</view>
-            <view v-if=" tab === 0 && (item?.status-0) === 99" class="sub-li-bottom-item color-primary" @tap.stop="toPay(item)">发布</view>
+            <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 === 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>
@@ -108,6 +109,7 @@ const toPay = async (val) => {
 // setTimeout(() => { toPay(props.list[0]) }, 2000)
 
 const confirm = ref()
+const confirmType = ref('closeJob') // 确认框类型
 const dialogContent = ref('')
 let handleActionInfo = {}
 const apiList = [closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, topJobAdvertisedCancel]
@@ -124,6 +126,7 @@ const handleAction = async (index, type, { id }, item) => {
     if (index === 0) {
       const text = userInfo.value?.entitlement?.publishJobCount && userInfo.value?.entitlement?.publishJobCount > 0 ? '将消耗一个发布点数' : '将重新收取费用'
       const positionName = item?.name ? '【' + formatName(item?.name) + '】' : '所选'
+      confirmType.value = 'closeJob' // 确认框类型
       dialogContent.value = `是否确认关闭${positionName}职位?关闭后再激活,${text}!`
       confirm.value.open()
       return
@@ -151,7 +154,23 @@ const handleClose = () => {
   confirm.value.close()
 }
 
-const handleConfirm = async () => {
+// 取消置顶
+const topUpSvgClickVal = ref({})
+const topUpSvgClick = (item) => {
+  topUpSvgClickVal.value = item
+  confirmType.value = 'topUpJob' // 确认框类型
+  const positionName = item?.name ? '【' + formatName(item?.name) + '】职位' : '职位'
+  dialogContent.value = `是否取消置顶${positionName}?`
+  confirm.value.open()
+}
+
+const handleConfirm = () => {
+  if (confirmType.value === 'closeJob') closeJob()
+  if (confirmType.value === 'topUpJob') handleAction(4, '', topUpSvgClickVal.value)
+}
+
+// 关闭职位
+const closeJob = async () => {
   try {
     uni.showLoading({ title: '关闭中...', mask: true })
     await apiList[handleActionInfo?.index](handleActionInfo?.ids)
@@ -323,7 +342,7 @@ const paySuccess = () => {
   font-size: 13px;
   color: #666;
 	&-item {
-		width: 50%;
+		width: 25%;
 		height: 35px;
 		line-height: 35px;
 		text-align: center;
@@ -335,4 +354,7 @@ const paySuccess = () => {
 		}
 	}
 }
+.TopUpSvg {
+  width: 25px; height: 25px; color: #FB8C00;
+}
 </style>

+ 1 - 0
static/svg/topUp.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1742979347889" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1803" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M128 128l768 0 0 89.6-768 0 0-89.6ZM732.288 496 555.7888 309.8624c-10.9504-11.2064-26.4128-18.4896-43.7888-18.4896s-32.832 7.2832-43.6032 18.6048L291.5264 495.8656c-9.2288 10.0224-15.1104 22.9696-15.1104 37.3248 0 30.816 26.3808 55.8016 58.8992 55.8016 0.4544 0 0.896-0.0576 1.344-0.0704l0 0.352L416 589.2736 416 896l192 0L608 589.2736l77.1904 0 0-0.448c1.1648 0.064 2.3104 0.1792 3.5008 0.1792 32.5248 0 58.8992-24.992 58.8992-55.8144C747.5904 518.8352 741.7024 505.8944 732.288 496z" fill="#FB8C00" p-id="1804"></path></svg>