flat: 暂存
This commit is contained in:
@@ -23,46 +23,11 @@
|
||||
</view>
|
||||
<view class="search-btn button-click" @click="searchBtn">搜索</view>
|
||||
</view>
|
||||
<view class="view-top" v-show="listCom.length || list.length">
|
||||
<view class="top-item" @click="changeType(0)" :class="{ active: currentTab === 0 }">综合</view>
|
||||
<view class="top-item" @click="changeType(1)" :class="{ active: currentTab === 1 }">视频</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="Detailscroll-view" v-show="listCom.length" @scrolltolower="choosePosition">
|
||||
<view class="cards-box" v-show="currentTab === 0">
|
||||
<view class="cards-box">
|
||||
<renderJobs :list="listCom" :longitude="longitudeVal" :latitude="latitudeVal"></renderJobs>
|
||||
</view>
|
||||
<view class="cards-box" style="padding-top: 24rpx" v-show="currentTab === 1">
|
||||
<custom-waterfalls-flow
|
||||
ref="waterfallsFlowRef"
|
||||
:column="columnCount"
|
||||
:columnSpace="columnSpace"
|
||||
@loaded="imageloaded"
|
||||
:value="list"
|
||||
>
|
||||
<template v-slot:default="job">
|
||||
<view class="slot-item">
|
||||
<view class="job-image btn-feel" @click="nextVideo(job)">
|
||||
<image class="cover-image" :src="job.cover" mode="aspectFill"></image>
|
||||
<view class="cover-triangle"></view>
|
||||
</view>
|
||||
<view class="job-info" @click="nextDetail(job)">
|
||||
<view class="salary">
|
||||
<Salary-Expectation
|
||||
:max-salary="job.maxSalary"
|
||||
:min-salary="job.minSalary"
|
||||
:is-month="true"
|
||||
></Salary-Expectation>
|
||||
<image v-if="job.isHot" class="flame" src="/static/icon/flame.png"></image>
|
||||
</view>
|
||||
<view class="title">{{ job.jobTitle }}</view>
|
||||
<view class="desc">{{ job.companyName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</custom-waterfalls-flow>
|
||||
<loadmore ref="loadmoreRef"></loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="main-content" v-show="!listCom.length">
|
||||
<view class="content-top">
|
||||
@@ -93,6 +58,7 @@ import img from '@/static/icon/filter.png';
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
const searchValue = ref('');
|
||||
const historyList = ref([]);
|
||||
const searchParams = ref({});
|
||||
const listCom = ref([]);
|
||||
const pageState = reactive({
|
||||
page: 0,
|
||||
@@ -103,51 +69,12 @@ const pageState = reactive({
|
||||
order: 0,
|
||||
},
|
||||
});
|
||||
const isLoaded = ref(false);
|
||||
const waterfallsFlowRef = ref(null);
|
||||
const loadmoreRef = ref(null);
|
||||
const currentTab = ref(0);
|
||||
// 响应式搜索条件(可以被修改)
|
||||
const searchParams = ref({});
|
||||
const pageSize = ref(10);
|
||||
|
||||
const { list, loading, refresh, loadMore } = usePagination(
|
||||
(params) => $api.createRequest('/app/job/littleVideo', params, 'GET', true),
|
||||
dataToImg, // 转换函数
|
||||
{
|
||||
pageSize: pageSize,
|
||||
search: searchParams,
|
||||
dataKey: 'data',
|
||||
autoWatchSearch: true,
|
||||
onBeforeRequest: () => {
|
||||
loadmoreRef.value?.change('loading');
|
||||
},
|
||||
onAfterRequest: () => {
|
||||
loadmoreRef.value?.change('more');
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
async function choosePosition(index) {
|
||||
if (currentTab.value === 0) {
|
||||
getJobList('add');
|
||||
} else {
|
||||
loadMore();
|
||||
}
|
||||
getJobList('add');
|
||||
}
|
||||
|
||||
function imageloaded() {
|
||||
loadmoreRef.value?.change('more');
|
||||
}
|
||||
|
||||
const { columnCount, columnSpace } = useColumnCount(() => {
|
||||
pageSize.value = 10 * (columnCount.value - 1);
|
||||
nextTick(() => {
|
||||
waterfallsFlowRef.value?.refresh?.();
|
||||
useLocationStore().getLocation();
|
||||
});
|
||||
});
|
||||
|
||||
onLoad(() => {
|
||||
let arr = uni.getStorageSync('searchList');
|
||||
if (arr) {
|
||||
@@ -156,18 +83,7 @@ onLoad(() => {
|
||||
});
|
||||
|
||||
function changeType(type) {
|
||||
if (currentTab.value === type) return;
|
||||
switch (type) {
|
||||
case 0:
|
||||
currentTab.value = 0;
|
||||
getJobList('refresh');
|
||||
break;
|
||||
case 1:
|
||||
currentTab.value = 1;
|
||||
refresh();
|
||||
waterfallsFlowRef.value?.refresh?.();
|
||||
break;
|
||||
}
|
||||
getJobList('refresh');
|
||||
}
|
||||
function searchFn(item) {
|
||||
searchValue.value = item;
|
||||
@@ -184,12 +100,7 @@ function searchBtn() {
|
||||
searchParams.value = {
|
||||
jobTitle: searchValue,
|
||||
};
|
||||
if (currentTab.value === 0) {
|
||||
getJobList('refresh');
|
||||
} else {
|
||||
refresh();
|
||||
waterfallsFlowRef.value?.refresh?.();
|
||||
}
|
||||
getJobList('refresh');
|
||||
}
|
||||
|
||||
function searchCollection(e) {
|
||||
|
Reference in New Issue
Block a user