|
|
@@ -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);
|