my-praise.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="my-praise-box">
  3. <view class="praise-item" v-for="(item,itemIndex) in list">
  4. <view class="praise-left">
  5. <image class="praise-head" src="/static/img/temporary/3.png" mode="aspectFill"></image>
  6. </view>
  7. <view class="praise-right">
  8. <view class="praise-top-data">
  9. <view class="praise-top-left">
  10. <view class="praise-top-left-title">
  11. <view class="left-title-text sys-height-44 sys-color-black sys-weight-600">WWWWW</view>
  12. <view class="left-title-vip">
  13. <image class="left-title-vip-img" src="/static/img/my/vip.png" mode="heightFix"></image>
  14. </view>
  15. </view>
  16. <view class="left-title-time sys-color-gray-9">2021-04-18 15:53发布.<100m</view>
  17. </view>
  18. <view class="praise-top-right">
  19. <view class="praise-top-right-icon">
  20. <image class="praise-top-right-img" src="/static/img/circle/Group-100243@2x.png" mode="aspectFill"></image>
  21. </view>
  22. <view class="praise-top-right-text sys-weight-600 sys-color-black">打招呼</view>
  23. </view>
  24. </view>
  25. <view class="right-text sys-color-black sys-weight-400">
  26. 我是阳光大男孩
  27. </view>
  28. <view class="right-img">
  29. <view class="one-img" v-if="item.img.length===1">
  30. <img-one :file-list="item.img"></img-one>
  31. </view>
  32. <view class="two-img" v-else-if="item.img.length===2 || item.img.length===4">
  33. <img-two :file-list="item.img"></img-two>
  34. </view>
  35. <view class="three-img" v-else>
  36. <img-three :file-list="item.img"></img-three>
  37. </view>
  38. </view>
  39. <view class="right-tag-list" >
  40. <dynamic-tag :list="item.tag" :tag-bg="tagBg" :tag-color="tagColor"></dynamic-tag>
  41. </view>
  42. <view class="right-operation-list">
  43. <view class="operation-share">
  44. <view class="operation-item">
  45. <view class="operation-icon"><text class="iconfont" :style="{'color':operateColor}">&#xe624;</text></view>
  46. <view class="operation-text sys-weight-400" :style="{'color':operateColor}">分享</view>
  47. </view>
  48. </view>
  49. <view class="operation-items">
  50. <view class="operation-item">
  51. <view class="operation-icon" @click="setLike(itemIndex)">
  52. <text class="iconfont icon-dianzan" v-if="!item.isLike" :style="{'color':operateColor}"> &#xe8ad;</text>
  53. <text class="iconfont icon-dianzan1" v-else :style="{'color':'#ED301D'}"> &#xe8c3;</text>
  54. </view>
  55. <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.likeNum>0?item.likeNum:'点赞'}}</view>
  56. </view>
  57. <view class="operation-item">
  58. <view class="operation-icon"><text class="iconfont icon-pinglun" :style="{'color':operateColor}">&#xe891;</text></view>
  59. <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.evaluateNum>0?item.evaluateNum:'评论'}}</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import ImgOne from "@/pages/common/img/img-one";
  69. import ImgTwo from "@/pages/common/img/img-two";
  70. import ImgThree from "@/pages/common/img/img-three";
  71. import DynamicTag from "@/pages/common/tag/dynamic-tag";
  72. export default {
  73. name: "my-praise",
  74. components: {DynamicTag, ImgThree, ImgTwo, ImgOne},
  75. props: {},
  76. data() {
  77. return {
  78. tagBg:'#F2F2F2',
  79. tagColor:'#999999',
  80. operateColor:'#999999',
  81. list:[
  82. {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png'],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':1,'evaluateNum':0,'isLike':true},
  83. {'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':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':0,'evaluateNum':20,'isLike':false},
  84. {'text':'我是阳光大男孩我','img':[
  85. '/static/img/temporary/1.png',
  86. '/static/img/temporary/3.png',
  87. '/static/img/temporary/2.png',
  88. '/static/img/temporary/1.png',
  89. '/static/img/temporary/3.png',
  90. '/static/img/temporary/2.png',
  91. ],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':10,'evaluateNum':20,'isLike':true},
  92. ]
  93. }
  94. },
  95. watch: {},
  96. mounted() {
  97. },
  98. methods: {
  99. setLike(index){
  100. this.list[index].isLike=!this.list[index].isLike
  101. if(this.list[index].isLike){
  102. ++this.list[index].likeNum
  103. }else {
  104. --this.list[index].likeNum
  105. }
  106. }
  107. }
  108. }
  109. </script>
  110. <style scoped lang="scss">
  111. .my-praise-box{
  112. .praise-item{
  113. margin : 40rpx 0 4rpx 0;
  114. border-bottom: 1rpx solid #F2F2F2;
  115. display: flex;
  116. justify-content: space-between;
  117. .praise-left{
  118. width: 80rpx;
  119. .praise-head{
  120. width: 80rpx;
  121. height: 80rpx;
  122. border-radius: 60rpx;
  123. }
  124. }
  125. .praise-right{
  126. width: calc(100% - 80rpx);
  127. padding-left: 22rpx;
  128. .praise-top-data{
  129. display: flex;
  130. justify-content: space-between;
  131. .praise-top-left{
  132. .praise-top-left-title{
  133. display: flex;
  134. justify-content: flex-start;
  135. align-items: center;
  136. .left-title-text{
  137. font-size: 32rpx;
  138. margin-right: 8rpx;
  139. }
  140. .left-title-vip-img{
  141. height: 28rpx;
  142. }
  143. }
  144. .left-title-time{
  145. margin-top: 8rpx;
  146. line-height: 34rpx;
  147. font-size: 24rpx;
  148. }
  149. }
  150. .praise-top-right{
  151. height: 40rpx;
  152. border-radius: 200rpx;
  153. border: 2rpx solid #141414;
  154. padding: 8rpx 16rpx;
  155. display: flex;
  156. justify-content: space-between;
  157. .praise-top-right-img{
  158. width: 40rpx;
  159. height: 40rpx;
  160. margin-right: 8rpx;
  161. }
  162. .praise-top-right-text{
  163. font-size: 28rpx;
  164. line-height: 40rpx;
  165. }
  166. }
  167. }
  168. .right-text{
  169. margin-top: 24rpx;
  170. font-size: 28rpx;
  171. height: 40rpx;
  172. line-height: 40rpx;
  173. }
  174. .right-img{
  175. margin-top: 16rpx;
  176. }
  177. .right-tag-list{
  178. margin-top: 8rpx;
  179. }
  180. .right-operation-list{
  181. margin-top: 44rpx;
  182. padding-bottom: 42rpx;
  183. display: flex;
  184. justify-content: space-between;
  185. .operation-share{
  186. .operation-item:first-child{
  187. .operation-icon{
  188. text{
  189. font-size: 30rpx;
  190. }
  191. }
  192. }
  193. }
  194. .operation-items{
  195. display: flex;
  196. justify-content: flex-start;
  197. .operation-item:first-child{
  198. .operation-text{
  199. width: 100rpx;
  200. }
  201. }
  202. .operation-item:last-child{
  203. .operation-text{
  204. width: 80rpx;
  205. }
  206. }
  207. }
  208. .operation-item{
  209. display: flex;
  210. justify-content: flex-start;
  211. .operation-icon{
  212. width: 40rpx;
  213. height: 40rpx;
  214. margin-right: 8rpx;
  215. text{
  216. font-size: 40rpx;
  217. line-height: 40rpx;
  218. }
  219. }
  220. .operation-text{
  221. height: 40rpx;
  222. line-height: 41rpx;
  223. font-size: 26rpx;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. </style>