services.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view>
  3. <up-waterfall>
  4. <template #left>
  5. <view class="demo-warter" v-for="(item, index) in props.leftList" :key="index" @click="goToDetail(item)">
  6. <view v-if="item.type == 'slideshow'" class="home-swiper">
  7. <view v-if="ValueZoneSwiper.length > 0">
  8. <up-swiper :list="ValueZoneSwiper" :indicator="false" class="Up-swiper"></up-swiper>
  9. </view>
  10. </view>
  11. <template v-else>
  12. <up-lazy-load threshold="50" border-radius="10" :image="item.volunteerPicture" :index="index"
  13. mode="aspectFill"></up-lazy-load>
  14. <view class="demo-title-container">
  15. <view class="demo-title">
  16. {{ item.businessTierName }}
  17. </view>
  18. </view>
  19. <view class="demo-skillDescribe">
  20. {{ item.skillDescribe }}
  21. </view>
  22. <!-- <view class="demo-PriceDome">
  23. <view class="demo-price">
  24. <image :src="item.volunteerPicture" class="name-image"></image>
  25. {{ item.name }}
  26. </view>
  27. </view> -->
  28. </template>
  29. </view>
  30. </template>
  31. <template #right>
  32. <view class="demo-warter" v-for="(item, index) in props.rightList" :key="index" @click="goToDetail(item)">
  33. <up-lazy-load threshold="50" border-radius="10" :image="item.volunteerPicture" :index="index"
  34. mode="aspectFill"></up-lazy-load>
  35. <view class="demo-title-container">
  36. <view class="demo-title">
  37. {{ item.businessTierName }}
  38. </view>
  39. </view>
  40. <view class="demo-skillDescribe">
  41. {{ item.skillDescribe }}
  42. </view>
  43. <!-- <view class="demo-PriceDome">
  44. <view class="demo-price">
  45. <image :src="item.volunteerPicture" class="name-image"></image>
  46. {{ item.name }}
  47. </view>
  48. </view> -->
  49. </view>
  50. </template>
  51. </up-waterfall>
  52. </view>
  53. </template>
  54. <script setup>
  55. const props = defineProps({
  56. leftList: {
  57. type: Array,
  58. default: () => []
  59. },
  60. rightList: {
  61. type: Array,
  62. default: () => []
  63. },
  64. ValueZoneSwiper: {
  65. type: Array,
  66. default: () => []
  67. }
  68. });
  69. const goToDetail = async (item) => {
  70. const params = {
  71. volunteerId: item.volunteerId, // 获取 volunteerId
  72. serviceCategory: item.serviceCategory, // 获取 serviceCategory
  73. businessManagementId: item.businessManagementId, //获取 businessManagementId
  74. };
  75. const data = encodeURIComponent(JSON.stringify(params))
  76. console.log(data, '>>>>>data');
  77. uni.navigateTo({
  78. url: `/pages_home/pages/Volunteerside/goodsDetails?params=${data}`
  79. });
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. /* 轮播图片 */
  84. .home-swiper {
  85. width: 340rpx;
  86. height: 516rpx;
  87. .Up-swiper {
  88. width: 340rpx;
  89. height: 516rpx;
  90. }
  91. }
  92. .demo-warter {
  93. border-radius: 8px;
  94. margin: 5px;
  95. background-color: #ffffff;
  96. }
  97. .u-close {
  98. position: absolute;
  99. top: 32rpx;
  100. right: 32rpx;
  101. }
  102. .demo-image {
  103. width: 100%;
  104. border-radius: 4px;
  105. }
  106. .demo-title-container {
  107. display: flex;
  108. flex-direction: column;
  109. justify-content: center;
  110. align-items: center;
  111. padding: 4rpx 12rpx;
  112. // z-index: 0;
  113. margin-top: 10rpx;
  114. border-radius: 10rpx;
  115. box-sizing: border-box;
  116. border: 1rpx solid rgba(237, 93, 49, 0.8);
  117. }
  118. .demo-title {
  119. font-size: 22rpx;
  120. color: #ED5D31;
  121. display: -webkit-box;
  122. -webkit-box-orient: vertical;
  123. -webkit-line-clamp: 3;
  124. overflow: hidden;
  125. text-overflow: ellipsis;
  126. word-break: break-all;
  127. }
  128. .demo-skillDescribe {
  129. width: 298rpx;
  130. height: 73rpx;
  131. font-family: PingFang SC;
  132. font-size: 26rpx;
  133. font-weight: 500;
  134. line-height: 36rpx;
  135. letter-spacing: normal;
  136. color: #141414;
  137. margin-top: 5px;
  138. display: -webkit-box;
  139. -webkit-box-orient: vertical;
  140. -webkit-line-clamp: 2;
  141. overflow: hidden;
  142. text-overflow: ellipsis;
  143. word-break: break-all;
  144. }
  145. .demo-img {
  146. width: 40rpx;
  147. height: 40rpx;
  148. border-radius: 50%;
  149. }
  150. .demo-PriceDome {
  151. display: flex;
  152. justify-content: space-between;
  153. align-items: center;
  154. width: 100%;
  155. margin-top: 15rpx;
  156. }
  157. .demo-price {
  158. display: flex;
  159. align-items: center;
  160. flex: 1;
  161. overflow: hidden;
  162. /* 防止内容溢出 */
  163. }
  164. .name-image {
  165. width: 40rpx;
  166. height: 40rpx;
  167. margin-right: 10rpx;
  168. border-radius: 50%;
  169. }
  170. .name-text {
  171. white-space: nowrap;
  172. /* 禁止换行 */
  173. overflow: hidden;
  174. /* 超出部分隐藏 */
  175. text-overflow: ellipsis;
  176. /* 显示省略号 */
  177. max-width: 120rpx;
  178. /* 6个中文字符大约占120rpx */
  179. }
  180. </style>