flat: 国庆节暂存

This commit is contained in:
史典卓
2024-10-09 10:14:51 +08:00
parent 6504a558ac
commit a4ffe68ec2
32 changed files with 2663 additions and 2135 deletions

69
App.vue
View File

@@ -7,26 +7,42 @@
import { import {
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import {
GoLogin
} from '@/untils/AxiosUtils.js';
// #ifdef H5 // #ifdef H5
import { import {
setPlatformByHostName setPlatformByHostName
} from '@/untils/customized.js' } from '@/untils/customized.js'
import {
reject
} from 'lodash';
// #endif // #endif
export default { export default {
onLaunch: function(options) { onLaunch: function(options) {
this.$store.dispatch('InitArea') this.$store.dispatch('InitArea')
if (options.query.token) { if (options.query.token) {
uni.reLaunch({ this.tokenlogin(options.query.token).then(() => {
url: '/pages/login/blank?token=' + options.query.token this.$store.dispatch('getUserLocation')
this.$store.dispatch('getMobileIsCms')
this.$store.dispatch('getResumeInfo')
}) })
} else if (this.$store.state.user.token) { } else {
this.$store.dispatch('startRefreshTokenTimer') this.$store.dispatch('FedLogOut')
this.$store.dispatch('startRefreshNewsTimer')
this.$store.dispatch('refreshAuthState')
this.$store.dispatch('getUserLocation')
this.$store.dispatch('getMobileIsCms')
} }
// if (options.query.token) {
// // uni.reLaunch({
// // url: '/pages/login/blank?token=' + options.query.token
// // })
// this.tokenlogin(options.query.token)
// } else if (this.$api.haslogin()) {
// this.$store.dispatch('startRefreshTokenTimer')
// this.$store.dispatch('startRefreshNewsTimer')
// this.$store.dispatch('refreshAuthState')
// this.$store.dispatch('getUserLocation')
// this.$store.dispatch('getMobileIsCms')
// }
// #ifdef H5 // #ifdef H5
// 企业定制 // 企业定制
setPlatformByHostName(this.$store) setPlatformByHostName(this.$store)
@@ -35,7 +51,7 @@
onShow: function() {}, onShow: function() {},
onHide: function() {}, onHide: function() {},
computed: { computed: {
...mapGetters(['news']), ...mapGetters(['news', 'auth']),
allUnread() { allUnread() {
return this.news.allUnread return this.news.allUnread
} }
@@ -43,10 +59,41 @@
mounted() { mounted() {
this.$config.showTitle && document.documentElement.style.setProperty('--hide-title', 'block'); this.$config.showTitle && document.documentElement.style.setProperty('--hide-title', 'block');
}, },
methods: {
tokenlogin(token) {
return new Promise((resolve, reject) => {
uni.showLoading({
title: '登录中'
})
if (token) {
const that = this
this.$store.dispatch("LoginByUsername", {
username: 'admin',
password: "admin",
key: '',
code: '1111',
type: "account",
token: token,
tenantId: website.tenantId
}).then((resp) => {
this.$store.dispatch('refreshAuthState').then(() => {
uni.hideLoading()
resolve()
})
}).catch((err) => {
uni.hideLoading()
});
} else {
GoLogin()
}
})
}
},
watch: { watch: {
allUnread(value) { allUnread(value) {
console.log('allUnread', value) console.log('allUnread', value)
if (!this.$store.state.user.token) {} else if (value > 0) { if (!this.$api.haslogin()) {} else if (value > 0) {
uni.showTabBarRedDot({ uni.showTabBarRedDot({
index: 2 index: 2
}) })
@@ -65,7 +112,7 @@
}) })
}) })
} }
} },
} }
}; };
</script> </script>

View File

@@ -307,3 +307,9 @@ export const getPolicyContentList = (params) => request({
method: 'get', method: 'get',
params params
}) })
export const userWorkSearchListAll = (params) => request({
url: '/api/jobslink-api/user/userWork/searchListAll',
method: 'get',
params
})

View File

