adjust group order component

This commit is contained in:
chenweiqiang 2025-05-09 11:18:57 +08:00
parent 4fd7ff334e
commit c2fe2657bd
2 changed files with 48 additions and 24 deletions

View File

@ -1,21 +1,25 @@
<template> <template>
<view class="bg"> <view class="bg">
<view class="flex-round-m-8"> <view class="flex-s-between-m-8">
<image <view class="flex-c-m-8">
:src="groupLeader.avatar" <image
mode="aspectFill" :src="groupLeader.avatar"
class="avatar" mode="aspectFill"
@error="handleAvatarError(groupLeader)" class="avatar"
/> @error="handleAvatarError(groupLeader)"
<text>{{ groupLeader.nickname }}</text> />
<text style="padding-left: 8px;">{{ groupLeader.nickname }}</text>
</view>
<uni-icons v-if="type === 'pickup'" type="location" size="30"></uni-icons> <uni-icons v-if="type === 'pickup'" type="location" size="30"></uni-icons>
<text v-if="type === 'pickup'">{{ pickupAddr }}</text> <text v-if="type === 'pickup'">{{ pickupAddr }}</text>
<text>{{ groupTypeInfo() }}</text> <text>{{ groupTypeInfo() }}</text>
</view> </view>
<text>{{ desc }}</text> <view class="text-ellipsis">{{ desc }}</view>
<view class="flex-c-m-8"> <view class="flex-c-m-8">
<view v-for="item in itemList" :key="item.id"> <view class="item" v-for="item in itemList" :key="item.id">
<image <image
class="item-img-h-50"
:src="item.image_url" :src="item.image_url"
mode="aspectFill" mode="aspectFill"
@error="handleImageError(item)" @error="handleImageError(item)"
@ -24,18 +28,13 @@
</view> </view>
</view> </view>
<view class="flex-c-m-8"> <view class="flex-s-between-m-8">
<text>{{ statisticDesc }}</text> <text>{{ statisticDesc }}</text>
<button <view class="flex-c-m-8">
@click="shareHandler" <button @click="shareHandler">分享</button>
> <button @click="joinHandler">参团</button>
分享 </view>
</button>
<button
@click="joinHandler"
>
参团
</button>
</view> </view>
</view> </view>
</template> </template>
@ -107,9 +106,9 @@ function groupTypeInfo() {
margin: 10px; margin: 10px;
} }
.flex-round-m-8 { .flex-s-between-m-8 {
display: flex; display: flex;
align-content: space-around; justify-content: space-between;
align-items: center; align-items: center;
margin: 8px; margin: 8px;
} }
@ -125,4 +124,29 @@ function groupTypeInfo() {
height: 100rpx; height: 100rpx;
border-radius: 50%; border-radius: 50%;
} }
.text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; /* 兼容 WebKit 内核浏览器 */
-webkit-line-clamp: 2; /* 限制显示行数 */
-webkit-box-orient: vertical; /* 文本垂直排列 */
line-clamp: 2; /* 标准语法(部分浏览器支持) */
white-space: normal; /* 允许换行 */
/* 其他样式 */
font-size: 14px;
line-height: 1.5;
}
.item-img-h-50 {
width: 50px;
height: 50px;
}
.item {
margin-left: 20px;
display: inline-grid;
justify-content: center; /* 水平方向居中对齐 */
align-items: center; /* 垂直方向居中对齐 */
}
</style> </style>

View File

@ -31,7 +31,7 @@ export default {
{ {
id:"1", id:"1",
type:"express", type:"express",
desc:"测试描述", desc:"测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述",
status:"start", status:"start",
pickup_addr:"自提点地址", pickup_addr:"自提点地址",
item_list:[ item_list:[