acdr-ui/dist/dev/mp-weixin/modules/mall/public/richtext.js

84 lines
2.6 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 common_vendor = require("../../../common/vendor.js");
const sheep_api_promotion_article = require("../../../sheep/api/promotion/article.js");
if (!Array) {
const _easycom_mp_html2 = common_vendor.resolveComponent("mp-html");
const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
const _component_layout_default_uni = common_vendor.resolveComponent("layout-default-uni");
(_easycom_mp_html2 + _easycom_s_layout2 + _component_layout_default_uni)();
}
const _easycom_mp_html = () => "../../../uni_modules/mp-html/components/mp-html/mp-html.js";
const _easycom_s_layout = () => "../../../sheep/components/s-layout/s-layout.js";
if (!Math) {
(_easycom_mp_html + _easycom_s_layout)();
}
const _sfc_main = {
__name: "richtext",
setup(__props) {
const state = common_vendor.reactive({
title: "",
content: ""
});
function getRichTextContent(id, title) {
return __async(this, null, function* () {
const { code, data } = yield sheep_api_promotion_article.ArticleApi.getArticle(id, title);
if (code !== 0) {
return;
}
state.content = data.content;
if (state.title !== data.title) {
state.title = data.title;
common_vendor.index.setNavigationBarTitle({
title: state.title
});
}
});
}
common_vendor.onLoad((options) => {
if (options.title) {
state.title = options.title;
common_vendor.index.setNavigationBarTitle({
title: state.title
});
}
getRichTextContent(options.id, options.title);
});
return (_ctx, _cache) => {
return {
a: common_vendor.p({
content: state.content
}),
b: common_vendor.p({
title: state.title,
bgStyle: {
color: "#FFF"
}
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-423be2e8"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=richtext.js.map