You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/enfp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/intj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/entp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/estj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/infj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/infp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/isfj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/isfp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/home/fortune-telling/fortun-running.pag",
// demo:8 个 canvas 一次性加载,验证最后一帧
import { PAGInit } from "libpag-miniprogram";
import { loadFileByRequest, getCanvasNode } from "../fox-home/utils";
// ========== 8 个 PAG 地址,与 8 个 canvas 一一对应 ==========
const PAG_FILE_URLS = [
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/enfp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/intj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/entp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/estj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/infj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/infp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/isfj_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/normal-state/传送门/出门/isfp_bmp.pag",
"https://res-media.cshimedia.com/cheese-fox/image/home/fortune-telling/fortun-running.pag",
];
// ==========
const CANVAS_COUNT = 9;
const PAG_NAMES = ["enfp", "intj", "entp", "estj", "infj", "infp", "isfj", "isfp", "fortun-running"];
Page({
data: {
canvasList: [0, 1, 2, 3, 4, 5, 6, 7, 8],
names: PAG_NAMES,
statusList: [], // 每个格子状态:'' | 'fixed',长度 8
globalStatus: "loading",
statusText: "加载中...",
},
async onLoad() {
if (!PAG_FILE_URLS || PAG_FILE_URLS.length !== CANVAS_COUNT) {
this.setData({
globalStatus: "error",
statusText: "请确保 PAG_FILE_URLS 有 8 个地址",
});
return;
}
this.setData({
statusList: Array(CANVAS_COUNT).fill(""),
});
await this.initPAG();
},
async initPAG() {
try {
this.setData({ statusText: "初始化 PAG..." });
this.PAG = await PAGInit({ locateFile: (file) => "/utils/" + file });
},
onUnload() {

if (this.pagViews && this.pagViews.length) {
this.pagViews.forEach((v) => {
try {
v.destroy();
} catch (e) {}
});
this.pagViews = [];
}
},
});
Beta Was this translation helpful? Give feedback.
All reactions