feat: maidian
This commit is contained in:
@@ -93,7 +93,7 @@ import {
|
||||
import { onShareAppMessage, onShareTimeline, onLoad } from "@dcloudio/uni-app";
|
||||
import { getShareReward, abilityCheck } from "@/api/system.js";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
import { saveViewRequest } from "@/utils/common.js";
|
||||
import { saveViewRequest, trackRecord } from "@/utils/common.js";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
|
||||
const userStore = useUserStore();
|
||||
@@ -156,6 +156,10 @@ onLoad((options) => {
|
||||
shareToken.value = options.shareToken;
|
||||
saveViewRequest(options.shareToken, "wallpaper_download");
|
||||
}
|
||||
trackRecord({
|
||||
eventName: "wallpaper_page_visit",
|
||||
eventType: `visit`,
|
||||
});
|
||||
});
|
||||
|
||||
const getThumbUrl = (url) => {
|
||||
@@ -181,6 +185,11 @@ const switchCategory = (id) => {
|
||||
if (currentCategoryId.value === id) return;
|
||||
currentCategoryId.value = id;
|
||||
loadWallpapers(true);
|
||||
trackRecord({
|
||||
eventName: "wallpaper_category_click",
|
||||
eventType: `select`,
|
||||
elementId: id || "",
|
||||
});
|
||||
};
|
||||
|
||||
const loadWallpapers = async (reset = false) => {
|
||||
@@ -230,14 +239,25 @@ const onRefresh = () => {
|
||||
};
|
||||
|
||||
const previewImage = (index) => {
|
||||
const urls = wallpapers.value.map((item) => item.url);
|
||||
uni.previewImage({
|
||||
urls,
|
||||
current: index,
|
||||
// const urls = wallpapers.value.map((item) => item.url);
|
||||
// uni.previewImage({
|
||||
// urls,
|
||||
// current: index,
|
||||
// });
|
||||
const item = wallpapers.value[index];
|
||||
trackRecord({
|
||||
eventName: "wallpaper_preview_click",
|
||||
eventType: `select`,
|
||||
elementId: item?.id || "",
|
||||
});
|
||||
};
|
||||
|
||||
const downloadWallpaper = async (item) => {
|
||||
trackRecord({
|
||||
eventName: "wallpaper_download_click",
|
||||
eventType: `click`,
|
||||
elementId: item?.id || "",
|
||||
});
|
||||
if (!isLoggedIn.value) {
|
||||
loginPopupRef.value.open();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user