Commit ba93e79f by Lin

优化 HomeFrame 组件样式,调整背景色和边距,修复 CustomerSide 组件的内边距问题,更新 ActivityTime 组件的商品点击逻辑和样式,增强用户交互体验。

1 parent 3f7b2d98
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
<view <view
v-for="(item, index) in goodsList" v-for="(item, index) in goodsList"
:key="item.id || index" :key="item.id || index"
class="goods-item" :class="['goods-item', { active: goodsIndex === index }]"
@click="$emit('goodsClick', item, index)" @click="handleGoodsClick(item, index)"
> >
<view v-if="item.isMain" class="goods-item-badge">主推</view> <view v-if="item.isMain" class="goods-item-badge">主推</view>
<view v-else class="goods-item-badge badge02">次推</view> <view v-else class="goods-item-badge badge02">次推</view>
...@@ -138,6 +138,7 @@ export default { ...@@ -138,6 +138,7 @@ export default {
{ label: '特斯拉 Model 3', key: 'model3' } { label: '特斯拉 Model 3', key: 'model3' }
], ],
carModelIndex: 0, carModelIndex: 0,
goodsIndex: 0,
goodsList: MOCK_GOODS_LIST goodsList: MOCK_GOODS_LIST
} }
}, },
...@@ -150,6 +151,10 @@ export default { ...@@ -150,6 +151,10 @@ export default {
this.carModelIndex = index this.carModelIndex = index
this.$emit('carModelChange', this.carModelTabs[index], index) this.$emit('carModelChange', this.carModelTabs[index], index)
}, },
handleGoodsClick(item, index) {
this.goodsIndex = index
this.$emit('goodsClick', item, index)
},
handleEntranceClick(item) { handleEntranceClick(item) {
this.$emit('entranceClick', item) this.$emit('entranceClick', item)
} }
...@@ -162,12 +167,13 @@ export default { ...@@ -162,12 +167,13 @@ export default {
width: toRpx(1138); width: toRpx(1138);
height: 100%; height: 100%;
background-color: #ffffff; background-color: #ffffff;
.type-box { .type-box {
height: 62px; height: 31px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
margin-bottom: toRpx(28);
} }
.type-tag-item { .type-tag-item {
...@@ -262,7 +268,7 @@ export default { ...@@ -262,7 +268,7 @@ export default {
justify-content: center; justify-content: center;
gap: 4px; gap: 4px;
padding: toRpx(10) toRpx(16); padding: toRpx(10) toRpx(16);
border-radius: 0 0 0 8px; border-radius: 0 8px 0 8px;
background: rgba(0, 0, 0, 0.60); background: rgba(0, 0, 0, 0.60);
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
...@@ -285,9 +291,10 @@ export default { ...@@ -285,9 +291,10 @@ export default {
.goods-menu { .goods-menu {
$goods-item-height: 120px; $goods-item-height: 120px;
$shadow-space: 8px;
width: 100%; width: 100%;
height: $goods-item-height; height: calc(#{$goods-item-height} + #{$shadow-space * 2});
white-space: nowrap; white-space: nowrap;
margin: toRpx(28) 0; margin: toRpx(28) 0;
...@@ -296,27 +303,35 @@ export default { ...@@ -296,27 +303,35 @@ export default {
flex-wrap: nowrap; flex-wrap: nowrap;
gap: 12px; gap: 12px;
height: $goods-item-height; height: $goods-item-height;
padding: $shadow-space;
box-sizing: content-box;
} }
.goods-item { .goods-item {
position: relative; position: relative;
flex-shrink: 0; flex-shrink: 0;
box-sizing: border-box;
width: 252px; width: 252px;
height: $goods-item-height; height: $goods-item-height;
display: flex; display: flex;
align-items: stretch; align-items: stretch;
overflow: hidden; overflow: hidden;
border: 1.5px solid rgba(44, 102, 247, 0.1); border: none;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 8px 0 rgba(44, 102, 247, 0.1); background: #FFF;
background: linear-gradient(90deg, rgba(44, 102, 247, 0.05) 0%, rgba(44, 102, 247, 0.05) 100%), #fff; box-shadow: 0 2px 8px 0 rgba(44, 102, 247, 0.10);
cursor: pointer; cursor: pointer;
&.active {
border: 1.5px solid rgba(44, 102, 247, 0.10);
background: linear-gradient(0deg, rgba(44, 102, 247, 0.05) 0%, rgba(44, 102, 247, 0.05) 100%), #FFF;
}
} }
.goods-item-badge { .goods-item-badge {
position: absolute; position: absolute;
left: -1.5px; left: 0;
top: -1.5px; top: 0;
z-index: 2; z-index: 2;
padding: 2px 10px; padding: 2px 10px;
border-radius: 0 0 8px 0; border-radius: 0 0 8px 0;
...@@ -329,6 +344,11 @@ export default { ...@@ -329,6 +344,11 @@ export default {
.badge02 { .badge02 {
background: linear-gradient(90deg, #5C8AFF 0%, #49B6FF 100%); background: linear-gradient(90deg, #5C8AFF 0%, #49B6FF 100%);
} }
.goods-item.active .goods-item-badge {
left: -1.5px;
top: -1.5px;
}
.goods-item-img-wrap { .goods-item-img-wrap {
flex-shrink: 0; flex-shrink: 0;
width: 88px; width: 88px;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
</view> </view>
</view> </view>
<scroll-view class="customer-list" scroll-y show-scrollbar="false"> <scroll-view class="customer-list" scroll-y show-scrollbar="false">
<view class="customer-list-inner">
<view class="customer-count"> <view class="customer-count">
<view class="customer-count-left"> <view class="customer-count-left">
<image <image
...@@ -41,11 +42,11 @@ ...@@ -41,11 +42,11 @@
<text class="customer-count-unit">位客户</text> <text class="customer-count-unit">位客户</text>
</view> </view>
</view> </view>
<view <view
v-for="item in customerList" v-for="item in customerList"
:key="item.id" :key="item.id"
class="customer-item" class="customer-item"
> >
<view class="customer-item-avatar"> <view class="customer-item-avatar">
<text class="customer-item-avatar-text">{{ item.surname }}</text> <text class="customer-item-avatar-text">{{ item.surname }}</text>
</view> </view>
...@@ -78,6 +79,7 @@ ...@@ -78,6 +79,7 @@
<view class="sprite-icon icon-arrow-right"></view> <view class="sprite-icon icon-arrow-right"></view>
</view> </view>
</view> </view>
</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -175,7 +177,7 @@ export default { ...@@ -175,7 +177,7 @@ export default {
justify-content: space-between; justify-content: space-between;
padding: toRpx(8) 0 toRpx(28) 0; padding: toRpx(8) 0 toRpx(28) 0;
border-bottom: 1px solid #F5F7FA; border-bottom: 1px solid #F5F7FA;
margin-top: toRpx(36); margin-top: toRpx(28);
.header-left { .header-left {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -231,7 +233,11 @@ export default { ...@@ -231,7 +233,11 @@ export default {
.customer-list { .customer-list {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
padding-top: 12px; box-sizing: border-box;
}
.customer-list-inner {
padding: 12px 4px 4px;
box-sizing: border-box; box-sizing: border-box;
} }
......
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
<view <view
v-show="homeContentTabIndex === 0" v-show="homeContentTabIndex === 0"
class="right-content-box flex right-content-box-scene1" class="right-content-box flex right-content-box-scene1"
style="margin-top: 16px;"
> >
<view class="content-left" style="padding-bottom: 40px;"> <view class="content-left" style="padding-bottom: 40px;">
<view class="module-box box-class scene1-box-shadow"> <view class="module-box box-class scene1-box-shadow">
...@@ -1085,7 +1084,7 @@ export default { ...@@ -1085,7 +1084,7 @@ export default {
} }
.right-content-scene1 { .right-content-scene1 {
box-sizing: border-box; box-sizing: border-box;
background: #ebf7a6; background: #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
border: 2px solid #FFF; border: 2px solid #FFF;
} }
...@@ -1125,6 +1124,7 @@ export default { ...@@ -1125,6 +1124,7 @@ export default {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
z-index: 1; z-index: 1;
background-color: #eef4fe;
.home-content-tab { .home-content-tab {
flex: 1; flex: 1;
...@@ -1144,6 +1144,7 @@ export default { ...@@ -1144,6 +1144,7 @@ export default {
background: linear-gradient(90deg, #61C0FF 0%, #2C66F7 100%); background: linear-gradient(90deg, #61C0FF 0%, #2C66F7 100%);
border-radius: toRpx(24); border-radius: toRpx(24);
margin-right: toRpx(48); margin-right: toRpx(48);
margin-bottom: toRpx(4);
.start-icon { .start-icon {
width: toRpx(48); width: toRpx(48);
height: toRpx(48); height: toRpx(48);
...@@ -1244,13 +1245,13 @@ export default { ...@@ -1244,13 +1245,13 @@ export default {
} }
} }
.right-content-box-scene1 { .right-content-box-scene1 {
// border-radius: 24px; border-radius: 24px;
padding: 16px 20px; padding: 16px 20px;
box-sizing: border-box; box-sizing: border-box;
background-color: #ffffff; background-color: #ffffff;
flex: 1; flex: 1;
min-height: 0; min-height: 0;
transform: translateY(toMinusRpx(32)); // transform: translateY(toMinusRpx(32));
.tab-container { .tab-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -1261,7 +1262,8 @@ export default { ...@@ -1261,7 +1262,8 @@ export default {
.line { .line {
width: 1px; width: 1px;
flex-shrink: 0; flex-shrink: 0;
margin: 0 20px; margin-left: 20px;
margin-right: 20px;
background-color: #F5F7FA; background-color: #F5F7FA;
} }
.container-left { .container-left {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!