workDetail.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  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" @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. <image v-if="!isItMe" @click="showActionSheet(0)" src="../../static/icon/sy_icon_fenxiang.png" mode="widthFix">
  28. </image>
  29. <view v-else class="navbar-right" @click="showActionSheet(1)">
  30. <text class="fa fa-ellipsis-h"></text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 灵感 -->
  35. <template v-if="articleInfo.task_type == 1">
  36. <view class="inspiration-content" v-if="home_image">
  37. <image v-if="home_image" :src="home_image" class="inspirationPictures" mode="widthFix" @click="previewImage(home_image)"></image>
  38. </view>
  39. </template>
  40. <!-- 音乐 -->
  41. <template v-else-if="articleInfo.task_type == 2">
  42. <view class="musicContentBox">
  43. <view class="headCard">
  44. <image :src="home_image" class="songCover"></image>
  45. <view class="songInfo">
  46. <view class="songTitle">{{ addBrackets(articleInfo.title) }}</view>
  47. <view class="songTag">
  48. <view class="tag" v-for="(item, index) in commaToArray(articleInfo.style)" :key="index + item">{{ item }}
  49. </view>
  50. </view>
  51. </view>
  52. <template v-if="articleInfo.task_type == 2">
  53. <image @click="toggleAudio" v-if="isPlaying" src="@/static/makedetail/cz_icon_zanting.png"
  54. class="playerButton"></image>
  55. <image @click="toggleAudio" v-else src="@/static/makedetail/cz_icon_bofang.png" class="playerButton">
  56. </image>
  57. </template>
  58. </view>
  59. <view class="contentHeader">
  60. <view class="musicContent">
  61. <text> {{ articleInfo.lyrics }}</text>
  62. <image class="roll" src="@/static/icon/roll.png"></image>
  63. </view>
  64. <view class="maskLayer"></view>
  65. </view>
  66. </view>
  67. </template>
  68. <!-- 作品描述 -->
  69. <view class="workDescription">
  70. <view class="workDescription-title">
  71. <view>创作说明 </view>
  72. <!-- <image class="pen" src="@/static/icon/wd_icon_bianji.png"></image> -->
  73. </view>
  74. <view class="workDescription-content">
  75. {{ content || "暂无内容" }}
  76. </view>
  77. </view>
  78. <view class="goCreate" @click="goCreate()">去创作</view>
  79. <DialogBox ref="customConfirm"></DialogBox>
  80. <!-- 文章头图区域 -->
  81. <view class="topUser" v-if="false">
  82. <image :src="home_image" class="home_image" mode="aspectFill"></image>
  83. <!-- 图片指示器 -->
  84. <view class="image-indicator" v-if="image_list.length > 1">
  85. <text>{{ selImg + 1 }}/{{ image_list.length }}</text>
  86. </view>
  87. <!-- 音乐类型时显示歌词 -->
  88. <view class="lyrics-overlay" v-if="articleInfo.task_type == 2">
  89. <text class="lyrics-text">{{ articleInfo.lyrics }}</text>
  90. </view>
  91. <!-- 音乐类型时显示播放按钮 -->
  92. <view class="play-button" v-if="articleInfo.task_type == 2 && articleInfo.result_audio" @click="toggleAudio">
  93. <text class="fa" :class="isPlaying ? 'fa-pause' : 'fa-play'"></text>
  94. </view>
  95. <!-- 缩略图列表 -->
  96. <view class="list">
  97. <view class="img" :class="selImg == index ? 'active' : ''" v-for="(item, index) in image_list" :key="index"
  98. @click="selPhoto(item, index)">
  99. <image :src="item" mode="aspectFill"></image>
  100. </view>
  101. </view>
  102. </view>
  103. <!-- 音频元素 -->
  104. <audio id="audioPlayer" :src="articleInfo.result_audio" style="display: none" v-if="false"></audio>
  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. <view class="thread2"></view>
  110. <view class="thread2"></view>
  111. <previewImage ref="previewImage" :opacity="0.8" :circular="true" :imgs="imgs" :descs="descs"></previewImage>
  112. <!-- 评论区域 -->
  113. <CommentSection v-if="userInfo.id != 0 && articleInfo.title" ref="commentSection" :myInfo="myInfo"
  114. :userInfo="userInfo" :articleId="arcID" @totalNumberOfComments="totalNumberOfComments" :articleInfo="articleInfo" find="work">
  115. </CommentSection>
  116. <!-- 自定义 ActionSheet -->
  117. <ActionSheet ref="actionSheet" :items="items" @select="handleActionSelect" @cancel="handleActionCancel" />
  118. <view class="thread2"></view>
  119. <SharePopup :visible="showShare" :userId="userId" :share-title="shareTitle" :share-desc="shareDesc"
  120. :share-img="shareImg" view="workDetail" @close="showShare = false" />
  121. </view>
  122. </template>
  123. <script>
  124. import htmlParser from "../../common/html-parser";
  125. import previewImage from "@/components/kxj-previewImage/kxj-previewImage.vue"; //引用插件
  126. import CommentSection from "@/components/CommentSection/CommentSection.vue";
  127. import ActionSheet from "@/components/ActionSheet/ActionSheet.vue";
  128. import SharePopup from "@/components/SharePopup/SharePopup.vue";
  129. function parseImgs(nodes) {
  130. nodes.forEach((node) => {
  131. if (node.name === "img" && node.attrs && node.attrs["data-img-size-val"]) {
  132. const sizes = node.attrs["data-img-size-val"].split(",");
  133. const width = uni.upx2px(720 * 0.9);
  134. const height = parseInt(width * (sizes[1] / sizes[0]));
  135. node.attrs.style = `width:${width};height:${height};`;
  136. }
  137. if (Array.isArray(node.children)) {
  138. parseImgs(node.children);
  139. }
  140. });
  141. return nodes;
  142. }
  143. export default {
  144. components: {
  145. previewImage,
  146. CommentSection,
  147. ActionSheet,
  148. SharePopup,
  149. },
  150. data() {
  151. return {
  152. title: "",
  153. arcID: 0,
  154. selImg: 0,
  155. home_image: "",
  156. tag_list: [],
  157. image_list: [],
  158. imgs: [],
  159. descs: [],
  160. list_wish: [],
  161. content: "",
  162. author: {},
  163. showShare: false,
  164. shareTitle: "",
  165. shareDesc: "",
  166. shareImg: "",
  167. userId: 0,
  168. // 添加文章信息字段
  169. articleInfo: {
  170. title: "",
  171. content: "",
  172. create_time: "",
  173. images: "",
  174. view_count: 0,
  175. author: "",
  176. like_count: 0,
  177. is_like: false,
  178. },
  179. items: [],
  180. myInfo: {
  181. user_id: getApp().globalData.user_id, // 用户id
  182. user_name: getApp().globalData.nickname, // 用户名
  183. user_avatar: getApp().globalData.avator, // 用户头像地址
  184. },
  185. // 文章作者信息(提示: 一般来自localstorage, 如果是实时获取的话, 那么获取到数据后再v-if显示评论组件)
  186. userInfo: {
  187. user_id: 0, // 用户id
  188. user_name: "", // 用户名
  189. user_avatar: "", // 用户头像地址
  190. },
  191. deleteMode: "all", //删除模式
  192. // 评论总数
  193. tableTotal: 4,
  194. // 评论表
  195. tableData: [],
  196. isPlaying: false, // 添加播放状态
  197. audioPlayer: null, // 添加音频播放器实例
  198. sms_id: 0,
  199. isMessage: true,
  200. isItMe: false,
  201. };
  202. },
  203. onLoad(parms) {
  204. let self = this;
  205. this.arcID = parms.id
  206. if (parms.type == "sms") {
  207. this.isMessage = false;
  208. }
  209. if (parms.sms_id) {
  210. this.sms_id = parms.sms_id;
  211. }
  212. },
  213. onShow() {
  214. uni.$emit("check_update");
  215. this.loadData();
  216. this.$nextTick(() => {
  217. if (this.$refs.commentSection) {
  218. this.$refs.commentSection.loadCommentData();
  219. }
  220. });
  221. },
  222. onReady() {
  223. // 初始化音频播放器
  224. this.audioPlayer = uni.createInnerAudioContext();
  225. this.audioPlayer.onEnded(() => {
  226. this.isPlaying = false;
  227. });
  228. },
  229. onUnload() {
  230. // 页面卸载时停止音频播放
  231. if (this.audioPlayer) {
  232. this.audioPlayer.stop();
  233. this.audioPlayer.destroy();
  234. }
  235. },
  236. methods: {
  237. // 返回上一页
  238. goBack() {
  239. uni.navigateBack({
  240. delta: 1,
  241. });
  242. },
  243. totalNumberOfComments(tableTotal) {
  244. this.tableTotal = tableTotal;
  245. },
  246. onLinqu(item) {
  247. uni.navigateTo({
  248. url: "/pages/my/wishHelp?id=" + item.myid,
  249. });
  250. },
  251. selPhoto(item, sel) {
  252. this.selImg = sel;
  253. this.home_image = this.image_list[sel];
  254. },
  255. toArr(imgs) {
  256. let arr = imgs.split("|");
  257. return arr;
  258. },
  259. previewOpen(imgs1, index) {
  260. this.imgs = imgs1.split("|");
  261. setTimeout(() => this.$refs.previewImage.open(index), 0);
  262. // 传入当前选中的图片地址或序号
  263. return; //如需测试和uni原生预览差别可注释这两行
  264. },
  265. loadData() {
  266. uni.request({
  267. url: this.$apiHost + "/Work/getinfo",
  268. data: {
  269. uuid: getApp().globalData.uuid,
  270. id: this.arcID,
  271. },
  272. header: {
  273. "content-type": "application/json",
  274. sign: getApp().globalData.headerSign,
  275. },
  276. success: (res) => {
  277. console.log("文章信息:", res.data);
  278. if (res.data.success === "yes") {
  279. console.log("文章信息:", res.data.data);
  280. // 更新文章信息
  281. this.articleInfo = res.data.data;
  282. if (res.data.article) {
  283. this.articleInfo = res.data.article;
  284. }
  285. this.articleInfo.sms_id = this.sms_id;
  286. this.content = res.data.data.content;
  287. this.home_image = res.data.data.images;
  288. this.author = res.data.author;
  289. // 更新分享相关数据
  290. this.shareTitle = this.articleInfo.title || '萌创星球';
  291. this.shareDesc = this.articleInfo.content;
  292. this.shareImg = this.home_image;
  293. this.userId = this.articleInfo.userID;
  294. this.isItMe = this.userId == getApp().globalData.user_id
  295. ? true
  296. : false;
  297. this.userInfo.user_id = res.data.id; // 用户id
  298. this.userInfo.user_name = res.data.nickname; // 用户名
  299. this.userInfo.user_avatar = res.data.avator; // 用户头像地址
  300. } else {
  301. uni.showToast({
  302. title: "获取信息失败",
  303. icon: "none",
  304. });
  305. }
  306. },
  307. complete: (com) => {
  308. // uni.hideLoading();
  309. },
  310. fail: (e) => {
  311. console.log("请求失败:", e);
  312. uni.showToast({
  313. title: "网络请求失败",
  314. icon: "none",
  315. });
  316. },
  317. });
  318. },
  319. // 唤起新评论弹框
  320. openComment() {
  321. if (this.$refs.commentSection) {
  322. this.$refs.commentSection.openComment();
  323. }
  324. },
  325. // 文章点赞
  326. likeArticle() {
  327. uni.request({
  328. url: this.$apiHost + "/Work/like",
  329. data: {
  330. uuid: getApp().globalData.uuid,
  331. id: this.arcID,
  332. },
  333. header: {
  334. "content-type": "application/json",
  335. sign: getApp().globalData.headerSign,
  336. },
  337. success: (res) => {
  338. console.log("点赞结果:", res.data);
  339. if (res.data.success === "yes") {
  340. // 更新点赞状态
  341. if (!this.articleInfo.is_like) {
  342. this.articleInfo.like_count =
  343. (this.articleInfo.like_count || 0) + 1;
  344. this.articleInfo.is_like = true;
  345. uni.showToast({
  346. title: "点赞成功",
  347. icon: "none",
  348. });
  349. } else {
  350. this.articleInfo.like_count =
  351. (this.articleInfo.like_count || 0) - 1;
  352. this.articleInfo.is_like = false;
  353. uni.showToast({
  354. title: res.data.str,
  355. icon: "none",
  356. });
  357. }
  358. } else {
  359. uni.showToast({
  360. title: res.data.str,
  361. icon: "none",
  362. });
  363. }
  364. },
  365. fail: (e) => {
  366. console.log("点赞失败:", e);
  367. uni.showToast({
  368. title: "网络请求失败",
  369. icon: "none",
  370. });
  371. },
  372. });
  373. },
  374. // 关注作者
  375. followTheAuthor(n) {
  376. uni.$emit('check_login', () => {
  377. uni.request({
  378. url: this.$apiHost + "/Member/attention",
  379. data: {
  380. uuid: getApp().globalData.uuid,
  381. id: this.author.id,
  382. },
  383. header: {
  384. "content-type": "application/json",
  385. sign: getApp().globalData.headerSign,
  386. },
  387. success: (res) => {
  388. console.log("点赞结果:", res.data);
  389. uni.showToast({
  390. title: res.data.str,
  391. icon: "none",
  392. });
  393. if (res.data.success === "yes") {
  394. console.log("关注结果:", res.data, n);
  395. this.author.is_attention = n;
  396. }
  397. },
  398. fail: (e) => {
  399. console.log("关注失败:", e);
  400. uni.showToast({
  401. title: "网络请求失败",
  402. icon: "none",
  403. });
  404. },
  405. });
  406. })
  407. },
  408. // 分享文章
  409. shareArticle() {
  410. // 如果在微信小程序环境
  411. if (uni.getSystemInfoSync().platform === "mp-weixin") {
  412. uni.showShareMenu({
  413. withShareTicket: true,
  414. menus: ["shareAppMessage", "shareTimeline"],
  415. });
  416. } else {
  417. // 其他环境,如APP
  418. uni.share({
  419. provider: "weixin",
  420. scene: "WXSceneSession",
  421. type: 0,
  422. title: this.articleInfo.title,
  423. summary: this.articleInfo.content.substring(0, 40) + "...",
  424. imageUrl: this.home_image,
  425. success: function (res) {
  426. console.log("分享成功:" + JSON.stringify(res));
  427. },
  428. fail: function (err) {
  429. console.log("分享失败:" + JSON.stringify(err));
  430. },
  431. });
  432. }
  433. },
  434. // 切换音频播放状态
  435. toggleAudio() {
  436. if (!this.articleInfo.result_audio) return;
  437. if (this.isPlaying) {
  438. this.audioPlayer.pause();
  439. this.isPlaying = false;
  440. } else {
  441. this.audioPlayer.src = this.articleInfo.result_audio;
  442. this.audioPlayer.play();
  443. this.isPlaying = true;
  444. }
  445. },
  446. // 新增过滤器方法
  447. commaToArray(str) {
  448. if (!str) return "";
  449. return str.split(",");
  450. },
  451. // 新增过滤器方法
  452. addBrackets(str) {
  453. if (!str) return "";
  454. if (!str.startsWith("《")) {
  455. str = "《" + str;
  456. }
  457. if (!str.endsWith("》")) {
  458. str = str + "》";
  459. }
  460. return str;
  461. },
  462. getInfoData() {
  463. uni.request({
  464. url: this.$apiHost + "/Member/getinfoData",
  465. data: {
  466. uuid: getApp().globalData.uuid,
  467. },
  468. header: {
  469. "content-type": "application/json",
  470. },
  471. success: (res) => {
  472. console.log("用户信息", res.data);
  473. },
  474. });
  475. },
  476. showActionSheet(n) {
  477. uni.$emit('check_login', () => {
  478. if (n == 0) {
  479. // 如果只有一个分享按钮,直接唤醒分享弹窗
  480. this.showShare = true;
  481. return;
  482. }
  483. if (n == 1) {
  484. this.items = [
  485. {
  486. text: "分享作品",
  487. icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
  488. },
  489. {
  490. text: "修改封面",
  491. icon: "../../static/icon/cz_icon_xiugaifengmian.png",
  492. },
  493. {
  494. text: "删除作品",
  495. icon: "../../static/icon/sy_icon_shanchu.png",
  496. danger: true,
  497. },
  498. ];
  499. }
  500. this.$refs.actionSheet.show();
  501. })
  502. },
  503. handleActionCancel() {
  504. console.log("ActionSheet cancelled");
  505. },
  506. handleActionSelect(index, item) {
  507. console.log("ActionSheet selected index:", item.text);
  508. if (item.text === "分享作品") {
  509. this.showShare = true;
  510. } else if (item.text === "修改封面") {
  511. // 修改封面
  512. if (this.articleInfo.status == 3) {
  513. uni.showToast({
  514. title: '作品已完成,无法修改封面!',
  515. icon: 'success'
  516. });
  517. return;
  518. }
  519. this.editCover();
  520. } else if (item.text === "删除作品") {
  521. // 删除作品
  522. this.deleteWork();
  523. }
  524. },
  525. // 修改封面
  526. editCover() {
  527. var _self = this;
  528. uni.chooseImage({
  529. count: 1,
  530. sizeType: ['compressed'],
  531. sourceType: ['album', 'camera'],
  532. success: function (res) {
  533. console.log('res:', res)
  534. if (res.tempFilePaths.length > 0) {
  535. _self.imglocal = res.tempFilePaths[0]
  536. const tempFilePaths = res.tempFilePaths[0];
  537. console.log('tempFilePaths:', tempFilePaths);
  538. const uploadTask = uni.uploadFile({
  539. url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self.skey,
  540. filePath: res.tempFilePaths[0],
  541. name: 'file',
  542. success: function (uploadFileRes) {
  543. let resdata = JSON.parse(uploadFileRes.data)
  544. console.log('Success11:', uploadFileRes);
  545. console.log('Success21:', resdata);
  546. if (resdata.success == 'yes') {
  547. // 调用修改封面接口
  548. uni.request({
  549. url: _self.$apiHost + '/WorkAI/queueAction',
  550. method: 'GET',
  551. data: {
  552. uuid: getApp().globalData.uuid,
  553. act: 'editImg',
  554. result_images: resdata.url,
  555. id: _self.arcID
  556. },
  557. header: {
  558. 'content-type': 'application/json',
  559. 'sign': getApp().globalData.headerSign
  560. },
  561. success: (res) => {
  562. if (res.data.success === "yes") {
  563. // 只有在修改封面成功时才更新页面中的图片
  564. _self.home_image = resdata.url;
  565. uni.showToast({
  566. title: '修改封面成功',
  567. icon: 'success'
  568. });
  569. } else {
  570. uni.showToast({
  571. title: '修改封面失败',
  572. icon: 'none'
  573. });
  574. }
  575. },
  576. fail: () => {
  577. uni.showToast({
  578. title: '修改封面失败',
  579. icon: 'none'
  580. });
  581. }
  582. });
  583. }
  584. },
  585. fail: function (uploadFileFail) {
  586. console.log('Error:', uploadFileFail.data);
  587. uni.showToast({
  588. title: '图片上传失败',
  589. icon: 'none'
  590. });
  591. }
  592. });
  593. }
  594. },
  595. error: function (e) {
  596. console.log(e);
  597. uni.showToast({
  598. title: '选择图片失败',
  599. icon: 'none'
  600. });
  601. }
  602. });
  603. },
  604. // 删除作品
  605. deleteWork() {
  606. this.$refs["customConfirm"]
  607. .confirm({
  608. title: "确认删除",
  609. content: "确定要删除这个作品吗?",
  610. DialogType: "inquiry",
  611. btn1: "再考虑一下",
  612. btn2: "确认解绑",
  613. animation: 0,
  614. })
  615. .then((res) => {
  616. if (res.confirm) {
  617. // 用户点击确定,执行删除操作
  618. this.confirmDelete();
  619. }
  620. });
  621. },
  622. // 确认删除
  623. confirmDelete() {
  624. uni.showLoading({
  625. title: '删除中...'
  626. });
  627. uni.request({
  628. url: this.$apiHost + '/Work/doAct',
  629. method: 'GET',
  630. data: {
  631. uuid: getApp().globalData.uuid,
  632. act: 'del',
  633. id: this.arcID
  634. },
  635. header: {
  636. 'content-type': 'application/json',
  637. 'sign': getApp().globalData.headerSign
  638. },
  639. success: (res) => {
  640. uni.hideLoading();
  641. if (res.data.success === "yes") {
  642. uni.showToast({
  643. title: '删除成功',
  644. icon: 'success'
  645. });
  646. // 删除成功后返回上一页
  647. setTimeout(() => {
  648. uni.navigateBack({
  649. delta: 1
  650. });
  651. }, 1500);
  652. } else {
  653. uni.showToast({
  654. title: '删除失败',
  655. icon: 'none'
  656. });
  657. }
  658. },
  659. fail: () => {
  660. uni.hideLoading();
  661. uni.showToast({
  662. title: '删除失败',
  663. icon: 'none'
  664. });
  665. }
  666. });
  667. },
  668. goCreate() {
  669. // 切换到标签页
  670. uni.switchTab({
  671. // 指定要切换到的页面路径
  672. url: "/pages/make/index",
  673. });
  674. },
  675. goToUserHomepage(id) {
  676. uni.$emit('check_login', () => {
  677. if (!id) {
  678. return;
  679. }
  680. uni.navigateTo({
  681. url: "/pages/my/userHomepage?id=" + id,
  682. });
  683. })
  684. },
  685. // 预览图片
  686. previewImage(url) {
  687. if (!url) return;
  688. uni.previewImage({
  689. urls: [url],
  690. current: url,
  691. indicator: 'number',
  692. loop: true,
  693. showmenu:false
  694. });
  695. },
  696. },
  697. };
  698. </script>
  699. <style scoped lang="scss">
  700. @import "workDetail.scss";
  701. </style>