discoverFlowItem.vue 7.2 KB

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