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

View File

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

View File

@@ -31,7 +31,7 @@
<block v-if="activeTab == 0">
<view v-if="newList.length > 0">
<block v-for="(item, index) in newList" :key="index">
<companyList :companyitem="item"></companyList>
<companyList :companyitem="item" :position="userLocation"></companyList>
</block>
</view>
<view v-else>
@@ -51,7 +51,7 @@
<view v-if="companyList.length > 0">
<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>
</view>
<view v-else>
@@ -109,7 +109,9 @@
getcoder
} from "@/api/map.js";
import verticalMenu from '@/components/vertical-menu/vertical-menu.vue';
import {
mapGetters
} from 'vuex'
export default {
components: {
vTabs,
@@ -117,15 +119,16 @@
verticalMenu,
workList
},
computed: {
...mapGetters(['userLocation']),
},
data() {
return {
policyContentList: [],
activeTab: 0,
activeTab: '0',
companyList: [],
recommendList: [],
newList: [],
nearPage: {
current: 1,
size: 10,
@@ -142,10 +145,7 @@
total: 0
},
currentAddress: '',
currentPoint: {
latitude: 0,
longitude: 0
},
key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI',
open: false,
showPopUp: false,
@@ -157,10 +157,11 @@
if (option.tabIndex) {
this.activeTab = option.tabIndex
}
this.getData()
this.getPolicy()
this.$store.dispatch('getUserLocation')
this.download()
},
onShow: function() {
const enumTitle = {
"0": '最新零工岗位',
"1": '最新全职岗位',
@@ -169,7 +170,7 @@
uni.setNavigationBarTitle({
title: enumTitle[this.activeTab]
})
if (this.$store.state.user.token) {
if (this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
@@ -177,7 +178,6 @@
}
})
}
const value = uni.getStorageSync('active');
if (value) {
this.activeTab = value;
@@ -190,13 +190,7 @@
},
/*下拉刷新*/
onPullDownRefresh: function() {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
});
} else {
this.download();
}
this.download();
},
methods: {
step() {
@@ -228,30 +222,6 @@
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() {
uni.navigateTo({
url: '../seach/seach'
@@ -271,8 +241,8 @@
this.activeTab = e;
},
//附近任务;
getNearList: function(point) {
nearMission(this.nearPage.current, this.nearPage.size).then(res => {
getNearList: function() {
nearMission(this.nearPage.current, this.nearPage.size, 1).then(res => {
if (this.nearPage.current === 1) {
this.companyList = [];
}
@@ -313,7 +283,7 @@
},
//最新任务;
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) {
this.newList = [];
}
@@ -326,32 +296,31 @@
},
//上拉加载
upLoad: function() {
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.activeTab === '0') {
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 {
uni.showToast({
icon: "none",
@@ -365,25 +334,24 @@
download: function() {
console.log(this.activeTab)
if (this.activeTab === '0') {
this.nearPage.current = 1;
console.log('123123')
this.getLocation();
this.newPage.current = 1;
this.getNewList();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
return
}
if (this.activeTab === '1') {
this.recommendPage.current = 1;
this.getRecommendList();
this.nearPage.current = 1;
this.getNearList();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
return
}
if (this.activeTab === '2') {
this.newPage.current = 1;
this.getNewList();
// this.newPage.current = 1;
this.getPolicy();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
@@ -391,20 +359,13 @@
}
},
getData: function() {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
});
} else {
uni.$emit('newsReadChange');
this.nearPage.current = 1;
this.recommendPage.current = 1;
this.newPage.current = 1;
this.getLocation();
this.getRecommendList();
this.getNewList();
this.getNearList();
}
uni.$emit('newsReadChange');
this.nearPage.current = 1;
this.recommendPage.current = 1;
this.newPage.current = 1;
this.getRecommendList();
this.getNewList();
this.getNearList();
},
@@ -442,7 +403,8 @@
.content {
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));
}

View File

@@ -181,7 +181,7 @@
this.getPolicy()
},
onShow: function() {
if (this.$store.state.user.token) {
if (this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
@@ -202,7 +202,7 @@
},
/*下拉刷新*/
onPullDownRefresh: function() {
if (!this.$store.state.user.token) {
if (!this.$api.haslogin()) {
uni.redirectTo({
url: "/pages/login/login"
});
@@ -244,7 +244,7 @@
getLocation: function() {
var that = this;
uni.getLocation({
type: 'gcj02',
type: 'wgs84',
success: function(res) {
that.currentPoint = {
latitude: res.latitude,
@@ -455,7 +455,7 @@
}
},
getData: function() {
if (!this.$store.state.user.token) {
if (!this.$api.haslogin()) {
uni.redirectTo({
url: "/pages/login/login"
});
@@ -588,7 +588,7 @@
.positionText {
margin: 0 10rpx;
font-weight: bold;
font-weight: bold;
}
}
@@ -610,7 +610,8 @@
.content {
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));
}

View File

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