Explorar el Código

🎨 优化细节

快乐的梦鱼 hace 1 mes
padre
commit
89b646cc42

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

@@ -141,6 +141,7 @@ watch(() => villageStore.currentVillage, (newVal) => {
     if (topTab.value === 'around')
       topTab.value = 'village';
   }
+  tab.value = 'card';
 });
 
 onMounted(async () => {

+ 1 - 1
src/pages/home/village/introd/card.vue

@@ -68,7 +68,7 @@
         v-if="villageInfoLoader.content.value"
         ref="villageGalleryRef"
         :villageId="villageStore.currentVillage?.id ?? 0" 
-        @goGallery=""
+        @goGallery="handleGoGallery"
       />
 
       <!-- 地址 -->

+ 7 - 7
src/pages/home/village/introd/tree.vue

@@ -163,6 +163,7 @@ import TreeApi, { type BlessPackageItem, type GrowthLogFeedItem } from '@/api/li
 import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
 import BlessBuyDialog from '../dialogs/BlessBuyDialog.vue';
 import BlessSuccessDialog from '../dialogs/BlessSuccessDialog.vue';
+import { toast } from '@/components/utils/DialogAction.js';
 
 const GROWTH_FEED_COUNT = 6;
 const DEFAULT_AVATAR = 'https://xy.wenlvti.net/app_static/images/village/PlaceholderVolunteer.png';
@@ -335,26 +336,25 @@ async function handlePickOrWaterOrFertilize(action: 'pick' | 'water' | 'fertiliz
     uni.showLoading({
       title: '请稍后...',
     });
-    let res = '';
     switch (action) {
       case 'pick':
-        res = await TreeApi.pick(villageStore.currentVillage.id);
+        const res = await TreeApi.pick(villageStore.currentVillage.id);
         villageTreeRef.value?.playStateAnimation('collect');
+        toast(res);
         break;
       case 'water':
-        res = await TreeApi.water(villageStore.currentVillage.id);
+        await TreeApi.water(villageStore.currentVillage.id);
         villageTreeRef.value?.playStateAnimation('water');
+        toast('浇水成功!感谢您的贡献');
         break;
       case 'fertilize':
-        res = await TreeApi.fertilize(villageStore.currentVillage.id);
+         await TreeApi.fertilize(villageStore.currentVillage.id);
         villageTreeRef.value?.playStateAnimation('fertilize');
+        toast('施肥成功!感谢您的贡献');
         break;
     }
     refreshVillageTreeInfo();
     uni.hideLoading();
-    uni.showToast({
-      title: res,
-    });
   } catch (e) {
     uni.hideLoading();
     console.log(e);

+ 1 - 1
src/pages/home/village/volunteer/detail.vue

@@ -27,7 +27,7 @@
             </FlexRow>
             <Divider />
             <FlexRow align="center" gap="gap.md">
-              <Text text="贡献乡源光" fontConfig="contentText" />
+              <Text text="志愿者文化积分" fontConfig="contentText" />
               <Text :text="infoLoader.content.value.points" fontConfig="lightGoldTitle" />
             </FlexRow>