Commit 8b39a87a by Lin

更新(Entrance 组件):调整入口显示逻辑以支持活动标签页

- 修改 Entrance 组件以根据活动标签页显示入口项,替换 showOnHomeTab 为 showOnActivityTab。
- 更新 HomeFrame 和 ActivityTime 组件中 Entrance 的使用方式,确保正确传递活动标签页的显示状态。
- 优化客户信息页面,增加对汽车品牌信息的处理,确保数据同步和展示的准确性。
1 parent 704fcc7d
...@@ -16,14 +16,16 @@ ...@@ -16,14 +16,16 @@
:key="index" :key="index"
@click="handleClick(item)" @click="handleClick(item)"
> >
<view :class="['sprite-icon', `icon-${item.icon}`]"></view> <image v-if="item.iconImage" class="entrance-icon" :src="item.iconImage" mode="aspectFit" />
<view v-else :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view> <view class="entrance-name">{{ item.label }}</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view v-else :class="['entrance-list', `entrance-list-${type}`]"> <view v-else :class="['entrance-list', `entrance-list-${type}`]">
<view class="entrance-item" v-for="(item, index) in displayEntranceList" :key="index" @click="handleClick(item)"> <view class="entrance-item" v-for="(item, index) in displayEntranceList" :key="index" @click="handleClick(item)">
<view :class="['sprite-icon', `icon-${item.icon}`]"></view> <image v-if="item.iconImage" class="entrance-icon" :src="item.iconImage" mode="aspectFit" />
<view v-else :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view> <view class="entrance-name">{{ item.label }}</view>
</view> </view>
</view> </view>
...@@ -52,8 +54,8 @@ export default { ...@@ -52,8 +54,8 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
// 轻改首页 tab 是否为「首页」,控制服务中心入口展示 // 轻改限时产品活动 tab 激活时,控制服务中心入口展示
showOnHomeTab: { showOnActivityTab: {
type: Boolean, type: Boolean,
default: false default: false
} }
...@@ -75,7 +77,7 @@ export default { ...@@ -75,7 +77,7 @@ export default {
computed: { computed: {
displayEntranceList() { displayEntranceList() {
return this.entranceList.filter(e => { return this.entranceList.filter(e => {
if (e.showOnHomeTab) return this.showOnHomeTab if (e.showOnActivityTab) return this.showOnActivityTab
return true return true
}) })
} }
...@@ -210,13 +212,13 @@ export default { ...@@ -210,13 +212,13 @@ export default {
noInterception: true noInterception: true
}, },
{ {
icon: 'negotiation-detail', iconImage: require('@/assets/images/common/icon-menu-sever.png'),
name: 'ServiceCenter', name: 'ServiceCenter',
label: '服务中心', label: '服务中心',
page: '/pages/common/serviceDetail/index', page: '/pages/common/serviceDetail/index',
eventCode: 'app_service_center', eventCode: 'app_service_center',
sceneType: [1], sceneType: [1],
showOnHomeTab: true, showOnActivityTab: true,
pageDirect: true, pageDirect: true,
noInterception: true noInterception: true
}, },
...@@ -311,6 +313,11 @@ export default { ...@@ -311,6 +313,11 @@ export default {
margin-top: toRpx(8); margin-top: toRpx(8);
white-space: nowrap; white-space: nowrap;
} }
.entrance-icon {
width: calc(100vmin * (1173 / 768) * 0.04092071611253197);
height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
}
} }
.developing { .developing {
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<!-- 展业工具 --> <!-- 展业工具 -->
<view class="tools-box"> <view class="tools-box">
<Entrance scrollable @entranceClick="handleEntranceClick" /> <Entrance scrollable :show-on-activity-tab="showOnActivityTab" @entranceClick="handleEntranceClick" />
</view> </view>
</view> </view>
</template> </template>
...@@ -91,6 +91,10 @@ export default { ...@@ -91,6 +91,10 @@ export default {
activityProductList: { activityProductList: {
type: Array, type: Array,
default: () => [] default: () => []
},
showOnActivityTab: {
type: Boolean,
default: false
} }
}, },
data() { data() {
......
...@@ -72,10 +72,14 @@ ...@@ -72,10 +72,14 @@
</view> </view>
<view class="customer-item-row customer-item-row--meta"> <view class="customer-item-row customer-item-row--meta">
<text class="customer-item-meta">{{ formatPhone(item.customerPhone) }}</text> <text class="customer-item-meta">{{ formatPhone(item.customerPhone) }}</text>
<template v-if="hasDisplayDate(item.deliveryDate)">
<view class="customer-item-divider"></view> <view class="customer-item-divider"></view>
<text class="customer-item-meta">交付{{ formatDisplayDate(item.deliveryDate) }}</text> <text class="customer-item-meta">交付{{ formatDisplayDate(item.deliveryDate) }}</text>
</template>
<template v-if="hasDisplayDate(item.inviteDate)">
<view class="customer-item-divider"></view> <view class="customer-item-divider"></view>
<text class="customer-item-meta">到店{{ formatDisplayDate(item.inviteDate) }}</text> <text class="customer-item-meta">到店{{ formatDisplayDate(item.inviteDate) }}</text>
</template>
</view> </view>
<view class="customer-item-row customer-item-row--group"> <view class="customer-item-row customer-item-row--group">
<text class="customer-item-group">客户群:{{ item.qwGroupName || '客户群不存在' }}</text> <text class="customer-item-group">客户群:{{ item.qwGroupName || '客户群不存在' }}</text>
...@@ -135,6 +139,14 @@ export default { ...@@ -135,6 +139,14 @@ export default {
} }
return map[status] || '' return map[status] || ''
}, },
hasDisplayDate(val) {
if (val === null || val === undefined || val === '') return false
if (typeof val === 'number') {
const date = new Date(val)
return !Number.isNaN(date.getTime())
}
return !!String(val).trim()
},
formatDisplayDate(val) { formatDisplayDate(val) {
if (!val) return '-' if (!val) return '-'
if (typeof val === 'number') { if (typeof val === 'number') {
......
...@@ -90,10 +90,7 @@ ...@@ -90,10 +90,7 @@
<view class="tool-box-2 box-class scene1-box-shadow" style="height: 252px;"> <view class="tool-box-2 box-class scene1-box-shadow" style="height: 252px;">
<view class="common-title">展业工具</view> <view class="common-title">展业工具</view>
<view class="content-box"> <view class="content-box">
<Entrance <Entrance @entranceClick="entranceClick"></Entrance>
:show-on-home-tab="currentHomeContentTab && currentHomeContentTab.key === 'activity'"
@entranceClick="entranceClick"
/>
</view> </view>
</view> </view>
</view> </view>
...@@ -107,7 +104,11 @@ ...@@ -107,7 +104,11 @@
<!-- 限时产品活动 --> <!-- 限时产品活动 -->
<view v-show="currentHomeContentTab && currentHomeContentTab.key === 'activity'" class="right-content-box flex right-content-box-scene1"> <view v-show="currentHomeContentTab && currentHomeContentTab.key === 'activity'" class="right-content-box flex right-content-box-scene1">
<view class="tab-container"> <view class="tab-container">
<ActivityTime :activityProductList="activityProductList" @entranceClick="entranceClick" /> <ActivityTime
:activityProductList="activityProductList"
:show-on-activity-tab="currentHomeContentTab && currentHomeContentTab.key === 'activity'"
@entranceClick="entranceClick"
/>
<view class="line"></view> <view class="line"></view>
<CustomerSide :customerProfile="customerProfileList" /> <CustomerSide :customerProfile="customerProfileList" />
</view> </view>
...@@ -729,12 +730,7 @@ export default { ...@@ -729,12 +730,7 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据) * 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/ */
async getStrategyStatus() { async getStrategyStatus() {
const res = await uni.$api.activityApi.getActivityStatusAPI() const res = await uni.$api.activityApi.getActivityStatusAPI({merchantId: uni.$storage.get('userInfo').shopMerchantId})
console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
// const res = {
// marketingActivityHasData: true,
// customerListHasData: true
// }
console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res) console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res)
if (!res) return if (!res) return
......
<template> <template>
<view class="activity-detail-page"> <view class="activity-detail-page">
<view class="nav-bar"> <view class="back-btn" :style="backButtonStyle" @click.stop="back">
<view class="back" @click="back"> <image
<uni-icons type="left" :size="20" color="#000"></uni-icons> class="back-icon"
</view> :src="require('@/assets/images/common/icon-arrow-back.png')"
<view class="title">商品详情</view> mode="aspectFit"
/>
</view> </view>
<scroll-view class="detail-scroll" scroll-y>
<view class="detail-content">
<view class="goods-img-wrap">
<image <image
class="goods-img" class="goods-img"
:src="displayMainImage" :src="displayMainImage"
mode="aspectFill" mode="aspectFill"
/> />
<view
<image
v-if="goodsInfo.isMainPush == 1" v-if="goodsInfo.isMainPush == 1"
class="prelearn-btn" class="prelearn-entrance"
:style="prelearnButtonStyle"
:src="require('@/assets/images/common/icon-prestudy-entrance.png')"
mode="aspectFit"
@click.stop="handlePrelearnClick" @click.stop="handlePrelearnClick"
> />
预学习
</view>
</view>
</view>
</scroll-view>
</view> </view>
</template> </template>
...@@ -54,6 +51,31 @@ export default { ...@@ -54,6 +51,31 @@ export default {
computed: { computed: {
displayMainImage() { displayMainImage() {
return this.goodsInfo.mainImageUrl || this.goodsInfo.thumbImageUrl || GOODS_COVER return this.goodsInfo.mainImageUrl || this.goodsInfo.thumbImageUrl || GOODS_COVER
},
backButtonStyle() {
const { top, left } = this.overlayLayoutPx
return {
top: `${top}px`,
left: `${left}px`
}
},
prelearnButtonStyle() {
const { top, right } = this.overlayLayoutPx
return {
top: `${top}px`,
right: `${right}px`
}
},
overlayLayoutPx() {
const sys = uni.getSystemInfoSync()
const r = sys.windowWidth / 750
const safeTop = sys.safeAreaInsets?.top ?? sys.statusBarHeight ?? 0
const edge = Math.ceil(18 * r)
return {
top: safeTop + Math.ceil(16 * r),
left: edge,
right: edge
}
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -122,78 +144,36 @@ export default { ...@@ -122,78 +144,36 @@ export default {
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp'); overflow: hidden;
background-size: 100%; background-color: #000;
box-sizing: border-box;
padding-top: toRpx(160);
} }
.nav-bar { .goods-img {
position: fixed;
width: 100%; width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%; height: 100%;
aspect-ratio: 1/1; display: block;
}
.back-btn {
position: fixed;
z-index: 10;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
pointer-events: auto; width: 24px;
} height: 24px;
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
} }
.detail-scroll { .back-icon {
height: calc(100vh - #{toRpx(160)}); width: 24px;
height: 24px;
} }
.detail-content { .prelearn-entrance {
margin: 0 toRpx(64) toRpx(80); position: fixed;
padding-bottom: toRpx(40); z-index: 10;
} width: 152px;
height: 92px;
.goods-img-wrap {
position: relative;
width: 100%;
height: 288px;
overflow: hidden;
border-radius: 8px;
}
.goods-img {
width: 100%;
height: 288px;
display: block;
border-radius: 8px;
}
.prelearn-btn {
position: absolute;
top: 0;
right: 0;
z-index: 1;
padding: toRpx(10) toRpx(16);
border-radius: 0 8px 0 8px;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
font-size: 14px;
line-height: 14px;
font-weight: 500;
color: #ffffff;
white-space: nowrap;
&:active { &:active {
opacity: 0.85; opacity: 0.85;
......
...@@ -284,6 +284,8 @@ export default { ...@@ -284,6 +284,8 @@ export default {
customerName: '', customerName: '',
customerPhone: '', customerPhone: '',
carTypeName: '', carTypeName: '',
carChildsBrandId: '',
carChildsBrandName: '',
receptionScene: '', receptionScene: '',
arrivalDate: '', arrivalDate: '',
receptionSceneName: '', receptionSceneName: '',
...@@ -319,6 +321,8 @@ export default { ...@@ -319,6 +321,8 @@ export default {
Object.assign(this.customerInfo, { Object.assign(this.customerInfo, {
carTypeName: item.name, carTypeName: item.name,
carTypeId: item.id, carTypeId: item.id,
carChildsBrandName: item.carChildsBrandName,
carChildsBrandId: item.carChildsBrandId,
carBrand: item.carChildsBrandName, carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId, carBrandId: item.carChildsBrandId,
oneCarBrand: item.carBrand, oneCarBrand: item.carBrand,
...@@ -394,6 +398,8 @@ export default { ...@@ -394,6 +398,8 @@ export default {
carTypeId: customerInfo.carTypeId, carTypeId: customerInfo.carTypeId,
carBrand: customerInfo.carBrand, carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId, carBrandId: customerInfo.carBrandId,
carChildsBrandId: customerInfo.carChildsBrandId,
carChildsBrandName: customerInfo.carChildsBrandName,
oneCarBrand: customerInfo.oneCarBrand, oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId, oneCarBrandId: customerInfo.oneCarBrandId,
employeeName: uni.$storage.get('userInfo').name, employeeName: uni.$storage.get('userInfo').name,
...@@ -417,13 +423,14 @@ export default { ...@@ -417,13 +423,14 @@ export default {
customerPhone:params.customerPhone, customerPhone:params.customerPhone,
carBrand:params.carBrand, carBrand:params.carBrand,
carBrandId:params.carBrandId, carBrandId:params.carBrandId,
carChildsBrandId:'', carChildsBrandId: params.carChildsBrandId,
carChildsBrandName:'', carChildsBrandName: params.carChildsBrandName,
standNo:params.standNo,
carSeriesId:params.carTypeId, carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName, carSeriesName:params.carTypeName,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期 deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期 inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期
createdDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //建档日期 createdDate: params.filingDate, //建档日期
} }
] ]
} }
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<template v-else-if="i.type == 'input'"> <template v-else-if="i.type == 'input'">
<view class="input-box flex"> <view class="input-box flex">
<input <input
:type="i.inputType || 'text'"+ :type="i.inputType || 'text'"
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
class="input input--count" class="input input--count"
...@@ -311,8 +311,8 @@ ...@@ -311,8 +311,8 @@
}, },
{ {
label: '备注', label: '备注',
valueKey: 'groupRemark', valueKey: 'remark',
key: 'groupRemark', key: 'remark',
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
maxlength: 200, maxlength: 200,
...@@ -415,7 +415,8 @@ ...@@ -415,7 +415,8 @@
} }
console.log('getCustomerGroupInfoAPI**customerForm*', this.customerForm) console.log('getCustomerGroupInfoAPI**customerForm*', this.customerForm)
}, },
async submitCustomerProfileAPI() { async submitCustomerProfileAPI(options = {}) {
const { fromReception = false } = options
try { try {
this.customerForm.forEach(e => { this.customerForm.forEach(e => {
e.error = false e.error = false
...@@ -430,7 +431,7 @@ ...@@ -430,7 +431,7 @@
if (index !== -1) { if (index !== -1) {
this.customerForm[index].error = true this.customerForm[index].error = true
} }
return return false
} }
const requestParams = { const requestParams = {
id: this.customerInfo.id, id: this.customerInfo.id,
...@@ -466,6 +467,10 @@ ...@@ -466,6 +467,10 @@
if (res) { if (res) {
this.syncDisplayInfo() this.syncDisplayInfo()
uni.$emit('refreshCustomerProfileGroupInfo') uni.$emit('refreshCustomerProfileGroupInfo')
if (fromReception) {
uni.hideLoading()
return true
}
if (res == '1') { if (res == '1') {
this.$refs.successRef.open() this.$refs.successRef.open()
setTimeout(() => { setTimeout(() => {
...@@ -486,8 +491,10 @@ ...@@ -486,8 +491,10 @@
}) })
uni.hideLoading() uni.hideLoading()
} }
return true
} else { } else {
uni.hideLoading() uni.hideLoading()
return false
} }
}, },
async getCustomerGroupInfo(showToast = false) { async getCustomerGroupInfo(showToast = false) {
...@@ -609,8 +616,9 @@ ...@@ -609,8 +616,9 @@
if (res.deliveryDate) res.deliveryDate = dayjs(res.deliveryDate).format("YYYY-MM-DD") if (res.deliveryDate) res.deliveryDate = dayjs(res.deliveryDate).format("YYYY-MM-DD")
if (res.createdDate) res.createdDate = dayjs(res.createdDate).format("YYYY-MM-DD") if (res.createdDate) res.createdDate = dayjs(res.createdDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD") if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
this.customerInfo = res // 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 groupMemberName)
this.syncDisplayInfo(res) Object.assign(this.customerInfo, res)
this.syncDisplayInfo(this.customerInfo)
console.log('findVisitsInfo**customerInfo*', this.customerInfo) console.log('findVisitsInfo**customerInfo*', this.customerInfo)
await this.getCustomerGroupInfo() await this.getCustomerGroupInfo()
}, },
...@@ -621,10 +629,12 @@ ...@@ -621,10 +629,12 @@
animationDuration: 100 animationDuration: 100
}) })
}, },
startReception () { async startReception () {
const { sceneType, customerInfo } = this const { sceneType, customerInfo } = this
if (sceneType == 7) return // 二手车无接待功能 if (sceneType == 7) return // 二手车无接待功能
if (customerInfo.customerStatus == 2) return if (customerInfo.customerStatus == 2) return
const submitted = await this.submitCustomerProfileAPI({ fromReception: true })
if (!submitted) return
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
animationType: 'pop-out', animationType: 'pop-out',
...@@ -653,10 +663,12 @@ ...@@ -653,10 +663,12 @@
this.customerInfo.employeeName = item.staffName this.customerInfo.employeeName = item.staffName
this.customerInfo.userId = item.uuid this.customerInfo.userId = item.uuid
} else if (popkey == 'groupMemberVisible') { } else if (popkey == 'groupMemberVisible') {
this.customerInfo.groupMemberName = item.contact_name const groupMemberName = item.contact_name || item.name || ''
this.customerInfo.groupMemberId = item.contact_id const groupMemberId = item.contact_id || item.id || ''
this.customerInfo.wxId = item.wxId || item.wx_id || '' this.$set(this.customerInfo, 'groupMemberName', groupMemberName)
this.customerInfo.wxName = item.wxName || item.wx_name || '' this.$set(this.customerInfo, 'groupMemberId', groupMemberId)
this.$set(this.customerInfo, 'wxId', item.wxId || item.wx_id || '')
this.$set(this.customerInfo, 'wxName', item.wxName || item.wx_name || '')
} else { } else {
this.customerInfo.receptionSceneName = item.receptionSceneName this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id this.customerInfo.receptionScene = item.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!