123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <template>
- <view>
- <up-waterfall>
- <template #left>
- <view class="demo-warter" v-for="(item, index) in props.leftList" :key="index" @click="goToDetail(item)">
- <view v-if="item.type == 'slideshow'" class="home-swiper" @click.stop>
- <view v-if="ValueZoneSwiper.length > 0">
- <up-swiper :list="ValueZoneSwiper" :indicator="false" class="Up-swiper" @click="handleSwiperClick"
- :height="'516rpx'"></up-swiper>
- </view>
- </view>
- <template v-else>
- <up-lazy-load threshold="50" border-radius="10" :image="item.volunteerPicture" :index="index"
- mode="aspectFill"></up-lazy-load>
- <view class="demo-title-container">
- <view class="demo-title">
- {{ item.businessTierName }}
- </view>
- </view>
- <view class="demo-skillDescribe">
- {{ item.businessDescribe }}
- </view>
- <view class="demo-PriceDome">
- <view class="demo-price">
- <image :src="item.volunteerPicture" class="name-image"></image>
- <text class="name-text">{{ item.name }}</text>
- </view>
- <view class="demo-price">
- <image src="/static/img/1x.png" class="image-1x"></image>
- <text class="name-textNumber">1w</text>
- </view>
- </view>
- </template>
- </view>
- </template>
- <template #right>
- <view class="demo-warter" v-for="(item, index) in props.rightList" :key="index" @click="goToDetail(item)">
- <up-lazy-load threshold="50" border-radius="10" :image="item.volunteerPicture" :index="index"
- mode="aspectFill"></up-lazy-load>
- <view class="demo-title-container">
- <view class="demo-title">
- {{ item.businessTierName }}
- </view>
- </view>
- <view class="demo-skillDescribe">
- {{ item.businessDescribe }}
- </view>
- <view class="demo-PriceDome">
- <view class="demo-price">
- <image :src="item.volunteerPicture" class="name-image"></image>
- <text class="name-text">{{ item.name }}</text>
- </view>
- <view class="demo-price">
- <image src="/static/img/1x.png" class="image-1x"></image>
- <text class="name-textNumber">1w</text>
- </view>
- </view>
- </view>
- </template>
- </up-waterfall>
- </view>
- </template>
- <script setup>
- const props = defineProps({
- leftList: {
- type: Array,
- default: () => []
- },
- rightList: {
- type: Array,
- default: () => []
- },
- ValueZoneSwiper: {
- type: Array,
- default: () => []
- }
- });
- // 轮播图点击事件
- const handleSwiperClick = (item) => {
- console.log('轮播图点击', item);
- // 这里可以添加轮播图的点击处理逻辑
- }
- const goToDetail = async (item) => {
- const params = {
- volunteerId: item.volunteerId, // 获取 volunteerId
- serviceCategory: item.serviceCategory, // 获取 serviceCategory
- businessManagementId: item.businessManagementId, //获取 businessManagementId
- };
- const data = encodeURIComponent(JSON.stringify(params))
- console.log(data, '>>>>>data');
- uni.navigateTo({
- url: `/pages_home/pages/Volunteerside/goodsDetails?params=${data}`
- });
- }
- </script>
- <style scoped lang="scss">
- /* 轮播图片 */
- .home-swiper {
- width: 340rpx;
- height: 516rpx;
- :deep(.Up-swiper) {
- width: 100%;
- height: 100%;
- }
- }
- .demo-warter {
- margin-top: 80rpx;
- border-radius: 8px;
- margin: 5px;
- background-color: #ffffff;
- // padding-left: 10rpx;
- // padding-right: 10rpx;
- margin-bottom: 30rpx;
- }
- .u-close {
- position: absolute;
- top: 32rpx;
- right: 32rpx;
- }
- .demo-image {
- width: 100%;
- border-radius: 4px;
- }
- .demo-title-container {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 4rpx 12rpx;
- // z-index: 0;
- margin-top: 10rpx;
- border-radius: 10rpx;
- box-sizing: border-box;
- border: 1rpx solid rgba(237, 93, 49, 0.8);
- }
- .demo-title {
- font-size: 22rpx;
- color: #ED5D31;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- .demo-skillDescribe {
- width: 298rpx;
- height: 73rpx;
- font-family: PingFang SC;
- font-size: 26rpx;
- font-weight: 500;
- line-height: 36rpx;
- letter-spacing: normal;
- color: #141414;
- margin-top: 5px;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- .demo-img {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- }
- .demo-PriceDome {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- margin-top: 15rpx;
- }
- .demo-price {
- display: flex;
- align-items: center;
- overflow: hidden;
- /* 防止内容溢出 */
- }
- .image-1x{
- width: 20rpx;
- height: 20rpx;
- z-index: 0;
- }
- .name-textNumber{
- font-size: 22rpx;
- font-weight: normal;
- line-height: 24rpx;
- text-align: right;
- letter-spacing: -0.04em;
- color: #FF6E51;
- }
- .name-text {
- width: 117rpx;
- height: 34rpx;
- font-family: PingFang SC;
- font-size: 24rpx;
- font-weight: normal;
- line-height: 34rpx;
- letter-spacing: -0.04em;
- color: rgba(0, 0, 0, 0.8);
- }
- .name-image {
- width: 40rpx;
- height: 40rpx;
- margin-right: 10rpx;
- border-radius: 50%;
- }
- .name-text {
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- /* 超出部分隐藏 */
- text-overflow: ellipsis;
- /* 显示省略号 */
- max-width: 120rpx;
- /* 6个中文字符大约占120rpx */
- }
- </style>
|