浏览代码

🎨 修改细节问题

快乐的梦鱼 1 月之前
父节点
当前提交
f2e374f61c

+ 12 - 38
src/pages/chat/dependent/post/publish.vue

@@ -1,6 +1,12 @@
 <template>
-  <CommonTopBanner title="发布微信贴图">
-    <FlexCol padding="space.lg">
+  <CommonTopBanner title="AI帮你写微信贴图">
+    <FlexCol position="relative" padding="space.lg" align="center">   
+      <FlexCol position="absolute" :right="0" :top="0">
+        <PrimaryButton
+          text="发布"
+          @click="publish"
+        />
+      </FlexCol>
       <ProvideVar
         :vars="{
           FieldBackgroundColor: 'transparent',
@@ -14,6 +20,7 @@
           :backgroundCutBorderSize="[50,50,50,50]"
           direction="column"
           gap="gap.md"
+          width="95%"
           :padding="[40, 30]"
         >
           <Uploader 
@@ -28,46 +35,13 @@
             v-model="content" 
             type="text" 
             multiline 
-            placeholder="输入内容(可选)" 
+            placeholder="输入内容(可选)" 
             :maxLength="1000" 
-            rows="20" 
-            :inputStyle="{
-              height: '600rpx',
-            }"
+            rows="4" 
             showWordLimit 
           />
         </BackgroundBox>
       </ProvideVar>
-      <Height :height="50" />
-      <PrimaryButton
-        text="发布"
-        width="500rpx"
-        @click="publish"
-      />
-    </FlexCol>
-    <BackgroundBox 
-      position="fixed" :inset="{ b: 0, l: 0, r: 0 }"
-      backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxLarge.png"
-      :backgroundCutBorder="[50,50,0,50]"
-      :backgroundCutBorderSize="[50,50,0,50]"
-      direction="column"
-      :padding="[20, 10]"
-    >
-      <FlexRow padding="space.md" align="center" justify="space-between">
-        <FlexRow align="center" justify="center">
-          <Button icon="https://xy.wenlvti.net/app_static/images/village/IconAi.png" @click="showAgentPopup = true">AI伴写</Button>
-        </FlexRow>
-        <FlexRow align="center" justify="center">
-          <IconButton
-            icon="setting"
-            width="40rpx"
-            height="40rpx"
-          />
-        </FlexRow>
-      </FlexRow>
-      <XBarSpace />
-    </BackgroundBox>
-    <Popup v-model:show="showAgentPopup" position="bottom" closeable :closeIcon="false" size="60vh" round>
       <Agent 
         v-model:title="title"
         v-model:content="content"
@@ -75,7 +49,7 @@
         @upload="uploader?.pick()"
         @close="showAgentPopup = false" 
       />
-    </Popup>
+    </FlexCol>
   </CommonTopBanner>
 </template>
 

+ 1 - 0
src/pages/home/components/LightMap.vue

@@ -12,6 +12,7 @@
       map-id="prevMap"
       class="light-map-map"
       :enable-poi="false"
+      :show-location="true"
       :scale="12"
       :longitude="lonlat?.longitude"
       :latitude="lonlat?.latitude"

+ 2 - 0
src/pages/home/composeabe/GetCurrentLocation.ts

@@ -46,6 +46,8 @@ export function useGetCurrentLocation(
       longitude: Number(res.point.x),
       latitude: Number(res.point.y),
     };
+    if (isNaN(currentLonlat.value.longitude) || isNaN(currentLonlat.value.latitude))
+      throw new Error('获取模糊定位失败');
     villageStore.setCurrentLonlat(currentLonlat.value);
     villageStore.setCurrentRegion(res.address_detail.district);
     onCityChanged?.(res.address_detail.city);

+ 24 - 3
src/pages/home/index.vue

@@ -1,6 +1,6 @@
 <template>
   <FlexCol>
-    <FlexCol :gap="20" :padding="30" :innerStyle="{
+    <FlexCol :gap="20" :padding="[30,30,0,30]" :innerStyle="{
       marginTop: '-130px',
       backgroundImage: 'url(https://xy.wenlvti.net/app_static/images/home/BannerHomeNew.png)',
       backgroundSize: '100% auto',
@@ -143,7 +143,21 @@
         @goDetails="navTo('/pages/home/village/volunteer/detail', { id: $event.id })"
       />
 
-      <HomeTitle title="精选记忆" />
+      <HomeTitle title="精选记忆">
+        <template #right>
+          <Touchable
+            :padding="[15, 20]"
+            :innerStyle="{ marginRight: '20rpx' }"
+            direction="row"
+            center
+            gap="gap.md"
+            @click="handleGoPublish()"
+          >
+            <Icon name="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png" :size="30" />
+            <Text text="AI帮你写" fontConfig="contentText" />
+          </Touchable>
+        </template>
+      </HomeTitle>
     </FlexCol>
     <OfficialAccountPublishWrap
       topic="亮乡源" 
