Bladeren bron

feat:消息推送

lsw 8 maanden geleden
bovenliggende
commit
4ed474c5f3

+ 1 - 0
admin-ui/src/assets/styles/extend.scss

@@ -390,5 +390,6 @@
     width: 100%;
     background-color: #4581fb;
     border: 0px;
+    margin-top: 10px;
   }
 }

+ 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_4620946_yjys6ggyf8q.ttf?t=1722229086081') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4620946_njwyc3sdjfl.ttf?t=1722846374586') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 24 - 0
app/common/common.scss

@@ -352,3 +352,27 @@
 		margin-top: -5px;
 	}
 }
+.message-bubble-received {
+  background: white;
+  border-radius: 10px;
+  padding: 13px;
+  width: 85%;
+  word-wrap: break-word;
+  position: relative;
+  margin-left: 10px;
+  float: left;
+  clear: both;
+  font-size: 14px;
+  color: #262626;
+  margin-bottom: 15px;
+  &::before {
+    content: '';
+    position: absolute;
+    width: 0;
+    height: 0;
+    border-style: solid;
+    border-width: 0 10px 10px 10px;
+    border-color: transparent transparent white transparent;
+    left: -10px;
+  }
+}

+ 8 - 1
app/pages.json

@@ -44,7 +44,7 @@
 		{
 			"path": "pages/follow/detail",
 			"style": {
-				"navigationBarTitleText": "访详情"
+				"navigationBarTitleText": "访详情"
 			}
 		},
 		{
@@ -130,6 +130,13 @@
 			"style": {
 				"navigationBarTitleText": "就诊人信息"
 			}
+		},
+		{
+			"path" : "pages/follow/remind",
+			"style" : 
+			{
+				"navigationBarTitleText" : "复诊提醒"
+			}
 		}
 	],
 	"tabBar": {

+ 4 - 3
app/pages/follow/detail.vue

@@ -10,9 +10,9 @@
 				<text class="dx">({{ item.input }})</text>
 			</view>
 			<view class="mts">
-				<input v-if="item.input == '填空'" v-model="item.s_value" placeholder="请输入" :disabled="item.state != 0" />
-				<input v-if="item.input == '数字'" type="number" v-model="item.s_value" placeholder="请输入" :disabled="item.state != 0" />
-				<textarea v-if="item.input == '多行文本'" v-model="item.s_value" placeholder="请输入" :disabled="item.state != 0" />
+				<input v-if="item.input == '填空'" v-model="item.s_value" placeholder="请输入" :disabled="look" />
+				<input v-if="item.input == '数字'" type="number" v-model="item.s_value" placeholder="请输入" :disabled="look" />
+				<textarea v-if="item.input == '多行文本'" v-model="item.s_value" placeholder="请输入" :disabled="look" />
 				<view class="ops" v-if="item.input == '单选' || item.input == '多选' || item.input == '判断'">
 					<view v-for="(op, i) in item.selects" :key="op.name">
 						<view class="op" :class="{ active: op.check }" @click="check(item, op)">{{ op.name }}</view>
@@ -38,6 +38,7 @@ export default {
 			url: '/app/follow/detail/' + e.id,
 			success: (res) => {
 				this.item = res.data.data;
+				this.look = this.item.state != 0 ? true : false;
 				this.item.op = JSON.parse(this.item.op);
 			}
 		});

+ 12 - 22
app/pages/follow/index.vue

@@ -4,15 +4,14 @@
 			<u-tabs :list="tab" @click="click"></u-tabs>
 		</view>
 		<view class="list">
-			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/follow/detail?id=' + item.id)">
-				<view class="title omit">
-					<text class="icon" v-if="item.top === 1">&#xe61f;</text>
+			<view class="message-bubble-received" v-for="(item, index) in list" :key="index" @click="go('/pages/follow/detail?id=' + item.id)">
+				<view class="title">
+					<text class="icon">&#xe617;</text>
 					<text>{{ item.templateName }}</text>
 				</view>
-				<view class="desc">
-					<text>{{ item.state == 0 ? '待回访' : '已回访' }}</text>
-					<text>{{ item.createTime }}</text>
-				</view>
+				<view class="desc">尊敬的患者,为了更好的改善服务,我们向你发起了一个回访并且希望您认真填写。</view>
+				<view class="desc">{{ item.createTime }}</view>
+				<button class="btn" :style="{ backgroundColor: item.state == 0 ? '#4581fb' : '#4CAF50' }">{{ item.state == 0 ? '去填写' : '已填写' }}</button>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
@@ -30,7 +29,7 @@ export default {
 				{ name: '已回访', state: 1 }
 			],
 			list: [],
-			param: { pageNum: 1, pageSize: 10 },
+			param: { pageNum: 1, pageSize: 10, type: 1 },
 			loadMore: true
 		};
 	},
