|
@@ -2,9 +2,9 @@
|
|
<view>
|
|
<view>
|
|
<Navbar></Navbar>
|
|
<Navbar></Navbar>
|
|
<view class="box defaultBgc">
|
|
<view class="box defaultBgc">
|
|
- <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
|
|
|
|
|
|
+ <scroll-view class="scrollBox" :scroll-y="true" :scroll-top="scrollTop" @scrolltolower="loadingMore" @scroll="onScroll" style="position:relative;">
|
|
<view>
|
|
<view>
|
|
- <SwiperAd :list="swiperAdList" :strType="false" @click="handleToDetails"></SwiperAd>
|
|
|
|
|
|
+ <SwiperAd :list="swiperAdList" imgUrlKey="img" :strType="false" @click="handleToDetails"></SwiperAd>
|
|
<!-- 五宫格菜单 -->
|
|
<!-- 五宫格菜单 -->
|
|
<view class="white-bgc ss-p-t-10">
|
|
<view class="white-bgc ss-p-t-10">
|
|
<uni-grid :column="5" @change="handleGrid" :showBorder="false">
|
|
<uni-grid :column="5" @change="handleGrid" :showBorder="false">
|
|
@@ -21,7 +21,7 @@
|
|
<view style="position: relative;">
|
|
<view style="position: relative;">
|
|
<uni-search-bar
|
|
<uni-search-bar
|
|
v-model="query.content"
|
|
v-model="query.content"
|
|
- placeholder="请输入职位/公司关键字"
|
|
|
|
|
|
+ placeholder="输入职位/公司关键字"
|
|
cancelButton="none"
|
|
cancelButton="none"
|
|
:focus="false"
|
|
:focus="false"
|
|
bgColor="#fff"
|
|
bgColor="#fff"
|
|
@@ -51,17 +51,18 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, reactive } from 'vue'
|
|
|
|
|
|
+import { ref, reactive, nextTick } from 'vue'
|
|
import SwiperAd from '@/components/SwiperAd'
|
|
import SwiperAd from '@/components/SwiperAd'
|
|
import FilterList from '@/components/FilterList'
|
|
import FilterList from '@/components/FilterList'
|
|
import PositionList from '@/components/PositionList'
|
|
import PositionList from '@/components/PositionList'
|
|
import AdvertisePop from '@/components/Advertisement'
|
|
import AdvertisePop from '@/components/Advertisement'
|
|
import { dealDictObjData } from '@/utils/position'
|
|
import { dealDictObjData } from '@/utils/position'
|
|
-import { getJobAdvertisedSearch } from '@/api/position'
|
|
|
|
|
|
+import { getJobAdvertisedSearch, getPromotedPosition } from '@/api/position'
|
|
import { onShow, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
|
import { onShow, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
|
import Navbar from '@/components/Navbar'
|
|
import Navbar from '@/components/Navbar'
|
|
import { getRewardEventList } from '@/utils/eventList'
|
|
import { getRewardEventList } from '@/utils/eventList'
|
|
import { getMorningNewsArticle } from '@/api/content'
|
|
import { getMorningNewsArticle } from '@/api/content'
|
|
|
|
+import { getWebContent } from '@/api/common'
|
|
|
|
|
|
// 设置自定义tabbar选中值
|
|
// 设置自定义tabbar选中值
|
|
onShow(() => {
|
|
onShow(() => {
|
|
@@ -94,17 +95,16 @@ onLoad(() => {
|
|
|
|
|
|
const inputDialog = ref()
|
|
const inputDialog = ref()
|
|
const more = ref('more')
|
|
const more = ref('more')
|
|
-const swiperAdList = [
|
|
|
|
- { src: 'https://minio.menduner.com/dev/menduner/banner/IHG.gif', id: '577540545828753408' },
|
|
|
|
- { src: 'https://minio.citupro.com/dev/menduner/preferredGroup/SWISS-HOTEL-MANAGEMENT-SCHOOL-MBA.jpg' },
|
|
|
|
- { src: 'https://minio.menduner.com/dev/menduner/banner/Marriott.jpg', id: '734173233779183616' },
|
|
|
|
- { src: 'https://minio.menduner.com/dev/menduner/banner/UrCove.jpg', id: '277182701256183808' },
|
|
|
|
- { src: 'https://minio.menduner.com/dev/menduner/miniProgram/Grand-Mercure.jpg', id: '120281807903133696' },
|
|
|
|
- // { src: 'https://minio.menduner.com/dev/5eb89c28816dbc7613986ac994d2d760cc9fada84e17a78970c424904c26667c.jpg', id: '735167920258289664' },
|
|
|
|
- { src: 'https://minio.menduner.com/dev/c2fc649b5aec3811c7a171b199bc2e67bb1649e63b471e48a59c8a6ead6aa047.jpg', weiXinPublicUrl: 'https://mp.weixin.qq.com/s/lI7_iHY1yaEqrb_kG1MusA' },
|
|
|
|
- { src: 'https://minio.menduner.com/dev/fbff08c5608d746380f859a97241109fe4726f776a25301d7d0fb43d9ba7df67.png', weiXinPublicUrl: 'https://mp.weixin.qq.com/s/NrxuXTi7kB9AngNBYJ3v4A' },
|
|
|
|
- { src: 'https://minio.menduner.com/dev/4aeb9acb92512d899596d692db935429b339fca189129c0d78ce966f81ba2d38.jpg' }
|
|
|
|
-]
|
|
|
|
|
|
+
|
|
|
|
+// 获取轮播图
|
|
|
|
+const swiperAdList = ref([])
|
|
|
|
+const getSystemWebContent = async () => {
|
|
|
|
+ const { data } = await getWebContent()
|
|
|
|
+ swiperAdList.value = data.appHomeCarousel || []
|
|
|
|
+}
|
|
|
|
+getSystemWebContent()
|
|
|
|
+
|
|
|
|
+
|
|
const filterList = ref([
|
|
const filterList = ref([
|
|
{ label: '城市', dictType: 'areaTreeDataExtend', key: 'areaIds', map: { text: 'name', value: 'id' } },
|
|
{ label: '城市', dictType: 'areaTreeDataExtend', key: 'areaIds', map: { text: 'name', value: 'id' } },
|
|
// { label: '行业', dictType: 'industryTreeData',key: 'industryIds', map: { text: 'nameCn', value: 'id' } },
|
|
// { label: '行业', dictType: 'industryTreeData',key: 'industryIds', map: { text: 'nameCn', value: 'id' } },
|
|
@@ -123,12 +123,12 @@ const gridList = [
|
|
]
|
|
]
|
|
|
|
|
|
// 跳转企业详情
|
|
// 跳转企业详情
|
|
-const handleToDetails = ({ id, weiXinPublicUrl, title }) => {
|
|
|
|
- if (id) {
|
|
|
|
- uni.navigateTo({ url: `/pagesB/companyDetail/index?id=${id}` })
|
|
|
|
- }
|
|
|
|
- if (weiXinPublicUrl) {
|
|
|
|
- uni.navigateTo({ url: `/pages/addWebView/index?url=${weiXinPublicUrl}&title=${title || '风尚榜奖投票'}` })
|
|
|
|
|
|
+const handleToDetails = ({ link, title }) => {
|
|
|
|
+ // if (id) {
|
|
|
|
+ // uni.navigateTo({ url: `/pagesB/companyDetail/index?id=${id}` })
|
|
|
|
+ // }
|
|
|
|
+ if (link) {
|
|
|
|
+ uni.navigateTo({ url: `/pages/addWebView/index?url=${link}&title=${title || '风尚榜奖投票'}` })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -164,22 +164,48 @@ const handleGrid = async (e) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const checkValue = (obj) => {
|
|
|
|
+ return Object.values(obj).some(value => {
|
|
|
|
+ return value !== null && value !== undefined && value !== '' && (Array.isArray(value) ? value.length > 0 : true)
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
const positionListData = ref([])
|
|
const positionListData = ref([])
|
|
const query = reactive({
|
|
const query = reactive({
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
hire: false,
|
|
hire: false,
|
|
content: '',
|
|
content: '',
|
|
|
|
+ positionId: '',
|
|
areaIds: [],
|
|
areaIds: [],
|
|
industryIds: [],
|
|
industryIds: [],
|
|
jobType: [],
|
|
jobType: [],
|
|
- payScope: [],
|
|
|
|
- expType: []
|
|
|
|
|
|
+ payScope: ''
|
|
})
|
|
})
|
|
const getData = async () => {
|
|
const getData = async () => {
|
|
|
|
+ // 效验是否有带搜索条件
|
|
|
|
+ const { content, areaIds, industryIds, jobType, payScope, positionId } = query
|
|
|
|
+ const hasValue = checkValue({ content, areaIds, industryIds, jobType, payScope, positionId })
|
|
|
|
+
|
|
|
|
+ // 带查询条件时返回到顶部
|
|
|
|
+ if (hasValue) {
|
|
|
|
+ scrollTop.value = old.value.scrollTop
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ scrollTop.value = 0
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 带搜索条件(除分页外)用职位搜索接口,无条件则用推荐接口
|
|
|
|
+ const api = hasValue ? getJobAdvertisedSearch : getPromotedPosition
|
|
|
|
+ const params = hasValue ? query : { pageSize: query.pageSize, pageNo: query.pageNo, hire: 0 }
|
|
try {
|
|
try {
|
|
- const res = await getJobAdvertisedSearch(query)
|
|
|
|
- const list = res?.data?.list || []
|
|
|
|
|
|
+ const res = await api(params)
|
|
|
|
+ const arr = res?.data?.list || []
|
|
|
|
+ // 推荐接口返回数据需要拼接
|
|
|
|
+ const list = !hasValue ? arr.map(e => {
|
|
|
|
+ const { anotherName, logoUrl, scale, industryId, enterpriseId, enterpriseName, ...job } = e
|
|
|
|
+ return { job, enterprise: { anotherName, logoUrl, scale, industryId, enterpriseId, name: enterpriseName } }
|
|
|
|
+ }) : arr
|
|
positionListData.value.push(...list.map(e => {
|
|
positionListData.value.push(...list.map(e => {
|
|
if (!e) {
|
|
if (!e) {
|
|
return e
|
|
return e
|
|
@@ -196,11 +222,17 @@ const getData = async () => {
|
|
query.pageNo--
|
|
query.pageNo--
|
|
more.value = 'more'
|
|
more.value = 'more'
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
getData()
|
|
getData()
|
|
|
|
|
|
|
|
+const scrollTop = ref(0)
|
|
|
|
+const old = ref({
|
|
|
|
+ scrollTop: 0
|
|
|
|
+})
|
|
|
|
+const onScroll = (e) =>{
|
|
|
|
+ old.value.scrollTop = e.detail.scrollTop
|
|
|
|
+}
|
|
|
|
+
|
|
const handleSearch = (key, value) => {
|
|
const handleSearch = (key, value) => {
|
|
if (key === 'positionId' || key === 'payScope') {
|
|
if (key === 'positionId' || key === 'payScope') {
|
|
query[key] = value || null
|
|
query[key] = value || null
|