Browse Source

refactor(tabbar): 移除发布页面,新增个人动态页面

EvilDragon 5 months ago
parent
commit
f6133a85d5

+ 6 - 0
src/assets/svgs/phone.svg

@@ -0,0 +1,6 @@
+<svg width="85" height="32" viewBox="0 0 85 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="68.8529" cy="15.8529" r="15.8529" fill="#F2F2F2"/>
+<path d="M76.3275 15.0873C73.688 15.0873 71.1773 16.1131 69.4207 17.8994V12.001H71.1773C71.3245 12.001 71.4716 11.9479 71.5728 11.8595C71.6831 11.7622 71.7475 11.6296 71.7475 11.4969C71.7475 11.3908 71.7107 11.2847 71.6464 11.1963L68.7402 7.46448C68.6574 7.34952 68.5103 7.26993 68.3631 7.25224C68.216 7.23456 68.0504 7.26109 67.9309 7.34952C67.8757 7.37605 67.8297 7.42911 67.8021 7.46448L64.8775 11.1963C64.7028 11.435 64.758 11.7446 65.0155 11.9126C65.1167 11.9833 65.227 12.0099 65.3466 12.001H67.1032V23.3114H69.4023C69.4207 21.6577 70.1657 20.0748 71.4624 18.9163C72.7592 17.7579 74.5158 17.1123 76.3275 17.1389C76.9529 17.1389 77.4587 16.679 77.4587 16.1042C77.4587 15.5294 76.9529 15.0873 76.3275 15.0873Z" fill="black"/>
+<circle cx="15.8529" cy="15.8529" r="15.8529" fill="#F2F2F2"/>
+<path d="M15.2791 17.2874C14.0119 16.0203 12.8353 14.5721 13.3784 14.029C14.2382 13.1692 14.9623 12.6714 13.5141 10.8611C12.0659 9.05092 11.0703 10.4086 10.301 11.2232C9.39586 12.1283 10.2557 15.5677 13.6499 18.9619C17.0441 22.3561 20.4382 23.2159 21.3886 22.3108C22.2032 21.4962 23.5609 20.5459 21.7506 19.0977C19.9404 17.6495 19.4426 18.3736 18.628 19.1882C17.9944 19.7313 16.5463 18.5093 15.2791 17.2874Z" fill="black"/>
+</svg>

+ 6 - 0
src/assets/svgs/route.svg

@@ -0,0 +1,6 @@
+<svg width="85" height="32" viewBox="0 0 85 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="68.8529" cy="15.8529" r="15.8529" fill="#F2F2F2"/>
+<path d="M76.3275 15.0873C73.688 15.0873 71.1773 16.1131 69.4207 17.8994V12.001H71.1773C71.3245 12.001 71.4716 11.9479 71.5728 11.8595C71.6831 11.7622 71.7475 11.6296 71.7475 11.4969C71.7475 11.3908 71.7107 11.2847 71.6464 11.1963L68.7402 7.46448C68.6574 7.34952 68.5103 7.26993 68.3631 7.25224C68.216 7.23456 68.0504 7.26109 67.9309 7.34952C67.8757 7.37605 67.8297 7.42911 67.8021 7.46448L64.8775 11.1963C64.7028 11.435 64.758 11.7446 65.0155 11.9126C65.1167 11.9833 65.227 12.0099 65.3466 12.001H67.1032V23.3114H69.4023C69.4207 21.6577 70.1657 20.0748 71.4624 18.9163C72.7592 17.7579 74.5158 17.1123 76.3275 17.1389C76.9529 17.1389 77.4587 16.679 77.4587 16.1042C77.4587 15.5294 76.9529 15.0873 76.3275 15.0873Z" fill="black"/>
+<circle cx="15.8529" cy="15.8529" r="15.8529" fill="#F2F2F2"/>
+<path d="M15.2791 17.2874C14.0119 16.0203 12.8353 14.5721 13.3784 14.029C14.2382 13.1692 14.9623 12.6714 13.5141 10.8611C12.0659 9.05092 11.0703 10.4086 10.301 11.2232C9.39586 12.1283 10.2557 15.5677 13.6499 18.9619C17.0441 22.3561 20.4382 23.2159 21.3886 22.3108C22.2032 21.4962 23.5609 20.5459 21.7506 19.0977C19.9404 17.6495 19.4426 18.3736 18.628 19.1882C17.9944 19.7313 16.5463 18.5093 15.2791 17.2874Z" fill="black"/>
+</svg>

+ 4 - 0
src/core/libs/svgs.ts

@@ -26,6 +26,8 @@ import publish from '@/assets/svgs/publish.svg'
 import order from '@/assets/svgs/order.svg'
 import close from '@/assets/svgs/close.svg'
 import materialDealers from '@/assets/svgs/material-dealers.svg'
