lsw 1 year ago
parent
commit
5362c4b314

+ 1 - 1
app/App.vue

@@ -30,7 +30,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4507607_2j8og21e0fv.ttf?t=1718384228460') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4507607_m71b9669ik.ttf?t=1718463022282') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 7 - 0
app/pages.json

@@ -228,6 +228,13 @@
 			"style": {
 				"navigationBarTitleText": "企业卡片"
 			}
+		},
+		{
+			"path" : "pages/job/position/favorite",
+			"style" : 
+			{
+				"navigationBarTitleText" : "我的收藏"
+			}
 		}
 	],
 	"tabBar": {

+ 19 - 5
app/pages/job/detail.vue

@@ -1,9 +1,9 @@
 <template>
 	<view>
 		<view class="main">
-			<view class="title">{{ item.title }}</view>
+			<view class="title">{{ item.title || '' }}</view>
 			<view class="price" v-if="item.type == 0">{{ item.salary == '面议' ? item.salary : item.salary + '/月' }}</view>
-			<view class="desc">{{ item.experience }} · {{ item.positionName }} · {{ item.type == 0 ? '全职' : '兼职' }}</view>
+			<view class="desc">{{ item.experience || '' }} · {{ item.positionName || '' }} · {{ item.type == 0 ? '全职' : '兼职' }}</view>
 		</view>
 		<view class="bos">
 			<view class="ms" style="margin-top: 0px">
@@ -25,7 +25,7 @@
 		</view>
 		<view class="mfooter">
 			<view class="cn">
-				<button class="tob">
+				<button class="tob share" open-type="share">
 					<text class="icon">&#xe637;</text>
 					<view class="mtt">分享</view>
 				</button>
@@ -71,7 +71,7 @@ export default {
 			this.http.request({
 				url: '/app/favorite/add/' + this.item.id,
 				success: (res) => {
-					uni.showModal({ content: '收藏成功', showCancel: false });
+					uni.showToast({ title: '收藏成功' });
 					this.flag = true;
 				}
 			});
@@ -95,6 +95,15 @@ export default {
 					}
 				}
 			});
+		},
+		//分享
+		onShareAppMessage: function (res) {
+			return {
+				title: this.item.title,
+				path: '/pages/job/detail?id=' + this.item.id,
+				success: (res) => {},
+				fail: (res) => {}
+			};
 		}
 	}
 };
@@ -169,7 +178,7 @@ export default {
 	bottom: 0px;
 	border-top: 1px solid $line;
 	.cn {
-		padding: 10px 10px 18px 10px;
+		padding: 10px 10px 15px 10px;
 		overflow: hidden;
 		.tob {
 			margin-right: 15px;
@@ -185,6 +194,11 @@ export default {
 				font-size: 14px;
 			}
 		}
+		.share {
+			background-color: white;
+			line-height: 22px;
+			padding-top: 3px;
+		}
 		.btn {
 			float: right;
 			margin-top: 5px;

+ 92 - 0
app/pages/job/position/favorite.vue

@@ -0,0 +1,92 @@
+<template>
+	<view class="main pt0">
+		<view class="item_job" v-for="(item, index) in list" :key="index" @click="go('/pages/job/detail?id=' + item.positionId)">
+			<view class="top">
+				<view class="title omit">{{ item.title }}</view>
+				<view class="salary">{{ item.salary }}</view>
+			</view>
+			<view class="bot bt">
+				<view class="address omit">{{ item.address }}</view>
+				<view class="distance">{{ item.createTime }}</view>
+			</view>
+			<view class="flex">
+				<view class="f danger" @click.stop="del(item)">删除</view>
+			</view>
+		</view>
+		<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+		<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			param: { pageNum: 1, pageSize: 10 },
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/app/favorite/list',
+				data: this.param,
+				loading: 'false',
+				success: (res) => {
+					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+					res.data.rows.forEach((item) => {
+						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
+						this.list.push(item);
+					});
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		del(item) {
+			uni.showModal({
+				title: '提示',
+				content: '确定删除该收藏',
+				success: (res) => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/app/favorite/remove/' + item.id,
+							success: (res) => {
+								uni.showToast({ title: '删除成功' });
+								this.list.splice(this.list.indexOf(item), 1);
+							}
+						});
+					}
+				}
+			});
+		},
+		//刷新数据
+		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"></style>

