You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
4.2 KiB
Vue

8 months ago
<template>
<view class="p-root-person-collect g_w_all g_bg_f_5 g_pt_10 g_kuaishou">
<view v-show="computeCode == -1" class="g_flex_column_center">
<g-loading marginBottom="g_mb_130" />
</view>
<view v-show="computeCode > -1" class=" ">
<!-- 列表区 -->
<scroll-view class="m-list" id="listBox" :style="{ height: `${wheight}px)` }" :scroll-y="true" @scrolltolower="reachBottom">
<view class="">
<g-yi-list-job from="collect" class="g_h_all" :list="query.list" @clickCard="goDetail" :loading="loading" :speed="speed" :query="query" emptyText="嘿,这里还没有数据呢" pt="260" />
</view>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
onReady() {},
onShareAppMessage() {
return this.G.shareFun();
},
onLoad() {
let that = this;
},
data() {
return {
wheight: uni.getSystemInfoSync().windowHeight,
computeCode: -1,
cdnBaseImg: this.G.store().cdnBaseImg,
localBaseImg: this.G.store().localBaseImg,
loading: true,
appId: getApp().globalData.appId,
speed: -1,
query: {
page: 1,
size: 50,
list: [],
isFinish: -1,
},
};
},
onShow() {
let that = this;
that.getList();
},
onReachBottom() {
let that = this;
this.G.isLogin();
if (this.G.isLogin()) {
if (that.query.isFinish == -1 || that.query.isFinish == that.query.size) {
that.query.page++;
that.getList("concat");
}
}
},
methods: {
reachBottom() {
let that = this;
this.G.isLogin();
if (this.G.isLogin()) {
if (that.query.isFinish == -1 || that.query.isFinish == that.query.size) {
that.query.page++;
that.getList("concat");
}
}
},
getList($type = "init") {
let that = this;
let url = that.appId == 'wxb0c590fd696b79be' ? 'new_job_list' : 'yi_job_list'
that.G.Post(
that.api[url],
{
pageNum: that.query.page,
pageSize: that.query.size,
keys: "",
ujc: 1,
recruitment: 1,
classify: 1,
sex: -1,
workTypeStr: "",
lat: "",
lng: "",
jobClassify: "",
sortTag: 0,
jobSpecialLabelIds: "",
cityName: "",
brandIds: "",
jobCategoryLabelIds: "",
},
(res) => {
console.log("一才职位列表:", res);
that.computeCode = 1;
let resData = {};
if (that.appId == "wxb0c590fd696b79be" ) {
// 一才
resData = res;
} else {
// 其他
resData = res.pageBean;
}
if (resData.recordCount == 0) {
that.loading = false;
} else {
that.loading = true;
}
that.speed = resData.recordCount;
that.query.isFinish = resData.recordList.length;
if (resData.recordList && resData.recordList.length > 0) {
resData.recordList = that.G.toGetAddress(resData.recordList);
resData.recordList = that.G.toGetAge(resData.recordList);
resData.recordList = that.G.yijobCopy(resData.recordList);
resData.recordList.forEach(ita => {
ita.addss = that.G.setJobInfoPositionv3(ita.storeAddr)
})
}
if ($type == "init") {
that.query.list = [];
that.query.list =
resData.recordList && resData.recordList.length > 0
? resData.recordList.map((item, index) => {
return {
...item,
collected: item.collected ? true : false,
cus_price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValueHtml(item.salaryClassify, item.salaryClassifyValue) : "月薪",
gender: that.G.getGenderByMinAge(item),
};
})
: [];
} else {
that.query.list = that.query.list.concat(
resData.recordList && resData.recordList.length > 0
? resData.recordList.map((item, index) => {
return {
...item,
collected: item.collected ? true : false,
cus_price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValueHtml(item.salaryClassify, item.salaryClassifyValue) : "月薪",
gender: that.G.getGenderByMinAge(item),
};
})
: []
);
}
}
);
},
goDetail($item) {
console.log("前往详情页", $item);
uni.navigateTo({
url: "/root/detail/work?id=" + $item.id,
});
},
},
};
</script>
<style lang="scss">
.p-root-person-collect {
background-color: #f5f5f5;
min-height: 100%;
}
</style>