You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

75 lines
2.3 KiB

"use strict";
const common_vendor = require("../../../common/vendor.js");
const config_api = require("../../../config/api.js");
if (!Array) {
const _easycom_u_parse2 = common_vendor.resolveComponent("u-parse");
_easycom_u_parse2();
}
const _easycom_u_parse = () => "../../../uni_modules/uview-plus/components/u-parse/u-parse.js";
if (!Math) {
_easycom_u_parse();
}
const _sfc_main = {
__name: "noticeDetail",
setup(__props) {
let articleId = "";
const info = common_vendor.ref("");
async function getNoticeDetailFn() {
const { data: res } = await config_api.getNoticeDetail({ articleId });
info.value = res;
}
function goWebview(item) {
let url = item.url || item;
common_vendor.index.downloadFile({
url,
success: function(res) {
var filePath = res.tempFilePath;
common_vendor.index.openDocument({
filePath,
showMenu: true,
success: function(res2) {
console.log("打开文档成功");
},
success: function(res2) {
console.log("打开失败成功");
}
});
},
fail: (err) => {
console.log(err);
common_vendor.index.$u.toast("下载失败");
}
});
return;
}
common_vendor.onLoad((option) => {
articleId = option.id;
getNoticeDetailFn();
});
common_vendor.onPullDownRefresh(async () => {
await getNoticeDetailFn();
common_vendor.index.stopPullDownRefresh();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(info.value.title),
b: common_vendor.f(info.value.attachmentList, (item, index, i0) => {
return {
a: common_vendor.t(item.name || index),
b: common_vendor.o(($event) => goWebview(item), index),
c: index
};
}),
c: common_vendor.p({
content: info.value.content,
tagStyle: _ctx.style
}),
d: info.value.timeDesc
}, info.value.timeDesc ? {
e: common_vendor.t(info.value.timeDesc)
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ae16cb0d"]]);
wx.createPage(MiniProgramPage);