activeParty.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="hot-img" :style="'margin-top:' + mbConfig +'rpx;background-color:' + boxColor+';'" v-if="explosiveMoney.length">
  3. <!--单行展示-->
  4. <block v-if="tabConfig == 0">
  5. <view class="item skeleton-rect" v-for="(item, index) in explosiveMoney" :key="index" @click="goDetail(item)">
  6. <view class="title area-row">{{ item.info[0].value }}</view>
  7. <view class="msg area-row line1">{{ item.info[1].value }}</view>
  8. <view class="img">
  9. <easy-loadimage mode="widthFix" :image-src="item.img"></easy-loadimage>
  10. </view>
  11. </view>
  12. </block>
  13. <!--多行展示-->
  14. <block v-if="tabConfig == 1">
  15. <view class="bd">
  16. <view class="item skeleton-rect" v-for="(item, index) in explosiveMoney" :key="index" @click="goDetail(item)">
  17. <view class="left">
  18. <view class="title area-row">{{ item.info[0].value }}</view>
  19. <view class="msg area-row">{{ item.info[1].value }}</view>
  20. </view>
  21. <view class="img">
  22. <easy-loadimage mode="widthFix" :image-src="item.img"></easy-loadimage>
  23. </view>
  24. </view>
  25. </view>
  26. </block>
  27. </view>
  28. </template>
  29. <script>
  30. import {merPath} from "@/utils/index"
  31. export default {
  32. name: 'activeParty',
  33. props: {
  34. dataConfig: {
  35. type: Object,
  36. default: () => {}
  37. },
  38. merId: {
  39. type: String || Number,
  40. default: ''
  41. }
  42. },
  43. data() {
  44. return {
  45. explosiveMoney: this.dataConfig.menuConfig.list,
  46. themeColor: this.dataConfig.themeColor.color[0].item,
  47. bgColor: this.dataConfig.bgColor.color,
  48. mbConfig: this.dataConfig.mbConfig.val*2,
  49. boxColor: this.dataConfig.boxColor.color[0].item,
  50. tabConfig: this.dataConfig.tabConfig.tabVal, //展示样式
  51. };
  52. },
  53. created() {},
  54. methods: {
  55. goDetail(url){
  56. let urls = url.info[2].value
  57. urls = merPath(urls, this.merId)
  58. console.log(urls,'urls');
  59. if(urls.indexOf("http") != -1){
  60. // #ifdef H5
  61. location.href = urls
  62. // #endif
  63. }else{
  64. if(['/pages/goods_cate/goods_cate','/pages/order_addcart/order_addcart','/pages/user/index','/pages/plant_grass/index'].indexOf(urls) == -1){
  65. uni.navigateTo({
  66. url:urls
  67. })
  68. }else{
  69. uni.switchTab({
  70. url:urls
  71. })
  72. }
  73. }
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .hot-img {
  80. display: flex;
  81. align-items: center;
  82. justify-content: space-between;
  83. margin: 0 20rpx 0;
  84. padding: 20rpx 0;
  85. width: 710rpx;
  86. .item {
  87. display: block;
  88. width: 23.5%;
  89. background-color: #fefeff;
  90. padding: 20rpx 0 10rpx;
  91. border-radius: 8rpx;
  92. text-align: center;
  93. box-shadow: 2px 1px 6px 1px rgba(0, 0, 0, 0.03);
  94. .title {
  95. font-weight: bold;
  96. color: #282828;
  97. height: 40rpx;
  98. }
  99. .msg {
  100. margin: 5rpx auto 0;
  101. font-size: 20rpx;
  102. max-width: 120rpx;
  103. height: 30rpx;
  104. }
  105. .img {
  106. margin: 10rpx auto 0;
  107. width: 130rpx;
  108. height: 130rpx;
  109. /deep/image,/deep/.easy-loadimage,/deep/uni-image {
  110. width: 130rpx;
  111. height: 130rpx;
  112. }
  113. }
  114. &:first-child .msg {
  115. color: #8fbbe8;
  116. }
  117. &:nth-child(2) .msg {
  118. color: #d797b7;
  119. }
  120. &:nth-child(3) .msg {
  121. color: #c49bd1;
  122. }
  123. &:nth-child(4) .msg {
  124. color: #a3bf95;
  125. }
  126. }
  127. }
  128. .bd{
  129. display: flex;
  130. flex-wrap: wrap;
  131. .item{
  132. display: flex;
  133. align-items: center;
  134. width: 49%;
  135. margin-right: 2%;
  136. background: #fff;
  137. border-radius: 16rpx;
  138. padding: 20rpx;
  139. justify-content: space-between;
  140. &:nth-child(3),&:nth-child(4){
  141. margin-top: 20rpx;
  142. }
  143. &:nth-child(2n){
  144. margin-right: 0;
  145. }
  146. .left{
  147. width: 150rpx;
  148. align-items: center;
  149. }
  150. .img{
  151. margin: 0;
  152. }
  153. /deep/image,/deep/.easy-loadimage,uni-image{
  154. width: 120rpx!important;
  155. height: 120rpx!important;
  156. }
  157. }
  158. }
  159. </style>