acdr-ui/dist/dev/mp-weixin/sheep/components/s-share-modal/canvas-poster/poster/user.js

82 lines
2.2 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const sheep_index = require("../../../../index.js");
const sheep_components_sShareModal_canvasPoster_poster_index = require("./index.js");
const user = (poster) => __async(exports, null, function* () {
const width = poster.width;
const userInfo = sheep_index.sheep.$store("user").userInfo;
const wxa_qrcode = yield sheep_components_sShareModal_canvasPoster_poster_index.getWxaQrcode(poster.shareInfo.path, poster.shareInfo.query);
return [
{
type: "image",
src: sheep_components_sShareModal_canvasPoster_poster_index.formatImageUrlProtocol(
sheep_index.sheep.$url.cdn(sheep_index.sheep.$store("app").platform.share.posterInfo.user_bg)
),
css: {
width,
position: "fixed",
"object-fit": "contain",
top: "0",
left: "0",
zIndex: -1
}
},
{
type: "text",
text: userInfo.nickname,
css: {
color: "#333",
fontSize: 14,
textAlign: "center",
fontFamily: "sans-serif",
position: "fixed",
top: width * 0.4,
left: width / 2
}
},
{
type: "image",
src: sheep_components_sShareModal_canvasPoster_poster_index.formatImageUrlProtocol(sheep_index.sheep.$url.cdn(userInfo.avatar)),
css: {
position: "fixed",
left: width * 0.4,
top: width * 0.16,
width: width * 0.2,
height: width * 0.2
}
},
{
type: "image",
src: wxa_qrcode,
css: {
position: "fixed",
left: width * 0.35,
top: width * 0.84,
width: width * 0.3,
height: width * 0.3
}
}
];
});
exports.user = user;
//# sourceMappingURL=user.js.map