+import phone from '@/assets/svgs/phone.svg'
+import route from '@/assets/svgs/route.svg'
 export {
   polygon16,
   frame,
@@ -55,4 +57,6 @@ export {
   order,
   close,
   materialDealers,
+  phone,
+  route,
 }

+ 1 - 1
src/layouts/default.vue

@@ -13,7 +13,7 @@ const themeVars: ConfigProviderThemeVars = {
 </script>
 <template>
   <wd-config-provider class="flex-grow flex flex-col" style="flex-grow: 1" :themeVars="themeVars">
-    <view class="bg-[#f6f6f6] flex-grow flex">
+    <view class="bg-[#f6f6f6] flex-grow flex flex-col">
       <slot />
     </view>
     <wd-toast />

+ 5 - 1
src/layouts/tabbar.vue

@@ -62,6 +62,10 @@ const handleTabbarItemClick = (path: string) => {
   }
   uni.switchTab({ url: path })
 }
+const toPublishMoment = () => {
+  uni.navigateTo({ url: '/pages/publish/moment/index' })
+  publishState.value = false
+}
 </script>
 
 <template>
@@ -89,7 +93,7 @@ const handleTabbarItemClick = (path: string) => {
         </div>
         <div class="flex flex-col">
           <div class="flex justify-around">
-            <div class="flex flex-col items-center">
+            <div class="flex flex-col items-center" @click="toPublishMoment">
               <wd-img :src="iconCamera" width="66" mode="widthFix"></wd-img>
               <div class="text-black text-sm font-normal font-['PingFang SC'] leading-[21px]">
                 个人动态

+ 8 - 9
src/pages.json

@@ -109,15 +109,6 @@
       }
     },
     {
-      "path": "pages/publish/index",
-      "type": "page",
-      "layout": "tabbar",
-      "style": {
-        "navigationBarTitleText": "发布",
-        "navigationStyle": "custom"
-      }
-    },
-    {
       "path": "pages/home/classmates/index",
       "type": "page",
       "style": {
@@ -219,6 +210,14 @@
         "navigationBarBackgroundColor": "#fff",
         "navigationBarTitleText": "推荐材料商"
       }
+    },
+    {
+      "path": "pages/publish/moment/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "个人动态",
+        "navigationBarBackgroundColor": "#fff"
+      }
     }
   ],
   "subPackages": []

+ 2 - 2
src/pages/material/index.vue

@@ -7,7 +7,7 @@ import Card from '@/components/card.vue'
 import SectionHeading from '@/components/section-heading.vue'
 import { abc, calculator, treaty } from '@/core/libs/pngs'
 import { getMaterialDealers } from '@/core/libs/requests'
-import { materialDealers, close } from '@/core/libs/svgs'
+import { materialDealers, close, phone } from '@/core/libs/svgs'
 
 const { data, run } = useRequest(getMaterialDealers)
 const dealerPanelState = ref(false)
@@ -165,7 +165,7 @@ onMounted(() => {
                   </div>
                 </div>
                 <wd-button type="text" size="small" custom-class=" bg-[#f2f2f2]! p-0! ml-4">
-                  <wd-img width="28" height="28"></wd-img>
+                  <wd-img width="28" height="28" :src="phone"></wd-img>
                 </wd-button>
                 <wd-button type="text" size="small" custom-class=" bg-[#f2f2f2]! p-0! ml-4">
                   <wd-img width="28" height="28"></wd-img>

+ 0 - 11
src/pages/publish/index.vue

@@ -1,11 +0,0 @@
-<route lang="json5">
-{ layout: 'tabbar', style: { navigationBarTitleText: '发布', navigationStyle: 'custom' } }
-</route>
-
-<script setup lang="ts"></script>
-
-<template>
-  <view></view>
-</template>
-
-<style scoped lang="scss"></style>

+ 44 - 0
src/pages/publish/moment/index.vue

@@ -0,0 +1,44 @@
+<route lang="yaml">
+style:
+  navigationBarTitleText: 个人动态
+  navigationBarBackgroundColor: '#fff'
+</route>
+<script setup lang="ts">
+import SectionHeading from '@/components/section-heading.vue'
+
+const value = ref('')
+const fileList = ref([])
+const action = ref('')
+const handleChange = (e: any) => {
+  console.log(e)
+}
+</script>
+<template>
+  <div class="flex-grow bg-white p-3.5 flex flex-col">
+    <wd-textarea v-model="value" placeholder="分享你此刻的想法" />
+    <!-- <div class="flex items-center">
+      <img
+        class="w-[100px] h-[100px] rounded-lg overflow-hidden"
+        src="https://via.placeholder.com/100x100"
+      />
+      <div class="w-[100px] h-[100px] bg-[#f3f3f3] justify-center items-center inline-flex">
+        <div class="w-7 h-7 relative flex-col justify-start items-start flex"></div>
+      </div>
+    </div> -->
+    <wd-upload
+      :file-list="fileList"
+      image-mode="aspectFill"
+      :action="action"
+      @change="handleChange"
+    ></wd-upload>
+    <SectionHeading
+      title="标签"
+      custom-class="my-6"
+      path="/pages/publish/tags/index"
+    ></SectionHeading>
+    <div class="flex-1"></div>
+    <div class="w-full">
+      <wd-button type="primary" :round="false" block>发布</wd-button>
+    </div>
+  </div>
+</template>

+ 2 - 2
src/types/uni-pages.d.ts

@@ -10,7 +10,6 @@ interface NavigateToOptions {
        "/pages/material/index" |
        "/pages/messages/index" |
        "/pages/mine/index" |
-       "/pages/publish/index" |
        "/pages/home/classmates/index" |
        "/pages/home/classmates-detail/index" |
        "/pages/home/mall/index" |
@@ -23,7 +22,8 @@ interface NavigateToOptions {
        "/pages/home/study-tour/list" |
        "/pages/material/calculator/index" |
        "/pages/material/detail/index" |
-       "/pages/material/recommend/index";
+       "/pages/material/recommend/index" |
+       "/pages/publish/moment/index";
 }
 interface RedirectToOptions extends NavigateToOptions {}