services.vue 3.9 KB

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