Merge branch 'feat/liujie'
This commit is contained in:
@@ -54,13 +54,25 @@ 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("&");
|
||||
try {
|
||||
const decoded = decodeURIComponent(options.scene || "");
|
||||
const params: Record<string, string> = {};
|
||||
decoded.split("&").forEach((pair) => {
|
||||
const [key, value] = pair.split("=");
|
||||
if (key) params[key] = value ? decodeURIComponent(value) : "";
|
||||
});
|
||||
|
||||
Taro.redirectTo({ url: `/${defaultPage}?${query}` });
|
||||
// 拼接成 URL query
|
||||
const query = Object.entries(params)
|
||||
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
|
||||
.join("&");
|
||||
|
||||
Taro.redirectTo({
|
||||
url: query ? `/${defaultPage}?${query}` : `/${defaultPage}`,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("scene 解析失败:", err);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -324,8 +336,10 @@ const SharePopup = forwardRef(({ id, from, detail, userInfo }, ref) => {
|
||||
// const posterRef = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
changeMessageType();
|
||||
}, []);
|
||||
if (id) {
|
||||
changeMessageType();
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
async function changeMessageType() {
|
||||
try {
|
||||
@@ -1394,7 +1408,9 @@ function Index() {
|
||||
useDidShow(async () => {
|
||||
// await updateLocation();
|
||||
// await fetchUserInfo();
|
||||
await fetchDetail();
|
||||
if (id) {
|
||||
await fetchDetail();
|
||||
}
|
||||
});
|
||||
|
||||
const updateLocation = async () => {
|
||||
|
||||
@@ -192,7 +192,7 @@ function Intro() {
|
||||
<View className={styles.tip}>
|
||||
<Image
|
||||
className={styles.tipImage}
|
||||
src="http://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png"
|
||||
src="https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</View>
|
||||
@@ -236,7 +236,7 @@ function Intro() {
|
||||
<View className={styles.tip}>
|
||||
<Image
|
||||
className={styles.tipImage}
|
||||
src="http://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png"
|
||||
src="https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</View>
|
||||
@@ -244,7 +244,7 @@ function Intro() {
|
||||
<View className={styles.radar}>
|
||||
<Image
|
||||
className={styles.radarImage}
|
||||
src="http://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/a2e1b639-82a9-4ab8-b767-8605556eafcb.png"
|
||||
src="https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/a2e1b639-82a9-4ab8-b767-8605556eafcb.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user