+ 26 - 10
app/pages/user/index.vue

@@ -16,7 +16,7 @@
 			<view class="row">
 				<view class="out">
 					<view class="int">
-						<view class="num">{{ user.fullTime }}</view>
+						<view class="num">{{ user.fullTime || 0 }}</view>
 						<view class="desc">全职投递</view>
 					</view>
 				</view>
@@ -24,7 +24,7 @@
 			<view class="row">
 				<view class="out">
 					<view class="int">
-						<view class="num">{{ user.partTime }}</view>
+						<view class="num">{{ user.partTime || 0 }}</view>
 						<view class="desc">兼职投递</view>
 					</view>
 				</view>
@@ -32,7 +32,7 @@
 			<view class="row">
 				<view class="out">
 					<view class="int">
-						<view class="num">{{ user.invite }}</view>
+						<view class="num">{{ user.invite || 0 }}</view>
 						<view class="desc">面试次数</view>
 					</view>
 				</view>
@@ -131,17 +131,25 @@
 					</view>
 				</view>
 			</view>
-		</view>
-		<view class="mtt">更多服务</view>
-		<view class="menu">
-			<view class="cd" @click="go('/pages/statement/index/index')">
+			<view class="cd" @click="go('/pages/job/position/favorite')">
 				<view class="out">
 					<view class="int">
-						<view class="icon" style="background-color: #ffc107">&#xe63c;</view>
-						<view class="title">结算广场</view>
+						<view class="icon" style="background-color: #ff9800">&#xe626;</view>
+						<view class="title">我的收藏</view>
 					</view>
 				</view>
 			</view>
+		</view>
+		<view class="mtt">更多功能</view>
+		<view class="menu">
+			<view class="cd">
+				<view class="out">
+					<button class="int share" open-type="feedback" hover-class="none">
+						<view class="icon" style="background-color: #ffc107">&#xe648;</view>
+						<view class="title">建议反馈</view>
+					</button>
+				</view>
+			</view>
 			<view class="cd">
 				<view class="out">
 					<button class="int share" open-type="share" hover-class="none">
@@ -150,6 +158,14 @@
 					</button>
 				</view>
 			</view>
+			<view class="cd">
+				<view class="out">
+					<button class="int share" open-type="contact" hover-class="none">
+						<view class="icon" style="background-color: #8bc34a">&#xe632;</view>
+						<view class="title">联系客服</view>
+					</button>
+				</view>
+			</view>
 			<view class="cd" @click="go('/pages/other/setting')">
 				<view class="out">
 					<view class="int">
@@ -174,7 +190,7 @@ export default {
 				token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQwZGQzNWVlLTE5OWQtNDJhMy1hY2IxLTAxMmQwODI2YWNlZiJ9.2UejJW9OjqrkCQGzJHrSqO4JyzTeoezBt9m6y0xbMdIQvl0mko6gCRuXNmAOWUBvyowB7eYhk55RRcPzJUez8w'
 			};
 			uni.setStorageSync('user', this.user); */
-/* 		 		this.user = {
+		/* 		 		this.user = {
 			token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjM1MDZmY2NkLTg3ODMtNDc1OS1hYTY2LWY1ODMzNmU1MDYyZCJ9.GDs8mOUVSsqQMxZVHxyQi97Tfba4ztGsa_zT6Fjct0OVlXfQwwzioUtVX27UNRyzdOv0-ySbxGawoJzYjEidwA'
 		};
 		uni.setStorageSync('user', this.user); */

