diff --git a/pages/home/admissions/index.vue b/pages/home/admissions/index.vue index 1829c3c..080e8d8 100644 --- a/pages/home/admissions/index.vue +++ b/pages/home/admissions/index.vue @@ -8,16 +8,29 @@ @click="handleLeftClick" > - 招办在线 + 在线咨询
+ + + + {{ tab.name }} + + + + @@ -32,9 +45,9 @@ {{ teacher.department }} - {{ - teacher.online ? "立即提问" : "留言" - }} + + 立即提问 + @@ -58,6 +71,11 @@ export default { }, data() { return { + activeTab: "1", // 当前激活的tab + tabList: [ + { id: "1", name: "招生在线", key: "admissions" }, + { id: "2", name: "迎新在线", key: "welcome" }, + ], showLeaveMessage: false, teacherList: [ { @@ -89,10 +107,41 @@ export default { online: false, }, ], + welcomeList: [ + { + id: 5, + name: "李老师", + department: "学生处", + avatar: "/static/common/images/avatar.png", + online: true, + }, + { + id: 6, + name: "张老师", + department: "宿管中心", + avatar: "/static/common/images/student.png", + online: true, + }, + { + id: 7, + name: "迎新办陈老师", + department: "后勤服务中心", + avatar: "/static/common/images/student.png", + online: false, + }, + ], currentTeacher: null, }; }, + computed: { + currentList() { + return this.activeTab === "1" ? this.teacherList : this.welcomeList; + }, + }, methods: { + switchTab(tab) { + this.activeTab = tab; + }, handleLeftClick() { uni.navigateBack(); }, @@ -159,6 +208,44 @@ export default { } .admissions-content { + .custom-tab { + padding: 0 30rpx; + margin: 24rpx 0; + display: flex; + align-items: center; + + .tab-item { + position: relative; + padding: 12rpx 0; + margin-right: 60rpx; + cursor: pointer; + + .tab-text { + font-size: 32rpx; + font-weight: 500; + color: #505866; + letter-spacing: 0.04rpx; + } + + &.active .tab-text { + color: #4f6aff; + font-weight: 600; + } + + .tab-underline { + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + right: 0; + width: 80rpx; + height: 4rpx; + background-color: #4f6aff; + border-radius: 2rpx; + } + } + } + .teacher-list { .teacher-item { display: flex; diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index 8a15070..f76fdd6 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -19,7 +19,7 @@ > - - -