fix: 修复发布后分享弹窗打开问题
This commit is contained in:
@@ -60,8 +60,10 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
|
||||
show: async (publish_flag = false) => {
|
||||
setPublishFlag(publish_flag);
|
||||
if (publish_flag) {
|
||||
const url = await generateShareImageUrl();
|
||||
setShareImageUrl(url);
|
||||
try {
|
||||
const url = await generateShareImageUrl();
|
||||
setShareImageUrl(url);
|
||||
} catch (e) {}
|
||||
}
|
||||
setVisible(true);
|
||||
},
|
||||
@@ -81,6 +83,7 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
|
||||
const endTime = dayjs(end_time);
|
||||
const dayofWeek = DayOfWeekMap.get(startTime.day());
|
||||
const gameLength = `${endTime.diff(startTime, "hour")}小时`;
|
||||
console.log(userInfo, "userInfo");
|
||||
const url = await generateShareImage({
|
||||
userAvatar: userInfo.avatar_url,
|
||||
userNickname: userInfo.nickname,
|
||||
|
||||
@@ -23,6 +23,7 @@ import SupplementalNotes from "./components/SupplementalNotes";
|
||||
import OrganizerInfo from "./components/OrganizerInfo";
|
||||
import SharePopup from "./components/SharePopup";
|
||||
import { navto, toast } from "@/utils/helper";
|
||||
import { delay } from "@/utils";
|
||||
import ArrowLeft from "@/static/detail/icon-arrow-left.svg";
|
||||
// import Logo from "@/static/detail/icon-logo-go.svg";
|
||||
import styles from "./index.module.scss";
|
||||
@@ -53,6 +54,12 @@ function Index() {
|
||||
await waitForAuthInit();
|
||||
// 然后再获取用户信息
|
||||
await fetchUserInfo();
|
||||
|
||||
await delay(1000);
|
||||
|
||||
if (from !== "publish") {
|
||||
handleShare(true);
|
||||
}
|
||||
};
|
||||
init();
|
||||
}, []);
|
||||
@@ -105,10 +112,6 @@ function Index() {
|
||||
fetchUserInfoById(res.data.publisher_id);
|
||||
}
|
||||
|
||||
if (from === "publish") {
|
||||
handleShare(true);
|
||||
}
|
||||
|
||||
// Taro.hideLoading();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user