فهرست منبع

Updated Dashboard UI, add Header Searchbar

Nivek 2 سال پیش
والد
کامیت
2e36dcea73
3فایلهای تغییر یافته به همراه117 افزوده شده و 21 حذف شده
  1. 88 7
      src/components/Dashboard.vue
  2. 29 13
      src/components/Header.vue
  3. 0 1
      src/style.css

+ 88 - 7
src/components/Dashboard.vue

@@ -3,6 +3,8 @@
 
   const name = ref('haha')
 
+  const address = ref('江苏省南京市栖霞区仙林大道163号')
+
 </script>
 
 <template>
@@ -16,19 +18,88 @@
 
   </div>
 
-  <div class="flex items-center justify-center p-8 h-full overflow-y-clip">
-    <el-aside width="20%" class="mr-5 h-full bg-gray-100  rounded-lg flex flex-col items-center justify-between">
+  <div class="flex items-center justify-center p-8 h-full overflow-y-clip space-x-5">
+    <el-aside width="20%" class="h-full bg-gray-100  rounded-lg flex flex-col items-center justify-between">
 
-      <div class="h-1/3 w-full flex items-center justify-center border-b-2 border-gray-200">
+      <div class="py-6 h-1/2 w-full flex flex-col space-y-6 items-center justify-center border-b-2 border-gray-200">
         <el-avatar :size="150" class="block">
           <span class="text-3xl"> 头像 </span>
         </el-avatar>
+
+        <label class="w-2/5 px-3 py-2 text-center bg-primary-400 rounded-3xl text-white">顾客</label>
       </div>
 
-      <div class="bg-gray-50 h-2/3 w-full flex flex-col items-center justify-center shadow-md space-y-20">
-        <span class="w-full text-4xl text-center">用户名</span>
-        <span class="w-full text-2xl text-center">电话</span>
-        <span class="w-full text-2xl text-center">邮箱</span>
+
+      <div class="bg-gray-50 px-3 py-4 overflow-y-auto h-full w-full flex flex-col items-center justify-center shadow-md space-y-20">
+
+          <ul class="space-y-3 font-medium">
+            <li>
+              <router-link to="" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
+                <svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
+                  <path d="m17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z"/>
+                </svg>
+                <span class="flex-1 ms-3 whitespace-nowrap">私聊信箱</span>
+<!--                <span class="inline-flex items-center justify-center w-3 h-3 p-3 ms-3 text-sm font-medium text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300">-->
+<!--                  3-->
+<!--                </span>-->
+              </router-link>
+            </li>
+
+
+            <li>
+              <router-link to="" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
+                <svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 18 20">
+                  <path d="M17 5.923A1 1 0 0 0 16 5h-3V4a4 4 0 1 0-8 0v1H2a1 1 0 0 0-1 .923L.086 17.846A2 2 0 0 0 2.08 20h13.84a2 2 0 0 0 1.994-2.153L17 5.923ZM7 9a1 1 0 0 1-2 0V7h2v2Zm0-5a2 2 0 1 1 4 0v1H7V4Zm6 5a1 1 0 1 1-2 0V7h2v2Z"/>
+                </svg>
+                <span class="flex-1 ms-3 whitespace-nowrap">已收藏商品</span>
+              </router-link>
+            </li>
+
+            <li>
+              <router-link to="" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
+                <svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 16">
+                  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 8h11m0 0L8 4m4 4-4 4m4-11h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-3"/>
+                </svg>
+                <span class="flex-1 ms-3 whitespace-nowrap">关注店铺</span>
+              </router-link>
+            </li>
+
+          </ul>
+
+
+          <ul class="pt-4 mt-4 space-y-3 font-medium border-t border-gray-200">
+
+
+            <li>
+              <router-link to="" class="flex items-center p-2 text-gray-900 transition duration-75 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white group">
+                <svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 20">
+                  <path d="M16 14V2a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 0 0 0-2h-1v-2a2 2 0 0 0 2-2ZM4 2h2v12H4V2Zm8 16H3a1 1 0 0 1 0-2h9v2Z"/>
+                </svg>
+                <span class="ms-3">使用帮助</span>
+              </router-link>
+            </li>
+
+            <li>
+              <router-link to="" class="flex items-center p-2 text-gray-900 transition duration-75 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white group">
+                <svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 21 21">
+                  <path d="m5.4 2.736 3.429 3.429A5.046 5.046 0 0 1 10.134 6c.356.01.71.06 1.056.147l3.41-3.412c.136-.133.287-.248.45-.344A9.889 9.889 0 0 0 10.269 1c-1.87-.041-3.713.44-5.322 1.392a2.3 2.3 0 0 1 .454.344Zm11.45 1.54-.126-.127a.5.5 0 0 0-.706 0l-2.932 2.932c.029.023.049.054.078.077.236.194.454.41.65.645.034.038.078.067.11.107l2.927-2.927a.5.5 0 0 0 0-.707Zm-2.931 9.81c-.024.03-.057.052-.081.082a4.963 4.963 0 0 1-.633.639c-.041.036-.072.083-.115.117l2.927 2.927a.5.5 0 0 0 .707 0l.127-.127a.5.5 0 0 0 0-.707l-2.932-2.931Zm-1.442-4.763a3.036 3.036 0 0 0-1.383-1.1l-.012-.007a2.955 2.955 0 0 0-1-.213H10a2.964 2.964 0 0 0-2.122.893c-.285.29-.509.634-.657 1.013l-.01.016a2.96 2.96 0 0 0-.21 1 2.99 2.99 0 0 0 .489 1.716c.009.014.022.026.032.04a3.04 3.04 0 0 0 1.384 1.1l.012.007c.318.129.657.2 1 .213.392.015.784-.05 1.15-.192.012-.005.02-.013.033-.018a3.011 3.011 0 0 0 1.676-1.7v-.007a2.89 2.89 0 0 0 0-2.207 2.868 2.868 0 0 0-.27-.515c-.007-.012-.02-.025-.03-.039Zm6.137-3.373a2.53 2.53 0 0 1-.35.447L14.84 9.823c.112.428.166.869.16 1.311-.01.356-.06.709-.147 1.054l3.413 3.412c.132.134.249.283.347.444A9.88 9.88 0 0 0 20 11.269a9.912 9.912 0 0 0-1.386-5.319ZM14.6 19.264l-3.421-3.421c-.385.1-.781.152-1.18.157h-.134c-.356-.01-.71-.06-1.056-.147l-3.41 3.412a2.503 2.503 0 0 1-.443.347A9.884 9.884 0 0 0 9.732 21H10a9.9 9.9 0 0 0 5.044-1.388 2.519 2.519 0 0 1-.444-.348ZM1.735 15.6l3.426-3.426a4.608 4.608 0 0 1-.013-2.367L1.735 6.4a2.507 2.507 0 0 1-.35-.447 9.889 9.889 0 0 0 0 10.1c.1-.164.217-.316.35-.453Zm5.101-.758a4.957 4.957 0 0 1-.651-.645c-.033-.038-.077-.067-.11-.107L3.15 17.017a.5.5 0 0 0 0 .707l.127.127a.5.5 0 0 0 .706 0l2.932-2.933c-.03-.018-.05-.053-.078-.076ZM6.08 7.914c.03-.037.07-.063.1-.1.183-.22.384-.423.6-.609.047-.04.082-.092.129-.13L3.983 4.149a.5.5 0 0 0-.707 0l-.127.127a.5.5 0 0 0 0 .707L6.08 7.914Z"/>
+                </svg>
+                <span class="ms-3">建议与反馈</span>
+              </router-link>
+            </li>
+
+            <li>
+              <router-link to="" class="flex items-center p-2 text-gray-900 transition duration-75 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white group">
+                <svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
+                  <path d="M18 0H6a2 2 0 0 0-2 2h14v12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Z"/>
+                  <path d="M14 4H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM2 16v-6h12v6H2Z"/>
+                </svg>
+                <span class="ms-3">关于我们</span>
+              </router-link>
+            </li>
+
+          </ul>
+
       </div>
 
     </el-aside>
