flat: 国庆节暂存
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user