feng_ting-ting 1 周之前
父節點
當前提交
d7aae4ea26
共有 8 個文件被更改,包括 117 次插入25 次删除
  1. 5 0
      pages.json
  2. 70 4
      pages/index.vue
  3. 33 11
      pages/mine/index.vue
  4. 1 7
      pages/mine/info/index.vue
  5. 1 2
      pages/mine/xiao/index.vue
  6. 5 0
      store/modules/user.js
  7. 1 0
      utils/constant.js
  8. 1 1
      utils/storage.js

+ 5 - 0
pages.json

@@ -20,6 +20,11 @@
       "navigationBarTitleText": "发现"
     }
   }, {
+    "path": "pages/search/index",
+    "style": {
+      "navigationBarTitleText": "搜索"
+    }
+  }, {
     "path": "pages/faxian/index",
     "style": {
       "navigationBarTitleText": "消息"

+ 70 - 4
pages/index.vue

@@ -4,8 +4,8 @@
     <view class="nav-bar">
       <text class="nav-title">小鹅通</text>
       <view class="nav-icons">
-        <view class="iconfont1 icon-sousuo icon"></view>
-        <view class="iconfont1 icon-rili icon"></view>
+        <view class="iconfont1 icon-sousuo icon" @click="handleSearch"></view>
+        <view class="iconfont1 icon-rili icon" @click="showCalendarDrawer"></view>
       </view>
     </view>
     <!-- 仿日历形状的框 -->
@@ -22,13 +22,48 @@
     </view>
     <!-- 新增提示文字 -->
     <text class="no-course-tip">找不到已购课程?</text>
+
+    <!-- 右侧抽屉 -->
+    <view 
+      class="calendar-drawer" 
+      :style="{ right: showDrawer ? '0' : '-300px' }"
+      v-if="showDrawer"
+      @click.self="closeCalendarDrawer"
+    >
+      <view class="drawer-header">
+        <view class="close-btn" @click="closeCalendarDrawer">×</view>
+      </view>
+      <!-- 这里可以添加实时日历组件 -->
+      <view class="real-time-calendar">
+        <!-- 实时日历内容 -->
+        实时日历内容
+      </view>
+    </view>
   </view>
 </template>
 
 <script>
 export default {
-  
-}
+  data() {
+    return {
+      showDrawer: false
+    };
+  },
+  methods: {
+    handleSearch() {
+      // 假设搜索页面路径为 /pages/search/index,可根据实际情况修改
+      uni.navigateTo({
+        url: '/pages/search/index'
+      });
+    },
+    showCalendarDrawer() {
+      this.showDrawer = true;
+    },
+    closeCalendarDrawer() {
+      this.showDrawer = false;
+    }
+  }
+};
 </script>
 
 <style scoped>
@@ -129,4 +164,35 @@ export default {
     text-align: center; /* 文字居中 */
     margin-top: 10px; /* 与上方框的间距,可根据需求调整 */
   }
+
+/* 右侧抽屉样式 */
+.calendar-drawer {
+  position: fixed;
+  top: 0;
+  right: -300px;
+  width: 300px;
+  height: 100vh;
+  background-color: white;
+  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
+  transition: right 0.3s ease;
+  z-index: 999;
+}
+
+.real-time-calendar {
+  padding: 20px;
+}
+
+/* 抽屉头部样式 */
+.drawer-header {
+  display: flex;
+  justify-content: flex-end;
+  padding: 10px;
+}
+
+/* 关闭按钮样式 */
+.close-btn {
+  font-size: 24px;
+  cursor: pointer;
+  padding: 5px;
+}
 </style>

+ 33 - 11
pages/mine/index.vue

@@ -3,25 +3,27 @@
     <!--顶部个人信息栏-->
     <view class="header-section">
       <view class="flex padding justify-between">
-        <view class="flex align-center">
+        <!-- 修改为横向排列 -->
+        <view class="flex align-center"> 
           <view v-if="!avatar" class="cu-avatar xl round bg-white">
             <view class="iconfont icon-people text-gray icon"></view>
           </view>
           <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
           </image>
-          <view v-if="!name" @click="handleToLogin" class="login-tip">
-            点击登录
-          </view>
-          <view v-if="name" @click="handleToInfo" class="user-info">
-            <view class="u_title">
-              用户名:{{ name }}
+          <!-- 电话号码和个人信息部分 -->
+          <view v-if="name || !name" class="user-info flex flex-column ml-2"> 
+            <view v-if="!name" @click="handleToLogin" class="login-tip">
+              点击登录
+            </view>
+            <view v-if="name" class="u_title">
+              {{ 19030623072  }}
+            </view>
+            <view v-if="name" @click="handleToInfo" class="flex align-center mt-1"> 
+              <text>个人信息</text>
+              <view class="iconfont icon-right"></view>
             </view>
           </view>
         </view>
-        <view @click="handleToInfo" class="flex align-center">
-          <text>个人信息</text>
-          <view class="iconfont icon-right"></view>
-        </view>
       </view>
     </view>
 
@@ -210,3 +212,23 @@
     }
   }
 </style>
