12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <template>
- <view class="main">
- <!--搜索-->
- <view class="search">
- <u-search placeholder="企业名称" bgColor="white" :showAction="false"></u-search>
- </view>
- <!--找工作-->
- <view class="tab">
- <u-tabs :list="tab"></u-tabs>
- </view>
- <view class="jobs">
- <view class="part_time" v-for="(item, index) in list" :key="index" @click="detail()">
- <view class="title omit">{{ item.title }}</view>
- <view class="price">{{ item.price }}元/天</view>
- <text class="date">4.16-4.17</text>
- <view class="address">
- <text @click.stop="company()">{{ item.name }}</text>
- <text class="add">申请</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- tab: [
- { name: '最新', value: 0 },
- { name: '附近', value: 1 }
- ],
- list: [],
- param: { pageNum: 1, pageSize: 10, type: 0 },
- loadMore: true
- };
- },
- onLoad(e) {
- this.getData();
- },
- methods: {
- getData() {
- this.http.request({
- url: '/app/position/list',
- data: this.param,
- loading: 'false',
- success: (res) => {
- this.loadMore = res.data.pages > this.param.pageNum ? true : false;
- this.list.push(...res.data.rows);
- }
- });
- },
- click(e, tag) {
- this.param[tag] = this[tag][e.index].value;
- if (tag == 'audit') {
- this.current = e.index;
- }
- this.refresh();
- },
- selectClick(e) {
- uni.navigateTo({ url: '/pages/job/position/manage/push?type=' + e.value });
- },
- detail(item) {
- uni.navigateTo({ url: '/pages/job/position/manage/push?id=' + item.id });
- },
- //刷新数据
- refresh() {
- this.loadMore = true;
- this.param.pageNum = 1;
- this.list = [];
- this.getData();
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.refresh();
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param.pageNum++;
- this.getData();
- }
- }
- };
- </script>
- <style lang="scss">
- .jobs {
- margin-top: 0px;
- }
- </style>
|