Commit 950ae9a7 by 李伟康

根据您提供的信息,我注意到 code differences 部分是空的(只有空白的代码块)。由于没有实际的代码变更内容,我无法生成具体描述变更的 commit message。

如果您能提供具体的代码差异内容,我可以为您生成符合 Angular 规范的中文 commit message。请重新提供包含实际变更信息的 code differences 内容。

目前基于空的变更,只能生成类似这样的占位消息:

```
chore(empty): 无实际代码变更
<BLANK LINE>
本次提交未包含任何实际的代码修改内容,code differences 为空。
```

请提供具体的代码变更内容以获得准确的 commit message。
1 parent 9adfef0f

2.93 MB | W: | H:

2.93 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
* 19: 客户档案 * 19: 客户档案
* 20: 战败客户档案 * 20: 战败客户档案
* 21: 客户类型 * 21: 客户类型
* 22: 证件类型
* 23: 购车类型
* 24: 车辆使用性质
* 25: 选择品牌车系
* 26: 变速箱类型
*/ */
const componentConfig = { const componentConfig = {
......
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
sceneType () { sceneType () {
const { sceneType } = uni.$storage.get('userInfo') const { sceneType } = uni.$storage.get('userInfo')
return sceneType return sceneType
} },
}, },
mounted () { mounted () {
}, },
......
...@@ -186,6 +186,7 @@ export default { ...@@ -186,6 +186,7 @@ export default {
padding: 0 toRpx(40); padding: 0 toRpx(40);
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
background-color: #eef4fe;
&:first-of-type { &:first-of-type {
padding-left: toRpx(80); padding-left: toRpx(80);
} }
......
...@@ -595,15 +595,19 @@ export default { ...@@ -595,15 +595,19 @@ export default {
this.dateKey.staffCount = Date.now() this.dateKey.staffCount = Date.now()
}, },
handleBlur (e, i) { handleBlur (e, i) {
let { value } = e.detail let { value } = e.detail,
{ orderObj, userInfo } = this,
key = i.value
if (value) { if (value) {
let { orderObj, userInfo } = this let numbers = value.match(/\d+/g)
let key = i.value,
numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : '' numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString() this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey[key] = Date.now() this.dateKey[key] = Date.now()
} else {
this.orderObj[key] = ''
this.dateKey[key] = Date.now()
}
if ( if (
this.isNotEmpty(orderObj.recordStaffCount) && this.isNotEmpty(orderObj.recordStaffCount) &&
this.isNotEmpty(value) && this.isNotEmpty(value) &&
...@@ -624,7 +628,6 @@ export default { ...@@ -624,7 +628,6 @@ export default {
} }
this.$nextTick(() => this.$refs.reportNotice.open()) this.$nextTick(() => this.$refs.reportNotice.open())
} }
}
}, },
isNotEmpty (value) { isNotEmpty (value) {
return ( return (
...@@ -635,15 +638,19 @@ export default { ...@@ -635,15 +638,19 @@ export default {
) )
}, },
handleCarInputBlur (e, i, item, index) { handleCarInputBlur (e, i, item, index) {
let { value } = e.detail let { value } = e.detail,
{ key, max } = i
if (value) { if (value) {
let { key, max } = i, let numbers = value.match(/\d+/g)
numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : '' numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
item[key] = Math.min(Math.max(Number(numbers), 0), max).toString() item[key] = Math.min(Math.max(Number(numbers), 0), max).toString()
this.dateKey[`${key}_${index}`] = Date.now() this.dateKey[`${key}_${index}`] = Date.now()
} else {
item[key] = ''
this.dateKey[`${key}_${index}`] = Date.now()
} }
console.log(item[key])
}, },
async submit () { async submit () {
uni.showLoading({ uni.showLoading({
...@@ -660,7 +667,7 @@ export default { ...@@ -660,7 +667,7 @@ export default {
orderObj.sceneType = 1 orderObj.sceneType = 1
orderObj.brandDataList = carBandList orderObj.brandDataList = carBandList
if (orderObj.pickerValue == 0) { if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw { if (['', null].includes(orderObj.staffCount)) throw {
message: '今日驻店人数(按店)', message: '今日驻店人数(按店)',
refId: 'staffCount' refId: 'staffCount'
} }
......
...@@ -18,20 +18,29 @@ ...@@ -18,20 +18,29 @@
:titleList="titleList" :titleList="titleList"
@collapseAll="collapseAll" @collapseAll="collapseAll"
collapseControl collapseControl
@radioChange="radioChange"
> >
<!-- <template #goodsHtml> <template #goodsHtml>
<EquityGoods :externalData="orderObj" /> <EquityGoods
</template> --> :externalData="orderObj"
ref="goodsRef"
/>
</template>
<template #tireHtml> <template #tireHtml>
<template v-if="orderObj.tireFlag == 1"> <template v-if="orderObj.tireFlag == 1">
<EquityTire :externalData="orderObj" /> <EquityTire
:externalData="orderObj"
ref="tireRef"
/>
</template> </template>
</template> </template>
<template #uploadHtml> <template #uploadHtml>
hhh <EquityUpload ref="uplopdRef" />
</template> </template>
<template #conversion> <template #conversion>
改装 <template v-if="orderObj.inclueType == 1">
<EquityConversion ref="conversionRef" />
</template>
</template> </template>
</GlCell> </GlCell>
...@@ -82,15 +91,21 @@ import { EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, EQUITY_POPUP_ENUM } from '../ ...@@ -82,15 +91,21 @@ import { EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, EQUITY_POPUP_ENUM } from '../
import GlCell from '@/components/Form/GlCell.vue' import GlCell from '@/components/Form/GlCell.vue'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import EquityGoods from './EquityGoods/EquityGoods.vue' import EquityGoods from './EquityForm/EquityGoods.vue'
import EquityTire from './EquityGoods/EquityTire.vue' import EquityTire from './EquityForm/EquityTire.vue'
import EquityUpload from './EquityForm/EquityUpload.vue'
import EquityConversion from './EquityForm/EquityConversion.vue'
import NP from 'number-precision'
export default { export default {
name: 'CreateEquity', name: 'CreateEquity',
components: { components: {
GlCell, GlCell,
OrderPopup, OrderPopup,
EquityGoods, EquityGoods,
EquityTire EquityTire,
EquityUpload,
EquityConversion
}, },
data () { data () {
return { return {
...@@ -98,10 +113,7 @@ export default { ...@@ -98,10 +113,7 @@ export default {
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'),
orderObj: { orderObj: {
billingDate: dayjs().format('YYYY-MM-DD'),
effectiveDate: dayjs().add(1, 'day').format('YYYY-MM-DD'),
vehicleSeriesId: '', vehicleSeriesId: '',
ybAttachmentFlag: 1,
goodInfoList: [] goodInfoList: []
}, },
...@@ -110,16 +122,30 @@ export default { ...@@ -110,16 +122,30 @@ export default {
} }
}, },
computed: {
orderPopupRef () {
return this.$refs.orderPopup
}
},
mounted () { mounted () {
this.getServiceInfoDetail() this.getServiceInfoDetail()
}, },
methods: { methods: {
// 单选框change事件
radioChange (e, val) {
this.$set(this.orderObj, val.value, e.detail.value)
this.formList.map(k => {
k.map(i => {
if (i.value == val.value) i.current = e.detail.value
})
})
this.viewKey = Date.now()
},
handleCell (val) { handleCell (val) {
console.log(val) console.log(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()
this.popupType = Object.keys(EQUITY_POPUP_ENUM).find(key => EQUITY_POPUP_ENUM[key].key === val.key) * 1 this.popupType = Object.keys(EQUITY_POPUP_ENUM).find(key => EQUITY_POPUP_ENUM[key].key === val.key) * 1
this.$refs.orderPopup.open() this.orderPopupRef.open()
}, },
onConfirm (val) { onConfirm (val) {
const { chooseContent, popupType } = val, const { chooseContent, popupType } = val,
...@@ -142,15 +168,123 @@ export default { ...@@ -142,15 +168,123 @@ export default {
}, },
async getServiceInfoDetail () { async getServiceInfoDetail () {
const data = await uni.$api.equityApi.getServiceInfoDetail({ const data = await uni.$api.equityApi.getServiceInfoDetail({
contractNo: 'car998467117191905280' contractNo: 'car994817154207522816'
}) })
if (data.ybAttachmentFlag != 0) this.formList[3] = [] if (data.ybAttachmentFlag != 0) this.formList[3] = []
if (data.qsFlag != 1) this.formList[4] = [] if (data.qsFlag != 1) this.formList[4] = []
this.orderObj.goodInfoList = data.goodInfoList this.orderObj.goodInfoList = data.goodInfoList
this.orderObj.tireFlag = data.tireFlag this.orderObj.tireFlag = data.tireFlag
console.log(data) let carInfo = {},
this.orderObj = this.orderObj params = {}
if (data.vehicleShapeId) {
carInfo = {
carBrandText: `${data.vehicleBrandName}/${data.vehicleSubBrandName}/${data.vehicleSeriesName}/${data.vehicleShapeName}`,
vehicleShapeId: data.vehicleShapeId,
vehicleShapeName: data.vehicleShapeName,
vehicleSeriesId: data.vehicleSeriesId,
vehicleSeriesName: data.vehicleSeriesName,
vehicleBrandId: data.vehicleBrandId,
vehicleBrandName: data.vehicleBrandName,
vehicleSubBrandId: data.vehicleSubBrandId,
vehicleSubBrandName: data.vehicleSubBrandName,
}
}
if (!data.customerType) data.customerType = 1
if (data.customerType) {
const customerTypeEnum = this.orderPopupRef.componentObject[21].options
params = {
customerType: data.customerType,
customerTypeName: customerTypeEnum.find(i => i.optionId == data.customerType).optionLabel
}
}
if (data.cardType) {
const cardTypeEnum = this.orderPopupRef.componentObject[22].options
params.cardType = data.cardType
params.cardTypeName = cardTypeEnum.find(i => i.optionId == data.cardType).optionLabel
}
if (data.buyCarType == null) data.buyCarType = 1
if (data.buyCarType != null) {
const buyCarTypeEnum = this.orderPopupRef.componentObject[23].options
params.buyCarType = data.buyCarType
params.buyCarTypeName = buyCarTypeEnum.find(i => i.optionId == data.buyCarType).optionLabel
}
let priceList = ['actualSalesPrice']
data.goodInfoList.map((item, idx) => {
priceList.forEach(k => {
data.goodInfoList[idx][k] = item[k] === null ? null : (item[k] / 100).toFixed(2)
})
if (item.vehicleRegistrationDate) {
item.vehicleRegistrationDate = dayjs(item.vehicleRegistrationDate).format('YYYY-MM-DD')
}
if (item.buyDate) {
item.buyDate = dayjs(item.buyDate).format('YYYY-MM-DD')
}
if (item.qualityBeginDate) {
item.qualityBeginDate = dayjs(item.qualityBeginDate).format('YYYY-MM-DD')
}
if (item.itemsCode == 'YB0003') {
item.gearbox = item.gearbox || ''
item.vehicleNature = typeof item.vehicleNature == 'number' ? item.vehicleNature : 1
let val = constantData.vehicleNatureList.find(k => k.optionId == item.vehicleNature)
if (val) {
item.vehicleNatureName = val.optionLabel
}
}
if (item.printType == 2 && !['YB0001', 'YB0002', 'YB0003'].includes(item.itemsCode)) item.displacementPowerFlag = item.displacementPowerFlag || 0
})
// 判断购买商品是否全部是延保allWarrantyFlag
const allWarrantyFlag = data?.goodInfoList?.some(v => v.printType != 2),
codeToAttr = {
YB0001: 'invoice',
YB0003: 'driveFront',
YB0004: 'driveBack',
YB0002: 'contract',
YB0005: 'other',
QS0001: 'retrofitInvoice',
QS0002: 'retrofit'
},
imgObj = {}
this.formList.map(i => {
i.map(e => {
if (e.value == 'effectiveDate') e.hidden = !allWarrantyFlag //false 显示生效日期 true不显示
})
})
if ((data.ybAttachmentFlag == 0 || data.qsFlag == 1) && data.attachmentList?.length) {
data.attachmentList.forEach(item => {
imgObj[codeToAttr[item.attachmentCode]].push({ url: item.attachmentFile })
})
}
console.log(imgObj,'----')
Object.assign(this.orderObj, {
...data,
vin: data.vin,
invoicePrice: NP.divide(data.invoicePrice || 0, 100).toFixed(2),
seatesNum: data.seatesNum,
engineNo: data.engineNo,
vehicleColor: data.vehicleColor,
billingDate: data.billingDate || dayjs().format('YYYY-MM-DD'),
customerName: data.customerName,
customerPhone: data.customerPhone,
cardNo: data.cardNo,
customerAddress: data.customerAddress,
goodInfoList: data.goodInfoList,
effectiveDate: data.effectiveDate || dayjs().add(1, 'day').format('YYYY-MM-DD'),
tireFlag: data.tireFlag,
compensationName: data.compensationName || data.customerName,
attachmentList: data.attachmentList || [],
merchantName: data.merchantName,
merchantPhone: data.merchantPhone,
merchantAddress: data.merchantAddress,
imgObj,
inclueType: data.qsFlag == 1 ? 1 : '',
...carInfo,
...params
})
this.formList[4].map(e => {
if (e.value == 'inclueType') e.current = data.qsFlag == 1 ? 1 : ''
})
console.log(JSON.parse(JSON.stringify(this.orderObj)))
this.viewKey = Date.now() this.viewKey = Date.now()
}, },
collapseAll (index) { collapseAll (index) {
...@@ -158,9 +292,17 @@ export default { ...@@ -158,9 +292,17 @@ export default {
}, },
confirmCalendar (e, key) { confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate this.orderObj[key] = e.fulldate
} },
submit () {
const { orderObj } = this,
{ goodsRef, tireRef, uplopdRef, conversionRef } = this.$refs
console.log(goodsRef, tireRef, uplopdRef, conversionRef)
},
handleEditSave () {
} }
}
} }
</script> </script>
......
...@@ -680,16 +680,20 @@ export default { ...@@ -680,16 +680,20 @@ export default {
this.dateKey.staffCount = Date.now() this.dateKey.staffCount = Date.now()
}, },
handleBlur (e, i) { handleBlur (e, i) {
let { value } = e.detail let { value } = e.detail,
{ orderObj, userInfo } = this,
key = i.value
if (value) { if (value) {
let { orderObj, userInfo } = this let numbers = value.match(/\d+/g)
let key = i.value,
numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : '' numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString() this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey[key] = Date.now() this.dateKey[key] = Date.now()
console.log(key) console.log(key)
} else {
this.orderObj[key] = ''
this.dateKey[key] = Date.now()
}
if ( if (
this.isNotEmpty(orderObj.recordStaffCount) && this.isNotEmpty(orderObj.recordStaffCount) &&
orderObj.recordStaffCount != value && orderObj.recordStaffCount != value &&
...@@ -709,7 +713,6 @@ export default { ...@@ -709,7 +713,6 @@ export default {
} }
this.$nextTick(() => this.$refs.reportNotice.open()) this.$nextTick(() => this.$refs.reportNotice.open())
} }
}
}, },
isNotEmpty (value) { isNotEmpty (value) {
return ( return (
...@@ -720,18 +723,22 @@ export default { ...@@ -720,18 +723,22 @@ export default {
) )
}, },
handleCarInputBlur (e, i, item, index) { handleCarInputBlur (e, i, item, index) {
const { orderObj, let { orderObj,
userInfo, userInfo,
carBandList carBandList
} = this } = this,
let { value } = e.detail { value } = e.detail,
{ key, max } = i
if (value) { if (value) {
let { key, max } = i, let numbers = value.match(/\d+/g)
numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : '' numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
item[key] = Math.min(Math.max(Number(numbers), 0), max).toString() item[key] = Math.min(Math.max(Number(numbers), 0), max).toString()
this.dateKey[`${key}_${index}`] = Date.now() this.dateKey[`${key}_${index}`] = Date.now()
} else {
item[key] = ''
this.dateKey[`${key}_${index}`] = Date.now()
}
if (['deliveryCount', 'notDeliveryCount'].includes(key) && orderObj.onBreak == 'N') { if (['deliveryCount', 'notDeliveryCount'].includes(key) && orderObj.onBreak == 'N') {
let checkName = `${key}Record`, let checkName = `${key}Record`,
checkValue = carBandList[index][checkName] checkValue = carBandList[index][checkName]
...@@ -756,8 +763,6 @@ export default { ...@@ -756,8 +763,6 @@ export default {
this.$nextTick(() => this.$refs.reportNotice.open()) this.$nextTick(() => this.$refs.reportNotice.open())
} }
} }
console.log(key)
}
}, },
async submit () { async submit () {
uni.$track.add({ uni.$track.add({
...@@ -770,7 +775,7 @@ export default { ...@@ -770,7 +775,7 @@ export default {
orderObj.sceneType = 0 orderObj.sceneType = 0
orderObj.brandDataList = carBandList orderObj.brandDataList = carBandList
if (orderObj.pickerValue == 0) { if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw { if (['', null].includes(orderObj.staffCount)) throw {
message: '今日驻店人数(按店)', message: '今日驻店人数(按店)',
refId: 'staffCount' refId: 'staffCount'
} }
......
<template>
<view
class="upload-content"
:key="viewKey"
>
<view class="upload-box">
<view class="label">发票或收据</view>
<view class="upload-item">
<template v-if="imgObj.retrofitInvoice">
<image
class="img"
:src="imgObj.retrofitInvoice"
@click="previewMedia(imgObj.retrofitInvoice)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('retrofitInvoice')"
></uni-icons>
</view>
</template>
<template v-else>
<view
class="upload-component"
@click="chooseImage('retrofitInvoice')"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="text">上传照片</view>
</view>
</template>
</view>
</view>
<view class="upload-box">
<view class="label">加改装部位照片</view>
<view class="upload-item">
<template v-if="imgObj.retrofit">
<image
class="img"
:src="imgObj.retrofit"
@click="previewMedia(imgObj.retrofit)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('retrofit')"
></uni-icons>
</view>
</template>
<template v-else>
<view
class="upload-component"
@click="chooseImage('retrofit')"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="text">上传照片</view>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import { uploadFile } from '@/utils/ossUpload.js'
import permision from '@/js_sdk/wa-permission/permission.js'
export default {
name: 'EquityUpload',
props: {
externalData: null,
},
watch: {
externalData: {
handler (val) {
this.serviceInfo = val
},
deep: true,
immediate: true
}
},
data () {
return {
serviceInfo: {},
viewKey: Date.now(),
imgObj: {
other: []
}
}
},
mounted () {
},
methods: {
previewMedia (urls, index = 0) {
uni.previewImage({
current: index,
urls: Array.isArray(urls) ? urls : [urls],
})
},
delImage (key, index, isArray) {
if (isArray) this.imgObj[key].splice(index, 1)
else this.imgObj[key] = ''
this.viewKey = Date.now()
},
async chooseImage (key, isArray) {
let _this = this
try {
// #ifdef APP-PLUS
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
const camera = await permision.requestAndroidPermission('android.permission.CAMERA')
const isOnline = await uni.$isNetWork()
if (photoLibrary != 1) throw '您的设备不支持相册功能或未授权访问,请前往设置中开启相册权限'
if (camera != 1) throw '您的设备不支持摄像头功能或未授权访问,请前往设置中开启摄像头权限'
if (!isOnline) throw '当前无网络连接,请连接网络后重试'
// #endif
uni.chooseImage({
count: 1,
async success (res) {
uni.showLoading({ title: '上传中...', mask: true })
const url = await uploadFile(res.tempFiles[0], res.tempFilePaths[0])
if (isArray) _this.imgObj[key].push(url)
else _this.imgObj[key] = url
_this.viewKey = Date.now()
uni.hideLoading()
},
fail (err) {
uni.hideLoading()
if (err.errMsg.indexOf('cancel') === -1) {
return uni.showToast({
title: '图片上传失败',
icon: 'none'
})
}
},
})
} catch (error) {
uni.hideLoading()
return uni.showToast({
title: error,
icon: 'none'
})
}
},
}
}
</script>
<style scoped lang='scss'>
.upload-content {
padding: 32rpx 32rpx 0;
.upload-box {
display: flex;
margin-bottom: 32rpx;
.label {
width: 168rpx;
flex-shrink: 0;
margin-right: 32rpx;
}
.value {
gap: 16rpx;
flex-wrap: wrap;
}
.upload-item {
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
background: #f5f8ff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #999999;
font-size: 20rpx;
position: relative;
.del {
position: absolute;
width: toRpx(32);
height: toRpx(32);
background: #00000080;
border-radius: 100%;
top: toRpx(8);
right: toRpx(4);
justify-content: center;
}
.upload-component {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.icon {
font-weight: 700;
margin-bottom: toRpx(22);
}
.img {
width: 100%;
height: 100%;
}
.text {
width: 80%;
text-align: center;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -3,21 +3,48 @@ ...@@ -3,21 +3,48 @@
<GlCell <GlCell
:formList="[formList]" :formList="[formList]"
:formData="serviceInfo" :formData="serviceInfo"
@inputBlur="inputBlur"
@handleLabelTips="handleLabelTips" @handleLabelTips="handleLabelTips"
> >
<template #tireHtml> <template #tireHtml>
牛牛牛 <view class="tire-box">
<template v-for="(i,index) in tireList">
<view
class="tire-item"
:key="index"
>
<view class="label flex">
{{i.name}}
<template v-if="index == 0">
<view
class="tips"
@click="handleLabelTips(i)"
>位置示例</view>
</template>
</view>
<view class="content">
<GlCell
:formList="[i.list]"
:formData="serviceInfo"
:index="index"
:cellBoxStyle="cellBoxStyle"
/>
</view>
</view>
</template>
</view>
</template> </template>
</GlCell> </GlCell>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { TIRE_FORM_LIST } from './contant'
import { TIRE_FORM_LIST, TIRE_LIST } from './contant'
import utils from '@/utils/utils' import utils from '@/utils/utils'
import GlCell from '@/components/Form/GlCell.vue' import GlCell from '@/components/Form/GlCell.vue'
export default { export default {
name: 'EquityTire', name: 'EquityTire',
props: { props: {
...@@ -29,7 +56,9 @@ export default { ...@@ -29,7 +56,9 @@ export default {
data () { data () {
return { return {
formList: utils.deepClone(TIRE_FORM_LIST), formList: utils.deepClone(TIRE_FORM_LIST),
tireList: utils.deepClone(TIRE_LIST),
serviceInfo: {}, serviceInfo: {},
cellBoxStyle: 'background: #f5f7fa;',
} }
}, },
watch: { watch: {
...@@ -42,21 +71,38 @@ export default { ...@@ -42,21 +71,38 @@ export default {
} }
}, },
mounted () { mounted () {
console.log(this.formList)
}, },
methods: { methods: {
inputBlur (e, val) {
},
handleLabelTips (item) { handleLabelTips (item) {
let { tipsUrl } = item let { tipsUrl } = item
uni.previewImage({ uni.previewImage({
urls: [tipsUrl] urls: [tipsUrl]
}) })
} },
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.tire-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
padding: 0 32rpx;
gap: 16rpx 32rpx;
.tire-item {
.label {
height: 68rpx;
color: #999999;
font-size: 26rpx;
.tips {
color: #4673ff;
font-size: 24rpx;
margin-left: 8rpx;
}
}
.content {
border-radius: 16rpx;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<view
class="upload-content"
:key="viewKey"
>
<view class="upload-box">
<view class="label">购车发票</view>
<view class="upload-item">
<template v-if="imgObj.invoice">
<image
class="img"
:src="imgObj.invoice"
@click="previewMedia(imgObj.invoice)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('invoice')"
></uni-icons>
</view>
</template>
<template v-else>
<view
class="upload-component"
@click="chooseImage('invoice')"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="text">上传照片</view>
</view>
</template>
</view>
</view>
<view class="upload-box">
<view class="label">行驶证或车辆合格证</view>
<view class="value flex">
<view class="upload-item">
<template v-if="imgObj.driveFront">
<image
class="img"
:src="imgObj.driveFront"
@click="previewMedia(imgObj.driveFront)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('driveFront')"
></uni-icons>
</view>
</template>
<template v-else>
<view
class="upload-component"
@click="chooseImage('driveFront')"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="text">行驶证主页/车辆合格证</view>
</view>
</template>
</view>
<view class="upload-item">
<template v-if="imgObj.driveBack">
<image
class="img"
:src="imgObj.driveBack"
@click="previewMedia(imgObj.driveBack)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('driveBack')"
></uni-icons>
</view>
</template>
<template v-else>
<view
class="upload-component"
@click="chooseImage('driveBack')"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="text">行驶证副页/车辆合格证</view>
</view>
</template>
</view>
</view>
</view>
<view class="upload-box">
<view class="label">合同购买时里程数</view>
<view class="upload-item">
<template v-if="imgObj.contract">
<image
class="img"
:src="imgObj.contract"
@click="previewMedia(imgObj.contract)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('contract')"
></uni-icons>
</view>
</template>
<template v-else>
<view
class="upload-component"
@click="chooseImage('contract')"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="text">上传照片</view>
</view>
</template>
</view>
</view>
<view class="upload-box">
<view class="label">其他</view>
<view class="value flex">
<template v-if="imgObj.other.length < 9">
<view
class="upload-item"
@click="chooseImage('other',true)"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view>上传照片最多9张</view>
</view>
</template>
<template v-if="imgObj.other.length">
<template v-for="(i,index) in imgObj.other">
<view
class="upload-item"
:key="index"
>
<image
class="img"
:src="i"
@click="previewMedia(imgObj.other,index)"
/>
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage('other',index , true)"
></uni-icons>
</view>
</view>
</template>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import { uploadFile } from '@/utils/ossUpload.js'
import permision from '@/js_sdk/wa-permission/permission.js'
export default {
name: 'EquityUpload',
props: {
externalData: null,
},
watch: {
externalData: {
handler (val) {
this.serviceInfo = val
},
deep: true,
immediate: true
}
},
data () {
return {
serviceInfo: {},
viewKey: Date.now(),
imgObj: {
other: []
}
}
},
mounted () {
},
methods: {
previewMedia (urls, index = 0) {
uni.previewImage({
current: index,
urls: Array.isArray(urls) ? urls : [urls],
})
},
delImage (key, index, isArray) {
if (isArray) this.imgObj[key].splice(index, 1)
else this.imgObj[key] = ''
this.viewKey = Date.now()
},
async chooseImage (key, isArray) {
let _this = this
try {
// #ifdef APP-PLUS
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
const camera = await permision.requestAndroidPermission('android.permission.CAMERA')
const isOnline = await uni.$isNetWork()
if (photoLibrary != 1) throw '您的设备不支持相册功能或未授权访问,请前往设置中开启相册权限'
if (camera != 1) throw '您的设备不支持摄像头功能或未授权访问,请前往设置中开启摄像头权限'
if (!isOnline) throw '当前无网络连接,请连接网络后重试'
// #endif
uni.chooseImage({
count: 1,
async success (res) {
uni.showLoading({ title: '上传中...', mask: true })
const url = await uploadFile(res.tempFiles[0], res.tempFilePaths[0])
if (isArray) _this.imgObj[key].push(url)
else _this.imgObj[key] = url
_this.viewKey = Date.now()
uni.hideLoading()
},
fail (err) {
uni.hideLoading()
if (err.errMsg.indexOf('cancel') === -1) {
return uni.showToast({
title: '图片上传失败',
icon: 'none'
})
}
},
})
} catch (error) {
uni.hideLoading()
return uni.showToast({
title: error,
icon: 'none'
})
}
},
}
}
</script>
<style scoped lang='scss'>
.upload-content {
padding: 0 32rpx;
.upload-box {
display: flex;
margin-bottom: 32rpx;
.label {
width: 168rpx;
flex-shrink: 0;
margin-right: 32rpx;
}
.value {
gap: 16rpx;
flex-wrap: wrap;
}
.upload-item {
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
background: #f5f8ff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #999999;
font-size: 20rpx;
position: relative;
.del {
position: absolute;
width: toRpx(32);
height: toRpx(32);
background: #00000080;
border-radius: 100%;
top: toRpx(8);
right: toRpx(4);
justify-content: center;
}
.upload-component {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.icon {
font-weight: 700;
margin-bottom: toRpx(22);
}
.img {
width: 100%;
height: 100%;
}
.text {
width: 80%;
text-align: center;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -172,7 +172,6 @@ const oilProFormList = [ ...@@ -172,7 +172,6 @@ const oilProFormList = [
value: 'mileage', value: 'mileage',
type: 'input', type: 'input',
suffix: 'KM', suffix: 'KM',
labelWidth: 'var(--fontSize240)',
inputLimit: { inputLimit: {
type: 'digit', type: 'digit',
minVal: 0 minVal: 0
...@@ -197,20 +196,98 @@ const TIRE_FORM_LIST = [ ...@@ -197,20 +196,98 @@ const TIRE_FORM_LIST = [
value: 'tireBrand', value: 'tireBrand',
maxlength: '20', maxlength: '20',
type: 'input', type: 'input',
},
{
label: '轮胎规格',
value: 'tireScale',
maxlength: '20',
type: 'input',
labelTips: '位置示例', labelTips: '位置示例',
tipsUrl: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/equity/tire-tips-1.webp' tipsUrl: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/equity/tire-tips-1.webp'
}, },
{ {
hidden:true, hidden: true,
rowHtml:'tireHtml' rowHtml: 'tireHtml'
} }
] ]
const TIRE_LIST = [
{
name: '左前胎',
tipsUrl: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/equity/tire-tips-2.webp',
list: [
{
label: '轮胎DOT号',
value: 'leftFrontDTO',
type: 'input',
maxlength: '20',
},
{
label: '轮胎生产批次',
value: 'leftFrontBatch',
type: 'input',
maxlength: '20',
}
]
},
{
name: '右前胎',
list: [
{
label: '轮胎DOT号',
value: 'rightFrontDTO',
type: 'input',
maxlength: '20',
},
{
label: '轮胎生产批次',
value: 'rightFrontBatch',
type: 'input',
maxlength: '20',
}
]
},
{
name: '左后胎',
list: [
{
label: '轮胎DOT号',
value: 'leftRearDTO',
type: 'input',
maxlength: '20',
},
{
label: '轮胎生产批次',
value: 'leftRearBatch',
type: 'input',
maxlength: '20',
}
]
},
{
name: '右后胎',
list: [
{
label: '轮胎DOT号',
value: 'rightRearDTO',
type: 'input',
maxlength: '20',
},
{
label: '轮胎生产批次',
value: 'rightRearBatch',
type: 'input',
maxlength: '20',
}
]
}
]
export { export {
energyProFormList, energyProFormList,
equityProFormList, equityProFormList,
extendServiceFormList, extendServiceFormList,
oilProFormList, oilProFormList,
displacementPowerSwitch, displacementPowerSwitch,
TIRE_FORM_LIST TIRE_FORM_LIST,
TIRE_LIST
} }
...@@ -544,8 +544,8 @@ const EQUITY_FORM_LIST = [ ...@@ -544,8 +544,8 @@ const EQUITY_FORM_LIST = [
key: 'futureCalendar' key: 'futureCalendar'
}, },
{ {
hidden:true, hidden: true,
rowHtml:'tireHtml' rowHtml: 'tireHtml'
}, },
{ {
label: '购车类型', label: '购车类型',
...@@ -567,6 +567,22 @@ const EQUITY_FORM_LIST = [ ...@@ -567,6 +567,22 @@ const EQUITY_FORM_LIST = [
], ],
[ [
{ {
label: '含加改装件',
value: 'inclueType',
type: 'radio',
current: '1',
radioList: [
{
value: '1',
name: '是'
},
{
value: '2',
name: '否'
}
],
},
{
hidden: true, hidden: true,
rowHtml: 'conversion' rowHtml: 'conversion'
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!