my-praise.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <view class="my-praise-box">
  3. <view class="" v-show="tagNum == 0">
  4. <view class="publish-box" v-show="publishBoxOff">
  5. <image class="publish-img sys-radius-12" src="/static/img/circle/1.png" mode=""></image>
  6. <view class="publish-text">
  7. <view class="publish-title sys-color-black-0 sys-weight-400 sys-size-34">
  8. 不太正经的机车照片
  9. </view>
  10. <view class="sys-size-28 sys-weight-400 sys-color-gray-9">
  11. 记录在自由路.上的轰鸣瞬间
  12. </view>
  13. </view>
  14. <view class="publish-button sys-background-FF9F14 sys-radius-200 sys-size-28 sys-color-white">
  15. 去发布
  16. </view>
  17. <view class="off-button sys-background-F2F2F2 sys-radius-round-left-80" @click="publishOff">
  18. <image class="off-img" src="/static/img/circle/off.png" mode=""></image>
  19. </view>
  20. </view>
  21. </view>
  22. <scroll-view class="recommended-box" scroll-x="true" v-show="tagNum == 2">
  23. <view class="recommended-list" v-for="(item,i) in listTwo" :key="i" @click="goRecommended">
  24. <image class="recommended-list-img sys-radius-16" :src="item.img" mode=""></image>
  25. <view class="recommended-list-name">
  26. <image class="list-name-img" src="../../../static/dgex-tantan/like.png" mode=""></image>
  27. <view class="sys-color-white sys-size-28">
  28. {{item.text}}
  29. </view>
  30. </view>
  31. <view class="recommended-list-text">
  32. <view class="recommended-list-text-left">
  33. <!-- <image v-for="imgs in item.icon" class="list-text-left-img sys-radius-8" :src="imgs" mode=""></image> -->
  34. <image v-for="imgs in item.icon" class="list-text-left-img sys-radius-8" src="/static/img/temporary/1.png" mode=""></image>
  35. </view>
  36. <view class="recommended-list-text-right">
  37. <view class="sys-size-24 sys-color-white">
  38. {{item.num}}人在这里
  39. </view>
  40. <uni-icons type="forward" size="12" color="#fff"></uni-icons>
  41. </view>
  42. </view>
  43. </view>
  44. </scroll-view>
  45. <view class="praise-item" @click="goToDetails" v-for="(item,itemIndex) in list">
  46. <view class="praise-left">
  47. <image class="praise-head" src="/static/img/temporary/3.png" mode="aspectFill"></image>
  48. </view>
  49. <view class="praise-right">
  50. <view class="praise-top-data">
  51. <view class="praise-top-left">
  52. <view class="praise-top-left-title">
  53. <view class="left-title-text sys-height-44 sys-color-black sys-weight-600">WWWWW</view>
  54. <view class="left-title-vip">
  55. <image class="left-title-vip-img" src="/static/img/my/vip.png" mode="heightFix"></image>
  56. </view>
  57. </view>
  58. <view class="left-title-time sys-color-gray-9">2021-04-18 15:53发布.<100m</view>
  59. </view>
  60. <view class="praise-top-right">
  61. <call></call>
  62. </view>
  63. </view>
  64. <view class="right-text sys-color-black sys-weight-400">
  65. 我是阳光大男孩
  66. </view>
  67. <view class="right-img">
  68. <view class="one-img" v-if="item.img.length===1">
  69. <img-one :file-list="item.img"></img-one>
  70. </view>
  71. <view class="two-img" v-else-if="item.img.length===2 || item.img.length===4">
  72. <img-two :file-list="item.img"></img-two>
  73. </view>
  74. <view class="three-img" v-else>
  75. <img-three :file-list="item.img"></img-three>
  76. </view>
  77. </view>
  78. <view class="right-tag-list" >
  79. <dynamic-tag :list="item.tag" :tag-bg="tagBg" :tag-color="tagColor"></dynamic-tag>
  80. </view>
  81. <view class="right-operation-list">
  82. <view class="operation-share">
  83. <view class="operation-item">
  84. <view class="operation-icon"><text class="iconfont" :style="{'color':operateColor}">&#xe624;</text></view>
  85. <view class="operation-text sys-weight-400" :style="{'color':operateColor}">分享</view>
  86. </view>
  87. </view>
  88. <view class="operation-items">
  89. <view class="operation-item">
  90. <view class="operation-icon" @click="setLike(itemIndex)">
  91. <text class="iconfont icon-dianzan" v-if="!item.isLike" :style="{'color':operateColor}"> &#xe8ad;</text>
  92. <text class="iconfont icon-dianzan1" v-else :style="{'color':'#ED301D'}"> &#xe8c3;</text>
  93. </view>
  94. <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.likeNum>0?item.likeNum:'点赞'}}</view>
  95. </view>
  96. <view class="operation-item">
  97. <view class="operation-icon"><text class="iconfont icon-pinglun" :style="{'color':operateColor}">&#xe891;</text></view>
  98. <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.evaluateNum>0?item.evaluateNum:'评论'}}</view>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import ImgOne from "@/pages/common/img/img-one";
  108. import ImgTwo from "@/pages/common/img/img-two";
  109. import ImgThree from "@/pages/common/img/img-three";
  110. import DynamicTag from "@/pages/common/tag/dynamic-tag";
  111. import Call from "@/pages/common/call/call";
  112. export default {
  113. name: "my-praise",
  114. components: {Call, DynamicTag, ImgThree, ImgTwo, ImgOne},
  115. props: {
  116. tagNum:{},
  117. },
  118. data() {
  119. return {
  120. tagBg:'#F2F2F2',
  121. tagColor:'#999999',
  122. operateColor:'#999999',
  123. list:[
  124. {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png'],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':1,'evaluateNum':0,'isLike':true},
  125. {'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},
  126. {'text':'我是阳光大男孩我','img':[
  127. '/static/img/temporary/1.png',
  128. '/static/img/temporary/3.png',
  129. '/static/img/temporary/2.png',
  130. '/static/img/temporary/1.png',
  131. '/static/img/temporary/3.png',
  132. '/static/img/temporary/2.png',
  133. ],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':10,'evaluateNum':20,'isLike':true},
  134. ],
  135. listTwo:[
  136. {'text':'24h照片营业馆','img':'/static/img/temporary/1.png','icon':['/static/img/temporary/1.png','/static/img/temporary/1.png'],'num':'815.4w'},
  137. {'text':'24h照片营业馆','img':'/static/img/temporary/1.png'},{'img':'/static/img/login/2.jpg','text':'24h照片营业馆'},{'img':'/static/img/login/2.jpg','text':'24h照片营业馆'},
  138. ],
  139. publishBoxOff:true
  140. }
  141. },
  142. watch: {},
  143. mounted() {
  144. },
  145. methods: {
  146. setLike(index){
  147. this.list[index].isLike=!this.list[index].isLike
  148. if(this.list[index].isLike){
  149. ++this.list[index].likeNum
  150. }else {
  151. --this.list[index].likeNum
  152. }
  153. },
  154. goToDetails(){
  155. uni.navigateTo({
  156. 'url':'/pages/circle/circle'
  157. })
  158. },
  159. goRecommended(){
  160. uni.navigateTo({
  161. 'url':'/pages/circle/recommended'
  162. })
  163. },
  164. publishOff(){
  165. this.publishBoxOff = false
  166. console.log(this.publishBoxOff);
  167. },
  168. }
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. .my-praise-box{
  173. .publish-box {
  174. width: 100%;
  175. // height: 100%;
  176. display: flex;
  177. border-top: 20rpx solid #FAFAFA;
  178. border-bottom: 20rpx solid #FAFAFA;
  179. padding: 32rpx;
  180. justify-content: space-between;
  181. position: relative;
  182. align-items: center;
  183. box-sizing: border-box;
  184. .publish-img {
  185. width: 120rpx;
  186. height: 120rpx;
  187. flex-shrink: 0;
  188. }
  189. .publish-text {
  190. .publish-title {
  191. margin: 0 0 8rpx 0;
  192. }
  193. }
  194. .publish-button {
  195. flex-shrink: 0;
  196. padding: 6rpx 32rpx;
  197. }
  198. .off-button {
  199. position: absolute;
  200. right: 0;
  201. top: 0;
  202. padding: 0rpx 2rpx 6rpx 12rpx;
  203. .off-img {
  204. width: 24rpx;
  205. height: 24rpx;
  206. }
  207. }
  208. }
  209. .recommended-box{
  210. box-sizing: border-box;
  211. width: 100%;
  212. padding: 0 24rpx;
  213. display: flex;
  214. align-items: center;
  215. white-space: nowrap;
  216. .recommended-list{
  217. display: inline-block;
  218. width: 320rpx;
  219. height: 160rpx;
  220. margin: 0 8rpx;
  221. padding: 16rpx 4rpx 16rpx 12rpx;
  222. box-sizing: border-box;
  223. position: relative;
  224. // flex-shrink: 0;
  225. .recommended-list-img{
  226. width: 100%;
  227. height: 100%;
  228. position: absolute;
  229. left: 0;
  230. top: 0;
  231. z-index: -1;
  232. }
  233. .recommended-list-name{
  234. display: flex;
  235. align-items: center;
  236. .list-name-img{
  237. width: 28rpx;
  238. height: 28rpx;
  239. margin: 0 10rpx 0 0;
  240. }
  241. }
  242. .recommended-list-text{
  243. width: 100%;
  244. padding: 0 4rpx 0 16rpx;
  245. box-sizing: border-box;
  246. position: absolute;
  247. bottom: 16rpx;
  248. left: 0;
  249. display: flex;
  250. align-items: center;
  251. justify-content: space-between;
  252. .recommended-list-text-left{
  253. display: flex;
  254. align-items: center;
  255. .list-text-left-img{
  256. width: 40rpx;
  257. height: 40rpx;
  258. margin: 0 4rpx 0 0;
  259. }
  260. }
  261. .recommended-list-text-right{
  262. display: flex;
  263. align-items: center;
  264. }
  265. }
  266. }
  267. }
  268. .praise-item{
  269. padding: 0 32rpx;
  270. margin : 40rpx 0 4rpx 0;
  271. border-bottom: 1rpx solid #F2F2F2;
  272. display: flex;
  273. justify-content: space-between;
  274. .praise-left{
  275. width: 80rpx;
  276. .praise-head{
  277. width: 80rpx;
  278. height: 80rpx;
  279. border-radius: 60rpx;
  280. }
  281. }
  282. .praise-right{
  283. width: calc(100% - 80rpx);
  284. padding-left: 22rpx;
  285. .praise-top-data{
  286. display: flex;
  287. justify-content: space-between;
  288. .praise-top-left{
  289. .praise-top-left-title{
  290. display: flex;
  291. justify-content: flex-start;
  292. align-items: center;
  293. .left-title-text{
  294. font-size: 32rpx;
  295. margin-right: 8rpx;
  296. }
  297. .left-title-vip-img{
  298. height: 28rpx;
  299. }
  300. }
  301. .left-title-time{
  302. margin-top: 8rpx;
  303. line-height: 34rpx;
  304. font-size: 24rpx;
  305. }
  306. }
  307. }
  308. .right-text{
  309. margin-top: 24rpx;
  310. font-size: 28rpx;
  311. height: 40rpx;
  312. line-height: 40rpx;
  313. }
  314. .right-img{
  315. margin-top: 16rpx;
  316. }
  317. .right-tag-list{
  318. margin-top: 8rpx;
  319. }
  320. .right-operation-list{
  321. margin-top: 44rpx;
  322. padding-bottom: 42rpx;
  323. display: flex;
  324. justify-content: space-between;
  325. .operation-share{
  326. .operation-item:first-child{
  327. .operation-icon{
  328. text{
  329. font-size: 30rpx;
  330. }
  331. }
  332. }
  333. }
  334. .operation-items{
  335. display: flex;
  336. justify-content: flex-start;
  337. .operation-item:first-child{
  338. .operation-text{
  339. width: 100rpx;
  340. }
  341. }
  342. .operation-item:last-child{
  343. .operation-text{
  344. width: 80rpx;
  345. }
  346. }
  347. }
  348. .operation-item{
  349. display: flex;
  350. justify-content: flex-start;
  351. .operation-icon{
  352. width: 40rpx;
  353. height: 40rpx;
  354. margin-right: 8rpx;
  355. text{
  356. font-size: 40rpx;
  357. line-height: 40rpx;
  358. }
  359. }
  360. .operation-text{
  361. height: 40rpx;
  362. line-height: 41rpx;
  363. font-size: 26rpx;
  364. }
  365. }
  366. }
  367. }
  368. }
  369. }
  370. </style>