discoverFlowItem.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view :data-theme="theme">
  3. <view @click="goDetail(items)" class="wf-page2">
  4. <view class="flex-y-center mb-20">
  5. <image class="type-image mr-20" :src="items.icon" mode=""></image>
  6. <view>
  7. <view class="info-dzi mb-10 fs-24">{{items.authorName}}<text class="ml-14 mr-14">·</text>北京大学</view>
  8. <view class="info-xzi">
  9. <text>{{items.id}}楼</text>
  10. <text>3-23 13:22:04</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="info-dzi f-s-22 f-w-300 mb-20">
  15. {{items.content || ''}}
  16. </view>
  17. <view class='pictrue skeleton-rect'>
  18. <easy-loadimage mode="widthFix" :image-src="items.cover" :radius="8"></easy-loadimage>
  19. <view class="discover_video_icon" v-if="items.type == 2">
  20. <text class="iconfont icon-24gf-play"></text>
  21. </view>
  22. <!-- 审核状态:0-待审核,1-审核通过,2-审核失败,3-平台关闭 -->
  23. <view class="approval_status" v-if="items.auditStatus != 1 && uid == items.authorId">
  24. <view v-if="items.auditStatus == 2" class="approval_title">审核未通过</view>
  25. <view v-if="items.auditStatus == 3" class="approval_title">平台关闭</view>
  26. <view v-if="items.auditStatus == 0" class="approval_title">正在审核</view>
  27. <text v-if="items.auditStatus == 2 || items.auditStatus == 3" class="approval_info">查看未通过原因</text>
  28. <text v-if="items.auditStatus == 0" class="approval_info">通过后将展示在列表</text>
  29. </view>
  30. </view>
  31. <view class='text'>
  32. <!-- <view v-if="items.title" class='name skeleton-rect mt-24'>
  33. <text class="text_name line2">
  34. {{items.title}}
  35. </text>
  36. </view> -->
  37. <view class="count acea-row skeleton-rect">
  38. <!-- <view class="author acea-row">
  39. <image class="image" :src="items.authorAvatar ? items.authorAvatar : urlDomain+'crmebimage/presets/morenT.png'"
  40. mode="widthFix"></image>
  41. <text class="author_name line1"> {{items.authorName}}</text>
  42. </view> -->
  43. <view class="like" @click.stop="likeToggle(items)">
  44. <view class="like_count">
  45. <text class="iconfont" :class="items.userIsLike ? 'icon-shoucang1' : 'icon-dianzan'"></text>
  46. <text class="collect">{{items.likeNum ? items.likeNum < 10000 ? items.likeNum : (items.likeNum / 10000).toFixed(2) + 'w' : '' }}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. // +----------------------------------------------------------------------
  56. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  57. // +----------------------------------------------------------------------
  58. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  59. // +----------------------------------------------------------------------
  60. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  61. // +----------------------------------------------------------------------
  62. // | Author: CRMEB Team <admin@crmeb.com>
  63. // +----------------------------------------------------------------------
  64. import {
  65. toLogin
  66. } from '@/libs/login.js';
  67. import {
  68. discoverNoteLike
  69. } from '@/libs/follow.js';
  70. import easyLoadimage from '@/components/base/easy-loadimage.vue'
  71. import {
  72. mapGetters
  73. } from "vuex";
  74. let app = getApp();
  75. export default {
  76. components: {
  77. easyLoadimage
  78. },
  79. computed: {
  80. ...mapGetters(['uid', 'isLogin'])
  81. },
  82. props: {
  83. // 区分从发现列表、我的主页作品进去,点进去内容列表,home从我的主页点进去
  84. fromTo: {
  85. type: String,
  86. default: ''
  87. },
  88. items: {
  89. type: Object,
  90. default: {}
  91. },
  92. type: {
  93. type: Number,
  94. default: 0
  95. },
  96. tab: {
  97. type: Number,
  98. default: 1
  99. }
  100. },
  101. data() {
  102. return {
  103. urlDomain: this.$Cache.get("imgHost"),
  104. theme: app.globalData.theme
  105. };
  106. },
  107. // 滚动监听
  108. onPageScroll(e) {
  109. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  110. uni.$emit('scroll');
  111. },
  112. methods: {
  113. //点赞
  114. likeToggle(item) {
  115. this.$emit('changeLikeToggle', item)
  116. },
  117. goDetail(item) {
  118. if (item.type == 1) {
  119. uni.navigateTo({
  120. url: `/pages/discover/discover_details/index?noteId=${item.id}`
  121. });
  122. } else {
  123. uni.navigateTo({
  124. //#ifdef APP
  125. url: `/pages/discover/discover_video/appVideo/index?noteId=${item.id}&fromTo=${this.fromTo}&sd=${this.uid}`
  126. //#endif
  127. //#ifndef APP
  128. url: `/pages/discover/discover_video/routineVideo/index?noteId=${item.id}&fromTo=${this.fromTo}&sd=${this.uid}`
  129. //#endif
  130. });
  131. }
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .pictrue {
  138. max-height: 580rpx;
  139. overflow-y: hidden;
  140. border-radius: 16rpx;
  141. position: relative;
  142. .plant-show {
  143. width: 42rpx;
  144. height: 42rpx;
  145. border-radius: 100%;
  146. background: rgba(0, 0, 0, .5);
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. position: absolute;
  151. top: 10rpx;
  152. left: 10rpx;
  153. .iconfont {
  154. font-size: 20rpx;
  155. color: #fff;
  156. }
  157. }
  158. }
  159. .loadfail-img {
  160. width: 100%;
  161. height: 345rpx;
  162. }
  163. .text {
  164. padding-bottom: 6rpx;
  165. width: 345rpx;
  166. .name {
  167. padding: 0 20rpx;
  168. color: #333333;
  169. font-size: 28rpx;
  170. font-weight: bold;
  171. }
  172. .count {
  173. padding: 0 20rpx;
  174. margin-top: 20rpx;
  175. justify-content: space-between;
  176. .author {
  177. align-items: center;
  178. }
  179. .author_name {
  180. margin-left: 10rpx;
  181. max-width: 120rpx;
  182. font-size: 24rpx;
  183. color: #333333;
  184. max-width: 180rpx;
  185. }
  186. .author_time {
  187. color: #666666;
  188. }
  189. .like {
  190. font-size: 24rpx;
  191. color: #999999;
  192. display: flex;
  193. .like_count {
  194. display: flex;
  195. align-items: center;
  196. }
  197. .iconfont {
  198. font-size: 30rpx;
  199. }
  200. .icon-shoucang1 {
  201. @include main_color(theme);
  202. }
  203. .collect {
  204. font-size: 24rpx;
  205. margin-left: 5rpx;
  206. }
  207. }
  208. }
  209. }
  210. .wf-page2 .author .image,
  211. .wf-page2 .author uni-image {
  212. width: 46rpx !important;
  213. height: 46rpx !important;
  214. border-radius: 100%;
  215. }
  216. .approval_status {
  217. width: 100%;
  218. height: 100%;
  219. background: rgba(0, 0, 0, .4);
  220. position: absolute;
  221. top: 0;
  222. left: 0;
  223. border-radius: 16rpx;
  224. color: #fff;
  225. text-align: center;
  226. z-index: 5;
  227. .approval_title {
  228. font-size: 28rpx;
  229. margin-top: 135rpx;
  230. font-weight: bold;
  231. }
  232. .approval_info {
  233. font-size: 24rpx;
  234. margin-top: 24rpx;
  235. }
  236. }
  237. .info-xzi {
  238. font-weight: 400;
  239. font-size: 19rpx;
  240. color: #999999;
  241. }
  242. .info-dzi {
  243. font-weight: 500;
  244. font-size: 23rpx;
  245. color: #141414;
  246. }
  247. .type-image {
  248. width: 58rpx;
  249. height: 58rpx;
  250. }
  251. </style>