tweetDetail.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177
  1. <template>
  2. <view class="container" :style="'overflow:' + (showPage ? 'hidden' : 'visible')" v-if="info">
  3. <!-- 作者信息区域 -->
  4. <view class="author">
  5. <img mode="aspectFill" :src="info.userPhoto" @click="handleGoMyHome(info.userId)" />
  6. <view class="author_name">{{ info.userName }}</view>
  7. <view class="author_btn" v-if="info.isFollow !== 2" @click="handleFollow">{{ info.isFollow === 0 ? '关注' : '已关注' }}</view>
  8. </view>
  9. <!-- 轮播图区域 -->
  10. <swiper indicator-color="#ccc" indicator-active-color="#096562" indicator-dots autoplay circular class="swiper" v-if="info.images">
  11. <swiper-item class="swiper_item" v-for="(item, current) in info.images" :key="current" @click="handleClickSwiper(info.images, current)">
  12. <img mode="aspectFill" class="img" :src="item" />
  13. </swiper-item>
  14. </swiper>
  15. <video
  16. v-if="info.video"
  17. class="swiper"
  18. :src="info.video"
  19. id="myVideo"
  20. :show-fullscreen-btn="false"
  21. :direction="0"
  22. @fullscreenchange="fullscreenchange"
  23. @click="handleClickVideo('myVideo')"
  24. ></video>
  25. <!-- 推文信息区域 -->
  26. <view class="tweet">
  27. <view class="tweet_title">{{ info.title }}</view>
  28. <view class="tweet_msg">{{ info.content }}</view>
  29. <view class="tweet_info">{{ info.dateStr }} {{ info.townName }}</view>
  30. </view>
  31. <!-- 关联民宿区域 -->
  32. <view class="and">
  33. <!-- 每一个关联民宿区域 -->
  34. <view class="and_box" v-for="item in info.hotels" :key="item.id" @click="goHotelDetail(item)">
  35. <img mode="aspectFill" :src="item.coverImg" />
  36. <view class="box_detail">
  37. <view class="detail_name">
  38. {{ item.name }}
  39. <img class="img" :src="item.isCollect === 0 ? '../../static/index/like.png' : '../../static/index/like-active.png'" @click.stop="handleLikeHotel(item)" />
  40. </view>
  41. <view class="detail_leave" v-if="item.type === 1">银宿级</view>
  42. <view class="detail_leave" v-if="item.type === 2">金宿级</view>
  43. <view class="detail_leave" v-if="item.type === 3">白金级</view>
  44. <view class="detail_num">
  45. <view class="num_rate">{{ item.score.toFixed(1) }}分</view>
  46. <view class="num_comment">{{ item.comment }}条评论</view>
  47. <view class="num_price">
  48. ¥{{ item.price }}
  49. <text>起</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 关联民宿查看全部区域 -->
  55. <view class="and_all" @click="handleClickALL">查看全部 >></view>
  56. </view>
  57. <!-- 点赞人数区域 -->
  58. <view class="like" v-if="info.likes.length !== 0">
  59. <uv-avatar-group mode="aspectFill" :urls="info.likes" size="30" gap="0.3" maxCount="10"></uv-avatar-group>
  60. <view class="like_text" @click="handleGoPageLike">{{ info.likeNum }}人已赞</view>
  61. </view>
  62. <!-- 评论总条数区域 -->
  63. <view class="total" v-if="info.commentNum">共{{ info.commentNum }}条评论</view>
  64. <!-- 评论输入框区域 -->
  65. <view class="input_box">
  66. <input type="text" confirm-type="send" placeholder="爱评论的人运气都不差" v-model="commentsValue" @confirm="handleInput" />
  67. </view>
  68. <!-- 评论列表区域 -->
  69. <view class="comment_list" v-if="info.comments">
  70. <!-- 每一个评论区域 -->
  71. <view class="comment_box" v-for="item in info.comments" :key="item.id">
  72. <view class="box_left">
  73. <img mode="aspectFill" :src="item.image" @click="handleGoMyHome(item.userId)" />
  74. </view>
  75. <view class="box_right">
  76. <view class="right_name">{{ item.userName }}</view>
  77. <view class="right_content">{{ item.content }}</view>
  78. <view class="right_time">{{ item.date.slice(0, 19) }}</view>
  79. </view>
  80. </view>
  81. <!-- 查看全部评论区域 -->
  82. <view class="comment_all" @click="handleClickComment">查看全部评论 >></view>
  83. </view>
  84. <!-- 相关推文区域 -->
  85. <view class="related" v-if="bindTweetList.length !== 0">
  86. <view class="related_title">相关推文</view>
  87. <!-- 相关推文列表区域 -->
  88. <view class="related_list">
  89. <!-- 每一个推文区域 -->
  90. <view class="related_box" v-for="item in bindTweetList" :key="item.id" @click="handleGoBind(item)">
  91. <img class="box_cover" v-if="item.image" mode="aspectFill" :src="item.image" />
  92. <video class="box_cover" v-if="item.video" :src="item.video" :show-center-play-btn="false" :show-fullscreen-btn="false" :show-play-btn="false"></video>
  93. <view class="box_content">{{ item.title }}</view>
  94. <view class="box_info">
  95. <img class="img" mode="aspectFill" :src="item.userPhoto" />
  96. <view class="info_name">{{ item.userName }}</view>
  97. <img
  98. class="img2"
  99. mode="aspectFill"
  100. :src="item.isCollect === 0 ? '../../static/index/like.png' : '../../static/index/like-active.png'"
  101. @click.stop="handleClickLike(item)"
  102. />
  103. <view class="info_count">{{ item.collectNum }}</view>
  104. </view>
  105. <!-- 乡镇信息区域 -->
  106. <view class="box_town">{{ item.townName }}</view>
  107. <!-- 视频图标 -->
  108. <img v-if="item.video" class="box_play" src="../../static/index/video.png" />
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 底部点赞 评论 收藏区域 -->
  113. <view class="tab">
  114. <!-- 点赞 -->
  115. <view class="tab_box">
  116. <img class="img" :src="info.isLike === 0 ? '../../static/index/upvote.png' : '../../static/index/upvote-active.png'" @click="clickBtnLike" />
  117. {{ info.likeNum }}
  118. </view>
  119. <!-- 评论 -->
  120. <view class="tab_box" @click="handleClickComment">
  121. <img class="img2" src="../../static/index/comment.png" />
  122. {{ info.commentNum }}
  123. </view>
  124. <!-- 收藏 -->
  125. <view class="tab_box">
  126. <img class="img" :src="info.isCollect === 0 ? '../../static/index/like.png' : '../../static/index/like-active.png'" @click="handleClickLike(info)" />
  127. {{ info.collectNum }}
  128. </view>
  129. </view>
  130. <!-- 点击评论弹窗区域 -->
  131. <uv-popup ref="popup" bgColor="none" :safeAreaInsetBottom="false" :closeOnClickOverlay="false">
  132. <view class="body_pop" v-if="commentList.length">
  133. <!-- 评论总数区域 -->
  134. <view class="pop_title">
  135. 共{{ totalComment }}条评论
  136. <img class="pop_icon" src="../../static/index/close3.png" @click="handleClosePop" />
  137. </view>
  138. <!-- 评论列表区域 -->
  139. <scroll-view class="pop_list" scroll-y @scrolltolower="handleTolowerComment">
  140. <!-- 每一条评论区域 -->
  141. <view class="pop_item" v-for="item in commentList" :key="item.id">
  142. <!-- 用户区域 -->
  143. <view class="item_user" @click="handleComment(item)">
  144. <img mode="aspectFill" :src="item.image" @click.stop="handleGoMyHome(item.userId)" />
  145. <view class="user_info">
  146. {{ item.userName }}
  147. </view>
  148. </view>
  149. <!-- 评价内容区域 -->
  150. <view class="item_content" @click="handleComment(item)">
  151. <view class="content_top">
  152. {{ item.content }}
  153. </view>
  154. <view class="content_bottom">
  155. {{ item.date.slice(0, 19) }}
  156. </view>
  157. </view>
  158. <!-- 二级评论区域 -->
  159. <view class="item_child">
  160. <CommentChild3 v-if="item.childrens" :list="item.childrens" :commentParentId="tweetId" />
  161. </view>
  162. </view>
  163. </scroll-view>
  164. </view>
  165. <!-- 评论输入框区域 -->
  166. <view class="body_input" v-if="commentList.length">
  167. <view class="input_box">
  168. <input type="text" confirm-type="send" placeholder="说点什么呢~" v-model="popInputValue" @confirm="handleInputPop" />
  169. </view>
  170. </view>
  171. </uv-popup>
  172. <!-- 点击关联民宿弹窗区域 -->
  173. <uv-popup ref="popup_bind" bgColor="none" :safeAreaInsetBottom="false" :closeOnClickOverlay="false">
  174. <view class="body_pop">
  175. <!-- 评论总数区域 -->
  176. <view class="pop_title">
  177. 全部
  178. <img class="pop_icon" src="../../static/index/close3.png" @click="handleClosePopBind" />
  179. </view>
  180. <!-- 关联民宿列表区域 -->
  181. <scroll-view class="pop_list" v-if="bindList.length" scroll-y @scrolltolower="handleTolower">
  182. <!-- 每一个民宿区域 -->
  183. <view class="pop_item_bind" v-for="item in bindList" :key="item.id" @click="goHotelDetail(item)">
  184. <img mode="aspectFill" :src="item.coverImg" />
  185. <view class="box_detail">
  186. <view class="detail_name">
  187. {{ item.name }}
  188. <img
  189. class="img"
  190. :src="item.isCollect === 0 ? '../../static/index/like.png' : '../../static/index/like-active.png'"
  191. @click.stop="handleLikeHotel(item)"
  192. />
  193. </view>
  194. <view class="detail_leave" v-if="item.type === 1">银宿级</view>
  195. <view class="detail_leave" v-if="item.type === 2">金宿级</view>
  196. <view class="detail_leave" v-if="item.type === 3">白金级</view>
  197. <view class="detail_num">
  198. <view class="num_rate">{{ item.score.toFixed(1) }}分</view>
  199. <view class="num_comment">{{ item.comment }}条评论</view>
  200. <view class="num_price">
  201. ¥{{ item.price }}
  202. <text>起</text>
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. </scroll-view>
  208. </view>
  209. </uv-popup>
  210. </view>
  211. </template>
  212. <script>
  213. import CommentChild3 from '@/components/commentChild3.vue'
  214. export default {
  215. components: { CommentChild3 },
  216. data() {
  217. return {
  218. // 滚动穿透控制
  219. showPage: false,
  220. // 推文id
  221. tweetId: '',
  222. // 乡镇id
  223. townId: '',
  224. // 用户id
  225. userId: '',
  226. // 推文信息
  227. info: null,
  228. // 相关推文列表数组
  229. bindTweetList: [],
  230. // 弹窗评论列表当前页
  231. pageComment: 1,
  232. // 弹窗评论列表每页多少条
  233. rowsComment: 10,
  234. // 弹窗评论列表总条数
  235. totalComment: null,
  236. // 弹窗评论列表
  237. commentList: [],
  238. // 弹窗关联民宿列表
  239. bindList: [],
  240. // 弹窗关联民宿当前页
  241. pageBind: 1,
  242. // 弹窗关联民宿每页多少条
  243. rowsBind: 10,
  244. // 弹窗关联民宿总条数
  245. totalBind: null,
  246. // 一级评论框绑定数值
  247. commentsValue: '',
  248. // 评论弹窗评论框绑定数值
  249. popInputValue: '',
  250. // 相关推文当前页
  251. pageTweet: 1,
  252. // 相关推文每页多少条
  253. rowsTweet: 10,
  254. // 相关推文总条数
  255. totalTweet: null,
  256. // video 上下文 videoContext 对象
  257. videoContext: null,
  258. // 是否是全屏状态
  259. isFullScreen: false
  260. }
  261. },
  262. mounted() {
  263. // 开启转发功能
  264. uni.showShareMenu({
  265. withShareTicket: true,
  266. menus: ['shareAppMessage', 'shareTimeline']
  267. })
  268. },
  269. onShow() {
  270. let flag = uni.getStorageSync('openid')
  271. let tokenId = uni.getStorageSync('tokenId')
  272. if (tokenId && flag) {
  273. this.userId = uni.getStorageSync('userInfo').id
  274. this.getTweetInfo()
  275. this.getBindTweet()
  276. } else {
  277. uni.navigateTo({
  278. url: '/pages/login/login'
  279. })
  280. }
  281. },
  282. onLoad(options) {
  283. this.tweetId = options.id
  284. this.townId = options.townId
  285. uni.$on('getReset', this.getReset)
  286. },
  287. onReachBottom() {
  288. if (this.bindTweetList.length < this.totalTweet) {
  289. this.pageTweet++
  290. this.getBindTweet()
  291. } else {
  292. uni.showToast({
  293. title: '没有更多数据了',
  294. icon: 'none'
  295. })
  296. }
  297. },
  298. methods: {
  299. // 获取推文详细信息
  300. async getTweetInfo(id) {
  301. const res = await this.$myRequest({
  302. url: '/mhotel/articlequeryDetail.action',
  303. data: {
  304. id: id ? id : this.tweetId,
  305. userId: this.userId
  306. }
  307. })
  308. // console.log(res)
  309. if (res.code === 200) {
  310. this.info = res.data
  311. }
  312. },
  313. // 获取相关推文数组
  314. async getBindTweet() {
  315. const res = await this.$myRequest({
  316. url: '/mhotel/articlerelatedTweets.action',
  317. data: {
  318. id: this.tweetId,
  319. townId: this.townId,
  320. userId: this.userId,
  321. page: this.pageTweet,
  322. rows: this.rowsTweet
  323. }
  324. })
  325. // console.log(res)
  326. if (res.code === 200) {
  327. this.bindTweetList = res.data.pageList
  328. this.totalTweet = res.data.total
  329. }
  330. },
  331. // 关注或者取消关注请求
  332. async handleFollow() {
  333. const res = await this.$myRequest({
  334. url: '/mhotel/articlefollowAuthor.action',
  335. data: {
  336. authorId: this.info.userId,
  337. userId: this.userId
  338. }
  339. })
  340. // console.log(res)
  341. if (res.code === 200) {
  342. this.info.isFollow === 0 ? (this.info.isFollow = 1) : (this.info.isFollow = 0)
  343. }
  344. },
  345. // 点击关联民宿爱心图标回调
  346. async handleLikeHotel(item) {
  347. const res = await this.$myRequest({
  348. url: item.isCollect === 0 ? '/mhotel/ahpcollectHotel.action' : '/mhotel/ahpdelCollectHotel.action',
  349. data: {
  350. hotelId: item.id,
  351. userId: this.userId
  352. }
  353. })
  354. // console.log(res)
  355. if (res.code === 200) {
  356. item.isCollect === 0 ? (item.isCollect = 1) : (item.isCollect = 0)
  357. this.getTweetInfo()
  358. }
  359. },
  360. // 点击民宿前往民宿详情回调
  361. goHotelDetail(item) {
  362. this.showPage = false
  363. this.$refs.popup_bind.close()
  364. uni.navigateTo({
  365. url: `/pages/detail/detail?id=${item.id}&town=${this.info.townName}`
  366. })
  367. },
  368. // 点击轮播图图片回调
  369. handleClickSwiper(urls, current) {
  370. uni.previewImage({
  371. urls,
  372. current
  373. })
  374. },
  375. // 一级评论框确定输入回调
  376. async handleInput(e) {
  377. const res = await this.$myRequest({
  378. url: '/mhotel/articlecommentArticle.action',
  379. method: 'post',
  380. data: {
  381. articleId: this.tweetId,
  382. parentId: 0,
  383. userId: this.userId,
  384. content: e.detail.value
  385. }
  386. })
  387. // console.log(res)
  388. if (res.code === 200) {
  389. this.commentsValue = ''
  390. this.getTweetInfo()
  391. }
  392. },
  393. // 评论弹窗输入框回调
  394. async handleInputPop(e) {
  395. const res = await this.$myRequest({
  396. url: '/mhotel/articlecommentArticle.action',
  397. method: 'post',
  398. data: {
  399. articleId: this.tweetId,
  400. parentId: 0,
  401. userId: this.userId,
  402. content: e.detail.value
  403. }
  404. })
  405. // console.log(res)
  406. if (res.code === 200) {
  407. this.popInputValue = ''
  408. this.commentList = []
  409. this.pageComment = 1
  410. this.handleClickCommentReq()
  411. this.getTweetInfo()
  412. }
  413. },
  414. // 点击底部tab评论按钮回调
  415. handleClickComment() {
  416. if (this.info.comments) {
  417. this.commentList = []
  418. this.showPage = true
  419. this.$refs.popup.open('bottom')
  420. this.handleClickCommentReq()
  421. } else {
  422. uni.showToast({
  423. title: '暂无评论',
  424. icon: 'none'
  425. })
  426. }
  427. },
  428. async handleClickCommentReq() {
  429. const res = await this.$myRequest({
  430. url: '/mhotel/articlequeryCommentList.action',
  431. data: {
  432. id: this.tweetId,
  433. page: this.pageComment,
  434. rows: this.rowsComment
  435. }
  436. })
  437. // console.log(res)
  438. if (res.code === 200) {
  439. this.commentList = [...this.commentList, ...res.data.pageList]
  440. this.totalComment = res.data.total
  441. }
  442. },
  443. // 点击评论弹窗关闭图标回调
  444. handleClosePop() {
  445. this.showPage = false
  446. this.$refs.popup.close()
  447. },
  448. // 点击关联民宿查看全部按钮回调
  449. handleClickALL() {
  450. this.bindList = []
  451. this.showPage = true
  452. this.$refs.popup_bind.open('bottom')
  453. this.handleClickALLReq()
  454. },
  455. async handleClickALLReq() {
  456. const res = await this.$myRequest({
  457. url: '/mhotel/articlequeryHotelList.action',
  458. data: {
  459. id: this.tweetId,
  460. userId: this.userId,
  461. page: this.pageBind,
  462. rows: this.rowsBind
  463. }
  464. })
  465. // console.log(res)
  466. if (res.code === 200) {
  467. this.bindList = [...this.bindList, ...res.data.pageList]
  468. this.totalBind = res.data.total
  469. }
  470. },
  471. // 点击关联民宿弹窗关闭图标回调
  472. handleClosePopBind() {
  473. this.showPage = false
  474. this.$refs.popup_bind.close()
  475. },
  476. handleGoPageLike() {
  477. uni.navigateTo({
  478. url: `/pagesSub/likeList/likeList?id=${this.info.id}`
  479. })
  480. },
  481. // 相关推文点击爱心回调
  482. async handleClickLike(item) {
  483. const res = await this.$myRequest({
  484. url: '/mhotel/articlecollectArticle.action',
  485. data: {
  486. id: item.id,
  487. userId: this.userId
  488. }
  489. })
  490. // console.log(res)
  491. if (res.code === 200) {
  492. item.isCollect === 1 ? ((item.isCollect = 0), (item.collectNum -= 1)) : ((item.isCollect = 1), (item.collectNum += 1))
  493. }
  494. },
  495. // 点击底部点赞按钮回调
  496. async clickBtnLike() {
  497. const res = await this.$myRequest({
  498. url: '/mhotel/articlelikeArticle.action',
  499. data: {
  500. id: this.tweetId,
  501. userId: this.userId
  502. }
  503. })
  504. // console.log(res)
  505. if (res.code === 200) {
  506. this.getTweetInfo()
  507. }
  508. },
  509. handleGoBind(item) {
  510. this.tweetId = item.id
  511. this.townId = item.townId
  512. this.bindTweetList = []
  513. this.info = null
  514. this.getTweetInfo()
  515. this.getBindTweet()
  516. },
  517. handleComment(item) {
  518. uni.showModal({
  519. title: '请输入评论',
  520. editable: true,
  521. success: async (res) => {
  522. if (res.confirm) {
  523. const result = res.content
  524. if (!res.content) {
  525. uni.showToast({
  526. title: '评论内容不能为空',
  527. icon: 'none',
  528. mask: true
  529. })
  530. setTimeout(() => {
  531. this.handleComment()
  532. }, 1500)
  533. } else {
  534. const res = await this.$myRequest({
  535. url: '/mhotel/articlecommentArticle.action',
  536. method: 'post',
  537. data: {
  538. articleId: this.tweetId,
  539. parentId: item.id,
  540. userId: this.userId,
  541. content: result
  542. }
  543. })
  544. // console.log(res);
  545. if (res.code === 200) {
  546. this.getReset()
  547. }
  548. }
  549. }
  550. }
  551. })
  552. },
  553. getReset() {
  554. this.commentList = []
  555. this.pageComment = 1
  556. this.handleClickCommentReq()
  557. },
  558. handleTolower() {
  559. if (this.bindList.length < this.totalBind) {
  560. this.pageBind++
  561. this.handleClickALLReq()
  562. } else {
  563. uni.showToast({
  564. title: '没有更多数据了',
  565. icon: 'none'
  566. })
  567. }
  568. },
  569. handleTolowerComment() {
  570. if (this.commentList.length < this.totalComment) {
  571. this.pageComment++
  572. this.handleClickCommentReq()
  573. } else {
  574. uni.showToast({
  575. title: '没有更多数据了',
  576. icon: 'none'
  577. })
  578. }
  579. },
  580. // 进入全屏和退出全屏时触发的回调
  581. fullscreenchange(e) {
  582. this.isFullScreen = e.detail.fullScreen
  583. },
  584. // 点击视频控件时触发的回调
  585. handleClickVideo(id) {
  586. this.videoContext = uni.createVideoContext(id)
  587. if (this.isFullScreen) {
  588. this.videoContext.pause()
  589. this.videoContext.exitFullScreen()
  590. } else {
  591. this.videoContext.requestFullScreen()
  592. this.videoContext.play()
  593. }
  594. },
  595. handleGoMyHome(userId) {
  596. uni.navigateTo({
  597. url: `/pagesSub/myHome/myHome?userId=${userId}`
  598. })
  599. }
  600. }
  601. }
  602. </script>
  603. <style lang="scss" scoped>
  604. .container {
  605. padding-bottom: 130rpx;
  606. min-height: 100vh;
  607. background-color: #fff;
  608. .author {
  609. display: flex;
  610. align-items: center;
  611. padding: 0 20rpx;
  612. height: 100rpx;
  613. img {
  614. width: 50rpx;
  615. height: 50rpx;
  616. border-radius: 50%;
  617. }
  618. .author_name {
  619. margin-left: 15rpx;
  620. font-size: 28rpx;
  621. font-weight: bold;
  622. }
  623. .author_btn {
  624. display: flex;
  625. justify-content: center;
  626. align-items: center;
  627. margin-left: auto;
  628. width: 107rpx;
  629. height: 50rpx;
  630. color: #096562;
  631. font-size: 24rpx;
  632. border-radius: 69rpx;
  633. border: 1rpx solid #096562;
  634. }
  635. }
  636. .swiper {
  637. width: 100%;
  638. height: 495rpx;
  639. .swiper_item {
  640. width: 100%;
  641. height: 100%;
  642. .img {
  643. width: 100%;
  644. height: 440rpx;
  645. }
  646. }
  647. }
  648. .tweet {
  649. margin: auto;
  650. width: 710rpx;
  651. border-bottom: 1rpx solid #e6e6e6;
  652. .tweet_title {
  653. line-height: 50rpx;
  654. font-size: 32rpx;
  655. font-weight: bold;
  656. }
  657. .tweet_msg {
  658. margin-top: 10rpx;
  659. line-height: 40rpx;
  660. font-size: 28rpx;
  661. }
  662. .tweet_info {
  663. margin-top: 20rpx;
  664. height: 55rpx;
  665. color: #999999;
  666. font-size: 24rpx;
  667. }
  668. }
  669. .and {
  670. padding: 20rpx 0;
  671. margin: auto;
  672. width: 710rpx;
  673. border-bottom: 1rpx solid #e6e6e6;
  674. .and_box {
  675. display: flex;
  676. margin-bottom: 20rpx;
  677. width: 710rpx;
  678. height: 150rpx;
  679. background-color: #f2f2f2;
  680. img {
  681. width: 126rpx;
  682. height: 150rpx;
  683. }
  684. .box_detail {
  685. flex: 1;
  686. display: flex;
  687. flex-direction: column;
  688. justify-content: space-evenly;
  689. padding: 0 23rpx;
  690. overflow: hidden;
  691. .detail_name {
  692. display: flex;
  693. justify-content: space-between;
  694. align-items: center;
  695. font-size: 28rpx;
  696. font-weight: bold;
  697. overflow: hidden;
  698. text-overflow: ellipsis;
  699. white-space: nowrap;
  700. .img {
  701. width: 40rpx;
  702. height: 40rpx;
  703. }
  704. }
  705. .detail_leave {
  706. color: #808080;
  707. font-size: 24rpx;
  708. }
  709. .detail_num {
  710. display: flex;
  711. align-items: center;
  712. font-size: 24rpx;
  713. .num_rate {
  714. color: #ff5733;
  715. }
  716. .num_comment {
  717. margin-left: 15rpx;
  718. color: #a6a6a6;
  719. }
  720. .num_price {
  721. margin-left: auto;
  722. font-size: 28rpx;
  723. color: #ff5733;
  724. text {
  725. margin-left: 5rpx;
  726. font-size: 20rpx;
  727. color: #a6a6a6;
  728. }
  729. }
  730. }
  731. }
  732. }
  733. .and_all {
  734. display: flex;
  735. justify-content: center;
  736. align-items: center;
  737. width: 710rpx;
  738. height: 80rpx;
  739. color: #096562;
  740. font-size: 28rpx;
  741. background-color: #f2f2f2;
  742. }
  743. }
  744. .like {
  745. display: flex;
  746. align-items: center;
  747. padding: 0 20rpx;
  748. height: 108rpx;
  749. color: #808080;
  750. font-size: 28rpx;
  751. .like_text {
  752. margin-left: 18rpx;
  753. }
  754. }
  755. .total {
  756. margin: auto;
  757. width: 710rpx;
  758. height: 60rpx;
  759. line-height: 60rpx;
  760. font-size: 28rpx;
  761. color: #808080;
  762. }
  763. .input_box {
  764. margin: 10rpx auto 0;
  765. width: 710rpx;
  766. height: 66rpx;
  767. font-size: 24rpx;
  768. border-radius: 47rpx;
  769. background-color: #f2f2f2;
  770. input {
  771. box-sizing: border-box;
  772. padding: 0 33rpx;
  773. width: 100%;
  774. height: 100%;
  775. }
  776. }
  777. .comment_list {
  778. margin: auto;
  779. width: 710rpx;
  780. .comment_box {
  781. display: flex;
  782. box-sizing: border-box;
  783. padding-top: 30rpx;
  784. .box_left {
  785. width: 75rpx;
  786. img {
  787. width: 60rpx;
  788. height: 60rpx;
  789. border-radius: 50%;
  790. }
  791. }
  792. .box_right {
  793. flex: 1;
  794. flex-wrap: wrap;
  795. font-size: 24rpx;
  796. border-bottom: 1rpx solid #e6e6e6;
  797. .right_name {
  798. color: #808080;
  799. }
  800. .right_content {
  801. margin-top: 12rpx;
  802. word-break: break-all;
  803. }
  804. .right_time {
  805. margin: 12rpx 0 20rpx;
  806. color: #808080;
  807. }
  808. }
  809. }
  810. .comment_all {
  811. display: flex;
  812. justify-content: center;
  813. align-items: center;
  814. width: 710rpx;
  815. height: 80rpx;
  816. color: #096562;
  817. font-size: 28rpx;
  818. background-color: #f2f2f2;
  819. }
  820. }
  821. .related {
  822. margin: auto;
  823. width: 710rpx;
  824. .related_title {
  825. line-height: 105rpx;
  826. font-size: 32rpx;
  827. font-weight: bold;
  828. }
  829. .related_list {
  830. display: grid;
  831. grid-template-columns: 1fr 1fr;
  832. grid-auto-rows: auto;
  833. gap: 40rpx;
  834. .related_box {
  835. position: relative;
  836. width: 335rpx;
  837. background-color: #f7f7f7;
  838. .box_cover {
  839. width: 335rpx;
  840. height: 463rpx;
  841. border-radius: 10rpx 10rpx 0 0;
  842. }
  843. .box_content {
  844. padding: 10rpx 60rpx 10rpx 20rpx;
  845. font-size: 28rpx;
  846. font-weight: bold;
  847. word-break: break-all;
  848. overflow: hidden;
  849. text-overflow: ellipsis;
  850. white-space: nowrap;
  851. }
  852. .box_info {
  853. padding: 0 20rpx;
  854. display: flex;
  855. align-items: center;
  856. height: 50rpx;
  857. font-size: 20rpx;
  858. color: #666666;
  859. .img {
  860. width: 30rpx;
  861. height: 30rpx;
  862. border-radius: 50%;
  863. }
  864. .info_name {
  865. margin-left: 10rpx;
  866. }
  867. .img2 {
  868. margin-left: auto;
  869. width: 28rpx;
  870. height: 28rpx;
  871. }
  872. .info_count {
  873. margin-left: 5rpx;
  874. }
  875. }
  876. .box_town {
  877. position: absolute;
  878. top: 405rpx;
  879. left: 22rpx;
  880. padding: 0 20rpx;
  881. display: flex;
  882. justify-content: center;
  883. align-items: center;
  884. height: 43rpx;
  885. color: #fff;
  886. font-size: 20rpx;
  887. border-radius: 42rpx;
  888. background-color: rgba(0, 0, 0, 0.3);
  889. }
  890. .box_play {
  891. position: absolute;
  892. top: 20rpx;
  893. right: 20rpx;
  894. width: 50rpx;
  895. height: 50rpx;
  896. }
  897. }
  898. }
  899. }
  900. .tab {
  901. position: fixed;
  902. bottom: 0;
  903. left: 0;
  904. z-index: 999;
  905. display: flex;
  906. justify-content: space-evenly;
  907. align-items: center;
  908. width: 100%;
  909. height: 110rpx;
  910. border-top: 1rpx solid #e6e6e6;
  911. background-color: #fff;
  912. .tab_box {
  913. display: flex;
  914. justify-content: center;
  915. align-items: center;
  916. width: 200rpx;
  917. .img {
  918. margin-right: 10rpx;
  919. width: 45rpx;
  920. height: 45rpx;
  921. }
  922. .img2 {
  923. margin-right: 10rpx;
  924. width: 35rpx;
  925. height: 35rpx;
  926. }
  927. }
  928. }
  929. .body_pop {
  930. position: relative;
  931. height: 955rpx;
  932. border-radius: 22rpx 22rpx 0 0;
  933. background-color: #fff;
  934. .pop_title {
  935. position: fixed;
  936. top: 0;
  937. left: 0;
  938. right: 0;
  939. display: flex;
  940. justify-content: center;
  941. align-items: center;
  942. height: 110rpx;
  943. font-size: 28rpx;
  944. background-color: #fff;
  945. .pop_icon {
  946. position: absolute;
  947. top: 35rpx;
  948. right: 35rpx;
  949. width: 36rpx;
  950. height: 36rpx;
  951. }
  952. }
  953. .pop_list {
  954. box-sizing: border-box;
  955. padding: 110rpx 20rpx 30rpx;
  956. height: 955rpx;
  957. .pop_item {
  958. margin-bottom: 10rpx;
  959. padding-bottom: 10rpx;
  960. border-bottom: 1rpx solid #e6e6e6;
  961. .item_user {
  962. display: flex;
  963. align-items: center;
  964. height: 70rpx;
  965. img {
  966. width: 60rpx;
  967. height: 60rpx;
  968. border-radius: 50%;
  969. }
  970. .user_info {
  971. display: flex;
  972. align-items: center;
  973. margin-left: 18rpx;
  974. height: 70rpx;
  975. color: #808080;
  976. font-size: 24rpx;
  977. }
  978. }
  979. .item_content {
  980. margin-left: 80rpx;
  981. font-size: 24rpx;
  982. .content_top {
  983. }
  984. .content_bottom {
  985. margin: 10rpx 0;
  986. color: #808080;
  987. }
  988. .content_key {
  989. color: #808080;
  990. }
  991. }
  992. .item_child {
  993. margin-left: 50rpx;
  994. }
  995. }
  996. .pop_item_bind {
  997. display: flex;
  998. margin-bottom: 20rpx;
  999. width: 710rpx;
  1000. height: 150rpx;
  1001. background-color: #f2f2f2;
  1002. img {
  1003. width: 126rpx;
  1004. height: 150rpx;
  1005. }
  1006. .box_detail {
  1007. flex: 1;
  1008. display: flex;
  1009. flex-direction: column;
  1010. justify-content: space-evenly;
  1011. padding: 0 23rpx;
  1012. overflow: hidden;
  1013. .detail_name {
  1014. display: flex;
  1015. justify-content: space-between;
  1016. align-items: center;
  1017. font-size: 28rpx;
  1018. font-weight: bold;
  1019. overflow: hidden;
  1020. text-overflow: ellipsis;
  1021. white-space: nowrap;
  1022. .img {
  1023. width: 40rpx;
  1024. height: 40rpx;
  1025. }
  1026. }
  1027. .detail_leave {
  1028. color: #808080;
  1029. font-size: 24rpx;
  1030. }
  1031. .detail_num {
  1032. display: flex;
  1033. align-items: center;
  1034. font-size: 24rpx;
  1035. .num_rate {
  1036. color: #ff5733;
  1037. }
  1038. .num_comment {
  1039. margin-left: 15rpx;
  1040. color: #a6a6a6;
  1041. }
  1042. .num_price {
  1043. margin-left: auto;
  1044. font-size: 28rpx;
  1045. color: #ff5733;
  1046. text {
  1047. margin-left: 5rpx;
  1048. font-size: 20rpx;
  1049. color: #a6a6a6;
  1050. }
  1051. }
  1052. }
  1053. }
  1054. }
  1055. }
  1056. }
  1057. .body_input {
  1058. display: flex;
  1059. justify-content: center;
  1060. align-items: center;
  1061. height: 118rpx;
  1062. border-top: 1rpx solid #cccccc;
  1063. background-color: #fff;
  1064. .input_box {
  1065. width: 710rpx;
  1066. border-radius: 77rpx;
  1067. font-size: 24rpx;
  1068. background-color: #f2f2f2;
  1069. input {
  1070. box-sizing: border-box;
  1071. padding: 0 30rpx;
  1072. width: 100%;
  1073. height: 100%;
  1074. }
  1075. }
  1076. }
  1077. }
  1078. </style>