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

4 months ago
2 weeks ago
4 months ago
3 months ago
4 months ago
2 weeks ago
4 months ago
3 months ago
2 weeks ago
3 months ago
2 weeks ago
3 months ago
4 months ago
2 weeks ago
4 months ago
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const config_api = require("../../../config/api.js");
  4. if (!Array) {
  5. const _easycom_u_parse2 = common_vendor.resolveComponent("u-parse");
  6. _easycom_u_parse2();
  7. }
  8. const _easycom_u_parse = () => "../../../uni_modules/uview-plus/components/u-parse/u-parse.js";
  9. if (!Math) {
  10. _easycom_u_parse();
  11. }
  12. const _sfc_main = {
  13. __name: "noticeDetail",
  14. setup(__props) {
  15. let articleId = "";
  16. const info = common_vendor.ref("");
  17. async function getNoticeDetailFn() {
  18. const { data: res } = await config_api.getNoticeDetail({ articleId });
  19. info.value = res;
  20. }
  21. function goWebview(item) {
  22. let url = item.url || item;
  23. common_vendor.index.downloadFile({
  24. url,
  25. success: function(res) {
  26. var filePath = res.tempFilePath;
  27. common_vendor.index.openDocument({
  28. filePath,
  29. showMenu: true,
  30. success: function(res2) {
  31. console.log("打开文档成功");
  32. },
  33. success: function(res2) {
  34. console.log("打开失败成功");
  35. }
  36. });
  37. },
  38. fail: (err) => {
  39. console.log(err);
  40. common_vendor.index.$u.toast("下载失败");
  41. }
  42. });
  43. return;
  44. }
  45. common_vendor.onLoad((option) => {
  46. articleId = option.id;
  47. getNoticeDetailFn();
  48. });
  49. common_vendor.onPullDownRefresh(async () => {
  50. await getNoticeDetailFn();
  51. common_vendor.index.stopPullDownRefresh();
  52. });
  53. return (_ctx, _cache) => {
  54. return common_vendor.e({
  55. a: common_vendor.t(info.value.title),
  56. b: common_vendor.f(info.value.attachmentList, (item, index, i0) => {
  57. return {
  58. a: common_vendor.t(item.name || index),
  59. b: common_vendor.o(($event) => goWebview(item), index),
  60. c: index
  61. };
  62. }),
  63. c: common_vendor.p({
  64. content: info.value.content,
  65. tagStyle: _ctx.style
  66. }),
  67. d: info.value.timeDesc
  68. }, info.value.timeDesc ? {
  69. e: common_vendor.t(info.value.timeDesc)
  70. } : {});
  71. };
  72. }
  73. };
  74. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ae16cb0d"]]);
  75. wx.createPage(MiniProgramPage);