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

52 lines
1.8 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_components_sShareModal_canvasPoster_poster_user = require("./user.js");
const sheep_components_sShareModal_canvasPoster_poster_goods = require("./goods.js");
const sheep_components_sShareModal_canvasPoster_poster_groupon = require("./groupon.js");
const sheep_api_member_social = require("../../../../api/member/social.js");
function getPosterData(options) {
switch (options.shareInfo.poster.type) {
case "user":
return sheep_components_sShareModal_canvasPoster_poster_user.user(options);
case "goods":
return sheep_components_sShareModal_canvasPoster_poster_goods.goods(options);
case "groupon":
return sheep_components_sShareModal_canvasPoster_poster_groupon.groupon(options);
}
}
function formatImageUrlProtocol(url) {
if (url.indexOf("http:") === 0) {
url = url.replace("http:", "https:");
}
return url;
}
function getWxaQrcode(path, query) {
return __async(this, null, function* () {
const res = yield sheep_api_member_social.SocialApi.getWxaQrcode(path, query);
return "data:image/png;base64," + res.data;
});
}
exports.formatImageUrlProtocol = formatImageUrlProtocol;
exports.getPosterData = getPosterData;
exports.getWxaQrcode = getWxaQrcode;
//# sourceMappingURL=index.js.map