services.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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" @click.stop>
  7. <view v-if="ValueZoneSwiper.length > 0">
  8. <up-swiper :list="ValueZoneSwiper" :indicator="false" class="Up-swiper" @click="handleSwiperClick"
  9. :height="'516rpx'"></up-swiper>
  10. </view>
  11. </view>
  12. <template v-else>
  13. <up-lazy-load threshold="50" border-radius="10" :image="item.volunteerPicture" :index="index"
  14. mode="aspectFill"></up-lazy-load>
  15. <view class="demo-skillDescribe">
  16. {{ item.businessDescribe }}
  17. </view>
  18. <view class="demo-title-container">
  19. <view class="demo-title">
  20. {{ item.businessTierName }}
  21. </view>
  22. </view>
  23. <view class="demo-PriceDome">
  24. <view class="demo-price">
  25. <image :src="item.volunteerPicture" class="name-image"></image>
  26. <text class="name-text">{{ item.name }}</text>
  27. </view>
  28. <view class="demo-price">
  29. <image src="/static/img/1x.png" class="image-1x"></image>
  30. <text class="name-textNumber">1w</text>
  31. </view>
  32. </view>
  33. <view class="demo-price-distance">
  34. <view class="demo-price-distance-text-1">
  35. <text class="demo-price-distance-text-2">¥</text>
  36. <text class="demo-price-distance-text">{{ item.businessPrice }}</text>
  37. </view>
  38. <button class="demo-price-distance-button" @click="goToDetail(item)">抢购</button>
  39. </view>
  40. </template>
  41. </view>
  42. </template>
  43. <template #right>
  44. <view class=" demo-warter" v-for="(item, index) in props.rightList" :key="index" @click="goToDetail(item)">
  45. <up-lazy-load threshold="50" border-radius="10" :image="item.volunteerPicture" :index="index"
  46. mode="aspectFill"></up-lazy-load>
  47. <view class="demo-skillDescribe">
  48. {{ item.businessDescribe }}
  49. </view>
  50. <view class="demo-title-container">
  51. <view class="demo-title">
  52. {{ item.businessTierName }}
  53. </view>
  54. </view>
  55. <view class="demo-PriceDome">
  56. <view class="demo-price">
  57. <image :src="item.volunteerPicture" class="name-image"></image>
  58. <text class="name-text">{{ item.name }}</text>
  59. </view>
  60. <view class="demo-price">
  61. <image src="/static/img/1x.png" class="image-1x"></image>
  62. <text class="name-textNumber">1w</text>
  63. </view>
  64. </view>
  65. <view class="demo-price-distance">
  66. <view class="demo-price-distance-text-1">
  67. <text class="demo-price-distance-text-2">¥</text>
  68. <text class="demo-price-distance-text">{{ item.businessPrice }}</text>
  69. </view>
  70. <button class="demo-price-distance-button" @click="goToDetail(item)">抢购</button>
  71. </view>
  72. </view>
  73. </template>
  74. </up-waterfall>
  75. </view>
  76. </template>
  77. <script setup>
  78. const props = defineProps({
  79. leftList: {
  80. type: Array,
  81. default: () => []
  82. },
  83. rightList: {
  84. type: Array,
  85. default: () => []
  86. },
  87. ValueZoneSwiper: {
  88. type: Array,
  89. default: () => []
  90. }
  91. });
  92. // 轮播图点击事件
  93. const handleSwiperClick = (item) => {
  94. console.log('轮播图点击', item);
  95. // 这里可以添加轮播图的点击处理逻辑
  96. }
  97. const goToDetail = async (item) => {
  98. const params = {
  99. volunteerId: item.volunteerId, // 获取 volunteerId
  100. serviceCategory: item.serviceCategory, // 获取 serviceCategory
  101. businessManagementId: item.businessManagementId, //获取 businessManagementId
  102. };
  103. const data = encodeURIComponent(JSON.stringify(params))
  104. console.log(data, '>>>>>data');
  105. uni.navigateTo({
  106. url: `/pages_home/pages/Volunteerside/goodsDetails?params=${data}`
  107. });
  108. }
  109. </script>
  110. <style scoped lang="scss">
  111. /* 轮播图片 */
  112. .home-swiper {
  113. width: 340rpx;
  114. height: 516rpx;
  115. :deep(.Up-swiper) {
  116. width: 100%;
  117. height: 100%;
  118. }
  119. }
  120. .demo-warter {
  121. margin-top: 80rpx;
  122. border-radius: 8px;
  123. margin: 5px;
  124. background-color: #ffffff;
  125. // padding-left: 10rpx;
  126. // padding-right: 10rpx;
  127. margin-bottom: 30rpx;
  128. }
  129. .u-close {
  130. position: absolute;
  131. top: 32rpx;
  132. right: 32rpx;
  133. }
  134. .demo-image {
  135. width: 100%;
  136. border-radius: 4px;
  137. }
  138. .demo-title-container {
  139. display: flex;
  140. flex-direction: column;
  141. // justify-content: center;
  142. // align-items: center;
  143. padding: 4rpx 0rpx;
  144. // z-index: 0;
  145. margin-top: 10rpx;
  146. border-radius: 10rpx;
  147. box-sizing: border-box;
  148. // border: 1rpx solid rgba(237, 93, 49, 0.8);
  149. }
  150. .demo-title {
  151. font-size: 22rpx;
  152. color: #ED5D31;
  153. display: -webkit-box;
  154. -webkit-box-orient: vertical;
  155. -webkit-line-clamp: 3;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. word-break: break-all;
  159. }
  160. .demo-skillDescribe {
  161. width: 345rpx;
  162. height: auto;
  163. font-family: PingFang SC;
  164. font-size: 26rpx;
  165. font-weight: 500;
  166. line-height: 36rpx;
  167. letter-spacing: normal;
  168. color: #141414;
  169. margin-top: 5px;
  170. display: -webkit-box;
  171. -webkit-box-orient: vertical;
  172. -webkit-line-clamp: 1;
  173. overflow: hidden;
  174. text-overflow: ellipsis;
  175. word-break: break-all;
  176. }
  177. .demo-img {
  178. width: 40rpx;
  179. height: 40rpx;
  180. border-radius: 50%;
  181. }
  182. .demo-PriceDome {
  183. display: flex;
  184. justify-content: space-between;
  185. align-items: center;
  186. width: 100%;
  187. margin-top: 15rpx;
  188. }
  189. .demo-price {
  190. display: flex;
  191. align-items: center;
  192. overflow: hidden;
  193. /* 防止内容溢出 */
  194. }
  195. .image-1x {
  196. width: 20rpx;
  197. height: 20rpx;
  198. z-index: 0;
  199. }
  200. .name-textNumber {
  201. font-size: 22rpx;
  202. font-weight: normal;
  203. line-height: 24rpx;
  204. text-align: right;
  205. letter-spacing: -0.04em;
  206. color: #FF6E51;
  207. }
  208. .demo-price-distance {
  209. display: flex;
  210. justify-content: space-between;
  211. align-items: center;
  212. margin-top: 10rpx;
  213. .demo-price-distance-text-1 {
  214. display: flex;
  215. align-items: center;
  216. .demo-price-distance-text-2 {
  217. font-family: Source Han Sans;
  218. font-size: 22rpx;
  219. font-weight: bold;
  220. line-height: 34rpx;
  221. color: #FA2922;
  222. }
  223. }
  224. .demo-price-distance-text {
  225. font-family: Source Han Sans;
  226. font-weight: 700;
  227. font-size: 40rpx;
  228. font-variation-settings: "opsz" auto;
  229. color: #FA2922;
  230. }
  231. .demo-price-distance-button {
  232. width: 124rpx;
  233. height: 51rpx;
  234. display: flex;
  235. justify-content: center;
  236. align-items: center;
  237. border-radius: 36rpx;
  238. background: linear-gradient(90deg, #FE534B 25%, #FD8F7C 91%);
  239. box-shadow: 0rpx 1rpx 2rpx 0rpx rgba(0, 0, 0, 0.18), inset 0rpx 4rpx 10rpx 0rpx rgba(255, 221, 221, 0.3);
  240. color: #FFFFFF;
  241. font-size: 30rpx;
  242. padding: 0;
  243. margin-left: 70rpx;
  244. }
  245. }
  246. .name-text {
  247. width: 117rpx;
  248. height: 34rpx;
  249. font-family: PingFang SC;
  250. font-size: 24rpx;
  251. font-weight: normal;
  252. line-height: 34rpx;
  253. letter-spacing: -0.04em;
  254. color: rgba(0, 0, 0, 0.8);
  255. }
  256. .name-image {
  257. width: 40rpx;
  258. height: 40rpx;
  259. margin-right: 10rpx;
  260. border-radius: 50%;
  261. }
  262. .name-text {
  263. white-space: nowrap;
  264. /* 禁止换行 */
  265. overflow: hidden;
  266. /* 超出部分隐藏 */
  267. text-overflow: ellipsis;
  268. /* 显示省略号 */
  269. max-width: 120rpx;
  270. /* 6个中文字符大约占120rpx */
  271. }
  272. </style>