diff --git a/App.vue b/App.vue
index e7d157f..d3007fc 100644
--- a/App.vue
+++ b/App.vue
@@ -7,26 +7,42 @@
import {
mapGetters
} from 'vuex'
+ import {
+ GoLogin
+ } from '@/untils/AxiosUtils.js';
// #ifdef H5
import {
setPlatformByHostName
} from '@/untils/customized.js'
+ import {
+ reject
+ } from 'lodash';
// #endif
export default {
onLaunch: function(options) {
this.$store.dispatch('InitArea')
if (options.query.token) {
- uni.reLaunch({
- url: '/pages/login/blank?token=' + options.query.token
+ this.tokenlogin(options.query.token).then(() => {
+ this.$store.dispatch('getUserLocation')
+ this.$store.dispatch('getMobileIsCms')
+ this.$store.dispatch('getResumeInfo')
})
- } else if (this.$store.state.user.token) {
- this.$store.dispatch('startRefreshTokenTimer')
- this.$store.dispatch('startRefreshNewsTimer')
- this.$store.dispatch('refreshAuthState')
- this.$store.dispatch('getUserLocation')
- this.$store.dispatch('getMobileIsCms')
+ } else {
+ this.$store.dispatch('FedLogOut')
}
+ // 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
// 企业定制
setPlatformByHostName(this.$store)
@@ -35,7 +51,7 @@
onShow: function() {},
onHide: function() {},
computed: {
- ...mapGetters(['news']),
+ ...mapGetters(['news', 'auth']),
allUnread() {
return this.news.allUnread
}
@@ -43,10 +59,41 @@
mounted() {
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: {
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({
index: 2
})
@@ -65,7 +112,7 @@
})
})
}
- }
+ },
}
};
diff --git a/api/mission.js b/api/mission.js
index 3f9d5a9..4bdf0c6 100644
--- a/api/mission.js
+++ b/api/mission.js
@@ -306,4 +306,10 @@ export const getPolicyContentList = (params) => request({
url: '/api/jobslink-api/desk/article/getAllArticle',
method: 'get',
params
+})
+
+export const userWorkSearchListAll = (params) => request({
+ url: '/api/jobslink-api/user/userWork/searchListAll',
+ method: 'get',
+ params
})
\ No newline at end of file
diff --git a/components/companyList/collectionList.vue b/components/companyList/collectionList.vue
index ea2e6e4..0176b47 100644
--- a/components/companyList/collectionList.vue
+++ b/components/companyList/collectionList.vue
@@ -1,244 +1,267 @@
-
-
-
-
-
-
-
-
-
- {{ companyitem.wage }}{{ wageUnit[companyitem.wageUnitCategory] }}
-
-
-
-
-
-
-
- {{ companyitem.tradeNames }}
-
-
- {{ item }}
-
-
-
-
-
-
-
-
-
-
-
- {{ companyitem.missionCompanyName }}
-
-
-
- --km
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/companyList/workList.vue b/components/companyList/workList.vue
index 3ac848b..3c8f398 100644
--- a/components/companyList/workList.vue
+++ b/components/companyList/workList.vue
@@ -90,7 +90,8 @@
near: {
type: Boolean,
default: false
- }
+ },
+ position: Object,
},
data() {
return {
diff --git a/components/sylj-selectLocation/tmap.vue b/components/sylj-selectLocation/tmap.vue
index e2936d8..ee754f3 100644
--- a/components/sylj-selectLocation/tmap.vue
+++ b/components/sylj-selectLocation/tmap.vue
@@ -268,7 +268,36 @@
}
},
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: () => {
uni.hideLoading();
diff --git a/config.js b/config.js
index 604a21e..5f3d042 100644
--- a/config.js
+++ b/config.js
@@ -6,6 +6,7 @@ module.exports = {
apiKey: 'e4266a5e84fe6c10f60c559967f0a03f',
// 显示标题
showTitle: false,
+ loginURl: 'https://dy12333.org.cn/h5/#/pages/qyPackge/user/login/login',
// 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/c02c6f51f3ab4190bffd5e3e54cf5ac4/111013e9067749488d44841208771768',
diff --git a/main.js b/main.js
index a7b2196..8138bde 100644
--- a/main.js
+++ b/main.js
@@ -8,6 +8,9 @@ import tools from '@/untils/tools.js'
import {
VueJsonp
} from 'vue-jsonp'
+import {
+ GoLogin
+} from '@/untils/AxiosUtils.js';
// 注册全局组件
// import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
// import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
@@ -16,9 +19,21 @@ import {
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) {
- console.log(url)
- if (needLogin) {
+ if (needLogin && !haslogin()) {
+ GoLogin()
return
}
uni.navigateTo({
@@ -26,6 +41,7 @@ function navTo(url, needLogin) {
})
}
+
const msg = (title, duration = 1500, mask = false, icon = 'none') => {
uni.showToast({
title,
@@ -50,7 +66,9 @@ Vue.component('super-map', superMapView)
Vue.component('empty', empty)
Vue.prototype.$api = {
msg,
- sleep
+ sleep,
+ haslogin,
+ hasResume
}
Vue.prototype.tools = tools
Vue.prototype.$config = config
diff --git a/manifest.json b/manifest.json
index 70d7780..eb8d4d8 100644
--- a/manifest.json
+++ b/manifest.json
@@ -65,11 +65,7 @@
},
"h5": {
"sdkConfigs": {
- "maps": {
- "qqmap": {
- "key": "FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI"
- }
- }
+ "maps": {}
},
"template": "index.html",
"router": {
diff --git a/pageMy/apply/rights.vue b/pageMy/apply/rights.vue
index 1ea49ce..e2dbfe4 100644
--- a/pageMy/apply/rights.vue
+++ b/pageMy/apply/rights.vue
@@ -36,7 +36,7 @@
}
},
onShow() {
- if (!this.$store.state.user.token){
+ if (!this.$api.haslogin()){
//modalTitle, content, whetherCancel, confirmText, pageUrl, cancelUrl
showUniModal('提示','您还未登录,点击确认去登录',true,'确定','/pages/login/login','/pages/index/index')
}else{
diff --git a/pageMy/my/resume/index.vue b/pageMy/my/resume/index.vue
index 213a895..ea69d2b 100644
--- a/pageMy/my/resume/index.vue
+++ b/pageMy/my/resume/index.vue
@@ -171,6 +171,9 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无收藏信息
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 937588e..1f87b0b 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -191,16 +191,16 @@
-
+
-
+
+ -->
{
- var auth = this.$store.state.auth
- if (!auth.bankCardState) {
- this.step()
- }
- })
-
this.download()
this.getSwiperList()
this.getPolicy()
- if (this.IsResume) {
- myResume().then(res => {
- const data = res.data.data
- if (!(data.education && data.telephone && data.wage && data.workplace)) {
- this.goures()
- this.$api.sleep(1000).then(() => {
- this.$api.msg('请输入基本信息')
- })
+ if (this.$api.haslogin()) {
+ this.$store.dispatch('refreshAuthState').then((e) => {
+ var auth = this.$store.state.auth
+ if (!auth.bankCardState) {
+ this.step()
}
})
- this.IsResume = false
}
},
onReady() {
@@ -399,11 +384,11 @@
})
},
download: function() {
- this.isLogin = this.$store.state.user.token ? true : false;
+ this.isLogin = this.$api.haslogin() ? true : false;
newMission().then(res => {
this.companyList = res.data.data;
});
- if (this.$store.state.user.token) {
+ if (this.$api.haslogin()) {
uni.$emit('newsReadChange')
this.$store.dispatch("getUnreadNum");
recMission().then(res => {
@@ -412,25 +397,7 @@
};
},
goLocation: function() {
- if (!this.$store.state.user.token) {
- 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'
- });
- }
+ this.navTo('../mapSeach/mapSeach', true)
},
goResume: function() {
uni.navigateTo({
@@ -444,40 +411,16 @@
});
},
goures: function() {
- if (!this.$store.state.user.token) {
- 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'
- });
- }
+ this.navTo('/pageMy/my/resume/index', true)
},
toNewTask() {
- uni.navigateTo({
- url: `/pages/project/newProject?tabIndex=${0}`
- });
+ this.navTo(`/pages/project/newProject?tabIndex=${0}`, false)
},
toNewWork() {
- uni.navigateTo({
- url: `/pages/project/newProject?tabIndex=${1}`
- });
+ this.navTo(`/pages/project/newProject?tabIndex=${1}`, false)
},
toNewProject() {
- uni.navigateTo({
- url: `/pages/project/newProject?tabIndex=${2}`
- });
+ this.navTo(`/pages/project/newProject?tabIndex=${2}`, false)
},
toArticleDetail(id) {
if (id) {
@@ -487,49 +430,11 @@
}
},
gouserSet: function() {
- if (!this.$store.state.user.token) {
- 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'
- });
- }
+ this.navTo('/pageMy/setUserBase/index', true)
},
goSeach: function() {
- if (!this.$store.state.user.token) {
- uni.showModal({
- 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 = ''
- // }
- }
+ this.navTo('../seach/seach?keywords=' + this.keywords, true)
+ this.keywords = ''
},
getSwiperList() {
getSwiperList(this.swiperType).then(res => {
diff --git a/pages/login/blank.vue b/pages/login/blank.vue
index 0d5f66f..243f6e3 100644
--- a/pages/login/blank.vue
+++ b/pages/login/blank.vue
@@ -7,6 +7,9 @@
import {
mapGetters
} from 'vuex'
+ import {
+ GoLogin
+ } from '@/untils/AxiosUtils.js';
import website from '@/config/website.js'
export default {
data() {
@@ -17,7 +20,7 @@
},
onLoad(options) {
uni.showLoading({
- title: ''
+ title: '登录中'
})
if (options.token) {
const that = this
@@ -39,7 +42,6 @@
if (!auth.bankCardState) {
that.goSign(0)
} else {
-
uni.switchTab({
url: '/pages/index/index'
})
@@ -50,9 +52,10 @@
// this.$refs.code.refushCode()
});
} else {
- uni.reLaunch({
- url: '/pages/login/login'
- })
+ // uni.reLaunch({
+ // url: '/pages/login/login'
+ // })
+ GoLogin()
}
},
method: {
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 41ad0f1..20d2187 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -1,170 +1,171 @@
-
-
-
-
-
-
-
-
-
- 立即登录
- 立即登录
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ 立即登录
+ 立即登录
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mapSeach/mapSeach.vue b/pages/mapSeach/mapSeach.vue
index f06e685..8936225 100644
--- a/pages/mapSeach/mapSeach.vue
+++ b/pages/mapSeach/mapSeach.vue
@@ -1,560 +1,563 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 附近零工岗位
-
-
-
-
-
-
-
-
-
-
-
- 暂无岗位信息
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 附近零工岗位
+
+
+
+
+
+
+
+
+
+
+
+ 暂无岗位信息
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/my/my.vue b/pages/my/my.vue
index d6a8499..32c1083 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -57,26 +57,26 @@
认证信息
-
+
问卷调查
-
+
+
@@ -122,6 +122,9 @@
-
-
-
-
-
-
-
+
+
+
+
+ {{ value.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/seach/seach.vue b/pages/seach/seach.vue
index d58b21f..3ca6f43 100644
--- a/pages/seach/seach.vue
+++ b/pages/seach/seach.vue
@@ -1,54 +1,18 @@
-
+
-
-
搜索
-
-
-
-
-
-
-
-
- {{ keywords }}
-
-
-
-
-
-
-
-
- 搜索结果
-
-
- {{ item.name }}
- 零工岗位
- 全职岗位
- 政策
- 招工
-
- 没有更多数据了
-
- 暂无数据
-
-
+
搜索记录
@@ -60,15 +24,14 @@
暂无历史记录
+
+
-
-
-
-
-
+
+
-
+
@@ -78,10 +41,10 @@
-
-
+
+
-
+
@@ -92,8 +55,8 @@
-
-
+
+
@@ -109,94 +72,86 @@
- 完善技能,获取精推荐
+ 暂无信息
+ 完善技能
+ -->
-
+
+
+
+
+ 没有更多数据
+
+
+
-
\ No newline at end of file
diff --git a/store/models/news.js b/store/models/news.js
index e8cde36..71ba2aa 100644
--- a/store/models/news.js
+++ b/store/models/news.js
@@ -372,7 +372,7 @@ const news = {
current,
total
}) => {
- console.log(data)
+ if (!data) return
data.forEach(item => {
state.dic[item.id] = item
})
diff --git a/store/models/user.js b/store/models/user.js
index 4f8990b..df9a312 100644
--- a/store/models/user.js
+++ b/store/models/user.js
@@ -18,6 +18,9 @@ import {
import {
calcDate
} from '@/untils/date.js'
+import {
+ myResume,
+} from '@/api/resume.js';
let refreshTimer = null;
@@ -67,8 +70,18 @@ const user = {
}) || 0, // 0 个体招工 ; 企业招工
userLocation: null,
userIsCms: false,
+ resumeInfo: {},
},
actions: {
+ getResumeInfo({
+ commit,
+ dispatch
+ }) {
+ myResume().then(res => {
+ const data = res.data.data
+ commit('upDataResumeInfo', data)
+ })
+ },
getMobileIsCms({
commit,
dispatch
@@ -83,14 +96,14 @@ const user = {
commit,
dispatch
}) {
- console.log('getUserLocation null1')
// commit('setLocation', {
// latitude: 31.133980,
// longitude: 104.404419,
// })
uni.getLocation({
- type: 'gcj02',
+ type: 'wgs84',
success: function(res) {
+ console.warn('用户位置获取成功')
const {
longitude,
latitude
@@ -101,9 +114,12 @@ const user = {
})
},
fail: function(err) {
+ console.warn('用户位置获取失败')
commit('setLocation', null)
},
- complete: function(e) {}
+ complete: function(e) {
+ console.warn('getUserLocation' + JSON.stringify(e))
+ }
})
},
//用户点击radio按钮
@@ -223,9 +239,12 @@ const user = {
commit
}, data) {
commit('SET_USER_SENDTIMES', data);
- },
+ }
},
mutations: {
+ upDataResumeInfo(state, payload) {
+ state.resumeInfo = payload
+ },
setIsCms(state, payload) {
state.userIsCms = payload.val
},
diff --git a/untils/AxiosUtils.js b/untils/AxiosUtils.js
index 79738b9..6b11d92 100644
--- a/untils/AxiosUtils.js
+++ b/untils/AxiosUtils.js
@@ -17,8 +17,10 @@ import {
import {
replaceStr
} from "../config";
+import overAllConfig from "../config";
let showModal = true
+const tabbarPageName = ['/pages/project/project', '/pages/my/my', '/pages/news/news']
/**
*
* @export
@@ -109,9 +111,9 @@ async function DoAjax(options, config = {}) {
if (statusWhiteList.includes(status)) throw res;
//如果是401则跳转到登录页面
if (status === 401) {
- store.dispatch('FedLogOut').then(() => {
- GoLogin()
- });
+ // store.dispatch('FedLogOut').then(() => {
+ // GoLogin()
+ // });
throw new Error(message);
}
// 如果请求为非200否者默认统一处理
@@ -189,25 +191,33 @@ export function Promisify(func) {
export function GoLogin() {
if (showModal) {
- showModal = false
- location.href = "https://dy12333.org.cn/h5/"
- // uni.showModal({
- // title: "提示",
- // content: "您还未登录,点击确认去登录",
- // success({
- // confirm
- // }) {
- // if (confirm) {
- // uni.redirectTo({
- // url: "/pages/login/login"
- // });
- // }
- // showModal = true
- // },
- // fail() {
- // showModal = true
- // }
- // })
+ uni.showModal({
+ title: "提示",
+ content: "您还未登录,点击确认去登录",
+ success({
+ confirm,
+ cancel
+ }) {
+ if (confirm) {
+ const returnPage = `${overAllConfig.loginURl}?returnPage=${location.href}`
+ location.href = returnPage
+ }
+ if (cancel) {
+ let pages = getCurrentPages();
+ let prePage = pages[pages.length - 1];
+ const resetPage = tabbarPageName.find((item) => item === prePage.$route.fullPath)
+ if (resetPage) {
+ uni.switchTab({
+ url: '/pages/index/index'
+ })
+ }
+ }
+ },
+ complete() {
+ showModal = true
+ }
+
+ })
}
}
diff --git a/vue.config.js b/vue.config.js
index c8ae835..e6f92ae 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -7,6 +7,7 @@ module.exports = {
proxy: {
'/api': {
target: 'http://10.165.0.173:8000',
+ // target: 'http://192.168.1.115:8000',
ws: true,
pathRewrite: {
'^/api': '/'