discoverFlowItem.vue 5.8 KB

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