Commit 67bf948e by Lin

refactor(Entrance、HomeFrame、CustomerSide、CouponPop):更新组件结构与样式

- 从 Entrance.vue 中移除 `showOnActivityTab`。
- 在 HomeFrame.vue 中新增 CustomerSide 组件,并优化样式以改善布局。
- 在 CustomerSide 组件中添加 header 渐变色和图标可见性的 props。
- 改进 CouponPop.vue,更高效地处理客户信息,包括车辆详情的映射。
1 parent ce72508f
...@@ -218,7 +218,6 @@ export default { ...@@ -218,7 +218,6 @@ export default {
page: '/pages/common/serviceDetail/index', page: '/pages/common/serviceDetail/index',
eventCode: 'app_service_center', eventCode: 'app_service_center',
sceneType: [1], sceneType: [1],
showOnActivityTab: true,
pageDirect: true, pageDirect: true,
noInterception: true noInterception: true
}, },
......
<template> <template>
<view :class="['container-right', { 'container-right--page': type === 'in' }]"> <view :class="['container-right', { 'container-right--page': type === 'in' }]">
<view class="customer-header"> <view
:class="['customer-header', { 'customer-header--gradient': enableHeaderGradient }]"
:style="enableHeaderGradient ? headerStyle : undefined"
>
<!-- 左 --> <!-- 左 -->
<view class="header-left"> <view class="header-left">
<image <image
v-if="showHeaderIcon"
class="header-left-icon" class="header-left-icon"
:src="require('@/assets/images/common/icon-file-custom.png')" :src="require('@/assets/images/common/icon-file-custom.png')"
mode="aspectFit" mode="aspectFit"
...@@ -106,6 +110,35 @@ export default { ...@@ -106,6 +110,35 @@ export default {
customerProfile: { customerProfile: {
type: Array, type: Array,
default: () => [] default: () => []
},
showHeaderIcon: {
type: Boolean,
default: true
},
enableHeaderGradient: {
type: Boolean,
default: false
},
headerGradient: {
type: Object,
default: null
}
},
computed: {
headerStyle() {
if (!this.enableHeaderGradient) return {}
const {
afterGradient = 'linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%)',
beforeGradient = 'linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%)',
afterOpacity = 0.15,
beforeOpacity = 0.6
} = this.headerGradient || {}
return {
'--header-gradient-after': afterGradient,
'--header-gradient-before': beforeGradient,
'--header-gradient-after-opacity': afterOpacity,
'--header-gradient-before-opacity': beforeOpacity
}
} }
}, },
methods: { methods: {
...@@ -190,6 +223,10 @@ export default { ...@@ -190,6 +223,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$card-shadow-space: 4px;
$content-h-gap: 12px;
$item-side-margin: $content-h-gap - $card-shadow-space;
.container-right { .container-right {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
...@@ -210,9 +247,46 @@ export default { ...@@ -210,9 +247,46 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: toRpx(8) 0 toRpx(28) 0; padding: toRpx(36) 12px toRpx(28);
border-bottom: 1px solid #F5F7FA; border-bottom: 1px solid #F5F7FA;
margin-top: toRpx(28);
&--gradient {
position: relative;
&::after {
content: '';
position: absolute;
left: 0;
top: 0;
z-index: 0;
width: 100%;
height: 100%;
background: var(--header-gradient-after, linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%));
opacity: var(--header-gradient-after-opacity, 0.15);
pointer-events: none;
}
&::before {
content: '';
position: absolute;
left: toMinusRpx(20);
top: toMinusRpx(28);
z-index: 0;
width: toRpx(136);
height: toRpx(136);
opacity: var(--header-gradient-before-opacity, 0.6);
background: var(--header-gradient-before, linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%));
filter: blur(toRpx(24));
pointer-events: none;
}
.header-left,
.header-right {
position: relative;
z-index: 1;
}
}
.header-left { .header-left {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -272,7 +346,8 @@ export default { ...@@ -272,7 +346,8 @@ export default {
} }
.customer-list-inner { .customer-list-inner {
padding: 12px 4px 4px; // 阴影绘制空间放在 inner,避免 scroll-view 裁剪左右 box-shadow
padding: 12px $card-shadow-space calc(4px + #{$card-shadow-space});
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -289,7 +364,7 @@ export default { ...@@ -289,7 +364,7 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 8px 12px; padding: 8px 12px;
margin-bottom: 8px; margin: 0 $item-side-margin 8px;
border-radius: 10px; border-radius: 10px;
background: rgba(44, 102, 247, 0.05); background: rgba(44, 102, 247, 0.05);
box-sizing: border-box; box-sizing: border-box;
...@@ -345,7 +420,7 @@ export default { ...@@ -345,7 +420,7 @@ export default {
align-items: flex-start; align-items: flex-start;
gap: 8px; gap: 8px;
padding: 10px 12px; padding: 10px 12px;
margin-bottom: 8px; margin: 0 $item-side-margin 8px;
background: #FFFFFF; background: #FFFFFF;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 4px rgba(44, 102, 247, 0.10); box-shadow: 0 2px 4px rgba(44, 102, 247, 0.10);
......
...@@ -94,10 +94,14 @@ ...@@ -94,10 +94,14 @@
</view> </view>
</view> </view>
</view> </view>
<view class="content-right box-class scene1-box-shadow"> <view class="content-right box-class scene1-box-shadow content-right-customer">
<view class="common-title">服务中心</view> <view class="content-right-customer-inner">
<view class="content-box"> <CustomerSide
<MessageIndex class="message-box" ref="messageRef" /> :customerProfile="customerProfileList"
enable-header-gradient
:showHeaderIcon="false"
:headerGradient="customerHeaderGradient"
/>
</view> </view>
</view> </view>
</view> </view>
...@@ -386,7 +390,13 @@ export default { ...@@ -386,7 +390,13 @@ export default {
}), }),
activityProductList: [], activityProductList: [],
prelearnData: {}, prelearnData: {},
customerProfileList: [] customerProfileList: [],
customerHeaderGradient: Object.freeze({
afterGradient: 'linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%)',
beforeGradient: 'linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%)',
afterOpacity: 0.15,
beforeOpacity: 0.6
})
} }
}, },
beforeDestroy() { beforeDestroy() {
...@@ -1404,6 +1414,35 @@ export default { ...@@ -1404,6 +1414,35 @@ export default {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
// transform: translateY(toMinusRpx(32)); // transform: translateY(toMinusRpx(32));
.content-left {
flex: 1 1 0;
min-width: 0;
width: auto;
}
.content-right-customer {
flex: 0 1 toRpx(720);
min-width: toRpx(320);
max-width: 40%;
width: auto;
height: calc(100% - 16px);
min-height: 0;
box-sizing: border-box;
padding: 0 0 16px;
display: flex;
flex-direction: column;
overflow: hidden;
.content-right-customer-inner {
margin-top: -10px;
}
&-inner {
flex: 1;
min-height: 0;
overflow: hidden;
}
}
.tab-container { .tab-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -420,6 +420,17 @@ export default { ...@@ -420,6 +420,17 @@ export default {
this.pageParams.customerQr = '' this.pageParams.customerQr = ''
this.$refs.couponPopup.open() this.$refs.couponPopup.open()
this.customerType = customerType this.customerType = customerType
if (customerInfo.inviteRecordId) {
this.customerInfo = customerInfo
this.pageParams.carInfo = {
carChildsBrandId: customerInfo.carChildsBrandId,
carChildsBrandName: customerInfo.carChildsBrandName,
carBrandId: customerInfo.carBrandId,
carBrand: customerInfo.carBrand,
id: customerInfo.carSeriesId,
name: customerInfo.carSeriesName
}
}
if (customerInfo.customerCouponId) { if (customerInfo.customerCouponId) {
try { try {
uni.showLoading({ uni.showLoading({
...@@ -443,8 +454,6 @@ export default { ...@@ -443,8 +454,6 @@ export default {
if (data) { if (data) {
this.pageParams.customerCouponId = customerInfo.customerCouponId this.pageParams.customerCouponId = customerInfo.customerCouponId
this.pageParams.customerQr = data this.pageParams.customerQr = data
if (customerInfo.inviteRecordId) this.customerInfo = customerInfo
} else throw '生成小程序码失败,请重试!' } else throw '生成小程序码失败,请重试!'
} else throw message } else throw message
......
...@@ -245,6 +245,7 @@ export default { ...@@ -245,6 +245,7 @@ export default {
this.$refs.invitationCanvas.clearBoard() this.$refs.invitationCanvas.clearBoard()
}, },
openDetail (e) { openDetail (e) {
console.log('openDetail**e**', e);
this.couponPopupRef.open(0, { this.couponPopupRef.open(0, {
...e, ...e,
phoneNumber: e.customerPhone, phoneNumber: e.customerPhone,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!