feat: 问题修复
This commit is contained in:
@@ -11,6 +11,7 @@ import Taro, {
|
||||
useShareAppMessage,
|
||||
useShareTimeline,
|
||||
useDidShow,
|
||||
useLoad,
|
||||
} from "@tarojs/taro";
|
||||
import classnames from "classnames";
|
||||
import dayjs from "dayjs";
|
||||
@@ -22,7 +23,6 @@ import {
|
||||
NTRPEvaluatePopup,
|
||||
GameManagePopup,
|
||||
Comments,
|
||||
Poster,
|
||||
} from "@/components";
|
||||
import {
|
||||
generateShareImage,
|
||||
@@ -42,7 +42,7 @@ import { EvaluateCallback, EvaluateScene } from "@/store/evaluateStore";
|
||||
import img from "@/config/images";
|
||||
import DownloadIcon from "@/static/detail/download_icon.svg";
|
||||
import WechatLogo from "@/static/detail/wechat_icon.svg";
|
||||
import WechatTimeline from "@/static/detail/wechat_timeline.svg";
|
||||
// import WechatTimeline from "@/static/detail/wechat_timeline.svg";
|
||||
import LinkIcon from "@/static/detail/link.svg";
|
||||
import CrossIcon from "@/static/detail/cross.svg";
|
||||
import { DayOfWeekMap } from "./config";
|
||||
@@ -51,6 +51,20 @@ import "./index.scss";
|
||||
|
||||
dayjs.locale("zh-cn");
|
||||
|
||||
const useSceneRedirect = (defaultPage: string) => {
|
||||
useLoad((options) => {
|
||||
if (options.scene) {
|
||||
const decoded = decodeURIComponent(options.scene);
|
||||
const params = Object.fromEntries(new URLSearchParams(decoded));
|
||||
const query = Object.entries(params)
|
||||
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
|
||||
.join("&");
|
||||
|
||||
Taro.redirectTo({ url: `/${defaultPage}?${query}` });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 将·作为连接符插入到标签文本之间
|
||||
function insertDotInTags(tags: string[]) {
|
||||
if (!tags) return [];
|
||||
@@ -1365,6 +1379,8 @@ function Index() {
|
||||
const { fetchUserInfo } = useUserActions(); // 获取登录用户的userInfo
|
||||
const myInfo = useUserInfo();
|
||||
|
||||
useSceneRedirect("game_pages/detail/index");
|
||||
|
||||
const isMyOwn = userInfo.id === myInfo.id;
|
||||
|
||||
const sharePopupRef = useRef<any>(null);
|
||||
|
||||
Reference in New Issue
Block a user