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 @@
* 19: 客户档案
* 20: 战败客户档案
* 21: 客户类型
* 22: 证件类型
* 23: 购车类型
* 24: 车辆使用性质
* 25: 选择品牌车系
* 26: 变速箱类型
*/
const componentConfig = {
......
......@@ -215,7 +215,7 @@ export default {
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
}
},
},
mounted () {
},
......
......@@ -186,6 +186,7 @@ export default {
padding: 0 toRpx(40);
flex-shrink: 0;
position: relative;
background-color: #eef4fe;
&:first-of-type {
padding-left: toRpx(80);
}
......
......@@ -595,35 +595,38 @@ export default {
this.dateKey.staffCount = Date.now()
},
handleBlur (e, i) {
let { value } = e.detail
let { value } = e.detail,
{ orderObj, userInfo } = this,
key = i.value
if (value) {
let { orderObj, userInfo } = this
let key = i.value,
numbers = value.match(/\d+/g)
let numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey[key] = Date.now()
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
this.isNotEmpty(value) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) {
this.noticeObj = {
title: '重要提示',
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
} else {
this.orderObj[key] = ''
this.dateKey[key] = Date.now()
}
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
this.isNotEmpty(value) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) {
this.noticeObj = {
title: '重要提示',
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
},
isNotEmpty (value) {
......@@ -635,15 +638,19 @@ export default {
)
},
handleCarInputBlur (e, i, item, index) {
let { value } = e.detail
let { value } = e.detail,
{ key, max } = i
if (value) {
let { key, max } = i,
numbers = value.match(/\d+/g)
let numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
item[key] = Math.min(Math.max(Number(numbers), 0), max).toString()
this.dateKey[`${key}_${index}`] = Date.now()
} else {
item[key] = ''
this.dateKey[`${key}_${index}`] = Date.now()
}
console.log(item[key])
},
async submit () {
uni.showLoading({
......@@ -660,7 +667,7 @@ export default {
orderObj.sceneType = 1
orderObj.brandDataList = carBandList
if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw {
if (['', null].includes(orderObj.staffCount)) throw {
message: '今日驻店人数(按店)',
refId: 'staffCount'
}
......
......@@ -18,20 +18,29 @@
:titleList="titleList"
@collapseAll="collapseAll"
collapseControl
@radioChange="radioChange"
>
<!-- <template #goodsHtml>
<EquityGoods :externalData="orderObj" />
</template> -->
<template #goodsHtml>
<EquityGoods
:externalData="orderObj"
ref="goodsRef"
/>
</template>
<template #tireHtml>
<template v-if="orderObj.tireFlag == 1">
<EquityTire :externalData="orderObj" />
<EquityTire
:externalData="orderObj"
ref="tireRef"
/>
</template>
</template>
<template #uploadHtml>
hhh
<EquityUpload ref="uplopdRef" />
</template>
<template #conversion>
改装
<template v-if="orderObj.inclueType == 1">
<EquityConversion ref="conversionRef" />
</template>
</template>
</GlCell>
......@@ -82,15 +91,21 @@ import { EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, EQUITY_POPUP_ENUM } from '../
import GlCell from '@/components/Form/GlCell.vue'
import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs'
import EquityGoods from './EquityGoods/EquityGoods.vue'
import EquityTire from './EquityGoods/EquityTire.vue'
import EquityGoods from './EquityForm/EquityGoods.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 {
name: 'CreateEquity',
components: {
GlCell,
OrderPopup,
EquityGoods,
EquityTire
EquityTire,
EquityUpload,
EquityConversion
},
data () {
return {
......@@ -98,10 +113,7 @@ export default {
titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST),
endDate: dayjs().format('YYYY-MM-DD'),
orderObj: {
billingDate: dayjs().format('YYYY-MM-DD'),
effectiveDate: dayjs().add(1, 'day').format('YYYY-MM-DD'),
vehicleSeriesId: '',
ybAttachmentFlag: 1,
goodInfoList: []
},
......@@ -110,16 +122,30 @@ export default {
}
},
computed: {
orderPopupRef () {
return this.$refs.orderPopup
}
},
mounted () {
this.getServiceInfoDetail()
},
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) {
console.log(val)
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.$refs.orderPopup.open()
this.orderPopupRef.open()
},
onConfirm (val) {
const { chooseContent, popupType } = val,
......@@ -142,15 +168,123 @@ export default {
},
async getServiceInfoDetail () {
const data = await uni.$api.equityApi.getServiceInfoDetail({
contractNo: 'car998467117191905280'
contractNo: 'car994817154207522816'
})
if (data.ybAttachmentFlag != 0) this.formList[3] = []
if (data.qsFlag != 1) this.formList[4] = []
this.orderObj.goodInfoList = data.goodInfoList
this.orderObj.tireFlag = data.tireFlag
console.log(data)
this.orderObj = this.orderObj
let carInfo = {},
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()
},
collapseAll (index) {
......@@ -158,8 +292,16 @@ export default {
},
confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate
}
},
submit () {
const { orderObj } = this,
{ goodsRef, tireRef, uplopdRef, conversionRef } = this.$refs
console.log(goodsRef, tireRef, uplopdRef, conversionRef)
},
handleEditSave () {
}
}
}
</script>
......
......@@ -680,35 +680,38 @@ export default {
this.dateKey.staffCount = Date.now()
},
handleBlur (e, i) {
let { value } = e.detail
let { value } = e.detail,
{ orderObj, userInfo } = this,
key = i.value
if (value) {
let { orderObj, userInfo } = this
let key = i.value,
numbers = value.match(/\d+/g)
let numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey[key] = Date.now()
console.log(key)
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) {
this.noticeObj = {
title: '重要提示',
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
} else {
this.orderObj[key] = ''
this.dateKey[key] = Date.now()
}
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) {
this.noticeObj = {
title: '重要提示',
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
},
isNotEmpty (value) {
......@@ -720,43 +723,45 @@ export default {
)
},
handleCarInputBlur (e, i, item, index) {
const { orderObj,
let { orderObj,
userInfo,
carBandList
} = this
let { value } = e.detail
} = this,
{ value } = e.detail,
{ key, max } = i
if (value) {
let { key, max } = i,
numbers = value.match(/\d+/g)
let numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
item[key] = Math.min(Math.max(Number(numbers), 0), max).toString()
this.dateKey[`${key}_${index}`] = Date.now()
if (['deliveryCount', 'notDeliveryCount'].includes(key) && orderObj.onBreak == 'N') {
let checkName = `${key}Record`,
checkValue = carBandList[index][checkName]
if (
this.isNotEmpty(item[key]) &&
this.isNotEmpty(carBandList[index][checkName]) &&
checkValue != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid) {
let context = i.label
this.noticeObj = {
title: '重要提示',
text: `${context}与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,${context}将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
} else {
item[key] = ''
this.dateKey[`${key}_${index}`] = Date.now()
}
if (['deliveryCount', 'notDeliveryCount'].includes(key) && orderObj.onBreak == 'N') {
let checkName = `${key}Record`,
checkValue = carBandList[index][checkName]
if (
this.isNotEmpty(item[key]) &&
this.isNotEmpty(carBandList[index][checkName]) &&
checkValue != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid) {
let context = i.label
this.noticeObj = {
title: '重要提示',
text: `${context}与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,${context}将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
console.log(key)
}
},
async submit () {
......@@ -770,7 +775,7 @@ export default {
orderObj.sceneType = 0
orderObj.brandDataList = carBandList
if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw {
if (['', null].includes(orderObj.staffCount)) throw {
message: '今日驻店人数(按店)',
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
......@@ -3,21 +3,48 @@
<GlCell
:formList="[formList]"
:formData="serviceInfo"
@inputBlur="inputBlur"
@handleLabelTips="handleLabelTips"
>
<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>
</GlCell>
</view>
</template>
<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 GlCell from '@/components/Form/GlCell.vue'
export default {
name: 'EquityTire',
props: {
......@@ -29,7 +56,9 @@ export default {
data () {
return {
formList: utils.deepClone(TIRE_FORM_LIST),
tireList: utils.deepClone(TIRE_LIST),
serviceInfo: {},
cellBoxStyle: 'background: #f5f7fa;',
}
},
watch: {
......@@ -42,21 +71,38 @@ export default {
}
},
mounted () {
console.log(this.formList)
},
methods: {
inputBlur (e, val) {
},
handleLabelTips (item) {
let { tipsUrl } = item
uni.previewImage({
urls: [tipsUrl]
})
}
},
}
}
</script>
<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>
\ 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
......@@ -172,7 +172,6 @@ const oilProFormList = [
value: 'mileage',
type: 'input',
suffix: 'KM',
labelWidth: 'var(--fontSize240)',
inputLimit: {
type: 'digit',
minVal: 0
......@@ -197,20 +196,98 @@ const TIRE_FORM_LIST = [
value: 'tireBrand',
maxlength: '20',
type: 'input',
},
{
label: '轮胎规格',
value: 'tireScale',
maxlength: '20',
type: 'input',
labelTips: '位置示例',
tipsUrl: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/equity/tire-tips-1.webp'
},
{
hidden:true,
rowHtml:'tireHtml'
hidden: true,
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 {
energyProFormList,
equityProFormList,
extendServiceFormList,
oilProFormList,
displacementPowerSwitch,
TIRE_FORM_LIST
TIRE_FORM_LIST,
TIRE_LIST
}
......@@ -544,8 +544,8 @@ const EQUITY_FORM_LIST = [
key: 'futureCalendar'
},
{
hidden:true,
rowHtml:'tireHtml'
hidden: true,
rowHtml: 'tireHtml'
},
{
label: '购车类型',
......@@ -567,6 +567,22 @@ const EQUITY_FORM_LIST = [
],
[
{
label: '含加改装件',
value: 'inclueType',
type: 'radio',
current: '1',
radioList: [
{
value: '1',
name: '是'
},
{
value: '2',
name: '否'
}
],
},
{
hidden: true,
rowHtml: 'conversion'
}
......@@ -627,6 +643,6 @@ const EQUITY_POPUP_ENUM = {
25: {
key: 'carBrand'
}
}
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList, UpdateOrderInfo, defeat_titleList, EQUITY_FORM_LIST, EQUITY_FORM_TITLE_LIST, EQUITY_POPUP_ENUM }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!