Replies: 1 comment
-
|
请提供一个可复现问题的小程序代码片段,然后将对应的链接贴出来 另外描述清楚问题背景,包括使用的 libpag 版本、系统版本等 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

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