@@ -98,6 +169,16 @@
           </button>
         </div>
 
+        <div class="p-5 flex flex-col">
+<!--          <label for="address" class="block mt-2 mb-2 text-sm font-medium text-gray-900">默认地址</label>-->
+          <textarea id="address" rows="7"
+                    v-model="address"
+                    class="overflow-auto block p-3 w-full text-xl text-gray-900 bg-white rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500" placeholder="中华门"></textarea>
+
+        </div>
+
+
+
       </div>
 
 

+ 29 - 13
src/components/Header.vue

@@ -1,35 +1,51 @@
 <script setup lang="ts">
 import {UserFilled, SwitchButton} from "@element-plus/icons-vue";
+import {ref} from 'vue';
+
+const searchContent = ref('')
+
+function search() {
+  //todo: search
+
+
+}
+
 </script>
 
 <template>
   <div class="bg-primary-500 min-w-full top-0 shadow-md flex-shrink-0 rounded-b-xl">
 
     <div class="mx-4 p-4">
-      <div class="flex items-center justify-between">
 
-        <div class="flex items-center space-x-4">
+      <div class="flex items-center justify-between space-x-4">
+
+        <div class="flex items-center">
           <router-link to="/home" v-slot="{navigate}">
             <h1 @click="navigate" class="text-xl text-white"> 蓝鲸在线购物 </h1>
           </router-link>
-
         </div>
 
-        <form class="w-3/4">
+        <div class="w-3/4">
+          <form>
+            <div class="relative">
 
-          <div class="relative">
+              <!--网上抄的logo-->
+              <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
+                <svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
+                  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
+                </svg>
+              </div>
 
-            <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
-              <svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
-                <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
-              </svg>
+              <input type="search" id="search"
+                     v-model="searchContent"
+                     class="block w-full p-4 ps-10 text-gray-900 border border-gray-300 rounded-3xl bg-gray-50 focus:ring-blue-500 focus:border-blue-500" placeholder="国货好物" required>
+              <button type="submit" @click="search"
+                      class="text-white absolute end-5 bottom-2.5 bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-3xl text-sm px-4 py-2">搜索商品</button>
             </div>
+          </form>
+        </div>
 
-            <input type="search" id="search" class="block w-full p-4 ps-10 text-gray-900 border border-gray-300 rounded-3xl bg-gray-50 focus:ring-blue-500 focus:border-blue-500" placeholder="国货好物" required>
-            <button type="submit" class="text-white absolute end-5 bottom-2.5 bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-3xl text-sm px-4 py-2">搜索商品</button>
-          </div>
 
-        </form>
 
         <div class="flex items-center space-x-4 mx-3">
           <router-link to="/dashboard" v-slot="{navigate}">

+ 0 - 1
src/style.css

@@ -20,5 +20,4 @@ html, body {
   height: 100%;
   display: flex;
   flex-direction: column;
-  overflow: auto;
 }