+ 29 - 7
app/pages/user/resume/deliver/receive/index.vue

@@ -1,8 +1,11 @@
 <template>
 	<view class="main pt0">
-		<view class="message _error" v-if="total > 0">你有:{{ this.total }}份简历未处理,请及时处理。</view>
+		<view class="message _error" v-if="total > 0">你有:{{ total }}份简历未处理,请及时处理。</view>
 		<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/user/resume/deliver/receive/list?id=' + item.id + '&title=' + item.title + '&total=' + item.total)">
-			<view class="title omit">{{ item.title }}</view>
+			<view class="top">
+				<view class="title omit">{{ item.title }}</view>
+				<view class="bage" v-if="item.noRead > 0">{{ item.noRead > 99 ? '99+' : item.noRead }}</view>
+			</view>
 			<view class="desc">
 				<view class="progress">
 					<u-line-progress :percentage="(item.isRead / item.total).toFixed(2) * 100" :height="20" text="已读"></u-line-progress>
@@ -38,8 +41,10 @@ export default {
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
 					res.data.rows.forEach((item) => {
 						this.list.push(item);
-						this.total = this.total + (item.total - item.isRead);
+						item.noRead = parseInt(item.total) - parseInt(item.isRead);
+						this.total = this.total + item.noRead;
 					});
+					console.log('asd:' + this.total);
 				}
 			});
 		},
@@ -78,16 +83,33 @@ export default {
 	padding: 15px;
 	overflow: hidden;
 	margin-bottom: 12px;
-	.title {
-		border-radius: 3px;
-		font-weight: bold;
-		font-size: 18px;
+	.top {
+		overflow: hidden;
+		position: relative;
+		.title {
+			border-radius: 3px;
+			font-weight: bold;
+			font-size: 18px;
+			width: 70%;
+			float: left;
+		}
+		.bage {
+			position: absolute;
+			padding: 0px 5px;
+			border-radius: 20px;
+			background-color: red;
+			color: white;
+			top: 2px;
+			right: 7px;
+			font-size: 14px;
+		}
 	}
 	.desc {
 		margin-top: 10px;
 		color: $font-c;
 		font-size: 15px;
 		margin-left: -5px;
+		overflow: hidden;
 		.progress {
 			float: left;
 			width: 90%;

+ 2 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_FavoriteController.java

@@ -1,8 +1,8 @@
 package com.ruoyi.web.work.api;
 
-import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.web.work.api.config.BaseController;
 import com.ruoyi.web.work.domain.Favorite;
 import com.ruoyi.web.work.service.IFavoriteService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +27,7 @@ public class Api_FavoriteController extends BaseController {
 
     @GetMapping("/list")
     public TableDataInfo list(Favorite favorite) {
+        favorite.setUserId(getUser().getId());
         startPage();
         List<Favorite> list = favoriteService.selectList(favorite);
         return getDataTable(list);

+ 2 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Favorite.java

@@ -44,10 +44,6 @@ public class Favorite{
     private String salary;
 
     @TableField(exist = false)
-    @ApiModelProperty(value = "地区名称")
-    private String regionName;
-
-    @TableField(exist = false)
-    @ApiModelProperty(value = "地点名")
-    private String location;
+    @ApiModelProperty(value = "详细地址")
+    private String address;
 }

+ 5 - 4
ruoyi-admin/src/main/resources/mapper/work/FavoriteMapper.xml

@@ -9,14 +9,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             f.*,
             p.type,
             p.title,
-            p.region_name,
-            p.location
+            p.address,
+            p.salary
         FROM
             tb_favorite f
                 LEFT JOIN tb_position p ON p.id = f.position_id
         WHERE
-            f.user_id = 14
-          AND p.state = 0
+            f.user_id =#{userId}
+          AND p.state =0
+          AND p.audit =1
         ORDER BY
             f.id DESC
     </select>