lsw 9 місяців тому
батько
коміт
df54da44c9

+ 9 - 7
app/pages/department/index.vue

@@ -1,16 +1,15 @@
 <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="contents">
 				<u-divider :text="item.deptName + '介绍'" v-if="item.deptName"></u-divider>
-				<image src="https://omo-oss-image.thefastimg.com/portal-saas/new2022102818501904409/cms/image/29a676ec-abc2-48fe-8657-ce8f05f8ceb2.jpg" mode="widthFix" style="width: 100%;height: 150px;" v-else></image>
 				<u-parse :content="item.brief"></u-parse>
 			</view>
 		</view>
@@ -22,8 +21,7 @@ export default {
 	data() {
 		return {
 			item: {},
-			current: -1,
-			list: []
+			list: [{ deptId: 0 }]
 		};
 	},
 	onLoad(e) {
@@ -35,11 +33,15 @@ export default {
 				url: '/app/department/list',
 				success: (res) => {
 					this.list = res.data.data;
+					if (this.list.length > 0 && this.list[0].children.length > 0) {
+						this.selected(this.list[0].children[0], 0);
+					}
 				}
 			});
 		},
 		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/department/detail/' + item.deptId,
 				success: (res) => {

+ 3 - 1
app/pages/doctor/index.vue

@@ -40,7 +40,9 @@ export default {
 				url: '/app/department/list',
 				success: (res) => {
 					this.list = res.data.data;
-					this.selected(this.list[0].children[0], 0);
+					if (this.list.length > 0 && this.list[0].children.length > 0) {
+						this.selected(this.list[0].children[0], 0);
+					}
 				}
 			});
 		},

+ 5 - 2
app/pages/knowledge/index.vue

@@ -99,13 +99,15 @@ export default {
 <style lang="scss">
 .list {
 	padding: 10px 12px;
+	background-color: white;
+	margin: 10px;
+	border-radius: 10px;
 	.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;
+		border-bottom: 1px solid $line;
 		.title {
 			font-size: 15px;
 			font-weight: bold;
@@ -117,6 +119,7 @@ export default {
 		.desc {
 			font-size: 14px;
 			padding-top: 10px;
+			color: $font-c;
 			text {
 				padding-right: 30px;
 			}