Commit cbb6d660 by 前端

Merge branch 'hotfix_v5.8.3.2' into 'master'

上线合并

See merge request !96
2 parents ce72508f e685a44b
......@@ -739,4 +739,13 @@ module.exports = {
...data
})
},
updateGoodsOrderRemark(data = {}) {
return http.post({
method: 'dj.api.smartcarlife.goodsOrder.remark',
projectName: 'pad',
...data
})
},
}
......@@ -116,16 +116,15 @@ module.exports = {
},
/**搜索订单(含套餐) */
getWorkPackageGoodsList (data) {
let params = data || {}
params.sceneType = 1
return http.post(
{
method: 'dj.api.smartcarlife.order.search.containPackageGoods',
projectName: 'boutique',
...data,
pageSize: 10,
pageSize: 999999,
statusList: [1]
pageSize: 20,
pageNum: 1,
statusList: [1],
sceneType: 1,
...data
},
false,
'dj',
......
......@@ -236,6 +236,14 @@ import {
import { storageApi } from '@/utils/cache'
import RecordService from '@/utils/recordManager/RecordService.js'
import { getAiStreamSession } from '@/utils/aiAssistant/aiStreamSession.js'
import {
trackAiBallClick,
trackAiThinkingTrigger,
trackAiQuestionSelect,
trackAiAnswerRender,
trackAiError,
AI_ERROR_TYPE
} from '@/utils/aiAssistant/aiAssistantTrack.js'
import { TransportType } from '@/utils/socket'
const DEMO_CAPTURE_SECONDS = 60
const HELP_ANSWER_REQUEST_TIMEOUT = 90000
......@@ -397,6 +405,7 @@ export default {
// #ifdef APP-PLUS
if (this.uiState === 'thinking') return
if (this.menuVisible || this.questionMenuVisible || this.introVisible) return
trackAiBallClick()
if (this.abnormalBubbleVisible) {
this.abnormalBubbleVisible = false
this._pendingBallTap = true
......@@ -500,6 +509,7 @@ export default {
this.qaList = []
this.selectedQaIndex = -1
trackAiThinkingTrigger(DEMO_CAPTURE_SECONDS)
this._logAi('info', `startThinking session=${sessionId}`)
await this.$nextTick()
......@@ -522,6 +532,7 @@ export default {
return
}
this._logAi('error', `startThinking failed: ${(e && e.message) || e}`)
trackAiError(this._resolveAiErrorType(e))
this.streamStatus = 'error'
this.uiState = 'idle'
this.resultVisible = false
......@@ -534,11 +545,18 @@ export default {
// #endif
},
selectQa(idx) {
const item = this.qaList[idx]
if (item) {
trackAiQuestionSelect(idx, item.query || '')
}
this.selectedQaIndex = idx
if (this.questionMenuVisible) {
this.questionMenuVisible = false
this.resultVisible = true
}
if (item && item.answer) {
this._trackAnswerRenderForIntent(idx)
}
},
/** 打开面板即开始监听/模拟流式 markdown,边收边渲染 */
beginStreamSession() {
......@@ -705,6 +723,7 @@ export default {
if (!this.qaList.length) {
this._logAi('info', 'response empty, no questions to show')
trackAiError(AI_ERROR_TYPE.NO_ANSWER)
return
}
if (isCancelled()) {
......@@ -720,9 +739,26 @@ export default {
this.questionMenuVisible = false
this.selectedQaIndex = 0
this.resultVisible = true
if (this.qaList[0] && this.qaList[0].answer) {
this._trackAnswerRenderForIntent(0)
}
}
// #endif
},
_trackAnswerRenderForIntent(intentId) {
const renderStart = Date.now()
this.$nextTick(() => {
trackAiAnswerRender(intentId, Date.now() - renderStart)
})
},
_resolveAiErrorType(err) {
const msg = String((err && (err.errMsg || err.message)) || '')
if (/timeout/i.test(msg)) return AI_ERROR_TYPE.TIMEOUT
if (this._isHelpAnswerNetworkError(err) || /连接失败|network/i.test(msg)) {
return AI_ERROR_TYPE.NETWORK
}
return AI_ERROR_TYPE.OTHER
},
_logAi(level, msg) {
// #ifdef APP-PLUS
const text = `[AiAssistant] ${msg}`
......
......@@ -218,7 +218,6 @@ export default {
page: '/pages/common/serviceDetail/index',
eventCode: 'app_service_center',
sceneType: [1],
showOnActivityTab: true,
pageDirect: true,
noInterception: true
},
......
......@@ -48,20 +48,22 @@
<view
v-for="(item, index) in goodsList"
:key="item.id || index"
:class="['goods-item', { active: goodsIndex === index }]"
class="goods-item-shell"
@click="handleGoodsClick(item, index)"
>
<view v-if="item.isMainPush" class="goods-item-badge">主推</view>
<view v-else class="goods-item-badge badge02">次推</view>
<view class="goods-item-img-wrap">
<image class="goods-item-img" :src="item.thumbImageUrl" mode="aspectFill" />
</view>
<view class="goods-item-content">
<text class="goods-item-name">{{ item.name }}</text>
<view class="goods-item-desc text-two-line">{{ item.description }}</view>
<view class="goods-item-price-wrap">
<text class="goods-item-price">¥ {{ item.price }}</text>
<text v-if="item.originalPrice" class="goods-item-original-price">¥ {{ item.originalPrice }}</text>
<view :class="['goods-item', { active: goodsIndex === index }]">
<view v-if="item.isMainPush" class="goods-item-badge">主推</view>
<view v-else class="goods-item-badge badge02">次推</view>
<view class="goods-item-img-wrap">
<image class="goods-item-img" :src="item.thumbImageUrl" mode="aspectFill" />
</view>
<view class="goods-item-content">
<text class="goods-item-name">{{ item.name }}</text>
<view class="goods-item-desc text-two-line">{{ item.description }}</view>
<view class="goods-item-price-wrap">
<text class="goods-item-price">¥ {{ item.price }}</text>
<text v-if="item.originalPrice" class="goods-item-original-price">¥ {{ item.originalPrice }}</text>
</view>
</view>
</view>
</view>
......@@ -324,8 +326,11 @@ export default {
}
}
.goods-box {
$shadow-space: 10px;
width: 100%;
overflow: visible;
// 允许横向阴影溢出父级,避免负 margin 扩展后被外层裁剪
clip-path: inset(0 -#{$shadow-space});
.goods-img-wrap {
position: relative;
......@@ -375,26 +380,38 @@ export default {
.goods-menu {
$goods-item-height: 120px;
$shadow-space: 8px;
$shadow-space: 10px;
$item-gap: 12px;
// 向外扩展滚动视口,配合首尾 margin 消除左右空隙并保留阴影绘制空间
// scroll-view 自身 padding 为视口边缘预留阴影区,负 margin 保持与父级同宽对齐
width: calc(100% + #{$shadow-space * 2});
margin: toRpx(28) (-$shadow-space);
margin: toRpx(28) (-$shadow-space) 0;
height: calc(#{$goods-item-height} + #{$shadow-space * 2});
padding: $shadow-space;
box-sizing: border-box;
white-space: nowrap;
.goods-menu-inner {
display: flex;
flex-wrap: nowrap;
gap: 12px;
align-items: stretch;
height: $goods-item-height;
padding: $shadow-space 0;
box-sizing: border-box;
}
.goods-item-shell {
flex-shrink: 0;
padding: $shadow-space;
margin: (-$shadow-space) 0;
box-sizing: content-box;
& + & {
margin-left: calc(#{$item-gap} - #{$shadow-space * 2});
}
}
.goods-item {
position: relative;
flex-shrink: 0;
box-sizing: border-box;
width: 252px;
height: $goods-item-height;
......@@ -407,14 +424,6 @@ export default {
box-shadow: 0 2px 8px 0 rgba(44, 102, 247, 0.10);
cursor: pointer;
&:first-child {
margin-left: $shadow-space;
}
&:last-child {
margin-right: $shadow-space;
}
&.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;
......@@ -518,4 +527,11 @@ export default {
margin-top: toRpx(28);
}
}
::v-deep .goods-menu {
.uni-scroll-view,
.uni-scroll-view-content {
height: 100%;
}
}
</style>
<template>
<view class="list-skeleton">
<view
v-for="groupIndex in groupCount"
:key="'skeleton-group-' + groupIndex"
class="list-skeleton__group"
>
<view class="list-skeleton__count">
<view class="list-skeleton__block list-skeleton__count-left"></view>
<view class="list-skeleton__block list-skeleton__count-right"></view>
</view>
<view
v-for="itemIndex in itemCount"
:key="'skeleton-item-' + groupIndex + '-' + itemIndex"
class="list-skeleton__item"
>
<view class="list-skeleton__block list-skeleton__avatar"></view>
<view class="list-skeleton__body">
<view class="list-skeleton__block list-skeleton__line list-skeleton__line--name"></view>
<view class="list-skeleton__block list-skeleton__line list-skeleton__line--meta"></view>
<view class="list-skeleton__block list-skeleton__line list-skeleton__line--group"></view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'ListSkeleton',
props: {
groupCount: {
type: Number,
default: 2
},
itemCount: {
type: Number,
default: 2
}
}
}
</script>
<style lang="scss" scoped>
$card-shadow-space: 4px;
$content-h-gap: 12px;
$item-side-margin: $content-h-gap - $card-shadow-space;
@keyframes list-skeleton-shimmer {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
.list-skeleton {
&__group {
margin-bottom: 8px;
&:last-child {
margin-bottom: 0;
}
}
&__block {
border-radius: 4px;
background: linear-gradient(90deg, #F0F2F5 25%, #E4E8ED 50%, #F0F2F5 75%);
background-size: 200% 100%;
animation: list-skeleton-shimmer 1.4s ease-in-out infinite;
}
&__count {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
margin: 0 $item-side-margin 8px;
border-radius: 10px;
background: rgba(44, 102, 247, 0.03);
box-sizing: border-box;
min-height: 32px;
}
&__count-left {
width: 120px;
height: 14px;
}
&__count-right {
width: 56px;
height: 14px;
}
&__item {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 10px 12px;
margin: 0 $item-side-margin 8px;
background: #FFFFFF;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(44, 102, 247, 0.06);
box-sizing: border-box;
}
&__avatar {
width: 32px;
height: 32px;
border-radius: 50%;
flex-shrink: 0;
}
&__body {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 8px;
padding-top: 2px;
}
&__line {
height: 14px;
&--name {
width: 72%;
}
&--meta {
width: 55%;
}
&--group {
width: 40%;
}
}
}
</style>
......@@ -94,10 +94,15 @@
</view>
</view>
</view>
<view class="content-right box-class scene1-box-shadow">
<view class="common-title">服务中心</view>
<view class="content-box">
<MessageIndex class="message-box" ref="messageRef" />
<view class="content-right box-class scene1-box-shadow content-right-customer">
<view class="content-right-customer-inner">
<CustomerSide
:customerProfile="customerProfileList"
:loading="customerProfileLoading"
enable-header-gradient
:showHeaderIcon="false"
:headerGradient="customerHeaderGradient"
/>
</view>
</view>
</view>
......@@ -110,7 +115,10 @@
@entranceClick="entranceClick"
/>
<view class="line"></view>
<CustomerSide :customerProfile="customerProfileList" />
<CustomerSide
:customerProfile="customerProfileList"
:loading="customerProfileLoading"
/>
</view>
</view>
<!-- 挖掘潜客机会 -->
......@@ -386,7 +394,14 @@ export default {
}),
activityProductList: [],
prelearnData: {},
customerProfileList: []
customerProfileList: [],
customerProfileLoading: true,
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() {
......@@ -493,7 +508,7 @@ export default {
// 监听自定义事件
uni.$on('pageBack', () => {
this.$refs.leftBox.getMessageInfo()
this.$refs.messageRef.getMessageSummary()
this.$refs.messageRef?.getMessageSummary()
})
uni.$on('refreshCustomerProfileGroupInfo', () => {
this.getCustomerProfileGroupInfo()
......@@ -706,7 +721,7 @@ export default {
},
async changeTab({ item, index }) {
if (index == 0) {
this.$refs.messageRef.getMessageSummary()
this.$refs.messageRef?.getMessageSummary()
this.getCustomerProfileGroupInfo()
this.getStrategyStatus()
}
......@@ -760,7 +775,8 @@ export default {
}
},
/**
* 查询当前进行中的营销活动商品列表
* @function 营销活动:
* @desc 查询当前进行中的营销活动商品列表
*/
async getActivityProductList() {
const { shopMerchantId: merchantId } = uni.$storage.get('userInfo') || {}
......@@ -783,22 +799,27 @@ export default {
},
/**
* 查询客户建档分页查询-月按天分组
* @function 客户档案:
* @desc 查询客户建档分页查询-月按天分组
*/
async getCustomerProfileGroupInfo() {
const { shopMerchantId: merchantId } = uni.$storage.get('userInfo') || {}
if (!merchantId) {
this.customerProfileList = []
this.customerProfileLoading = false
return
}
this.customerProfileLoading = true
try {
const res = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI({ merchantId })
console.log('getCustomerProfileListInfo***')
console.log('getCustomerProfileGroupInfo***', res)
this.customerProfileList = Array.isArray(res) ? res : []
} catch (error) {
console.error('查询客户建档分组信息失败:', error)
this.customerProfileList = []
} finally {
this.customerProfileLoading = false
}
},
/**
......@@ -1404,6 +1425,35 @@ export default {
flex: 1;
min-height: 0;
// 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 {
width: 100%;
height: 100%;
......
......@@ -45,21 +45,28 @@ export default {
return
}
this.componentLoading(params)
const { shopMerchantId } = userInfo,
apiParams = {
const { shopMerchantId } = userInfo
const isOrderSearch = !params.defeat && userInfo.sceneType == 1
const useWorkPackageGoods = params.defeat || isOrderSearch
let apiTargetName = useWorkPackageGoods ? 'getWorkPackageGoodsList' : 'getQuotationCustomerList'
let apiParams = useWorkPackageGoods
? {
merchantId: shopMerchantId,
pageSize: 20,
pageNum: 1,
statusList: [1],
sceneType: 1,
keyword: searchValue || ''
}
: {
merchantId: shopMerchantId,
pageSize: 999999,
currentPage: 1,
search: searchValue
}
let apiTargetName = !params.defeat ? 'getQuotationCustomerList' : 'getWorkPackageGoodsList'
console.log(apiTargetName, 'apiTargetName')
if (params.defeat) {
apiParams.keyword = searchValue
}
const { list } = await uni.$api.popupApi[apiTargetName](apiParams)
let customerList = list
if (params.defeat) {
if (useWorkPackageGoods) {
const listArray = list.map(item => {
if (item.customer && item.customer.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
......@@ -72,8 +79,9 @@ export default {
this.updateParams(params, customerList || [])
},
initData (list) {
const { params: { idKey, defeat }, data } = this
let key = defeat ? 'id' : 'customerPhone'
const { params: { idKey, defeat }, data, userInfo } = this
const isOrderSearch = !defeat && userInfo.sceneType == 1
let key = defeat || isOrderSearch ? 'id' : 'customerPhone'
console.log(data, idKey)
if (data[idKey]) {
this.currentId = data[idKey]
......@@ -88,14 +96,16 @@ export default {
this.getList(searchValue, true)
},
choose (i) {
let { params } = this
let key = params.defeat ? 'id' : 'customerPhone'
let { params, userInfo } = this
const isOrderSearch = !params.defeat && userInfo.sceneType == 1
let key = params.defeat || isOrderSearch ? 'id' : 'customerPhone'
this.currentId = i[key]
this.$emit('choose', i)
},
checkActive (i) {
let { currentId, data, params } = this
let key = params.defeat ? 'id' : 'customerPhone'
let { currentId, data, params, userInfo } = this
const isOrderSearch = !params.defeat && userInfo.sceneType == 1
let key = params.defeat || isOrderSearch ? 'id' : 'customerPhone'
return currentId ? (i[key] == currentId) : (i[key]) == data[params.idKey]
}
}
......
......@@ -420,6 +420,17 @@ export default {
this.pageParams.customerQr = ''
this.$refs.couponPopup.open()
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) {
try {
uni.showLoading({
......@@ -443,8 +454,6 @@ export default {
if (data) {
this.pageParams.customerCouponId = customerInfo.customerCouponId
this.pageParams.customerQr = data
if (customerInfo.inviteRecordId) this.customerInfo = customerInfo
} else throw '生成小程序码失败,请重试!'
} else throw message
......
......@@ -245,6 +245,7 @@ export default {
this.$refs.invitationCanvas.clearBoard()
},
openDetail (e) {
console.log('openDetail**e**', e);
this.couponPopupRef.open(0, {
...e,
phoneNumber: e.customerPhone,
......
......@@ -291,6 +291,11 @@ export default {
showPayTips () {
if (this.orderObj.payeeType == 0 && this.orderObj.selectPayType == 7) return true
else return false
},
// 轻改场景:隐藏场景名称表单项(仅展示层)
hideSceneNameField () {
const { sceneType } = this.userInfo || {}
return sceneType == 1
}
},
onload (options) {
......@@ -332,6 +337,9 @@ export default {
} else {
item.hidden = item._originHidden
}
if (item.value === 'baseSceneCode' && this.hideSceneNameField) {
item.hidden = true
}
})
})
this.formList = list
......
......@@ -654,7 +654,12 @@ const popupTypeEnum = {
// 订单类型弹窗(OrderTypePopup)
key: 'djOrderType',
list: ''
},
19: {
key: 'customer'
}
}
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST }
const titleList = [null, { addHtml: 'customer' }]
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList }
......@@ -50,6 +50,14 @@
</view>
</picker>
</template>
<template v-else-if="i.type == 'radio'">
<radio-group class="radio-group flex" @change="radioChange($event, i)">
<label class="radio-item flex" v-for="item in i.radioList" :key="item.value">
<radio style="transform: scale(0.7)" :value="item.value" :checked="customerInfo[i.key] == item.value" />
<view class="radio-name">{{ item.name }}</view>
</label>
</radio-group>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
......@@ -104,6 +112,14 @@
</view>
</picker>
</template>
<template v-else-if="i.type == 'radio'">
<radio-group class="radio-group flex" @change="radioChange($event, i)">
<label class="radio-item flex" v-for="item in i.radioList" :key="item.value">
<radio style="transform: scale(0.7)" :value="item.value" :checked="customerInfo[i.key] == item.value" />
<view class="radio-name">{{ item.name }}</view>
</label>
</radio-group>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
......@@ -207,12 +223,15 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}
],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
type: 'input',
inputType: 'text',
maxlength: 17
label: '性别',
valueKey: 'customerSex',
key: 'customerSex',
type: 'radio',
current: 1,
radioList: [
{ value: 1, name: '男' },
{ value: 2, name: '女' }
]
},
{
label: '到店日期',
......@@ -220,6 +239,14 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
key: 'inviteDate',
type: 'date',
dateFromToday: true
},
{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
type: 'input',
inputType: 'text',
maxlength: 17
},
{
label: '建档日期',
......@@ -288,6 +315,7 @@ export default {
this.customerInfo = {
customerName: '',
customerPhone: '',
customerSex: 1,
carTypeName: '',
carChildsBrandId: '',
carChildsBrandName: '',
......@@ -312,6 +340,11 @@ export default {
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res
if (this.customerInfo.customerSex != null && this.customerInfo.customerSex !== '') {
this.customerInfo.customerSex = Number(this.customerInfo.customerSex)
} else {
this.customerInfo.customerSex = 1
}
if (!this.customerInfo.filingDate) {
this.customerInfo.filingDate = dayjs().format('YYYY-MM-DD')
}
......@@ -367,6 +400,11 @@ export default {
getDatePickerEnd (field) {
return field.dateUnlimited ? '2099-12-31' : this.endDate
},
radioChange (e, field) {
const raw = e.detail.value
const sampleVal = field.radioList?.[0]?.value
this.customerInfo[field.key] = typeof sampleVal === 'number' ? Number(raw) : raw
},
bindDateChange (e, valueKey) {
const value = e.detail.value
this.customerInfo[valueKey] = value
......@@ -503,10 +541,11 @@ export default {
baseSceneCode:'100101',
customerName:params.customerName,
customerPhone:params.customerPhone,
customerSex: params.customerSex,
carBrand:params.carBrand,
carBrandId:params.carBrandId,
carChildsBrandId: params.carTypeId,
carChildsBrandName: params.carTypeName,
carChildsBrandId: params.oneCarBrandId,
carChildsBrandName: params.oneCarBrand,
standNo:params.standNo,
carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName,
......@@ -707,6 +746,19 @@ export default {
.error {
border: toRpx(2) solid #f24724 !important;
}
.radio-group {
width: toRpx(738);
height: toRpx(76);
align-items: center;
gap: toRpx(48);
}
.radio-item {
align-items: center;
}
.radio-name {
color: #333333;
font-size: toRpx(28);
}
}
.btns {
justify-content: center;
......
......@@ -77,6 +77,14 @@
</view>
</picker>
</template>
<template v-else-if="i.type == 'radio'">
<radio-group class="radio-group flex" @change="radioChange($event, i)">
<label class="radio-item flex" v-for="item in i.radioList" :key="item.value">
<radio style="transform: scale(0.7)" :value="item.value" :checked="customerInfo[i.key] == item.value" />
<view class="radio-name">{{ item.name }}</view>
</label>
</radio-group>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
......@@ -126,6 +134,14 @@
</view>
</picker>
</template>
<template v-else-if="i.type == 'radio'">
<radio-group class="radio-group flex" @change="radioChange($event, i)">
<label class="radio-item flex" v-for="item in i.radioList" :key="item.value">
<radio style="transform: scale(0.7)" :value="item.value" :checked="customerInfo[i.key] == item.value" />
<view class="radio-name">{{ item.name }}</view>
</label>
</radio-group>
</template>
<template v-else>
<view
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
......@@ -253,8 +269,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
},
{
label: '车型',
valueKey: 'carChildsBrandName',
key: 'carChildsBrandId',
valueKey: 'carSeriesName',
key: 'carSeriesId',
type: 'select',
required: true,
popKey: 'carBrandVisible'
......@@ -282,8 +298,19 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
type: 'readonly',
required: true,
merchantNameKey: 'merchantName'
},{
label: '性别',
valueKey: 'customerSex',
key: 'customerSex',
type: 'radio',
current: 1,
radioList: [
{ value: 1, name: '男' },
{ value: 2, name: '女' }
]
}],
default_optionalForm = [{
default_optionalForm = [
{
label: '车架号',
valueKey: 'standNo',
key: 'standNo',
......@@ -360,23 +387,6 @@ export default {
goodsSubOrderList () {
return this.displayInfo.goodsSubOrderDTOS.filter(item => item)
},
upgradeStatusInfo () {
const { customerInfo } = this
if (customerInfo.upgradeStatusName) {
return {
label: customerInfo.upgradeStatusName,
type: this.getUpgradeStatusType(customerInfo.upgradeStatusName)
}
}
const statusMap = {
1: { label: '待跟进', type: 'warning' },
2: { label: '已升级', type: 'success' },
3: { label: '战败', type: 'failed' },
4: { label: '已退款', type: 'refund' }
}
const status = customerInfo.upgradeStatus ?? customerInfo.orderStatus
return statusMap[status] || null
},
sceneType () {
const { sceneType } = uni.$storage.get('userInfo') || {}
return sceneType
......@@ -388,6 +398,9 @@ export default {
isStartReceptionDisabled () {
if (this.isRequiredFormIncomplete) return true
return [2, 3, 4].includes(Number(this.customerInfo.customerStatus))
},
isRemarkEditable () {
return Number(this.customerInfo.orderStatus) === 3
}
},
data () {
......@@ -512,6 +525,7 @@ export default {
const requestParams = {
id: this.customerInfo.id,
customerName: this.customerInfo.customerName,
customerSex: this.customerInfo.customerSex,
carBrand: this.customerInfo.carBrand,
carBrandId: this.customerInfo.carBrandId,
carChildsBrandName: this.customerInfo.carChildsBrandName,
......@@ -653,13 +667,6 @@ export default {
goodsSubOrderDTOS: Array.isArray(info.goodsSubOrderDTOS) ? info.goodsSubOrderDTOS : []
}
},
getUpgradeStatusType (label) {
if (label === '已升级') return 'success'
if (label === '待跟进') return 'warning'
if (label === '战败') return 'failed'
if (label === '已退款') return 'refund'
return 'default'
},
initForm () {
const { sceneType } = uni.$storage.get("userInfo")
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
......@@ -676,6 +683,7 @@ export default {
this.customerInfo = {
customerName: '',
customerPhone: '',
customerSex: 1,
carBrand: '',
carBrandId: '',
carSeriesName: '',
......@@ -707,8 +715,15 @@ export default {
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.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.carChildsBrandId) res.carChildsBrandId = res.carSeriesId
if (res.carChildsBrandName) res.carChildsBrandName = res.carSeriesName
// 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 contact_name)
Object.assign(this.customerInfo, res)
if (this.customerInfo.customerSex != null && this.customerInfo.customerSex !== '') {
this.customerInfo.customerSex = Number(this.customerInfo.customerSex)
} else {
this.customerInfo.customerSex = 1
}
if (!this.customerInfo.createdDate) {
this.customerInfo.createdDate = dayjs().format('YYYY-MM-DD')
}
......@@ -817,9 +832,11 @@ export default {
this.$refs[popkey].close()
if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close()
console.log('选择车型***', item);
Object.assign(this.customerInfo, {
carChildsBrandName: item.name,
carChildsBrandId: item.id,
carChildsBrandName: item.carBrand,
carChildsBrandId: item.carBrandId,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
carSeriesName: item.name,
......@@ -855,6 +872,11 @@ export default {
this.syncInviteDateFromDelivery()
}
},
radioChange (e, field) {
const raw = e.detail.value
const sampleVal = field.radioList?.[0]?.value
this.customerInfo[field.key] = typeof sampleVal === 'number' ? Number(raw) : raw
},
inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo
if (val.key === 'standNo' && standNoVal) {
......@@ -1180,6 +1202,19 @@ export default {
.error {
border: toRpx(2) solid #f24724 !important;
}
.radio-group {
width: toRpx(738);
height: toRpx(76);
align-items: center;
gap: toRpx(48);
}
.radio-item {
align-items: center;
}
.radio-name {
color: #333333;
font-size: toRpx(28);
}
.input--readonly {
color: #666666;
background: #f5f7fa;
......
import { storageApi } from '@/utils/cache'
const EVENT = {
BALL_CLICK: 'app_ai_ball_click',
THINKING_TRIGGER: 'app_ai_thinking_trigger',
QUESTION_SELECT: 'app_ai_question_select',
ANSWER_RENDER: 'app_ai_answer_render',
ERROR: 'app_ai_error'
}
function getUserId() {
const { uuid } = storageApi.getUserInfo() || {}
return uuid || ''
}
function getSessionId() {
return storageApi.getSessionId() || ''
}
function getPageContext() {
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
return currentPage?.route || '/'
}
function track(eventCode, businessParam = {}) {
if (!uni.$track) return
uni.$track.add({
eventCode,
businessParam: {
user_id: getUserId(),
session_id: getSessionId(),
...businessParam
}
})
}
export function trackAiBallClick() {
track(EVENT.BALL_CLICK, {
timestamp: Date.now(),
page_context: getPageContext()
})
}
export function trackAiThinkingTrigger(audioDuration) {
track(EVENT.THINKING_TRIGGER, {
audio_duration: audioDuration
})
}
export function trackAiQuestionSelect(intentId, intentText) {
track(EVENT.QUESTION_SELECT, {
intent_id: intentId,
intent_text: intentText
})
}
export function trackAiAnswerRender(intentId, renderTime) {
track(EVENT.ANSWER_RENDER, {
intent_id: intentId,
render_time: renderTime
})
}
export function trackAiError(errorType) {
track(EVENT.ERROR, {
error_type: errorType,
timestamp: Date.now()
})
}
export const AI_ERROR_TYPE = {
TIMEOUT: 'timeout',
NETWORK: 'network_disconnect',
NO_ANSWER: 'no_answer',
OTHER: 'other'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!