@@ -43,7 +42,7 @@ export default {
 	methods: {
 		click(e) {
 			this.current = e.index;
-			this.param.type = e.dictValue;
+			this.param.state = e.state;
 			this.refresh();
 		},
 		getData() {
@@ -88,27 +87,18 @@ export default {
 <style lang="scss">
 .list {
 	padding: 10px 12px;
-	.item {
-		border-radius: 5px;
-		padding: 13px 12px 13px 12px;
-		margin-bottom: 10px;
-		overflow: hidden;
-		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-		background-color: white;
+	.message-bubble-received {
 		.title {
-			font-size: 15px;
+			font-size: 16px;
 			font-weight: bold;
 			.icon {
-				color: orangered;
 				padding-right: 3px;
 			}
 		}
 		.desc {
-			font-size: 14px;
+			font-size: 13px;
 			padding-top: 10px;
-			text {
-				padding-right: 30px;
-			}
+			color: $font-c;
 		}
 	}
 }

+ 85 - 0
app/pages/follow/remind.vue

@@ -0,0 +1,85 @@
+<template>
+	<view>
+		<view class="list">
+			<view class="message-bubble-received" v-for="(item, index) in list" :key="index">
+				<view class="title">
+					<text class="icon">&#xe813;</text>
+					<text>{{ item.templateName }}</text>
+				</view>
+				<view class="desc">{{ item.op }}</view>
+				<view class="desc">{{ item.createTime }}</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>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			param: { pageNum: 1, pageSize: 10, type: 0 },
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/app/follow/list',
+				data: this.param,
+				loading: 'false',
+				success: (res) => {
+					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+					this.list.push(...res.data.rows);
+				}
+			});
+		},
+		//刷新数据
+		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">
+.list {
+	padding: 10px 12px;
+	.message-bubble-received {
+		.title {
+			font-size: 16px;
+			font-weight: bold;
+			.icon {
+				padding-right: 3px;
+			}
+		}
+		.desc {
+			font-size: 13px;
+			padding-top: 10px;
+			color: $font-c;
+		}
+	}
+}
+</style>

+ 5 - 5
app/pages/user/index.vue

@@ -16,9 +16,9 @@
 			<view class="icon edit">&#xe62b;</view>
 		</view>
 		<view class="cmd">
-			<view class="s_item" @click="go('/pages/follow/index')">
-				<text class="icon ic" style="color: #607d8b">&#xe60b;</text>
-				<text class="title">我的复诊</text>
+			<view class="s_item" @click="go('/pages/follow/remind')">
+				<text class="icon ic" style="color: #03a9f4">&#xe6a3;</text>
+				<text class="title">复诊提醒</text>
 				<text class="icon arrow">&#xe62b;</text>
 			</view>
 			<view class="s_item" @click="go('/pages/follow/index')">
@@ -27,12 +27,12 @@
 				<text class="icon arrow">&#xe62b;</text>
 			</view>
 			<view class="s_item" @click="go('/pages/visit/index')">
-				<text class="icon ic" style="color: #03a9f4">&#xe614;</text>
+				<text class="icon ic" style="color: #03a9f4">&#xe685;</text>
 				<text class="title">就诊记录</text>
 				<text class="icon arrow">&#xe62b;</text>
 			</view>
 			<view class="s_item" @click="go('/pages/detection/index')">
-				<text class="icon ic" style="color: #607d8b">&#xe615;</text>
+				<text class="icon ic" style="color: #ff9800">&#xe63a;</text>
 				<text class="title">检测报告</text>
 				<text class="icon arrow">&#xe62b;</text>
 			</view>

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

@@ -27,7 +27,7 @@ public class Api_FollowController extends BaseController {
 
     @GetMapping("/list")
     public TableDataInfo list(FollowRecord followRecord) {
-        followRecord.setPatientId(getUser().getId());
+        followRecord.setPatientId(getUser().getPatientId());
         startPage();
         List<FollowRecord> list = followRecordService.selectAppList(followRecord);
         return getDataTable(list);

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowRecordServiceImpl.java

@@ -35,7 +35,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
     @Override
     public AjaxResult detail(Long id) {
         FollowRecord followRecord = getById(id);
-        if (followRecord == null || !followRecord.getPatientId().equals(AppUtil.getUser().getId())) {
+        if (followRecord == null || !followRecord.getPatientId().equals(AppUtil.getUser().getPatientId())) {
             return AjaxResult.error("回访不存在或非法操作");
         }
         return AjaxResult.success(followRecord);
@@ -44,7 +44,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
     @Override
     public AjaxResult push(FollowRecordDto dto) {
         FollowRecord followRecord = getById(dto.getId());
-        if (followRecord == null || !followRecord.getPatientId().equals(AppUtil.getUser().getId())) {
+        if (followRecord == null || !followRecord.getPatientId().equals(AppUtil.getUser().getPatientId())) {
             return AjaxResult.error("回访不存在或非法操作");
         }
         followRecord.setOp(dto.getOp());

+ 4 - 2
ruoyi-admin/src/main/resources/mapper/work/FollowRecordMapper.xml

@@ -29,11 +29,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectAppList" resultType="com.ruoyi.web.work.domain.FollowRecord">
-        select id,template_name,state,create_time from tb_follow_record
+        select id,template_name,op,state,create_time from tb_follow_record
         <where>
-            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="patientId != null "> AND patient_id = #{patientId}</if>
             <if test="state != null "> and state = #{state}</if>
         </where>
+        ORDER BY id DESC
     </select>
 
     <select id="selectVisitList" resultType="com.ruoyi.web.work.domain.vo.VisitVoList">