user-content.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="user-content-box">
  3. <view class="content-top">
  4. <view class="top-left">“</view>
  5. <view class="top-right">
  6. <image class="right-img" mode="aspectFill" src="/static/img/index/like.png" ></image>
  7. <view class="right-text sys-color-white sys-weight-400">{{userItem.likeCount}}喜欢</view>
  8. </view>
  9. </view>
  10. <view class="user-signature sys-color-white sys-weight-400">{{userItem.slogan}}</view>
  11. <view class="user-tag" v-if="userItem.tagList.length>0">
  12. <view class="tag-item" v-for="i in userItem.tagList">
  13. <image class="tag-img" mode="aspectFill" src="/static/img/index/tag-img.png" ></image>
  14. <view class="tag-text sys-color-gray-3 sys-weight-400">{{i}}</view>
  15. </view>
  16. </view>
  17. <view class="user-wire"></view>
  18. <view class="gift-box" @touchmove.stop="stopTouche" @touchend.stop="stopTouche" @touchstart.stop="stopTouche">
  19. <view class="gift-title">
  20. <view class="gift-title-left sys-weight-600">心动礼物</view>
  21. <view class="gift-title-right">
  22. <view class="gift-right-text sys-color-white sys-weight-400">全部</view>
  23. <image class="gift-right-img" mode="aspectFill" src="/static/img/index/right.png" ></image>
  24. </view>
  25. </view>
  26. <view class="gift-list" id="gift-list" >
  27. <view class="gift-item" v-for="giftItem in giftList">
  28. <image class="gift-item-img" :class="{'gift-item-img-gray':giftItem.num<=0}" mode="aspectFill" :src="giftItem.url" ></image>
  29. <view class="gift-num sys-color-white" v-if="giftItem.num>0">
  30. <text>X</text>
  31. <text>{{giftItem.num}}</text>
  32. </view>
  33. <view class="gift-but sys-background-yellow sys-color-black sys-weight-500" v-else>点亮</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="dynamic-list">
  38. <dynamic-item :user-id="userItem.userId"></dynamic-item>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import ImgOne from "@/pages/common/img/img-one";
  44. import ImgTwo from "@/pages/common/img/img-two";
  45. import ImgThree from "@/pages/common/img/img-three";
  46. import DynamicItem from "@/pages/common/dynamic/dynamic-items";
  47. import {getMoments} from "@/api/discovery";
  48. export default {
  49. name: "user-content",
  50. components: {DynamicItem, ImgThree, ImgTwo, ImgOne},
  51. props: {
  52. 'userItem':{
  53. default:{
  54. 'userId':0,
  55. 'likeCount':0,
  56. 'tagList':[],
  57. }
  58. }
  59. },
  60. data() {
  61. return {
  62. giftList:[
  63. {'num':1,'url':'/static/img/temporary/gift1.png'},
  64. {'num':0,'url':'/static/img/temporary/gift2.png'},
  65. {'num':0,'url':'/static/img/temporary/gift3.png'},
  66. {'num':1,'url':'/static/img/temporary/gift1.png'},
  67. {'num':0,'url':'/static/img/temporary/gift2.png'},
  68. {'num':0,'url':'/static/img/temporary/gift3.png'},
  69. ],
  70. }
  71. },
  72. watch: {
  73. 'userId':function () {
  74. }
  75. },
  76. mounted() {
  77. console.log()
  78. },
  79. methods: {
  80. stopTouche(){
  81. // console.log('滑动事件阻止触发')
  82. return false
  83. },
  84. }
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. .user-content-box{
  89. background: #333333;
  90. padding: 40rpx 28rpx;
  91. .content-top{
  92. display: flex;
  93. justify-content: space-between;
  94. .top-left{
  95. font-size: 48rpx;
  96. color: rgba(255,255,255,0.3);
  97. }
  98. .top-right{
  99. display: flex;
  100. justify-content: center;
  101. .right-img{
  102. width: 36rpx;
  103. height: 36rpx;
  104. margin-right: 6rpx;
  105. }
  106. .right-text{
  107. font-size:26rpx ;
  108. }
  109. }
  110. }
  111. .user-signature{
  112. font-size: 32rpx;
  113. }
  114. .user-tag{
  115. display: flex;
  116. flex-wrap: wrap;
  117. margin-bottom: 62rpx;
  118. .tag-item{
  119. margin-top: 26rpx;
  120. margin-right: 20rpx;
  121. border-radius: 200rpx;
  122. background: rgba(255,255,255,0.4);
  123. display: flex;
  124. justify-content: center;
  125. padding: 6rpx 12rpx;
  126. .tag-img{
  127. width: 32rpx;
  128. height: 32rpx;
  129. margin-right: 8rpx;
  130. }
  131. .tag-text{
  132. font-size: 28rpx;
  133. height: 32rpx;
  134. line-height: 32rpx;
  135. }
  136. }
  137. }
  138. .user-wire{
  139. height: 2rpx;
  140. border-radius: 200rpx;
  141. opacity: 0.2;
  142. background-color: #4D4C4C;
  143. }
  144. .gift-box{
  145. margin-top: 64rpx;
  146. .gift-title{
  147. height: 56rpx;
  148. display: flex;
  149. justify-content: space-between;
  150. .gift-title-left{
  151. font-size: 40rpx;
  152. line-height: 56rpx;
  153. height: 56rpx;
  154. color: rgba(255,255,255,0.4);
  155. }
  156. .gift-title-right{
  157. display: flex;
  158. justify-content: center;
  159. .gift-right-text{
  160. font-size: 24rpx;
  161. margin-right: 8rpx;
  162. }
  163. .gift-right-img{
  164. margin-top: 4rpx;
  165. height: 24rpx;
  166. width: 24rpx;
  167. }
  168. }
  169. }
  170. .gift-list{
  171. margin-top: 32rpx;
  172. display: flex;
  173. justify-content: flex-start;
  174. overflow-y: scroll;
  175. .gift-item{
  176. border-radius: 16rpx;
  177. background: #3D3D3D;
  178. width: 198rpx;
  179. height: 232rpx;
  180. margin-right: 14rpx;
  181. .gift-but{
  182. margin-left: 43rpx;
  183. width: 112rpx;
  184. height: 44rpx;
  185. line-height: 44rpx;
  186. font-size:28rpx ;
  187. border-radius: 200rpx;
  188. text-align: center;
  189. }
  190. .gift-num{
  191. text-align: center;
  192. font-size: 20rpx;
  193. height: 28rpx;
  194. line-height: 28rpx;
  195. text:first-child{
  196. font-size: 16rpx;
  197. }
  198. text:last-child{
  199. font-size: 30rpx;
  200. }
  201. }
  202. .gift-item-img{
  203. margin: 32rpx 49rpx 28rpx 49rpx;
  204. width: 100rpx;
  205. height: 100rpx;
  206. }
  207. .gift-item-img-gray{
  208. filter: grayscale(100%);
  209. }
  210. }
  211. .gift-item:last-child{
  212. margin-right: 0;
  213. }
  214. }
  215. }
  216. .dynamic-list{
  217. margin-top: 44rpx;
  218. }
  219. }
  220. </style>