user-content.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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" @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. <view class="dynamic-item" v-for="(item,itemIndex) in list">
  39. <view class="dynamic-title">
  40. <view class="dynamic-title-left">
  41. <text class="dynamic-title-text sys-color-white sys-weight-400">12</text>
  42. <text class="dynamic-title-text sys-color-white sys-weight-400">04月</text>
  43. <text class="dynamic-title-text sys-color-white sys-weight-400">2020年</text>
  44. </view>
  45. <view class="dynamic-title-right">
  46. <image class="dynamic-right-img" mode="aspectFill" src="/static/img/index/dynamic-all.png" ></image>
  47. </view>
  48. </view>
  49. <view class="dynamic-data">
  50. <view class="data-text">
  51. <text class="text-item sys-color-white ">{{item.text}}</text>
  52. </view>
  53. <view class="data-img" v-if="item.img.length>0">
  54. <view class="one-img" v-if="item.img.length===1">
  55. <img-one :file-list="item.img"></img-one>
  56. </view>
  57. <view class="two-img" v-else-if="item.img.length===2 || item.img.length===4">
  58. <img-two :file-list="item.img"></img-two>
  59. </view>
  60. <view class="three-img" v-else>
  61. <img-three :file-list="item.img"></img-three>
  62. </view>
  63. </view>
  64. <view class="data-tag-list" >
  65. <view class="data-tag" v-for="tag in item.tag">
  66. <image class="data-tag-img" mode="aspectFill" :src="tag.icon" ></image>
  67. <view class="data-tag-text sys-color-black-2 sys-weight-400">{{tag.text}}</view>
  68. </view>
  69. </view>
  70. <view class="data-operation">
  71. <view class="operation-item" @click="setLike(itemIndex)">
  72. <image class="operation-img" mode="aspectFill" :src="'/static/img/index/like-'+(item.isLike?'ok':'no')+'.png'" ></image>
  73. <view class="operation-text sys-color-white sys-weight-400">{{item.likeNum>0?item.likeNum:'点赞'}}</view>
  74. </view>
  75. <view class="operation-item">
  76. <image class="operation-img" mode="aspectFill" src="/static/img/index/evaluate.png" ></image>
  77. <view class="operation-text sys-color-white sys-weight-400">{{item.evaluateNum>0?item.evaluateNum:'评论'}}</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. stopTouche(){
  122. // console.log('滑动事件阻止触发')
  123. return false
  124. },
  125. setLike(index){
  126. this.list[index].isLike=!this.list[index].isLike
  127. if(this.list[index].isLike){
  128. ++this.list[index].likeNum
  129. }else {
  130. --this.list[index].likeNum
  131. }
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. .user-content-box{
  138. background: #333333;
  139. padding: 40rpx 28rpx;
  140. .content-top{
  141. display: flex;
  142. justify-content: space-between;
  143. .top-left{
  144. font-size: 48rpx;
  145. color: rgba(255,255,255,0.3);
  146. }
  147. .top-right{
  148. display: flex;
  149. justify-content: center;
  150. .right-img{
  151. width: 36rpx;
  152. height: 36rpx;
  153. margin-right: 6rpx;
  154. }
  155. .right-text{
  156. font-size:26rpx ;
  157. }
  158. }
  159. }
  160. .user-signature{
  161. font-size: 32rpx;
  162. }
  163. .user-tag{
  164. display: flex;
  165. flex-wrap: wrap;
  166. margin-bottom: 62rpx;
  167. .tag-item{
  168. margin-top: 26rpx;
  169. margin-right: 20rpx;
  170. border-radius: 200rpx;
  171. background: rgba(255,255,255,0.4);
  172. display: flex;
  173. justify-content: center;
  174. padding: 6rpx 12rpx;
  175. .tag-img{
  176. width: 32rpx;
  177. height: 32rpx;
  178. margin-right: 8rpx;
  179. }
  180. .tag-text{
  181. font-size: 28rpx;
  182. height: 32rpx;
  183. line-height: 32rpx;
  184. }
  185. }
  186. }
  187. .user-wire{
  188. height: 2rpx;
  189. border-radius: 200rpx;
  190. opacity: 0.2;
  191. background-color: #4D4C4C;
  192. }
  193. .gift-box{
  194. margin-top: 64rpx;
  195. .gift-title{
  196. height: 56rpx;
  197. display: flex;
  198. justify-content: space-between;
  199. .gift-title-left{
  200. font-size: 40rpx;
  201. line-height: 56rpx;
  202. height: 56rpx;
  203. color: rgba(255,255,255,0.4);
  204. }
  205. .gift-title-right{
  206. display: flex;
  207. justify-content: center;
  208. .gift-right-text{
  209. font-size: 24rpx;
  210. margin-right: 8rpx;
  211. }
  212. .gift-right-img{
  213. margin-top: 4rpx;
  214. height: 24rpx;
  215. width: 24rpx;
  216. }
  217. }
  218. }
  219. .gift-list{
  220. margin-top: 32rpx;
  221. display: flex;
  222. justify-content: flex-start;
  223. overflow-y: scroll;
  224. .gift-item{
  225. border-radius: 16rpx;
  226. background: #3D3D3D;
  227. width: 198rpx;
  228. height: 232rpx;
  229. margin-right: 14rpx;
  230. .gift-but{
  231. margin-left: 43rpx;
  232. width: 112rpx;
  233. height: 44rpx;
  234. line-height: 44rpx;
  235. font-size:28rpx ;
  236. border-radius: 200rpx;
  237. text-align: center;
  238. }
  239. .gift-num{
  240. text-align: center;
  241. font-size: 20rpx;
  242. height: 28rpx;
  243. line-height: 28rpx;
  244. text:first-child{
  245. font-size: 16rpx;
  246. }
  247. text:last-child{
  248. font-size: 30rpx;
  249. }
  250. }
  251. .gift-item-img{
  252. margin: 32rpx 49rpx 28rpx 49rpx;
  253. width: 100rpx;
  254. height: 100rpx;
  255. }
  256. .gift-item-img-gray{
  257. filter: grayscale(100%);
  258. }
  259. }
  260. .gift-item:last-child{
  261. margin-right: 0;
  262. }
  263. }
  264. }
  265. .dynamic-list{
  266. margin-top: 44rpx;
  267. .dynamic-item{
  268. margin-top: 16rpx;
  269. .dynamic-title{
  270. display: flex;
  271. justify-content: space-between;
  272. .dynamic-title-left{
  273. display:table-cell;
  274. vertical-align:bottom;
  275. .dynamic-title-text{
  276. font-size: 28rpx;
  277. }
  278. .dynamic-title-text:first-child{
  279. font-size: 48rpx;
  280. margin-right: 12rpx;
  281. }
  282. }
  283. .dynamic-title-right{
  284. .dynamic-right-img{
  285. width: 6rpx;
  286. height: 26rpx;
  287. }
  288. }
  289. }
  290. .dynamic-data{
  291. margin-left: 26rpx;
  292. border-left: 1rpx solid rgba(255,255,255,0.2);
  293. padding: 4rpx 0 44rpx 40rpx;
  294. .data-text{
  295. .text-item{
  296. font-size: 28rpx;
  297. }
  298. }
  299. .data-img{
  300. margin-top: 30rpx;
  301. }
  302. .data-tag-list{
  303. margin-top: 28rpx;
  304. display: flex;
  305. flex-wrap: wrap;
  306. .data-tag{
  307. margin-top: 26rpx;
  308. margin-right: 20rpx;
  309. border-radius: 200rpx;
  310. background: rgba(255,255,255,0.4);
  311. display: flex;
  312. justify-content: center;
  313. padding: 4rpx 12rpx;
  314. .data-tag-img{
  315. width: 32rpx;
  316. height: 32rpx;
  317. margin-right: 8rpx;
  318. }
  319. .data-tag-text{
  320. font-size: 24rpx;
  321. height: 32rpx;
  322. line-height: 32rpx;
  323. }
  324. }
  325. }
  326. .data-operation{
  327. margin-top: 40rpx;
  328. display: flex;
  329. justify-content: flex-start;
  330. .operation-item{
  331. width: 200rpx;
  332. display: flex;
  333. justify-content: flex-start;
  334. .operation-img{
  335. width: 40rpx;
  336. height: 40rpx;
  337. margin-right: 8rpx;
  338. }
  339. .operation-text{
  340. height: 40rpx;
  341. line-height: 41rpx;
  342. font-size: 26rpx;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. }
  350. </style>