+
+<style lang="scss" scoped>
+  .user-info {
+    display: flex;
+    flex-direction: column; // 确保垂直排列
+    justify-content: center; // 垂直居中
+  }
+
+  .u_title {
+    // 可以根据需要调整字体样式
+    font-size: 18px;
+    line-height: 1.2; 
+  }
+
+  // 个人信息部分的样式
+  .flex align-center.mt-1 {
+    // 可以根据需要调整间距
+    margin-top: 4px; 
+  }
+</style>

+ 1 - 7
pages/mine/info/index.vue

@@ -4,8 +4,6 @@
       <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
       <uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
       <uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
-      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
-      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
       <uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
     </uni-list>
   </view>
@@ -17,9 +15,7 @@
   export default {
     data() {
       return {
-        user: {},
-        roleGroup: "",
-        postGroup: ""
+        user: {}
       }
     },
     onLoad() {
@@ -29,8 +25,6 @@
       getUser() {
         getUserProfile().then(response => {
           this.user = response.data
-          this.roleGroup = response.roleGroup
-          this.postGroup = response.postGroup
         })
       }
     }

+ 1 - 2
pages/mine/xiao/index.vue

@@ -1,7 +1,6 @@
 <template>
   <view class="about-container">
     <view class="header-section text-center">
-      </image>
       <uni-title type="h4" title="了解小鹅通"></uni-title>
     </view>
 
@@ -17,7 +16,7 @@
       </view>
     </view>
 
-  </view>
+ 
 </template>
 
 <script>

+ 5 - 0
store/modules/user.js

@@ -13,6 +13,7 @@ const user = {
     token: getToken(),
     id: storage.get(constant.id),
     name: storage.get(constant.name),
+    phone: storage.get(constant.phone),
     avatar: storage.get(constant.avatar),
     roles: storage.get(constant.roles),
     permissions: storage.get(constant.permissions)
@@ -30,6 +31,10 @@ const user = {
       state.name = name
       storage.set(constant.name, name)
     },
+    SET_PHONE: (state, phone) => {
+      state.phone = phone
+      storage.set(constant.phone, phone)
+    },
     SET_AVATAR: (state, avatar) => {
       state.avatar = avatar
       storage.set(constant.avatar, avatar)

+ 1 - 0
utils/constant.js

@@ -2,6 +2,7 @@ const constant = {
   avatar: 'user_avatar',
   id: 'user_id',
   name: 'user_name',
+  phone: 'phonenumber',
   roles: 'user_roles',
   permissions: 'user_permissions'
  }

+ 1 - 1
utils/storage.js

@@ -4,7 +4,7 @@ import constant from './constant'
 let storageKey = 'storage_data'
 
 // 存储节点变量名
-let storageNodeKeys = [constant.avatar, constant.id, constant.name, constant.roles, constant.permissions]
+let storageNodeKeys = [constant.avatar, constant.id, constant.name, constant.phone, constant.roles, constant.permissions]
 
 const storage = {
   set: function(key, value) {