Commit 0ad661c2 by 李伟康

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

2 parents 4ec6118d 186cabf2
...@@ -47,4 +47,32 @@ module.exports = { ...@@ -47,4 +47,32 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 轻改营销活动改版接口
*/
// 1、查询策略首页数据状态(营销活动和客户列表是否有数据)
getActivityStatusAPI(data) {
return http.post({
method: 'dj.pad.api.strategy.data.status',
projectName: 'pad',
...data
})
},
// 2、查询当前进行中的营销活动商品列表
getActivityProductListAPI(data) {
return http.post({
method: 'dj.pad.api.active.marketing.activity.product.list',
projectName: 'pad',
...data
})
},
// 2、查询今日待执行触达客户
getTaskCustomerPageAPI(data) {
return http.post({
method: 'dj.pad.api.today.sop.task.customer.page',
projectName: 'pad',
...data
})
},
} }
...@@ -708,7 +708,6 @@ module.exports = { ...@@ -708,7 +708,6 @@ module.exports = {
...data, ...data,
}) })
}, },
/** /**
* 查询门店分类 * 查询门店分类
* *
...@@ -720,4 +719,24 @@ module.exports = { ...@@ -720,4 +719,24 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 预学习首页弹框
*/
getPrelernHomePopupAPI(data = {}) {
return http.post({
method: 'dj.api.pad.prelearn.home.popup',
projectName: 'boutique',
...data
})
},
/**
* 预学习-扣减跳过次数
*/
deductSkipCountAPI(data = {}) {
return http.post({
method: 'dj.api.pad.prelearn.deduct.skip',
projectName: 'boutique',
...data
})
},
} }
...@@ -156,4 +156,59 @@ module.exports = { ...@@ -156,4 +156,59 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 轻改业务改版
* 1、客户建档详情
*/
customerProfileInfoAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.customerProfileInfo',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 2、客户建档提交
*/
csubmitCustomerProfileAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.submitCustomerProfile',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 3、客户建档分页查询
*/
pageCustomerProfileInfoAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.pageCustomerProfileInfo',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 3、获取客户群信息
*/
getCustomerGroupInfoAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.getCustomerGroupInfo',
projectName: 'pad',
...data
})
},
/**
* 轻改业务改版
* 4、获取群成员信息
*/
getCustomerGroupMemberInfoAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.order.getCustomerGroupMemberInfo',
projectName: 'pad',
...data
})
},
} }
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<!-- 活动类型标签栏 --> <!-- 活动类型标签栏 -->
<view class="type-box"> <view class="type-box">
<view <view
v-for="(item, index) in activityTypeTabs" v-for="(item, index) in activityTypeList"
:key="item.key" :key="item.marketingStage"
:class="['type-tag-item', { active: activityTypeIndex === index }]" :class="['type-tag-item', { active: activityTypeIndex === index }]"
@click="handleActivityTypeClick(index)" @click="handleActivityTypeClick(index)"
> >
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
<view class="car-list-inner"> <view class="car-list-inner">
<view <view
v-for="(item, index) in carModelTabs" v-for="(item, index) in carModelTabs"
:key="item.key" :key="item.carSeriesId || 'all'"
:class="['car-item', { active: carModelIndex === index }]" :class="['car-item', { active: carModelIndex === index }]"
@click="handleCarModelClick(index)" @click="handleCarModelClick(index)"
> >
{{ item.label }} {{ item.carSeriesName }}
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -81,74 +81,139 @@ import Entrance from '@/components/Entrance.vue' ...@@ -81,74 +81,139 @@ import Entrance from '@/components/Entrance.vue'
const GOODS_COVER = require('@/assets/images/common/goods-activity-cover.png') const GOODS_COVER = require('@/assets/images/common/goods-activity-cover.png')
const MOCK_GOODS_LIST = [ /** 前端虚拟 Tab:接口 carSeriesList 不含此项,仅用于 UI 展示「全部车型」 */
{ const ALL_CAR_SERIES_TAB = {
id: 1, carSeriesId: '__ALL__',
name: '这是活动商品/套餐限时保养套餐限时保养套餐', carSeriesName: '全部车型'
description: '这是选项卡描述-包含机油更换、机滤、空调滤、空气滤全套服务,活动期间享受8折优惠,先到先得。', }
price: '19999.00',
originalPrice: '12980.00',
isMain: true
},
{
id: 2,
name: '618大促精品套餐',
description: '免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',
price: '899.00',
originalPrice: '1299.00',
isMain: false
},
{
id: 3,
name: '618大促精品套餐',
description: '免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',
price: '899.00',
originalPrice: '1299.00'
}
].map(item => ({ cover: GOODS_COVER, ...item }))
export default { export default {
name: 'ActivityTime', name: 'ActivityTime',
components: { components: {
Entrance Entrance
}, },
props: {
/** 营销活动商品列表,结构:[{ marketingStage, carSeriesList: [{ carSeriesId, carSeriesName, productList }] }] */
activityProductList: {
type: Array,
default: () => []
}
},
data() { data() {
return { return {
// 活动类型本地配置:marketingStage 与接口字段对应,补充文案与图标
activityTypeTabs: [ activityTypeTabs: [
{ {
label: '新享特惠', label: '新享特惠',
key: 'preSale', key: 'preSale',
marketingStage: 0,
icon: require('@/assets/images/common/activity-type-preSale.png'), icon: require('@/assets/images/common/activity-type-preSale.png'),
activeIcon: require('@/assets/images/common/activity-type-preSale-active.png') activeIcon: require('@/assets/images/common/activity-type-preSale-active.png')
}, },
{ {
label: '售后钜惠', label: '售后钜惠',
key: 'afterSale', key: 'afterSale',
marketingStage: 1,
icon: require('@/assets/images/common/activity-type-afterSale.png'), icon: require('@/assets/images/common/activity-type-afterSale.png'),
activeIcon: require('@/assets/images/common/activity-type-afterSale-active.png') activeIcon: require('@/assets/images/common/activity-type-afterSale-active.png')
} }
], ],
activityTypeIndex: 0, activityTypeIndex: 0,
carModelTabs: [ carModelIndex: 0, // 0 对应「全部车型」,切换活动类型或数据刷新时重置至此
{ label: '全部车型', key: 'all' }, goodsIndex: 0
{ label: '问界M5', key: 'm5' }, }
{ label: '问界M7', key: 'm7' }, },
{ label: '问界M9', key: 'm9' }, computed: {
{ label: '奥迪 A6L', key: 'a6l' }, // 将接口 marketingStage 与本地标签配置(文案、图标)合并
{ label: '特斯拉 Model 3', key: 'model3' } activityTypeList() {
], return this.activityProductList.map(item => {
carModelIndex: 0, const stage = Number(item.marketingStage)
goodsIndex: 0, const tab = this.activityTypeTabs.find(t => t.marketingStage === stage)
goodsList: MOCK_GOODS_LIST return {
...item,
marketingStage: stage,
label: tab?.label ?? '',
icon: tab?.icon,
activeIcon: tab?.activeIcon
}
})
},
// 当前活动类型下的原始车型列表(接口数据,不含虚拟 Tab)
carSeriesList() {
return this.activityProductList[this.activityTypeIndex]?.carSeriesList ?? []
},
// 车型标签栏:首位注入「全部车型」,无车型数据时不展示标签栏
carModelTabs() {
if (!this.carSeriesList.length) return []
return [ALL_CAR_SERIES_TAB, ...this.carSeriesList]
},
selectedCarTab() {
return this.carModelTabs[this.carModelIndex] ?? null
},
isAllCarModelSelected() {
return this.selectedCarTab?.carSeriesId === ALL_CAR_SERIES_TAB.carSeriesId
},
// 全部车型:合并当前活动类型下所有 productList;具体车型:取选中项 productList
goodsList() {
const productList = this.isAllCarModelSelected
? this.carSeriesList.flatMap(series => series.productList ?? [])
: (this.selectedCarTab?.productList ?? [])
return productList.map(product => this.mapProductItem(product))
}
},
watch: {
// 接口数据更新时重置选中态,默认回到首个活动类型 + 全部车型
activityProductList() {
this.resetTabSelection()
},
// 切换车型/活动类型后商品数量可能变少,校正选中索引避免越界
goodsList(list) {
if (this.goodsIndex >= list.length) {
this.goodsIndex = 0
}
} }
}, },
methods: { methods: {
resetTabSelection() {
this.activityTypeIndex = 0
this.carModelIndex = 0 // 重置为「全部车型」
this.goodsIndex = 0
},
formatPrice(value) {
if (value === '' || value == null) return ''
const num = Number(value)
return Number.isNaN(num) ? String(value) : num.toFixed(2)
},
// 将接口商品字段映射为展示所需结构,并计算优惠价/原价展示逻辑
mapProductItem(product) {
const discountPrice = product.discountPrice
const currentPrice = product.currentPrice
const hasValidDiscount =
discountPrice !== '' &&
discountPrice != null &&
Number(discountPrice) !== Number(currentPrice)
return {
...product,
id: product.productId,
name: product.tabName || '',
description: product.tabDescription || '',
price: this.formatPrice(hasValidDiscount ? discountPrice : currentPrice),
originalPrice: hasValidDiscount ? this.formatPrice(currentPrice) : '',
isMain: product.isMainPush === 1,
cover: GOODS_COVER
}
},
handleActivityTypeClick(index) { handleActivityTypeClick(index) {
if (this.activityTypeIndex === index) return
this.activityTypeIndex = index this.activityTypeIndex = index
this.carModelIndex = 0 // 切换活动类型后默认选中「全部车型」
this.goodsIndex = 0
}, },
handleCarModelClick(index) { handleCarModelClick(index) {
if (this.carModelIndex === index) return if (this.carModelIndex === index) return
this.carModelIndex = index this.carModelIndex = index
this.goodsIndex = 0
this.$emit('carModelChange', this.carModelTabs[index], index) this.$emit('carModelChange', this.carModelTabs[index], index)
}, },
handleGoodsClick(item, index) { handleGoodsClick(item, index) {
......
...@@ -138,14 +138,14 @@ export default { ...@@ -138,14 +138,14 @@ export default {
methods: { methods: {
handleGoCustomerFiles() { handleGoCustomerFiles() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/customFiles/addFiles', url: '/pages/common/customerPages/addFiles',
animationType: 'pop-in', animationType: 'pop-in',
animationDuration: 100 animationDuration: 100
}) })
}, },
handleGoCustomerDetail(item) { handleGoCustomerDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/customFiles/detailFiles?customerId=${item.id}`, url: `/pages/common/customerPages/detailFiles?customerId=${item.id}`,
animationType: 'pop-in', animationType: 'pop-in',
animationDuration: 100 animationDuration: 100
}) })
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</template> </template>
</view> </view>
<view <view
v-show="homeContentTabIndex === 0" v-show="currentHomeContentTab && currentHomeContentTab.key === 'home'"
class="right-content-box flex right-content-box-scene1" class="right-content-box flex right-content-box-scene1"
> >
<view class="content-left" style="padding-bottom: 40px;"> <view class="content-left" style="padding-bottom: 40px;">
...@@ -102,16 +102,16 @@ ...@@ -102,16 +102,16 @@
</view> </view>
</view> </view>
<!-- 限时产品活动 --> <!-- 限时产品活动 -->
<view v-show="homeContentTabIndex === 1" 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 @entranceClick="entranceClick" /> <ActivityTime :activityProductList="activityProductList" @entranceClick="entranceClick" />
<view class="line"></view> <view class="line"></view>
<CustomerSide /> <CustomerSide />
</view> </view>
</view> </view>
<!-- 挖掘潜客机会 --> <!-- 挖掘潜客机会 -->
<view v-show="homeContentTabIndex === 2" class="right-content-box flex right-content-box-scene1 customer-opportunities-box"> <view v-show="currentHomeContentTab && currentHomeContentTab.key === 'customer'" class="right-content-box flex right-content-box-scene1 customer-opportunities-box">
<customer-opportunities :show="homeContentTabIndex === 2" /> <customer-opportunities :show="currentHomeContentTab && currentHomeContentTab.key === 'customer'" />
</view> </view>
</view> </view>
...@@ -348,12 +348,9 @@ export default { ...@@ -348,12 +348,9 @@ export default {
pointComponentName: 'Point', pointComponentName: 'Point',
// userInfo: {}, // userInfo: {},
tabIndex: 0, tabIndex: 0,
homeContentTabs: [ marketingActivityHasData: false,
{ label: '首页', key: 'home' }, customerListHasData: false,
{ label: '限时产品活动', key: 'activity' }, homeContentTabIndex: 0,
{ label: '挖掘潜客机会', key: 'customer' }
],
homeContentTabIndex: 1,
showBeisen: false, showBeisen: false,
tipsObject: {}, tipsObject: {},
autoplay: true, autoplay: true,
...@@ -384,7 +381,8 @@ export default { ...@@ -384,7 +381,8 @@ export default {
position: 'absolute', position: 'absolute',
top: '-1000px', top: '-1000px',
left: '-1000px' left: '-1000px'
}) }),
activityProductList: []
} }
}, },
beforeDestroy() { beforeDestroy() {
...@@ -446,6 +444,19 @@ export default { ...@@ -446,6 +444,19 @@ export default {
const { sceneType } = uni.$storage.get('userInfo') || {} const { sceneType } = uni.$storage.get('userInfo') || {}
return sceneType return sceneType
}, },
homeContentTabs() {
const tabs = []
if (!this.marketingActivityHasData) {
tabs.push({ label: '首页', key: 'home' })
}
if (this.marketingActivityHasData) {
tabs.push({ label: '限时产品活动', key: 'activity' })
}
if (this.customerListHasData) {
tabs.push({ label: '挖掘潜客机会', key: 'customer' })
}
return tabs
},
currentHomeContentTab() { currentHomeContentTab() {
return this.homeContentTabs[this.homeContentTabIndex] || null return this.homeContentTabs[this.homeContentTabIndex] || null
}, },
...@@ -477,6 +488,8 @@ export default { ...@@ -477,6 +488,8 @@ export default {
* 获取门店场景小分类 * 获取门店场景小分类
*/ */
this.getStoreBaseSceneCodeList() this.getStoreBaseSceneCodeList()
this.getStrategyStatus()
}, },
methods: { methods: {
handleHomeContentTabClick(index) { handleHomeContentTabClick(index) {
...@@ -690,6 +703,76 @@ export default { ...@@ -690,6 +703,76 @@ export default {
this.courseInfo = res this.courseInfo = res
} }
}, },
/**
* 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/
async getStrategyStatus() {
// const res = await uni.$api.activityApi.getActivityStatusAPI()
const res = {
marketingActivityHasData: true,
customerListHasData: true
}
if (!res) return
console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
this.marketingActivityHasData = !!res.marketingActivityHasData
this.customerListHasData = !!res.customerListHasData
this.homeContentTabIndex = 0
// 仅「限时产品活动」Tab 展示时才需拉取营销活动商品列表
if (this.marketingActivityHasData || this.customerListHasData) {
this.getActivityProductList()
}
},
async getActivityProductList() {
// const res = await uni.$api.activityApi.getActivityProductListAPI()
const res = [
{
marketingStage:0,
carSeriesList:[
{
carSeriesId:'0001',
carSeriesName:'问界M5',
productList:[
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',tabDescription:1999,discountPrice:'',endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:9999,thumbImageUrl:'',productId:'',mainImageUrl:''},
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',tabDescription:1999,discountPrice:'',endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:9999,thumbImageUrl:'',productId:'',mainImageUrl:''},
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',tabDescription:1999,discountPrice:'',endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:9999,thumbImageUrl:'',productId:'',mainImageUrl:''}
]
},
{
carSeriesId:'0002',
carSeriesName:'问界M9',
productList:[
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:1999,thumbImageUrl:'',productId:'',mainImageUrl:''},
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:1999,thumbImageUrl:'',productId:'',mainImageUrl:''},
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:1999,thumbImageUrl:'',productId:'',mainImageUrl:''}
]
}
]
},
{
marketingStage:1,
carSeriesList:[
{
carSeriesId:'1001',
carSeriesName:'问界M5',
productList:[
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'',discountPrice:'这是选项卡描述-包含机油更换、机滤、空调滤、空气滤全套服务,活动期间享受8折优惠,先到先得。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:2200,thumbImageUrl:'',productId:'',mainImageUrl:''}
]
},
{
carSeriesId:'1002',
carSeriesName:'问界M7',
productList:[
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'',tabDescription:'这是选项卡描述-包含机油更换、机滤、空调滤、空气滤全套服务,活动期间享受8折优惠,先到先得。',discountPrice:1899,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:2100,thumbImageUrl:'',productId:'',mainImageUrl:''}
]
}
]
}
]
this.activityProductList = res
// console.log('查询当前进行中的营销活动商品列表:', res)
},
handleFooter(val) { handleFooter(val) {
this.footerBox = val this.footerBox = val
}, },
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1 const index = 2
/** /**
* *
0本地 0本地
......
...@@ -161,13 +161,13 @@ ...@@ -161,13 +161,13 @@
} }
}, },
{ {
"path": "pages/common/customFiles/addFiles", "path": "pages/common/customerPages/addFiles",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/common/customFiles/detailFiles", "path": "pages/common/customerPages/detailFiles",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
......
...@@ -21,9 +21,10 @@ ...@@ -21,9 +21,10 @@
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]" :class="['input', { error: i.error }]"
placeholder="请选择" :placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);" placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done" confirm-type="done"
@blur="inputBlur($event, i)"
/> />
</template> </template>
<template v-else-if="i.type == 'date'"> <template v-else-if="i.type == 'date'">
...@@ -36,8 +37,12 @@ ...@@ -36,8 +37,12 @@
:value="customerInfo[i.valueKey]" :value="customerInfo[i.valueKey]"
> >
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"> <view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view> </view>
</picker> </picker>
</template> </template>
...@@ -46,7 +51,7 @@ ...@@ -46,7 +51,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]" :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)" @click="showPopup(i.popKey)"
> >
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view> </view>
</template> </template>
...@@ -66,9 +71,10 @@ ...@@ -66,9 +71,10 @@
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]" :class="['input', { error: i.error }]"
placeholder="请选择" :placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);" placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done" confirm-type="done"
@blur="inputBlur($event, i)"
/> />
</template> </template>
<template v-else-if="i.type == 'date'"> <template v-else-if="i.type == 'date'">
...@@ -81,8 +87,12 @@ ...@@ -81,8 +87,12 @@
:value="customerInfo[i.valueKey]" :value="customerInfo[i.valueKey]"
> >
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"> <view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view> </view>
</picker> </picker>
</template> </template>
...@@ -114,11 +124,6 @@ ...@@ -114,11 +124,6 @@
carModelKey="brandModel" carModelKey="brandModel"
customBoolean customBoolean
/> />
<customer-tags
ref="customerTagstVisible"
@select="handleSelect($event, 'customerTagstVisible')"
:chooseList="tagsList"
></customer-tags>
<reception-sence <reception-sence
ref="receptionSceneVisible" ref="receptionSceneVisible"
@select="handleSelect($event, 'receptionSceneVisible')" @select="handleSelect($event, 'receptionSceneVisible')"
...@@ -144,9 +149,9 @@ ...@@ -144,9 +149,9 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import CustomerTags from '@/components/HomeFrame/components/ReceptionCenter/CustomerTags.vue'
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue' import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue'
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import { validateVin, formatVinInput } from '@/utils/vinVaildate'
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{ default_customerForm = [{
...@@ -177,11 +182,20 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -177,11 +182,20 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible' popKey: 'carBrandVisible'
}, },
{ {
label: '流量来源',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
required: true,
popKey: 'residentSaleVisible'
},
{
label: '交付日期', label: '交付日期',
valueKey: 'arrivalDate', valueKey: 'arrivalDate',
key: 'arrivalDate', key: 'arrivalDate',
required: true,
type: 'date' type: 'date'
}, }
// { // {
// label: '接待场景', // label: '接待场景',
// valueKey: 'receptionSceneName', // valueKey: 'receptionSceneName',
...@@ -189,15 +203,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -189,15 +203,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
// type: 'select', // type: 'select',
// required: true, // required: true,
// popKey: 'receptionSceneVisible' // popKey: 'receptionSceneVisible'
// }, // }
{ ],
label: '流量来源',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
}],
default_optionalForm = [{ default_optionalForm = [{
label: '车架号', label: '车架号',
valueKey: 'standNo', valueKey: 'standNo',
...@@ -213,22 +220,21 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -213,22 +220,21 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
type: 'date' type: 'date'
}, },
{ {
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
},{
label: '驻店零售', label: '驻店零售',
valueKey: 'residentSaleName', valueKey: 'residentSaleName',
key: 'residentSaleId', key: 'residentSaleId',
type: 'select', type: 'select',
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
}] }]
export default { export default {
name: 'AddFiles', name: 'AddFiles',
components: { CarBrands, CustomerTags, ReceptionSence, Employee }, components: { CarBrands, ReceptionSence, Employee },
computed: { computed: {
check () { check () {
let { customerForm, customerInfo } = this, let { customerForm, customerInfo } = this,
...@@ -241,19 +247,6 @@ export default { ...@@ -241,19 +247,6 @@ export default {
result = error result = error
} }
return result return result
},
tagsList () {
let list = [],
{ customerInfo, customerTag } = this,
names = customerInfo.customerTagName ? customerInfo.customerTagName.split('|') : [],
isd = customerTag ? customerTag.split(',') : []
names.map((e, index) => {
list.push({
labelName: e,
labelId: isd[index]
})
})
return list
} }
}, },
data () { data () {
...@@ -264,7 +257,7 @@ export default { ...@@ -264,7 +257,7 @@ export default {
customerInfo: {}, customerInfo: {},
startDate: '', startDate: '',
endDate: '', endDate: '',
customerTag: '' validateState: true
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -289,7 +282,6 @@ export default { ...@@ -289,7 +282,6 @@ export default {
brandModel: '', brandModel: '',
receptionScene: '', receptionScene: '',
arrivalDate: '', arrivalDate: '',
customerTagName: '',
receptionSceneName: '', receptionSceneName: '',
standNo: '', standNo: '',
residentSaleName: '', residentSaleName: '',
...@@ -302,8 +294,6 @@ export default { ...@@ -302,8 +294,6 @@ export default {
const res = await uni.$api.customerApi.findVisitsInfo({ const res = await uni.$api.customerApi.findVisitsInfo({
id: this.customerId id: this.customerId
}) })
if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|')
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD") if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD") if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res this.customerInfo = res
...@@ -330,15 +320,6 @@ export default { ...@@ -330,15 +320,6 @@ export default {
oneCarBrand: item.carBrand, oneCarBrand: item.carBrand,
oneCarBrandId: item.carBrandId oneCarBrandId: item.carBrandId
}) })
} else if (popkey == 'customerTagstVisible') {
let names = [],
ids = []
item.map(i => {
names.push(i.labelName)
ids.push(i.labelId)
})
this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',')
} else if (popkey == 'residentSaleVisible') { } else if (popkey == 'residentSaleVisible') {
this.customerInfo.residentSaleName = item.staffName this.customerInfo.residentSaleName = item.staffName
this.customerInfo.residentSaleId = item.uuid this.customerInfo.residentSaleId = item.uuid
...@@ -350,17 +331,50 @@ export default { ...@@ -350,17 +331,50 @@ export default {
bindDateChange (e, valueKey) { bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value this.customerInfo[valueKey] = e.detail.value
}, },
inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo
if (val.key === 'standNo' && standNoVal) {
this.customerInfo.standNo = formatVinInput(standNoVal)
validateVin(this.customerInfo.standNo)
.then(result => {
const { valid } = result.data
this.validateState = valid
})
.catch(() => {
this.validateState = false
})
} else if (val.key === 'standNo') {
this.validateState = true
}
},
async submit () { async submit () {
if (this.check) return if (this.check) return
const carVin = this.customerInfo.standNo
if (carVin) {
this.customerInfo.standNo = formatVinInput(carVin)
if (this.customerInfo.standNo.length !== 17) {
uni.showToast({
title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)',
icon: 'none'
})
return
}
if (!this.validateState) {
uni.showToast({
title: '车架号校验不匹配,请核对后重新输入',
icon: 'none'
})
return
}
}
try { try {
this.customerForm.map(e => { this.customerForm.map(e => {
e.error = false e.error = false
}) })
let { customerInfo, customerForm, optionalForm, customerTag } = 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 ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = { params = {
customerTag,
merchantId: shopMerchantId, merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 bussinessScene: sceneType == 0 ? 1 : 2
} }
...@@ -379,7 +393,6 @@ export default { ...@@ -379,7 +393,6 @@ export default {
oneCarBrand: customerInfo.oneCarBrand, oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId oneCarBrandId: customerInfo.oneCarBrandId
}) })
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
...@@ -547,6 +560,13 @@ export default { ...@@ -547,6 +560,13 @@ export default {
flex-shrink: 0; flex-shrink: 0;
} }
.calendar-icon {
width: 16px;
height: 16px;
margin-left: auto;
flex-shrink: 0;
}
.error { .error {
border: toRpx(2) solid #f24724 !important; border: toRpx(2) solid #f24724 !important;
} }
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
}, },
}, },
onLoad(options) { onLoad(options) {
const defaultUrl = 'http://192.168.1.68:3001/gl-agent-position/?demo=prelearn-bridge' 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('[prelearn bridge demo] open url:', this.webviewUrl) console.log('[prelearn bridge demo] open url:', this.webviewUrl)
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!