|
@@ -5,9 +5,9 @@
|
|
|
<view class="usearch">
|
|
|
<u-search placeholder="搜索工作" :disabled="true" bgColor="white" :showAction="false" @click="go('/pages/job/search')"></u-search>
|
|
|
</view>
|
|
|
- <view class="address">
|
|
|
+ <view class="address omit" @click="go('/pages/job/position/city')">
|
|
|
<text class="icon"></text>
|
|
|
- <text>南宁市</text>
|
|
|
+ <text>{{ param.cityName || '南宁市' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!--轮播图-->
|
|
@@ -50,14 +50,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="tab">
|
|
|
- <u-tabs :list="tab" @click="click"></u-tabs>
|
|
|
- <view class="filters" @click="show = true">
|
|
|
- <text class="icon"></text>
|
|
|
- <text>更多</text>
|
|
|
- </view>
|
|
|
+ <u-tabs :list="tab" @click="tabClick"></u-tabs>
|
|
|
</view>
|
|
|
+ <!--职位列表-->
|
|
|
<view class="list">
|
|
|
- <job :list="list"></job>
|
|
|
+ <job :list="list" v-if="list.length > 0"></job>
|
|
|
+ <u-empty v-else text="该城市暂无工作"></u-empty>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -65,17 +63,24 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- tab: [{ name: '推荐' }, { name: '最新' }, { name: '附近' }],
|
|
|
+ tab: [
|
|
|
+ { name: '最新', orderBy: 'id' },
|
|
|
+ { name: '附近', orderBy: 'distance' }
|
|
|
+ ],
|
|
|
list: [],
|
|
|
- param: { pageNum: 1, pageSize: 20, orderBy: 'id', type: 0 },
|
|
|
+ param: { pageNum: 1, pageSize: 20, type: 0 },
|
|
|
bannerList: [],
|
|
|
noticeList: []
|
|
|
};
|
|
|
},
|
|
|
- onShow() {},
|
|
|
onLoad() {
|
|
|
- this.initData();
|
|
|
this.getData();
|
|
|
+ this.initData();
|
|
|
+ uni.$on('select_city', (res) => {
|
|
|
+ this.param.cityName = res.title;
|
|
|
+ this.param.regionId = res.id;
|
|
|
+ this.getData();
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
|
@@ -106,6 +111,9 @@ export default {
|
|
|
type: 'wgs84',
|
|
|
success: (res) => {
|
|
|
uni.setStorageSync('location', res);
|
|
|
+ this.param.latitude = res.latitude;
|
|
|
+ this.param.longitude = res.longitude;
|
|
|
+ this.getData();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -120,12 +128,13 @@ export default {
|
|
|
url: '/app/position/list',
|
|
|
data: this.param,
|
|
|
success: (res) => {
|
|
|
- this.list.push(...res.data.rows);
|
|
|
+ this.list = res.data.rows;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- click(e) {
|
|
|
- this.current = e.index;
|
|
|
+ tabClick(e) {
|
|
|
+ this.param.orderBy = e.orderBy;
|
|
|
+ this.getData();
|
|
|
},
|
|
|
go(url) {
|
|
|
uni.navigateTo({ url: url });
|
|
@@ -135,5 +144,11 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-@import './index.scss';
|
|
|
+.banner {
|
|
|
+ margin-top: 15px;
|
|
|
+ box-shadow: $box-shadow;
|
|
|
+}
|
|
|
+.menu {
|
|
|
+ box-shadow: none;
|
|
|
+}
|
|
|
</style>
|