Commit 36f8c454 by 前端

Merge branch 'SAAS+V5.5.1' into 'SAAS+V5.5.2'

开发提测合并

See merge request !56
2 parents bb80b812 dcd5b583
...@@ -238,5 +238,15 @@ module.exports = { ...@@ -238,5 +238,15 @@ module.exports = {
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`) .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
.join('&') .join('&')
return gscPost(`/evalOrder/apiRegion/search${queryString ? '?' + queryString : ''}`, { ...data }, { returnAll: true }) return gscPost(`/evalOrder/apiRegion/search${queryString ? '?' + queryString : ''}`, { ...data }, { returnAll: true })
},
/** 撤销合同 */
revokeSaleContract(data) {
return gscPost(
`/evalOrder/revokeSaleContract`,
{
...data
},
{ returnAll: true }
)
} }
} }
...@@ -3,22 +3,19 @@ module.exports = { ...@@ -3,22 +3,19 @@ module.exports = {
gscPost: (url, data, _config = {}) => { gscPost: (url, data, _config = {}) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.getNetworkType({ uni.getNetworkType({
success (res) { success(res) {
if (['none'].includes(res.networkType)) { if (['none'].includes(res.networkType)) {
uni.hideLoading(); uni.hideLoading()
uni.showToast({ uni.showToast({
title: '网络异常', title: '网络异常',
icon: "none", icon: 'none'
}); })
return; return
} }
if (!uni.$signHttp) uni.$signHttp = new Request(uni.signHttpConfig) if (!uni.$signHttp) uni.$signHttp = new Request(uni.signHttpConfig)
data.source = 1
resolve(uni.$signHttp.post(url, data, _config)) resolve(uni.$signHttp.post(url, data, _config))
} }
}) })
}) })
} }
} }

2.94 MB | W: | H:

2.94 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3 const index = 2
/** /**
* *
0本地 0本地
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.19.0", "versionName" : "2.20.0",
"versionCode" : 2190, "versionCode" : 2200,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
...@@ -68,8 +68,10 @@ ...@@ -68,8 +68,10 @@
"ad" : {}, "ad" : {},
"speech" : {}, "speech" : {},
"geolocation" : { "geolocation" : {
"system" : { "baidu" : {
"__platform__" : [ "ios", "android" ] "__platform__" : [ "android" ],
"appkey_ios" : "",
"appkey_android" : "rfN7u5gCi0KyCGIWWBYGXlmKrVQsKH8z"
} }
} }
}, },
......
...@@ -32,6 +32,21 @@ ...@@ -32,6 +32,21 @@
> >
<view :class="['label',{required:i.required}]">{{ i.label }}</view> <view :class="['label',{required:i.required}]">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) && i.required },{disabled: pageParams.received}]"> <view :class="['value', { error: showError(i.key) && i.required },{disabled: pageParams.received}]">
<template v-if="i.addHtml">
<view
:class="['select', `${pageParams.carInfo[i.key]? '' : 'placeholder'}`]"
@click="showPopup(i.popKey)"
:key="selectKey"
>
{{ pageParams.carInfo[i.key] || i.placeholder }}
<uni-icons
class="arrow"
type="down"
:size="16"
></uni-icons>
</view>
</template>
<template v-else>
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input <input
:type="i.inputType" :type="i.inputType"
...@@ -61,6 +76,7 @@ ...@@ -61,6 +76,7 @@
<template v-else> <template v-else>
<view class="text">{{ customerInfo[i.key] }}</view> <view class="text">{{ customerInfo[i.key] }}</view>
</template> </template>
</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -77,7 +93,14 @@ ...@@ -77,7 +93,14 @@
:key="idx" :key="idx"
> >
<view class="label">{{ j.label }}</view> <view class="label">{{ j.label }}</view>
<view class="value-text">{{ customerInfo[j.key] || '--'}}</view> <view class="value-text">
<template v-if="j.addHtml">
{{ pageParams.carInfo[j.key] || '--'}}
</template>
<template v-else>
{{ customerInfo[j.key] || '--'}}
</template>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -147,6 +170,11 @@ ...@@ -147,6 +170,11 @@
>生成专属二维码</view> >生成专属二维码</view>
</view> </view>
</MessageBox> </MessageBox>
<car-brands
:linkage="false"
ref="carBrandListVisible"
@select="handleSelect($event, 'carBrandListVisible')"
/>
<employee <employee
ref="employeeBoxVisible" ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')" @select="handleSelect($event,'employeeBoxVisible')"
...@@ -179,6 +207,8 @@ ...@@ -179,6 +207,8 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import qrcode from '@/utils/qrcode.js' import qrcode from '@/utils/qrcode.js'
import CarBrands from '@/components/CarBrands.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/; const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import dayjs from 'dayjs' import dayjs from 'dayjs'
const formObject_boutique = [{ const formObject_boutique = [{
...@@ -201,10 +231,12 @@ const formObject_boutique = [{ ...@@ -201,10 +231,12 @@ const formObject_boutique = [{
}, },
{ {
label: "品牌车型", label: "品牌车型",
key: "carModel", type: "select",
type: "text",
popKey: "carBrandListVisible", popKey: "carBrandListVisible",
placeholder: '请选择车型' placeholder: '请选择车型',
addHtml: 'carbrand',
key: 'name',
required: true
}, },
{ {
label: "交付专员", label: "交付专员",
...@@ -233,12 +265,22 @@ export default { ...@@ -233,12 +265,22 @@ export default {
title: String, title: String,
tips: String tips: String
}, },
components: { Employee }, components: { Employee, CarBrands },
watch: { watch: {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.customerInfo = Object.assign(this.customerInfo, newval) this.customerInfo = Object.assign(this.customerInfo, newval)
if (newval.carModel) {
this.pageParams.carInfo = {
carChildsBrandId: newval.carChildsBrandId,
carChildsBrandName: newval.carChildsBrandName,
carBrandId: newval.carBrandId,
carBrand: newval.carBrand,
id: newval.carSeriesId,
name: newval.carModel
}
}
try { try {
// 监听完成接待修改数据,同步修改生成优惠券按钮状态 // 监听完成接待修改数据,同步修改生成优惠券按钮状态
const { customerName, phoneNumber, staffName } = this.customerInfo const { customerName, phoneNumber, staffName } = this.customerInfo
...@@ -268,6 +310,21 @@ export default { ...@@ -268,6 +310,21 @@ export default {
}, },
show () { show () {
this.closeAllPopup() this.closeAllPopup()
},
carInfo: {
handler (newval) {
console.log(newval, '===')
this.pageParams.carInfo = {
carChildsBrandId: newval.carChildsBrandId,
carChildsBrandName: newval.carChildsBrandName,
carBrandId: newval.carBrandId,
carBrand: newval.carBrand,
id: newval.id,
name: newval.name
}
},
deep: true,
immediate: true
} }
}, },
computed: { computed: {
...@@ -419,11 +476,18 @@ export default { ...@@ -419,11 +476,18 @@ export default {
if (popkey == "employeeBoxVisible") { if (popkey == "employeeBoxVisible") {
this.customerInfo.salesUuid = item.uuid; this.customerInfo.salesUuid = item.uuid;
this.customerInfo.staffName = item.staffName; this.customerInfo.staffName = item.staffName;
this.$store.dispatch("setCustomerInfo", this.customerInfo);
} else { } else {
this.$refs.carBrandListVisible.close(); this.$refs.carBrandListVisible.close();
this.customerInfo.carModel = item.name; this.pageParams.carInfo = {
carChildsBrandId: item.carChildsBrandId,
carChildsBrandName: item.carChildsBrandName,
carBrandId: item.carBrandId,
carBrand: item.carBrand,
id: item.id,
name: item.name
}
} }
this.$store.dispatch("setCustomerInfo", this.customerInfo);
this.selectKey = Date.now() this.selectKey = Date.now()
const { customerName, phoneNumber, staffName } = this.customerInfo const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName this.isCheck = customerName && phoneNumber && staffName
...@@ -455,7 +519,7 @@ export default { ...@@ -455,7 +519,7 @@ export default {
if (this.pageParams.received) return if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况 if (!this.isCheck) return // 按钮置灰的情况
try { try {
const { pageParams: { clickFlag, couponId }, carInfo, customerInfo } = this, { const { pageParams: { clickFlag, couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo"), shopMerchantId } = uni.$storage.get("userInfo"),
validateStatus = await this.validate(), validateStatus = await this.validate(),
checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId]) checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId])
...@@ -512,7 +576,7 @@ export default { ...@@ -512,7 +576,7 @@ export default {
try { try {
this.pageParams.received = false this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => { this.pageParams.qrTimer = setInterval(async () => {
const { pageParams: { couponId }, customerInfo } = this, const { pageParams: { couponId ,carInfo }, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({ res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId, merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber, customerPhone: customerInfo.phoneNumber,
...@@ -524,7 +588,7 @@ export default { ...@@ -524,7 +588,7 @@ export default {
this.$emit('reception', { this.$emit('reception', {
item: { item: {
customerName: customerInfo.customerName, customerName: customerInfo.customerName,
carSeriesName: customerInfo.carModel, carSeriesName: carInfo.name,
customerPhone: customerInfo.phoneNumber, customerPhone: customerInfo.phoneNumber,
userId: customerInfo.salesUuid, userId: customerInfo.salesUuid,
employeeName: customerInfo.staffName, employeeName: customerInfo.staffName,
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
ref="futureCalendar" ref="futureCalendar"
:insert="false" :insert="false"
:clearDate="false" :clearDate="false"
:startDate="endDate" :startDate="startDate"
@confirm="confirmCalendar($event,'effectiveDate')" @confirm="confirmCalendar($event,'effectiveDate')"
:date="orderObj.effectiveDate" :date="orderObj.effectiveDate"
showBottomBtn showBottomBtn
...@@ -173,6 +173,7 @@ export default { ...@@ -173,6 +173,7 @@ export default {
formList: utils.deepClone(EQUITY_FORM_LIST), formList: utils.deepClone(EQUITY_FORM_LIST),
titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST), titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST),
endDate: dayjs().format('YYYY-MM-DD'), endDate: dayjs().format('YYYY-MM-DD'),
startDate: dayjs().add(1, 'day').format('YYYY-MM-DD'),
equityFormRule: utils.deepClone(EQUITY_FORM_RULE), equityFormRule: utils.deepClone(EQUITY_FORM_RULE),
orderObj: {}, orderObj: {},
loadComplete: false, loadComplete: false,
...@@ -232,7 +233,6 @@ export default { ...@@ -232,7 +233,6 @@ export default {
if (i.value == val.value) i.current = e.detail.value if (i.value == val.value) i.current = e.detail.value
}) })
}) })
this.viewKey = Date.now()
}, },
handleCell (val) { handleCell (val) {
if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open() if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open()
...@@ -246,16 +246,13 @@ export default { ...@@ -246,16 +246,13 @@ export default {
Object.assign(this.orderObj, chooseContent) Object.assign(this.orderObj, chooseContent)
this.$set(this.orderObj, 'carBrandText', this.$set(this.orderObj, 'carBrandText',
`${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`) `${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`)
this.viewKey = Date.now()
return return
} else if (_typeValue.options) { } else if (_typeValue.options) {
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId']) this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId'])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel']) this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel'])
this.viewKey = Date.now()
return return
} }
this.$set(this.orderObj, _typeValue.value, chooseContent) this.$set(this.orderObj, _typeValue.value, chooseContent)
this.viewKey = Date.now()
}, },
inputBlur (e, val) { inputBlur (e, val) {
this.orderObj[val.value] = this.orderObj[val.value] this.orderObj[val.value] = this.orderObj[val.value]
...@@ -367,7 +364,8 @@ export default { ...@@ -367,7 +364,8 @@ export default {
}) })
} }
let inclueType = data.addOnsFlag == 0 ? 2 : 1 let inclueType = data.addOnsFlag == 0 ? 2 : 1
Object.assign(this.orderObj, { this.orderObj = utils.deepClone({
...this.orderObj,
...data, ...data,
vin: data.vin, vin: data.vin,
invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2), invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2),
...@@ -414,7 +412,6 @@ export default { ...@@ -414,7 +412,6 @@ export default {
}, },
confirmCalendar (e, key) { confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate this.orderObj[key] = e.fulldate
this.viewKey = Date.now()
}, },
async submit (operationType) { async submit (operationType) {
// VIN车架号-动态校验 // VIN车架号-动态校验
......
...@@ -104,7 +104,7 @@ import GlCell from '../../../../components/Form/GlCell.vue' ...@@ -104,7 +104,7 @@ import GlCell from '../../../../components/Form/GlCell.vue'
import Product from './Product.vue' import Product from './Product.vue'
import Package from './Package.vue' import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue' import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList, titleList } from '../contant' import { FORM_LIST, popupTypeEnum, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import UploadProofOfPayment from './UploadProofOfPayment.vue' import UploadProofOfPayment from './UploadProofOfPayment.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
...@@ -194,7 +194,6 @@ export default { ...@@ -194,7 +194,6 @@ export default {
djPayList: [], // 嘀加收款方对应支付方式 djPayList: [], // 嘀加收款方对应支付方式
merchantPayList: [], // 门店收款方对应支付方式 merchantPayList: [], // 门店收款方对应支付方式
configPayTypeList: [], // 园区店配置支持的支付方式 configPayTypeList: [], // 园区店配置支持的支付方式
payTypeList,
goodsList: [], goodsList: [],
subOrderList: [], subOrderList: [],
otherProduct: [], otherProduct: [],
...@@ -234,7 +233,7 @@ export default { ...@@ -234,7 +233,7 @@ export default {
orderObj.price = this.divideByHundred(owner.price) orderObj.price = this.divideByHundred(owner.price)
orderObj.insurancePrice = this.divideByHundred(insurancePrice) orderObj.insurancePrice = this.divideByHundred(insurancePrice)
orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate) orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate)
if(!data.vdQuotationGoodsList) data.vdQuotationGoodsList = [] if (!data.vdQuotationGoodsList) data.vdQuotationGoodsList = []
orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map( orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map(
item => { item => {
item.price = this.divideByHundred(item.goodsPrice) item.price = this.divideByHundred(item.goodsPrice)
...@@ -791,7 +790,9 @@ export default { ...@@ -791,7 +790,9 @@ export default {
total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number)) total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number))
} else if (item.packageGoods && item.packageGoods.totalPrice) { } else if (item.packageGoods && item.packageGoods.totalPrice) {
console.log(item.packageGoods, '套餐') console.log(item.packageGoods, '套餐')
total = NP.plus(total, item.packageGoods.totalPrice) item.packageGoods.goodsList.map(i => {
total = NP.plus(total, i.sellPrice * i.number)
})
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) {
console.log(item.multipleSpecificationsGoods, '多规格') console.log(item.multipleSpecificationsGoods, '多规格')
total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1)) total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1))
...@@ -806,19 +807,11 @@ export default { ...@@ -806,19 +807,11 @@ export default {
// 获取园区店支付方式 // 获取园区店支付方式
async getConfig () { async getConfig () {
const { merchantId } = this.userInfo,
res = await uni.$api.boutiqueApi.getYqStoreConfig({
yqMerchantId: merchantId
})
console.log(123)
let m = res.supportPayTypes || []
let n = this.payTypeList
let list = n.filter(k => {
let idx = m.find(j => j == k.value)
return idx >= 0
})
this.djPayList = [ this.djPayList = [
...list?.filter(v => ![2, 5].includes(Number(v.value))), {
value: '1',
name: '微信支付'
},
{ {
name: '对公转账', name: '对公转账',
value: '6' value: '6'
...@@ -828,7 +821,10 @@ export default { ...@@ -828,7 +821,10 @@ export default {
value: '7' value: '7'
}, },
] ]
this.merchantPayList = [...list?.filter(v => v.value == 2)] this.merchantPayList = [{
value: '2',
name: '门店收款'
},]
this.changePayee() this.changePayee()
}, },
changePayee () { changePayee () {
...@@ -999,8 +995,8 @@ export default { ...@@ -999,8 +995,8 @@ export default {
}, },
clearPayMentDocList () { clearPayMentDocList () {
this.showUpload = false this.showUpload = false
this.orderInfo.paymentDocList = [] this.orderObj.paymentDocList = []
this.orderInfo.transactionNo = '' this.orderObj.transactionNo = ''
} }
} }
} }
......
...@@ -221,25 +221,38 @@ export default { ...@@ -221,25 +221,38 @@ export default {
value = '0' value = '0'
} }
// 检查最小价格 // 检查最小价格
// if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// // 普通商品的最小价格检查 if (item.packageGoods) {
// if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) { item.packageGoods?.goodsList[cindex]
// uni.showToast({ let packageItem = item.packageGoods?.goodsList[cindex]
// title: '单价不可低于商品最低价', if (packageItem && packageItem.validMinSellPrice === 'N' && packageItem.minSellPrice && parseFloat(value) < parseFloat(packageItem.minSellPrice)) {
// icon: 'none' uni.showToast({
// }) title: '价格不可低于商品最低价',
// value = item.goods.minSellPrice.toString() icon: 'none'
// } })
// } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { value = packageItem.minSellPrice.toString()
// // 多规格商品的最小价格检查 }
// if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) { } else {
// uni.showToast({ // 普通商品的最小价格检查
// title: '单价不可低于商品最低价', if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
// icon: 'none' uni.showToast({
// }) title: '价格不可低于商品最低价',
// value = item.multipleSpecificationsGoods.goods.minSellPrice.toString() icon: 'none'
// } })
// } value = item.goods.minSellPrice.toString()
}
}
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// 多规格商品的最小价格检查
if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
uni.showToast({
title: '价格不可低于商品最低价',
icon: 'none'
})
value = item.multipleSpecificationsGoods.goods.minSellPrice.toString()
}
}
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
if (item.goodsFlag == 1) { if (item.goodsFlag == 1) {
//如果没有多规格商品,更新普通商品的价格 //如果没有多规格商品,更新普通商品的价格
...@@ -439,12 +452,11 @@ export default { ...@@ -439,12 +452,11 @@ export default {
.number { .number {
margin-left: toRpx(16); margin-left: toRpx(16);
} }
.front-number-box{ .front-number-box {
position: absolute; position: absolute;
top: 50%; top: 50%;
right: toRpx(24); right: toRpx(24);
transform: translateY(-50%); transform: translateY(-50%);
} }
} }
} }
......
...@@ -156,6 +156,7 @@ import permision from '@/js_sdk/wa-permission/permission.js' ...@@ -156,6 +156,7 @@ import permision from '@/js_sdk/wa-permission/permission.js'
import { sign, md532, md516 } from 'utils/common' import { sign, md532, md516 } from 'utils/common'
import { signSecretKey } from '@/env.js' import { signSecretKey } from '@/env.js'
import { validateVin, formatVinInput } from '@/utils/vinVaildate' import { validateVin, formatVinInput } from '@/utils/vinVaildate'
import { getPlateLocation } from '@/utils/licensePlateParser'
export default { export default {
name: 'AddEvaluationFrom', name: 'AddEvaluationFrom',
components: { components: {
...@@ -556,7 +557,7 @@ export default { ...@@ -556,7 +557,7 @@ export default {
uploadOtherFields: [{ key: 41, label: '其他图片', required: false, accept: 'image', maxCount: 30, fullwidth: true }], uploadOtherFields: [{ key: 41, label: '其他图片', required: false, accept: 'image', maxCount: 30, fullwidth: true }],
currentField: null, currentField: null,
query: {}, query: {},
validateState:true validateState: true
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -904,16 +905,16 @@ export default { ...@@ -904,16 +905,16 @@ export default {
// VIN车架号-动态校验 // VIN车架号-动态校验
const carVin = this.formData.carBaseReqDTO.vin const carVin = this.formData.carBaseReqDTO.vin
console.log("validateState",this.validateState); console.log('validateState', this.validateState)
if (carVin) { if (carVin) {
// 前置判断 // 前置判断
if (carVin.length !== 17) { if (carVin.length !== 17) {
uni.showToast({title:'请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)',icon:'none'}) uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' })
return false return false
} }
// 根据接口校验结果判断 // 根据接口校验结果判断
if (carVin.length === 17 && !this.validateState) { if (carVin.length === 17 && !this.validateState) {
uni.showToast({title:'车架号校验不匹配,请核对后重新输入',icon:'none'}) uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' })
return false return false
} }
} }
...@@ -1018,7 +1019,7 @@ export default { ...@@ -1018,7 +1019,7 @@ export default {
}, },
handleCell(field) { handleCell(field) {
const that = this const that = this
console.log("handleCellAAAAA"); console.log('handleCellAAAAA')
if (field.isCar) { if (field.isCar) {
this.openSelectCar() this.openSelectCar()
} else if (field.isCity) { } else if (field.isCity) {
...@@ -1140,14 +1141,16 @@ export default { ...@@ -1140,14 +1141,16 @@ export default {
} }
// VIN车架号动态校验:车架号字段,动态转换为大写 // VIN车架号动态校验:车架号字段,动态转换为大写
validateVin(upperValue).then(result => { validateVin(upperValue)
console.log("validateVin",result); .then(result => {
let { valid } = result.data; console.log('validateVin', result)
let { valid } = result.data
this.validateState = valid this.validateState = valid
// 校验成功,所有提示已在公共方法中处理 // 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result) console.log('车架号校验成功:', result)
}).catch(err => { })
console.log("validateVinErr",result); .catch(err => {
console.log('validateVinErr', result)
}) })
} }
if (field.key === 'mileage') { if (field.key === 'mileage') {
...@@ -1324,14 +1327,16 @@ export default { ...@@ -1324,14 +1327,16 @@ export default {
if (res.data.code == 0) { if (res.data.code == 0) {
if (res.data.data.status == 1) { if (res.data.data.status == 1) {
this.formData.carBaseReqDTO.vin = res.data.data.vin this.formData.carBaseReqDTO.vin = res.data.data.vin
validateVin(this.formData.carBaseReqDTO.vin).then(result => { validateVin(this.formData.carBaseReqDTO.vin)
console.log("validateVin",result); .then(result => {
let { valid } = result.data; console.log('validateVin', result)
let { valid } = result.data
this.validateState = valid this.validateState = valid
// 校验成功,所有提示已在公共方法中处理 // 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result) console.log('车架号校验成功:', result)
}).catch(err => { })
console.log("validateVinErr",result); .catch(err => {
console.log('validateVinErr', result)
}) })
uni.showToast({ title: '车架号识别完成并已自动填写到表单中', icon: 'none' }) uni.showToast({ title: '车架号识别完成并已自动填写到表单中', icon: 'none' })
uni.hideLoading() uni.hideLoading()
...@@ -1364,6 +1369,21 @@ export default { ...@@ -1364,6 +1369,21 @@ export default {
uni.showToast({ title: '行驶证信息识别完成,已自动填写到表单中', icon: 'none' }) uni.showToast({ title: '行驶证信息识别完成,已自动填写到表单中', icon: 'none' })
if (res.data.data.status == 1) { if (res.data.data.status == 1) {
this.formData.carBaseReqDTO.engineNumber = res.data.data.engineNumber this.formData.carBaseReqDTO.engineNumber = res.data.data.engineNumber
// 识别车牌号并解析省市回显到上牌城市
if (res.data.data.licensePlate) {
const plateLocation = getPlateLocation(res.data.data.licensePlate)
console.log('plateLocation', plateLocation)
if (plateLocation.success && plateLocation.province && plateLocation.city) {
// 清空上牌城市的ID,只保留名称
this.formData.carBaseReqDTO.registrationProvinceId = null
this.formData.carBaseReqDTO.registrationCityId = null
this.formData.carBaseReqDTO.registrationProvinceName = plateLocation.province
this.formData.carBaseReqDTO.registrationCityName = plateLocation.city
}
}
if (this.title == '新增评估单') { if (this.title == '新增评估单') {
this.formData.carBaseReqDTO.licensePlate = res.data.data.licensePlate this.formData.carBaseReqDTO.licensePlate = res.data.data.licensePlate
if (res.data.data.licensePlate) { if (res.data.data.licensePlate) {
...@@ -1412,7 +1432,44 @@ export default { ...@@ -1412,7 +1432,44 @@ export default {
this.formData.carBaseReqDTO.vin = res.data.data.vin this.formData.carBaseReqDTO.vin = res.data.data.vin
this.formData.carBaseReqDTO.registrationDate = res.data.data.registrationDate this.formData.carBaseReqDTO.registrationDate = res.data.data.registrationDate
this.formData.carLicenseReqDTO.previousOwnerAddress = res.data.data.previousOwnerAddress
// 处理 previousOwnerAddress,提取省市并回显到上牌城市
const previousOwnerAddress = res.data.data.previousOwnerAddress
this.formData.carLicenseReqDTO.previousOwnerAddress = previousOwnerAddress
if (previousOwnerAddress) {
// 解析地址,提取省和市(到市级)
let provinceName = ''
let cityName = ''
// 处理直辖市(北京市、上海市、天津市、重庆市)
const municipalities = ['北京市', '上海市', '天津市', '重庆市']
const municipalityMatch = municipalities.find(city => previousOwnerAddress.startsWith(city))
if (municipalityMatch) {
// 直辖市:省和市都是同一个名称
provinceName = municipalityMatch
cityName = municipalityMatch
} else {
// 普通省份:例如:"山东省济南市历下区" -> 省:"山东省",市:"济南市"
const provinceMatch = previousOwnerAddress.match(/^(.+?省)/)
const cityMatch = previousOwnerAddress.match(/省(.+?市)/)
if (provinceMatch && cityMatch) {
provinceName = provinceMatch[1]
cityName = cityMatch[1]
}
}
if (provinceName && cityName) {
// 清空上牌城市的ID,只保留名称
this.formData.carBaseReqDTO.registrationProvinceId = 0
this.formData.carBaseReqDTO.registrationCityId = 0
this.formData.carBaseReqDTO.registrationProvinceName = provinceName
this.formData.carBaseReqDTO.registrationCityName = cityName
}
}
this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName
this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName
this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<view v-if="status == 20 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('requote', 'app_evaluate_requote')">重新报价</view> <view v-if="status == 20 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('requote', 'app_evaluate_requote')">重新报价</view>
<view v-if="status == 20 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('sign', 'app_evaluate_sign')">客户签约</view> <view v-if="status == 20 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('sign', 'app_evaluate_sign')">客户签约</view>
<view v-if="subStatus == 1" class="common-btn gray-btn ml-24" @click.stop="handleClick('signing')">签约中</view> <view v-if="subStatus == 1" class="common-btn gray-btn ml-24" @click.stop="handleClick('signing')">签约中</view>
<view v-if="subStatus == 1 && status == 20" class="common-btn ml-24" @click.stop="handleClick('withdrawal', 'app_evaluate_withdrawal')">撤回合同</view>
<view v-if="subStatus == 2 || subStatus == 3" class="common-btn gray-btn ml-24" @click.stop="handleClick('paying')">支付中</view> <view v-if="subStatus == 2 || subStatus == 3" class="common-btn gray-btn ml-24" @click.stop="handleClick('paying')">支付中</view>
<view v-if="status == 30 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('cancelSign', 'app_evaluate_cancel_sign')">取消签约</view> <view v-if="status == 30 && !subStatus" class="common-btn ml-24" @click.stop="handleClick('cancelSign', 'app_evaluate_cancel_sign')">取消签约</view>
<view v-if="status == 31 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('signAgreement', 'app_evaluate_cancel_sign')">确认代保管</view> <view v-if="status == 31 && !subStatus" class="common-btn blue-btn ml-24" @click.stop="handleClick('signAgreement', 'app_evaluate_cancel_sign')">确认代保管</view>
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')"> <view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')">
<view class="sprite-icon icon-scanIconX"></view> <view class="sprite-icon icon-scanIconX"></view>
</view> </view>
<view v-if="field.isLocation" class="flex align-center scanBtn justify-center" @click.stop="location">
<view class="sprite-icon icon-location"></view>
</view>
<text v-if="field.isCell" class="ml-12 cellLabel" :class="{ disabled: field.disabled }">{{ field.cell }}</text> <text v-if="field.isCell" class="ml-12 cellLabel" :class="{ disabled: field.disabled }">{{ field.cell }}</text>
</template> </template>
<template v-if="field.type === 'select'"> <template v-if="field.type === 'select'">
...@@ -275,6 +278,9 @@ export default { ...@@ -275,6 +278,9 @@ export default {
scan(type) { scan(type) {
this.$emit('scan', type) this.$emit('scan', type)
}, },
location() {
this.$emit('location')
},
previewPdf(field) { previewPdf(field) {
this.$emit('previewPdf', field) this.$emit('previewPdf', field)
}, },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<view class="car-number mr-12">{{ carInfo.registrationDateStr }}</view> <view class="car-number mr-12">{{ carInfo.registrationDateStr }}</view>
<view class="car-number mr-12">{{ carInfo.mileageStr }}</view> <view class="car-number mr-12">{{ carInfo.mileageStr }}</view>
<view class="car-number mr-12">{{ carInfo.transferCountStr }}</view> <view class="car-number mr-12">{{ carInfo.transferCountStr }}</view>
<view class="car-number">{{ vehicleCategoryMap[1] }}</view> <view class="car-number">{{ vehicleCategoryMap[carInfo.vehicleCategory] }}</view>
</view> </view>
<view class="info-row flex mb-30"> <view class="info-row flex mb-30">
<view class="info-item flex align-center"> <view class="info-item flex align-center">
......
...@@ -136,6 +136,12 @@ export default { ...@@ -136,6 +136,12 @@ export default {
sourceType: ['camera'], sourceType: ['camera'],
success: async res => { success: async res => {
console.log('选择图片成功', res) console.log('选择图片成功', res)
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function () {
console.log('图片保存成功')
}
})
try { try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) { for (const file of res.tempFiles) {
...@@ -218,6 +224,12 @@ export default { ...@@ -218,6 +224,12 @@ export default {
compressed: false, compressed: false,
success: async res => { success: async res => {
console.log('拍摄视频成功', res) console.log('拍摄视频成功', res)
uni.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
}
})
try { try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) { if (res.size > MAX_VIDEO_SIZE) {
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</view> </view>
</view> </view>
<view class="fromBox"> <view class="fromBox">
<FormCell :formFields="formFields" :formData="formData" @handleCell="handleCell" @previewPdf="previewPdf" @deletePdf="deletePdf" /> <FormCell :formFields="formFields" :formData="formData" @handleCell="handleCell" @previewPdf="previewPdf" @deletePdf="deletePdf" @location="location" />
</view> </view>
</view> </view>
<view class="button-module flex justify-center align-center"> <view class="button-module flex justify-center align-center">
...@@ -171,7 +171,8 @@ export default { ...@@ -171,7 +171,8 @@ export default {
sourceKey: 'uuid', sourceKey: 'uuid',
targetKey: 'handoverAddress', targetKey: 'handoverAddress',
type: 'input', type: 'input',
maxlength: 43 maxlength: 43,
isLocation: true
}, },
{ {
key: 'buyerAgreementUrl', key: 'buyerAgreementUrl',
...@@ -279,10 +280,28 @@ export default { ...@@ -279,10 +280,28 @@ export default {
evalOrderNo: this.query.evalOrderNo evalOrderNo: this.query.evalOrderNo
}) })
if (res.data.code == 0) { if (res.data.code == 0) {
// this.$set(this.formData, 'handoverAddress', res.data.data.evalCarBase.carProvinceName + '-' + res.data.data.evalCarBase.carCityName) const data = res.data.data
console.log('res.data.data', JSON.parse(res.data.data.custodyContract.electronicContractField))
// this.custodianName = JSON.parse(res.data.data.custodyContract.electronicContractField).custodianName || '' // 设置交车时间
this.formData.handoverTime = dayjs().format('YYYY-MM-DD HH:mm:00') this.formData.handoverTime = dayjs().format('YYYY-MM-DD HH:mm:00')
// 处理图片回显
if (data.imageListDTO && data.imageListDTO.length > 0) {
// 行驶证图片 (fileSubtype: 21)
const drivingLicenseImages = data.imageListDTO.filter(img => img.fileSubtype === 21).map(img => img.fileUrl)
if (drivingLicenseImages.length > 0) {
this.$set(this.uploadedImages, 'motorRegistrationCertificateUrl', drivingLicenseImages)
this.formData.motorRegistrationCertificateUrl = drivingLicenseImages.join(',')
}
// 登记证图片 (fileSubtype: 22)
const registrationImages = data.imageListDTO.filter(img => img.fileSubtype === 22).map(img => img.fileUrl)
if (registrationImages.length > 0) {
this.$set(this.uploadedImages, 'motorBookUrl', registrationImages)
this.formData.motorBookUrl = registrationImages.join(',')
}
}
// this.evalOrderSimpleDetail = res.data.data // this.evalOrderSimpleDetail = res.data.data
} else { } else {
uni.hideLoading() uni.hideLoading()
...@@ -473,6 +492,12 @@ export default { ...@@ -473,6 +492,12 @@ export default {
sizeType: ['original'], sizeType: ['original'],
sourceType: ['camera'], sourceType: ['camera'],
success: async res => { success: async res => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function () {
console.log('图片保存成功')
}
})
try { try {
const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB const MAX_IMAGE_SIZE = 10 * 1024 * 1024 // 10MB
for (const file of res.tempFiles) { for (const file of res.tempFiles) {
...@@ -542,6 +567,12 @@ export default { ...@@ -542,6 +567,12 @@ export default {
compressed: false, compressed: false,
success: async res => { success: async res => {
console.log('拍摄视频成功', res) console.log('拍摄视频成功', res)
uni.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
console.log('save success')
}
})
try { try {
const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB const MAX_VIDEO_SIZE = 100 * 1024 * 1024 // 100MB
if (res.size > MAX_VIDEO_SIZE) { if (res.size > MAX_VIDEO_SIZE) {
...@@ -679,6 +710,22 @@ export default { ...@@ -679,6 +710,22 @@ export default {
console.log(successDate) console.log(successDate)
this.$set(this.formData, 'handoverTime', successDate) this.$set(this.formData, 'handoverTime', successDate)
this.show = false this.show = false
},
location() {
const that = this
uni.showLoading({ title: '定位中...' })
uni.getLocation({
type: 'gcj02',
geocode: true,
success: function (res) {
uni.hideLoading()
that.$set(that.formData, 'handoverAddress', res.address.province + res.address.city)
},
fail: function (err) {
uni.hideLoading()
uni.showToast({ title: '定位失败', icon: 'none' })
}
})
} }
}, },
watch: {}, watch: {},
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<view class="upload-images-wrapper" v-if="getImageBySubtype(field.key)"> <view class="upload-images-wrapper" v-if="getImageBySubtype(field.key)">
<view class="uploaded-media-container"> <view class="uploaded-media-container">
<view class="video-container"> <view class="video-container">
<image :src="getImageBySubtype(field.key).fileUrl + videoProcess" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(getImageBySubtype(field.key).fileUrl, 2)"></image> <image :src="getVideoThumbnail(getImageBySubtype(field.key).fileUrl)" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(getImageBySubtype(field.key).fileUrl, 2)"></image>
<!-- <video :src="getImageBySubtype(field.key).fileUrl" mode="aspectFill" controls class="uploaded-media"></video> --> <!-- <video :src="getImageBySubtype(field.key).fileUrl" mode="aspectFill" controls class="uploaded-media"></video> -->
<view class="video-play-icon"> <view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view> <view class="sprite-icon icon-upload-play"></view>
...@@ -173,10 +173,19 @@ ...@@ -173,10 +173,19 @@
<view class="tab-panel-title">二手车转让协议</view> <view class="tab-panel-title">二手车转让协议</view>
<view class="gridBoxNoPadding"> <view class="gridBoxNoPadding">
<template v-for="(item, index) in vehicleItems"> <template v-for="(item, index) in vehicleItems">
<view v-if="!detailsInfo.signingInfo.saleContract.depositPrice ? item.key !== 'signingInfo.saleContract.depositPrice' && item.key !== 'signingInfo.saleContract.finalPrice' : item.key !== 'signingInfo.saleContract.fullPrice'" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]"> <view v-if="(!detailsInfo.signingInfo.saleContract.depositPrice ? item.key !== 'signingInfo.saleContract.depositPrice' && item.key !== 'signingInfo.saleContract.finalPrice' : item.key !== 'signingInfo.saleContract.fullPrice') && (item.key !== 'signingInfo.saleContract.thirdPartyTransactionVoucher' || formatValue(item, detailsInfo))" :key="index" :class="['flex align-start', { 'full-width': item.fullWidth }, { 'align-center': item.type == 'link' }]">
<view class="title-label-see mr-16">{{ item.label }}</view> <view class="title-label-see mr-16">{{ item.label }}</view>
<view v-if="item.type == 'image'"> <view v-if="item.type == 'image'">
<image :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image> <!-- 三方/委托交易凭证可能是视频 -->
<view v-if="item.key === 'signingInfo.saleContract.thirdPartyTransactionVoucher' && isVideoUrl(formatValue(item, detailsInfo))" class="uploaded-media-container">
<view class="video-container">
<image :src="getVideoThumbnail(formatValue(item, detailsInfo))" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(formatValue(item, detailsInfo), 2)"></image>
<view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view>
</view>
</view>
</view>
<image v-else :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</view> </view>
<view v-else-if="item.type == 'link'" class="flex-1" @click.stop="pdfPreview(detailsInfo.signingInfo.saleContract.contractNo)"> <view v-else-if="item.type == 'link'" class="flex-1" @click.stop="pdfPreview(detailsInfo.signingInfo.saleContract.contractNo)">
<view class="pdf-box flex align-center justify-between"> <view class="pdf-box flex align-center justify-between">
...@@ -311,7 +320,15 @@ ...@@ -311,7 +320,15 @@
<image @click.stop="previewMedia(url, 1)" v-for="(url, idx) in splitMediaUrls(formatValue(item, detailsInfo))" :key="idx" :src="url" mode="aspectFill" style="margin-right: 10px"></image> <image @click.stop="previewMedia(url, 1)" v-for="(url, idx) in splitMediaUrls(formatValue(item, detailsInfo))" :key="idx" :src="url" mode="aspectFill" style="margin-right: 10px"></image>
</template> </template>
<template v-else> <template v-else>
<image v-if="formatValue(item, detailsInfo).includes('mp4')" :src="formatValue(item, detailsInfo) + videoProcess" @click.stop="previewMedia(formatValue(item, detailsInfo), 2)"></image> <!-- 过户授权委托书可能是视频 -->
<view v-if="item.key === 'carHandoverInfo.transferPhotoUrl' && isVideoUrl(formatValue(item, detailsInfo))" class="uploaded-media-container">
<view class="video-container">
<image :src="getVideoThumbnail(formatValue(item, detailsInfo))" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(formatValue(item, detailsInfo), 2)"></image>
<view class="video-play-icon">
<view class="sprite-icon icon-upload-play"></view>
</view>
</view>
</view>
<image v-else :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image> <image v-else :src="formatValue(item, detailsInfo)" @click.stop="previewMedia(formatValue(item, detailsInfo), 1)"></image>
</template> </template>
</view> </view>
...@@ -393,7 +410,7 @@ ...@@ -393,7 +410,7 @@
</template> </template>
</view> </view>
<view v-else-if="item.fieldType == 'video'"> <view v-else-if="item.fieldType == 'video'">
<image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldBeforeValue)" :key="idx" :src="url + videoProcess" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image> <image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldBeforeValue)" :key="idx" :src="getVideoThumbnail(url)" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image>
</view> </view>
</template> </template>
</view> </view>
...@@ -409,7 +426,7 @@ ...@@ -409,7 +426,7 @@
</template> </template>
</view> </view>
<view v-else-if="item.fieldType == 'video'"> <view v-else-if="item.fieldType == 'video'">
<image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldAfterValue)" :key="idx" :src="url + videoProcess" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image> <image @click.stop="previewMedia(url, 2)" v-for="(url, idx) in splitMediaUrls(item.fieldAfterValue)" :key="idx" :src="getVideoThumbnail(url)" mode="aspectFill" style="margin-right: 10px; width: 80px; height: 80px"></image>
</view> </view>
</template> </template>
</view> </view>
...@@ -553,6 +570,7 @@ export default { ...@@ -553,6 +570,7 @@ export default {
{ label: '交车地点', key: 'signingInfo.saleContract.handoverAddress' }, { label: '交车地点', key: 'signingInfo.saleContract.handoverAddress' },
{ label: '身份证国徽面', key: 'signingInfo.saleContract.idCardFrontUrl', type: 'image' }, { label: '身份证国徽面', key: 'signingInfo.saleContract.idCardFrontUrl', type: 'image' },
{ label: '身份证人像面', key: 'signingInfo.saleContract.idCardBackUrl', type: 'image' }, { label: '身份证人像面', key: 'signingInfo.saleContract.idCardBackUrl', type: 'image' },
{ label: '三方/委托交易凭证', key: 'signingInfo.saleContract.thirdPartyTransactionVoucher', type: 'image' },
{ label: '查阅合同', key: 'signingInfo.saleContract.contractUrl', type: 'link' } { label: '查阅合同', key: 'signingInfo.saleContract.contractUrl', type: 'link' }
], ],
payeeItems: [ payeeItems: [
...@@ -708,6 +726,45 @@ export default { ...@@ -708,6 +726,45 @@ export default {
.map(url => url.trim()) .map(url => url.trim())
.filter(url => url) .filter(url => url)
}, },
// 判断URL是否是视频
isVideoUrl(url) {
if (!url) return false
// 1. 检查是否包含阿里云视频处理参数
if (url.includes(this.videoProcess)) {
return true
}
// 2. 检查文件扩展名(视频格式)
const videoExtensions = ['.mp4', '.mov', '.avi', '.wmv', '.flv', '.m4v', '.3gp', '.mkv', '.webm']
const urlLower = url.toLowerCase()
const hasVideoExtension = videoExtensions.some(ext => {
// 检查扩展名,需要排除查询参数
const urlWithoutQuery = urlLower.split('?')[0].split('#')[0]
return urlWithoutQuery.endsWith(ext)
})
return hasVideoExtension
},
// 获取视频缩略图URL
getVideoThumbnail(url) {
if (!url) return ''
// 如果已经是阿里云链接且包含videoProcess,直接返回
if (url.includes(this.videoProcess)) {
return url
}
// 如果是阿里云OSS链接,添加videoProcess参数
if (url.includes('aliyuncs.com') || url.includes('oss-')) {
// 如果URL已经有查询参数,用&连接;否则用?连接
const separator = url.includes('?') ? '&' : '?'
return url + separator + this.videoProcess.replace('?', '')
}
// 如果不是阿里云链接(如小程序上传),返回默认视频图片
return 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/video_default.png'
},
statusClass(status) { statusClass(status) {
return status > 0 ? `status-${status}` : 'status-0' return status > 0 ? `status-${status}` : 'status-0'
}, },
......
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
</view> </view>
</template> </template>
</GeneralPopup> </GeneralPopup>
<NoticePopup ref="notice" title="重要提示" text="确定要撤回合同吗?" type="warning"></NoticePopup>
<OrderPopup ref="orderPopup" :data="custodyAgreementObj" :isDefeatOrder="true" :externalData="[]" @onConfirm="onConfirm" :popupType="14" idKey="id" /> <OrderPopup ref="orderPopup" :data="custodyAgreementObj" :isDefeatOrder="true" :externalData="[]" @onConfirm="onConfirm" :popupType="14" idKey="id" />
</view> </view>
</template> </template>
...@@ -165,7 +166,7 @@ import EvaluationCard from './components/evaluationCard.vue' ...@@ -165,7 +166,7 @@ import EvaluationCard from './components/evaluationCard.vue'
import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin' import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin'
import GeneralPopup from './components/GeneralPopup.vue' import GeneralPopup from './components/GeneralPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import { set } from 'lodash' import NoticePopup from '@/components/NoticePopup.vue'
export default { export default {
name: 'EvaluationFormList', name: 'EvaluationFormList',
mixins: [ZPMixin], mixins: [ZPMixin],
...@@ -175,7 +176,8 @@ export default { ...@@ -175,7 +176,8 @@ export default {
TypeTabComponent, TypeTabComponent,
EvaluationCard, EvaluationCard,
GeneralPopup, GeneralPopup,
OrderPopup OrderPopup,
NoticePopup
}, },
data() { data() {
return { return {
...@@ -391,8 +393,55 @@ export default { ...@@ -391,8 +393,55 @@ export default {
this.reSubmit(e) this.reSubmit(e)
} else if (e.type === 'signAgreement') { } else if (e.type === 'signAgreement') {
this.signAgreement(e) this.signAgreement(e)
} else if (e.type === 'withdrawal') {
this.withdrawal(e)
} }
}, },
async withdrawal(e) {
this.$refs.notice.buttonsList = [
{
text: '取消',
type: 'default',
callback: () => {
this.$refs.notice.close()
}
},
{
text: '确定',
type: 'primary',
callback: async () => {
uni.showLoading()
const res = await uni.$api.evaluationApi.revokeSaleContract({
saleContractNo: e.saleContractNo
})
console.log('res:', res)
if (res.data.code == 0) {
this.$refs.notice.close()
uni.hideLoading()
uni.showToast({
title: '撤回合同成功',
icon: 'none'
})
setTimeout(() => {
this.currentPage = 1
this.search()
}, 1000)
} else {
this.$refs.notice.close()
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
}
}
]
// 打开弹窗
this.$refs.notice.open()
},
async reSubmit(e) { async reSubmit(e) {
uni.showLoading() uni.showLoading()
const res = await uni.$api.evaluationApi.evalOrderConfirmVehicleDelivery({ const res = await uni.$api.evaluationApi.evalOrderConfirmVehicleDelivery({
...@@ -734,11 +783,13 @@ export default { ...@@ -734,11 +783,13 @@ export default {
border-radius: toRpx(42); border-radius: toRpx(42);
background: rgb(255, 255, 255) !important; background: rgb(255, 255, 255) !important;
.tipsPopupBg { .tipsPopupBg {
border-radius: toRpx(42) toRpx(42) 0 0; border-radius: toRpx(42) toRpx(42) 0 0;
width: 100%; width: 100%;
height: toRpx(244); height: toRpx(244);
} }
.title { .title {
color: #333333; color: #333333;
font-size: toRpx(40); font-size: toRpx(40);
...@@ -746,6 +797,7 @@ export default { ...@@ -746,6 +797,7 @@ export default {
text-align: center; text-align: center;
margin-top: toRpx(48); margin-top: toRpx(48);
} }
.tipsConent { .tipsConent {
color: #666666; color: #666666;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -753,14 +805,17 @@ export default { ...@@ -753,14 +805,17 @@ export default {
padding: toRpx(16) toRpx(64); padding: toRpx(16) toRpx(64);
line-height: toRpx(48); line-height: toRpx(48);
text-align: center; text-align: center;
text { text {
color: #347bff; color: #347bff;
} }
} }
.footer-box { .footer-box {
height: toRpx(154); height: toRpx(154);
} }
} }
.evaluation-form-list { .evaluation-form-list {
position: relative; position: relative;
width: 100vw; width: 100vw;
...@@ -775,6 +830,7 @@ export default { ...@@ -775,6 +830,7 @@ export default {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
.box-class { .box-class {
height: calc(100% - #{toRpx(110)}); height: calc(100% - #{toRpx(110)});
background: #ffffff59; background: #ffffff59;
...@@ -782,24 +838,29 @@ export default { ...@@ -782,24 +838,29 @@ export default {
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
overflow: hidden; overflow: hidden;
.paging-class { .paging-class {
background-color: #fff; background-color: #fff;
height: calc(100% - #{toRpx(96)}); height: calc(100% - #{toRpx(96)});
box-sizing: border-box; box-sizing: border-box;
border-radius: toRpx(32); border-radius: toRpx(32);
} }
.no-br { .no-br {
border-radius: 0 toRpx(32) toRpx(32) toRpx(32); border-radius: 0 toRpx(32) toRpx(32) toRpx(32);
} }
.no-br1 { .no-br1 {
border-radius: toRpx(32) 0 toRpx(32) toRpx(32); border-radius: toRpx(32) 0 toRpx(32) toRpx(32);
} }
.mask-box { .mask-box {
height: calc(100% - #{toRpx(96)}); height: calc(100% - #{toRpx(96)});
width: 100%; width: 100%;
background: #fff; background: #fff;
border-radius: toRpx(48); border-radius: toRpx(48);
color: #808291; color: #808291;
.noDataImg { .noDataImg {
width: toRpx(480); width: toRpx(480);
height: toRpx(240); height: toRpx(240);
...@@ -807,9 +868,11 @@ export default { ...@@ -807,9 +868,11 @@ export default {
} }
} }
} }
.signAgreement-content { .signAgreement-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
.signAgreement-label { .signAgreement-label {
color: #999999; color: #999999;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -817,12 +880,14 @@ export default { ...@@ -817,12 +880,14 @@ export default {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.requiredLabel { .requiredLabel {
color: #f24724; color: #f24724;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
margin-left: toRpx(8); margin-left: toRpx(8);
} }
.from-value { .from-value {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -832,16 +897,19 @@ export default { ...@@ -832,16 +897,19 @@ export default {
background: #f4f5f7; background: #f4f5f7;
padding: toRpx(28) toRpx(24); padding: toRpx(28) toRpx(24);
flex: 1; flex: 1;
.sprite-icon { .sprite-icon {
margin-bottom: toRpx(2); margin-bottom: toRpx(2);
} }
} }
.btn { .btn {
color: #3b73ff; color: #3b73ff;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
margin-left: toRpx(24); margin-left: toRpx(24);
} }
.placeholder { .placeholder {
color: #999; color: #999;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -861,6 +929,7 @@ export default { ...@@ -861,6 +929,7 @@ export default {
.requote-content { .requote-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
.requote-label { .requote-label {
color: #333333; color: #333333;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -868,12 +937,14 @@ export default { ...@@ -868,12 +937,14 @@ export default {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.requiredLabel { .requiredLabel {
color: #f24724; color: #f24724;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
margin-left: toRpx(8); margin-left: toRpx(8);
} }
::v-deep .intention-input { ::v-deep .intention-input {
height: toRpx(96); height: toRpx(96);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -882,11 +953,13 @@ export default { ...@@ -882,11 +953,13 @@ export default {
background: #f4f5f7; background: #f4f5f7;
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
.uni-input-placeholder { .uni-input-placeholder {
margin-left: toRpx(24); margin-left: toRpx(24);
} }
} }
} }
.intention-input-cell { .intention-input-cell {
height: toRpx(96); height: toRpx(96);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -894,6 +967,7 @@ export default { ...@@ -894,6 +967,7 @@ export default {
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
} }
::v-deep .feedback-textarea { ::v-deep .feedback-textarea {
height: toRpx(288); height: toRpx(288);
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -901,6 +975,7 @@ export default { ...@@ -901,6 +975,7 @@ export default {
width: 100%; width: 100%;
padding: toRpx(24); padding: toRpx(24);
box-sizing: border-box; box-sizing: border-box;
.uni-input-wrapper { .uni-input-wrapper {
background: #f4f5f7; background: #f4f5f7;
} }
...@@ -915,6 +990,7 @@ export default { ...@@ -915,6 +990,7 @@ export default {
background: #f1f7fe; background: #f1f7fe;
padding-left: toRpx(32); padding-left: toRpx(32);
box-sizing: border-box; box-sizing: border-box;
.amount-title { .amount-title {
color: #333333; color: #333333;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -922,12 +998,14 @@ export default { ...@@ -922,12 +998,14 @@ export default {
margin-right: toRpx(16); margin-right: toRpx(16);
width: toRpx(168); width: toRpx(168);
} }
.amount-value { .amount-value {
color: #3b73ff; color: #3b73ff;
font-size: toRpx(36); font-size: toRpx(36);
font-weight: 700; font-weight: 700;
} }
} }
.popup-cell-title { .popup-cell-title {
color: #999; color: #999;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -935,14 +1013,17 @@ export default { ...@@ -935,14 +1013,17 @@ export default {
margin-right: toRpx(16); margin-right: toRpx(16);
width: toRpx(168); width: toRpx(168);
} }
.popup-cell-value { .popup-cell-value {
color: #222; color: #222;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
} }
.light-title { .light-title {
color: #333333; color: #333333;
} }
.light-value { .light-value {
color: #4673ff; color: #4673ff;
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</view> </view>
<view class="uni-calendar__header"> <view class="uni-calendar__header">
<view <view
class="uni-calendar__header-btn-box" :class="['uni-calendar__header-btn-box prev-btn',{'show-prev-btn':showPreBtn}]"
@click.stop="pre" @click.stop="pre"
> >
<view class="uni-calendar__header-btn uni-calendar--left"></view> <view class="uni-calendar__header-btn uni-calendar--left"></view>
...@@ -291,7 +291,12 @@ export default { ...@@ -291,7 +291,12 @@ export default {
showNextBtn () { showNextBtn () {
let { cale, endDate, nowDate } = this, let { cale, endDate, nowDate } = this,
maxDate = cale.getDate(endDate, -1, 'month') maxDate = cale.getDate(endDate, -1, 'month')
return cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${maxDate.year}/${maxDate.month}`) return !endDate ? true :cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${maxDate.year}/${maxDate.month}`)
},
showPreBtn () {
let { cale, startDate, nowDate } = this,
minDate = cale.getDate(startDate, -1, 'month')
return !startDate ? true : cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${minDate.year}/${minDate.month}`)
} }
}, },
watch: { watch: {
...@@ -656,10 +661,10 @@ $uni-text-color-grey: #999; ...@@ -656,10 +661,10 @@ $uni-text-color-grey: #999;
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
.next-btn { .next-btn ,.prev-btn{
opacity: 0; opacity: 0;
} }
.show-next-btn { .show-next-btn ,.show-prev-btn{
opacity: 1; opacity: 1;
} }
.uni-calendar__header-btn { .uni-calendar__header-btn {
......
// 车牌号省市代码映射表
const licenseData = {
京: { name: '北京', cities: { A: '城区', B: '出租车', C: '城区', E: '城区', F: '城区', G: '远郊区', H: '远郊区', J: '远郊区', K: '城区', L: '城区', M: '城区', N: '城区', P: '城区', Q: '城区' } },
津: { name: '天津', cities: { A: '公交/公安', B: '城区', C: '城区', D: '城区', E: '出租车', F: '城区', G: '城区', H: '城区' } },
沪: { name: '上海', cities: { A: '市区', B: '市区', C: '郊区', D: '市区', E: '市区', F: '市区', G: '市区', H: '市区', J: '市区', K: '市区', L: '市区', M: '市区', N: '市区', R: '崇明/长兴/横沙' } },
渝: { name: '重庆', cities: { A: '市区', B: '万州', C: '永川', D: '市区', F: '涪陵', G: '黔江', H: '武隆' } },
冀: { name: '河北', cities: { A: '石家庄', B: '唐山', C: '秦皇岛', D: '邯郸', E: '邢台', F: '保定', G: '张家口', H: '承德', J: '沧州', R: '廊坊', T: '衡水' } },
豫: { name: '河南', cities: { A: '郑州', B: '开封', C: '洛阳', D: '平顶山', E: '安阳', F: '鹤壁', G: '新乡', H: '焦作', J: '濮阳', K: '许昌', L: '漯河', M: '三门峡', N: '商丘', P: '周口', Q: '驻马店', R: '南阳', S: '信阳', U: '济源' } },
云: { name: '云南', cities: { A: '昆明', C: '昭通', D: '曲靖', E: '楚雄', F: '玉溪', G: '红河', H: '文山', J: '普洱', K: '西双版纳', L: '大理', M: '保山', N: '德宏', P: '丽江', Q: '怒江', R: '迪庆', S: '临沧' } },
辽: { name: '辽宁', cities: { A: '沈阳', B: '大连', C: '鞍山', D: '抚顺', E: '本溪', F: '丹东', G: '锦州', H: '营口', J: '阜新', K: '辽阳', L: '盘锦', M: '铁岭', N: '朝阳', P: '葫芦岛' } },
黑: { name: '黑龙江', cities: { A: '哈尔滨', B: '齐齐哈尔', C: '牡丹江', D: '佳木斯', E: '大庆', F: '伊春', G: '鸡西', H: '鹤岗', J: '双鸭山', K: '七台河', L: '松原', M: '绥化', N: '黑河', P: '大兴安岭' } },
湘: { name: '湖南', cities: { A: '长沙', B: '株洲', C: '湘潭', D: '衡阳', E: '邵阳', F: '岳阳', G: '张家界', H: '益阳', J: '常德', K: '娄底', L: '郴州', M: '永州', N: '怀化', U: '湘西' } },
皖: { name: '安徽', cities: { A: '合肥', B: '芜湖', C: '蚌埠', D: '淮南', E: '马鞍山', F: '淮北', G: '铜陵', H: '安庆', J: '黄山', K: '阜阳', L: '宿州', M: '滁州', N: '六安', P: '宣城', Q: '池州', R: '亳州' } },
鲁: { name: '山东', cities: { A: '济南', B: '青岛', C: '淄博', D: '枣庄', E: '东营', F: '烟台', G: '潍坊', H: '济宁', J: '泰安', K: '威海', L: '日照', M: '滨州', N: '德州', P: '聊城', Q: '临沂', R: '菏泽', S: '莱芜', U: '青岛增补', V: '潍坊增补' } },
新: { name: '新疆', cities: { A: '乌鲁木齐', B: '昌吉', C: '石河子', D: '奎屯', E: '博尔塔拉', F: '伊犁', G: '塔城', H: '阿勒泰', J: '克拉玛依', K: '吐鲁番', L: '哈密', M: '巴音郭楞', N: '阿克苏', P: '克孜勒苏', Q: '喀什', R: '和田' } },
苏: { name: '江苏', cities: { A: '南京', B: '无锡', C: '徐州', D: '常州', E: '苏州', F: '南通', G: '连云港', H: '淮安', J: '盐城', K: '扬州', L: '镇江', M: '泰州', N: '宿迁', U: '苏州增补' } },
浙: { name: '浙江', cities: { A: '杭州', B: '宁波', C: '温州', D: '绍兴', E: '湖州', F: '嘉兴', G: '金华', H: '衢州', J: '台州', K: '丽水', L: '舟山' } },
赣: { name: '江西', cities: { A: '南昌', B: '赣州', C: '宜春', D: '吉安', E: '上饶', F: '抚州', G: '九江', H: '景德镇', J: '萍乡', K: '新余', L: '鹰潭' } },
鄂: { name: '湖北', cities: { A: '武汉', B: '黄石', C: '十堰', D: '荆州', E: '宜昌', F: '襄阳', G: '鄂州', H: '荆门', J: '黄冈', K: '孝感', L: '咸宁', M: '仙桃', N: '潜江', P: '神农架', Q: '天门', R: '恩施' } },
桂: { name: '广西', cities: { A: '南宁', B: '柳州', C: '桂林', D: '梧州', E: '北海', F: '崇左', G: '来宾', H: '桂林', J: '贺州', K: '玉林', L: '百色', M: '河池', N: '钦州', P: '防城港', R: '贵港' } },
甘: { name: '甘肃', cities: { A: '兰州', B: '嘉峪关', C: '金昌', D: '白银', E: '天水', F: '酒泉', G: '张掖', H: '平凉', J: '庆阳', K: '定西', L: '陇南', M: '临夏', N: '甘南' } },
晋: { name: '山西', cities: { A: '太原', B: '大同', C: '阳泉', D: '长治', E: '晋城', F: '朔州', H: '忻州', J: '吕梁', K: '晋中', L: '临汾', M: '运城' } },
蒙: { name: '内蒙古', cities: { A: '呼和浩特', B: '包头', C: '乌海', D: '赤峰', E: '呼伦贝尔', F: '兴安盟', G: '通辽', H: '锡林郭勒', J: '乌兰察布', K: '鄂尔多斯', L: '巴彦淖尔', M: '阿拉善' } },
陕: { name: '陕西', cities: { A: '西安', B: '铜川', C: '宝鸡', D: '咸阳', E: '渭南', F: '汉中', G: '安康', H: '商洛', J: '延安', K: '榆林', V: '杨凌' } },
吉: { name: '吉林', cities: { A: '长春', B: '吉林', C: '四平', D: '辽源', E: '通化', F: '白山', G: '白城', H: '延边', J: '松原' } },
闽: { name: '福建', cities: { A: '福州', B: '厦门', C: '宁德', D: '莆田', E: '泉州', F: '漳州', G: '龙岩', H: '三明', J: '南平' } },
贵: { name: '贵州', cities: { A: '贵阳', B: '六盘水', C: '遵义', D: '安顺', E: '铜仁', F: '毕节', G: '黔西南', H: '黔东南', J: '黔南' } },
粤: { name: '广东', cities: { A: '广州', B: '深圳', C: '珠海', D: '汕头', E: '佛山', F: '韶关', G: '湛江', H: '肇庆', J: '江门', K: '茂名', L: '惠州', M: '梅州', N: '汕尾', P: '河源', Q: '阳江', R: '清远', S: '东莞', T: '中山', U: '潮州', V: '揭阳', W: '云浮', X: '顺德', Y: '南海', Z: '港澳' } },
青: { name: '青海', cities: { A: '西宁', B: '海东', C: '海北', D: '黄南', E: '海南州', F: '果洛', G: '玉树', H: '海西' } },
藏: { name: '西藏', cities: { A: '拉萨', B: '昌都', C: '山南', D: '日喀则', E: '那曲', F: '阿里', G: '林芝' } },
川: { name: '四川', cities: { A: '成都', B: '绵阳', C: '自贡', D: '攀枝花', E: '泸州', F: '德阳', G: '成都增补', H: '广元', J: '遂宁', K: '内江', L: '乐山', M: '资阳', Q: '宜宾', R: '南充', S: '达州', T: '雅安', U: '阿坝', V: '甘孜', W: '凉山', X: '广安', Y: '巴中', Z: '眉山' } },
宁: { name: '宁夏', cities: { A: '银川', B: '石嘴山', C: '吴忠', D: '固原', E: '中卫' } },
琼: { name: '海南', cities: { A: '海口', B: '三亚', C: '三沙', D: '五指山', E: '洋浦', F: '儋州' } }
}
/**
* 解析车牌省市
* @param {string} plateStr - 车牌号 (如: "粤B12345")
* @returns {object} { province, city, success }
*/
export function getPlateLocation(plateStr) {
// 基础校验
if (!plateStr || typeof plateStr !== 'string' || plateStr.length < 2) {
return { province: '', city: '', success: false }
}
const pChar = plateStr.charAt(0) // 提取省份简称:粤
const cChar = plateStr.charAt(1).toUpperCase() // 提取地市代码:B
const provinceInfo = licenseData[pChar]
if (provinceInfo) {
const cityName = provinceInfo.cities[cChar]
if (cityName) {
// 处理省份名称,添加"省"或"市"后缀
let province = provinceInfo.name
// 直辖市不需要加"省",只需要加"市"
const municipalities = ['北京', '上海', '天津', '重庆']
if (municipalities.includes(province)) {
province = province + '市'
} else if (province === '内蒙古') {
province = province + '自治区'
} else if (province === '新疆' || province === '西藏' || province === '广西' || province === '宁夏') {
// 其他自治区,根据习惯可能需要加"自治区"或"省",这里统一加"省"
province = province + '省'
} else {
province = province + '省'
}
// 处理城市名称,添加"市"后缀(如果还没有)
let city = cityName
// 特殊情况:不需要加"市"的情况
// 1. 已经以"市"结尾
// 2. 包含特殊关键词:城区、市区、郊区、出租车、公交、增补
// 3. 包含斜杠(如:崇明/长兴/横沙)
const specialKeywords = ['城区', '市区', '郊区', '出租车', '公交', '增补']
const isSpecialCase = specialKeywords.some(keyword => city.includes(keyword)) || city.includes('/')
// 普通城市名称添加"市"后缀
if (!city.endsWith('市') && !isSpecialCase) {
city = city + '市'
}
return {
province: province,
city: city,
success: true
}
}
}
return { province: '', city: '', success: false }
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!