|
@@ -1,49 +1,60 @@
|
|
<template>
|
|
<template>
|
|
- <view class="box defaultBgc">
|
|
|
|
- <uni-segmented-control :current="tab" :values="controlList" @clickItem="tabChange" styleType="text" activeColor="#00B760" style="background-color: #fff"></uni-segmented-control>
|
|
|
|
- <scroll-view class="scrollBox" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
|
|
|
|
- <view>
|
|
|
|
- <!-- -->
|
|
|
|
- <view class="white-bgc stick ss-p-t-20" style="border-radius: 5px;">
|
|
|
|
- <!-- <view class="defaultBgc d-flex ss-m-x-20">
|
|
|
|
- <view class="stickBtn" :style="`color: ${query.status==='99' ? '#00B760' :''}`" @tap=""><uni-icons v-if="query.status==='99'" class="ss-m-t-6 ss-m-r-4" color="#00B760" type="checkmarkempty" size="14"/>待发布(<text class="ss-m-x-2">{{ unpublishedCount }}</text>)</view>
|
|
|
|
- <view class="stickBtn newPositionBtn" @tap="">发布新职位</view>
|
|
|
|
- </view> -->
|
|
|
|
- <!-- 搜索条 -->
|
|
|
|
- <uni-search-bar
|
|
|
|
- v-model="query.name"
|
|
|
|
- radius="5"
|
|
|
|
- placeholder="输入关键字"
|
|
|
|
- cancelButton="none"
|
|
|
|
- :focus="false"
|
|
|
|
- @confirm="onSearch"
|
|
|
|
- ></uni-search-bar>
|
|
|
|
- </view>
|
|
|
|
- <view v-if="!positionListData?.length && more !== 'loading'" class="d-flex flex-column align-center justify-center ss-m-t-30">
|
|
|
|
- <view class="nodata-img-parent">
|
|
|
|
- <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
|
|
|
|
|
|
+ <layout-page @loginSucceeded="init">
|
|
|
|
+ <view class="box defaultBgc">
|
|
|
|
+ <uni-segmented-control :current="tab" :values="controlList" @clickItem="tabChange" styleType="text" activeColor="#00B760" style="background-color: #fff"></uni-segmented-control>
|
|
|
|
+ <scroll-view class="scrollBox" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
|
|
|
|
+ <view>
|
|
|
|
+ <!-- -->
|
|
|
|
+ <view class="white-bgc stick ss-p-t-20" style="border-radius: 5px;">
|
|
|
|
+ <!-- <view class="defaultBgc d-flex ss-m-x-20">
|
|
|
|
+ <view class="stickBtn" :style="`color: ${query.status==='99' ? '#00B760' :''}`" @tap=""><uni-icons v-if="query.status==='99'" class="ss-m-t-6 ss-m-r-4" color="#00B760" type="checkmarkempty" size="14"/>待发布(<text class="ss-m-x-2">{{ unpublishedCount }}</text>)</view>
|
|
|
|
+ <view class="stickBtn newPositionBtn" @tap="">发布新职位</view>
|
|
|
|
+ </view> -->
|
|
|
|
+ <!-- 搜索条 -->
|
|
|
|
+ <uni-search-bar
|
|
|
|
+ v-model="query.name"
|
|
|
|
+ radius="5"
|
|
|
|
+ placeholder="输入关键字"
|
|
|
|
+ cancelButton="none"
|
|
|
|
+ :focus="false"
|
|
|
|
+ @confirm="onSearch"
|
|
|
|
+ ></uni-search-bar>
|
|
</view>
|
|
</view>
|
|
- <view class="color-999">暂无职位</view>
|
|
|
|
- <view class="f-horizon-center">
|
|
|
|
- <button type="primary" size="default" class="ss-m-t-50" style="width: 60vw;" @click="handleClick">发布新职位</button>
|
|
|
|
|
|
+ <view v-if="!positionListData?.length && more !== 'loading'" class="d-flex flex-column align-center justify-center ss-m-t-30">
|
|
|
|
+ <view class="nodata-img-parent">
|
|
|
|
+ <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="color-999">暂无职位</view>
|
|
|
|
+ <view class="f-horizon-center">
|
|
|
|
+ <button type="primary" size="default" class="ss-m-t-50" style="width: 60vw;" @click="handleClickAdd">发布新职位</button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-else>
|
|
|
|
+ <PositionList v-if="positionListData?.length" :tab="tab" :payable="true" :list="positionListData" :noMore="false" @refresh="refresh"></PositionList>
|
|
|
|
+ <uni-load-more :status="more" />
|
|
|
|
+ <view style="padding-bottom: 20vh;"></view>
|
|
|
|
+ <view class="addBtn" @tap="handleClickAdd">
|
|
|
|
+ <view class="addBox">
|
|
|
|
+ <view class="icon">+</view>
|
|
|
|
+ <view class="text">发布新职位</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-else>
|
|
|
|
- <PositionList v-if="positionListData?.length" :tab="tab" :payable="true" :list="positionListData" :noMore="false" @refresh="refresh"></PositionList>
|
|
|
|
- <uni-load-more :status="more" />
|
|
|
|
- <view style="padding-bottom: 20vh;"></view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </scroll-view>
|
|
|
|
- </view>
|
|
|
|
|
|
+ </scroll-view>
|
|
|
|
+ </view>
|
|
|
|
+ </layout-page>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
|
|
+import layoutPage from '@/layout'
|
|
import PositionList from '@/components/PositionList'
|
|
import PositionList from '@/components/PositionList'
|
|
import { dealDictArrayData } from '@/utils/position'
|
|
import { dealDictArrayData } from '@/utils/position'
|
|
import { getJobAdvertisedList } from '@/api/new/position'
|
|
import { getJobAdvertisedList } from '@/api/new/position'
|
|
import { onShow } from '@dcloudio/uni-app'
|
|
import { onShow } from '@dcloudio/uni-app'
|
|
|
|
+import { getAccessToken } from '@/utils/request'
|
|
|
|
+import { showAuthModal } from '@/hooks/useModal'
|
|
|
|
|
|
const tab = ref(2)
|
|
const tab = ref(2)
|
|
const tabList = [
|
|
const tabList = [
|
|
@@ -99,17 +110,24 @@ const getData = async () => {
|
|
more.value = 'more'
|
|
more.value = 'more'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-getData()
|
|
|
|
|
|
|
|
// 设置自定义tabbar选中值
|
|
// 设置自定义tabbar选中值
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
|
+ console.log('onShow:', 789)
|
|
const currentPage = getCurrentPages()[0] // 获取当前页面实例
|
|
const currentPage = getCurrentPages()[0] // 获取当前页面实例
|
|
const currentTabBar = currentPage?.getTabBar?.()
|
|
const currentTabBar = currentPage?.getTabBar?.()
|
|
|
|
|
|
// 设置当前tab页的下标index
|
|
// 设置当前tab页的下标index
|
|
currentTabBar?.setData({ selected: 1 })
|
|
currentTabBar?.setData({ selected: 1 })
|
|
|
|
+ init()
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const init = () => {
|
|
|
|
+ console.log('123456:', 'init')
|
|
|
|
+ query.value.pageNo = 1
|
|
|
|
+ getData()
|
|
|
|
+}
|
|
|
|
+
|
|
const onSearch = () => {
|
|
const onSearch = () => {
|
|
query.value.pageNo = 1
|
|
query.value.pageNo = 1
|
|
getData()
|
|
getData()
|
|
@@ -129,11 +147,16 @@ const refresh = (reset = false) => {
|
|
getData()
|
|
getData()
|
|
}
|
|
}
|
|
|
|
|
|
-const handleClick = () => {
|
|
|
|
- let url = ''
|
|
|
|
- if (url) {
|
|
|
|
- uni.navigateTo({ url })
|
|
|
|
- }
|
|
|
|
|
|
+const handleClickAdd = () => {
|
|
|
|
+ if (!getAccessToken()) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请先登录',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ showAuthModal()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ uni.navigateTo({ url: '/pagesB/positionAdd/index' })
|
|
}
|
|
}
|
|
|
|
|
|
</script>
|
|
</script>
|
|
@@ -193,6 +216,43 @@ const handleClick = () => {
|
|
color: #00B760;
|
|
color: #00B760;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.addBtn{
|
|
|
|
+ position: fixed;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+ right: 35rpx;
|
|
|
|
+ // left: 50%;
|
|
|
|
+ // transform: translateX(-50%);
|
|
|
|
+ bottom: calc(env(safe-area-inset-bottom) + 60px);
|
|
|
|
+ width: 70px;
|
|
|
|
+ .addBox {
|
|
|
|
+ position: relative;
|
|
|
|
+ .icon {
|
|
|
|
+ font-size: 42px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ background-color: #00B760;
|
|
|
|
+ width: 50px;
|
|
|
|
+ height: 50px;
|
|
|
|
+ line-height: 46px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
|
|
|
|
+ }
|
|
|
|
+ .text {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 42px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #00B760;
|
|
|
|
+ background-color: #ffffffc9;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 2px 4px;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ box-shadow: 0 36px 6px rgba(0, 0, 0, 0.1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
// :deep(.uni-searchbar) {
|
|
// :deep(.uni-searchbar) {
|
|
// padding: 10px 30rpx;
|
|
// padding: 10px 30rpx;
|
|
// }
|
|
// }
|