articleDetail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  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(0)" 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.request({
  291. url: this.$apiHost + "/Member/attention",
  292. data: {
  293. uuid: getApp().globalData.uuid,
  294. id: this.author.id,
  295. },
  296. header: {
  297. "content-type": "application/json",
  298. sign: getApp().globalData.headerSign,
  299. },
  300. success: (res) => {
  301. console.log("点赞结果:", res.data);
  302. uni.showToast({
  303. title: res.data.str,
  304. icon: "none",
  305. });
  306. if (res.data.success === "yes") {
  307. console.log("关注结果:", res.data, n);
  308. this.author.is_attention = n;
  309. }
  310. },
  311. fail: (e) => {
  312. console.log("关注失败:", e);
  313. uni.showToast({
  314. title: "网络请求失败",
  315. icon: "none",
  316. });
  317. },
  318. });
  319. },
  320. totalNumberOfComments(tableTotal) {
  321. this.tableTotal = tableTotal;
  322. },
  323. onLinqu(item) {
  324. uni.navigateTo({
  325. url: "/pages/my/wishHelp?id=" + item.myid,
  326. });
  327. },
  328. selPhoto(item, sel) {
  329. this.selImg = sel;
  330. this.home_image = this.image_list[sel];
  331. },
  332. goToDetails(id) {
  333. console.log("goToDetails", id);
  334. uni.navigateTo({
  335. url: "/pages/index/workDetail?id=" + id,
  336. });
  337. console.log("goToDetails", id);
  338. },
  339. toArr(imgs) {
  340. let arr = imgs.split("|");
  341. return arr;
  342. },
  343. previewOpen(imgs1, index) {
  344. this.imgs = imgs1.split("|");
  345. setTimeout(() => this.$refs.previewImage.open(index), 0);
  346. return; //如需测试和uni原生预览差别可注释这两行
  347. },
  348. loadData() {
  349. uni.request({
  350. url: this.$apiHost + "/Article/getinfo",
  351. data: {
  352. uuid: getApp().globalData.uuid,
  353. id: this.arcID,
  354. },
  355. header: {
  356. "content-type": "application/json",
  357. sign: getApp().globalData.headerSign,
  358. },
  359. success: (res) => {
  360. console.log("文章信息:", res.data);
  361. if (res.data.success === "yes") {
  362. // 更新文章信息
  363. if (res.data.article) {
  364. this.articleInfo = res.data.article;
  365. }
  366. this.articleInfo.sms_id = this.sms_id;
  367. this.swperImages = this.imageString(res.data.article.images);
  368. console.log("swperImages", this.swperImages);
  369. this.userInfo.user_id = res.data.id; // 用户id
  370. this.userInfo.user_name = res.data.nickname; // 用户名
  371. this.userInfo.user_avatar = res.data.avator; // 用户头像地址
  372. this.author = res.data.author;
  373. this.workInfo = res.data.work_info;
  374. this.isItMe =
  375. res.data.article.userID == getApp().globalData.user_id
  376. ? true
  377. : false;
  378. const nodes = htmlParser(res.data.article.content);
  379. // #ifdef APP-PLUS-NVUE
  380. parseImgs(nodes);
  381. // #endif
  382. this.content = nodes;
  383. // 更新图片列表
  384. if (res.data.article.images && res.data.article.images !== "") {
  385. this.image_list = res.data.article.images.split(",");
  386. this.home_image = this.image_list[0];
  387. } else {
  388. this.home_image = "../../static/home/avator.png";
  389. }
  390. console.log("img", this.home_image);
  391. // 更新标签列表
  392. // if (res.data.data.tags && res.data.data.tags !== "") {
  393. // this.tag_list = res.data.data.tags.split(",");
  394. // }
  395. } else {
  396. uni.showToast({
  397. title: "获取文章信息失败",
  398. icon: "none",
  399. });
  400. }
  401. },
  402. complete: (com) => {
  403. // uni.hideLoading();
  404. },
  405. fail: (e) => {
  406. console.log("请求失败:", e);
  407. uni.showToast({
  408. title: "网络请求失败",
  409. icon: "none",
  410. });
  411. },
  412. });
  413. },
  414. // 评论相关方法已移至CommentSection组件
  415. // 唤起新评论弹框
  416. openComment() {
  417. if (this.$refs.commentSection) {
  418. this.$refs.commentSection.openComment();
  419. }
  420. },
  421. // 文章点赞
  422. // 分享文章
  423. shareArticle() {
  424. // 如果在微信小程序环境
  425. if (uni.getSystemInfoSync().platform === "mp-weixin") {
  426. uni.showShareMenu({
  427. withShareTicket: true,
  428. menus: ["shareAppMessage", "shareTimeline"],
  429. });
  430. } else {
  431. // 其他环境,如APP
  432. uni.share({
  433. provider: "weixin",
  434. scene: "WXSceneSession",
  435. type: 0,
  436. title: this.articleInfo.title,
  437. summary: this.articleInfo.content.substring(0, 40) + "...",
  438. imageUrl: this.home_image,
  439. success: function (res) {
  440. console.log("分享成功:" + JSON.stringify(res));
  441. },
  442. fail: function (err) {
  443. console.log("分享失败:" + JSON.stringify(err));
  444. },
  445. });
  446. }
  447. },
  448. // 评论回调事件
  449. replyFun({ params }, callback) {
  450. // params = {
  451. // ...params,
  452. // user_id: this.myInfo.user_id, // 用户id
  453. // user_name: this.myInfo.user_name, // 用户名
  454. // user_avatar: this.myInfo.user_avatar, // 用户头像地址
  455. // user_content: this.commentValue, // 用户评论内容
  456. // is_like: false, // 是否点赞
  457. // like_count: 0, // 点赞数统计
  458. // create_time: "刚刚", // 创建时间
  459. // owner: true, // 是否为所有者 所有者可以进行删除 管理员默认true
  460. // };
  461. console.log("replyFun", {
  462. uuid: getApp().globalData.uuid,
  463. article_id: this.arcID, // 文章ID
  464. content: params.user_content, // 评论内容
  465. parent_id: params.parent_id || 0, // 父评论ID
  466. reply_id: params.reply_id || 0, // 回复的评论ID
  467. reply_name: params.reply_name || "", // 被回复人名称
  468. });
  469. uni.request({
  470. url: this.$apiHost + "/Article/newComment",
  471. data: {
  472. uuid: getApp().globalData.uuid,
  473. type: "article",
  474. article_id: this.arcID, // 文章ID
  475. content: params.user_content, // 评论内容
  476. parent_id: params.parent_id || 0, // 父评论ID
  477. reply_id: params.reply_id || 0, // 回复的评论ID
  478. reply_name: params.reply_name || "", // 被回复人名称
  479. },
  480. header: {
  481. "content-type": "application/json",
  482. sign: getApp().globalData.headerSign,
  483. },
  484. success: (res) => {
  485. console.log("评论结果:", res.data);
  486. if (res.data.success === "yes") {
  487. callback(res.data); // 评论成功,传入后端返回的数据
  488. }
  489. },
  490. fail: (e) => {
  491. console.log("评论失败:", e);
  492. uni.showToast({
  493. title: "评论失败,请重试",
  494. icon: "none",
  495. });
  496. },
  497. });
  498. },
  499. /** 删除回调事件
  500. * mode 删除模式
  501. * -- bind: 当被删除的一级评论存在回复评论, 那么该评论内容变更显示为[当前评论内容已被移除]
  502. * -- only: 仅删除当前评论(后端删除相关联的回复评论, 否则总数显示不对)
  503. * -- all : 删除所有评论包括回复评论 前端遍历子评论上报
  504. */
  505. deleteFun({ params, mode }, callback) {
  506. console.log("deleteFun", {
  507. params,
  508. mode,
  509. });
  510. // 将params转换为逗号分隔的字符串
  511. const idsString = Array.isArray(params)
  512. ? params.join(",")
  513. : params.toString();
  514. console.log("删除评论", idsString, mode);
  515. uni.request({
  516. url: this.$apiHost + "/Article/delComment",
  517. data: {
  518. uuid: getApp().globalData.uuid,
  519. ids: idsString, // 将params转换为逗号分隔的字符串传递给ids
  520. mode: mode,
  521. },
  522. header: {
  523. "content-type": "application/json",
  524. sign: getApp().globalData.headerSign,
  525. },
  526. success: (res) => {
  527. console.log("删除结果:", res.data);
  528. if (res.data.success === "yes") {
  529. callback(res);
  530. }
  531. },
  532. fail: (e) => { },
  533. });
  534. // switch (mode) {
  535. // case "bind":
  536. // // 逻辑: 调用接口进行评论内容修改 update
  537. // setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
  538. // break;
  539. // case "only":
  540. // // 逻辑: 调用接口删除一个评论 delete
  541. // setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
  542. // break;
  543. // default:
  544. // // all
  545. // // 逻辑: 调用接口删除多个评论 [delete]
  546. // setTimeout(() => callback(), 500); // 目前为了展示效果, 直接执行callback
  547. // break;
  548. // }
  549. },
  550. showActionSheet() {
  551. if (!this.isItMe) {
  552. this.items = [
  553. {
  554. text: "分享作品",
  555. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  556. },
  557. ];
  558. }
  559. if (this.isItMe) {
  560. this.items = [
  561. {
  562. text: "分享作品",
  563. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  564. },
  565. {
  566. text: "修改帖子",
  567. icon: "../../static/icon/cz_icon_xiugaifengmian.png",
  568. },
  569. {
  570. text: "删除作品",
  571. icon: "../../static/icon/sy_icon_shanchu.png",
  572. danger: true,
  573. },
  574. ];
  575. }
  576. if (this.isMessage) {
  577. this.items = [
  578. {
  579. text: "分享消息",
  580. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  581. },
  582. ];
  583. }
  584. this.$refs.actionSheet.show();
  585. },
  586. handleActionCancel() {
  587. console.log("ActionSheet cancelled");
  588. },
  589. handleActionSelect(index, item) {
  590. console.log("ActionSheet selected index:", item.text);
  591. switch (item.text) {
  592. case "分享作品":
  593. console.log("分享作品");
  594. break;
  595. case "修改帖子":
  596. console.log("修改帖子");
  597. uni.navigateTo({
  598. url: "/pages/make/fabuArticle?id=" + this.articleInfo.id,
  599. });
  600. break;
  601. case "删除作品":
  602. console.log("删除作品");
  603. this.deleteArticle();
  604. break;
  605. }
  606. },
  607. imageString(str) {
  608. if (!str) {
  609. return [];
  610. }
  611. return str.split("|");
  612. },
  613. cutTime(time) {
  614. if (!time) {
  615. return "";
  616. }
  617. return time.split(" ")[0];
  618. },
  619. deleteArticle() {
  620. this.$refs["DialogBox"]
  621. .confirm({
  622. title: "提示",
  623. content: "确定删除该文章吗",
  624. DialogType: "inquiry",
  625. btn1: "取消",
  626. btn2: "确定",
  627. animation: 0,
  628. })
  629. .then(() => {
  630. uni.request({
  631. url: this.$apiHost + "/Article/doAct",
  632. data: {
  633. uuid: getApp().globalData.uuid,
  634. act: "del",
  635. id: this.articleInfo.id,
  636. },
  637. header: {
  638. "content-type": "application/json",
  639. sign: getApp().globalData.headerSign,
  640. },
  641. success: (res) => {
  642. if (res.data.success === "yes") {
  643. uni.showToast({
  644. title: "删除成功",
  645. icon: "success",
  646. });
  647. // 重新获取列表
  648. // this.getArticleList();
  649. setTimeout(() => {
  650. uni.navigateBack({});
  651. }, 800);
  652. } else {
  653. uni.showToast({
  654. title: res.data.str || "删除失败",
  655. icon: "none",
  656. });
  657. }
  658. },
  659. });
  660. })
  661. .catch(() => {
  662. // this.delCloseFun()
  663. });
  664. },
  665. goToUserHomepage(id) {
  666. if (!id) {
  667. return;
  668. }
  669. uni.navigateTo({
  670. url: "/pages/my/userHomepage?id=" + id,
  671. });
  672. },
  673. },
  674. };
  675. </script>
  676. <style scoped lang="scss">
  677. @import "articleDetail.scss";
  678. </style>