|
|
@@ -147,7 +147,8 @@ import { useRequireLogin } from '@/common/composeabe/RequireLogin';
|
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
|
import { toast } from '@/components/utils/DialogAction';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
-import { RequestApiError, SimpleTimer } from '@imengyu/imengyu-utils';
|
|
|
+import { RequestApiError, SimpleTimer, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
+import { useAuthStore } from '@/store/auth';
|
|
|
import HomeTitle from '@/common/components/parts/HomeTitle.vue';
|
|
|
import Text from '@/components/basic/Text.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
@@ -169,6 +170,7 @@ const GROWTH_FEED_COUNT = 6;
|
|
|
const DEFAULT_AVATAR = 'https://xy.wenlvti.net/app_static/images/village/PlaceholderVolunteer.png';
|
|
|
|
|
|
const villageStore = useVillageStore();
|
|
|
+const authStore = useAuthStore();
|
|
|
const { requireLoginAsync } = useRequireLogin();
|
|
|
|
|
|
const blessBuyDialogRef = ref<InstanceType<typeof BlessBuyDialog>>();
|
|
|
@@ -284,9 +286,7 @@ async function handleBuyBlessConfirm() {
|
|
|
paySign: payInfo.pay.paySign,
|
|
|
success: () => {
|
|
|
blessSuccessDialogRef.value?.show();
|
|
|
- setTimeout(() => {
|
|
|
- activityLoader.reload();
|
|
|
- }, 2000);
|
|
|
+ handleBlessPaySuccessRefresh();
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
showError(err);
|
|
|
@@ -305,6 +305,13 @@ function handleGoBless() {
|
|
|
duration: 300,
|
|
|
});
|
|
|
}
|
|
|
+async function handleBlessPaySuccessRefresh() {
|
|
|
+ refreshVillageTreeInfo();
|
|
|
+ await waitTimeOut(600);
|
|
|
+ authStore.refreshUserInfo();
|
|
|
+ await waitTimeOut(2000);
|
|
|
+ activityLoader.reload();
|
|
|
+}
|
|
|
|
|
|
function handleFertilize() {
|
|
|
handlePickOrWaterOrFertilize('fertilize');
|
|
|
@@ -387,7 +394,9 @@ onBeforeMount(() => {
|
|
|
});
|
|
|
defineExpose({
|
|
|
onPageBack: (name: string, data: Record<string, unknown>) => {
|
|
|
-
|
|
|
+ if (name === 'blessPaySuccessRefresh') {
|
|
|
+ handleBlessPaySuccessRefresh();
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
});
|