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 = {
...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 = {
...data,
})
},
/**
* 查询门店分类
*
......@@ -720,4 +719,24 @@ module.exports = {
...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 = {
...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 @@
<!-- 活动类型标签栏 -->
<view class="type-box">
<view
v-for="(item, index) in activityTypeTabs"
:key="item.key"
v-for="(item, index) in activityTypeList"
:key="item.marketingStage"
:class="['type-tag-item', { active: activityTypeIndex === index }]"
@click="handleActivityTypeClick(index)"
>
......@@ -21,11 +21,11 @@
<view class="car-list-inner">
<view
v-for="(item, index) in carModelTabs"
:key="item.key"
:key="item.carSeriesId || 'all'"
:class="['car-item', { active: carModelIndex === index }]"
@click="handleCarModelClick(index)"
>
{{ item.label }}
{{ item.carSeriesName }}
</view>
</view>
</scroll-view>
......@@ -81,74 +81,139 @@ import Entrance from '@/components/Entrance.vue'
const GOODS_COVER = require('@/assets/images/common/goods-activity-cover.png')
const MOCK_GOODS_LIST = [
{
id: 1,
name: '这是活动商品/套餐限时保养套餐限时保养套餐',
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 }))
/** 前端虚拟 Tab:接口 carSeriesList 不含此项,仅用于 UI 展示「全部车型」 */
const ALL_CAR_SERIES_TAB = {
carSeriesId: '__ALL__',
carSeriesName: '全部车型'
}
export default {
name: 'ActivityTime',
components: {
Entrance
},
props: {
/** 营销活动商品列表,结构:[{ marketingStage, carSeriesList: [{ carSeriesId, carSeriesName, productList }] }] */
activityProductList: {
type: Array,
default: () => []
}
},
data() {
return {
// 活动类型本地配置:marketingStage 与接口字段对应,补充文案与图标
activityTypeTabs: [
{
label: '新享特惠',
key: 'preSale',
marketingStage: 0,
icon: require('@/assets/images/common/activity-type-preSale.png'),
activeIcon: require('@/assets/images/common/activity-type-preSale-active.png')
},
{
label: '售后钜惠',
key: 'afterSale',
marketingStage: 1,
icon: require('@/assets/images/common/activity-type-afterSale.png'),
activeIcon: require('@/assets/images/common/activity-type-afterSale-active.png')
}
],
activityTypeIndex: 0,
carModelTabs: [
{ label: '全部车型', key: 'all' },
{ label: '问界M5', key: 'm5' },
{ label: '问界M7', key: 'm7' },
{ label: '问界M9', key: 'm9' },
{ label: '奥迪 A6L', key: 'a6l' },
{ label: '特斯拉 Model 3', key: 'model3' }
],
carModelIndex: 0,
goodsIndex: 0,
goodsList: MOCK_GOODS_LIST
carModelIndex: 0, // 0 对应「全部车型」,切换活动类型或数据刷新时重置至此
goodsIndex: 0
}
},
computed: {
// 将接口 marketingStage 与本地标签配置(文案、图标)合并
activityTypeList() {
return this.activityProductList.map(item => {
const stage = Number(item.marketingStage)
const tab = this.activityTypeTabs.find(t => t.marketingStage === stage)
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: {
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) {
if (this.activityTypeIndex === index) return
this.activityTypeIndex = index
this.carModelIndex = 0 // 切换活动类型后默认选中「全部车型」
this.goodsIndex = 0
},
handleCarModelClick(index) {
if (this.carModelIndex === index) return
this.carModelIndex = index
this.goodsIndex = 0
this.$emit('carModelChange', this.carModelTabs[index], index)
},
handleGoodsClick(item, index) {
......
......@@ -138,14 +138,14 @@ export default {
methods: {
handleGoCustomerFiles() {
uni.navigateTo({
url: '/pages/common/customFiles/addFiles',
url: '/pages/common/customerPages/addFiles',
animationType: 'pop-in',
animationDuration: 100
})
},
handleGoCustomerDetail(item) {
uni.navigateTo({
url: `/pages/common/customFiles/detailFiles?customerId=${item.id}`,
url: `/pages/common/customerPages/detailFiles?customerId=${item.id}`,
animationType: 'pop-in',
animationDuration: 100
})
......
......@@ -70,7 +70,7 @@
</template>
</view>
<view
v-show="homeContentTabIndex === 0"
v-show="currentHomeContentTab && currentHomeContentTab.key === 'home'"
class="right-content-box flex right-content-box-scene1"
>
<view class="content-left" style="padding-bottom: 40px;">
......@@ -102,16 +102,16 @@
</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">
<ActivityTime @entranceClick="entranceClick" />
<ActivityTime :activityProductList="activityProductList" @entranceClick="entranceClick" />
<view class="line"></view>
<CustomerSide />
</view>
</view>
<!-- 挖掘潜客机会 -->
<view v-show="homeContentTabIndex === 2" class="right-content-box flex right-content-box-scene1 customer-opportunities-box">
<customer-opportunities :show="homeContentTabIndex === 2" />
<view v-show="currentHomeContentTab && currentHomeContentTab.key === 'customer'" class="right-content-box flex right-content-box-scene1 customer-opportunities-box">
<customer-opportunities :show="currentHomeContentTab && currentHomeContentTab.key === 'customer'" />
</view>
</view>
......@@ -348,12 +348,9 @@ export default {
pointComponentName: 'Point',
// userInfo: {},
tabIndex: 0,
homeContentTabs: [
{ label: '首页', key: 'home' },
{ label: '限时产品活动', key: 'activity' },
{ label: '挖掘潜客机会', key: 'customer' }
],
homeContentTabIndex: 1,
marketingActivityHasData: false,
customerListHasData: false,
homeContentTabIndex: 0,
showBeisen: false,
tipsObject: {},
autoplay: true,
......@@ -384,7 +381,8 @@ export default {
position: 'absolute',
top: '-1000px',
left: '-1000px'
})
}),
activityProductList: []
}
},
beforeDestroy() {
......@@ -446,6 +444,19 @@ export default {
const { sceneType } = uni.$storage.get('userInfo') || {}
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() {
return this.homeContentTabs[this.homeContentTabIndex] || null
},
......@@ -477,6 +488,8 @@ export default {
* 获取门店场景小分类
*/
this.getStoreBaseSceneCodeList()
this.getStrategyStatus()
},
methods: {
handleHomeContentTabClick(index) {
......@@ -690,6 +703,76 @@ export default {
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) {
this.footerBox = val
},
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1
const index = 2
/**
*
0本地
......
......@@ -161,13 +161,13 @@
}
},
{
"path": "pages/common/customFiles/addFiles",
"path": "pages/common/customerPages/addFiles",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/customFiles/detailFiles",
"path": "pages/common/customerPages/detailFiles",
"style": {
"navigationStyle": "custom"
}
......
......@@ -21,9 +21,10 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
/>
</template>
<template v-else-if="i.type == 'date'">
......@@ -36,8 +37,12 @@
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
<view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view>
</picker>
</template>
......@@ -46,7 +51,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@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>
</view>
</template>
......@@ -66,9 +71,10 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
/>
</template>
<template v-else-if="i.type == 'date'">
......@@ -81,8 +87,12 @@
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
<view class="value text-hide">{{ customerInfo[i.valueKey] || `请选择${i.label}` }}</view>
<image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view>
</picker>
</template>
......@@ -114,11 +124,6 @@
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
@select="handleSelect($event, 'customerTagstVisible')"
:chooseList="tagsList"
></customer-tags>
<reception-sence
ref="receptionSceneVisible"
@select="handleSelect($event, 'receptionSceneVisible')"
......@@ -144,9 +149,9 @@
<script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs'
import CustomerTags from '@/components/HomeFrame/components/ReceptionCenter/CustomerTags.vue'
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue'
import Employee from '@/components/Employee.vue'
import { validateVin, formatVinInput } from '@/utils/vinVaildate'
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{
......@@ -177,11 +182,20 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
popKey: 'carBrandVisible'
},
{
label: '流量来源',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
required: true,
popKey: 'residentSaleVisible'
},
{
label: '交付日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
required: true,
type: 'date'
},
}
// {
// label: '接待场景',
// valueKey: 'receptionSceneName',
......@@ -189,15 +203,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
// type: 'select',
// required: true,
// popKey: 'receptionSceneVisible'
// },
{
label: '流量来源',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
}],
// }
],
default_optionalForm = [{
label: '车架号',
valueKey: 'standNo',
......@@ -213,22 +220,21 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
type: 'date'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
},{
label: '驻店零售',
valueKey: 'residentSaleName',
key: 'residentSaleId',
type: 'select',
popKey: 'residentSaleVisible'
},
{
label: '建档日期',
valueKey: 'filingDate',
key: 'filingDate',
type: 'date'
}]
export default {
name: 'AddFiles',
components: { CarBrands, CustomerTags, ReceptionSence, Employee },
components: { CarBrands, ReceptionSence, Employee },
computed: {
check () {
let { customerForm, customerInfo } = this,
......@@ -241,19 +247,6 @@ export default {
result = error
}
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 () {
......@@ -264,7 +257,7 @@ export default {
customerInfo: {},
startDate: '',
endDate: '',
customerTag: ''
validateState: true
}
},
onLoad (options) {
......@@ -289,7 +282,6 @@ export default {
brandModel: '',
receptionScene: '',
arrivalDate: '',
customerTagName: '',
receptionSceneName: '',
standNo: '',
residentSaleName: '',
......@@ -302,8 +294,6 @@ export default {
const res = await uni.$api.customerApi.findVisitsInfo({
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.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res
......@@ -330,15 +320,6 @@ export default {
oneCarBrand: item.carBrand,
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') {
this.customerInfo.residentSaleName = item.staffName
this.customerInfo.residentSaleId = item.uuid
......@@ -350,17 +331,50 @@ export default {
bindDateChange (e, valueKey) {
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 () {
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 {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, optionalForm, customerTag } = this,
let { customerInfo, customerForm, optionalForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = {
customerTag,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2
}
......@@ -379,7 +393,6 @@ export default {
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
......@@ -547,6 +560,13 @@ export default {
flex-shrink: 0;
}
.calendar-icon {
width: 16px;
height: 16px;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
}
......
......@@ -125,7 +125,7 @@ export default {
},
},
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
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!