fix: bizhi detail
This commit is contained in:
@@ -133,6 +133,7 @@ const detailData = ref({
|
||||
});
|
||||
const recommendList = ref([]);
|
||||
const shareToken = ref("");
|
||||
const categoryId = ref("");
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options.shareToken) {
|
||||
@@ -196,6 +197,7 @@ const fetchRecommend = async (id) => {
|
||||
try {
|
||||
const res = await getWallpaperSameList(id || detailData.value.id);
|
||||
recommendList.value = res;
|
||||
categoryId.value = res[0]?.categoryId || "";
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch recommendations", e);
|
||||
}
|
||||
@@ -214,7 +216,7 @@ const goBack = () => {
|
||||
|
||||
const goToIndex = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/wallpaper/index",
|
||||
url: `/pages/wallpaper/index?categoryId=${categoryId.value}`,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -249,16 +251,6 @@ const onRecommendClick = (item) => {
|
||||
});
|
||||
};
|
||||
|
||||
const goToGreeting = () => {
|
||||
uni.switchTab({ url: "/pages/make/index" });
|
||||
};
|
||||
|
||||
const goToAvatar = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/avatar/index",
|
||||
});
|
||||
};
|
||||
|
||||
const handleLogind = async () => {
|
||||
// Logic after successful login if needed
|
||||
};
|
||||
|
||||
@@ -174,6 +174,10 @@ onLoad((options) => {
|
||||
shareToken.value = options.shareToken;
|
||||
saveViewRequest(options.shareToken, "wallpaper_download");
|
||||
}
|
||||
if (options.categoryId) {
|
||||
currentCategoryId.value = options.categoryId;
|
||||
}
|
||||
fetchCategories();
|
||||
trackRecord({
|
||||
eventName: "wallpaper_page_visit",
|
||||
eventType: `visit`,
|
||||
@@ -190,7 +194,9 @@ const fetchCategories = async () => {
|
||||
const list = Array.isArray(res) ? res : res?.list || [];
|
||||
if (list.length > 0) {
|
||||
categories.value = list;
|
||||
if (!currentCategoryId.value) {
|
||||
currentCategoryId.value = list[0].id;
|
||||
}
|
||||
loadWallpapers(true);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user