user-content.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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">108喜欢</view>
  8. </view>
  9. </view>
  10. <view class="user-signature sys-color-white sys-weight-400">崇尚自由,热爱生活,足以!</view>
  11. <view class="user-tag">
  12. <view class="tag-item" v-for="i in 5">
  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">认识朋友</view>
  15. </view>
  16. </view>
  17. <view class="user-wire"></view>
  18. <view class="gift-box">
  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">
  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 class="dynamic-list">
  37. <view class="dynamic-item" v-for="(item,itemIndex) in list">
  38. <view class="dynamic-title">
  39. <view class="dynamic-title-left">
  40. <text class="dynamic-title-text sys-color-white sys-weight-400">12</text>
  41. <text class="dynamic-title-text sys-color-white sys-weight-400">04月</text>
  42. <text class="dynamic-title-text sys-color-white sys-weight-400">2020年</text>
  43. </view>
  44. <view class="dynamic-title-right">
  45. <image class="dynamic-right-img" mode="aspectFill" src="/static/img/index/dynamic-all.png" ></image>
  46. </view>
  47. </view>
  48. <view class="dynamic-data">
  49. <view class="data-text">
  50. <text class="text-item sys-color-white ">{{item.text}}</text>
  51. </view>
  52. <view class="data-img" v-if="item.img.length>0">
  53. <view class="one-img" v-if="item.img.length===1">
  54. <img-one :file-list="item.img"></img-one>
  55. </view>
  56. <view class="two-img" v-else-if="item.img.length===2 || item.img.length===4">
  57. <img-two :file-list="item.img"></img-two>
  58. </view>
  59. <view class="three-img" v-else>
  60. <img-three :file-list="item.img"></img-three>
  61. </view>
  62. </view>
  63. <view class="data-tag-list">
  64. <view class="data-tag" v-for="tag in item.tag">
  65. <image class="data-tag-img" mode="aspectFill" :src="tag.icon" ></image>
  66. <view class="data-tag-text sys-color-black-2 sys-weight-400">{{tag.text}}</view>
  67. </view>
  68. </view>
  69. <view class="data-operation">
  70. <view class="operation-item" @click="setLike(itemIndex)">
  71. <image class="operation-img" mode="aspectFill" :src="'/static/img/index/like-'+(item.isLike?'ok':'no')+'.png'" ></image>
  72. <view class="operation-text sys-color-white sys-weight-400">{{item.likeNum>0?item.likeNum:'点赞'}}</view>
  73. </view>
  74. <view class="operation-item">
  75. <image class="operation-img" mode="aspectFill" src="/static/img/index/evaluate.png" ></image>
  76. <view class="operation-text sys-color-white sys-weight-400">{{item.evaluateNum>0?item.evaluateNum:'评论'}}</view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import ImgOne from "@/pages/index/model/img-one";
  87. import ImgTwo from "@/pages/index/model/img-two";
  88. import ImgThree from "@/pages/index/model/img-three";
  89. export default {
  90. name: "user-content",
  91. components: {ImgThree, ImgTwo, ImgOne},
  92. props: {},
  93. data() {
  94. return {
  95. giftList:[
  96. {'num':1,'url':'/static/img/temporary/gift1.png'},
  97. {'num':0,'url':'/static/img/temporary/gift2.png'},
  98. {'num':0,'url':'/static/img/temporary/gift3.png'},
  99. {'num':1,'url':'/static/img/temporary/gift1.png'},
  100. {'num':0,'url':'/static/img/temporary/gift2.png'},
  101. {'num':0,'url':'/static/img/temporary/gift3.png'},
  102. ],
  103. list:[
  104. {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png'],'tag':[{'text':'南亭新都会商场','icon':'/static/img/index/address.png'},{'text':'你好认识一哈','icon':'/static/img/index/know.png'}],'likeNum':1,'evaluateNum':0,'isLike':true},
  105. {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png','/static/img/temporary/2.png','/static/img/temporary/3.png','/static/img/temporary/2.png'],'tag':[{'text':'南亭新都会商场','icon':'/static/img/index/address.png'},{'text':'你好认识一哈','icon':'/static/img/index/know.png'}],'likeNum':0,'evaluateNum':20,'isLike':false},
  106. {'text':'我是阳光大男孩我','img':[
  107. '/static/img/temporary/1.png',
  108. '/static/img/temporary/3.png',
  109. '/static/img/temporary/2.png',
  110. '/static/img/temporary/1.png',
  111. '/static/img/temporary/3.png',
  112. '/static/img/temporary/2.png',
  113. ],'tag':[{'text':'南亭新都会商场','icon':'/static/img/index/address.png'},{'text':'你好认识一哈','icon':'/static/img/index/know.png'}],'likeNum':10,'evaluateNum':20,'isLike':true},
  114. ]
  115. }
  116. },
  117. watch: {},
  118. mounted() {
  119. },
  120. methods: {
  121. setLike(index){
  122. this.list[index].isLike=!this.list[index].isLike
  123. if(this.list[index].isLike){
  124. ++this.list[index].likeNum
  125. }else {
  126. --this.list[index].likeNum
  127. }
  128. }
  129. }
  130. }
  131. </script>
  132. <style scoped lang="scss">
  133. .user-content-box{
  134. background: #333333;
  135. padding: 40rpx 28rpx;
  136. .content-top{
  137. display: flex;
  138. justify-content: space-between;
  139. .top-left{
  140. font-size: 48rpx;
  141. color: rgba(255,255,255,0.3);
  142. }
  143. .top-right{
  144. display: flex;
  145. justify-content: center;
  146. .right-img{
  147. width: 36rpx;
  148. height: 36rpx;
  149. margin-right: 6rpx;
  150. }
  151. .right-text{
  152. font-size:26rpx ;
  153. }
  154. }
  155. }
  156. .user-signature{
  157. font-size: 32rpx;
  158. }
  159. .user-tag{
  160. display: flex;
  161. flex-wrap: wrap;
  162. margin-bottom: 62rpx;
  163. .tag-item{
  164. margin-top: 26rpx;
  165. margin-right: 20rpx;
  166. border-radius: 200rpx;
  167. background: rgba(255,255,255,0.4);
  168. display: flex;
  169. justify-content: center;
  170. padding: 6rpx 12rpx;
  171. .tag-img{
  172. width: 32rpx;
  173. height: 32rpx;
  174. margin-right: 8rpx;
  175. }
  176. .tag-text{
  177. font-size: 28rpx;
  178. height: 32rpx;
  179. line-height: 32rpx;
  180. }
  181. }
  182. }
  183. .user-wire{
  184. height: 2rpx;
  185. border-radius: 200rpx;
  186. opacity: 0.2;
  187. background-color: #4D4C4C;
  188. }
  189. .gift-box{
  190. margin-top: 64rpx;
  191. .gift-title{
  192. height: 56rpx;
  193. display: flex;
  194. justify-content: space-between;
  195. .gift-title-left{
  196. font-size: 40rpx;
  197. line-height: 56rpx;
  198. height: 56rpx;
  199. color: rgba(255,255,255,0.4);
  200. }
  201. .gift-title-right{
  202. display: flex;
  203. justify-content: center;
  204. .gift-right-text{
  205. font-size: 24rpx;
  206. margin-right: 8rpx;
  207. }
  208. .gift-right-img{
  209. margin-top: 4rpx;
  210. height: 24rpx;
  211. width: 24rpx;
  212. }
  213. }
  214. }
  215. .gift-list{
  216. margin-top: 32rpx;
  217. display: flex;
  218. justify-content: flex-start;
  219. overflow-y: scroll;
  220. .gift-item{
  221. border-radius: 16rpx;
  222. background: #3D3D3D;
  223. width: 198rpx;
  224. height: 232rpx;
  225. margin-right: 14rpx;
  226. .gift-but{
  227. margin-left: 43rpx;
  228. width: 112rpx;
  229. height: 44rpx;
  230. line-height: 44rpx;
  231. font-size:28rpx ;
  232. border-radius: 200rpx;
  233. text-align: center;
  234. }
  235. .gift-num{
  236. text-align: center;
  237. font-size: 20rpx;
  238. height: 28rpx;
  239. line-height: 28rpx;
  240. text:first-child{
  241. font-size: 16rpx;
  242. }
  243. text:last-child{
  244. font-size: 30rpx;
  245. }
  246. }
  247. .gift-item-img{
  248. margin: 32rpx 49rpx 28rpx 49rpx;
  249. width: 100rpx;
  250. height: 100rpx;
  251. }
  252. .gift-item-img-gray{
  253. filter: grayscale(100%);
  254. }
  255. }
  256. .gift-item:last-child{
  257. margin-right: 0;
  258. }
  259. }
  260. }
  261. .dynamic-list{
  262. margin-top: 44rpx;
  263. .dynamic-item{
  264. margin-top: 16rpx;
  265. .dynamic-title{
  266. display: flex;
  267. justify-content: space-between;
  268. .dynamic-title-left{
  269. display:table-cell;
  270. vertical-align:bottom;
  271. .dynamic-title-text{
  272. font-size: 28rpx;
  273. }
  274. .dynamic-title-text:first-child{
  275. font-size: 48rpx;
  276. margin-right: 12rpx;
  277. }
  278. }
  279. .dynamic-title-right{
  280. .dynamic-right-img{
  281. width: 6rpx;
  282. height: 26rpx;
  283. }
  284. }
  285. }
  286. .dynamic-data{
  287. margin-left: 26rpx;
  288. border-left: 1rpx solid rgba(255,255,255,0.2);
  289. padding: 4rpx 0 44rpx 40rpx;
  290. .data-text{
  291. .text-item{
  292. font-size: 28rpx;
  293. }
  294. }
  295. .data-img{
  296. margin-top: 30rpx;
  297. }
  298. .data-tag-list{
  299. margin-top: 28rpx;
  300. display: flex;
  301. flex-wrap: wrap;
  302. .data-tag{
  303. margin-top: 26rpx;
  304. margin-right: 20rpx;
  305. border-radius: 200rpx;
  306. background: rgba(255,255,255,0.4);
  307. display: flex;
  308. justify-content: center;
  309. padding: 4rpx 12rpx;
  310. .data-tag-img{
  311. width: 32rpx;
  312. height: 32rpx;
  313. margin-right: 8rpx;
  314. }
  315. .data-tag-text{
  316. font-size: 24rpx;
  317. height: 32rpx;
  318. line-height: 32rpx;
  319. }
  320. }
  321. }
  322. .data-operation{
  323. margin-top: 40rpx;
  324. display: flex;
  325. justify-content: flex-start;
  326. .operation-item{
  327. width: 200rpx;
  328. display: flex;
  329. justify-content: flex-start;
  330. .operation-img{
  331. width: 40rpx;
  332. height: 40rpx;
  333. margin-right: 8rpx;
  334. }
  335. .operation-text{
  336. height: 40rpx;
  337. line-height: 41rpx;
  338. font-size: 26rpx;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. }
  346. </style>