articleDetail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. <template>
  2. <view class="page">
  3. <!-- 引入FontAwesome -->
  4. <view>
  5. <link rel="stylesheet"
  6. href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
  7. </view>
  8. <!-- 顶部导航栏 -->
  9. <view class="custom-navbar">
  10. <view class="navbar-left" @click="goBack">
  11. <text class="fa fa-angle-left"></text>
  12. </view>
  13. <view class="navbar-center">
  14. <view class="navbar-title" v-if="isMessage" @click="goToUserHomepage(author.id)">
  15. <image class="navbar-avatar" :src="author.avator" mode="aspectFill"></image>
  16. <text class="navbar-text">{{ author.nickname }}</text>
  17. <!-- <text class="navbar-badge" v-if="author.is_vip > 0">VIP</text> -->
  18. </view>
  19. </view>
  20. <view class="navbar-right">
  21. <template v-if="!isItMe">
  22. <text class="followTheAuthor followTheAuthor1" v-if="author.is_attention == 0"
  23. @click="followTheAuthor(1)">+关注</text>
  24. <text class="followTheAuthor followTheAuthor0" v-if="author.is_attention == 1"
  25. @click="followTheAuthor(0)">已关注</text>
  26. </template>
  27. <template v-if="isMessage">
  28. <image v-if="!isItMe" @click="showActionSheet(0)" src="@/static/icon/sy_icon_fenxiang.png"
  29. mode="widthFix"></image>
  30. <view v-else class="navbar-right" @click="showActionSheet(1)">
  31. <text class="fa fa-ellipsis-h"></text>
  32. </view>
  33. </template>
  34. <image v-else @click="showActionSheet(2)" src="@/static/icon/sy_icon_fenxiang.png" mode="widthFix">
  35. </image>
  36. </view>
  37. </view>
  38. <view class="topStatusBar inProgress" v-if="articleInfo.status == 2">
  39. 审核中</view>
  40. <view class="topStatusBar fail" v-else-if="articleInfo.status == 3" @click="openConfirmationBox">
  41. 审核未通过,点击查看原因</view>
  42. <template v-if="isMessage">
  43. <!-- 轮播图部分 -->
  44. <uv-swiper v-if="articleInfo.type == 'user'" class="swiper-box" height="1032rpx" :list="swperImages"
  45. indicator indicatorMode="dot" bgColor="#fff" :autoplay="false">
  46. </uv-swiper>
  47. <!-- 文章内容区域 -->
  48. <view class="body">
  49. <!-- 文章标题与元信息 -->
  50. <view class="article-header">
  51. <view class="title">
  52. {{ articleInfo.title || "暂无标题" }}
  53. </view>
  54. <view class="article-content">
  55. <view class="content">
  56. <!-- <rich-text :nodes="content" style="font-size: 14px"></rich-text> -->
  57. <uv-parse :content="articleInfo.content"></uv-parse>
  58. </view>
  59. </view>
  60. <view class="cardLink" @click="goToDetails(workInfo.id)">
  61. <image :src="workInfo.images" mode="heightFix"></image>
  62. <view class="content">
  63. <view class="tit">作品一号</view>
  64. <view class="tex">{{
  65. cutTime(workInfo.create_time) || "暂无时间"
  66. }}</view>
  67. </view>
  68. </view>
  69. <view v-if="false" class="meta-info">
  70. <view class="meta-item">
  71. <text class="fa fa-calendar"></text>
  72. <text class="meta-text">{{
  73. articleInfo.create_time || "暂无时间"
  74. }}</text>
  75. </view>
  76. <view class="meta-item">
  77. <text class="fa fa-eye"></text>
  78. <text class="meta-text">{{ articleInfo.num_view || 0 }}次阅读</text>
  79. </view>
  80. <view class="meta-item" v-if="articleInfo.author">
  81. <text class="fa fa-user"></text>
  82. <text class="meta-text">{{ articleInfo.author }}</text>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 文章底部区域 -->
  87. <view class="article-footer" v-if="false">
  88. <view class="action-bar">
  89. <view class="action-item" @tap="likeArticle">
  90. <text class="fa" :class="articleInfo.is_like ? 'fa-thumbs-up liked' : 'fa-thumbs-o-up'
  91. "></text>
  92. <text class="action-text">{{ articleInfo.like_count || 0 }}</text>
  93. </view>
  94. <view class="action-item" @tap="openComment">
  95. <text class="fa fa-comment-o"></text>
  96. <text class="action-text">{{ tableTotal || 0 }}</text>
  97. </view>
  98. <view class="action-item" @tap="shareArticle">
  99. <text class="fa fa-share-alt"></text>
  100. <text class="action-text">分享</text>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- <view class="btn_submit" @click="chatTA()">
  106. <image class="icon" src="../../static/icon/icon_chat_white.png" mode="widthFix"></image>
  107. 私聊
  108. </view> -->
  109. <previewImage ref="previewImage" :opacity="0.8" :circular="true" :imgs="imgs" :descs="descs"></previewImage>
  110. </template>
  111. <template v-else>
  112. <!-- <rich-text :nodes="content" style="font-size: 14px"></rich-text> -->
  113. <uv-parse :content="articleInfo.content"></uv-parse>
  114. </template>
  115. <!-- 评论区域 -->
  116. <template v-if="articleInfo.status == 1">
  117. <CommentSection v-if="userInfo.id != 0" ref="commentSection" @totalNumberOfComments="totalNumberOfComments"
  118. :articleInfo="articleInfo" :myInfo="myInfo" :userInfo="userInfo" :articleId="arcID" :type="'article'">
  119. </CommentSection>
  120. </template>
  121. <view class="thread2"></view>
  122. <!-- 自定义 ActionSheet -->
  123. <ActionSheet ref="actionSheet" :items="items" @select="handleActionSelect" @cancel="handleActionCancel" />
  124. <CustomPopup ref="confirmationBox">
  125. <view class="failureReason">
  126. <view class="title"> 审核未通关</view>
  127. <view class="reviewContent">
  128. <!-- {{ fileInformation.reason }} -->
  129. <uv-parse :content="articleInfo.reason"></uv-parse>
  130. </view>
  131. <view class="btn-box" @click="closeConfirmationBox">知道了</view>
  132. </view>
  133. </CustomPopup>
  134. <DialogBox ref="DialogBox"></DialogBox>
  135. </view>
  136. </template>
  137. <script>
  138. import htmlParser from "../../common/html-parser";
  139. import CommentSection from "@/components/CommentSection/CommentSection.vue";
  140. import previewImage from "@/components/kxj-previewImage/kxj-previewImage.vue"; //引用插件
  141. import CustomPopup from "@/components/CustomPopup/CustomPopup.vue";
  142. function parseImgs(nodes) {
  143. nodes.forEach((node) => {
  144. if (node.name === "img" && node.attrs && node.attrs["data-img-size-val"]) {
  145. const sizes = node.attrs["data-img-size-val"].split(",");
  146. const width = uni.upx2px(720 * 0.9);
  147. const height = parseInt(width * (sizes[1] / sizes[0]));
  148. node.attrs.style = `width:${width};height:${height};`;
  149. }
  150. if (Array.isArray(node.children)) {
  151. parseImgs(node.children);
  152. }
  153. });
  154. return nodes;
  155. }
  156. export default {
  157. components: {
  158. previewImage,
  159. CommentSection,
  160. CustomPopup,
  161. },
  162. data() {
  163. return {
  164. swperImages: [],
  165. items: [],
  166. title: "",
  167. arcID: 0,
  168. selImg: 0,
  169. home_image: "",
  170. myinfo: {},
  171. tag_list: [],
  172. image_list: [],
  173. imgs: [],
  174. descs: [],
  175. list_wish: [],
  176. content: "",
  177. tableTotal: 0,
  178. author: {},
  179. // 添加文章信息字段
  180. articleInfo: {
  181. title: "",
  182. content: "",
  183. create_time: "",
  184. images: "",
  185. view_count: 0,
  186. author: "",
  187. like_count: 0,
  188. is_like: false,
  189. },
  190. workInfo: {},
  191. myInfo: {
  192. user_id: getApp().globalData.user_id, // 用户id
  193. user_name: getApp().globalData.nickname, // 用户名
  194. user_avatar: getApp().globalData.avator, // 用户头像地址
  195. },
  196. // 文章作者信息(提示: 一般来自localstorage, 如果是实时获取的话, 那么获取到数据后再v-if显示评论组件)
  197. userInfo: {
  198. user_id: 0, // 用户id
  199. user_name: "", // 用户名
  200. user_avatar: "", // 用户头像地址
  201. },
  202. isItMe: false,
  203. sms_id: 0,
  204. isMessage: true,
  205. };
  206. },
  207. onLoad(parms) {
  208. let self = this;
  209. this.arcID = parms.id;
  210. if (parms.type == "sms") {
  211. this.isMessage = false;
  212. }
  213. if (parms.sms_id) {
  214. this.sms_id = parms.sms_id;
  215. }
  216. },
  217. onShow() {
  218. uni.$emit("check_update");
  219. this.$nextTick(() => {
  220. if (this.$refs.commentSection) {
  221. this.$refs.commentSection.loadCommentData();
  222. }
  223. });
  224. this.loadData();
  225. },
  226. methods: {
  227. openConfirmationBox() {
  228. this.$refs.confirmationBox.open();
  229. },
  230. closeConfirmationBox() {
  231. this.$refs.confirmationBox.close();
  232. },
  233. // 返回上一页
  234. goBack() {
  235. uni.navigateBack({
  236. delta: 1,
  237. });
  238. },
  239. // 文章点赞
  240. likeArticle() {
  241. uni.request({
  242. url: this.$apiHost + "/Work/zanTA",
  243. data: {
  244. uuid: getApp().globalData.uuid,
  245. id: this.arcID,
  246. },
  247. header: {
  248. "content-type": "application/json",
  249. sign: getApp().globalData.headerSign,
  250. },
  251. success: (res) => {
  252. console.log("点赞结果:", res.data);
  253. if (res.data.success === "yes") {
  254. // 更新点赞状态
  255. if (!this.articleInfo.is_like) {
  256. this.articleInfo.like_count =
  257. (this.articleInfo.like_count || 0) + 1;
  258. this.articleInfo.is_like = true;
  259. uni.showToast({
  260. title: "点赞成功",
  261. icon: "none",
  262. });
  263. } else {
  264. this.articleInfo.like_count =
  265. (this.articleInfo.like_count || 0) - 1;
  266. this.articleInfo.is_like = false;
  267. uni.showToast({
  268. title: res.data.str,
  269. icon: "none",
  270. });
  271. }
  272. } else {
  273. uni.showToast({
  274. title: res.data.str,
  275. icon: "none",
  276. });
  277. }
  278. },
  279. fail: (e) => {
  280. console.log("点赞失败:", e);
  281. uni.showToast({
  282. title: "网络请求失败",
  283. icon: "none",
  284. });
  285. },
  286. });
  287. },
  288. // 关注作者
  289. followTheAuthor(n) {
  290. uni.$emit('check_login', () => {
  291. uni.request({
  292. url: this.$apiHost + "/Member/attention",
  293. data: {
  294. uuid: getApp().globalData.uuid,
  295. id: this.author.id,
  296. },
  297. header: {
  298. "content-type": "application/json",
  299. sign: getApp().globalData.headerSign,
  300. },
  301. success: (res) => {
  302. console.log("点赞结果:", res.data);
  303. uni.showToast({
  304. title: res.data.str,
  305. icon: "none",
  306. });
  307. if (res.data.success === "yes") {
  308. console.log("关注结果:", res.data, n);
  309. this.author.is_attention = n;
  310. }
  311. },
  312. fail: (e) => {
  313. console.log("关注失败:", e);
  314. uni.showToast({
  315. title: "网络请求失败",
  316. icon: "none",
  317. });
  318. },
  319. });
  320. })
  321. },
  322. totalNumberOfComments(tableTotal) {
  323. this.tableTotal = tableTotal;
  324. },
  325. onLinqu(item) {
  326. uni.navigateTo({
  327. url: "/pages/my/wishHelp?id=" + item.myid,
  328. });
  329. },
  330. selPhoto(item, sel) {
  331. this.selImg = sel;
  332. this.home_image = this.image_list[sel];
  333. },
  334. goToDetails(id) {
  335. console.log("goToDetails", id);
  336. uni.navigateTo({
  337. url: "/pages/index/workDetail?id=" + id,
  338. });
  339. console.log("goToDetails", id);
  340. },
  341. toArr(imgs) {
  342. let arr = imgs.split("|");
  343. return arr;
  344. },
  345. previewOpen(imgs1, index) {
  346. this.imgs = imgs1.split("|");
  347. setTimeout(() => this.$refs.previewImage.open(index), 0);
  348. return; //如需测试和uni原生预览差别可注释这两行
  349. },
  350. loadData() {
  351. uni.request({
  352. url: this.$apiHost + "/Article/getinfo",
  353. data: {
  354. uuid: getApp().globalData.uuid,
  355. id: this.arcID,
  356. },
  357. header: {
  358. "content-type": "application/json",
  359. sign: getApp().globalData.headerSign,
  360. },
  361. success: (res) => {
  362. console.log("文章信息:", res.data);
  363. if (res.data.success === "yes") {
  364. // 更新文章信息
  365. if (res.data.article) {
  366. this.articleInfo = res.data.article;
  367. }
  368. this.articleInfo.sms_id = this.sms_id;
  369. this.swperImages = this.imageString(res.data.article.images);
  370. console.log("swperImages", this.swperImages);
  371. this.userInfo.user_id = res.data.id; // 用户id
  372. this.userInfo.user_name = res.data.nickname; // 用户名
  373. this.userInfo.user_avatar = res.data.avator; // 用户头像地址
  374. this.author = res.data.author;
  375. this.workInfo = res.data.work_info;
  376. this.isItMe =
  377. res.data.article.userID == getApp().globalData.user_id
  378. ? true
  379. : false;
  380. const nodes = htmlParser(res.data.article.content);
  381. // #ifdef APP-PLUS-NVUE
  382. parseImgs(nodes);
  383. // #endif
  384. this.content = nodes;
  385. // 更新图片列表
  386. if (res.data.article.images && res.data.article.images !== "") {
  387. this.image_list = res.data.article.images.split(",");
  388. this.home_image = this.image_list[0];
  389. } else {
  390. this.home_image = "../../static/home/avator.png";
  391. }
  392. console.log("img", this.home_image);
  393. // 更新标签列表
  394. // if (res.data.data.tags && res.data.data.tags !== "") {
  395. // this.tag_list = res.data.data.tags.split(",");
  396. // }
  397. } else {
  398. uni.showToast({
  399. title: "获取文章信息失败",
  400. icon: "none",
  401. });
  402. }
  403. },
  404. complete: (com) => {
  405. // uni.hideLoading();
  406. },
  407. fail: (e) => {
  408. console.log("请求失败:", e);
  409. uni.showToast({
  410. title: "网络请求失败",
  411. icon: "none",
  412. });
  413. },
  414. });
  415. },
  416. // 评论相关方法已移至CommentSection组件
  417. // 唤起新评论弹框
  418. openComment() {
  419. if (this.$refs.commentSection) {
  420. this.$refs.commentSection.openComment();
  421. }
  422. },
  423. // 文章点赞
  424. // 分享文章
  425. shareArticle() {
  426. // 如果在微信小程序环境
  427. if (uni.getSystemInfoSync().platform === "mp-weixin") {
  428. uni.showShareMenu({
  429. withShareTicket: true,
  430. menus: ["shareAppMessage", "shareTimeline"],
  431. });
  432. } else {
  433. // 其他环境,如APP
  434. uni.share({
  435. provider: "weixin",
  436. scene: "WXSceneSession",
  437. type: 0,
  438. title: this.articleInfo.title,
  439. summary: this.articleInfo.content.substring(0, 40) + "...",
  440. imageUrl: this.home_image,
  441. success: function (res) {
  442. console.log("分享成功:" + JSON.stringify(res));
  443. },
  444. fail: function (err) {
  445. console.log("分享失败:" + JSON.stringify(err));
  446. },
  447. });
  448. }
  449. },
  450. // 评论回调事件
  451. replyFun({ params }, callback) {
  452. // params = {
  453. // ...params,
  454. // user_id: this.myInfo.user_id, // 用户id
  455. // user_name: this.myInfo.user_name, // 用户名
  456. // user_avatar: this.myInfo.user_avatar, // 用户头像地址
  457. // user_content: this.commentValue, // 用户评论内容
  458. // is_like: false, // 是否点赞
  459. // like_count: 0, // 点赞数统计
  460. // create_time: "刚刚", // 创建时间
  461. // owner: true, // 是否为所有者 所有者可以进行删除 管理员默认true
  462. // };
  463. console.log("replyFun", {
  464. uuid: getApp().globalData.uuid,
  465. article_id: this.arcID, // 文章ID
  466. content: params.user_content, // 评论内容
  467. parent_id: params.parent_id || 0, // 父评论ID
  468. reply_id: params.reply_id || 0, // 回复的评论ID
  469. reply_name: params.reply_name || "", // 被回复人名称
  470. });
  471. uni.request({
  472. url: this.$apiHost + "/Article/newComment",
  473. data: {
  474. uuid: getApp().globalData.uuid,
  475. type: "article",
  476. article_id: this.arcID, // 文章ID
  477. content: params.user_content, // 评论内容
  478. parent_id: params.parent_id || 0, // 父评论ID
  479. reply_id: params.reply_id || 0, // 回复的评论ID
  480. reply_name: params.reply_name || "", // 被回复人名称
  481. },
  482. header: {
  483. "content-type": "application/json",
  484. sign: getApp().globalData.headerSign,
  485. },
  486. success: (res) => {
  487. console.log("评论结果:", res.data);
  488. if (res.data.success === "yes") {
  489. callback(res.data); // 评论成功,传入后端返回的数据
  490. }
  491. },
  492. fail: (e) => {
  493. console.log("评论失败:", e);
  494. uni.showToast({
  495. title: "评论失败,请重试",
  496. icon: "none",
  497. });
  498. },
  499. });
  500. },
  501. /** 删除回调事件
  502. * mode 删除模式
  503. * -- bind: 当被删除的一级评论存在回复评论, 那么该评论内容变更显示为[当前评论内容已被移除]
  504. * -- only: 仅删除当前评论(后端删除相关联的回复评论, 否则总数显示不对)
  505. * -- all : 删除所有评论包括回复评论 前端遍历子评论上报
  506. */
  507. deleteFun({ params, mode }, callback) {
  508. console.log("deleteFun", {
  509. params,
  510. mode,
  511. });
  512. // 将params转换为逗号分隔的字符串
  513. const idsString = Array.isArray(params)
  514. ? params.join(",")
  515. : params.toString();
  516. console.log("删除评论", idsString, mode);
  517. uni.request({
  518. url: this.$apiHost + "/Article/delComment",
  519. data: {
  520. uuid: getApp().globalData.uuid,
  521. ids: idsString, // 将params转换为逗号分隔的字符串传递给ids
  522. mode: mode,
  523. },
  524. header: {
  525. "content-type": "application/json",
  526. sign: getApp().globalData.headerSign,
  527. },
  528. success: (res) => {
  529. console.log("删除结果:", res.data);
  530. if (res.data.success === "yes") {
  531. callback(res);
  532. }
  533. },
  534. fail: (e) => { },
  535. });
  536. // switch (mode) {
  537. // case "bind":
  538. // // 逻辑: 调用接口进行评论内容修改 update
  539. // setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
  540. // break;
  541. // case "only":
  542. // // 逻辑: 调用接口删除一个评论 delete
  543. // setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
  544. // break;
  545. // default:
  546. // // all
  547. // // 逻辑: 调用接口删除多个评论 [delete]
  548. // setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
  549. // break;
  550. // }
  551. },
  552. showActionSheet(n) {
  553. uni.$emit('check_login', () => {
  554. if (n==0) {
  555. this.items = [
  556. {
  557. text: "分享作品",
  558. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  559. },
  560. ];
  561. }
  562. if (n==1) {
  563. this.items = [
  564. {
  565. text: "分享作品",
  566. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  567. },
  568. {
  569. text: "修改帖子",
  570. icon: "../../static/icon/cz_icon_xiugaifengmian.png",
  571. },
  572. {
  573. text: "删除作品",
  574. icon: "../../static/icon/sy_icon_shanchu.png",
  575. danger: true,
  576. },
  577. ];
  578. }
  579. if (n==2) {
  580. this.items = [
  581. {
  582. text: "分享消息",
  583. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  584. },
  585. ];
  586. }
  587. this.$refs.actionSheet.show();
  588. })
  589. },
  590. handleActionCancel() {
  591. console.log("ActionSheet cancelled");
  592. },
  593. handleActionSelect(index, item) {
  594. console.log("ActionSheet selected index:", item.text);
  595. switch (item.text) {
  596. case "分享作品":
  597. console.log("分享作品");
  598. break;
  599. case "修改帖子":
  600. console.log("修改帖子");
  601. uni.navigateTo({
  602. url: "/pages/make/fabuArticle?id=" + this.articleInfo.id,
  603. });
  604. break;
  605. case "删除作品":
  606. console.log("删除作品");
  607. this.deleteArticle();
  608. break;
  609. }
  610. },
  611. imageString(str) {
  612. if (!str) {
  613. return [];
  614. }
  615. return str.split("|");
  616. },
  617. cutTime(time) {
  618. if (!time) {
  619. return "";
  620. }
  621. return time.split(" ")[0];
  622. },
  623. deleteArticle() {
  624. this.$refs["DialogBox"]
  625. .confirm({
  626. title: "提示",
  627. content: "确定删除该文章吗",
  628. DialogType: "inquiry",
  629. btn1: "取消",
  630. btn2: "确定",
  631. animation: 0,
  632. })
  633. .then(() => {
  634. uni.request({
  635. url: this.$apiHost + "/Article/doAct",
  636. data: {
  637. uuid: getApp().globalData.uuid,
  638. act: "del",
  639. id: this.articleInfo.id,
  640. },
  641. header: {
  642. "content-type": "application/json",
  643. sign: getApp().globalData.headerSign,
  644. },
  645. success: (res) => {
  646. if (res.data.success === "yes") {
  647. uni.showToast({
  648. title: "删除成功",
  649. icon: "success",
  650. });
  651. // 重新获取列表
  652. // this.getArticleList();
  653. setTimeout(() => {
  654. uni.navigateBack({});
  655. }, 800);
  656. } else {
  657. uni.showToast({
  658. title: res.data.str || "删除失败",
  659. icon: "none",
  660. });
  661. }
  662. },
  663. });
  664. })
  665. .catch(() => {
  666. // this.delCloseFun()
  667. });
  668. },
  669. goToUserHomepage(id) {
  670. uni.$emit('check_login', () => {
  671. if (!id) {
  672. return;
  673. }
  674. uni.navigateTo({
  675. url: "/pages/my/userHomepage?id=" + id,
  676. });
  677. })
  678. },
  679. },
  680. };
  681. </script>
  682. <style scoped lang="scss">
  683. @import "articleDetail.scss";
  684. </style>