my-praise.vue 7.2 KB

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