lsw il y a 10 mois
Parent
commit
ccfaf42e8c

+ 11 - 0
app/common/common.scss

@@ -163,6 +163,7 @@
 			padding: 5px;
 			.int {
 				padding: 8px 5px 8px 5px;
+				position: relative;
 				.icon {
 					font-size: 30px;
 					width: 50px;
@@ -177,6 +178,16 @@
 					font-size: 14px;
 					padding-top: 5px;
 				}
+				.bage {
+					position: absolute;
+					padding: 0px 5px;
+					border-radius: 20px;
+					background-color: red;
+					color: white;
+					top: 2px;
+					right: 7px;
+					font-size: 13px;
+				}
 			}
 			.share {
 				background-color: white;

+ 4 - 2
app/pages/user/index.vue

@@ -90,6 +90,7 @@
 						<view class="int">
 							<view class="icon" style="background-color: #03a9f4">&#xe627;</view>
 							<view class="title">收到简历</view>
+							<view class="bage" v-if="user.noRead > 0">{{ user.noRead > 99 ? '99+' : user.noRead }}</view>
 						</view>
 					</view>
 				</view>
@@ -118,6 +119,7 @@
 					<view class="int">
 						<view class="icon" style="background-color: #4caf50">&#xe605;</view>
 						<view class="title">面试邀约</view>
+						<view class="bage" v-if="user.accept > 0">{{ user.accept > 99 ? '99+' : user.accept }}</view>
 					</view>
 				</view>
 			</view>
@@ -168,8 +170,8 @@ export default {
 		};
 	},
 	onShow() {
-		/* 		 this.user = {
-				token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImQyYThiZTk5LThjY2MtNGFkMi05ODJlLTMzYzE3NTdiNDllOSJ9.YFzfq1YEDy1FmZ-2bynRDgQai6qMdfGFsgQCDMiStba-m4AdoqKx6hmfd7F5n2t9l1bgcxE9VVpC7M6TdWN72Q'
+		/* 	 this.user = {
+				token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjRjMzVmMzYyLTE1ZDItNDcxNi05NGEzLTI0YzljNGNmYTExNiJ9.jb5HwsEUCPCuwvIXseSjARBbTHjR3sD0crQTRb4PdwY5YSGa7V4WiMAvYFdbc1HNkdd9H0IQLLjgLP9ZSRUlxA'
 			};
 			uni.setStorageSync('user', this.user); */
 		if (this.hasLogin()) {

+ 8 - 2
app/pages/user/resume/deliver/receive/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="main pt0">
+		<view class="message _error" v-if="total > 0">你有:{{ this.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="desc">
@@ -19,7 +20,8 @@ export default {
 		return {
 			list: [],
 			param: { pageNum: 1, pageSize: 10 },
-			loadMore: true
+			loadMore: true,
+			total: 0
 		};
 	},
 	onLoad(e) {
@@ -27,13 +29,17 @@ export default {
 	},
 	methods: {
 		getData() {
+			this.total = 0;
 			this.http.request({
 				url: '/app/deliver/receive',
 				data: this.param,
 				loading: 'false',
 				success: (res) => {
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
-					this.list.push(...res.data.rows);
+					res.data.rows.forEach((item) => {
+						this.list.push(item);
+						this.total = this.total + (item.total - item.isRead);
+					});
 				}
 			});
 		},

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

@@ -40,7 +40,7 @@ public class Api_UserController extends BaseController {
 
     @GetMapping("/info")
     public AjaxResult info() {
-        return AjaxResult.success(userService.getById(getUser().getId()));
+        return userService.info();
     }
 
     @PostMapping("/choice")

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/User.java

@@ -99,5 +99,9 @@ public class User{
     @TableField(exist = false)
     private String token;
 
+    @TableField(exist = false)
+    private Integer noRead;
 
+    @TableField(exist = false)
+    private Integer accept;
 }

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

@@ -16,4 +16,6 @@ public interface UserMapper extends BaseMapper<User> {
 
     @Select("SELECT * FROM tb_user WHERE open_id=#{openId}")
     User selectByOpenId(@Param("openId") String openId);
+
+    User selectUser(@Param("id") Long id);
 }

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IUserService.java

@@ -55,4 +55,11 @@ public interface IUserService extends IService<User> {
      * @return
      */
     AjaxResult exit();
+
+
+    /**
+     * 用户详情
+     * @return
+     */
+    AjaxResult info();
 }

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

@@ -115,4 +115,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             return AjaxResult.error("退出登录失败");
         }
     }
+
+    @Override
+    public AjaxResult info() {
+        return AjaxResult.success(userMapper.selectUser(AppUtil.getUser().getId()));
+    }
 }

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

@@ -13,4 +13,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="selectUser" resultType="com.ruoyi.web.work.domain.User">
+        SELECT
+            u.*,
+            ( SELECT COUNT( d.id ) FROM tb_resume_deliver d WHERE d.enterprise_id = u.id AND is_read = 0 ) AS noRead,
+            ( SELECT COUNT( d.id ) FROM tb_resume_deliver d WHERE d.user_id = u.id AND state = 1 AND is_accept = 0 ) AS accept
+        FROM
+            tb_user u
+        WHERE
+            id =#{id}
+    </select>
+
 </mapper>