Bladeren bron

feat: 优化导航栏组件,添加输入框组件并调整评论逻辑

EvilDragon 3 maanden geleden
bovenliggende
commit
0660e1b78c
2 gewijzigde bestanden met toevoegingen van 15 en 3 verwijderingen
  1. 9 3
      packages/app/src/components/navbar-evo.vue
  2. 6 0
      packages/app/src/pages/home/moment/index.vue

+ 9 - 3
packages/app/src/components/navbar-evo.vue

@@ -1,7 +1,15 @@
 <script lang="ts" setup>
 import { ConfigProviderThemeVars } from 'wot-design-uni'
 import { useRouter } from '../core/utils/router'
-import { type CSSProperties, computed, getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue'
+import {
+  type CSSProperties,
+  computed,
+  getCurrentInstance,
+  nextTick,
+  onMounted,
+  ref,
+  watch,
+} from 'vue'
 
 const props = withDefaults(
   defineProps<{
@@ -27,8 +35,6 @@ const handleToHome = () => {
   uni.reLaunch({ url: '/pages/home/index' })
 }
 onMounted(() => {
-  console.log(1111);
-  
   // console.log(slots.prepend)
   // getCurrentPages()
   // console.log(getCurrentPages())

+ 6 - 0
packages/app/src/pages/home/moment/index.vue

@@ -29,6 +29,7 @@ import NavBarEvo from '@/components/navbar-evo.vue'
 import { useRouter } from '../../../core/utils/router'
 import { usePermissions } from '../../../composables/permissions'
 import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html.vue'
+import WdInput from 'wot-design-uni/components/wd-input/wd-input.vue'
 
 const { features } = usePermissions()
 const userStore = useUserStore()
@@ -36,6 +37,8 @@ const { userInfo } = storeToRefs(userStore)
 const router = useRouter()
 const id = ref()
 const isShared = ref(false)
+const commeentRef = ref<InstanceType<typeof WdInput>>()
+const focus = ref(false)
 const { data, run } = useRequest(() => getCircle(id.value), { initialData: {} })
 const { data: reviews, run: runGetReviews } = useRequest(
   () => getCircleReviews({ circleId: id.value }),
@@ -228,6 +231,7 @@ onShareAppMessage(async ({ from, target }) => {
             </div>
             <div
               class="ml-1.5 text-[#2f4471]/90 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]"
+              @click="focus = true"
             >
               点击评论~
             </div>
@@ -239,11 +243,13 @@ onShareAppMessage(async ({ from, target }) => {
       <div class="bg-white flex items-center">
         <div class="w-[168px] bg-[#f6f6f6] rounded-[60px] px-3.5 py-2 flex items-center">
           <wd-input
+            ref="commeentRef"
             custom-class="bg-transparent!"
             no-border
             confirm-type="send"
             v-model="reviewContent"
             placeholder="说点什么..."
+            :focus="focus"
             :cursor-spacing="140"
             @confirm="handleSend"
           ></wd-input>