flat: 基础修改

This commit is contained in:
Apcallover
2024-04-14 14:32:17 +08:00
parent c4f62b6efb
commit 05686b2bba
11 changed files with 4459 additions and 4193 deletions

View File

@@ -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
})
}

View File

@@ -65,449 +65,464 @@
</template>
<script>
import {classifyData, classifyData2} from './classifyData.js';
console.log(classifyData, classifyData2)
import { getTrade } from '@/api/resume.js'
export default {
props: {
closePopUp: {
type: Function,
required: true
},
subMitPopUp: {
type: Function,
required: true
},
isTask: {
type: Boolean,
default: false
}
},
components: {
// vTabs,
// companyList, verticalMenu
},
data() {
return {
scrollTop: 0,
oldScrollTop: 0,
current: 0,
menuHeight: 0,
menuItemHeight: 0,
itemId: "0",
tabbar: classifyData,
menuItemPos: 0,
arr: [],
scrollRightTop: 0,
timer: null,
areaModal: {
address: '',
addressShow: false,
title: 'Hello',
// indexs: [0, 0, 8],
// defaultIds: [1, 110000, 110106],
defaultNames: ['四川省', '德阳市', '旌阳区'],
labelName: "areaName",
isClickAddress: false,
import {
classifyData,
classifyData2
} from './classifyData.js';
console.log(classifyData, classifyData2)
import {
getTrade
} from '@/api/resume.js'
export default {
props: {
closePopUp: {
type: Function,
required: true
},
industryModal: {
industry: "",
industryList: [[]],
industryShow: false,
isClickIndustry: false,
subMitPopUp: {
type: Function,
required: true
},
submitData: {},
canSubmit: false,
}
},
created: function () {
if(!this.isTask) {
this.tabbar = classifyData2
}
this.getData()
this.getMenuItemTop()
},
methods: {
getData: function () {
getTrade().then(res => {
console.log(res.data.data);
const newData = this.tabbar;
newData.map(item => {
if (item.name === "行业") {
item.data = res.data.data
}
})
this.tabbar = newData;
this.industryModal.industry = res.data.data[0]?.name
this.industryModal.industryList = [res.data.data]
})
},
// 点击左边的栏目切换
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop();
isTask: {
type: Boolean,
default: false
}
if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(() => {
this.scrollRightTop = this.arr[index];
// scrollRightTop = newarrTop
this.current = index;
this.leftMenuStatus(index);
})
},
// 获取一个目标元素的高度
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
// const query = uni.createSelectorQuery().in(this);
const query = uni.createSelectorQuery()
query.select('.' + elClass).fields({
size: true
}, res => {
// 如果节点尚未生成res值为null循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
if (dataVal == 'menuHeight') {
this.menuHeight = res.height;
}
if (dataVal == 'menuItemHeight') {
this.menuItemHeight = res.height;
}
resolve();
}).exec();
})
components: {
// vTabs,
// companyList, verticalMenu
},
data() {
return {
scrollTop: 0,
oldScrollTop: 0,
current: 0,
menuHeight: 0,
menuItemHeight: 0,
itemId: "0",
tabbar: classifyData,
menuItemPos: 0,
arr: [],
scrollRightTop: 0,
timer: null,
// 观测元素相交状态
async observer() {
this.tabbar.map((val, index) => {
let observer = uni.createIntersectionObserver(this);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交就动态设置左边栏目的活动状态
observer.relativeTo('.right-box', {
top: 0
}).observe('#item' + index, res => {
if (res.intersectionRatio > 0) {
let id = res.id.substring(4);
this.leftMenuStatus(id);
}
})
})
},
// 设置左边菜单的滚动状态
async leftMenuStatus(index) {
this.current = index;
// 如果为0意味着尚未初始化
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
areaModal: {
address: '',
addressShow: false,
title: 'Hello',
// indexs: [0, 0, 8],
// defaultIds: [1, 110000, 110106],
defaultNames: ['四川省', '德阳市', '旌阳区'],
labelName: "areaName",
isClickAddress: false,
},
industryModal: {
industry: "",
industryList: [
[]
],
industryShow: false,
isClickIndustry: false,
},
submitData: {},
canSubmit: false,
}
// console.log(index, this.arr[index]);
// 将菜单活动item垂直居中
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
},
created: function() {
if (!this.isTask) {
this.tabbar = classifyData2
}
this.getData()
this.getMenuItemTop()
},
// 右边菜单滚动
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (this.timer) return;
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
setTimeout(() => { // 节流
this.timer = null;
// scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i];
let height2 = this.arr[i + 1];
// 如果不存在height2意味着数据循环已经到了最后一个设置左边菜单为最后一项即可
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i - 1);
return;
}
}
}, 50)
},
methods: {
getData: function() {
getTrade().then(res => {
console.log(res.data.data);
const newData = this.tabbar;
// 获取右边菜单每个item到顶部的距离
getMenuItemTop() {
new Promise(resolve => {
let selectorQuery = uni.createSelectorQuery();
console.log(selectorQuery);
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
console.log(rects);
// 如果节点尚未生成rects值为[](因为用selectAll所以返回的是数组),循环调用执行
if (!rects.length) {
setTimeout(() => {
this.getMenuItemTop();
}, 10);
return;
}
rects.forEach((rect) => {
// 这里减去rects[0].top是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
this.arr.push(rect.top - rects[0].top);
resolve();
newData.map(item => {
if (item.name === "行业") {
item.data = res.data.data
}
})
}).exec()
})
},
clickFunc({ type, bigObj, smallObj }) {
this.canSubmit = true;
switch (type) {
case "industry":
this.industryModal.industryShow = true;
this.industryModal.isClickIndustry = true;
this.$set(this.industryModal, 'isClickIndustry', true);
break;
case "address":
this.areaModal.addressShow = true;
// this.areaModal.isClickAddress=true;
this.$set(this.areaModal, 'isClickAddress', true);
break;
this.tabbar = newData;
this.industryModal.industry = res.data.data[0]?.name
this.industryModal.industryList = [res.data.data]
default:
this.$set(this.submitData, bigObj.name, smallObj.id);
console.log(this.submitData);
break;
})
},
// 点击左边的栏目切换
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(() => {
this.scrollRightTop = this.arr[index];
// scrollRightTop = newarrTop
this.current = index;
this.leftMenuStatus(index);
})
},
// 获取一个目标元素的高度
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
// const query = uni.createSelectorQuery().in(this);
const query = uni.createSelectorQuery()
query.select('.' + elClass).fields({
size: true
}, res => {
// 如果节点尚未生成res值为null循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
if (dataVal == 'menuHeight') {
this.menuHeight = res.height;
}
if (dataVal == 'menuItemHeight') {
this.menuItemHeight = res.height;
}
resolve();
}).exec();
})
},
// 观测元素相交状态
async observer() {
this.tabbar.map((val, index) => {
let observer = uni.createIntersectionObserver(this);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交就动态设置左边栏目的活动状态
observer.relativeTo('.right-box', {
top: 0
}).observe('#item' + index, res => {
if (res.intersectionRatio > 0) {
let id = res.id.substring(4);
this.leftMenuStatus(id);
}
})
})
},
// 设置左边菜单的滚动状态
async leftMenuStatus(index) {
this.current = index;
// 如果为0意味着尚未初始化
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// console.log(index, this.arr[index]);
// 将菜单活动item垂直居中
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
},
// 右边菜单滚动
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (this.timer) return;
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
setTimeout(() => { // 节流
this.timer = null;
// scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i];
let height2 = this.arr[i + 1];
// 如果不存在height2意味着数据循环已经到了最后一个设置左边菜单为最后一项即可
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i - 1);
return;
}
}
}, 50)
},
// 获取右边菜单每个item到顶部的距离
getMenuItemTop() {
new Promise(resolve => {
let selectorQuery = uni.createSelectorQuery();
console.log(selectorQuery);
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
console.log(rects);
// 如果节点尚未生成rects值为[](因为用selectAll所以返回的是数组),循环调用执行
if (!rects.length) {
setTimeout(() => {
this.getMenuItemTop();
}, 10);
return;
}
rects.forEach((rect) => {
// 这里减去rects[0].top是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
this.arr.push(rect.top - rects[0].top);
resolve();
})
}).exec()
})
},
clickFunc({
type,
bigObj,
smallObj
}) {
this.canSubmit = true;
switch (type) {
case "industry":
this.industryModal.industryShow = true;
this.industryModal.isClickIndustry = true;
this.$set(this.industryModal, 'isClickIndustry', true);
break;
case "address":
this.areaModal.addressShow = true;
// this.areaModal.isClickAddress=true;
this.$set(this.areaModal, 'isClickAddress', true);
break;
default:
this.$set(this.submitData, bigObj.name, smallObj.id);
console.log(this.submitData);
break;
}
},
changeHandler(e) {
const {
columnIndex,
value,
values, // values为当前变化列的数组内容
index,
// 微信小程序无法将picker实例传出来只能通过ref操作
picker = this.$refs.uPicker
} = e
// 当第一列值发生变化时,变化第二列(后一列)对应的选项
if (columnIndex === 0) {
// picker为选择器this实例变化第二列对应的选项
picker.setColumnValues(1, this.columnData[index])
}
},
confirmAddress(val) {
console.log(val, "点击地址");
var valArr = val.value;
this.areaModal.address = [...new Set(val.value)].join(' / ')
this.areaModal.address1 = valArr
this.areaModal.addressShow = false
},
pickerIndustryFunc(val) {
console.log(val, "点击行业");
this.industryModal.industry = val.value[0].name;
this.industryModal.industryShow = false
},
subMitFunc(val) {
if (!this.canSubmit) return;
if (!this.areaModal.isClickAddress) {
// this.areaModal.address1 = [null, null, null];
this.areaModal.address1 = ["", "", ""];
}
if (!this.industryModal.isClickIndustry) {
this.industryModal.industry = "";
}
console.log(this.submitData, this.areaModal, this.industryModal);
this.subMitPopUp({
submitData: this.submitData,
areaModal: this.areaModal,
industryModal: this.industryModal
})
}
},
changeHandler(e) {
const {
columnIndex,
value,
values, // values为当前变化列的数组内容
index,
// 微信小程序无法将picker实例传出来只能通过ref操作
picker = this.$refs.uPicker
} = e
// 当第一列值发生变化时,变化第二列(后一列)对应的选项
if (columnIndex === 0) {
// picker为选择器this实例变化第二列对应的选项
picker.setColumnValues(1, this.columnData[index])
}
},
confirmAddress(val) {
console.log(val, "点击地址");
var valArr = val.value;
this.areaModal.address = [...new Set(val.value)].join(' / ')
this.areaModal.address1 = valArr
this.areaModal.addressShow = false
},
pickerIndustryFunc(val) {
console.log(val, "点击行业");
this.industryModal.industry = val.value[0].name;
this.industryModal.industryShow = false
},
subMitFunc(val) {
if (!this.canSubmit) return;
if (!this.areaModal.isClickAddress) {
// this.areaModal.address1 = [null, null, null];
this.areaModal.address1 = ["", "", ""];
}
if (!this.industryModal.isClickIndustry) {
this.industryModal.industry = "";
}
console.log(this.submitData, this.areaModal, this.industryModal);
this.subMitPopUp({ submitData: this.submitData, areaModal: this.areaModal, industryModal: this.industryModal })
}
}
}
</script>
<style lang="scss" scoped>
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
}
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
}
.u-search-box {
padding: 18rpx 30rpx;
}
.u-search-box {
padding: 18rpx 30rpx;
}
.u-menu-wrap {
flex: 100;
display: flex;
overflow: hidden;
}
.u-menu-wrap {
flex: 100;
display: flex;
overflow: hidden;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text {
font-size: 26rpx;
color: #ccc;
margin-left: 10rpx;
}
.u-search-text {
font-size: 26rpx;
color: #ccc;
margin-left: 10rpx;
}
.u-tab-view {
width: 200rpx;
height: 100%;
}
.u-tab-view {
width: 200rpx;
height: 100%;
}
.u-tab-item {
height: 110rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #444;
font-weight: 400;
line-height: 1;
}
.u-tab-item {
height: 110rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #444;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active {
position: relative;
color: #000;
font-size: 30rpx;
font-weight: 600;
background: #fff;
}
.u-tab-item-active {
position: relative;
color: #000;
font-size: 30rpx;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: "";
position: absolute;
border-left: 4px solid skyblue;
height: 32rpx;
left: 0;
top: 39rpx;
}
.u-tab-item-active::before {
content: "";
position: absolute;
border-left: 4px solid skyblue;
height: 32rpx;
left: 0;
top: 39rpx;
}
.u-tab-view {
height: 100%;
}
.u-tab-view {
height: 100%;
}
.right-box {
background-color: rgb(250, 250, 250);
}
.right-box {
background-color: rgb(250, 250, 250);
}
.page-view {
padding: 8rpx;
padding-left: 4rpx;
}
.page-view {
padding: 8rpx;
padding-left: 4rpx;
}
.class-item {
margin-bottom: 10rpx;
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
}
.class-item {
margin-bottom: 10rpx;
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
}
.class-item:last-child {
min-height: 100vh;
}
.class-item:last-child {
min-height: 100vh;
}
.item-title {
font-size: 28rpx;
font-weight: bold;
}
.item-title {
font-size: 28rpx;
font-weight: bold;
}
.item-menu-name {
font-weight: normal;
font-size: 26rpx;
.item-menu-name {
font-weight: normal;
font-size: 26rpx;
}
}
.item-container {
display: flex;
flex-wrap: wrap;
}
.item-container {
display: flex;
flex-wrap: wrap;
}
.thumb-box {
width: 43%;
line-height: 80rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 25rpx;
margin-left: 20rpx;
background-color: #f3f4f8;
border: 1px solid #f3f4f8;
color: #666666;
}
.thumb-box {
width: 43%;
line-height: 80rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 25rpx;
margin-left: 20rpx;
background-color: #f3f4f8;
border: 1px solid #f3f4f8;
color: #666666;
}
.thumb-box1 {
width: 90%;
.thumb-box1 {
width: 90%;
}
}
.selected-box {
background-color: #e3eafe;
border: 1px solid #92adfb;
color: #92adfb !important;
}
.selected-box {
background-color: #e3eafe;
border: 1px solid #92adfb;
color: #92adfb !important;
}
.item-menu-image {
width: 120rpx;
height: 120rpx;
}
.item-menu-image {
width: 120rpx;
height: 120rpx;
}
.buttonWrapper {
// position: absolute;
// bottom: 10px;
display: flex;
justify-content: space-around;
margin-bottom: -10px;
margin-top: 10px;
}
.buttonWrapper {
// position: absolute;
// bottom: 10px;
display: flex;
justify-content: space-around;
margin-bottom: -10px;
margin-top: 10px;
}
.cancelButton {
padding: 15rpx 30rpx;
background-color: #f3f4f8;
border-radius: 5px;
color: #9b9b9b;
}
.cancelButton {
padding: 15rpx 120rpx;
background-color: #f3f4f8;
border-radius: 5px;
color: #9b9b9b;
}
.sureButton {
padding: 15rpx 150rpx;
background-color: #4171f9;
color: #fff;
border-radius: 5px;
}
.sureButton {
padding: 15rpx 120rpx;
background-color: #4171f9;
color: #fff;
border-radius: 5px;
}
.noSubMitButton {
background-color: #f3f4f8;
color: #9b9b9b;
}
.noSubMitButton {
background-color: #f3f4f8;
color: #9b9b9b;
}
</style>

View File

@@ -1,40 +1,40 @@
<template>
<view style="background-color: #fff;">
<view class="head" @click="goUserBase">
<image v-if="userInfo.avatar" :src="userInfo.avatar" mode=""></image>
<image v-else src="../../../static/img/head.svg" mode=""></image>
<view style="background-color: #fff;">
<view class="head" @click="goUserBase">
<image v-if="userInfo.avatar" :src="userInfo.avatar" mode=""></image>
<image v-else src="../../../static/img/head.svg" mode=""></image>
<view class="name">
<view class="userName">
{{ auth.authInfo.realName }}
</view>
<view class="userInfo">
个人基本信息
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="name">
<view class="userName">
{{ auth.authInfo.realName }}
</view>
<view class="userInfo">
个人基本信息
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="title">
<view class="title_text">
我的职业技能
</view>
<image v-if="mySkills.length < 2" src="../../../static/img/add.gray.svg" mode="" @click="goAdd"></image>
</view>
<view class="title">
<view class="title_text">
我的职业技能
</view>
<image v-if="mySkills.length < 2" src="../../../static/img/add.gray.svg" mode="" @click="goAdd"></image>
</view>
<view class="listBody">
<m-slide-list @controller-reg="controller.reg" @controller-moving="controller.moving"
@controller-opened="controller.opened" @controller-closed="controller.closed"
@remove="removeSkills(item.id, index)" v-for="(item, index) in mySkills" :key="item.id"
:button="buttonList">
<view class="list">
<view class="list_text">
{{ item.worktypes }}{{ item.skills }}
</view>
</view>
</m-slide-list>
</view>
<!-- <view class="jobcontent" @click="goSetCity">
<view class="listBody">
<m-slide-list @controller-reg="controller.reg" @controller-moving="controller.moving"
@controller-opened="controller.opened" @controller-closed="controller.closed"
@remove="removeSkills(item.id, index)" v-for="(item, index) in mySkills" :key="item.id"
:button="buttonList">
<view class="list">
<view class="list_text">
{{ item.worktypes }}{{ item.skills }}
</view>
</view>
</m-slide-list>
</view>
<!-- <view class="jobcontent" @click="goSetCity">
<view class="jobinfo">
<view
v-bind:class="['jobAddress', { 'input-error': !myResume.city.id && !myResume.city.workplace && isShowBorder }]">
@@ -47,463 +47,511 @@
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view> -->
<view class="jobcontent" @click="areaModal.addressShow = true">
<view class="jobinfo">
<view
v-bind:class="['jobAddress', { 'input-error': !myResume.city.id && !myResume.city.workplace && isShowBorder }]">
想工作的地点
</view>
<view v-bind:class="['jobText']">
{{ myResume.city !== "{}" ? myResume.city.id ? getCity(myResume.city.id) : myResume.city.workplace :
<view class="jobcontent" @click="areaModal.addressShow = true">
<view class="jobinfo">
<view
v-bind:class="['jobAddress', { 'input-error': !myResume.city.id && !myResume.city.workplace && isShowBorder }]">
想工作的地点
</view>
<view v-bind:class="['jobText']">
{{ myResume.city !== "{}" ? myResume.city.id ? getCity(myResume.city.id) : myResume.city.workplace :
'请选择'
}}
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="jobcontent" @click="showPickerFunc('education')">
<view class="jobinfo">
<view v-bind:class="['jobAddress', { 'input-error': !myResume.education.label && isShowBorder }]">
的学历
</view>
<view v-bind:class="['jobText']">
{{ myResume.education !== "{}" ? myResume.education.label : '请选择' }}
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="jobcontent" @click="showPickerFunc('wage')">
<view class="jobinfo">
<view v-bind:class="['jobAddress', { 'input-error': !myResume.wage && isShowBorder }]">
的期望薪资
</view>
<view v-bind:class="['jobText']">
{{ myResume.wage ? myResume.wage : '请选择' }}
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="jobcontent">
<view class="jobinfo">
<view v-bind:class="['jobAddress', { 'input-error': !myResume.phone && isShowBorder }]">
的联系方式
</view>
<u--input :value="myResume.phone" @focus="setPhoneFunc1" @change="setPhoneFunc" type="number"
placeholder="请输入您的电话" border="none" clearable></u--input>
</view>
</view>
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="jobcontent" @click="showPickerFunc('education')">
<view class="jobinfo">
<view v-bind:class="['jobAddress', { 'input-error': !myResume.education.label && isShowBorder }]">
的学历
</view>
<view v-bind:class="['jobText']">
{{ myResume.education !== "{}" ? myResume.education.label : '请选择' }}
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="jobcontent" @click="showPickerFunc('wage')">
<view class="jobinfo">
<view v-bind:class="['jobAddress', { 'input-error': !myResume.wage && isShowBorder }]">
的期望薪资
</view>
<view v-bind:class="['jobText']">
{{ myResume.wage ? myResume.wage : '请选择' }}
</view>
</view>
<image src="../../../static/img/right.svg" mode=""></image>
</view>
<view class="jobcontent">
<view class="jobinfo">
<view v-bind:class="['jobAddress', { 'input-error': !myResume.phone && isShowBorder }]">
的联系方式
</view>
<u--input :value="myResume.phone" @focus="setPhoneFunc1" @change="setPhoneFunc" type="number"
placeholder="请输入您的电话" border="none" clearable></u--input>
</view>
</view>
<view v-if="isShowButton" class="saveWrapper">
<u-button @click="subMitResume" type="primary" shape="circle" text="保存"></u-button>
</view>
<view v-if="isShowButton" class="saveWrapper">
<u-button @click="subMitResume" type="primary" shape="circle" text="保存"></u-button>
</view>
<view class="border"></view>
<view class="border"></view>
<u-picker @confirm="pickerButtonFunc" @cancel="showPicker = false" :show="showPicker" :columns="columns"
keyName="label"></u-picker>
<u-picker @confirm="pickerButtonFunc" @cancel="showPicker = false" :show="showPicker" :columns="columns"
keyName="label"></u-picker>
<u-toast ref="uToast"></u-toast>
<u-toast ref="uToast"></u-toast>
<!-- 省市 -->
<data-picker :show="areaModal.addressShow" @confirm='confirmAddress' @cancel='areaModal.addressShow = false'
@close='areaModal.addressShow = false' :defaultNames="areaModal.defaultNames" :indexs="areaModal.indexs"
:defaultIds="areaModal.defaultIds" :showToolbar="false" :showBottombar="true"
:labelName="areaModal.labelName"></data-picker>
</view>
<!-- 省市 -->
<data-picker :show="areaModal.addressShow" @confirm='confirmAddress' @cancel='areaModal.addressShow = false'
@close='areaModal.addressShow = false' :defaultNames="areaModal.defaultNames" :indexs="areaModal.indexs"
:defaultIds="areaModal.defaultIds" :showToolbar="false" :showBottombar="true"
:labelName="areaModal.labelName"></data-picker>
</view>
</template>
<script>
import {
mapGetters
} from 'vuex'
import {
mySkills,
myResume,
removeSkills,
setCity,
setLearn,
setResume
} from '@/api/resume.js';
import mSlideList from '@/components/mark-slide-list/mark-slide-list.vue';
import controller from '@/components/mark-slide-list/controller';
import {
mapGetters
} from 'vuex'
import {
mySkills,
myResume,
removeSkills,
setCity,
setLearn,
setResume
} from '@/api/resume.js';
import mSlideList from '@/components/mark-slide-list/mark-slide-list.vue';
import controller from '@/components/mark-slide-list/controller';
export default {
components: {
mSlideList
},
data() {
return {
controller: new controller(),
myResume: {
city: {},
education: {},
wage: "",
phone: "",
},
mySkills: [],
id: undefined,
// id: '',
buttonList: [{
title: '删除',
background: '#ff3b32',
clickName: 'remove'
}],
showPicker: false,
showType: "",
columns: [[]],
export default {
components: {
mSlideList
},
data() {
return {
controller: new controller(),
myResume: {
city: {},
education: {},
wage: "",
phone: "",
},
mySkills: [],
id: undefined,
// id: '',
buttonList: [{
title: '删除',
background: '#ff3b32',
clickName: 'remove'
}],
showPicker: false,
showType: "",
columns: [
[]
],
canSubMit: false,
isShowButton: false,
isShowBorder: false,
isShowAddSkill: true,
canSubMit: false,
isShowButton: false,
isShowBorder: false,
isShowAddSkill: true,
areaModal: {
address: '',
addressShow: false,
title: 'Hello',
// indexs: [0, 0, 8],
// defaultIds: [1, 110000, 110106],
defaultNames: ['北京市', '北京市', '东城区'],
labelName: "areaName"
areaModal: {
address: '',
addressShow: false,
title: 'Hello',
// indexs: [0, 0, 8],
// defaultIds: [1, 110000, 110106],
defaultNames: ['北京市', '北京市', '东城区'],
labelName: "areaName"
},
}
},
onShow() {
this.getSkill()
},
created() {
this.getResume()
},
computed: {
...mapGetters(['userInfo', 'auth'])
},
watch: {
myResume: {
handler: function (newVal, oldVal) {
if (newVal.city && newVal.education && newVal.wage && newVal.phone) {
this.canSubMit = true;
} else {
this.canSubMit = false;
}
},
deep: true
}
},
methods: {
getResume() {
myResume().then(res => {
const data = res.data.data
this.myResume = {
city: { workplace: data.workplace },
education: { label: data.education },
wage: data.wage,
phone: data.telephone
}
this.isShowButton = false;
if (data && data.id) {
this.id = data.id
console.log(this.id,'-----------------------------');
}
});
},
getSkill() {
mySkills().then(res => {
this.mySkills = res.data.data;
})
},
goWantSkill: function () {
uni.$off('getWantSkill')
uni.$once('getWantSkill', (cb) => {
cb(this.myResume.learnSkill)
})
uni.$off('setWantSkill')
uni.$once('setWantSkill', ({
skill,
done
}) => {
setLearn(this.id, skill).then(res => {
uni.navigateBack()
}).catch(() => {
done && done()
})
this.getResume()
})
uni.navigateTo({
url: './setWskill?id=' + this.id
})
},
goSetCity: function () {
uni.$off('setCity')
uni.$on('setCity', ({ detail }) => {
console.log(detail, '---------------');
this.isShowButton = true
this.myResume.city = detail
// setCity(this.id, detail.parentLabel + '-' + detail.label).then(res => {
// this.myResume.cityId = detail.id
// this.getResume()
// })
})
uni.navigateTo({
url: `/pages/setCity/setCity?maxLayer=2`
})
},
goAdd: function () {
},
}
},
onShow() {
this.getSkill()
},
created() {
this.getResume()
},
computed: {
...mapGetters(['userInfo', 'auth'])
},
watch: {
myResume: {
handler: function(newVal, oldVal) {
if (newVal.city && newVal.education && newVal.wage && newVal.phone) {
this.canSubMit = true;
} else {
this.canSubMit = false;
}
},
deep: true
}
},
methods: {
getResume() {
myResume().then(res => {
const data = res.data.data
this.myResume = {
city: {
workplace: data.workplace
},
education: {
label: data.education
},
wage: data.wage,
phone: data.telephone
}
this.isShowButton = false;
if (data && data.id) {
this.id = data.id
console.log(this.id, '-----------------------------');
}
});
},
getSkill() {
mySkills().then(res => {
this.mySkills = res.data.data;
})
},
goWantSkill: function() {
uni.$off('getWantSkill')
uni.$once('getWantSkill', (cb) => {
cb(this.myResume.learnSkill)
})
uni.$off('setWantSkill')
uni.$once('setWantSkill', ({
skill,
done
}) => {
setLearn(this.id, skill).then(res => {
uni.navigateBack()
}).catch(() => {
done && done()
})
this.getResume()
})
uni.navigateTo({
url: './setWskill?id=' + this.id
})
},
goSetCity: function() {
uni.$off('setCity')
uni.$on('setCity', ({
detail
}) => {
console.log(detail, '---------------');
this.isShowButton = true
this.myResume.city = detail
// setCity(this.id, detail.parentLabel + '-' + detail.label).then(res => {
// this.myResume.cityId = detail.id
// this.getResume()
// })
})
uni.navigateTo({
url: `/pages/setCity/setCity?maxLayer=2`
})
},
goAdd: function() {
uni.navigateTo({
url: './addSkill'
})
},
goUserBase: function () {
uni.navigateTo({
url: '../userBase'
})
},
getCity: function (val) {
if (val) {
let areas = this.$store.getters.getAreaParents(val)
if (areas.length) {
return areas[0].label + '-' + areas[1].label
}
}
},
removeSkills: function (id, index) {
removeSkills(id).then(res => {
uni.showToast({
title: '操作成功',
icon: 'none'
});
this.mySkills.splice(index, 1)
})
},
showPickerFunc(type) {
this.showType = type;
switch (type) {
case "education":
this.columns =
[[
{ label: 'MBA/EMBA', value: 0 }, { label: '博士', value: 1 }, { label: '硕士', value: 2 }, { label: '本科', value: 3 },
{ label: '大专', value: 4 }, { label: '高中', value: 5 }, { label: '中专/中技', value: 6 }, { label: '初中及以下,', value: 7 },
{ label: '不限', value: 8 }
]]
break;
case "wage":
this.columns = [['10-15元/小时', '16-20元/小时', '21-25元/小时', '26-30元/小时', '30元/小时以上', '100-150元/天', '151-200元/天'
, '201-250元/天', '251-300元/天', "300元/天以上", "2000元以下/月", "2000-5000元/月", "5000-8000元/月",
"8000-10000元/月", "10000-15000元/月", "15000-20000元/月", "20000-25000元/月", "25000-30000元/月", "30000元以上/月", "面议、暂无要求"
]]
uni.navigateTo({
url: './addSkill'
})
},
goUserBase: function() {
uni.navigateTo({
url: '../userBase'
})
},
getCity: function(val) {
if (val) {
let areas = this.$store.getters.getAreaParents(val)
if (areas.length) {
return areas[0].label + '-' + areas[1].label
}
}
},
removeSkills: function(id, index) {
removeSkills(id).then(res => {
uni.showToast({
title: '操作成功',
icon: 'none'
});
this.mySkills.splice(index, 1)
})
},
showPickerFunc(type) {
this.showType = type;
switch (type) {
case "education":
this.columns = [
[{
label: 'MBA/EMBA',
value: 0
}, {
label: '博士',
value: 1
}, {
label: '硕士',
value: 2
}, {
label: '本科',
value: 3
},
{
label: '大专',
value: 4
}, {
label: '高中',
value: 5
}, {
label: '中专/中技',
value: 6
}, {
label: '初中及以下,',
value: 7
},
{
label: '不限',
value: 8
}
]
]
break;
case "wage":
this.columns = [
['10-15元/小时', '16-20元/小时', '21-25元/小时', '26-30元/小时', '30元/小时以上', '100-150元/天',
'151-200元/天', '201-250元/天', '251-300元/天', "300元/天以上", "2000元以下/月",
"2000-5000元/月", "5000-8000元/月",
"8000-10000元/月", "10000-15000元/月", "15000-20000元/月", "20000-25000元/月",
"25000-30000元/月", "30000元以上/月", "面议、暂无要求"
]
]
break;
break;
default:
default:
break;
}
this.isShowButton = true;
this.showPicker = true;
},
pickerButtonFunc(e) {
console.log(e, this.myResume, this.myResume[this.showType]);
this.myResume[this.showType] = e.value[0];
this.showPicker = false;
},
setPhoneFunc(e) {
this.myResume.phone = e;
},
setPhoneFunc1(e) {
this.isShowButton = true;
},
showToast(text) {
this.$refs.uToast.show({
type: 'error',
icon: false,
title: '失败主题',
message: text,
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
})
},
break;
}
this.isShowButton = true;
this.showPicker = true;
},
pickerButtonFunc(e) {
console.log(e, this.myResume, this.myResume[this.showType]);
this.myResume[this.showType] = e.value[0];
this.showPicker = false;
},
setPhoneFunc(e) {
this.myResume.phone = e;
},
setPhoneFunc1(e) {
this.isShowButton = true;
},
showToast(text) {
this.$refs.uToast.show({
type: 'error',
icon: false,
title: '失败主题',
message: text,
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
})
},
subMitResume() {
console.log(this.myResume);
this.isShowBorder = true;
if (!this.canSubMit) return;
const { city, education, phone, wage } = this.myResume
// 中国大陆手机号码正则表达式
const mobileRegex = /\b(1[3-9]\d{9})\b/;
// 中国大陆座机号码正则表达式
const landlineRegex = /\b(0\d{2,3}-\d{7,8}(-\d{1,4})?)\b/;
subMitResume() {
console.log(this.myResume);
this.isShowBorder = true;
if (!this.canSubMit) return;
const {
city,
education,
phone,
wage
} = this.myResume
// 中国大陆手机号码正则表达式
const mobileRegex = /\b(1[3-9]\d{9})\b/;
// 中国大陆座机号码正则表达式
const landlineRegex = /\b(0\d{2,3}-\d{7,8}(-\d{1,4})?)\b/;
if (mobileRegex.test(phone) || landlineRegex.test(phone)) {
// 电话号码格式正确
console.log(phone, "电话号码格式正确");
setResume({
id: this.id, education: education.label, workplace: city.workplace ? city.workplace : city.parentLabel + '-' + city.label, telephone: phone, wage
}).then(res => {
this.isShowButton = false;
this.getResume()
})
} else {
// 电话号码格式不正确
console.log(phone, "电话号码格式不正确");
this.showToast("电话号码格式不正确");
}
return;
if (mobileRegex.test(phone) || landlineRegex.test(phone)) {
// 电话号码格式正确
console.log(phone, "电话号码格式正确");
setResume({
id: this.id,
education: education.label,
workplace: city.workplace ? city.workplace : city.parentLabel + '-' + city.label,
telephone: phone,
wage
}).then(res => {
this.isShowButton = false;
this.getResume()
})
} else {
// 电话号码格式不正确
console.log(phone, "电话号码格式不正确");
this.showToast("电话号码格式不正确");
}
return;
},
},
confirmAddress(val) {
console.log(val);
var valArr = val.value;
// this.areaModal.address = [...new Set(val.value)].join(' / ')
this.isShowButton = true
this.myResume.city.workplace = [...new Set(val.value)].join('/')
console.log(this.areaModal.address);
this.areaModal.addressShow = false
},
}
}
confirmAddress(val) {
console.log(val);
var valArr = val.value;
// this.areaModal.address = [...new Set(val.value)].join(' / ')
this.isShowButton = true
this.myResume.city.workplace = [...new Set(val.value)].join('/')
console.log(this.areaModal.address);
this.areaModal.addressShow = false
},
}
}
</script>
<style>
.border {
margin-left: 30rpx;
width: 720rpx;
border: 1rpx solid #f2f2f2;
.border {
margin-left: 30rpx;
width: 720rpx;
border: 1rpx solid #f2f2f2;
/* height: 1rpx;
/* height: 1rpx;
background-color: #ddd; */
}
}
.jobText {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #666666;
}
.jobText {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #666666;
}
.jobAddress {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
}
.jobAddress {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
}
.nochoose {
/* color: #ccc; */
}
.nochoose {
/* color: #ccc; */
}
.jobcontent {
padding: 30rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 63rpx;
border: 1px solid #fff;
}
.jobcontent {
padding: 30rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 63rpx;
border: 1px solid #fff;
}
.jobcontent image {
width: 40rpx;
height: 40rpx;
}
.jobcontent image {
width: 40rpx;
height: 40rpx;
}
.listBody {}
.listBody {}
.list_text {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #666666;
background: #ffffff;
overflow-y: auto;
/* white-space: nowrap; */
overflow-wrap: break-word;
word-wrap: break-word;
}
.list_text {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #666666;
background: #ffffff;
overflow-y: auto;
/* white-space: nowrap; */
overflow-wrap: break-word;
word-wrap: break-word;
}
.list image {
width: 40rpx;
height: 40rpx;
margin-left: auto;
}
.list image {
width: 40rpx;
height: 40rpx;
margin-left: auto;
}
.list {
padding: 0 15px 0 30rpx;
height: 126rpx;
/* line-height: 126rpx; */
background: #fff;
border-bottom: 1px solid #f2f2f2;
display: flex;
align-items: center;
}
.list {
padding: 0 15px 0 30rpx;
height: 126rpx;
/* line-height: 126rpx; */
background: #fff;
border-bottom: 1px solid #f2f2f2;
display: flex;
align-items: center;
}
.title image {
width: 40rpx;
height: 40rpx;
}
.title image {
width: 40rpx;
height: 40rpx;
}
.title {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
display: flex;
padding: 25rpx 30rpx;
/* padding-top: 30rpx; */
background-color: #fff;
align-items: center;
justify-content: space-between;
border: 1rpx solid #f2f2f2;
}
.title {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #999999;
display: flex;
padding: 25rpx 30rpx;
/* padding-top: 30rpx; */
background-color: #fff;
align-items: center;
justify-content: space-between;
border: 1rpx solid #f2f2f2;
}
.userInfo {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #999999;
}
.userInfo {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #999999;
}
.name {
margin-left: 20rpx;
font-family: PingFangSC-Medium;
font-size: 36rpx;
color: #333333;
line-height: 50rpx;
}
.name {
margin-left: 20rpx;
font-family: PingFangSC-Medium;
font-size: 36rpx;
color: #333333;
line-height: 50rpx;
}
.head image:last-child {
width: 40rpx;
height: 40rpx;
margin-left: auto;
}
.head image:last-child {
width: 40rpx;
height: 40rpx;
margin-left: auto;
}
.head image {
width: 100rpx;
height: 100rpx;
}
.head image {
width: 100rpx;
height: 100rpx;
}
page {
background-color: #FFFFFF;
}
page {
background-color: #FFFFFF;
}
.head {
padding: 30rpx;
width: 690rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: flex-start;
}
.head {
padding: 30rpx;
width: 690rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: flex-start;
}
.saveWrapper {
width: 80%;
padding: 20rpx;
margin: 0 auto;
padding-bottom: 60rpx;
}
.saveWrapper {
width: 80%;
padding: 20rpx;
margin: 0 auto;
padding-bottom: 60rpx;
}
.input-error {
color: red;
}
.input-error {
color: red;
}
</style>

1476
pages.json

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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

View File

@@ -1,110 +1,116 @@
<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 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')"
</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 @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>
<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>
</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' />
</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 == 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>
<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 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>
</block>
<!-- <view v-if="companyList.length > 0">
<!-- <view v-if="companyList.length > 0">
<block v-for="(item, index) in companyList" :key="item.id">
<companyList :companyitem="item"></companyList>
<view class="baddd"></view>
@@ -116,311 +122,327 @@
暂无任务信息
</view>
</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');
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);
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);
},
// 新面板搜索
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, '----------');
})
// }
},
}
//搜索关键词高亮
// 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);
}
},
//上拉加载
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}`
})
}
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()
}
})
}
}
};
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;
}
.mainWrapper {
background-color: #f3f4f8;
min-height: 95vh;
}
.close {
position: absolute;
right: 24rpx;
top: 6rpx;
height: 60rpx;
padding: 5rpx 0;
line-height: 60rpx;
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
}
.baddd {
background-color: #f6f6f6;
height: 20rpx;
}
.headSearch .search-view {
border-bottom: 1rpx solid #dddddd;
padding: 14rpx 32rpx;
background: rgba(255, 255, 255, 1);
}
.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-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-view {
border-bottom: 1rpx solid #dddddd;
padding: 14rpx 32rpx;
background: rgba(255, 255, 255, 1);
}
.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 {
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 .placeholderClass {
color: #CCCCCC;
}
.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 image {
height: 32rpx;
width: 32rpx;
}
.headSearch .search-item .placeholderClass {
color: #CCCCCC;
}
.nothing {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
margin-top: 50%;
}
.headSearch .search-item image {
height: 32rpx;
width: 32rpx;
}
.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;
.nothing {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
margin-top: 50%;
}
}
.search-result .search-item .type {
font-size: 20rpx;
color: #707070;
background-color: #dddddd;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding: 0 20rpx;
}
.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>

View File

@@ -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': '/'