lsw 9 mesiacov pred
rodič
commit
6f48609991

+ 11 - 3
app/common/common.scss

@@ -25,7 +25,7 @@
 	overflow: hidden;
 }
 .ellip {
-	-webkit-line-clamp: 2;
+	-webkit-line-clamp: 3;
 	text-overflow: ellipsis;
 	display: -webkit-box;
 	-webkit-box-orient: vertical;
@@ -115,10 +115,18 @@
 					border-radius: 5px;
 					float: left;
 				}
-				.name {
+				.con {
 					float: left;
+					width: 60%;
 					padding-left: 12px;
-					padding-top: 30px;
+					.name {
+						font-weight: bold;
+					}
+					.brief {
+						font-size: 13px;
+						color: $font-c;
+						line-height: 20px;
+					}
 				}
 			}
 		}

+ 2 - 2
app/pages/doctor/detail.vue

@@ -7,7 +7,7 @@
 			</view>
 			<view class="con">
 				<u-divider text="人物介绍"></u-divider>
-				<u-parse :content="item.remark"></u-parse>
+				<u-parse :content="item.introduce"></u-parse>
 			</view>
 		</view>
 	</view>
@@ -26,7 +26,7 @@ export default {
 			url: '/app/doctor/detail/' + e.id,
 			success: (res) => {
 				this.item = res.data.data;
-				this.item.remark = res.data.data.remark.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
+				this.item.introduce = res.data.data.introduce.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
 			}
 		});
 	},

+ 17 - 9
app/pages/doctor/index.vue

@@ -1,19 +1,23 @@
 <template>
 	<view class="msilde">
 		<view class="left">
-			<u-collapse accordion @open="current = -1">
-				<u-collapse-item :title="d.deptName" name="Docs guide" v-for="(d, index) in list" :key="d.deptName">
-					<view :class="{ active: index == current }" v-for="(i, index) in d.children" :key="i.deptName" class="item" @click="selected(i, index)">{{ i.deptName }}</view>
+			<u-collapse accordion :value="list[0].deptId">
+				<u-collapse-item :title="d.deptName" :name="d.deptId" v-for="(d, index) in list" :key="d.deptName">
+					<view :class="{ active: index == i.current }" v-for="(i, index) in d.children" :key="i.deptName" class="item" @click="selected(i, index)">{{ i.deptName }}</view>
 				</u-collapse-item>
 			</u-collapse>
 		</view>
 		<view class="right">
-			<view class="list">
+			<view class="list" v-if="doctor_list.length > 0">
 				<view v-for="(item, index) in doctor_list" :key="index" class="item" @click="go('/pages/doctor/detail?id=' + item.id)">
-					<image :src="item.avatar ? ip + item.avatar : '../../static/head.png'" mode="aspectFit" class="avatar"></image>
-					<view class="name">{{ item.name }}</view>
+					<image :src="item.avatar ? ip + item.avatar : '../../static/head.png'" mode="scaleToFill" class="avatar"></image>
+					<view class="con">
+						<view class="name">{{ item.name }}</view>
+						<view class="brief ellip">{{ item.brief }}</view>
+					</view>
 				</view>
 			</view>
+			<u-empty v-else></u-empty>
 		</view>
 	</view>
 </template>
@@ -24,8 +28,7 @@ export default {
 		return {
 			ip: this.http.ip,
 			doctor_list: {},
-			current: -1,
-			list: []
+			list: [{ deptId: 0 }]
 		};
 	},
 	onLoad(e) {
@@ -37,11 +40,16 @@ export default {
 				url: '/app/department/list',
 				success: (res) => {
 					this.list = res.data.data;
+					this.selected(this.list[0].children[0], 0);
 				}
 			});
 		},
+		open() {
+			this.current = -1;
+		},
 		selected(item, index) {
-			this.current = index;
+			this.list.flatMap((i) => i.children).forEach((j) => (j.current = -1));
+			item.current = index;
 			this.http.request({
 				url: '/app/doctor/list',
 				data: { deptId: item.deptId },