lsw 10 maanden geleden
bovenliggende
commit
3cdd8ef640

+ 7 - 0
app/pages.json

@@ -177,6 +177,13 @@
 			{
 				"navigationBarTitleText" : "新闻详情"
 			}
+		},
+		{
+			"path" : "pages/job/list",
+			"style" : 
+			{
+				"navigationBarTitleText" : "全职"
+			}
 		}
 	],
 	"tabBar": {

+ 94 - 0
app/pages/job/list.vue

@@ -0,0 +1,94 @@
+<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>

+ 0 - 0
app/pages/serve/index.scss


+ 1 - 1
app/pages/serve/index.vue

@@ -46,7 +46,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="cd" @click="go('/pages/clsd/job/full_time')">
+			<view class="cd" @click="go('/pages/job/list')">
 				<view class="out">
 					<view class="int">
 						<view class="icon" style="background-color: #4581fb">&#xe9d9;</view>

+ 1 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_PositionController.java

@@ -27,10 +27,8 @@ public class Api_PositionController extends BaseController {
 
     @GetMapping("/list")
     public TableDataInfo list(Position position) {
-        position.setState(0);
-        position.setAudit(1);
         startPage();
-        List<Position> list = positionService.manageList(position);
+        List<Position> list = positionService.indexList(position);
         return getDataTable(list);
     }
 

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/PositionMapper.java

@@ -13,4 +13,6 @@ public interface PositionMapper extends BaseMapper<Position> {
     List<Position> selectList(Position position);
 
     List<Position> manageList(Position position);
+
+    List<Position> indexList(Position position);
 }

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPositionService.java

@@ -17,6 +17,8 @@ public interface IPositionService extends IService<Position> {
 
     List<Position> manageList(Position position);
 
+    List<Position> indexList(Position position);
+
     /**
      * 发布职位
      *

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PositionServiceImpl.java

@@ -40,6 +40,11 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
     }
 
     @Override
+    public List<Position> indexList(Position position) {
+        return positionMapper.indexList(position);
+    }
+
+    @Override
     public AjaxResult manageAdd(PositionDto dto) {
         Position position = new Position();
         BeanUtils.copyProperties(dto, position);

+ 11 - 0
ruoyi-admin/src/main/resources/mapper/work/PositionMapper.xml

@@ -21,4 +21,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="title != null  and title != ''"> and title like concat('%', #{name}, '%')</if>
         </where>
     </select>
+    <select id="indexList" resultType="com.ruoyi.web.work.domain.Position">
+        SELECT
+            *
+        FROM
+            tb_position
+        WHERE
+            state = 0
+          AND audit = 1
+          AND type = #{type}
+        <if test="title != null  and title != ''"> and title like concat('%', #{name}, '%')</if>
+    </select>
 </mapper>