WaterfallsFlowItem.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view @click="goDetail(item)" class="wf-page2" :style="viewColor">
  3. <view v-if="item" class='pictrue skeleton-rect'>
  4. <!-- <image :src='item.image[0]' mode="widthFix"></image> -->
  5. <easy-loadimage mode="widthFix" :image-src="item.image[0]"></easy-loadimage>
  6. <view v-if="isShow" class="plant-show">
  7. <text v-if="item.is_type == 1" class="iconfont icon-tuwen1"></text>
  8. <text v-else-if="item.is_type == 2" class="iconfont icon-shipin1"></text>
  9. </view>
  10. <image v-if="item.is_type == 2 && !isShow" class="video_img" src="../../static/images/stop.png"></image>
  11. <view v-if="isAuth && tab == 0 && item.status != 1" class="approval_status">
  12. <view v-if="item.status == -1" class="approval_title">审核未通过</view>
  13. <view v-else-if="item.status == -2" class="approval_title">已下架</view>
  14. <view v-else-if="item.status == 0" class="approval_title">正在审核</view>
  15. <text v-if="item.status == -1 || item.status == -2" class="approval_info">查看未通过原因</text>
  16. <text v-if="item.status == 0" class="approval_info">通过后将展示在列表</text>
  17. </view>
  18. </view>
  19. <view v-if="item" class='text'>
  20. <view class='name skeleton-rect'>
  21. <text class="text_name line2">
  22. {{item.title}}
  23. </text>
  24. </view>
  25. <view class="count acea-row skeleton-rect">
  26. <view v-if="!isAuth" class="author acea-row">
  27. <image class="image" :src="(item.author && item.author.avatar) || '/static/images/f.png'" mode="widthFix"></image>
  28. <text class="author_name line1">{{item.author && item.author.nickname}}</text>
  29. </view>
  30. <view v-else class="author acea-row">
  31. <text class="author_time">
  32. {{item.time}}
  33. </text>
  34. </view>
  35. <view class="like">
  36. <button class="like_count" hover-class="none" @click.stop="likeToggle(item)">
  37. <text class="iconfont" :class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
  38. <text class="collect">{{item.count_start}}</text>
  39. </button>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. // +----------------------------------------------------------------------
  47. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  48. // +----------------------------------------------------------------------
  49. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  50. // +----------------------------------------------------------------------
  51. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  52. // +----------------------------------------------------------------------
  53. // | Author: CRMEB Team <admin@crmeb.com>
  54. // +----------------------------------------------------------------------
  55. import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'
  56. import { mapGetters } from "vuex";
  57. export default {
  58. components:{easyLoadimage},
  59. computed: {...mapGetters(['viewColor'])},
  60. props: {
  61. item: {
  62. type: Object,
  63. require: true
  64. },
  65. type: {
  66. type: Number,
  67. default: 0
  68. },
  69. isAuth: {
  70. type: Boolean,
  71. default: false
  72. },
  73. uid: {
  74. type: Number,
  75. default: 0
  76. },
  77. tab: {
  78. type: Number,
  79. default: 1
  80. },
  81. isFind: {
  82. type: Boolean,
  83. default: false
  84. },
  85. isShow: {
  86. type: Boolean,
  87. default: false
  88. },
  89. },
  90. data() {
  91. return {
  92. isShowAuth: false,
  93. isAuto: false
  94. };
  95. },
  96. methods: {
  97. likeToggle(item){
  98. this.$emit('likeToggle',item)
  99. },
  100. goDetail(item){
  101. if(this.isFind){
  102. uni.navigateTo({
  103. url: '/pages/plantGrass/plant_featured/index?id='+item.topic_id
  104. });
  105. }else{
  106. this.plantDeail(item)
  107. }
  108. },
  109. plantDeail(item){
  110. if(item.is_type == 1){
  111. uni.navigateTo({
  112. url: '/pages/plantGrass/plant_detail/index?id='+item.community_id
  113. });
  114. }else{
  115. let user = this.isAuth ? 1 : 0;
  116. uni.navigateTo({
  117. //#ifdef APP
  118. url: '/pages/short_video/appSwiper/index?id='+item.community_id+'&user='+user+'&uid='+this.uid+'&tab='+this.tab
  119. //#endif
  120. //#ifndef APP
  121. url: '/pages/short_video/nvueSwiper/index?id='+item.community_id+'&user='+user+'&uid='+this.uid+'&tab='+this.tab
  122. //#endif
  123. });
  124. }
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .wf-page2 .pictrue{
  131. height: 345rpx;
  132. border-radius: 16rpx;
  133. position: relative;
  134. /deep/image,/deep/.easy-loadimage,uni-image{
  135. width: 100%;
  136. max-width: 345rpx;
  137. height: 345rpx;
  138. border-radius: 16rpx;
  139. }
  140. .video_img{
  141. width: 40rpx;
  142. height: 40rpx;
  143. position: absolute;
  144. top: 10rpx;
  145. right: 10rpx;
  146. z-index: 10;
  147. }
  148. .plant-show{
  149. width: 42rpx;
  150. height: 42rpx;
  151. border-radius: 100%;
  152. background: rgba(0,0,0,.5);
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. position: absolute;
  157. top: 10rpx;
  158. left: 10rpx;
  159. .iconfont{
  160. font-size: 20rpx;
  161. color: #fff;
  162. }
  163. }
  164. }
  165. .loadfail-img{
  166. width: 100%;
  167. height: 345rpx;
  168. }
  169. .wf-page2 .text{
  170. padding: 20rpx;
  171. width: 345rpx;
  172. .name{
  173. color: #333333;
  174. font-size: 28rpx;
  175. font-weight: bold;
  176. }
  177. .count{
  178. margin-top: 20rpx;
  179. justify-content: space-between;
  180. .author{
  181. align-items: center;
  182. }
  183. .author_name{
  184. margin-left: 10rpx;
  185. max-width: 120rpx;
  186. font-size: 24rpx;
  187. color: #333333;
  188. max-width: 180rpx;
  189. }
  190. .author_time{
  191. color: #666666;
  192. }
  193. .like{
  194. font-size: 24rpx;
  195. color: #999999;
  196. display: flex;
  197. .like_count{
  198. display: flex;
  199. align-items: center;
  200. }
  201. .iconfont{
  202. font-size: 30rpx;
  203. }
  204. .icon-shoucang1{
  205. color: var(--view-priceColor);
  206. }
  207. .collect{
  208. font-size: 24rpx;
  209. margin-left: 5rpx;
  210. }
  211. }
  212. }
  213. }
  214. .wf-page2 .author .image,.wf-page2 .author uni-image{
  215. width: 46rpx;
  216. height: 46rpx;
  217. border-radius: 100%;
  218. }
  219. .approval_status{
  220. width: 100%;
  221. height: 100%;
  222. background: rgba(0,0,0,.4);
  223. position: absolute;
  224. top: 0;
  225. left: 0;
  226. border-radius: 16rpx;
  227. color: #fff;
  228. text-align: center;
  229. z-index: 5;
  230. .approval_title{
  231. font-size: 28rpx;
  232. margin-top: 135rpx;
  233. font-weight: bold;
  234. }
  235. .approval_info{
  236. font-size: 24rpx;
  237. margin-top: 24rpx;
  238. }
  239. }
  240. </style>