flat: 基础修改
This commit is contained in:
@@ -93,14 +93,10 @@ export const findTradeList = () => {
|
||||
})
|
||||
}
|
||||
|
||||
export const addInviteCompanyAuth = ({
|
||||
params,
|
||||
data
|
||||
}) => {
|
||||
export const addInviteCompanyAuth = (params) => {
|
||||
return request({
|
||||
url: '/api/jobslink-api/tenant/company/app/inviteCompany/auth',
|
||||
method: 'post',
|
||||
data,
|
||||
params
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1494
pages.json
1494
pages.json
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
<view class="headd_left">
|
||||
<u-icon name="search" color="#2297fa" size="24"></u-icon>
|
||||
<input placeholder-class="search_style" type="text" confirm-type="搜索" v-model="keywords"
|
||||
placeholder="搜任务/搜岗位/搜个体户招工/搜政策" />
|
||||
placeholder="搜任务/搜岗位/搜政策" />
|
||||
</view>
|
||||
<view class="headd_right">
|
||||
搜索
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="content">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="formOne">
|
||||
<view class="card">
|
||||
<view class="card_title">企业信息</view>
|
||||
<u-form-item label="企业名称" labelWidth="100" prop="comname" borderBottom ref="item1">
|
||||
@@ -40,7 +40,8 @@
|
||||
</u-form-item>
|
||||
<u-form-item label="企业介绍" labelWidth="100" labelPosition="top" prop="companyDesc" borderBottom
|
||||
ref="item1">
|
||||
<u--textarea v-model="formData.companyDesc" placeholder="请输入内容"></u--textarea>
|
||||
<u--textarea v-model="formData.companyDesc" placeholder="请输入企业介绍" count
|
||||
maxlength="200"></u--textarea>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="card">
|
||||
@@ -56,11 +57,18 @@
|
||||
<view class="card">
|
||||
<view class="card_title">相关资料</view>
|
||||
<view class="card_content">
|
||||
<UploadIdNumber v-model="formData.identityUrl4Id" backImg="/static/img/idcard.png">
|
||||
</UploadIdNumber>
|
||||
<UploadIdNumber v-model="formData.identityUrl5Id" backImg="/static/img/backidcard1.png">
|
||||
</UploadIdNumber>
|
||||
<UploadIdNumber v-model="formData.authUrlId" backImg="/static/img/idcard.png"></UploadIdNumber>
|
||||
<u-form-item labelWidth="100" prop="identityUrl4Id">
|
||||
<UploadIdNumber v-model="formData.identityUrl4Id" backImg="/static/img/idcard.png">
|
||||
</UploadIdNumber>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="100" prop="identityUrl5Id">
|
||||
<UploadIdNumber v-model="formData.identityUrl5Id" backImg="/static/img/backidcard1.png">
|
||||
</UploadIdNumber>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="100" prop="authUrlId">
|
||||
<UploadIdNumber v-model="formData.authUrlId" backImg="/static/img/idcard.png">
|
||||
</UploadIdNumber>
|
||||
</u-form-item>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -80,10 +88,98 @@
|
||||
import {
|
||||
addInviteCompanyAuth
|
||||
} from '@/api/userrecruit.js'
|
||||
const rules = []
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex'
|
||||
const rules = {
|
||||
comname: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入企业名称',
|
||||
trigger: ['change']
|
||||
},
|
||||
companyTid: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入统一信用代码',
|
||||
trigger: ['change']
|
||||
},
|
||||
masterName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入法人姓名',
|
||||
trigger: ['change']
|
||||
},
|
||||
masterIdentity: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
pattern: /^[1-9]\d{5}(19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[Xx\d]$/,
|
||||
message: '请输入法人身份证号',
|
||||
trigger: ['change']
|
||||
},
|
||||
cityId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择所在地区',
|
||||
trigger: ['change']
|
||||
},
|
||||
companyAddress: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入详细地址',
|
||||
trigger: ['change']
|
||||
},
|
||||
nature: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择企业性质',
|
||||
trigger: ['change']
|
||||
},
|
||||
tradeId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择行业',
|
||||
trigger: ['change']
|
||||
},
|
||||
companyDesc: {
|
||||
type: 'string',
|
||||
min: 20,
|
||||
required: true,
|
||||
message: '请输入企业介绍(最少20个字符)',
|
||||
trigger: ['change']
|
||||
},
|
||||
manager: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入联系人',
|
||||
trigger: ['change']
|
||||
},
|
||||
telphone: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
pattern: /^1[3-9]{1}[0-9]{9}$/,
|
||||
message: '请输入手机号码',
|
||||
trigger: ['change']
|
||||
},
|
||||
identityUrl4Id: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请上传法人身份证(人像)',
|
||||
trigger: ['change']
|
||||
},
|
||||
identityUrl5Id: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请上传法人身份证(国徽)',
|
||||
trigger: ['change']
|
||||
},
|
||||
authUrlId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请上传企业营业执照',
|
||||
trigger: ['change']
|
||||
},
|
||||
}
|
||||
export default {
|
||||
components: {
|
||||
UploadIdNumber,
|
||||
@@ -108,28 +204,29 @@
|
||||
created() {
|
||||
this.formData.manager = this.authInfo.realName
|
||||
this.formData.idNumber = this.authInfo.idNumber
|
||||
console.log(this.authInfo)
|
||||
console.log(this.userInfo)
|
||||
},
|
||||
methods: {
|
||||
hideKeyboard() {
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
async submit() {
|
||||
let data = {
|
||||
...this.formData,
|
||||
nature: Number(this.formData.nature),
|
||||
cityId: Number(this.formData.cityId),
|
||||
tradeId: Number(this.formData.tradeId),
|
||||
}
|
||||
let params = {
|
||||
// auth: this.authInfo.authValue
|
||||
}
|
||||
let resData = await addInviteCompanyAuth({
|
||||
params,
|
||||
data
|
||||
const _this = this
|
||||
this.$refs.formOne.validate().then(res => {
|
||||
_this.$api.msg('提交数据')
|
||||
}).catch(errors => {
|
||||
_this.$api.msg('请完善内容')
|
||||
})
|
||||
console.log(resData)
|
||||
// let params = {
|
||||
// ...this.formData,
|
||||
// nature: Number(this.formData.nature),
|
||||
// cityId: Number(this.formData.cityId),
|
||||
// tradeId: Number(this.formData.tradeId),
|
||||
// }
|
||||
// let resData = await addInviteCompanyAuth(params)
|
||||
// console.log(resData)
|
||||
// if (resData.data.code === 200) {
|
||||
// _this.$api.msg('已完成企业信息认证')
|
||||
// }
|
||||
},
|
||||
reset() {
|
||||
const _this = this
|
||||
|
||||
@@ -1,426 +1,448 @@
|
||||
<template>
|
||||
<view class="mainWrapper">
|
||||
<view v-show="!searchResultShow" class="headSearch">
|
||||
<view class="search-view">
|
||||
<view class="search-item">
|
||||
<image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;" mode=""></image>
|
||||
<input type="text" confirm-type="搜索" v-model="keywords" @confirm="getNewList('search')"
|
||||
placeholder="搜任务/搜岗位/搜个体户招工/搜政策" />
|
||||
<view @click="getNewList('search')" style="width: 80rpx;height: 50rpx;color:#fff;background-color: #0091ff;font-size:24rpx;text-align: center;line-height: 50rpx;border-radius: 25rpx;;">搜索</view>
|
||||
</view>
|
||||
<!-- <view class="close" @click="closeBack">
|
||||
取消
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="searchResultShow" class="headSearch">
|
||||
<view class="search-view">
|
||||
<view class="search-item" @click="clearCurrentKeyWords">
|
||||
<!-- <image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;" mode=""></image> -->
|
||||
<!-- <input type="text" confirm-type="搜索" v-model="keywords" @confirm="getNewList('search')"
|
||||
placeholder="搜任务/搜岗位/搜政策" /> -->
|
||||
<!-- <view @click="getNewList('search')" style="width: 80rpx;height: 50rpx;color:#fff;background-color: #0091ff;font-size:24rpx;text-align: center;line-height: 50rpx;border-radius: 25rpx;;">搜索</view> -->
|
||||
<view style="font-size: 24rpx;height: 50rpx;background-color: #ddd;border-radius: 25rpx;line-height: 50rpx;padding: 0 20rpx;padding-right: 40rpx;position:relative;">
|
||||
{{ keywords }}
|
||||
<u-icon name="close" size="14" style="position:absolute;right:10rpx;top:13rpx;"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="searchResultShow" class="search-result">
|
||||
<view class="title">搜索结果</view>
|
||||
<view v-for="(item, index) in searchResultList" class="search-item" @click="toDetail(item)">
|
||||
<image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" mode=""></image>
|
||||
<view style="flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{ item.name }}</view>
|
||||
<view class="type" v-if="item.type == 0">任务</view>
|
||||
<view class="type" v-else-if="item.type == 1">岗位</view>
|
||||
<view class="type" v-else-if="item.type == 2">政策</view>
|
||||
<view class="type" v-else-if="item.type == 3">招工</view>
|
||||
</view>
|
||||
<view v-if="searchResultList.length > 0" style="text-align: center;font-size: 26rpx;margin-top: 20rpx;color:#999;">没有更多数据了</view>
|
||||
<view v-if="searchResultList.length == 0" style="text-align: center;font-size: 26rpx;margin-top: 20rpx;">暂无数据</view>
|
||||
</view>
|
||||
<view v-show="!searchResultShow" class="search-history">
|
||||
<view class="title">搜索记录</view>
|
||||
<view class="clear" @click="clearKeyWords">
|
||||
<image src="../../static/img/delete.png" style="width: 24rpx;height: 24rpx;" mode=""></image>
|
||||
<view style="margin-left: 5rpx;">清空</view>
|
||||
</view>
|
||||
<view class="wrapper" v-if="searchHistoryList.length > 0">
|
||||
<view class="item" v-for="(item, index) in searchHistoryList" @click="keyWordsClick(item.keywords)">
|
||||
{{ item.keywords }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty">暂无历史记录</view>
|
||||
</view>
|
||||
<v-tabs v-show="!searchResultShow" :tabs="['推荐任务', '推荐岗位', '推荐政策']" height="45px" v-model="activeTab" color="#999" activeColor="#000"
|
||||
fontSize="30rpx" activeFontSize="31rpx" @change='changeTab' />
|
||||
|
||||
|
||||
<block v-if="(activeTab == 0)&&!searchResultShow">
|
||||
<view v-if="companyList.length > 0">
|
||||
<block v-for="(item, index) in companyList" :key="item.id">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
|
||||
<view class="nothingContnt">
|
||||
暂无信息
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="(activeTab == 1)&&!searchResultShow">
|
||||
<view v-if="newList.length > 0">
|
||||
<block v-for="(item, index) in newList" :key="index">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" class="nothing" mode=""></image>
|
||||
<view class="nothingContnt">暂无信息</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
||||
|
||||
<block v-if="(activeTab == 2)&&!searchResultShow">
|
||||
<view v-if="recommendList.length > 0">
|
||||
<block v-for="(item, index) in recommendList" :key="item.id">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
|
||||
<view class="nothingContnt">
|
||||
完善技能,获取精推荐
|
||||
</view>
|
||||
<!-- <view class="btn" @click="goResume">
|
||||
完善技能
|
||||
</view> -->
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- <view v-if="companyList.length > 0">
|
||||
<block v-for="(item, index) in companyList" :key="item.id">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
<view class="baddd"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
|
||||
<view class="nothingContnt">
|
||||
暂无任务信息
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { newMissionAll, getSearchKeyWordsList, clearSearchKeyWords, getListByKeyWords } from '@/api/mission.js';
|
||||
import companyList from '@/components/companyList/companyList.vue';
|
||||
import vTabs from '@/components/v-tabs/v-tabs.vue';
|
||||
import testData from '@/common/textdata.js';
|
||||
export default {
|
||||
components: {
|
||||
companyList,
|
||||
vTabs,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTab: 0,
|
||||
companyList: [],
|
||||
recommendList: [],
|
||||
newList: [],
|
||||
keywords: '',
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
},
|
||||
searchHistoryList: [],
|
||||
searchResultShow: false,
|
||||
searchResultList: []
|
||||
};
|
||||
},
|
||||
onLoad: function (option) {
|
||||
this.keywords = option.keywords ? option.keywords : ''
|
||||
},
|
||||
onShow: function () {
|
||||
this.getList('search');
|
||||
|
||||
this.getKeyWordsList()
|
||||
},
|
||||
/*页面滚动到底部*/
|
||||
onReachBottom: function () {
|
||||
this.upLoad()
|
||||
},
|
||||
methods: {
|
||||
clearCurrentKeyWords() {
|
||||
this.keywords = '';
|
||||
let that = this;
|
||||
setTimeout(function() {
|
||||
that.searchResultShow = false;
|
||||
}, 100);
|
||||
|
||||
},
|
||||
// 新面板搜索
|
||||
getNewList() {
|
||||
getListByKeyWords(this.keywords).then(res => {
|
||||
this.searchResultShow = true
|
||||
this.searchResultList = res.data.data
|
||||
// this.searchResultList.forEach((item, index) => {
|
||||
// item.name = this.getInf(item.name, this.keywords);
|
||||
// })
|
||||
})
|
||||
},
|
||||
// 获取搜索历史记录
|
||||
getKeyWordsList() {
|
||||
getSearchKeyWordsList().then(res => {
|
||||
let response = res.data
|
||||
if(response.code == 200) {
|
||||
this.searchHistoryList = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
keyWordsClick(keyWords) {
|
||||
// console.log(keyWords)
|
||||
this.searchResultShow = true;
|
||||
this.keywords = keyWords;
|
||||
this.getNewList();
|
||||
},
|
||||
//最新任务;
|
||||
getList: function (type) {
|
||||
//改变搜索条件,页码值变为1
|
||||
if (type === 'search') {
|
||||
this.page.current = 1;
|
||||
};
|
||||
// if (this.keywords) {
|
||||
newMissionAll(this.page.current, this.page.size, this.keywords).then(res => {
|
||||
if (this.page.current === 1) {
|
||||
this.companyList = [];
|
||||
}
|
||||
this.page.current += 1;
|
||||
this.page.total = res.data.data.total;
|
||||
if (res.data.data && res.data.data.records.length) {
|
||||
this.companyList = this.companyList.concat(res.data.data.records);
|
||||
|
||||
}
|
||||
//搜索关键词高亮
|
||||
// if (this.companyList.length) {
|
||||
// this.companyList.forEach((item, index) => {
|
||||
// item.missionTitle = this.getInf(item.missionTitle, this.keywords);
|
||||
// });
|
||||
// }
|
||||
console.log(this.companyList, '----------');
|
||||
})
|
||||
// }
|
||||
},
|
||||
|
||||
//上拉加载
|
||||
upLoad: function () {
|
||||
if (this.page.current <= Math.ceil(this.page.total / this.page.size)) {
|
||||
this.getList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: '已经是最后一页',
|
||||
})
|
||||
return
|
||||
}
|
||||
},
|
||||
closeBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 指定关键字高亮
|
||||
* @param {*} str 字符串
|
||||
* @param {*} key 关键字
|
||||
*/
|
||||
getInf(str, key) {
|
||||
if (str && key) {
|
||||
let replaceReg = new RegExp(key, 'g')// 匹配关键字正则
|
||||
let replaceString = "<span style='color: #1b66ff;'>" + key + "</span>" // 高亮替换
|
||||
return str.replace(replaceReg, replaceString);
|
||||
}
|
||||
},
|
||||
|
||||
toDetail(item) {
|
||||
const no = item.id
|
||||
// 判断是岗位还是任务 0:任务,1:岗位,2:政策
|
||||
if(item.type == 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/projectInfo?missionNo=${encodeURIComponent(no)}&isCan=1`
|
||||
})
|
||||
} else if(item.type == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/workInfo?workId=${encodeURIComponent(no)}&isCan=1`
|
||||
})
|
||||
} else if(item.type == 2) {
|
||||
uni.navigateTo({
|
||||
url:`/pages/user/policyContent?id=${no}`
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
changeTab: function (e) {
|
||||
this.activeTab = e;
|
||||
},
|
||||
// 清空搜索历史
|
||||
clearKeyWords() {
|
||||
clearSearchKeyWords().then(res => {
|
||||
if(res.data.code == 200) {
|
||||
this.getKeyWordsList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mainWrapper{
|
||||
background-color: #f3f4f8;
|
||||
min-height: 95vh;
|
||||
}
|
||||
.baddd {
|
||||
background-color: #f6f6f6;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 24rpx;
|
||||
top: 6rpx;
|
||||
height: 60rpx;
|
||||
padding: 5rpx 0;
|
||||
line-height: 60rpx;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.headSearch .search-view {
|
||||
border-bottom: 1rpx solid #dddddd;
|
||||
padding: 14rpx 32rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.headSearch .search-item {
|
||||
display: flex;
|
||||
padding: 0 10rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(249, 249, 249, 1);
|
||||
border-radius: 200px;
|
||||
align-items: center;
|
||||
border: 1px solid #0091ff;
|
||||
}
|
||||
|
||||
.headSearch .search-item input {
|
||||
padding: 0 24rpx;
|
||||
height: 80rpx;
|
||||
font-weight: 400;
|
||||
flex: 1;
|
||||
text-align: start;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang-SC-Bold, PingFang-SC;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
|
||||
.headSearch .search-item .placeholderClass {
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.headSearch .search-item image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
}
|
||||
|
||||
.nothing {
|
||||
width: 400rpx;
|
||||
height: 200rpx;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-top: 50%;
|
||||
}
|
||||
|
||||
.nothingContnt {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.search-history {
|
||||
background-color: #fff;
|
||||
padding: 10rpx 40rpx;
|
||||
position: relative;
|
||||
}
|
||||
.search-history .title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.search-history .clear {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #707070;
|
||||
}
|
||||
.search-history .empty {
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
color: #707070;
|
||||
}
|
||||
.search-history .wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.search-history .wrapper .item {
|
||||
font-size: 24rpx;
|
||||
background-color: #f6f6f6;
|
||||
padding: 8rpx 12rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.search-result {
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
height: 100vh;
|
||||
}
|
||||
.search-result .title {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.search-result .search-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
}
|
||||
.search-result .search-item .type {
|
||||
font-size: 20rpx;
|
||||
color: #707070;
|
||||
background-color: #dddddd;
|
||||
border-radius: 15rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="mainWrapper">
|
||||
<view v-show="!searchResultShow" class="headSearch">
|
||||
<view class="search-view">
|
||||
<view class="search-item">
|
||||
<image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;" mode=""></image>
|
||||
<input type="text" confirm-type="搜索" v-model="keywords" @confirm="getNewList('search')"
|
||||
placeholder="搜任务/搜岗位/搜政策" />
|
||||
<view @click="getNewList('search')"
|
||||
style="width: 80rpx;height: 50rpx;color:#fff;background-color: #0091ff;font-size:24rpx;text-align: center;line-height: 50rpx;border-radius: 25rpx;;">
|
||||
搜索</view>
|
||||
</view>
|
||||
<!-- <view class="close" @click="closeBack">
|
||||
取消
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="searchResultShow" class="headSearch">
|
||||
<view class="search-view">
|
||||
<view class="search-item" @click="clearCurrentKeyWords">
|
||||
<!-- <image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;" mode=""></image> -->
|
||||
<!-- <input type="text" confirm-type="搜索" v-model="keywords" @confirm="getNewList('search')"
|
||||
placeholder="搜任务/搜岗位/搜政策" /> -->
|
||||
<!-- <view @click="getNewList('search')" style="width: 80rpx;height: 50rpx;color:#fff;background-color: #0091ff;font-size:24rpx;text-align: center;line-height: 50rpx;border-radius: 25rpx;;">搜索</view> -->
|
||||
<view
|
||||
style="font-size: 24rpx;height: 50rpx;background-color: #ddd;border-radius: 25rpx;line-height: 50rpx;padding: 0 20rpx;padding-right: 40rpx;position:relative;">
|
||||
{{ keywords }}
|
||||
<u-icon name="close" size="14" style="position:absolute;right:10rpx;top:13rpx;"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="searchResultShow" class="search-result">
|
||||
<view class="title">搜索结果</view>
|
||||
<view v-for="(item, index) in searchResultList" class="search-item" @click="toDetail(item)">
|
||||
<image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;margin-right: 10rpx;"
|
||||
mode=""></image>
|
||||
<view style="flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{ item.name }}</view>
|
||||
<view class="type" v-if="item.type == 0">任务</view>
|
||||
<view class="type" v-else-if="item.type == 1">岗位</view>
|
||||
<view class="type" v-else-if="item.type == 2">政策</view>
|
||||
<view class="type" v-else-if="item.type == 3">招工</view>
|
||||
</view>
|
||||
<view v-if="searchResultList.length > 0"
|
||||
style="text-align: center;font-size: 26rpx;margin-top: 20rpx;color:#999;">没有更多数据了</view>
|
||||
<view v-if="searchResultList.length == 0" style="text-align: center;font-size: 26rpx;margin-top: 20rpx;">
|
||||
暂无数据</view>
|
||||
</view>
|
||||
<view v-show="!searchResultShow" class="search-history">
|
||||
<view class="title">搜索记录</view>
|
||||
<view class="clear" @click="clearKeyWords">
|
||||
<image src="../../static/img/delete.png" style="width: 24rpx;height: 24rpx;" mode=""></image>
|
||||
<view style="margin-left: 5rpx;">清空</view>
|
||||
</view>
|
||||
<view class="wrapper" v-if="searchHistoryList.length > 0">
|
||||
<view class="item" v-for="(item, index) in searchHistoryList" @click="keyWordsClick(item.keywords)">
|
||||
{{ item.keywords }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty">暂无历史记录</view>
|
||||
</view>
|
||||
<v-tabs v-show="!searchResultShow" :tabs="['推荐任务', '推荐岗位', '推荐政策']" height="45px" v-model="activeTab"
|
||||
color="#999" activeColor="#000" fontSize="30rpx" activeFontSize="31rpx" @change='changeTab' />
|
||||
|
||||
|
||||
<block v-if="(activeTab == 0)&&!searchResultShow">
|
||||
<view v-if="companyList.length > 0">
|
||||
<block v-for="(item, index) in companyList" :key="item.id">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
|
||||
<view class="nothingContnt">
|
||||
暂无信息
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="(activeTab == 1)&&!searchResultShow">
|
||||
<view v-if="newList.length > 0">
|
||||
<block v-for="(item, index) in newList" :key="index">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" class="nothing" mode=""></image>
|
||||
<view class="nothingContnt">暂无信息</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
||||
|
||||
<block v-if="(activeTab == 2)&&!searchResultShow">
|
||||
<view v-if="recommendList.length > 0">
|
||||
<block v-for="(item, index) in recommendList" :key="item.id">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
|
||||
<view class="nothingContnt">
|
||||
完善技能,获取精推荐
|
||||
</view>
|
||||
<!-- <view class="btn" @click="goResume">
|
||||
完善技能
|
||||
</view> -->
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- <view v-if="companyList.length > 0">
|
||||
<block v-for="(item, index) in companyList" :key="item.id">
|
||||
<companyList :companyitem="item"></companyList>
|
||||
<view class="baddd"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
|
||||
<view class="nothingContnt">
|
||||
暂无任务信息
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
newMissionAll,
|
||||
getSearchKeyWordsList,
|
||||
clearSearchKeyWords,
|
||||
getListByKeyWords
|
||||
} from '@/api/mission.js';
|
||||
import companyList from '@/components/companyList/companyList.vue';
|
||||
import vTabs from '@/components/v-tabs/v-tabs.vue';
|
||||
import testData from '@/common/textdata.js';
|
||||
export default {
|
||||
components: {
|
||||
companyList,
|
||||
vTabs,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTab: 0,
|
||||
companyList: [],
|
||||
recommendList: [],
|
||||
newList: [],
|
||||
keywords: '',
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
},
|
||||
searchHistoryList: [],
|
||||
searchResultShow: false,
|
||||
searchResultList: []
|
||||
};
|
||||
},
|
||||
onLoad: function(option) {
|
||||
this.keywords = option.keywords ? option.keywords : ''
|
||||
},
|
||||
onShow: function() {
|
||||
this.getList('search');
|
||||
|
||||
this.getKeyWordsList()
|
||||
},
|
||||
/*页面滚动到底部*/
|
||||
onReachBottom: function() {
|
||||
this.upLoad()
|
||||
},
|
||||
methods: {
|
||||
clearCurrentKeyWords() {
|
||||
this.keywords = '';
|
||||
let that = this;
|
||||
setTimeout(function() {
|
||||
that.searchResultShow = false;
|
||||
}, 100);
|
||||
|
||||
},
|
||||
// 新面板搜索
|
||||
getNewList() {
|
||||
getListByKeyWords(this.keywords).then(res => {
|
||||
this.searchResultShow = true
|
||||
this.searchResultList = res.data.data
|
||||
// this.searchResultList.forEach((item, index) => {
|
||||
// item.name = this.getInf(item.name, this.keywords);
|
||||
// })
|
||||
})
|
||||
},
|
||||
// 获取搜索历史记录
|
||||
getKeyWordsList() {
|
||||
getSearchKeyWordsList().then(res => {
|
||||
let response = res.data
|
||||
if (response.code == 200) {
|
||||
this.searchHistoryList = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
keyWordsClick(keyWords) {
|
||||
// console.log(keyWords)
|
||||
this.searchResultShow = true;
|
||||
this.keywords = keyWords;
|
||||
this.getNewList();
|
||||
},
|
||||
//最新任务;
|
||||
getList: function(type) {
|
||||
//改变搜索条件,页码值变为1
|
||||
if (type === 'search') {
|
||||
this.page.current = 1;
|
||||
};
|
||||
// if (this.keywords) {
|
||||
newMissionAll(this.page.current, this.page.size, this.keywords).then(res => {
|
||||
if (this.page.current === 1) {
|
||||
this.companyList = [];
|
||||
}
|
||||
this.page.current += 1;
|
||||
this.page.total = res.data.data.total;
|
||||
if (res.data.data && res.data.data.records.length) {
|
||||
this.companyList = this.companyList.concat(res.data.data.records);
|
||||
|
||||
}
|
||||
//搜索关键词高亮
|
||||
// if (this.companyList.length) {
|
||||
// this.companyList.forEach((item, index) => {
|
||||
// item.missionTitle = this.getInf(item.missionTitle, this.keywords);
|
||||
// });
|
||||
// }
|
||||
console.log(this.companyList, '----------');
|
||||
})
|
||||
// }
|
||||
},
|
||||
|
||||
//上拉加载
|
||||
upLoad: function() {
|
||||
if (this.page.current <= Math.ceil(this.page.total / this.page.size)) {
|
||||
this.getList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: '已经是最后一页',
|
||||
})
|
||||
return
|
||||
}
|
||||
},
|
||||
closeBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 指定关键字高亮
|
||||
* @param {*} str 字符串
|
||||
* @param {*} key 关键字
|
||||
*/
|
||||
getInf(str, key) {
|
||||
if (str && key) {
|
||||
let replaceReg = new RegExp(key, 'g') // 匹配关键字正则
|
||||
let replaceString = "<span style='color: #1b66ff;'>" + key + "</span>" // 高亮替换
|
||||
return str.replace(replaceReg, replaceString);
|
||||
}
|
||||
},
|
||||
|
||||
toDetail(item) {
|
||||
const no = item.id
|
||||
// 判断是岗位还是任务 0:任务,1:岗位,2:政策
|
||||
if (item.type == 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/projectInfo?missionNo=${encodeURIComponent(no)}&isCan=1`
|
||||
})
|
||||
} else if (item.type == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/workInfo?workId=${encodeURIComponent(no)}&isCan=1`
|
||||
})
|
||||
} else if (item.type == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/policyContent?id=${no}`
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
changeTab: function(e) {
|
||||
this.activeTab = e;
|
||||
},
|
||||
// 清空搜索历史
|
||||
clearKeyWords() {
|
||||
clearSearchKeyWords().then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.getKeyWordsList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mainWrapper {
|
||||
background-color: #f3f4f8;
|
||||
min-height: 95vh;
|
||||
}
|
||||
|
||||
.baddd {
|
||||
background-color: #f6f6f6;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 24rpx;
|
||||
top: 6rpx;
|
||||
height: 60rpx;
|
||||
padding: 5rpx 0;
|
||||
line-height: 60rpx;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.headSearch .search-view {
|
||||
border-bottom: 1rpx solid #dddddd;
|
||||
padding: 14rpx 32rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.headSearch .search-item {
|
||||
display: flex;
|
||||
padding: 0 10rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(249, 249, 249, 1);
|
||||
border-radius: 200px;
|
||||
align-items: center;
|
||||
border: 1px solid #0091ff;
|
||||
}
|
||||
|
||||
.headSearch .search-item input {
|
||||
padding: 0 24rpx;
|
||||
height: 80rpx;
|
||||
font-weight: 400;
|
||||
flex: 1;
|
||||
text-align: start;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang-SC-Bold, PingFang-SC;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
|
||||
.headSearch .search-item .placeholderClass {
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.headSearch .search-item image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
}
|
||||
|
||||
.nothing {
|
||||
width: 400rpx;
|
||||
height: 200rpx;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-top: 50%;
|
||||
}
|
||||
|
||||
.nothingContnt {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-history {
|
||||
background-color: #fff;
|
||||
padding: 10rpx 40rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.search-history .title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.search-history .clear {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.search-history .empty {
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.search-history .wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.search-history .wrapper .item {
|
||||
font-size: 24rpx;
|
||||
background-color: #f6f6f6;
|
||||
padding: 8rpx 12rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.search-result {
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.search-result .title {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.search-result .search-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
}
|
||||
|
||||
.search-result .search-item .type {
|
||||
font-size: 20rpx;
|
||||
color: #707070;
|
||||
background-color: #dddddd;
|
||||
border-radius: 15rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
port: 1887,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://192.168.1.106:8000',
|
||||
target: 'http://10.165.0.173:8000',
|
||||
ws: true,
|
||||
pathRewrite: {
|
||||
'^/api': '/'
|
||||
|
||||
Reference in New Issue
Block a user