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.
apply-assistant-v3/root/other/search.vue

236 lines
8.5 KiB
Vue

<template>
<view class="p-bill-index g_w_all g_h_all g_bg_f_5 g_kuaishou">
<view class="m-search g_flex_row_between flex_center g_bg_f g_pl_10 g_pr_10 g_pb_8 g_pt_6 g_mb_10">
<u-search class="g_flex_1" :focus="true" @btnSearch="getSearch" height="80" v-model="keyword" :placeholder="placeholder" bg-color="#ededed" :show-action="false" @change="getSearch" @clear="getSearch" @custom="getSearch" @search="getSearch" search-icon-color="#999999" :maxlength="20"></u-search>
<view class="g_ml_8 g_fs_16" style="color: #576b95" hover-class="thover" @click="backPrev"></view>
</view>
<view v-if="whichPage == 'home' || whichPage == 'record'">
<g-list-job @uploadList="getList" :list="jobQuery.list" v-if="keyword || whichPage == 'record'" :from="whichPage" :loading="loading" :speed="speed" :query="jobQuery" emptyText="暂无搜索结果" emptySubText=" " />
</view>
<view v-if="whichPage == 'bill'">
<g-list-job @uploadList="getList" :list="jobQuery.list" v-if="keyword" :loading="loading" :speed="speed" :query="jobQuery" emptyText="暂无搜索结果" emptySubText=" " />
</view>
<view v-if="whichPage == 'apply'">
<g-list-apply @uploadList="getApplyList('concat')" :list="jobQuery.list" v-if="keyword" :tabActive="applyType" from="home" bg class="g_bg_f" @shareJob="shareJob" :loading="loading" :speed="speed" :isLogin="true" :query.sync="jobQuery" :navInfo="navInfo" />
</view>
</view>
</template>
<script>
export default {
onReady() {
this.G.setNavStyle()
},
onShareAppMessage() {
return this.G.shareFun()
},
onLoad(options) {
console.log(options)
this.whichPage = options.from
if (this.whichPage == 'record' || this.whichPage == 'home') {
this.placeholder = '搜索职位名称'
uni.setNavigationBarTitle({
title: '搜索职位',
})
this.getList()
} else if (this.whichPage == 'apply') {
// 工单的类型 0 我报的 1 报给我的
this.applyType = options.active
this.placeholder = '搜索姓名/职位/手机号'
uni.setNavigationBarTitle({
title: '搜索工单',
})
this.getApplyList()
}
},
// 组件名称
name: '',
// 局部注册的组件
components: {},
// 组件参数 接收来自父组件的数据
props: {},
// 组件状态值
data() {
return {
whichPage: '',
keyword: '',
loading: true,
speed: -1,
applyType: 0,
jobQuery: {
page: 1,
size: 50,
list: [],
isFinish: -1,
},
placeholder: '搜索职位名称',
navInfo: {},
}
},
// 计算属性
computed: {},
// 侦听器
watch: {},
created() {},
mounted() {},
onShow() {
let that = this
that.navInfo = that.G.getNavInfo()
},
// 组件方法
methods: {
getSearch(e) {
console.log(e)
this.speed = -1
this.keyword = e
this.jobQuery.page = 1
console.log(this.whichPage)
if (this.whichPage == 'home' || this.whichPage == 'record') {
this.getList()
} else if (this.whichPage == 'apply') {
this.getApplyList()
}
},
backPrev() {
console.log('backPrev')
uni.navigateBack({
delta: 1,
})
},
getList($type = 'init') {
let that = this
let jobConfig = {
pageNum: that.jobQuery.page,
pageSize: that.jobQuery.size,
agencyId: that.whichPage == 'home' || that.whichPage == 'record' ? '' : uni.getStorageSync('apply-agencyId'),
classify: 2,
keys: that.keyword,
recruitment: 1,
}
that.G.Post(that.api.job_list, jobConfig, (res) => {
console.log('res', res)
if (res.recordCount == 0) {
that.loading = false
} else {
that.loading = true
}
that.speed = res.recordCount
that.jobQuery.isFinish = res.recordList.length
res.recordList = that.G.toGetAddressv3(res.recordList)
res.recordList = that.G.toGetAge(res.recordList)
res.recordList = that.G.yijobCopy(res.recordList)
if ($type == 'init') {
that.jobQuery.list = []
if (res.recordList.length > 0) {
that.jobQuery.list = res.recordList.map((item, index) => {
// console.log(item)
return {
...item,
title: item.jobName,
address: item.district + '丨' + item.age,
price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : that.G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
logo: item.agencyLogo,
fuWuFei: that.G.setReturnFee(item.returnFee, item.returnFeeType),
gender: that.G.getGenderByMinAge(item),
time: that.G.setDeadLine(item.updateTime, 'jiaofu'),
leafCateId: item.id,
// serverPrice: that.G.setReturnFee(item.returnFee, item.returnFeeType),
serverPrice: that.G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
recruitmentSwitch: item.recruitment == 1 ? true : false,
recruitmentImage: item.recruitment,
isToday: item.today == 0 ? false : true,
active: 0,
}
})
}
} else {
that.jobQuery.list = that.jobQuery.list.concat(
res.recordList.map((item, index) => {
return {
...item,
title: item.jobName,
address: item.district + '丨' + item.age,
price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : that.G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
logo: item.agencyLogo,
fuWuFei: that.G.setReturnFee(item.returnFee, item.returnFeeType),
gender: that.G.getGenderByMinAge(item),
time: that.G.setDeadLine(item.updateTime, 'jiaofu'),
leafCateId: item.id,
// serverPrice: that.G.setReturnFee(item.returnFee, item.returnFeeType),
serverPrice: that.G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
recruitmentSwitch: item.recruitment == 1 ? true : false,
recruitmentImage: item.recruitment,
isToday: item.today == 0 ? false : true,
active: 0,
}
})
)
}
if (that.whichPage == 'record') {
that.jobQuery.list = that.jobQuery.list.filter((item) => {
return item.recruitmentImage == 1
})
that.speed = that.jobQuery.list.length
}
console.log('that.jobQuery.list', that.jobQuery.list)
console.log('speed', that.speed)
// that.loading = false;
})
},
/**
* 获取工单列表
*/
getApplyList($type = 'init') {
let that = this
that.G.Post(
that.api.order_list_new,
{
pageNum: that.jobQuery.page,
pageSize: that.jobQuery.size,
keys: that.keyword,
classify: that.applyType + 1,
status: '',
},
(res) => {
if (res.recordCount == 0) {
that.loading = false
} else {
that.loading = true
}
that.$forceUpdate()
that.speed = res.recordCount
that.jobQuery.isFinish = res.recordList.length
if (that.speed > 0) {
// uni.setBackgroundColor({
// backgroundColorBottom: "#ffffff",
// });
res.recordList.forEach((item, index) => {
item.time = that.G.getPointTime(item.updateTime, 'MM--DD HH:MM')
item.status_text = that.G.getOrderStatus().filter((itm, inx) => {
return itm.id == item.status
})[0].name
item.setTitle = that.G.titleToStr(item)
})
} else {
// uni.setBackgroundColor({
// backgroundColorBottom: "#ededed",
// });
}
if ($type == 'init') {
that.jobQuery.list = res.recordList
// that.query.list = [...res.recordList, ...res.recordList, ...res.recordList, ...res.recordList, ...res.recordList];
} else {
that.jobQuery.list = that.jobQuery.list.concat(res.recordList)
}
}
)
},
},
}
</script>
<style scoped lang="less"></style>