@@ -211,6 +225,9 @@ import Width from '@/components/layout/space/Width.vue';
 import OfficialAccountPublishWrap from '@/common/components/OfficialAccountPublishWrap.vue';
 import IntroClamTip from './village/dialogs/IntroClamTip.vue';
 import MemoryTimeOut from '@/components/composeabe/MemoryTimeOut';
+import Touchable from '@/components/feedback/Touchable.vue';
+import Icon from '@/components/basic/Icon.vue';
+import Text from '@/components/basic/Text.vue';
 
 const emit = defineEmits(['goVillage']);
 const { onPublishSuccess } = useOfficialAccount();
@@ -288,7 +305,6 @@ const activityLoader = useSimpleDataLoader(async () => {
 });
 
 
-
 watch(currentRegion, async (newVal) => {
   await villageRankListLoader.reload();
   await villageUserRankListLoader.reload();
@@ -325,6 +341,11 @@ function handleGoAI() {
     navTo('/pages/chat/index');
   }, '暂时需要登录后才能使用AI助手');
 }
+async function handleGoPublish() {
+  requireLogin(async () => {
+    navTo('/pages/chat/dependent/post/publish', { tag: '亮乡源' });
+  }, '欢迎使用AI助手,登录后以便使用更多功能哦!');
+}
 async function handleLightVillage() {
   requireLogin(async () => navTo('/pages/home/light/submit-map', { city: currentCity.value }), '登录后才能点亮村社哦!');
 }

+ 1 - 1
src/pages/home/village/index.vue

@@ -136,7 +136,7 @@ onMounted(async () => {
     });
   }
   if (isDevEnv) {
-    tab.value = 'tree';
+    //tab.value = 'tree';
   }
   await waitTimeOut(1000);
   if (villageStore.currentVillage) {

+ 10 - 28
src/pages/home/village/introd/card.vue

@@ -1,5 +1,5 @@
 <template>
-  <FlexCol :padding="30" gap="gap.lg">
+  <FlexCol :padding="[30,30,0,30]" gap="gap.lg">
 
     <!-- 卡片背景 -->
     <BackgroundBox 
@@ -197,20 +197,17 @@
     <!-- 文脉乡源 -->
     <HomeTitle title="文脉乡源">
       <template #right>
-        <BackgroundImageButton 
-          backgroundImage="https://xy.wenlvti.net/app_static/images/village/TagActive.png"
-          :backgroundCutBorder="[10, 10, 10, 10]"
-          :backgroundCutBorderSize="[10, 10, 10, 10]"
+        <Touchable
           :padding="[15, 20]"
           :innerStyle="{ marginRight: '20rpx' }"
           direction="row"
           center
-          gap="gap.sm"
+          gap="gap.md"
           @click="handleGoPublish()"
         >
           <Icon name="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png" :size="30" />
-          <Text text="去发布" fontConfig="contentText" color="white" />
-        </BackgroundImageButton>
+          <Text text="AI帮你写" fontConfig="contentText" />
+        </Touchable>
       </template>
     </HomeTitle>
     <RoundTags v-model:active="listActiveTag" :tags="['广场', '老味道', '老手艺', '老物件', '老故事']" />
@@ -360,27 +357,12 @@ function handleGoCollect(collectModuleId?: number, title?: string) {
   });
 }
 function handleGoPublish() {
-  if (!authStore.isLogged) {
-    confirm({
-      title: '提示',
-      content: '登录后就可以发布村社贴图了',
-      confirmText: '去登录',
-    }).then((res) => {
-      if (res) {
-        navTo('/pages/user/login');
-      }
+  requireLogin(async () => {
+    navTo('/pages/chat/dependent/post/publish', {
+      tag: recommendTagName.value,
+      villageId: villageStore.currentVillage?.id ?? undefined,
     });
-    return;
-  }
-  navTo('/pages/chat/dependent/post/publish', {
-    tag: listActiveTag.value,
-    villageId: villageStore.currentVillage?.id ?? undefined,
-  });
-}
-function handleGoPost(id: number) {
-  navTo('/pages/home/post/detail', {
-    id: id,
-  });
+  }, '欢迎使用AI助手,登录后以便使用更多功能哦!');
 }
 
 watch(() => villageStore.currentVillage, () => {

+ 3 - 2
src/pages/index.vue

@@ -88,7 +88,8 @@ onShareTimeline(() => {
   }
 })
 onMounted(() => {
-  if (isDevEnv)
-    tabIndex.value = 1;
+  if (isDevEnv) {
+    //tabIndex.value = 1;
+  }
 })
 </script>