@@ -34,7 +34,7 @@
</view> </view>
<view style="display: flex;align-items: center;position:absolute;right:0;"> <view style="display: flex;align-items: center;position:absolute;right:0;">
<image src="../../static/img/location_new.png" style="width: 30rpx;height: 30rpx;" mode=""></image> <image src="../../static/img/location_new.png" style="width: 30rpx;height: 30rpx;" mode=""></image>
<view>--km</view> <view>{{distance(companyitem)}}</view>
</view> </view>
</view> </view>
<view class="comment" v-if='comment' @tap.stop="goComment(companyitem.missionNo)"> <view class="comment" v-if='comment' @tap.stop="goComment(companyitem.missionNo)">
@@ -57,6 +57,10 @@
dateFormat dateFormat
} from "../../untils/format.js"; } from "../../untils/format.js";
import dictionary from '@/common/textdata.js'; import dictionary from '@/common/textdata.js';
import {
addZeroPrefix,
getDistanceFromLatLonInKm
} from '@/untils/tools.js'
import { import {
defaults defaults
} from "lodash"; } from "lodash";
@@ -81,7 +85,8 @@
near: { near: {
type: Boolean, type: Boolean,
default: false default: false
} },
location: Object
}, },
data() { data() {
return { return {
@@ -101,6 +106,24 @@
} }
}, },
methods: { methods: {
distance(item) {
const {
lon,
lat
} = item
if (this.position && lon > 0) {
const {
longitude,
latitude
} = this.position
const {
m,
km
} = getDistanceFromLatLonInKm(lat, lon, latitude, longitude)
return m > 1000 ? `${km.toFixed(2)}km` : `${m.toFixed(2)}m`
}
return '--km'
},
goComment: function(no) { goComment: function(no) {
uni.navigateTo({ uni.navigateTo({
url: `../../pageMy/mycomment/mycomment?missionNo=${encodeURIComponent(no)}` url: `../../pageMy/mycomment/mycomment?missionNo=${encodeURIComponent(no)}`
@@ -112,7 +135,7 @@
case 0: case 0:
this.navTo( this.navTo(
`/pages/projectInfo/projectInfo?missionNo=${encodeURIComponent(item.missionNo)}&isCan=1` `/pages/projectInfo/projectInfo?missionNo=${encodeURIComponent(item.missionNo)}&isCan=1`
) )
break break
case 1: case 1:
this.navTo(`/pages/projectInfo/workInfo?workId=${encodeURIComponent(item.id)}&isCan=1`) this.navTo(`/pages/projectInfo/workInfo?workId=${encodeURIComponent(item.id)}&isCan=1`)

View File

@@ -90,7 +90,8 @@
near: { near: {
type: Boolean, type: Boolean,
default: false default: false
} },
position: Object,
}, },
data() { data() {
return { return {

View File

@@ -268,7 +268,36 @@
} }
}, },
fail: () => { fail: () => {
//console.log('获取失败') if (window.location.origin.search('localhost') >= 0 || window.location.origin
.search('10.165.0.173') >= 0) { // 测试环境
const value = that.formatterAdressLocation({
"formatted_address": "四川省德阳市广汉市西高镇李家院子东北约95米",
"location": {
"lon": 104.20046,
"lat": 31.0513
},
"addressComponent": {
"address": "李家院子",
"town": "高坪镇",
"nation": "中国",
"city": "德阳市",
"county_code": "156510681",
"poi_position": "东北",
"county": "广汉市",
"city_code": "156510600",
"address_position": "东北",
"poi": "李家院子",
"province_code": "156510000",
"town_code": "156510681103",
"province": "四川省",
"road": "洛小路",
"road_distance": 126,
"address_distance": 95,
"poi_distance": 95
}
}, 1)
that.arr_list = [value]
}
}, },
complete: () => { complete: () => {
uni.hideLoading(); uni.hideLoading();

View File

@@ -6,6 +6,7 @@ module.exports = {
apiKey: 'e4266a5e84fe6c10f60c559967f0a03f', apiKey: 'e4266a5e84fe6c10f60c559967f0a03f',
// 显示标题 // 显示标题
showTitle: false, showTitle: false,
loginURl: 'https://dy12333.org.cn/h5/#/pages/qyPackge/user/login/login',
// map 1、黑色模块 2、白色模块 // map 1、黑色模块 2、白色模块
// supperMap: 'http://10.165.0.44:1205/proxy/rest/maps/f346b6c59dc64d5793713cf384fab78d/33cbaa14370449a08588f1074ecfec67', // supperMap: 'http://10.165.0.44:1205/proxy/rest/maps/f346b6c59dc64d5793713cf384fab78d/33cbaa14370449a08588f1074ecfec67',
// supperMap: 'http://10.165.0.44:1205/proxy/rest/maps/c02c6f51f3ab4190bffd5e3e54cf5ac4/111013e9067749488d44841208771768', // supperMap: 'http://10.165.0.44:1205/proxy/rest/maps/c02c6f51f3ab4190bffd5e3e54cf5ac4/111013e9067749488d44841208771768',

24
main.js
View File

@@ -8,6 +8,9 @@ import tools from '@/untils/tools.js'
import { import {
VueJsonp VueJsonp
} from 'vue-jsonp' } from 'vue-jsonp'
import {
GoLogin
} from '@/untils/AxiosUtils.js';
// 注册全局组件 // 注册全局组件
// import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue" // import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
// import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue" // import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
@@ -16,9 +19,21 @@ import {
import empty from '@/components/empty/empty.vue' import empty from '@/components/empty/empty.vue'
function haslogin() {
return !!store.state.user.token
}
function hasResume() { // 是否填写简历
const data = store.state.user.resumeInfo
if (!(data.education && data.telephone && data.wage && data.workplace)) {
return false
}
return true
}
function navTo(url, needLogin) { function navTo(url, needLogin) {
console.log(url) if (needLogin && !haslogin()) {
if (needLogin) { GoLogin()
return return
} }
uni.navigateTo({ uni.navigateTo({
@@ -26,6 +41,7 @@ function navTo(url, needLogin) {
}) })
} }
const msg = (title, duration = 1500, mask = false, icon = 'none') => { const msg = (title, duration = 1500, mask = false, icon = 'none') => {
uni.showToast({ uni.showToast({
title, title,
@@ -50,7 +66,9 @@ Vue.component('super-map', superMapView)
Vue.component('empty', empty) Vue.component('empty', empty)
Vue.prototype.$api = { Vue.prototype.$api = {
msg, msg,
sleep sleep,
haslogin,
hasResume
} }
Vue.prototype.tools = tools Vue.prototype.tools = tools
Vue.prototype.$config = config Vue.prototype.$config = config

View File

@@ -65,11 +65,7 @@
}, },
"h5": { "h5": {
"sdkConfigs": { "sdkConfigs": {
"maps": { "maps": {}
"qqmap": {
"key": "FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI"
}
}
}, },
"template": "index.html", "template": "index.html",
"router": { "router": {

View File

@@ -36,7 +36,7 @@
} }
}, },
onShow() { onShow() {
if (!this.$store.state.user.token){ if (!this.$api.haslogin()){
//modalTitle, content, whetherCancel, confirmText, pageUrl, cancelUrl //modalTitle, content, whetherCancel, confirmText, pageUrl, cancelUrl
showUniModal('提示','您还未登录,点击确认去登录',true,'确定','/pages/login/login','/pages/index/index') showUniModal('提示','您还未登录,点击确认去登录',true,'确定','/pages/login/login','/pages/index/index')
}else{ }else{

View File

@@ -171,6 +171,9 @@
</template> </template>
<script> <script>
import {
GoLogin
} from '@/untils/AxiosUtils.js';
import { import {
mapGetters mapGetters
} from 'vuex' } from 'vuex'
@@ -247,6 +250,10 @@
} }
}, },
onShow() { onShow() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
this.getSkill() this.getSkill()
}, },
created() { created() {
@@ -529,6 +536,7 @@
}).then(res => { }).then(res => {
this.isShowButton = false; this.isShowButton = false;
this.getResume() this.getResume()
this.$store.dispatch('getResumeInfo')
this.$api.msg('保存成功') this.$api.msg('保存成功')
}) })
} else { } else {

View File

@@ -1,153 +1,158 @@
<template> <template>
<view class="body"> <view class="body">
<!-- <view class="tab"> <!-- <view class="tab">
<v-tabs :tabs="['全部任务','全部岗位']" v-model="activeTab" color="#999" activeColor="#000" fontSize="36rx" <v-tabs :tabs="['全部任务','全部岗位']" v-model="activeTab" color="#999" activeColor="#000" fontSize="36rx"
activeFontSize="36rpx" @change='changeTab' /> activeFontSize="36rpx" @change='changeTab' />
</view> --> </view> -->
<block v-for="(page, pIndex) in data" :key="pIndex"> <block v-for="(page, pIndex) in data" :key="pIndex">
<block v-for="(item, index) in page" :key="item.id"> <block v-for="(item, index) in page" :key="item.id">
<view class="probody"> <view class="probody">
<company-list :companyitem="item" :noApply="false"></company-list> <company-list :companyitem="item" :noApply="false" :location="userLocation"></company-list>
<view class="baddd"></view> <view class="baddd"></view>
<!-- <block> <!-- <block>
<image src="/static/img/tab.orange.svg" mode="" v-if="item.status === 1"></image> <image src="/static/img/tab.orange.svg" mode="" v-if="item.status === 1"></image>
<image src="/static/img/tab.blue.svg" mode="" v-else-if="item.status === 2"></image> <image src="/static/img/tab.blue.svg" mode="" v-else-if="item.status === 2"></image>
<image src="/static/img/tab.green.svg" mode="" v-else-if="item.status === 3"></image> <image src="/static/img/tab.green.svg" mode="" v-else-if="item.status === 3"></image>
<image src="/static/img/tab.gray.svg" mode="" v-else></image> <image src="/static/img/tab.gray.svg" mode="" v-else></image>
</block> --> </block> -->
</view> </view>
</block> </block>
</block> </block>
<view class="nothing" v-if="data.length === 0"> <view class="nothing" v-if="data.length === 0">
<image src="/static/img/pic_notask.svg" mode=""></image> <image src="/static/img/pic_notask.svg" mode=""></image>
<view class="nothingContnt"> <view class="nothingContnt">
暂无收藏信息 暂无收藏信息
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import vTabs from '@/components/v-tabs/v-tabs.vue'; import vTabs from '@/components/v-tabs/v-tabs.vue';
import companyList from '@/components/companyList/collectionList.vue'; import companyList from '@/components/companyList/collectionList.vue';
import { import {
myCollection myCollection
} from '@/api/mission.js'; } from '@/api/mission.js';
import {
export default { mapGetters
components: { } from 'vuex'
vTabs, export default {
companyList components: {
}, vTabs,
data() { companyList
return { },
data: [], data() {
activeTab: 0, return {
current: 1, data: [],
size: 10, activeTab: 0,
total: 0 current: 1,
} size: 10,
}, total: 0
onLoad: function() { }
this.init() },
}, computed: {
/*页面滚动到底部 换页*/ ...mapGetters(['userLocation']),
onReachBottom: function() { },
if (this.current <= Math.ceil(this.total / this.size)) { onLoad: function() {
this.getData(); this.init()
} else { },
uni.showToast({ /*页面滚动到底部 换页*/
icon: "none", onReachBottom: function() {
title: '已经是最后一页', if (this.current <= Math.ceil(this.total / this.size)) {
}) this.getData();
} } else {
}, uni.showToast({
/*下拉刷新*/ icon: "none",
onPullDownRefresh:function(){ title: '已经是最后一页',
this.init() })
}, }
methods: { },
init(){ /*下拉刷新*/
this.current = 1 onPullDownRefresh: function() {
this.data = [] this.init()
this.getData() },
}, methods: {
getData() { init() {
var status = Number(this.activeTab) + 1 this.current = 1
myCollection(this.current, this.size, status).then(res => { this.data = []
uni.stopPullDownRefresh(); this.getData()
if (this.current === 1) { },
this.data = []; getData() {
} var status = Number(this.activeTab) + 1
this.current += 1; myCollection(this.current, this.size, status).then(res => {
this.total = res.data.data.total; uni.stopPullDownRefresh();
if (res.data.data && res.data.data.records.length) { if (this.current === 1) {
this.data.push(res.data.data.records); this.data = [];
} }
}) this.current += 1;
}, this.total = res.data.data.total;
gomap: function() { if (res.data.data && res.data.data.records.length) {
uni.navigateTo({ this.data.push(res.data.data.records);
url: '../mapSeach/mapSeach' }
}) })
}, },
changeTab: function(e) { gomap: function() {
this.activeTab = e; uni.navigateTo({
this.init() url: '../mapSeach/mapSeach'
} })
} },
} changeTab: function(e) {
this.activeTab = e;
this.init()
}
}
}
</script> </script>
<style scoped> <style scoped>
page { page {
height: 100%; height: 100%;
} }
.tab { .tab {
height: 46px; height: 46px;
} }
.body { .body {
height: 100%; height: 100%;
} }
.probody image { .probody image {
width: 88rpx; width: 88rpx;
height: 88rpx; height: 88rpx;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
} }
.probody { .probody {
width: 100%; width: 100%;
position: relative; position: relative;
} }
.baddd { .baddd {
background: #f6f6f6; background: #f6f6f6;
height: 20rpx; height: 20rpx;
} }
.nothing { .nothing {
height: 100%; height: 100%;
padding-top: 50%; padding-top: 50%;
box-sizing: border-box; box-sizing: border-box;
} }
.nothing image { .nothing image {
width: 400rpx; width: 400rpx;
height: 200rpx; height: 200rpx;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
.nothingContnt { .nothingContnt {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
margin-top: 30rpx; margin-top: 30rpx;
text-align: center; text-align: center;
} }
</style> </style>

View File

@@ -191,16 +191,16 @@
</view> </view>
</view> </view>
<view class="info_market"> <!-- <view class="info_market">
<view class="market_top"> <view class="market_top">
<view class="top_log"></view> <view class="top_log"></view>
<view class="next_market" @click="navTo('/pages/market/market')">去市场</view> <view class="next_market" @click="navTo('/pages/market/market')">去市场</view>
</view> </view>
<!-- <view class="market_bottom"> <view class="market_bottom">
<view>了解市场<u-icon name="arrow-right" color="#666666" size="13"></u-icon></view> <view>了解市场<u-icon name="arrow-right" color="#666666" size="13"></u-icon></view>
<view>我要咨询<u-icon name="arrow-right" color="#666666" size="13"></u-icon></view> <view>我要咨询<u-icon name="arrow-right" color="#666666" size="13"></u-icon></view>
</view> --> </view>
</view> </view> -->
<view class="latestMission"> <view class="latestMission">
<view class="cardTips" <view class="cardTips"
@@ -293,36 +293,21 @@
}; };
}, },
onLoad: function(options) { onLoad: function(options) {
if (this.$api.haslogin()) {
this.$store.dispatch('getResumeInfo')
}
}, },
onShow: function() { onShow: function() {
if (!this.$store.state.user.token) {
uni.reLaunch({
url: '/pages/login/login'
})
return
}
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
this.step()
}
})
this.download() this.download()
this.getSwiperList() this.getSwiperList()
this.getPolicy() this.getPolicy()
if (this.IsResume) { if (this.$api.haslogin()) {
myResume().then(res => { this.$store.dispatch('refreshAuthState').then((e) => {
const data = res.data.data var auth = this.$store.state.auth
if (!(data.education && data.telephone && data.wage && data.workplace)) { if (!auth.bankCardState) {
this.goures() this.step()
this.$api.sleep(1000).then(() => {
this.$api.msg('请输入基本信息')
})
} }
}) })
this.IsResume = false
} }
}, },
onReady() { onReady() {
@@ -399,11 +384,11 @@
}) })
}, },
download: function() { download: function() {
this.isLogin = this.$store.state.user.token ? true : false; this.isLogin = this.$api.haslogin() ? true : false;
newMission().then(res => { newMission().then(res => {
this.companyList = res.data.data; this.companyList = res.data.data;
}); });
if (this.$store.state.user.token) { if (this.$api.haslogin()) {
uni.$emit('newsReadChange') uni.$emit('newsReadChange')
this.$store.dispatch("getUnreadNum"); this.$store.dispatch("getUnreadNum");
recMission().then(res => { recMission().then(res => {
@@ -412,25 +397,7 @@
}; };
}, },
goLocation: function() { goLocation: function() {
if (!this.$store.state.user.token) { this.navTo('../mapSeach/mapSeach', true)
uni.showModal({
title: '提示',
content: '您还未登录,点击确认去登录',
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: "/pages/login/login"
});
} else if (res.cancel) {
return
}
}
});
} else {
uni.navigateTo({
url: '../mapSeach/mapSeach'
});
}
}, },
goResume: function() { goResume: function() {
uni.navigateTo({ uni.navigateTo({
@@ -444,40 +411,16 @@
}); });
}, },
goures: function() { goures: function() {
if (!this.$store.state.user.token) { this.navTo('/pageMy/my/resume/index', true)
uni.showModal({
title: '提示',
content: '您还未登录,点击确认去登录',
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: "/pages/login/login"
});
} else if (res.cancel) {
return
}
}
});
} else {
uni.navigateTo({
url: '/pageMy/my/resume/index'
});
}
}, },
toNewTask() { toNewTask() {
uni.navigateTo({ this.navTo(`/pages/project/newProject?tabIndex=${0}`, false)
url: `/pages/project/newProject?tabIndex=${0}`
});
}, },
toNewWork() { toNewWork() {
uni.navigateTo({ this.navTo(`/pages/project/newProject?tabIndex=${1}`, false)
url: `/pages/project/newProject?tabIndex=${1}`
});
}, },
toNewProject() { toNewProject() {
uni.navigateTo({ this.navTo(`/pages/project/newProject?tabIndex=${2}`, false)
url: `/pages/project/newProject?tabIndex=${2}`
});
}, },
toArticleDetail(id) { toArticleDetail(id) {
if (id) { if (id) {
@@ -487,49 +430,11 @@
} }
}, },
gouserSet: function() { gouserSet: function() {
if (!this.$store.state.user.token) { this.navTo('/pageMy/setUserBase/index', true)
uni.showModal({
title: '提示',
content: '您还未登录,点击确认去登录',
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: "/pages/login/login"
});
} else if (res.cancel) {
return
}
}
});
} else {
uni.navigateTo({
url: '/pageMy/setUserBase/index'
});
}
}, },
goSeach: function() { goSeach: function() {
if (!this.$store.state.user.token) { this.navTo('../seach/seach?keywords=' + this.keywords, true)
uni.showModal({ this.keywords = ''
title: '提示',
content: '您还未登录,点击确认去登录',
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/login/login'
})
} else if (res.cancel) {
return
}
}
});
} else {
// if (this.keywords) {
uni.navigateTo({
url: '../seach/seach?keywords=' + this.keywords
});
this.keywords = ''
// }
}
}, },
getSwiperList() { getSwiperList() {
getSwiperList(this.swiperType).then(res => { getSwiperList(this.swiperType).then(res => {

View File

@@ -7,6 +7,9 @@
import { import {
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import {
GoLogin
} from '@/untils/AxiosUtils.js';
import website from '@/config/website.js' import website from '@/config/website.js'
export default { export default {
data() { data() {
@@ -17,7 +20,7 @@
}, },
onLoad(options) { onLoad(options) {
uni.showLoading({ uni.showLoading({
title: '' title: '登录中'
}) })
if (options.token) { if (options.token) {
const that = this const that = this
@@ -39,7 +42,6 @@
if (!auth.bankCardState) { if (!auth.bankCardState) {
that.goSign(0) that.goSign(0)
} else { } else {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })
@@ -50,9 +52,10 @@
// this.$refs.code.refushCode() // this.$refs.code.refushCode()
}); });
} else { } else {
uni.reLaunch({ // uni.reLaunch({
url: '/pages/login/login' // url: '/pages/login/login'
}) // })
GoLogin()
} }
}, },
method: { method: {

View File

@@ -1,170 +1,171 @@
<template> <template>
<login-template title="账号登录"> <login-template title="账号登录">
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<!-- <view class="login-go-home" @click="goHome"> <!-- <view class="login-go-home" @click="goHome">
<image class="login-go-home-image" src="@/static/img/home.svg"></image> <image class="login-go-home-image" src="@/static/img/home.svg"></image>
</view> --> </view> -->
<!-- #endif --> <!-- #endif -->
<jl-input type="text" v-model="phone" placeholder="请输入手机号" @confirm="login"></jl-input> <jl-input type="text" v-model="phone" placeholder="请输入手机号" @confirm="login"></jl-input>
<jl-input type="text" v-model="password" placeholder="请输入登录密码" @confirm="login" showPassword clearable></jl-input> <jl-input type="text" v-model="password" placeholder="请输入登录密码" @confirm="login" showPassword
<!-- <code-input ref="code" v-model="code" :getCode="getCaptcha" @key-change="keyChange" @confirm="login"></code-input> --> clearable></jl-input>
<view v-if="loading" class="btn nocheck" loading="true"></view> <!-- <code-input ref="code" v-model="code" :getCode="getCaptcha" @key-change="keyChange" @confirm="login"></code-input> -->
<view v-else-if="validate" class="btn" @click="login">立即登录</view> <view v-if="loading" class="btn nocheck" loading="true"></view>
<view v-else class="btn nocheck">立即登录</view> <view v-else-if="validate" class="btn" @click="login">立即登录</view>
<!-- <view class="changeLogintype"> <view v-else class="btn nocheck">立即登录</view>
<!-- <view class="changeLogintype">
<view class="" @click="goReg">手机注册</view> <view class="" @click="goReg">手机注册</view>
<view class="" @click="goForget">忘记密码</view> <view class="" @click="goForget">忘记密码</view>
</view> --> </view> -->
</login-template> </login-template>
</template> </template>
<script> <script>
import { import {
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import { import {
getCaptcha getCaptcha
} from '@/api/user.js' } from '@/api/user.js'
import { import {
isMobile isMobile
} from '@/untils/validate.js' } from '@/untils/validate.js'
import website from '@/config/website.js' import website from '@/config/website.js'
import codeInput from './codeInput.vue' import codeInput from './codeInput.vue'
import jlInput from '@/components/jl-input/main.vue' import jlInput from '@/components/jl-input/main.vue'
import loginTemplate from './template.vue' import loginTemplate from './template.vue'
export default { export default {
components: { components: {
jlInput, jlInput,
codeInput, codeInput,
loginTemplate loginTemplate
}, },
data() { data() {
return { return {
phone: '', phone: '',
password: '', password: '',
code: '1111', code: '1111',
key: '', key: '',
loading: false loading: false
} }
}, },
created() { created() {
if (this.userInfo.token) { if (this.userInfo.token) {
uni.navigateBack() uni.navigateBack()
} }
}, },
onShow() { onShow() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
wx.hideHomeButton(); wx.hideHomeButton();
//#endif //#endif
this.password = '' this.password = ''
if (this.$store.state.user.token) { if (this.$api.haslogin()) {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
this.$store.dispatch('clearAuthState') this.$store.dispatch('clearAuthState')
this.$store.dispatch('endRefreshNewsTimer') this.$store.dispatch('endRefreshNewsTimer')
}) })
} }
}, },
methods: { methods: {
goHome() { goHome() {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })
}, },
login(e) { login(e) {
if (this.validate) { if (this.validate) {
this.userChecked = true; this.userChecked = true;
console.log(this.userChecked) console.log(this.userChecked)
// if (!this.userChecked) { // if (!this.userChecked) {
// uni.showToast({ // uni.showToast({
// title:'请先阅读并同意《服务及隐私协议》', // title:'请先阅读并同意《服务及隐私协议》',
// icon:'none', // icon:'none',
// }) // })
// } else { // } else {
var that = this var that = this
this.loading = true this.loading = true
this.$store.dispatch("LoginByUsername", { this.$store.dispatch("LoginByUsername", {
username: this.phone, username: this.phone,
password: this.password, password: this.password,
key: this.key, key: this.key,
code: this.code, code: this.code,
type: "account", type: "account",
tenantId: website.tenantId tenantId: website.tenantId
}).then((resp) => { }).then((resp) => {
this.$store.dispatch('refreshAuthState').then(() => { this.$store.dispatch('refreshAuthState').then(() => {
that.loading = false that.loading = false
var auth = this.auth var auth = this.auth
if (!auth.bankCardState) { if (!auth.bankCardState) {
that.goSign(0) that.goSign(0)
} else { } else {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })
} }
}) })
}).catch((err) => { }).catch((err) => {
this.loading = false this.loading = false
// this.$refs.code.refushCode() // this.$refs.code.refushCode()
location.href = "https://dy12333.org.cn/h5/" location.href = "https://dy12333.org.cn/h5/"
}); });
// } // }
} }
}, },
// 步骤 // 步骤
goSign(active) { goSign(active) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/projectInfo/signContract?active=${active}` url: `/pages/projectInfo/signContract?active=${active}`
}) })
}, },
keyChange(val) { keyChange(val) {
this.key = val this.key = val
}, },
goReg() { goReg() {
uni.navigateTo({ uni.navigateTo({
url: './reg' url: './reg'
}) })
}, },
goForget() { goForget() {
uni.navigateTo({ uni.navigateTo({
url: './forgetPwd' url: './forgetPwd'
}) })
}, },
getCaptcha getCaptcha
}, },
computed: { computed: {
...mapGetters(['userInfo', 'auth', 'autograph', 'userChecked']), ...mapGetters(['userInfo', 'auth', 'autograph', 'userChecked']),
validate() { validate() {
return this.phone && this.password && this.code return this.phone && this.password && this.code
} }
} }
} }
</script> </script>
<style> <style>
@import "./css.css"; @import "./css.css";
/* #ifdef H5 */ /* #ifdef H5 */
.login-go-home { .login-go-home {
position: absolute; position: absolute;
top: 10rpx; top: 10rpx;
left: 0; left: 0;
border-radius: 50%; border-radius: 50%;
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
background: rgb(217, 217, 217); background: rgb(217, 217, 217);
border: 1px solid rgb(198, 198, 198); border: 1px solid rgb(198, 198, 198);
} }
.login-go-home-image { .login-go-home-image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin: auto; margin: auto;
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
} }
/* #endif */ /* #endif */
</style> </style>

View File

@@ -1,470 +1,473 @@
<template> <template>
<view class="bodys"> <view class="bodys">
<view class="status_bar"> <view class="status_bar">
<!-- 这里是状态栏 --> <!-- 这里是状态栏 -->
</view> </view>
<view class="head"> <view class="head">
<map id='midMap' ref='midMap' :latitude="latitude" :markers="markList" :longitude="longitude" @tap="changeMap" scale="10"> <map id='midMap' ref='midMap' :latitude="latitude" :markers="markList" :longitude="longitude"
</map> @tap="changeMap" scale="10">
<view class="search"> </map>
<view class="head_border"> <view class="search">
</view> <view class="head_border">
<view class="controlss"> </view>
<view class="controlss-back"> <view class="controlss">
<image src="../../static/img/left.svg" @click="backView" mode=""></image> <view class="controlss-back">
</view> <image src="../../static/img/left.svg" @click="backView" mode=""></image>
<view class="controlss-input" @click="goSearch"> </view>
<input type="text" placeholder="搜索工作的地点" disabled="true" /> <view class="controlss-input" @click="goSearch">
<image src="../../static/img/search.svg" style="margin-left: auto;" mode=""></image> <input type="text" placeholder="搜索工作的地点" disabled="true" />
</view> <image src="../../static/img/search.svg" style="margin-left: auto;" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
<view class="controlsPop"> </view>
<view class="listTitle"> <view class="controlsPop">
附近零工岗位 <view class="listTitle">
</view> 附近零工岗位
<view class="borderbom"></view> </view>
<scroll-view scroll-y lower-threshold="0" style="height: 92%;" @scrolltolower="upLoad" v-if="companyList.length>0"> <view class="borderbom"></view>
<block v-for="(item, index) in companyList" :key="item.id"> <scroll-view scroll-y lower-threshold="0" style="height: 92%;" @scrolltolower="upLoad"
<companyList :companyitem="item" :near="true"></companyList> v-if="companyList.length>0">
<view class="baddd"></view> <block v-for="(item, index) in companyList" :key="item.id">
</block> <companyList :companyitem="item" :near="true"></companyList>
</scroll-view> <view class="baddd"></view>
<view class="nothingArea" v-else> </block>
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image> </scroll-view>
<view class="nothingContnt"> <view class="nothingArea" v-else>
暂无岗位信息 <image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
</view> <view class="nothingContnt">
</view> 暂无岗位信息
</view> </view>
</view> </view>
</view>
</view>
</template> </template>
<script> <script>
import companyList from '@/components/companyList/companyList.vue'; import companyList from '@/components/companyList/companyList.vue';
import testData from '@/common/textdata.js'; import testData from '@/common/textdata.js';
import { import {
nearMission nearMission
} from '@/api/mission.js'; } from '@/api/mission.js';
import { import {
getcoder, getcoder,
querySearch querySearch
} from "@/api/map.js"; } from "@/api/map.js";
export default { export default {
components: { components: {
companyList companyList
}, },
data() { data() {
return { return {
longitude: 116.40, longitude: 116.40,
latitude: 39.90, latitude: 39.90,
// key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI', // key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI',
key: 'MTCBZ-WAAWC-H3M22-AL6XI-G4XN6-YZFK5', key: 'MTCBZ-WAAWC-H3M22-AL6XI-G4XN6-YZFK5',
currentPoint: {}, currentPoint: {},
companyList: [], companyList: [],
markList: [], markList: [],
inpoints: [], inpoints: [],
inputValue: '', inputValue: '',
searchResult: false, searchResult: false,
searchResultList: [], searchResultList: [],
page: { page: {
current: 1, current: 1,
size: 10, size: 10,
total: 0 total: 0
}, },
mapCtx: null, mapCtx: null,
type: "" type: ""
}; };
}, },
onLoad: function(option) { onLoad: function(option) {
if (option.item) { if (option.item) {
const item = JSON.parse(decodeURIComponent(option.item)); const item = JSON.parse(decodeURIComponent(option.item));
var point = { var point = {
target: { target: {
latitude: item.lat, latitude: item.lat,
longitude: item.lng longitude: item.lng
} }
}; };
this.currentPoint = point; this.currentPoint = point;
this.type = 'search'; this.type = 'search';
} }
}, },
onShow: function() { onShow: function() {
if (this.type === 'search') { if (this.type === 'search') {
this.changeMap(this.currentPoint); this.changeMap(this.currentPoint);
} else { } else {
this.getLocation(); this.getLocation();
} }
// that.inputValue=''; // that.inputValue='';
//发起定位授权弹窗 //发起定位授权弹窗
// uni.authorize({ // uni.authorize({
// scope: 'scope.userLocation', // scope: 'scope.userLocation',
// success() { // success() {
// that.getLocation() // that.getLocation()
// }, // },
// fail() { // fail() {
// uni.showModal({ // uni.showModal({
// title: '提示', // title: '提示',
// content: '获取您的位置,以便为您推荐合适工作信息', // content: '获取您的位置,以便为您推荐合适工作信息',
// success: function (res) { // success: function (res) {
// if (res.confirm) { // if (res.confirm) {
// that.getLocation(); // that.getLocation();
// } else if (res.cancel) { // } else if (res.cancel) {
// //默认位置 // //默认位置
// var point = { // var point = {
// target:{ // target:{
// latitude:that.latitude, // latitude:that.latitude,
// longitude:that.longitude // longitude:that.longitude
// } // }
// }; // };
// that.currentPoint = point; // that.currentPoint = point;
// that.changeMap(point); // that.changeMap(point);
// } // }
// } // }
// }); // });
// } // }
// }); // });
// that.getLocation(); // that.getLocation();
}, },
methods: { methods: {
/*定位*/ /*定位*/
getLocation: function() { getLocation: function() {
var that = this; var that = this;
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
success: function(res) { success: function(res) {
//初始化当前点 //初始化当前点
var point = { var point = {
target: { target: {
latitude: res.latitude, latitude: res.latitude,
longitude: res.longitude longitude: res.longitude
} }
}; };
that.currentPoint = point; that.currentPoint = point;
// that.latitude = res.latitude; // that.latitude = res.latitude;
// that.longitude = res.longitude; // that.longitude = res.longitude;
//设置当前点 并逆地址解析和获取任务 //设置当前点 并逆地址解析和获取任务
that.changeMap(point); that.changeMap(point);
}, },
fail: function() { fail: function() {
//默认位置 //默认位置
var point = { var point = {
target: { target: {
latitude: that.latitude, latitude: that.latitude,
longitude: that.longitude longitude: that.longitude
} }
}; };
that.currentPoint = point; that.currentPoint = point;
that.changeMap(point); that.changeMap(point);
}, },
complete: function(e) {} complete: function(e) {}
}); });
}, },
/*设置当前点 并逆地址解析和获取任务*/ /*设置当前点 并逆地址解析和获取任务*/
changeMap: function(e) { changeMap: function(e) {
this.page.current = 1; this.page.current = 1;
if (e) { if (e) {
var point = { var point = {
target: { target: {
latitude: e.target.latitude, latitude: e.target.latitude,
longitude: e.target.longitude longitude: e.target.longitude
} }
}; };
this.currentPoint = point; this.currentPoint = point;
this.latitude = e.target.latitude; this.latitude = e.target.latitude;
this.longitude = e.target.longitude; this.longitude = e.target.longitude;
this.markList = []; this.markList = [];
this.getAddrByPoint(e.target); this.getAddrByPoint(e.target);
this.getData(e.target); this.getData(e.target);
} }
}, },
/*逆地址解析*/ /*逆地址解析*/
getAddrByPoint: function(point) { getAddrByPoint: function(point) {
var that = this; var that = this;
var location = point.latitude + ',' + point.longitude var location = point.latitude + ',' + point.longitude
that.setCurrentMarker(point); //设置当前marker that.setCurrentMarker(point); //设置当前marker
getcoder(location, encodeURI(that.key), 0).then(res => { getcoder(location, encodeURI(that.key), 0).then(res => {
var address = res.data.result.address_component.city + res.data.result.formatted_addresses.recommend; var address = res.data.result.address_component.city + res.data.result
this.markList.forEach(ele => { //给当前marker添加label .formatted_addresses.recommend;
if (ele.id === 0) { this.markList.forEach(ele => { //给当前marker添加label
ele.title = address; if (ele.id === 0) {
ele['callout'] = { ele.title = address;
content: address, ele['callout'] = {
color: '#000000', content: address,
fontSize: 12, color: '#000000',
borderRadius: 2, fontSize: 12,
borderWidth: 0, borderRadius: 2,
borderColor: '#ffffff', borderWidth: 0,
bgColor: '#ffffff', borderColor: '#ffffff',
padding: '5', bgColor: '#ffffff',
display: 'ALWAYS', padding: '5',
textAlign: 'center' display: 'ALWAYS',
} textAlign: 'center'
} }
}) }
}); })
}, });
/*设置当前定位点marker*/ },
setCurrentMarker: function(point) { /*设置当前定位点marker*/
this.markList.push({ setCurrentMarker: function(point) {
id: 0, this.markList.push({
latitude: point.latitude, id: 0,
longitude: point.longitude, latitude: point.latitude,
title: '', longitude: point.longitude,
zIndex: 2, title: '',
iconPath: '/static/img/location.png', zIndex: 2,
// width: 20, iconPath: '/static/img/location.png',
// height: 20 // width: 20,
}) // height: 20
}, })
/*设置任务点*/ },
setmarkers: function() { /*设置任务点*/
// 设置任务点 setmarkers: function() {
var inpoints = []; // 设置任务点
inpoints.push({ var inpoints = [];
latitude: this.currentPoint.target.latitude, inpoints.push({
longitude: this.currentPoint.target.longitude latitude: this.currentPoint.target.latitude,
}) longitude: this.currentPoint.target.longitude
if (this.companyList.length) { })
for (var i = 0; i < this.companyList.length && i < 10; i++) { if (this.companyList.length) {
inpoints.push({ for (var i = 0; i < this.companyList.length && i < 10; i++) {
latitude: this.companyList[i].lat, inpoints.push({
longitude: this.companyList[i].lon latitude: this.companyList[i].lat,
}) longitude: this.companyList[i].lon
this.markList.push({ })
id: i + 1, this.markList.push({
latitude: this.companyList[i].lat, id: i + 1,
longitude: this.companyList[i].lon, latitude: this.companyList[i].lat,
zIndex: 1, longitude: this.companyList[i].lon,
iconPath: '/static/img/point.png', zIndex: 1,
// width: 30, iconPath: '/static/img/point.png',
// height: 30 // width: 30,
}) // height: 30
} })
} }
this.inpoints = inpoints; }
}, this.inpoints = inpoints;
goSearch() { },
uni.navigateTo({ goSearch() {
url: '../seach/placeSearch' uni.navigateTo({
}); url: '../seach/placeSearch'
}, });
// search:function(){ },
// if(this.inputValue){ // search:function(){
// this.querySearch(this.inputValue) // if(this.inputValue){
// }else{ // this.querySearch(this.inputValue)
// return // }else{
// } // return
// }, // }
// //关键词输入提示 // },
// querySearch:function(queryString) { // //关键词输入提示
// querySearch(queryString, encodeURI(this.key)).then(res => { // querySearch:function(queryString) {
// if (res.data.status === 0) { // querySearch(queryString, encodeURI(this.key)).then(res => {
// this.searchResultList = res.data.data; // if (res.data.status === 0) {
// if(this.searchResultList.length){ // this.searchResultList = res.data.data;
// this.searchResultList.forEach((item, index) => { // if(this.searchResultList.length){
// item.title = this.getInf(item.title, this.inputValue); // this.searchResultList.forEach((item, index) => {
// }); // item.title = this.getInf(item.title, this.inputValue);
// } // });
// } // }
// }); // }
// }, // });
// // 8-2、选择地址 // },
// handleSelect:function(item) { // // 8-2、选择地址
// this.page.current=1; // handleSelect:function(item) {
// this.searchResult=false; // this.page.current=1;
// this.inputValue=''; // this.searchResult=false;
// this.searchResultList = []; // this.inputValue='';
// var point = { // this.searchResultList = [];
// target:{ // var point = {
// latitude:item.location.lat, // target:{
// longitude:item.location.lng // latitude:item.location.lat,
// } // longitude:item.location.lng
// }; // }
// this.currentPoint = point; // };
// this.changeMap(point); // this.currentPoint = point;
// }, // this.changeMap(point);
// //高亮 // },
// getInf(str, key) { // //高亮
// if (str && key) { // getInf(str, key) {
// let replaceReg = new RegExp(key, 'g')// 匹配关键字正则 // if (str && key) {
// let replaceString = "<span style='color: #1b66ff;'>" + key + "</span>" // 高亮替换 // let replaceReg = new RegExp(key, 'g')// 匹配关键字正则
// return str.replace(replaceReg, replaceString); // let replaceString = "<span style='color: #1b66ff;'>" + key + "</span>" // 高亮替换
// } // return str.replace(replaceReg, replaceString);
// }, // }
// cancel:function(){ // },
// this.inputValue = ''; // cancel:function(){
// this.searchResult = false; // this.inputValue = '';
// }, // this.searchResult = false;
getData: function(obj) { // },
nearMission(this.page.current, this.page.size, obj.latitude, obj.longitude, 50).then(res => { getData: function(obj) {
if (this.page.current === 1) { nearMission(this.page.current, this.page.size, obj.latitude, obj.longitude, 50).then(res => {
this.companyList = []; if (this.page.current === 1) {
} this.companyList = [];
this.page.current += 1; }
this.page.total = res.data.data.total; this.page.current += 1;
if (res.data.data && res.data.data.records.length) { this.page.total = res.data.data.total;
this.companyList = this.companyList.concat(res.data.data.records); if (res.data.data && res.data.data.records.length) {
} this.companyList = this.companyList.concat(res.data.data.records);
//非上拉加载 即设置任务点 }
if (obj !== 'upload') { //非上拉加载 即设置任务点
this.setmarkers(); if (obj !== 'upload') {
} this.setmarkers();
}) }
}, })
//上拉加载 },
upLoad: function() { //上拉加载
if (this.page.current <= Math.ceil(this.page.total / this.page.size)) { upLoad: function() {
this.getData('upload'); if (this.page.current <= Math.ceil(this.page.total / this.page.size)) {
} else { this.getData('upload');
uni.showToast({ } else {
icon: "none", uni.showToast({
title: '已经是最后一页', icon: "none",
}) title: '已经是最后一页',
return })
} return
}, }
backView: function() { },
uni.navigateBack({ backView: function() {
delta: 1 uni.navigateBack({
}); delta: 1
} });
} }
}; }
};
</script> </script>
<style> <style>
.status_bar { .status_bar {
height: var(--status-bar-height); height: var(--status-bar-height);
width: 100%; width: 100%;
} }
.locationimg { .locationimg {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
position: fixed; position: fixed;
left: 355rpx; left: 355rpx;
top: 250rpx; top: 250rpx;
} }
.baddd { .baddd {
background: #f6f6f6; background: #f6f6f6;
height: 20rpx; height: 20rpx;
} }
.head_border { .head_border {
width: 60rpx; width: 60rpx;
height: 8rpx; height: 8rpx;
border-radius: 30rpx; border-radius: 30rpx;
margin: 0 auto; margin: 0 auto;
background-color: #ddd; background-color: #ddd;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.head { .head {
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
text-align: center; text-align: center;
height: 50%; height: 50%;
position: relative; position: relative;
/* border-bottom: 20rpx solid #f6f6f6; */ /* border-bottom: 20rpx solid #f6f6f6; */
} }
map { map {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
} }
.head .search { .head .search {
position: absolute; position: absolute;
top: 10rpx; top: 10rpx;
left: 0; left: 0;
right: 0; right: 0;
} }
.head .search .controlss { .head .search .controlss {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: row; flex-direction: row;
margin: 0rpx 20rpx; margin: 0rpx 20rpx;
} }
.head .search .controlss .controlss-back { .head .search .controlss .controlss-back {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-right: 20rpx; margin-right: 20rpx;
padding: 5rpx; padding: 5rpx;
background-color: #ffffff; background-color: #ffffff;
} }
.head .search .controlss .controlss-input { .head .search .controlss .controlss-input {
flex: 1; flex: 1;
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 200rpx; border-radius: 200rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
} }
.head .search .controlss input { .head .search .controlss input {
text-align: left; text-align: left;
font-size: 28rpx; font-size: 28rpx;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
font-weight: normal; font-weight: normal;
} }
.head .search .controlss image { .head .search .controlss image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.controlsPop { .controlsPop {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 750rpx; width: 750rpx;
height: 50%; height: 50%;
background-color: #fefefe; background-color: #fefefe;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.controlsPop .listTitle { .controlsPop .listTitle {
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
font-size: 24rpx; font-size: 24rpx;
} }
.controlsPop .nothingArea { .controlsPop .nothingArea {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.controlsPop .nothingContnt { .controlsPop .nothingContnt {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
margin-top: 30rpx; margin-top: 30rpx;
text-align: center; text-align: center;
} }
.controlsPop .nothing { .controlsPop .nothing {
width: 400rpx; width: 400rpx;
height: 200rpx; height: 200rpx;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
/* /*
.searchPage .headSearch .search-view { .searchPage .headSearch .search-view {
border-bottom: 1rpx solid #dddddd; border-bottom: 1rpx solid #dddddd;
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
@@ -532,29 +535,29 @@
font-size:32rpx; font-size:32rpx;
} */ } */
.highlight { .highlight {
color: #1b66ff; color: #1b66ff;
} }
.searchPage .search-result li .address { .searchPage .search-result li .address {
font-size: 24rpx; font-size: 24rpx;
color: #999999 color: #999999
} }
.borderbom { .borderbom {
width: 100%; width: 100%;
height: 1rpx; height: 1rpx;
border-bottom: 1rpx solid #f2f2f2; border-bottom: 1rpx solid #f2f2f2;
} }
page { page {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.bodys { .bodys {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
} }
</style> </style>

View File

@@ -57,26 +57,26 @@
认证信息 认证信息
<image src="../../static/img/right.svg" mode=""></image> <image src="../../static/img/right.svg" mode=""></image>
</view> </view>
<view class="btnList" @click="navTo('/pageMy/setUserBase/mailbox')"> <!-- <view class="btnList" @click="navTo('/pageMy/setUserBase/mailbox')">
<image src="../../static/img/evaluate.png" mode=""></image> <image src="../../static/img/evaluate.png" mode=""></image>
咨询信箱 咨询信箱
<image src="../../static/img/right.svg" mode=""></image> <image src="../../static/img/right.svg" mode=""></image>
</view> </view> -->
<view class="btnList" @click="navTo('/pageMy/setUserBase/applicationsRecord')"> <view class="btnList" @click="navTo('/pageMy/setUserBase/applicationsRecord')">
<image src="../../static/img/phone.svg" mode=""></image> <image src="../../static/img/phone.svg" mode=""></image>
问卷调查 问卷调查
<image src="../../static/img/right.svg" mode=""></image> <image src="../../static/img/right.svg" mode=""></image>
</view> </view>
<view class="btnList" @click="navTo('/pageMy/setUserBase/survey')"> <!-- <view class="btnList" @click="navTo('/pageMy/setUserBase/survey')">
<image src="../../static/img/phone.svg" mode=""></image> <image src="../../static/img/phone.svg" mode=""></image>
用工调研 用工调研
<image src="../../static/img/right.svg" mode=""></image> <image src="../../static/img/right.svg" mode=""></image>
</view> </view> -->
<view class="btnList" @click="navTo('/pageMy/setUserBase/complain')"> <!-- <view class="btnList" @click="navTo('/pageMy/setUserBase/complain')">
<image src="../../static/img/vip.svg" mode=""></image> <image src="../../static/img/vip.svg" mode=""></image>
投诉建议 投诉建议
<image src="../../static/img/right.svg" mode=""></image> <image src="../../static/img/right.svg" mode=""></image>
</view> </view> -->
<template v-if="user.userIsCms"> <template v-if="user.userIsCms">
<view class="btnList" @click="navTo('/pageMy/admin/check')"> <view class="btnList" @click="navTo('/pageMy/admin/check')">
<image src="../../static/img/check1.png" mode=""></image> <image src="../../static/img/check1.png" mode=""></image>
@@ -122,6 +122,9 @@
</template> </template>
<script> <script>
import {
GoLogin
} from '@/untils/AxiosUtils.js';
import { import {
mapState, mapState,
mapGetters mapGetters
@@ -140,19 +143,28 @@
} }
}, },
onLoad() { onLoad() {
this.$store.dispatch('getMobileIsCms') // this.$store.dispatch('getMobileIsCms')
// if (this.$store.state.user.token && this.authPass) { // if (this.$api.haslogin() && this.authPass) {
// this.$store.dispatch('getVipCode') // this.$store.dispatch('getVipCode')
// } // }
}, },
onShow() { onShow() {
if (!this.$store.state.user.token) { if (/token/g.test(location.href)) {
uni.redirectTo({ this.$api.sleep(2000).then(() => {
url: '/pages/login/login' if (!this.$api.haslogin()) {
GoLogin()
} else {
uni.$emit('newsReadChange')
this.$store.dispatch('refreshAuthState')
}
}) })
} else { } else {
uni.$emit('newsReadChange') if (!this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState') GoLogin()
} else {
uni.$emit('newsReadChange')
this.$store.dispatch('refreshAuthState')
}
} }
// this.labourUnionInfoInit() // this.labourUnionInfoInit()
}, },

View File

@@ -27,7 +27,9 @@
import { import {
mapGetters mapGetters
} from 'vuex' } from 'vuex'
import {
GoLogin
} from '@/untils/AxiosUtils.js';
export default { export default {
data() { data() {
return { return {
@@ -36,14 +38,21 @@
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
if (!this.$store.state.user.token) { if (/token/g.test(location.href)) {
uni.redirectTo({ this.$api.sleep(2000).then(() => {
url: "/pages/login/login" if (!this.$api.haslogin()) {
GoLogin()
} else {
uni.$emit('newsReadChange')
}
}) })
} else { } else {
uni.$emit('newsReadChange') if (!this.$api.haslogin()) {
GoLogin()
} else {
uni.$emit('newsReadChange')
}
} }
console.log(this.news)
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.loading = true this.loading = true

View File

@@ -92,24 +92,18 @@
}, },
mounted() { mounted() {
const _this = this const _this = this
uni.getLocation({ console.log(this.$store.state.user.userLocation)
type: 'gcj02', if (this.$store.state.user.userLocation) {
success: function(res) { const {
const { latitude,
longitude, longitude
latitude } = this.$store.state.user.userLocation
} = res _this.getList(longitude, latitude).then((covers) => {
_this.latitude = latitude _this.$refs.uMap.addFeature(covers)
_this.longitude = longitude })
_this.getList(longitude, latitude).then((covers) => { } else {
_this.$refs.uMap.addFeature(covers) _this.$api.msg('无法获得周边信息')
}) }
},
fail: function(err) {
_this.$api.msg('无法获得周边信息')
},
complete: function(e) {}
})
}, },
onShow() { onShow() {
// const _this = this // const _this = this
@@ -144,25 +138,17 @@
}, },
search() { search() {
const _this = this const _this = this
uni.getLocation({ if (this.$store.state.user.userLocation) {
type: 'gcj02', const {
success: function(res) { latitude,
const { longitude
longitude, } = this.$store.state.user.userLocation
latitude _this.getList(longitude, latitude).then((covers) => {
} = res _this.$refs.uMap.addFeature(covers)
_this.latitude = latitude })
_this.longitude = longitude } else {
_this.getList(longitude, latitude).then((covers) => { _this.$api.msg('无法获得周边信息')
_this.$api.msg('成功获得周边信息') }
_this.$refs.uMap.addFeature(covers)
})
},
fail: function(err) {
_this.$api.msg('无法获得周边信息')
},
complete: function(e) {}
})
// this.getList(this.longitude, this.latitude).then((covers) => { // this.getList(this.longitude, this.latitude).then((covers) => {
// this.$api.msg('成功获得周边信息') // this.$api.msg('成功获得周边信息')
// console.log(covers) // console.log(covers)

View File

@@ -31,7 +31,7 @@
<block v-if="activeTab == 0"> <block v-if="activeTab == 0">
<view v-if="newList.length > 0"> <view v-if="newList.length > 0">
<block v-for="(item, index) in newList" :key="index"> <block v-for="(item, index) in newList" :key="index">
<companyList :companyitem="item"></companyList> <companyList :companyitem="item" :position="userLocation"></companyList>
</block> </block>
</view> </view>
<view v-else> <view v-else>
@@ -51,7 +51,7 @@
<view v-if="companyList.length > 0"> <view v-if="companyList.length > 0">
<block v-for="(item, index) in companyList" :key="item.id"> <block v-for="(item, index) in companyList" :key="item.id">
<workList :companyitem="item" :near="activeTab === 0"></workList> <workList :companyitem="item" :position="userLocation" :near="activeTab === 0"></workList>
</block> </block>
</view> </view>
<view v-else> <view v-else>
@@ -109,7 +109,9 @@
getcoder getcoder
} from "@/api/map.js"; } from "@/api/map.js";
import verticalMenu from '@/components/vertical-menu/vertical-menu.vue'; import verticalMenu from '@/components/vertical-menu/vertical-menu.vue';
import {
mapGetters
} from 'vuex'
export default { export default {
components: { components: {
vTabs, vTabs,
@@ -117,15 +119,16 @@
verticalMenu, verticalMenu,
workList workList
}, },
computed: {
...mapGetters(['userLocation']),
},
data() { data() {
return { return {
policyContentList: [], policyContentList: [],
activeTab: 0, activeTab: '0',
companyList: [], companyList: [],
recommendList: [], recommendList: [],
newList: [], newList: [],
nearPage: { nearPage: {
current: 1, current: 1,
size: 10, size: 10,
@@ -142,10 +145,7 @@
total: 0 total: 0
}, },
currentAddress: '', currentAddress: '',
currentPoint: {
latitude: 0,
longitude: 0
},
key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI', key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI',
open: false, open: false,
showPopUp: false, showPopUp: false,
@@ -157,10 +157,11 @@
if (option.tabIndex) { if (option.tabIndex) {
this.activeTab = option.tabIndex this.activeTab = option.tabIndex
} }
this.getData() this.$store.dispatch('getUserLocation')
this.getPolicy() this.download()
}, },
onShow: function() { onShow: function() {
const enumTitle = { const enumTitle = {
"0": '最新零工岗位', "0": '最新零工岗位',
"1": '最新全职岗位', "1": '最新全职岗位',
@@ -169,7 +170,7 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: enumTitle[this.activeTab] title: enumTitle[this.activeTab]
}) })
if (this.$store.state.user.token) { if (this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState').then((e) => { this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth var auth = this.$store.state.auth
if (!auth.bankCardState) { if (!auth.bankCardState) {
@@ -177,7 +178,6 @@
} }
}) })
} }
const value = uni.getStorageSync('active'); const value = uni.getStorageSync('active');
if (value) { if (value) {
this.activeTab = value; this.activeTab = value;
@@ -190,13 +190,7 @@
}, },
/*下拉刷新*/ /*下拉刷新*/
onPullDownRefresh: function() { onPullDownRefresh: function() {
if (!this.$store.state.user.token) { this.download();
uni.redirectTo({
url: "/pages/login/login"
});
} else {
this.download();
}
}, },
methods: { methods: {
step() { step() {
@@ -228,30 +222,6 @@
url: '/pageMy/my/resume/addSkill' url: '/pageMy/my/resume/addSkill'
}) })
}, },
/*定位*/
getLocation: function() {
var that = this;
uni.getLocation({
type: 'gcj02',
success: function(res) {
that.currentPoint = {
latitude: res.latitude,
longitude: res.longitude
}
// that.getAddrByPoint(res);
that.getNearList(that.currentPoint)
},
complete: function(e) {}
});
},
/*逆地址解析*/
getAddrByPoint: function(point) {
var that = this;
var location = point.latitude + ',' + point.longitude
getcoder(location, encodeURI(that.key), 0).then(res => {
that.currentAddress = res.data.result.address
});
},
goSeach: function() { goSeach: function() {
uni.navigateTo({ uni.navigateTo({
url: '../seach/seach' url: '../seach/seach'
@@ -271,8 +241,8 @@
this.activeTab = e; this.activeTab = e;
}, },
//附近任务; //附近任务;
getNearList: function(point) { getNearList: function() {
nearMission(this.nearPage.current, this.nearPage.size).then(res => { nearMission(this.nearPage.current, this.nearPage.size, 1).then(res => {
if (this.nearPage.current === 1) { if (this.nearPage.current === 1) {
this.companyList = []; this.companyList = [];
} }
@@ -313,7 +283,7 @@
}, },
//最新任务; //最新任务;
getNewList: function() { getNewList: function() {
newMissionAll(this.newPage.current, this.newPage.size, '').then(res => { newMissionAll(this.newPage.current, this.newPage.size, '', 1).then(res => {
if (this.newPage.current === 1) { if (this.newPage.current === 1) {
this.newList = []; this.newList = [];
} }
@@ -326,32 +296,31 @@
}, },
//上拉加载 //上拉加载
upLoad: function() { upLoad: function() {
if (this.activeTab === 0) { if (this.activeTab === '0') {
if (this.nearPage.current <= Math.ceil(this.nearPage.total / this.nearPage.size)) {
this.getNearList(this.currentPoint);
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === 1) {
if (this.recommendPage.current <= Math.ceil(this.recommendPage.total / this.recommendPage
.size)) {
this.getRecommendList();
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === 2) {
if (this.newPage.current <= Math.ceil(this.newPage.total / this.newPage.size)) { if (this.newPage.current <= Math.ceil(this.newPage.total / this.newPage.size)) {
this.getNewList(); this.getNewList()
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === '1') {
if (this.nearPage.current <= Math.ceil(this.nearPage.total / this.nearPage.size)) {
this.getNearList();
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === '2') {
if (this.newPage.current <= Math.ceil(this.newPage.total / this.newPage.size)) {
this.getPolicy();
} else { } else {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@@ -365,25 +334,24 @@
download: function() { download: function() {
console.log(this.activeTab) console.log(this.activeTab)
if (this.activeTab === '0') { if (this.activeTab === '0') {
this.nearPage.current = 1; this.newPage.current = 1;
console.log('123123') this.getNewList();
this.getLocation();
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
return return
} }
if (this.activeTab === '1') { if (this.activeTab === '1') {
this.recommendPage.current = 1; this.nearPage.current = 1;
this.getRecommendList(); this.getNearList();
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
return return
} }
if (this.activeTab === '2') { if (this.activeTab === '2') {
this.newPage.current = 1; // this.newPage.current = 1;
this.getNewList(); this.getPolicy();
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
@@ -391,20 +359,13 @@
} }
}, },
getData: function() { getData: function() {
if (!this.$store.state.user.token) { uni.$emit('newsReadChange');
uni.redirectTo({ this.nearPage.current = 1;
url: "/pages/login/login" this.recommendPage.current = 1;
}); this.newPage.current = 1;
} else { this.getRecommendList();
uni.$emit('newsReadChange'); this.getNewList();
this.nearPage.current = 1; this.getNearList();
this.recommendPage.current = 1;
this.newPage.current = 1;
this.getLocation();
this.getRecommendList();
this.getNewList();
this.getNearList();
}
}, },
@@ -442,7 +403,8 @@
.content { .content {
background-color: #f3f4f8; background-color: #f3f4f8;
padding-top: 20rpx; padding-top: 20rpx;
min-height: 80vh; /* min-height: 80vh; */
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
} }

View File

@@ -181,7 +181,7 @@
this.getPolicy() this.getPolicy()
}, },
onShow: function() { onShow: function() {
if (this.$store.state.user.token) { if (this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState').then((e) => { this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth var auth = this.$store.state.auth
if (!auth.bankCardState) { if (!auth.bankCardState) {
@@ -202,7 +202,7 @@
}, },
/*下拉刷新*/ /*下拉刷新*/
onPullDownRefresh: function() { onPullDownRefresh: function() {
if (!this.$store.state.user.token) { if (!this.$api.haslogin()) {
uni.redirectTo({ uni.redirectTo({
url: "/pages/login/login" url: "/pages/login/login"
}); });
@@ -244,7 +244,7 @@
getLocation: function() { getLocation: function() {
var that = this; var that = this;
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
success: function(res) { success: function(res) {
that.currentPoint = { that.currentPoint = {
latitude: res.latitude, latitude: res.latitude,
@@ -455,7 +455,7 @@
} }
}, },
getData: function() { getData: function() {
if (!this.$store.state.user.token) { if (!this.$api.haslogin()) {
uni.redirectTo({ uni.redirectTo({
url: "/pages/login/login" url: "/pages/login/login"
}); });
@@ -588,7 +588,7 @@
.positionText { .positionText {
margin: 0 10rpx; margin: 0 10rpx;
font-weight: bold; font-weight: bold;
} }
} }
@@ -610,7 +610,8 @@
.content { .content {
background-color: #f3f4f8; background-color: #f3f4f8;
padding-top: 20rpx; padding-top: 20rpx;
min-height: 80vh; /* min-height: 80vh; */
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
} }

View File

@@ -12,13 +12,16 @@
</view> </view>
<view class="content"> <view class="content">
<view class="typeButtonWrapper"> <view class="typeButtonWrapper">
<view class="typeButtonLeft"> <scroll-view class="typeButtonLeft" scroll-x="true" scroll-left="0">
<view v-for="(item, index) in nonReactiveArray" :key="index" <view v-for="(item, index) in nonReactiveArray" :key="index"
:class="['typeButton', index == activeTab ? 'activeButton' : '']" @click="changeTab(index)">{{ :class="['typeButton', index == activeTab ? 'activeButton' : '']" @click="changeTab(index)">
item {{item}}
}}</view> </view>
</view> </scroll-view>
<!-- <view class="typeButtonLeft">
<view v-for="(item, index) in nonReactiveArray" :key="index"
:class="['typeButton', index == activeTab ? 'activeButton' : '']" @click="changeTab(index)">{{item}}</view>
</view> -->
<!-- 筛选 --> <!-- 筛选 -->
<view class="screenButton" @click="showPopUp = true"> <view class="screenButton" @click="showPopUp = true">
筛选 筛选
@@ -55,7 +58,7 @@
<view v-if="companyList.length > 0" style="padding-bottom: 20rpx;"> <view v-if="companyList.length > 0" style="padding-bottom: 20rpx;">
<block v-for="(item, index) in companyList" :key="item.id"> <block v-for="(item, index) in companyList" :key="item.id">
<workList :companyitem="item" :near="activeTab === 0"></workList> <workList :companyitem="item" :position="userLocation" :near="activeTab === 0"></workList>
</block> </block>
</view> </view>
<view v-else> <view v-else>
@@ -103,6 +106,9 @@
import companyList from '@/components/companyList/companyList.vue'; import companyList from '@/components/companyList/companyList.vue';
import workList from '@/components/companyList/workList.vue' import workList from '@/components/companyList/workList.vue'
import userrecruitList from './userrecruitList.vue' import userrecruitList from './userrecruitList.vue'
import {
GoLogin
} from '@/untils/AxiosUtils.js';
import { import {
newMissionAll, newMissionAll,
recommendMission, recommendMission,
@@ -164,41 +170,25 @@
total: 0 total: 0
}, },
currentAddress: '', currentAddress: '',
currentPoint: {
latitude: 0,
longitude: 0
},
key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI', key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI',
open: false, open: false,
showPopUp: false, showPopUp: false,
isSearch: false, isSearch: false,
searchData: {}, searchData: {},
// nonReactiveArray: ["推荐任务", "推荐岗位", "个体户招工"], // nonReactiveArray: ["推荐任务", "推荐岗位", "个体户招工"],
nonReactiveArray: ["推荐零工岗位", "推荐全职岗位", "全部零工岗位", "全部全职岗位"], nonReactiveArray: ["推荐零工岗位", "推荐全职岗位", "全部零工岗位", "全部全职岗位"],
} }
}, },
onLoad: function() { onLoad: function() {
this.getData() this.$store.dispatch('getUserLocation')
console.log('userLocation', this.userLocation)
// this.getPolicy()
}, },
onShow: function() { onShow: function() {
this.download(); if (/token/g.test(location.href)) {
this.$api.sleep(2000).then(() => {
if (this.$store.state.user.token) { this.showInit()
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
this.step()
}
}) })
} } else {
this.showInit()
const value = uni.getStorageSync('active');
if (value) {
this.activeTab = value;
uni.removeStorageSync('active')
} }
}, },
/*页面滚动到底部 换页*/ /*页面滚动到底部 换页*/
@@ -207,7 +197,7 @@
}, },
/*下拉刷新*/ /*下拉刷新*/
onPullDownRefresh: function() { onPullDownRefresh: function() {
if (!this.$store.state.user.token) { if (!this.$api.haslogin()) {
uni.redirectTo({ uni.redirectTo({
url: "/pages/login/login" url: "/pages/login/login"
}); });
@@ -216,6 +206,27 @@
} }
}, },
methods: { methods: {
showInit() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
this.getData()
this.download();
if (this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
this.step()
}
})
}
const value = uni.getStorageSync('active');
if (value) {
this.activeTab = value;
uni.removeStorageSync('active')
}
},
step() { step() {
var that = this var that = this
that.open = true that.open = true
@@ -245,23 +256,6 @@
url: '/pageMy/my/resume/addSkill' url: '/pageMy/my/resume/addSkill'
}) })
}, },
/*定位*/
getLocation: function() {
var that = this;
uni.getLocation({
type: 'gcj02',
success: function(res) {
that.currentPoint = {
latitude: res.latitude,
longitude: res.longitude
}
console.log('打印', res)
// that.getAddrByPoint(res);
that.getNearList(that.currentPoint)
},
complete: function(e) {}
});
},
/*逆地址解析*/ /*逆地址解析*/
getAddrByPoint: function(point) { getAddrByPoint: function(point) {
var that = this; var that = this;
@@ -419,10 +413,10 @@
//下拉刷新 //下拉刷新
download: function() { download: function() {
this.isSearch = false; this.isSearch = false;
this.$store.dispatch('getUserLocation')
if (this.activeTab === 0 || this.activeTab === 2) { if (this.activeTab === 0 || this.activeTab === 2) {
this.nearPage.current = 1; this.nearPage.current = 1;
this.newPage.current = 1; this.newPage.current = 1;
this.getLocation();
this.getNewList() this.getNewList()
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@@ -430,7 +424,8 @@
return return
} }
if (this.activeTab === 1 || this.activeTab === 3) { if (this.activeTab === 1 || this.activeTab === 3) {
this.nearPage.current === 1 this.nearPage.current = 1;
this.newPage.current = 1;
this.getNearList() this.getNearList()
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@@ -447,20 +442,19 @@
// } // }
}, },
getData: function() { getData: function() {
if (!this.$store.state.user.token) { // if (!this.$api.haslogin()) {
uni.redirectTo({ // uni.redirectTo({
url: "/pages/login/login" // url: "/pages/login/login"
}); // });
} else { // } else {
uni.$emit('newsReadChange'); uni.$emit('newsReadChange');
this.nearPage.current = 1; this.nearPage.current = 1;
this.policyPage.current = 1; this.policyPage.current = 1;
this.newPage.current = 1; this.newPage.current = 1;
this.getLocation(); // this.getNewList();
// this.getNewList(); // this.getNearList();
// this.getNearList(); // this.getPolicy()
// this.getPolicy() // }
}
}, },
closePopUp() { closePopUp() {
this.showPopUp = false this.showPopUp = false
@@ -630,8 +624,8 @@
.content { .content {
background-color: #f3f4f8; background-color: #f3f4f8;
padding-top: 20rpx; /* min-height: 80vh; */
min-height: 80vh; min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
} }
@@ -647,6 +641,7 @@
line-height: 30px; line-height: 30px;
font-size: 14px; font-size: 14px;
background-color: #fff; background-color: #fff;
margin: 20rpx 0;
} }
.typeButtonWrapper { .typeButtonWrapper {
@@ -658,9 +653,8 @@
} }
.typeButtonLeft { .typeButtonLeft {
display: flex;
width: 80%; width: 80%;
overflow-x: scroll; white-space: nowrap;
} }
.typeButton { .typeButton {
@@ -670,6 +664,8 @@
border-radius: 50px; border-radius: 50px;
margin-right: 10rpx; margin-right: 10rpx;
white-space: nowrap; white-space: nowrap;
margin: 20rpx 10rpx 20rpx 0;
display: inline-block;
} }
.activeButton { .activeButton {

View File

@@ -123,7 +123,8 @@
style="margin-right: 10rpx;background-color: #FBAD17;border-radius: 45rpx;"> style="margin-right: 10rpx;background-color: #FBAD17;border-radius: 45rpx;">
电话联系 电话联系
</view> </view>
<view @click="submit" class="bottombtn flexbtn" style="border-radius: 45rpx;"> <view @click="submit" class="bottombtn flexbtn"
:style="{backgroundColor: applyopen ? '#999999' : '#1B66FF'}">
申请 申请
</view> </view>
</view> </view>
@@ -162,9 +163,10 @@
<view style="height: 200rpx;padding: 20rpx 40rpx;"> <view style="height: 200rpx;padding: 20rpx 40rpx;">
<view style="font-size: 28rpx;font-weight: bold;">重要提示</view> <view style="font-size: 28rpx;font-weight: bold;">重要提示</view>
<view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view> <view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view>
<view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName }} : <view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName || '联系人'}} :
<span style="color: blue" <span style="color: blue" v-if="info.callTel"
@click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span> @click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span>
<span style="color: #333333" v-else>无联系方式</span>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@@ -251,7 +253,8 @@
maxlength: 6, maxlength: 6,
collectStatus: 0, // 收藏状态 collectStatus: 0, // 收藏状态
showPopUp: false, showPopUp: false,
isInvite: false isInvite: false,
applyopen: false
} }
}, },
components: { components: {
@@ -291,6 +294,14 @@
methods: { methods: {
dateFormat, dateFormat,
collect() { collect() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
// console.log('收藏,取消收藏') // console.log('收藏,取消收藏')
const status = this.collectStatus == 0 ? 1 : 0; const status = this.collectStatus == 0 ? 1 : 0;
updateCollectStatus(this.info.id, status, 0).then(res => { updateCollectStatus(this.info.id, status, 0).then(res => {
@@ -300,6 +311,14 @@
}) })
}, },
callPhone() { callPhone() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
this.showPopUp = true; this.showPopUp = true;
}, },
closePopUp() { closePopUp() {
@@ -343,7 +362,9 @@
lon: self.info.lon, lon: self.info.lon,
}) })
} }
if (res.data.data.missionNo.search('ZKRD') >= 0) {
self.applyopen = true
}
self.showDetail = true; self.showDetail = true;
self.getCollectStatus(); self.getCollectStatus();
if (self.type === 1) { if (self.type === 1) {
@@ -357,16 +378,23 @@
}); });
}, },
submit: function() { submit: function() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
if (this.applyopen) return;
const _that = this const _that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请确认申请,申请后不能撤销', content: '请确认申请,申请后不能撤销',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if (!_that.$store.state.user.token) {
GoLogin()
return
}
if (_that.loading) return if (_that.loading) return
const auth = _that.auth const auth = _that.auth
const contractOn = _that.info.contractOn const contractOn = _that.info.contractOn
@@ -572,11 +600,11 @@
background-color: #1B66FF; background-color: #1B66FF;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 10rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 32rpx; font-size: 32rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
border-radius: 45rpx;
} }
.btn { .btn {

View File

@@ -166,9 +166,10 @@
<view style="height: 200rpx;padding: 20rpx 40rpx;"> <view style="height: 200rpx;padding: 20rpx 40rpx;">
<view style="font-size: 28rpx;font-weight: bold;">重要提示</view> <view style="font-size: 28rpx;font-weight: bold;">重要提示</view>
<view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view> <view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view>
<view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName }} : <view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName || '联系人'}} :
<span style="color: blue" <span style="color: blue" v-if="info.callTel"
@click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span> @click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span>
<span style="color: #333333" v-else>无联系方式</span>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@@ -295,6 +296,14 @@
methods: { methods: {
dateFormat, dateFormat,
collect() { collect() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
// console.log('收藏,取消收藏') // console.log('收藏,取消收藏')
const status = this.collectStatus == 0 ? 1 : 0; const status = this.collectStatus == 0 ? 1 : 0;
updateCollectStatus(this.info.id, status, 2).then(res => { updateCollectStatus(this.info.id, status, 2).then(res => {
@@ -304,6 +313,15 @@
}) })
}, },
callPhone() { callPhone() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
this.showPopUp = true; this.showPopUp = true;
}, },
closePopUp() { closePopUp() {
@@ -356,16 +374,21 @@
} }
}, },
submit: function() { submit: function() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
const _that = this const _that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请确认申请,申请后不能撤销', content: '请确认申请,申请后不能撤销',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if (!_that.$store.state.user.token) {
GoLogin()
return
}
if (_that.loading) return if (_that.loading) return
const auth = _that.auth const auth = _that.auth
const contractOn = _that.info.contractOn const contractOn = _that.info.contractOn

View File

@@ -170,9 +170,10 @@
<view style="height: 200rpx;padding: 20rpx 40rpx;"> <view style="height: 200rpx;padding: 20rpx 40rpx;">
<view style="font-size: 28rpx;font-weight: bold;">重要提示</view> <view style="font-size: 28rpx;font-weight: bold;">重要提示</view>
<view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view> <view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view>
<view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName }} : <view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName || '联系人'}} :
<span style="color: blue" <span style="color: blue" v-if="info.callTel"
@click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span> @click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span>
<span style="color: #333333" v-else>无联系方式</span>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@@ -297,6 +298,14 @@
methods: { methods: {
dateFormat, dateFormat,
collect() { collect() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
// console.log('收藏,取消收藏') // console.log('收藏,取消收藏')
const status = this.collectStatus == 0 ? 1 : 0; const status = this.collectStatus == 0 ? 1 : 0;
updateCollectStatus(this.info.id, status, 2).then(res => { updateCollectStatus(this.info.id, status, 2).then(res => {
@@ -306,6 +315,15 @@
}) })
}, },
callPhone() { callPhone() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
this.showPopUp = true; this.showPopUp = true;
}, },
closePopUp() { closePopUp() {
@@ -357,16 +375,21 @@
} }
}, },
submit: function() { submit: function() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
const _that = this const _that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请确认申请,申请后不能撤销', content: '请确认申请,申请后不能撤销',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if (!_that.$store.state.user.token) {
GoLogin()
return
}
if (_that.loading) return if (_that.loading) return
const auth = _that.auth const auth = _that.auth
const contractOn = _that.info.contractOn const contractOn = _that.info.contractOn

View File

@@ -127,7 +127,8 @@
style="margin-right: 10rpx;background-color: #FBAD17;border-radius: 45rpx;"> style="margin-right: 10rpx;background-color: #FBAD17;border-radius: 45rpx;">
电话联系 电话联系
</view> </view>
<view @click="submit" class="bottombtn flexbtn" style="border-radius: 45rpx;"> <view @click="submit" class="bottombtn flexbtn"
:style="{backgroundColor: applyopen ? '#999999' : '#1B66FF'}">
申请 申请
</view> </view>
</view> </view>
@@ -166,9 +167,10 @@
<view style="height: 200rpx;padding: 20rpx 40rpx;"> <view style="height: 200rpx;padding: 20rpx 40rpx;">
<view style="font-size: 28rpx;font-weight: bold;">重要提示</view> <view style="font-size: 28rpx;font-weight: bold;">重要提示</view>
<view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view> <view style="font-size: 24rpx;color:#707070;margin-top:10rpx;">为保障个人基本劳动权益建议通过平台用工的形式就业</view>
<view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName }} : <view style="text-align: center;font-size:28rpx;margin-top: 30rpx;"> {{ info.callName || '联系人 '}} :
<span style="color: blue" <span style="color: blue" v-if="info.callTel"
@click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span> @click="tools.onDialingPhoneNumber(info.callTel)">{{ info.callTel }}</span>
<span style="color: #333333" v-else>无联系方式</span>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@@ -251,6 +253,7 @@
maxlength: 6, maxlength: 6,
collectStatus: 0, // 收藏状态 collectStatus: 0, // 收藏状态
showPopUp: false, showPopUp: false,
applyopen: false
} }
}, },
components: { components: {
@@ -288,6 +291,14 @@
methods: { methods: {
dateFormat, dateFormat,
collect() { collect() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
// console.log('收藏,取消收藏') // console.log('收藏,取消收藏')
const status = this.collectStatus == 0 ? 1 : 0; const status = this.collectStatus == 0 ? 1 : 0;
updateCollectStatus(this.info.id, status, 1).then(res => { updateCollectStatus(this.info.id, status, 1).then(res => {
@@ -297,6 +308,15 @@
}) })
}, },
callPhone() { callPhone() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
this.showPopUp = true; this.showPopUp = true;
}, },
closePopUp() { closePopUp() {
@@ -304,6 +324,7 @@
}, },
// 获取收藏状态 // 获取收藏状态
getCollectStatus() { getCollectStatus() {
if (!this.$api.haslogin()) return
getCollectState(this.info.id, 1).then(res => { getCollectState(this.info.id, 1).then(res => {
// 0 未收藏1 已收藏 // 0 未收藏1 已收藏
// console.log(res) // console.log(res)
@@ -326,6 +347,9 @@
lon: self.info.lon, lon: self.info.lon,
}) })
} }
if (res.data.data.missionNo.search('ZKRD') >= 0) {
self.applyopen = true
}
self.showDetail = true; self.showDetail = true;
self.getCollectStatus(); self.getCollectStatus();
if (self.type === 1) { if (self.type === 1) {
@@ -339,16 +363,22 @@
}); });
}, },
submit: function() { submit: function() {
if (!this.$api.haslogin()) {
GoLogin()
return
}
if (!this.$api.hasResume()) {
this.navTo('/pageMy/my/resume/index', true)
return
}
if (this.applyopen) return;
const _that = this const _that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请确认申请,申请后不能撤销', content: '请确认申请,申请后不能撤销',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if (!_that.$store.state.user.token) {
GoLogin()
return
}
if (_that.loading) return if (_that.loading) return
const auth = _that.auth const auth = _that.auth
const contractOn = _that.info.contractOn const contractOn = _that.info.contractOn
@@ -554,11 +584,11 @@
background-color: #1B66FF; background-color: #1B66FF;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 10rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 32rpx; font-size: 32rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
border-radius: 45rpx;
} }
.btn { .btn {

View File

@@ -1,307 +1,312 @@
<template> <template>
<view class="body"> <view class="body">
<CustomNavbar @back="back" titke="申请消息"></CustomNavbar> <CustomNavbar @back="back" titke="申请消息"></CustomNavbar>
<view v-for="(value, key) in messageList" class="newsList" @click="goList(value)" :key="key"> <view v-for="(value, key) in messageList" class="newsList" @click="goList(value)" :key="key">
<view class="newsIcon"> <view class="newsIcon">
<image :src="value.icon" mode=""></image> <image :src="value.icon" mode=""></image>
<!-- <view v-if="news_recruit.unread[value.id] > 0" class="point"></view> --> <!-- <view v-if="news_recruit.unread[value.id] > 0" class="point"></view> -->
</view> </view>
<view class="newsListRight"> <view class="newsListRight">
<view class="head"> <view class="head">
<view class="head_left"> <view class="head_left">
{{ value.title }} {{ value.title }}
</view> </view>
<!-- <view class="head_right" v-if="value.data.length > 0"> <!-- <view class="head_right" v-if="value.data.length > 0">
{{value.data[0][0][value.prop.time]}} {{value.data[0][0][value.prop.time]}}
</view> --> </view> -->
</view> </view>
<!-- <view class="content" v-if="value.data.length > 0"> <!-- <view class="content" v-if="value.data.length > 0">
{{value.prop.desc(value)}} {{value.prop.desc(value)}}
</view> --> </view> -->
</view> </view>
</view> </view>
<cs-button></cs-button> <cs-button></cs-button>
<CustomTabbar :currentpage="2"></CustomTabbar> <CustomTabbar :currentpage="2"></CustomTabbar>
</view> </view>
</template> </template>
<script> <script>
import CustomTabbar from '@/components/CustomTabbar/custom_tabbar.vue' import CustomTabbar from '@/components/CustomTabbar/custom_tabbar.vue'
import CustomNavbar from '@/components/CustomNavbar/navbar.vue'; import CustomNavbar from '@/components/CustomNavbar/navbar.vue';
export default { export default {
components: { CustomTabbar, CustomNavbar }, components: {
data() { CustomTabbar,
return { CustomNavbar
loading: false, },
size: 20, data() {
messageList: [{ return {
id: "0", loading: false,
title: "消息通知", size: 20,
icon: "../../../static/img/notice.svg", messageList: [{
page: { id: "0",
current: 0, title: "消息通知",
size: this.size, icon: "../../../static/img/notice.svg",
total: this.size, page: {
}, current: 0,
data: [], size: this.size,
prop: { total: this.size,
title: "title", },
desc: (value) => { data: [],
if (value.data[0]) return value.data[0][0]["desc"]; prop: {
}, title: "title",
time: "createTime", desc: (value) => {
isRead: "isRead", if (value.data[0]) return value.data[0][0]["desc"];
listDesc: "desc", },
}, time: "createTime",
navigateTo(item) { isRead: "isRead",
uni.$once("getNewsDetail", (cb) => { listDesc: "desc",
cb(item); },
}); navigateTo(item) {
uni.navigateTo({ uni.$once("getNewsDetail", (cb) => {
url: "/pages/news/newsDetail?type=0", cb(item);
}); });
}, uni.navigateTo({
} url: "/pages/news/newsDetail?type=0",
// , { });
// id: "1", },
// title: "任务申请", }
// icon: "../../../static/img/renwu.png", // , {
// page: { // id: "1",
// current: 0, // title: "任务申请",
// size: this.size, // icon: "../../../static/img/renwu.png",
// total: this.size, // page: {
// }, // current: 0,
// data: [], // size: this.size,
// prop: { // total: this.size,
// title: "missionTitle", // },
// desc: (value) => { // data: [],
// if (value.data[0]) // prop: {
// return `您收到${value.data[0][0]["companyName"]}的任务`; // title: "missionTitle",
// }, // desc: (value) => {
// time: "createTime", // if (value.data[0])
// isRead: "status", // return `您收到${value.data[0][0]["companyName"]}的任务`;
// listDesc: "companyName", // },
// }, // time: "createTime",
// navigateTo(item, dispatch) { // isRead: "status",
// // dispatch("readNew", { // listDesc: "companyName",
// // key: "1", // },
// // id: item.id, // navigateTo(item, dispatch) {
// // }); // // dispatch("readNew", {
// uni.navigateTo({ // // key: "1",
// url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent( // // id: item.id,
// item.missionNo // // });
// )}&id=${encodeURIComponent(item.id)}`, // uni.navigateTo({
// }); // url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(
// }, // item.missionNo
// }, { // )}&id=${encodeURIComponent(item.id)}`,
// id: "1", // });
// title: "岗位申请", // },
// icon: "../../../static/img/job_recruit.svg", // }, {
// page: { // id: "1",
// current: 0, // title: "岗位申请",
// size: this.size, // icon: "../../../static/img/job_recruit.svg",
// total: this.size, // page: {
// }, // current: 0,
// data: [], // size: this.size,
// prop: { // total: this.size,
// title: "missionTitle", // },
// desc: (value) => { // data: [],
// if (value.data[0]) // prop: {
// return `您收到${value.data[0][0]["companyName"]}的任务`; // title: "missionTitle",
// }, // desc: (value) => {
// time: "createTime", // if (value.data[0])
// isRead: "status", // return `您收到${value.data[0][0]["companyName"]}的任务`;
// listDesc: "companyName", // },
// }, // time: "createTime",
// navigateTo(item, dispatch) { // isRead: "status",
// // dispatch("readNew", { // listDesc: "companyName",
// // key: "1", // },
// // id: item.id, // navigateTo(item, dispatch) {
// // }); // // dispatch("readNew", {
// uni.navigateTo({ // // key: "1",
// url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent( // // id: item.id,
// item.missionNo // // });
// )}&id=${encodeURIComponent(item.id)}`, // uni.navigateTo({
// }); // url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(
// }, // item.missionNo
// }, { // )}&id=${encodeURIComponent(item.id)}`,
// id: "1", // });
// title: "个体户申请", // },
// icon: "../../../static/img/own_recruit.svg", // }, {
// page: { // id: "1",
// current: 0, // title: "个体户申请",
// size: this.size, // icon: "../../../static/img/own_recruit.svg",
// total: this.size, // page: {
// }, // current: 0,
// data: [], // size: this.size,
// prop: { // total: this.size,
// title: "missionTitle", // },
// desc: (value) => { // data: [],
// if (value.data[0]) // prop: {
// return `您收到${value.data[0][0]["companyName"]}的任务`; // title: "missionTitle",
// }, // desc: (value) => {
// time: "createTime", // if (value.data[0])
// isRead: "status", // return `您收到${value.data[0][0]["companyName"]}的任务`;
// listDesc: "companyName", // },
// }, // time: "createTime",
// navigateTo(item, dispatch) { // isRead: "status",
// // dispatch("readNew", { // listDesc: "companyName",
// // key: "1", // },
// // id: item.id, // navigateTo(item, dispatch) {
// // }); // // dispatch("readNew", {
// uni.navigateTo({ // // key: "1",
// url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent( // // id: item.id,
// item.missionNo // // });
// )}&id=${encodeURIComponent(item.id)}`, // uni.navigateTo({
// }); // url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(
// }, // item.missionNo
// }, // )}&id=${encodeURIComponent(item.id)}`,
] // });
} // },
}, // },
onLoad() { }, ]
onShow() { }
if (!this.$store.state.user.token) { },
uni.redirectTo({ onLoad() {},
url: "/pages/login/login" onShow() {
}) if (!this.$api.haslogin()) {
} else { uni.redirectTo({
uni.$emit('newsReadChange') url: "/pages/login/login"
} })
}, } else {
// onPullDownRefresh() { uni.$emit('newsReadChange')
// this.loading = true }
// this.$store.dispatch("newsInit").then(() => { },
// this.loading = false // onPullDownRefresh() {
// uni.stopPullDownRefresh(); // this.loading = true
// }).catch(() => { // this.$store.dispatch("newsInit").then(() => {
// this.loading = false // this.loading = false
// uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
// }) // }).catch(() => {
// }, // this.loading = false
methods: { // uni.stopPullDownRefresh();
goList(item) { // })
// if (item.data.length === 0) { // },
// uni.showToast({ methods: {
// title: '暂无消息', goList(item) {
// icon: 'none' // if (item.data.length === 0) {
// }); // uni.showToast({
// return // title: '暂无消息',
// } // icon: 'none'
console.log(item.data) // });
// 任务推送、岗位推送、政策推送 // return
if (item.title == '岗位申请') { // }
console.log('岗位申请') console.log(item.data)
uni.navigateTo({ // 任务推送、岗位推送、政策推送
url: './taskProjectList' if (item.title == '岗位申请') {
}) console.log('岗位申请')
} else if (item.title == '岗位申请') { uni.navigateTo({
console.log('岗位申请') url: './taskProjectList'
uni.navigateTo({ })
url: './jobProjectList' } else if (item.title == '岗位申请') {
}) console.log('岗位申请')
} else if (item.title == '个体户申请') { uni.navigateTo({
uni.navigateTo({ url: './jobProjectList'
url: './policyList' })
}) } else if (item.title == '个体户申请') {
} else { uni.navigateTo({
uni.navigateTo({ url: './policyList'
url: './newsList?type=' + item.id })
}) } else {
} uni.navigateTo({
}, url: './newsList?type=' + item.id
back() { })
uni.reLaunch({ url: '/pages/my/my' }) }
}, },
}, back() {
} uni.reLaunch({
url: '/pages/my/my'
})
},
},
}
</script> </script>
<style> <style>
.content { .content {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
width: 560rpx; width: 560rpx;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
/*不换行*/ /*不换行*/
text-overflow: ellipsis; text-overflow: ellipsis;
/*超出部分文字以...显示*/ /*超出部分文字以...显示*/
} }
.head_right { .head_right {
float: right; float: right;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 24rpx; font-size: 24rpx;
color: #CCCCCC; color: #CCCCCC;
} }
.head_left { .head_left {
float: left; float: left;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 36rpx; font-size: 36rpx;
color: #333333; color: #333333;
} }
.head { .head {
overflow: hidden; overflow: hidden;
width: 560rpx; width: 560rpx;
} }
.newsListRight { .newsListRight {
float: left; float: left;
width: 560rpx; width: 560rpx;
height: 50rpx; height: 50rpx;
line-height: 50rpx; line-height: 50rpx;
padding-left: 30rpx; padding-left: 30rpx;
} }
.newsList .newsIcon { .newsList .newsIcon {
position: relative; position: relative;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
display: inline-block; display: inline-block;
float: left; float: left;
} }
.newsList image { .newsList image {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }
.newsList .point { .newsList .point {
position: absolute; position: absolute;
top: 5rpx; top: 5rpx;
right: 10rpx; right: 10rpx;
width: 20rpx; width: 20rpx;
height: 20rpx; height: 20rpx;
background: red; background: red;
border-radius: 50%; border-radius: 50%;
} }
.newsList { .newsList {
border-bottom: 1rpx solid #dddddd; border-bottom: 1rpx solid #dddddd;
padding-bottom: 30rpx; padding-bottom: 30rpx;
padding-right: 30rpx; padding-right: 30rpx;
padding-top: 30rpx; padding-top: 30rpx;
padding-left: 30rpx; padding-left: 30rpx;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.body { .body {
background-color: #fefefe; background-color: #fefefe;
/* padding-left: 30rpx; /* padding-left: 30rpx;
width: 720rpx; */ width: 720rpx; */
} }
page { page {
background: #f6f6f6; background: #f6f6f6;
} }
</style> </style>

View File

@@ -1,54 +1,18 @@
<template> <template>
<view class="mainWrapper"> <view class="mainWrapper">
<view v-show="!searchResultShow" class="headSearch"> <view class="headSearch">
<view class="search-view"> <view class="search-view">
<view class="search-item"> <view class="search-item">
<image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;" mode=""></image> <image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;" mode=""></image>
<input type="text" confirm-type="搜索" v-model="keywords" @confirm="getNewList('search')" <input type="text" confirm-type="搜索" v-model="keywords" @confirm="getList"
placeholder="搜零工岗位/搜全职岗位/搜政策" /> placeholder="搜零工岗位/搜全职岗位/搜政策" />
<view @click="getNewList('search')" <view @click="getList"
style="width: 80rpx;height: 50rpx;color:#fff;background-color: #0091ff;font-size:24rpx;text-align: center;line-height: 50rpx;border-radius: 25rpx;;"> 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> </view>
<!-- <view class="close" @click="closeBack">
取消
</view> -->
</view> </view>
</view> </view>
<view v-show="searchResultShow" class="headSearch"> <view class="search-history">
<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="title">搜索记录</view>
<view class="clear" @click="clearKeyWords"> <view class="clear" @click="clearKeyWords">
<image src="../../static/img/delete.png" style="width: 24rpx;height: 24rpx;" mode=""></image> <image src="../../static/img/delete.png" style="width: 24rpx;height: 24rpx;" mode=""></image>
@@ -60,15 +24,14 @@
</view> </view>
</view> </view>
<view v-else class="empty">暂无历史记录</view> <view v-else class="empty">暂无历史记录</view>
<v-tabs :tabs="tabList" height="45px" v-model="activeTab" color="#999" activeColor="#000" fontSize="30rpx"
activeFontSize="31rpx" @change='changeTab' />
</view> </view>
<v-tabs v-show="!searchResultShow" :tabs="['推荐零工岗位', '推荐全职岗位', '推荐政策']" height="45px" v-model="activeTab" <block v-if="activeTab === 0">
color="#999" activeColor="#000" fontSize="30rpx" activeFontSize="31rpx" @change='changeTab' /> <view v-if="companyList.length ">
<block v-if="(activeTab == 0)&&!searchResultShow">
<view v-if="companyList.length > 0">
<block v-for="(item, index) in companyList" :key="item.id"> <block v-for="(item, index) in companyList" :key="item.id">
<companyList :companyitem="item"></companyList> <companyList :companyitem="item" :location="userLocation"></companyList>
</block> </block>
</view> </view>
<view v-else> <view v-else>
@@ -78,10 +41,10 @@
</view> </view>
</view> </view>
</block> </block>
<block v-if="(activeTab == 1)&&!searchResultShow"> <block v-if="activeTab === 1">
<view v-if="newList.length > 0"> <view v-if="newList.length">
<block v-for="(item, index) in newList" :key="item.id"> <block v-for="(item, index) in newList" :key="item.id">
<workList :companyitem="item" :near="activeTab === 0"></workList> <workList :companyitem="item" :near="activeTab === 0" :location="userLocation"></workList>
</block> </block>
</view> </view>
<view v-else> <view v-else>
@@ -92,8 +55,8 @@
<block v-if="(activeTab == 2)&&!searchResultShow"> <block v-if="activeTab == 2">
<view v-if="recommendList.length > 0"> <view v-if="recommendList.length">
<!-- <block v-for="(item, index) in recommendList" :key="item.id"> <!-- <block v-for="(item, index) in recommendList" :key="item.id">
<companyList :companyitem="item"></companyList> <companyList :companyitem="item"></companyList>
</block> --> </block> -->
@@ -109,94 +72,86 @@
<view v-else> <view v-else>
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image> <image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
<view class="nothingContnt"> <view class="nothingContnt">
完善技能获取精推荐 暂无信息
</view> </view>
<!-- <view class="btn" @click="goResume"> <!-- <view class="btn" @click="goResume">
完善技能 完善技能
</view> --> </view> -->
</view> </view>
</block> </block>
<!-- <view v-if="companyList.length > 0"> <block v-if="activeTab == -1">
<block v-for="(item, index) in companyList" :key="item.id"> <view>
<companyList :companyitem="item"></companyList> <image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
<view class="baddd"></view> <view class="nothingContnt">
</block> 没有更多数据
</view> </view>
<view v-else> </view>
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image> </block>
<view class="nothingContnt">
暂无任务信息
</view>
</view> -->
</view> </view>
</template> </template>
<script> <script>
import {
cloneDeep
} from 'lodash';
import { import {
newMissionAll, newMissionAll,
getSearchKeyWordsList, getSearchKeyWordsList,
clearSearchKeyWords, clearSearchKeyWords,
getListByKeyWords, getListByKeyWords,
nearMission, nearMission,
getPolicyContentList getPolicyContentList,
userWorkSearchListAll
} from '@/api/mission.js'; } from '@/api/mission.js';
import {
mapGetters
} from 'vuex'
import companyList from '@/components/companyList/companyList.vue'; import companyList from '@/components/companyList/companyList.vue';
import vTabs from '@/components/v-tabs/v-tabs.vue';
import testData from '@/common/textdata.js';
import workList from '@/components/companyList/workList.vue' import workList from '@/components/companyList/workList.vue'
const titleStatus = {
'mission': {
title: '零工岗位',
val: 0,
},
'work': {
title: '全职岗位',
val: 1,
},
'policy': {
title: '政策',
val: 2,
},
}
export default { export default {
components: { components: {
companyList, companyList,
vTabs,
workList workList
}, },
data() { data() {
return { return {
activeTab: 0, activeTab: 0,
companyList: [],
recommendList: [],
newList: [],
keywords: '', keywords: '',
page: {
current: 1,
size: 10,
total: 0
},
searchHistoryList: [], searchHistoryList: [],
searchResultShow: false, companyList: [],
searchResultList: [] newList: [],
}; recommendList: [],
tabList: ['零工岗位', '全职岗位', '政策']
}
}, },
onLoad: function(option) { computed: {
this.keywords = option.keywords ? option.keywords : '' ...mapGetters(['userLocation']),
}, },
onShow: function() { onShow: function() {
this.getList('refresh');
this.getKeyWordsList() this.getKeyWordsList()
}, },
/*页面滚动到底部*/
onReachBottom: function() {
this.upLoad()
},
methods: { methods: {
clearCurrentKeyWords() { goPolicyInfo(data) {
this.keywords = ''; if (data) {
let that = this; uni.navigateTo({
setTimeout(function() { url: `/pages/user/policyContent?id=${data}`
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() { getKeyWordsList() {
@@ -211,142 +166,6 @@
// console.log(keyWords) // console.log(keyWords)
this.searchResultShow = true; this.searchResultShow = true;
this.keywords = keyWords; this.keywords = keyWords;
this.getNewList();
},
//最新任务;
getList: function(type = 'add') {
//改变搜索条件页码值变为1
if (type === 'refresh') {
this.page.current = 1;
};
// if (this.keywords) {
newMissionAll(this.page.current, this.page.size, this.keywords).then(res => {
this.page.total = res.data.data.total;
if (type === 'refresh') {
this.companyList = res.data.data.records
} else if (res.data.data && res.data.data.records.length) {
this.companyList = this.companyList.concat(res.data.data.records);
}
this.page.current += 1;
})
},
getgwList(type = 'add') {
if (type === 'refresh') {
this.page.current = 1;
};
nearMission(this.page.current, this.page.size).then(res => {
this.page.total = res.data.data.total;
if (type === 'refresh') {
this.newList = res.data.data.records
} else if (res.data.data && res.data.data.records.length) {
this.newList = this.newList.concat(res.data.data.records);
}
this.page.current += 1;
})
},
getPoliyList(type = 'add') {
if (type === 'refresh') {
this.page.current = 1;
};
let params = {
current: this.page.current,
size: this.page.size,
type: 1
}
getPolicyContentList(params).then(res => {
this.page.total = res.data.data.total;
if (type === 'refresh') {
this.recommendList = res.data.data.records
} else if (res.data.data && res.data.data.records.length) {
this.recommendList = this.recommendList.concat(res.data.data.records);
}
this.page.current += 1;
})
},
goPolicyInfo(data) {
if (data) {
uni.navigateTo({
url: `/pages/user/policyContent?id=${data}`
})
} else {
// uni.showToast({
// title:'暂无内容',
// icon:'none'
// })
}
},
//上拉加载
upLoad: function() {
if (this.page.current <= Math.ceil(this.page.total / this.page.size)) {
switch (this.activeTab) {
case 0:
this.getList();
break;
case 1:
this.getgwList();
break;
case 2:
this.getPoliyList()
break;
}
} 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;
switch (e) {
case 0:
this.getList('refresh');
break;
case 1:
this.getgwList('refresh');
break;
case 2:
this.getPoliyList('refresh')
break;
}
}, },
// 清空搜索历史 // 清空搜索历史
clearKeyWords() { clearKeyWords() {
@@ -355,15 +174,55 @@
this.getKeyWordsList() this.getKeyWordsList()
} }
}) })
},
changeTab: function(e) {
this.activeTab = e;
// const tab = cloneDeep(this.tabList[e])
// Object.keys(titleStatus).map((key) => {
// if (titleStatus[key].title === tab) {
// this.activeTab = titleStatus[key].val;
// }
// })
},
async getList() {
const params = {
keywords: this.keywords
}
let resData = await userWorkSearchListAll(params)
if (resData.data.code === 200) {
const {
mission,
policy,
work
} = resData.data.data
const tabVal = []
Object.keys(titleStatus).map((key) => {
if (resData.data.data[key].length) {
tabVal.push(titleStatus[key].title)
}
})
if (tabVal.length) {
let count = 0
Object.keys(titleStatus).map((key) => {
if (!count && titleStatus[key].title === tabVal[0]) {
this.activeTab = titleStatus[key].val;
count++
}
})
}
this.companyList = mission
this.recommendList = policy
this.newList = work
}
} }
} }
}; }
</script> </script>
<style scoped> <style scoped>
.mainWrapper { .mainWrapper {
background-color: #f3f4f8; background-color: #f3f4f8;
min-height: 95vh; min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
} }
.baddd { .baddd {
@@ -475,6 +334,7 @@
padding: 8rpx 12rpx; padding: 8rpx 12rpx;
border-radius: 20rpx; border-radius: 20rpx;
margin-right: 10rpx; margin-right: 10rpx;
position: relative;
} }
.search-result { .search-result {

517
pages/seach/seachCopy.vue Normal file
View File

@@ -0,0 +1,517 @@
<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>
<view>岗位/任务</view>
<view>政策</view>
</view>
<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.type1 == 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="item.id">
<workList :companyitem="item" :near="activeTab === 0"></workList>
</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 v-for="(item, index) in recommendList" :key="index"
style="width: 90%;height: 100rpx;background-color: #fff;border-radius: 10rpx;margin:20rpx 5% 20rpx 5%;display: flex;align-items: center"
@click="goPolicyInfo(item.id)">
<image :src="item.headPic" style="width: 60rpx;height: 60rpx;margin: 0 20rpx;"></image>
<view style="font-size: 26rpx;">{{ item.articleTitle }}</view>
</view>
</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,
nearMission,
getPolicyContentList
} 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';
import workList from '@/components/companyList/workList.vue'
export default {
components: {
companyList,
vTabs,
workList
},
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('refresh');
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 = 'add') {
//改变搜索条件页码值变为1
if (type === 'refresh') {
this.page.current = 1;
};
// if (this.keywords) {
newMissionAll(this.page.current, this.page.size, this.keywords).then(res => {
this.page.total = res.data.data.total;
if (type === 'refresh') {
this.companyList = res.data.data.records
} else if (res.data.data && res.data.data.records.length) {
this.companyList = this.companyList.concat(res.data.data.records);
}
this.page.current += 1;
})
},
getgwList(type = 'add') {
if (type === 'refresh') {
this.page.current = 1;
};
nearMission(this.page.current, this.page.size).then(res => {
this.page.total = res.data.data.total;
if (type === 'refresh') {
this.newList = res.data.data.records
} else if (res.data.data && res.data.data.records.length) {
this.newList = this.newList.concat(res.data.data.records);
}
this.page.current += 1;
})
},
getPoliyList(type = 'add') {
if (type === 'refresh') {
this.page.current = 1;
};
let params = {
current: this.page.current,
size: this.page.size,
type: 1
}
getPolicyContentList(params).then(res => {
this.page.total = res.data.data.total;
if (type === 'refresh') {
this.recommendList = res.data.data.records
} else if (res.data.data && res.data.data.records.length) {
this.recommendList = this.recommendList.concat(res.data.data.records);
}
this.page.current += 1;
})
},
goPolicyInfo(data) {
if (data) {
uni.navigateTo({
url: `/pages/user/policyContent?id=${data}`
})
} else {
// uni.showToast({
// title:'暂无内容',
// icon:'none'
// })
}
},
//上拉加载
upLoad: function() {
if (this.page.current <= Math.ceil(this.page.total / this.page.size)) {
switch (this.activeTab) {
case 0:
this.getList();
break;
case 1:
this.getgwList();
break;
case 2:
this.getPoliyList()
break;
}
} 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;
switch (e) {
case 0:
this.getList('refresh');
break;
case 1:
this.getgwList('refresh');
break;
case 2:
this.getPoliyList('refresh')
break;
}
},
// 清空搜索历史
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>

View File

@@ -372,7 +372,7 @@ const news = {
current, current,
total total
}) => { }) => {
console.log(data) if (!data) return
data.forEach(item => { data.forEach(item => {
state.dic[item.id] = item state.dic[item.id] = item
}) })

View File

@@ -18,6 +18,9 @@ import {
import { import {
calcDate calcDate
} from '@/untils/date.js' } from '@/untils/date.js'
import {
myResume,
} from '@/api/resume.js';
let refreshTimer = null; let refreshTimer = null;
@@ -67,8 +70,18 @@ const user = {
}) || 0, // 0 个体招工 企业招工 }) || 0, // 0 个体招工 企业招工
userLocation: null, userLocation: null,
userIsCms: false, userIsCms: false,
resumeInfo: {},
}, },
actions: { actions: {
getResumeInfo({
commit,
dispatch
}) {
myResume().then(res => {
const data = res.data.data
commit('upDataResumeInfo', data)
})
},
getMobileIsCms({ getMobileIsCms({
commit, commit,
dispatch dispatch
@@ -83,14 +96,14 @@ const user = {
commit, commit,
dispatch dispatch
}) { }) {
console.log('getUserLocation null1')
// commit('setLocation', { // commit('setLocation', {
// latitude: 31.133980, // latitude: 31.133980,
// longitude: 104.404419, // longitude: 104.404419,
// }) // })
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
success: function(res) { success: function(res) {
console.warn('用户位置获取成功')
const { const {
longitude, longitude,
latitude latitude
@@ -101,9 +114,12 @@ const user = {
}) })
}, },
fail: function(err) { fail: function(err) {
console.warn('用户位置获取失败')
commit('setLocation', null) commit('setLocation', null)
}, },
complete: function(e) {} complete: function(e) {
console.warn('getUserLocation' + JSON.stringify(e))
}
}) })
}, },
//用户点击radio按钮 //用户点击radio按钮
@@ -223,9 +239,12 @@ const user = {
commit commit
}, data) { }, data) {
commit('SET_USER_SENDTIMES', data); commit('SET_USER_SENDTIMES', data);
}, }
}, },
mutations: { mutations: {
upDataResumeInfo(state, payload) {
state.resumeInfo = payload
},
setIsCms(state, payload) { setIsCms(state, payload) {
state.userIsCms = payload.val state.userIsCms = payload.val
}, },

View File

@@ -17,8 +17,10 @@ import {
import { import {
replaceStr replaceStr
} from "../config"; } from "../config";
import overAllConfig from "../config";
let showModal = true let showModal = true
const tabbarPageName = ['/pages/project/project', '/pages/my/my', '/pages/news/news']
/** /**
* *
* @export * @export
@@ -109,9 +111,9 @@ async function DoAjax(options, config = {}) {
if (statusWhiteList.includes(status)) throw res; if (statusWhiteList.includes(status)) throw res;
//如果是401则跳转到登录页面 //如果是401则跳转到登录页面
if (status === 401) { if (status === 401) {
store.dispatch('FedLogOut').then(() => { // store.dispatch('FedLogOut').then(() => {
GoLogin() // GoLogin()
}); // });
throw new Error(message); throw new Error(message);
} }
// 如果请求为非200否者默认统一处理 // 如果请求为非200否者默认统一处理
@@ -189,25 +191,33 @@ export function Promisify(func) {
export function GoLogin() { export function GoLogin() {
if (showModal) { if (showModal) {
showModal = false uni.showModal({
location.href = "https://dy12333.org.cn/h5/" title: "提示",
// uni.showModal({ content: "您还未登录,点击确认去登录",
// title: "提示", success({
// content: "您还未登录,点击确认去登录", confirm,
// success({ cancel
// confirm }) {
// }) { if (confirm) {
// if (confirm) { const returnPage = `${overAllConfig.loginURl}?returnPage=${location.href}`
// uni.redirectTo({ location.href = returnPage
// url: "/pages/login/login" }
// }); if (cancel) {
// } let pages = getCurrentPages();
// showModal = true let prePage = pages[pages.length - 1];
// }, const resetPage = tabbarPageName.find((item) => item === prePage.$route.fullPath)
// fail() { if (resetPage) {
// showModal = true uni.switchTab({
// } url: '/pages/index/index'
// }) })
}
}
},
complete() {
showModal = true
}
})
} }
} }

View File

@@ -7,6 +7,7 @@ module.exports = {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://10.165.0.173:8000', target: 'http://10.165.0.173:8000',
// target: 'http://192.168.1.115:8000',
ws: true, ws: true,
pathRewrite: { pathRewrite: {
'^/api': '/' '^/api': '/'