Commit db94a6fa by 李伟康

Merge branch 'saas+v5.8.3' of http://192.168.3.233:8090/glsx/gl_tape into saas+v5.8.3

2 parents 7cf02fa6 da70e4ca
...@@ -171,7 +171,18 @@ module.exports = { ...@@ -171,7 +171,18 @@ module.exports = {
* 轻改业务改版 * 轻改业务改版
* 2、客户建档提交 * 2、客户建档提交
*/ */
csubmitCustomerProfileAPI(data) { submitPreliminaryOrderAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.preliminaryOrder.batch',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 3、客户建档提交
*/
submitCustomerProfileAPI(data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.order.submitCustomerProfile', method: 'dj.api.smartcarlife.order.submitCustomerProfile',
projectName: 'pad', projectName: 'pad',
......
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
</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-list-inner">
<view
v-for="group in customerProfile"
:key="group.date"
class="customer-day-group"
>
<view class="customer-count"> <view class="customer-count">
<view class="customer-count-left"> <view class="customer-count-left">
<image <image
...@@ -35,107 +40,116 @@ ...@@ -35,107 +40,116 @@
:src="require('@/assets/images/common/icon-customer-count.png')" :src="require('@/assets/images/common/icon-customer-count.png')"
mode="aspectFit" mode="aspectFit"
/> />
<text class="customer-count-label">今日({{ todayDate }})已建档</text> <text class="customer-count-label">{{ formatDateLabel(group.date) }}已建档</text>
</view> </view>
<view class="customer-count-right"> <view class="customer-count-right">
<text class="customer-count-num">{{ todayCustomerCount }}</text> <text class="customer-count-num">{{ group.number || 0 }}</text>
<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 group.customerProfileInfoDTOS || []"
: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">{{ getCustomerSurname(item.customerName) }}</text>
</view> </view>
<view class="customer-item-body" @click="handleGoCustomerDetail(item)"> <view class="customer-item-body" @click="handleGoCustomerDetail(item)">
<view class="customer-item-row customer-item-row--name"> <view class="customer-item-row customer-item-row--name">
<text class="customer-item-name">{{ item.name }}</text> <view class="customer-item-name-left">
<view v-if="item.carModel" class="customer-item-car-tag"> <text class="customer-item-name">{{ item.customerName || '-' }}</text>
<text class="customer-item-car-text">{{ item.carModel }}</text> <view v-if="item.carSeriesName" class="customer-item-car-tag">
<text class="customer-item-car-text">{{ item.carSeriesName }}</text>
</view>
</view>
<view
v-if="getCustomerStatusLabel(item.customerStatus)"
:class="['customer-item-status', getCustomerStatusClass(item.customerStatus)]"
>
<text class="customer-item-status-text">{{ getCustomerStatusLabel(item.customerStatus) }}</text>
</view> </view>
</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">{{ item.phone }}</text> <text class="customer-item-meta">{{ item.customerPhone || '-' }}</text>
<view class="customer-item-divider"></view> <view class="customer-item-divider"></view>
<text class="customer-item-meta">交付{{ item.deliveryDate }}</text> <text class="customer-item-meta">交付{{ formatDisplayDate(item.deliveryDate) }}</text>
<view class="customer-item-divider"></view> <view class="customer-item-divider"></view>
<text class="customer-item-meta">到店{{ item.visitDate }}</text> <text class="customer-item-meta">到店{{ formatDisplayDate(item.inviteDate) }}</text>
</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.groupName }}</text> <text class="customer-item-group">客户群:{{ item.qwGroupName || '-' }}</text>
</view>
</view>
<view class="customer-item-side">
<view
v-if="item.status"
:class="['customer-item-status', `customer-item-status--${item.statusType || 'warning'}`]"
>
<text class="customer-item-status-text">{{ item.status }}</text>
</view>
<view class="customer-item-arrow"> <view class="customer-item-arrow">
<view class="sprite-icon icon-arrow-right"></view> <view class="sprite-icon icon-arrow-right"></view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
const MOCK_CUSTOMER_LIST = [
{
id: 1,
surname: '张',
name: '张**',
carModel: '奥迪 A6L',
phone: '136****6789',
deliveryDate: '06-20',
visitDate: '05-12',
groupName: '张先生2827-客户大定精品服务群吉利古拉',
status: '待跟进',
statusType: 'warning'
},
{
id: 2,
surname: '李',
name: '李**',
carModel: '宝马 5系',
phone: '138****1234',
deliveryDate: '06-18',
visitDate: '05-10',
groupName: '李先生1028-客户精品服务群',
status: '待跟进',
statusType: 'warning'
}
]
export default { export default {
name: 'CustomerSide', name: 'CustomerSide',
props: { props: {
type: { type: {
type: String, type: String,
default: 'out' default: 'out'
},
customerProfile: {
type: Array,
default: () => []
} }
}, },
data() { methods: {
return { getCustomerSurname(name) {
customerList: MOCK_CUSTOMER_LIST, if (!name) return ''
todayCustomerCount: 8 return String(name).charAt(0)
},
getCustomerStatusLabel(status) {
const map = {
1: '待跟进',
2: '已升级',
3: '战败',
4: '已退款'
}
return map[status] || ''
},
getCustomerStatusClass(status) {
const map = {
1: 'customer-item-status--warning',
2: 'customer-item-status--success',
3: 'customer-item-status--failed',
4: 'customer-item-status--refund'
}
return map[status] || ''
},
formatDisplayDate(val) {
if (!val) return '-'
if (typeof val === 'number') {
const date = new Date(val)
if (Number.isNaN(date.getTime())) return '-'
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${month}-${day}`
} }
const match = String(val).match(/(\d{4})-(\d{2})-(\d{2})/)
if (match) return `${match[2]}-${match[3]}`
return val
}, },
computed: { formatDateLabel(dateStr) {
todayDate() { const display = this.formatDisplayDate(dateStr)
if (!dateStr) return display
const now = new Date() const now = new Date()
const month = String(now.getMonth() + 1).padStart(2, '0') const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
const day = String(now.getDate()).padStart(2, '0') if (dateStr === todayStr) {
return `${month}-${day}` return `今日(${display})`
} }
return display
}, },
methods: {
handleGoCustomerFiles() { handleGoCustomerFiles() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/customerPages/addFiles', url: '/pages/common/customerPages/addFiles',
...@@ -241,6 +255,14 @@ export default { ...@@ -241,6 +255,14 @@ export default {
box-sizing: border-box; box-sizing: border-box;
} }
.customer-day-group {
margin-bottom: 8px;
&:last-child {
margin-bottom: 0;
}
}
.customer-count { .customer-count {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -337,7 +359,8 @@ export default { ...@@ -337,7 +359,8 @@ export default {
min-width: 0; min-width: 0;
&--name { &--name {
gap: 6px; justify-content: space-between;
gap: 8px;
} }
&--meta { &--meta {
...@@ -346,8 +369,18 @@ export default { ...@@ -346,8 +369,18 @@ export default {
} }
&--group { &--group {
align-items: flex-start; align-items: center;
justify-content: space-between;
gap: 8px;
}
} }
.customer-item-name-left {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
flex: 1;
} }
.customer-item-name { .customer-item-name {
...@@ -397,19 +430,10 @@ export default { ...@@ -397,19 +430,10 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
.customer-item-side {
align-self: stretch;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: space-between;
flex-shrink: 0;
}
.customer-item-status { .customer-item-status {
padding: 0 8px; padding: 0 8px;
border-radius: 4px; border-radius: 4px;
background: #FDECE9; flex-shrink: 0;
&--warning { &--warning {
background: #FDECE9; background: #FDECE9;
...@@ -418,6 +442,30 @@ export default { ...@@ -418,6 +442,30 @@ export default {
color: #F24724; color: #F24724;
} }
} }
&--success {
background: #EAF9F1;
.customer-item-status-text {
color: #35C376;
}
}
&--failed {
background: #F5F7FA;
.customer-item-status-text {
color: #999EA8;
}
}
&--refund {
background: #FFF5E6;
.customer-item-status-text {
color: #F7A431;
}
}
} }
.customer-item-status-text { .customer-item-status-text {
...@@ -427,10 +475,11 @@ export default { ...@@ -427,10 +475,11 @@ export default {
.customer-item-arrow { .customer-item-arrow {
width: 16px; width: 16px;
height: 16px; height: 18px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-shrink: 0;
.icon-arrow-right { .icon-arrow-right {
width: 16px !important; width: 16px !important;
......
...@@ -63,7 +63,8 @@ ...@@ -63,7 +63,8 @@
:styleV2="true" :styleV2="true"
/> />
<template v-if="sceneType != 7"> <template v-if="sceneType != 7">
<view class="reception-btn" @click="start"> <!-- <view class="reception-btn" @click="start"> -->
<view class="reception-btn" @click="getCustomerProfileGroupInfo">
<image class="start-icon" :src="require('@/assets/images/common/icon-reception-start.png')" mode="aspectFit"></image> <image class="start-icon" :src="require('@/assets/images/common/icon-reception-start.png')" mode="aspectFit"></image>
<view class="start-text">开始接待</view> <view class="start-text">开始接待</view>
</view> </view>
...@@ -106,7 +107,7 @@ ...@@ -106,7 +107,7 @@
<view class="tab-container"> <view class="tab-container">
<ActivityTime :activityProductList="activityProductList" @entranceClick="entranceClick" /> <ActivityTime :activityProductList="activityProductList" @entranceClick="entranceClick" />
<view class="line"></view> <view class="line"></view>
<CustomerSide /> <CustomerSide :customerProfile="customerProfileList" />
</view> </view>
</view> </view>
<!-- 挖掘潜客机会 --> <!-- 挖掘潜客机会 -->
...@@ -192,7 +193,8 @@ ...@@ -192,7 +193,8 @@
<!-- 预学习弹框 --> <!-- 预学习弹框 -->
<StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="968" <StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="968"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248"> :topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248">
<PreStudyPopup :prelearnData="prelearnData" :confirmText="preStudyPopInfo.confirmText" @cancel="handlePreStudyCancel" <PreStudyPopup :prelearnData="prelearnData" :confirmText="preStudyConfirmText"
:confirmDisabled="preStudyConfirmDisabled" @cancel="handlePreStudyCancel"
@confirm="deductSkipCount" @start-study="handlePreStudyStart" /> @confirm="deductSkipCount" @start-study="handlePreStudyStart" />
</StudyPopup> </StudyPopup>
...@@ -362,9 +364,6 @@ export default { ...@@ -362,9 +364,6 @@ export default {
showError: false, showError: false,
confirmText: '确认已提交' confirmText: '确认已提交'
}, },
preStudyPopInfo: {
confirmText: '',
},
showStudyPermissionPopup: false, showStudyPermissionPopup: false,
showPreStudyPopup: false, showPreStudyPopup: false,
courseInfo: { courseInfo: {
...@@ -383,7 +382,8 @@ export default { ...@@ -383,7 +382,8 @@ export default {
left: '-1000px' left: '-1000px'
}), }),
activityProductList: [], activityProductList: [],
prelearnData: {} prelearnData: {},
customerProfileList: []
} }
}, },
beforeDestroy() { beforeDestroy() {
...@@ -463,6 +463,16 @@ export default { ...@@ -463,6 +463,16 @@ export default {
}, },
activityWindowPopStatus() { activityWindowPopStatus() {
return this.$store.getters.activityWindowPopStatus return this.$store.getters.activityWindowPopStatus
},
preStudyConfirmText() {
const count = this.prelearnData?.remainingSkipCount
if (count == null) return '跳过'
if (count <= 0) return '跳过次数已用尽,必须学习'
return `跳过(剩余${count}次)`
},
preStudyConfirmDisabled() {
const count = this.prelearnData?.remainingSkipCount
return count != null && count <= 0
} }
}, },
watch: { watch: {
...@@ -709,12 +719,13 @@ export default { ...@@ -709,12 +719,13 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据) * 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/ */
async getStrategyStatus() { async getStrategyStatus() {
const res = await uni.$api.activityApi.getActivityStatusAPI() // const res = await uni.$api.activityApi.getActivityStatusAPI()
// console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res) // console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
// const res = { const res = {
// marketingActivityHasData: true, marketingActivityHasData: true,
// customerListHasData: true customerListHasData: true
// } }
console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res)
if (!res) return if (!res) return
this.marketingActivityHasData = !!res.marketingActivityHasData this.marketingActivityHasData = !!res.marketingActivityHasData
...@@ -830,46 +841,1168 @@ export default { ...@@ -830,46 +841,1168 @@ export default {
* 查询客户建档分页查询-月按天分组 * 查询客户建档分页查询-月按天分组
*/ */
async getCustomerProfileGroupInfo() { async getCustomerProfileGroupInfo() {
// const res = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI({}) const data = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI({})
// console.log('查询客户建档分页查询-月按天分组:', res) console.log('getCustomerProfileGroupInfoAPI-月按天分组:', data)
const res = [
{
"date": "2026-06-25",
"customerProfileInfoDTOS": [
{
"id": 33787,
"customerName": "张三222",
"customerPhone": "13121213343",
"customerStatus": 1,
"standNo": null,
"inviteDate": null,
"carBrandId": null,
"carBrand": null,
"carChildsBrandId": null,
"carChildsBrandName": null,
"carSeriesId": null,
"carSeriesName": null,
"deliveryDate": null,
"createdDate": "2026-06-25 15:14:04",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "8a014b824abb42bd84bb5145043eabc2",
"employeeName": "王璐琦",
"advanceUserId": "0ad2caf3e55e44baa32b4ef3c5edd039",
"advanceUserName": "王lq",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40016,
"customerId": 33787,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
}
],
"number": 1
},
{
"date": "2026-06-24",
"customerProfileInfoDTOS": [
{
"id": 33785,
"customerName": "鹿窝圣诞节发货斯卡蒂",
"customerPhone": "16987984646",
"customerStatus": 1,
"standNo": "22222222222222222",
"inviteDate": "2026-06-24 14:30:00",
"carBrandId": 2978,
"carBrand": "鸿蒙智行",
"carChildsBrandId": 3454,
"carChildsBrandName": "AITO 问界",
"carSeriesId": 1150155,
"carSeriesName": "问界M9",
"deliveryDate": null,
"createdDate": "2026-06-24 14:47:13",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "8a014b824abb42bd84bb5145043eabc2",
"employeeName": "王璐琦",
"advanceUserId": "0ad2caf3e55e44baa32b4ef3c5edd039",
"advanceUserName": "王lq",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": "",
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40011,
"customerId": 33785,
"inviteDate": 1782282600000,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33784,
"customerName": "卢奇测试客户档案爱心",
"customerPhone": "15679849874",
"customerStatus": 1,
"standNo": "11111111111111111",
"inviteDate": "2026-06-24 16:00:00",
"carBrandId": 2978,
"carBrand": "鸿蒙智行",
"carChildsBrandId": 3454,
"carChildsBrandName": "AITO 问界",
"carSeriesId": 1149146,
"carSeriesName": "问界M5",
"deliveryDate": null,
"createdDate": "2026-06-24 14:42:38",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "8a014b824abb42bd84bb5145043eabc2",
"employeeName": "王璐琦",
"advanceUserId": "0ad2caf3e55e44baa32b4ef3c5edd039",
"advanceUserName": "王lq",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": "",
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40010,
"customerId": 33784,
"inviteDate": 1782288000000,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33783,
"customerName": "测试开发环境跳转",
"customerPhone": "18366122711",
"customerStatus": 2,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-24 14:20:28",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40009,
"customerId": 33783,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33782,
"customerName": "0624正经23",
"customerPhone": "18366122753",
"customerStatus": 1,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-24 13:57:13",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40008,
"customerId": 33782,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33781,
"customerName": "0624正经23",
"customerPhone": "18368122753",
"customerStatus": 1,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-24 11:37:40",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40006,
"customerId": 33781,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33780,
"customerName": "0624正经23",
"customerPhone": "18368166753",
"customerStatus": 1,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-24 10:54:54",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40005,
"customerId": 33780,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33779,
"customerName": "0624正经23",
"customerPhone": "18360766753",
"customerStatus": 1,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-24 10:39:49",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40004,
"customerId": 33779,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
}
],
"number": 7
},
{
"date": "2026-06-23",
"customerProfileInfoDTOS": [
{
"id": 33778,
"customerName": "0623正经23",
"customerPhone": "18350766753",
"customerStatus": 1,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-23 15:39:00",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": "C",
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 40003,
"customerId": 33778,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33777,
"customerName": "0623正经下单",
"customerPhone": "18350768592",
"customerStatus": 1,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-23 15:04:47",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "成威2号",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 39994,
"customerId": 33777,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
}
],
"number": 2
},
{
"date": "2026-06-22",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-21",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-20",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-19",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-18",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-17",
"customerProfileInfoDTOS": [
{
"id": 33773,
"customerName": "0427正经下单",
"customerPhone": "1850768566",
"customerStatus": 2,
"standNo": "2934783232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-17 16:41:56",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "584fdb460afa4dad835cbe8d73cfa923",
"advanceUserName": "陈希",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": "A",
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 39987,
"customerId": 33773,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33772,
"customerName": "0427正经下单",
"customerPhone": "18750768566",
"customerStatus": 1,
"standNo": "2934780232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-17 16:38:32",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "584fdb460afa4dad835cbe8d73cfa923",
"advanceUserName": "陈希",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 39986,
"customerId": 33772,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
},
{
"id": 33771,
"customerName": "0427正经下单",
"customerPhone": "18750768583",
"customerStatus": 2,
"standNo": "2934780232",
"inviteDate": null,
"carBrandId": 2129,
"carBrand": "阿斯顿・马丁",
"carChildsBrandId": 2130,
"carChildsBrandName": "阿斯顿・马丁",
"carSeriesId": 1145184,
"carSeriesName": "Rapide",
"deliveryDate": null,
"createdDate": "2026-06-17 10:23:00",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "70ef874b8de046209a49541efb7c4bfe",
"employeeName": "MMI",
"advanceUserId": "584fdb460afa4dad835cbe8d73cfa923",
"advanceUserName": "陈希",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null,
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 39985,
"customerId": 33771,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
}
],
"number": 3
},
{
"date": "2026-06-16",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-15",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-14",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-13",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-12",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-11",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-10",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-09",
"customerProfileInfoDTOS": [
{
"id": 33770,
"customerName": "fjkd",
"customerPhone": "18744455479",
"customerStatus": 2,
"standNo": "99999999999999999",
"inviteDate": null,
"carBrandId": null,
"carBrand": null,
"carChildsBrandId": null,
"carChildsBrandName": null,
"carSeriesId": null,
"carSeriesName": null,
"deliveryDate": null,
"createdDate": "2026-06-09 09:42:00",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "ced7b108984344b7801d4a80ad23492b",
"employeeName": "谢海旭",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "发瘟鸡",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": "",
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 39982,
"customerId": 33770,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
}
],
"number": 1
},
{
"date": "2026-06-08",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-07",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-06",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-05",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-04",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-03",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-06-02",
"customerProfileInfoDTOS": [
{
"id": 33769,
"customerName": "施工单001",
"customerPhone": "15855254477",
"customerStatus": 2,
"standNo": "55555555555555555",
"inviteDate": null,
"carBrandId": null,
"carBrand": null,
"carChildsBrandId": null,
"carChildsBrandName": null,
"carSeriesId": null,
"carSeriesName": null,
"deliveryDate": null,
"createdDate": "2026-06-02 16:54:49",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "ced7b108984344b7801d4a80ad23492b",
"employeeName": "谢海旭",
"advanceUserId": "e77729f1a544442a8f43e587e1f6d20a",
"advanceUserName": "发瘟鸡",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": "",
"updatedBy": null,
"customerClass": null,
"goodsSubOrderDTOS": null,
"inviteRecord": [
{
"id": 39980,
"customerId": 33769,
"inviteDate": null,
"inviteType": null,
"userId": null,
"userName": null,
"status": null,
"toShopStatus": null,
"callNum": null,
"lastCallDate": null,
"lastBindPhone": null,
"lastBindPhoneExpireDate": null,
"lastBindPhoneDate": null,
"customerCouponId": null,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedUserName": null,
"updatedDate": null,
"deletedFlag": null,
"trafficEffectiveness": null,
"trafficEffectivenessTime": null
}
],
"startTime": null,
"endTime": null,
"statusList": null,
"isAll": null,
"pageNum": null,
"pageSize": null
}
],
"number": 1
},
{
"date": "2026-06-01",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-05-31",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-05-30",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-05-29",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-05-28",
"customerProfileInfoDTOS": [],
"number": 0
},
{
"date": "2026-05-27",
"customerProfileInfoDTOS": [],
"number": 0
}
]
if (res) {
this.customerProfileList = res
}
}, },
/** /**
* 查询预学习首页弹框信息 * @function 预学习:
* @desc 查询预学习首页弹框信息
*/ */
async getPrelearnHome() { async getPrelearnHome() {
try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI() // const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
const res = { const res = {
"activityId": 22, "activityId": 31,
"activityName": "618年中促活动A", "activityName": "618年中促活动A",
"packages": [ "packages": [
{ {
"activityProductId": "15", "activityProductId": "16",
"packageName": "tttttttt", "packageName": "tttttttt",
"includes": [], "includes": ['原厂定制车衣','玻璃贴膜'],
"learnStatus": "NOT_STUDY", "learnStatus": "NOT_STUDY",
"scriptReady": true "scriptReady": true
} }
], ],
"remainingSkipCount": 3, "remainingSkipCount": 0,
"shouldPopup": true, "shouldPopup": true,
"muteReason": null, "muteReason": null,
"remainingActivityCount": null "remainingActivityCount": null
} }
console.log('查询预学习首页弹框信息:', res) console.log('getPrelernHomePopupAPI res***', res);
if (res) { if (!res) return
this.prelearnData = res this.prelearnData = res
this.showPreStudyPopup = res.shouldPopup this.showPreStudyPopup = res.shouldPopup
this.preStudyPopInfo.confirmText = `跳过(剩余${res.remainingSkipCount}次)` } catch (e) {
// uni.$logger?.local?.info('预学习首页弹框查询失败', e)
} }
}, },
/**
* @function 预学习:
* @desc 扣减跳过次数
*/
async deductSkipCount() { async deductSkipCount() {
let requestParams = { const { activityId, remainingSkipCount } = this.prelearnData || {}
activityId:this.prelearnData.getActivityMessagePopUpWindow if (!activityId) return
if (remainingSkipCount != null && remainingSkipCount <= 0) {
uni.showToast({ title: '跳过次数已用完', icon: 'none' })
return
} }
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res); try {
if (res) { const res = await uni.$api.commonApi.deductSkipCountAPI({ activityId })
if (!res) return
this.showPreStudyPopup = false this.showPreStudyPopup = false
if (res.remainingSkipCount != null) {
this.prelearnData = { ...this.prelearnData, remainingSkipCount: res.remainingSkipCount }
}
} catch (e) {
// uni.$logger?.local?.info('预学习扣减跳过次数失败', e)
} }
}, },
handleFooter(val) { handleFooter(val) {
......
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
<view class="cancel-button" @click="handleCancel"> <view class="cancel-button" @click="handleCancel">
取消 取消
</view> </view>
<view class="confirm-button" @click="deductSkipCount"> <view
class="confirm-button"
:class="{ 'confirm-button--disabled': confirmDisabled }"
@click="deductSkipCount"
>
{{ confirmText }} {{ confirmText }}
</view> </view>
</view> </view>
...@@ -32,14 +36,21 @@ export default { ...@@ -32,14 +36,21 @@ export default {
default: () => ({skipCount: 2}) default: () => ({skipCount: 2})
} }
}, },
computed: {
confirmDisabled() {
return this.prelearnContext?.skipCount === 0
}
},
methods: { methods: {
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
}, },
async deductSkipCount() { async deductSkipCount() {
if (this.confirmDisabled) return
let requestParams = { let requestParams = {
activityId:this.prelearnContext.getActivityMessagePopUpWindow activityId:this.prelearnContext.activityId
} }
console.log('deductSkipCountAPI requestParams***', requestParams);
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams) const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res); console.log('deductSkipCountAPI***', res);
if (res) { if (res) {
...@@ -128,6 +139,17 @@ export default { ...@@ -128,6 +139,17 @@ export default {
&:active { &:active {
opacity: 0.8; opacity: 0.8;
} }
&--disabled {
border-color: #d9d9d9;
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
color: #ffffff;
pointer-events: none;
&:active {
opacity: 1;
}
}
} }
.text-red { .text-red {
color: #F24724; color: #F24724;
......
...@@ -25,7 +25,11 @@ ...@@ -25,7 +25,11 @@
</view> </view>
<!-- 按钮组(始终显示) --> <!-- 按钮组(始终显示) -->
<view class="button-group"> <view class="button-group">
<view class="confirm-button" @click="handleConfirm"> <view
class="confirm-button"
:class="{ 'confirm-button--disabled': confirmDisabled }"
@click="handleConfirm"
>
{{ confirmText }} {{ confirmText }}
</view> </view>
</view> </view>
...@@ -40,6 +44,10 @@ export default { ...@@ -40,6 +44,10 @@ export default {
type: String, type: String,
default: '跳过' default: '跳过'
}, },
confirmDisabled: {
type: Boolean,
default: false
},
prelearnData: { prelearnData: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
...@@ -55,21 +63,57 @@ export default { ...@@ -55,21 +63,57 @@ export default {
if (!includes?.length) return '' if (!includes?.length) return ''
return `包含:${includes.join(' + ')}` return `包含:${includes.join(' + ')}`
}, },
handleStartStudy(item, index) { async handleStartStudy(item, index) {
if (item.learnStatus !== 'NOT_STUDY') return if (item.learnStatus !== 'NOT_STUDY') return
this.$emit('start-study', item, index)
const prelearnDataStr = encodeURIComponent(JSON.stringify(this.prelearnData)) try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
const res = {
"activityId": 31,
"activityName": "618年中促活动A",
"packages": [
{
"activityProductId": "16",
"packageName": "tttttttt",
"includes": ['原厂定制车衣','玻璃贴膜'],
"learnStatus": "NOT_STUDY",
"scriptReady": true
}
],
"remainingSkipCount": 0,
"shouldPopup": true,
"muteReason": null,
"remainingActivityCount": null
}
console.log('getPrelernHomePopupAPI res***', res)
if (!res) return
const freshItem = res.packages?.find(
(pkg) => pkg.activityProductId === item.activityProductId
)
console.log('freshItem***', freshItem)
if (!freshItem?.scriptReady) {
uni.showToast({ title: '话术未就绪,请稍后重试', icon: 'none' })
return
}
this.$emit('start-study', freshItem, index)
const prelearnDataStr = encodeURIComponent(JSON.stringify(res))
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`, url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`,
fail: (err) => { fail: (err) => {
console.error('预学习桥接页跳转失败:', err) console.error('预学习桥接页跳转失败:', err)
} }
}) })
} catch (err) {
console.error('预学习首页弹框查询失败:', err)
}
}, },
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
}, },
handleConfirm() { handleConfirm() {
if (this.confirmDisabled) return
this.$emit('confirm') this.$emit('confirm')
} }
} }
...@@ -187,9 +231,11 @@ export default { ...@@ -187,9 +231,11 @@ export default {
} }
.confirm-button { .confirm-button {
width: toRpx(338); width: 100%;
height: toRpx(80); height: toRpx(80);
margin: 0 auto; margin: 0 auto;
padding: 0 toRpx(24);
box-sizing: border-box;
border-radius: toRpx(48); border-radius: toRpx(48);
border: toRpx(2) solid #979797; border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
...@@ -203,5 +249,16 @@ export default { ...@@ -203,5 +249,16 @@ export default {
&:active { &:active {
opacity: 0.8; opacity: 0.8;
} }
&--disabled {
border-color: #d9d9d9;
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
color: #ffffff;
pointer-events: none;
&:active {
opacity: 1;
}
}
} }
</style> </style>
...@@ -182,19 +182,19 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -182,19 +182,19 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible' popKey: 'carBrandVisible'
}, },
{ {
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
},
{
label: '流量来源', label: '流量来源',
valueKey: 'residentSaleName', valueKey: 'residentSaleName',
key: 'residentSaleId', key: 'residentSaleId',
type: 'select', type: 'select',
required: true, required: true,
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
} }
// { // {
// label: '接待场景', // label: '接待场景',
...@@ -269,6 +269,10 @@ export default { ...@@ -269,6 +269,10 @@ export default {
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD") this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
}, },
methods: { methods: {
async getCustomerGroupInfo() {
const res = await uni.$api.customerApi.getCustomerGroupInfoAPI({merchantId: 44211227})
console.log('getCustomerGroupInfoAPI***', res)
},
initForm () { initForm () {
const { sceneType } = uni.$storage.get("userInfo") const { sceneType } = uni.$storage.get("userInfo")
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50 default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
...@@ -373,7 +377,7 @@ export default { ...@@ -373,7 +377,7 @@ export default {
}) })
let { customerInfo, customerForm, optionalForm } = this, let { customerInfo, customerForm, optionalForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"), { shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo', targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
params = { params = {
merchantId: shopMerchantId, merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 bussinessScene: sceneType == 0 ? 1 : 2
...@@ -400,9 +404,50 @@ export default { ...@@ -400,9 +404,50 @@ export default {
mask: true mask: true
}) })
console.log('params**', params) console.log('params**', params)
// const res = await uni.$api.customerApi[targetApi](params), // {
const res = await uni.$api.customerApi.submitCustomerProfileAPI([params]), // "merchantId": 44211227,
// "bussinessScene": 2,
// "customerName": "linl",
// "customerPhone": "13588008885",
// "carTypeName": "问界M7",
// "arrivalDate": "2026-06-25",
// "residentSaleId": "997c9fbb64b046ac900d751d99d0273d",
// "standNo": "",
// "filingDate": "",
// "carTypeId": 1149147,
// "carBrand": "AITO 问界",
// "carBrandId": 3454,
// "oneCarBrand": "鸿蒙智行",
// "oneCarBrandId": 2978,
// "employeeName": "成威2号",
// "userId": "e77729f1a544442a8f43e587e1f6d20a",
// "sellerMerchantId": 44209880
// }
let requestParams = {
userId:params.userId,
merchantId:params.merchantId,
employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId,
preliminaryOrders: [
{
customerName:params.customerName,
customerPhone:params.customerPhone,
carBrand:params.carBrand,
carBrandId:params.carBrandId,
carChildsBrandId:'',
carChildsBrandName:'',
carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName,
deliveryDate:params.arrivalDate, //交付日期
inviteDate:'', //到店日期
createdDate:'', //建档日期
}
]
}
console.log('requestParams**', requestParams)
const res = await uni.$api.customerApi[targetApi](requestParams),
_this = this _this = this
console.log('submitCustomerProfileAPI res**', res)
if (res) { if (res) {
if (res == '1') { if (res == '1') {
this.$refs.successRef.open() this.$refs.successRef.open()
...@@ -428,8 +473,10 @@ export default { ...@@ -428,8 +473,10 @@ export default {
uni.hideLoading() uni.hideLoading()
} }
} catch (error) { } catch (error) {
let index = this.customerForm.findIndex(e => e.key == error) const index = this.customerForm.findIndex(e => e.key == error)
if (index !== -1) {
this.customerForm[index].error = true this.customerForm[index].error = true
}
uni.hideLoading() uni.hideLoading()
} }
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
class="demo-webview" class="demo-webview"
:style="webviewShellStyle" :style="webviewShellStyle"
:src="webviewUrl" :src="webviewUrl"
:fullscreen="isAppClient ? false : undefined"
:webview-styles="webviewInsetStyle" :webview-styles="webviewInsetStyle"
@message="handleWebMessage" @message="handleWebMessage"
@onPostMessage="handleWebMessage" @onPostMessage="handleWebMessage"
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
> >
<PreBackPopup <PreBackPopup
:confirmText="backPopInfo.confirmText" :confirmText="backPopInfo.confirmText"
:prelearnContext="prelearnContext"
@cancel="handleBackPopupCancel" @cancel="handleBackPopupCancel"
@confirm="handleBackPopupConfirm" @confirm="handleBackPopupConfirm"
/> />
...@@ -70,8 +70,9 @@ export default { ...@@ -70,8 +70,9 @@ export default {
activityProductId: '16', activityProductId: '16',
staffUuid: uni.$storage.get('userInfo').uuid, staffUuid: uni.$storage.get('userInfo').uuid,
staffName: uni.$storage.get('userInfo').name, staffName: uni.$storage.get('userInfo').name,
merchantId: '44209880', merchantId: String(uni.$storage.get('userInfo').merchantId ?? ''),
entrySource: 'home_popup', entrySource: 'home_popup',
skipCount: 0,
}, },
pendingAppBackTimer: null, pendingAppBackTimer: null,
pendingAppBackRequestId: null, pendingAppBackRequestId: null,
...@@ -137,12 +138,20 @@ export default { ...@@ -137,12 +138,20 @@ export default {
onLoad(options) { onLoad(options) {
const defaultUrl = 'http://192.168.1.68:4173/prelearning.html' const defaultUrl = 'http://192.168.1.68:4173/prelearning.html'
this.webviewUrl = options.url ? decodeURIComponent(options.url) : defaultUrl this.webviewUrl = options.url ? decodeURIComponent(options.url) : defaultUrl
console.log('[prelearnBridge] 页面入参 options:', options)
if (options.prelearnData) { if (options.prelearnData) {
try { try {
const prelearnData = JSON.parse(decodeURIComponent(options.prelearnData)) const prelearnData = JSON.parse(decodeURIComponent(options.prelearnData))
console.log('[prelearnBridge] 预学习弹窗数据 prelearnData:', prelearnData) console.log('[prelearnBridge] 预学习弹窗数据 prelearnData:', prelearnData)
const { activityId, activityProductId, entrySource } = prelearnData
if (activityId != null) {
this.prelearnContext.activityId = String(activityId)
}
if (activityProductId != null) {
this.prelearnContext.activityProductId = String(activityProductId)
}
if (entrySource) {
this.prelearnContext.entrySource = entrySource
}
} catch (error) { } catch (error) {
console.error('[prelearnBridge] 解析 prelearnData 失败:', error) console.error('[prelearnBridge] 解析 prelearnData 失败:', error)
} }
...@@ -176,6 +185,7 @@ export default { ...@@ -176,6 +185,7 @@ export default {
console.log('[prelearnBridge] open url:', this.webviewUrl) console.log('[prelearnBridge] open url:', this.webviewUrl)
}, },
onReady() { onReady() {
this.registerCompleteActivityHandler()
this.captureChildWebview() this.captureChildWebview()
this.initBrowserBridge() this.initBrowserBridge()
this.createNavBackHotArea() this.createNavBackHotArea()
...@@ -190,6 +200,7 @@ export default { ...@@ -190,6 +200,7 @@ export default {
onUnload() { onUnload() {
this.clearPendingAppBack() this.clearPendingAppBack()
this.destroyNavBackHotArea() this.destroyNavBackHotArea()
this.unregisterCompleteActivityHandler()
// #ifdef H5 // #ifdef H5
window.removeEventListener('message', this.handleBrowserMessage) window.removeEventListener('message', this.handleBrowserMessage)
// #endif // #endif
...@@ -249,11 +260,149 @@ export default { ...@@ -249,11 +260,149 @@ export default {
initBrowserBridge() { initBrowserBridge() {
// #ifdef H5 // #ifdef H5
window.addEventListener('message', this.handleBrowserMessage) window.addEventListener('message', this.handleBrowserMessage)
setTimeout(() => this.injectH5CompleteActivity(), 600)
setTimeout(() => this.injectH5CompleteActivity(), 1500)
setTimeout(() => this.pushPrelearnSessionByBrowserMessage(), 600) setTimeout(() => this.pushPrelearnSessionByBrowserMessage(), 600)
setTimeout(() => this.pushPrelearnSessionByBrowserMessage(), 1500) setTimeout(() => this.pushPrelearnSessionByBrowserMessage(), 1500)
setTimeout(() => this.pushPrelearnSessionByBrowserMessage(), 3000) setTimeout(() => this.pushPrelearnSessionByBrowserMessage(), 3000)
// #endif // #endif
}, },
registerCompleteActivityHandler() {
const handler = (payload) => this.handleCompleteActivity(payload)
this._completeActivityHandler = handler
// #ifdef H5
const globalObj = typeof window !== 'undefined'
? window
: (typeof globalThis !== 'undefined' ? globalThis : null)
if (globalObj) {
globalObj.completeActivity = handler
}
// #endif
// #ifdef APP-PLUS
this.registerAppParentCompleteActivityHandler(handler)
// #endif
},
registerAppParentCompleteActivityHandler(handler) {
if (typeof plus !== 'undefined') {
plus.__prelearnBridgeCompleteActivity = handler
}
const tryRegister = () => {
try {
const wv = this.$scope && this.$scope.$getAppWebview && this.$scope.$getAppWebview()
if (!wv || typeof wv.evalJS !== 'function') return false
wv.evalJS(`
(function() {
window.completeActivity = function(payload) {
try {
if (typeof plus !== 'undefined' && plus.__prelearnBridgeCompleteActivity) {
plus.__prelearnBridgeCompleteActivity(payload || {});
}
} catch (e) {}
};
})();
`)
return true
} catch (error) {
console.log('[prelearnBridge] register parent completeActivity failed:', error)
return false
}
}
if (!tryRegister()) {
this.$nextTick(() => {
setTimeout(() => tryRegister(), 100)
})
}
},
unregisterCompleteActivityHandler() {
// #ifdef H5
const globalObj = typeof window !== 'undefined'
? window
: (typeof globalThis !== 'undefined' ? globalThis : null)
if (globalObj && globalObj.completeActivity) {
delete globalObj.completeActivity
}
// #endif
// #ifdef APP-PLUS
if (typeof plus !== 'undefined' && plus.__prelearnBridgeCompleteActivity) {
delete plus.__prelearnBridgeCompleteActivity
}
try {
const wv = this.$scope && this.$scope.$getAppWebview && this.$scope.$getAppWebview()
if (wv && typeof wv.evalJS === 'function') {
wv.evalJS('try { delete window.completeActivity; } catch (e) {}')
}
} catch (error) {
console.log('[prelearnBridge] unregister parent completeActivity failed:', error)
}
// #endif
},
buildH5CompleteActivityInjectScript() {
return `
(function() {
window.completeActivity = function(payload) {
payload = payload || {};
try {
if (typeof uni !== 'undefined' && uni.postMessage) {
uni.postMessage({ data: { type: 'COMPLETE_ACTIVITY', payload: payload } });
return;
}
} catch (e) {}
try {
if (typeof plus !== 'undefined' && plus.webview) {
var pwv = plus.webview.currentWebview();
var parent = pwv && pwv.parent && pwv.parent();
if (parent && parent.evalJS) {
parent.evalJS('window.completeActivity && window.completeActivity(' + JSON.stringify(payload) + ')');
return;
}
}
} catch (e) {}
try {
if (window.parent && window.parent !== window) {
window.parent.postMessage({
source: 'prelearn-h5',
type: 'COMPLETE_ACTIVITY',
payload: payload
}, '*');
}
} catch (e) {}
};
})();
`
},
injectH5CompleteActivity() {
const script = this.buildH5CompleteActivityInjectScript()
// #ifdef APP-PLUS
if (this.childWebview && this.childWebview.evalJS) {
this.childWebview.evalJS(script)
console.log('[prelearnBridge] injected window.completeActivity into child webview')
return
}
// #endif
// #ifdef H5
const iframe = document.querySelector('iframe')
if (!iframe || !iframe.contentWindow) {
console.log('[prelearnBridge] browser iframe missing, skip completeActivity inject')
return
}
try {
iframe.contentWindow.eval(script)
console.log('[prelearnBridge] injected window.completeActivity into browser iframe')
} catch (error) {
console.log('[prelearnBridge] inject completeActivity into iframe failed:', error)
}
// #endif
},
handleCompleteActivity(payload) {
console.log('[prelearnBridge] H5 completeActivity:', payload)
this.clearPendingAppBack()
this.navigateBack()
},
handleBrowserMessage(event) { handleBrowserMessage(event) {
const message = event && event.data const message = event && event.data
if (!message || message.source !== 'prelearn-h5') return if (!message || message.source !== 'prelearn-h5') return
...@@ -274,6 +423,10 @@ export default { ...@@ -274,6 +423,10 @@ export default {
if (message.type === 'PRELEARN_APP_BACK_HANDLED') { if (message.type === 'PRELEARN_APP_BACK_HANDLED') {
this.handleH5BackHandled(message) this.handleH5BackHandled(message)
} }
if (message.type === 'COMPLETE_ACTIVITY') {
this.handleCompleteActivity(message.payload || message.data)
}
}, },
captureChildWebview() { captureChildWebview() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
...@@ -286,8 +439,11 @@ export default { ...@@ -286,8 +439,11 @@ export default {
console.log('[prelearn bridge demo] child webview ready') console.log('[prelearn bridge demo] child webview ready')
this.applyWebviewInset() this.applyWebviewInset()
this.createNavBackHotArea() this.createNavBackHotArea()
this.injectH5CompleteActivity()
this.pushPrelearnSessionToH5() this.pushPrelearnSessionToH5()
setTimeout(() => this.injectH5CompleteActivity(), 600)
setTimeout(() => this.pushPrelearnSessionToH5(), 600) setTimeout(() => this.pushPrelearnSessionToH5(), 600)
setTimeout(() => this.injectH5CompleteActivity(), 1500)
setTimeout(() => this.pushPrelearnSessionToH5(), 1500) setTimeout(() => this.pushPrelearnSessionToH5(), 1500)
return return
} }
...@@ -306,20 +462,25 @@ export default { ...@@ -306,20 +462,25 @@ export default {
handleWebMessage(event) { handleWebMessage(event) {
const messages = this.normalizeMessages(event) const messages = this.normalizeMessages(event)
messages.forEach((message) => { messages.forEach((message) => {
console.log('[prelearn bridge demo] receive h5 message:', message) console.log('***通知APP-POSTMESSAGE***', message)
if (!message || !message.type) return if (!message || !message.type) return
if (message.type === 'GET_PRELEARN_TICKET') { if (message.type === 'GET_PRELEARN_TICKET') {
this.pushPrelearnSessionToH5(message.requestId) this.pushPrelearnSessionToH5(message.requestId)
} }
if (message.type === 'PRELEARN_BACK_TO_APP') { // if (message.type === 'PRELEARN_BACK_TO_APP') {
if (message.type === 'completeActivity') {
this.handleH5BackEvent(message) this.handleH5BackEvent(message)
} }
if (message.type === 'PRELEARN_APP_BACK_HANDLED') { if (message.type === 'PRELEARN_APP_BACK_HANDLED') {
this.handleH5BackHandled(message) this.handleH5BackHandled(message)
} }
if (message.type === 'COMPLETE_ACTIVITY') {
this.handleCompleteActivity(message.payload || message.data)
}
}) })
}, },
normalizeMessages(event) { normalizeMessages(event) {
...@@ -574,16 +735,59 @@ export default { ...@@ -574,16 +735,59 @@ export default {
} }
// #endif // #endif
}, },
back() { async back() {
try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
const res = {
"activityId": 31,
"activityName": "618年中促活动A",
"packages": [
{
"activityProductId": "16",
"packageName": "tttttttt",
"includes": ['原厂定制车衣','玻璃贴膜'],
"learnStatus": "STUDIED",
"scriptReady": true
}
],
"remainingSkipCount": 0,
"shouldPopup": true,
"muteReason": null,
"remainingActivityCount": null
}
console.log('[prelearnBridge] getPrelernHomePopupAPI res:', res)
// if (!res) {
// this.navigateBack()
// return
// }
const packages = res.packages || []
const allStudied = packages.length > 0 && packages.every(
(pkg) => pkg.learnStatus === 'STUDIED'
)
if (allStudied) {
this.navigateBack()
return
}
if (res.activityId != null) {
this.prelearnContext.activityId = String(res.activityId)
}
this.prelearnContext.skipCount = res.remainingSkipCount ?? 0
this.showBackPopup = true this.showBackPopup = true
} catch (error) {
console.error('[prelearnBridge] 预学习返回弹框查询失败:', error)
this.showBackPopup = true
}
}, },
handleBackPopupCancel() { handleBackPopupCancel() {
this.showBackPopup = false this.showBackPopup = false
this.backPopInfo.confirmText = '确认已提交' this.backPopInfo.confirmText = '确认'
}, },
handleBackPopupConfirm() { handleBackPopupConfirm() {
this.showBackPopup = false this.showBackPopup = false
this.backPopInfo.confirmText = '确认已提交' this.backPopInfo.confirmText = '确认'
this.notifyH5AppBackPressed() this.notifyH5AppBackPressed()
}, },
navigateBack() { navigateBack() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!