Commit d177e970 by 李伟康

commit 提交

1 parent 94f0107d
...@@ -148,7 +148,8 @@ export default { ...@@ -148,7 +148,8 @@ export default {
customerType: { customerType: {
type: Number, type: Number,
default: 1 default: 1
} },
titleTips: String
}, },
data () { data () {
return { return {
...@@ -218,8 +219,8 @@ export default { ...@@ -218,8 +219,8 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
tips () { tips () {
let { sceneType } = this, let { sceneType, titleTips } = this,
text = '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。' text = titleTips || '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。'
if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。' if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。'
return text return text
} }
...@@ -381,7 +382,7 @@ export default { ...@@ -381,7 +382,7 @@ export default {
} }
.required { .required {
&::before { &::before {
content: "*"; content: '*';
color: #ff0000; color: #ff0000;
position: absolute; position: absolute;
left: -20rpx; left: -20rpx;
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
key: 'newCarFare', key: 'newCarFare',
type: 'input', type: 'input',
inputType: 'digit', inputType: 'digit',
maxlength: 9, maxlength: 10,
unit: '元', unit: '元',
}, },
], ],
...@@ -165,10 +165,10 @@ export default { ...@@ -165,10 +165,10 @@ export default {
if (e?.currentTarget && e?.target) { if (e?.currentTarget && e?.target) {
const { key } = e.currentTarget.dataset const { key } = e.currentTarget.dataset
if (key == 'newCarFare') { if (key == 'newCarFare') {
let value = Number(e.target.value >= 999999 ? 999999 : e.target.value) let value = Number(e.target.value) >= 9999999 ? 9999999 : e.target.value
// 判断是否为整数 // 判断是否为整数
if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1') if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
this.customerInfo[key] = Number(value).toFixed(2) ? value > 0 ? value : '' : '' this.customerInfo[key] = Number(value).toFixed(2) ? value >= 0 ? value : '' : ''
this.inputCustomer() this.inputCustomer()
} }
} }
......
...@@ -176,9 +176,9 @@ export default { ...@@ -176,9 +176,9 @@ export default {
handleInput (event) { handleInput (event) {
let value = event.target.value, let value = event.target.value,
{ index } = event.currentTarget.dataset { index } = event.currentTarget.dataset
value = Number(value > 999999 ? 999999 : value) value = Number(value) > 999999 ? 999999 : value
// 使用正则表达式来限制小数点后的位数 if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
this.insuranceList[index].cost = Number(value).toFixed(2) > 0 ? String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1') : '' this.insuranceList[index].cost = Number(value).toFixed(2) ? value >= 0 ? value : '' : ''
}, },
defaultBlock (item) { defaultBlock (item) {
return item.main == '交强险' ? (this.isPreview ? 'has-default' : item.show ? 'has-default' : '') : '' return item.main == '交强险' ? (this.isPreview ? 'has-default' : item.show ? 'has-default' : '') : ''
...@@ -216,8 +216,8 @@ export default { ...@@ -216,8 +216,8 @@ export default {
this.setInsuranceList(storageKey, list || []) this.setInsuranceList(storageKey, list || [])
} }
else { else {
const { insuranceList } = this, let { insuranceList } = this,
combinedList = [...insuranceList, ...list] combinedList = [...insuranceList, ...list]
const deduplicatedList = combinedList.reduce((acc, item) => { const deduplicatedList = combinedList.reduce((acc, item) => {
const existingItem = acc.find(existing => String(existing.id) === String(item.id)); const existingItem = acc.find(existing => String(existing.id) === String(item.id));
if (existingItem) { if (existingItem) {
...@@ -227,7 +227,12 @@ export default { ...@@ -227,7 +227,12 @@ export default {
} else acc.push(item) } else acc.push(item)
return acc; return acc;
}, []) }, [])
this.setInsuranceList(storageKey, deduplicatedList) let arr = []
deduplicatedList.map(e =>{
let index = list.findIndex(item => String(item.id) === String(e.id))
if(index != -1) arr.push(e)
})
this.setInsuranceList(storageKey, arr)
} }
} catch (error) { } catch (error) {
this.flag = true this.flag = true
......
...@@ -72,59 +72,72 @@ export default { ...@@ -72,59 +72,72 @@ export default {
}, },
// 选择场景 // 选择场景
async selectScene ({ sceneType }, index) { async selectScene ({ sceneType }, index) {
let { sceneList, openSceneArr, userInfo } = this let { sceneList, openSceneArr, userInfo } = this
if (!openSceneArr.includes(sceneType) && !userInfo?.isSuper) return uni.showToast({ try {
title: '暂未开通此场景', if (!openSceneArr.includes(sceneType) && !userInfo?.isSuper) return uni.showToast({
icon: 'none' title: '暂未开通此场景',
}) icon: 'none'
sceneList.map(i => (i.actived = false)) })
sceneList[index].actived = true sceneList.map(i => (i.actived = false))
this.sceneList = sceneList sceneList[index].actived = true
userInfo.sceneType = sceneType this.sceneList = sceneList
uni.showLoading({ userInfo.sceneType = sceneType
mask: true uni.showLoading({
}) mask: true
if (userInfo?.isSuper) this.jump(userInfo) })
else { if (userInfo?.isSuper) this.jump(userInfo)
try { else {
const data = await uni.$api.userApi.selectMerchantScene({ const data = await uni.$api.userApi.selectMerchantScene({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName, merchantName: userInfo.shopMerchantName,
sceneType sceneType
}) })
if (data) this.jump(userInfo, data) if (data) this.jump(userInfo, data)
} catch (error) { else {
uni.hideLoading() this.$sendSentry(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},接口返回:${JSON.stringify(data || '')}`)
uni.showToast({ }
title: error,
icon: 'none'
})
} }
} catch (error) {
this.$sendSentry(`选择场景异常:merchantId:${userInfo.shopMerchantId},merchantName:${userInfo.shopMerchantName},sceneType:${sceneType},失败原因:${JSON.stringify(error)}`)
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none'
})
console.log(error)
} }
}, },
async jump (userInfo, data) { async jump (userInfo, data) {
uni.hideLoading() try {
if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant uni.hideLoading()
let { shopMerchantId } = userInfo if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant
//调接口获取门店主营品牌 let { shopMerchantId } = userInfo
uni.showLoading({ //调接口获取门店主营品牌
mask: true uni.showLoading({
}) mask: true
const res = await uni.$api.userApi.getMerchantBrand({ })
merchantId: shopMerchantId const res = await uni.$api.userApi.getMerchantBrand({
}) merchantId: shopMerchantId
uni.hideLoading() })
userInfo.channelType = res.channelType || 1 // 默认1 1问界 2 比亚迪 3 其他 uni.hideLoading()
// userInfo.channelType = 3 userInfo.channelType = res.channelType || 1 // 默认1 1问界 2 比亚迪 3 其他
uni.$storage.set('userInfo', userInfo) // userInfo.channelType = 3
let url = { uni.$storage.set('userInfo', userInfo)
1: '/pages/boutique/index', let url = {
0: '/pages/equity/index' 1: '/pages/boutique/index',
}[userInfo.sceneType] 0: '/pages/equity/index'
uni.reLaunch({ }[userInfo.sceneType]
url uni.reLaunch({
}) url
})
} catch (error) {
this.$sendSentry(`选择场景后跳转异常:${error}`)
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none'
})
}
} }
} }
} }
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<finish-step <finish-step
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
:titleTips="finishTips"
/> />
<informationEntry <informationEntry
:showPayPage.sync="showPayPage" :showPayPage.sync="showPayPage"
...@@ -139,6 +140,12 @@ export default { ...@@ -139,6 +140,12 @@ export default {
name = this.media.find((e) => e.id == id)?.detailTitle || "" name = this.media.find((e) => e.id == id)?.detailTitle || ""
return name; return name;
}, },
finishTips(){
const {channelType} = uni.$storage.get("userInfo")
let text = ''
if(channelType != 1) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。'
return text
}
}, },
watch: { watch: {
watchStatus: { watchStatus: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!