Commit c519e27a by cen

fix: j校验调整

1 parent 0061e546
......@@ -8,9 +8,8 @@ const HOST = {
merchant: merchantDomain,
ip: 'http://192.168.1.169:8292'
}
const request = new Request({
baseURL: `${HOST['eva']}`,
baseURL: `${HOST['eva']}${pathEnum.evaluation}`,
timeout: 300000,
appId: signSecretKey.appKey,
appSecret: signSecretKey.secret,
......@@ -43,6 +42,7 @@ const request = new Request({
},
error: (error, config) => {
console.log('error事件触发', error, config)
return Promise.reject(error)
},
logout: config => {
console.log('logout事件触发', config)
......
......@@ -197,6 +197,9 @@
.py-40 {
padding: toRpx(40) 0;
}
.px-16 {
padding: 0 toRpx(16);
}
.px-20 {
padding: 0 toRpx(20);
}
......

2.78 MB | W: | H:

2.78 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 index = 0
const index = 1
/**
*
0本地
......@@ -148,7 +148,7 @@ const pathEnum = {
merchants: '/rop-merchants/',
pad: '/rop-dj-pad/',
clue: '/rop-scrm-clue/',
evaluation: '/gsc-vcp-pad-facade/'
evaluation: '/gsc-vcp-pad-facade'
}
const CONFIG_ENV_MAP = {
1: 'develop',
......
......@@ -6,8 +6,8 @@
<text class="requiredLabel" v-if="field.required">*</text>
</view>
<template v-if="field.type === 'input'">
<input v-if="field.targetObj" :disabled="field.disabled" type="text" :placeholder="'请输入'" v-model="formData[field.targetObj][field.targetKey]" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<input v-else type="text" :disabled="field.disabled" :placeholder="'请输入'" v-model="formData[field.targetKey]" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" />
<input class="formInput" :min="field.min" :max="field.max" v-if="field.targetObj" :type="field.inputType || 'text'" :disabled="field.disabled" type="text" :placeholder="'请输入'" :maxlength="field.maxlength || 100" v-model="formData[field.targetObj][field.targetKey]" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<input class="formInput" :min="field.min" :max="field.max" v-else type="text" :type="field.inputType || 'text'" :disabled="field.disabled" :placeholder="'请输入'" v-model="formData[field.targetKey]" :maxlength="field.maxlength || 100" :pattern="field.pattern || ''" @input="e => handleInput(e, field)" @blur="e => handleBlur(e, field)" />
<view v-if="field.isScan" class="flex align-center scanBtn justify-center" @click.stop="scan('vinOcr')">
<view class="sprite-icon icon-scanIconX"></view>
</view>
......@@ -15,11 +15,22 @@
<template v-if="field.type === 'select'">
<view class="flex align-center from-value">
<template v-if="field.targetObj ? formData[field.targetObj][field.targetKey] : formData[field.targetKey]">
<template v-if="field.showText && userInfo && userInfo[field.showText]">
{{ userInfo[field.showText] }}
<text>|</text>
</template>
{{ field.targetObj ? formData[field.targetObj][field.targetNameKey] : formData[field.targetNameKey] }}
<view v-if="!field.isCar && !field.isCity && !field.isCarCity">
<template v-if="field.showText && userInfo && userInfo[field.showText]">
{{ userInfo[field.showText] }}
<text>|</text>
</template>
{{ field.targetObj ? formData[field.targetObj][field.targetNameKey] : formData[field.targetNameKey] }}
</view>
<view v-else-if="field.isCar">
{{ formData.carBaseReqDTO.carSeriesName + ' ' + formData.carBaseReqDTO.carTypeName }}
</view>
<view v-else-if="field.isCity">
{{ formData.carBaseReqDTO.registrationProvinceName + ' ' + formData.carBaseReqDTO.registrationCityName }}
</view>
<view v-else-if="field.isCarCity">
{{ formData.carBaseReqDTO.carProvinceName + ' ' + formData.carBaseReqDTO.carCityName }}
</view>
</template>
<template v-else>
<span class="placeholder">请选择</span>
......@@ -79,8 +90,8 @@
</view>
</view>
<view class="pdf-box flex align-center justify-between">
<view>
<!-- <view class="sprite-icon icon-icon-select"></view> -->
<view class="flex align-center">
<view class="sprite-icon icon-pdf"></view>
<text>二手车买卖补充协议</text>
</view>
<view class="flex align-center">
......@@ -161,7 +172,8 @@ export default {
this.$emit('inputChange', e, field)
},
handleBlur(e, field) {
let value = e.detail.value.trim()
console.log('handleBlur', e, field)
let value = e.target._value.trim() || e.detail.value.trim()
if (field.targetObj) {
if (this.formData[field.targetObj]) {
this.formData[field.targetObj][field.targetKey] = value
......@@ -249,13 +261,15 @@ export default {
color: #333333;
font-size: toRpx(28);
}
input {
.formInput {
border: 0;
flex: 1;
height: toRpx(40);
font-size: toRpx(28);
color: #333333;
padding: 0;
text-align: right;
outline: none;
}
.form-item-textarea {
flex-direction: column;
......
<template>
<GeneralPopup ref="carPopup" popupClass="carPopup" :list="list" :title="title">
<GeneralPopup ref="carPopup" popupClass="carPopup" :list="list" :title="title" @confirm="confirm">
<template v-slot:content>
<StepTab :steps="steps" :currentStep="currentStep" :clickable="true" @step-change="onStepChange" :isShowStepNumber="false"></StepTab>
<view class="list-component">
......@@ -45,7 +45,8 @@ export default {
selectedSeries: null,
selectedModel: null,
selectedYear: null,
loadingYearData: false // 添加加载状态标记
loadingYearData: false, // 添加加载状态标记
selectionResult: null
}
},
created() {
......@@ -134,7 +135,6 @@ export default {
}
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const signature = sign(params, secret)
console.log('签名结果:', signature)
return new Promise((resolve, reject) => {
uni.request({
url: 'http://qcdidicb.glsx.com.cn/router?method=glsx.accounts.base.car.types',
......@@ -148,7 +148,7 @@ export default {
success(result) {
console.log('请求结果:', result)
if (result.data && result.data.code === '0' && result.data.data && result.data.data.carinfos) {
model.childs = result.data.data.carinfos
model.childs = result.data.data.carinfos || []
this.loadingYearData = false
resolve(model.childs)
} else {
......@@ -165,6 +165,14 @@ export default {
open() {
console.log('Opening car selector popup')
this.$refs.carPopup.open()
return new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
},
confirm() {
console.log(this.selectionResult)
this.$emit('car-selected', this.selectionResult)
},
onStepChange(index) {
......@@ -223,13 +231,13 @@ export default {
} else if (this.currentStep === 3) {
this.selectedYear = item
const selectionResult = {
this.selectionResult = {
brand: this.selectedBrand,
series: this.selectedSeries,
model: this.selectedModel,
year: this.selectedYear
}
this.$emit('car-selected', selectionResult)
// 可选:关闭弹窗
// this.$refs.carPopup.close();
}
......
<template>
<GeneralPopup ref="carPopup" popupClass="carPopup" :list="list" :title="title">
<GeneralPopup ref="carPopup" popupClass="carPopup" :list="list" :title="title" @confirm="handleConfirm">
<template v-slot:content>
<StepTab :steps="steps" :currentStep="currentStep" :clickable="true" @step-change="onStepChange" :isShowStepNumber="false"></StepTab>
<view class="list-component">
......@@ -37,15 +37,15 @@ export default {
currentSelectedId: null,
steps: [
{ label: '选择省份', number: 1 },
{ label: '选择市', number: 2 },
{ label: '选择区', number: 3 }
{ label: '选择市', number: 2 }
],
carBrandData: [],
selectedBrand: null,
selectedSeries: null,
selectedModel: null,
selectedYear: null,
loadingYearData: false // 添加加载状态标记
loadingYearData: false, // 添加加载状态标记
selectionResult: null
}
},
......@@ -59,12 +59,12 @@ export default {
case 1:
data = (this.selectedBrand?.districts || []).map(item => this.addLetterToItem(item))
break
case 2:
data = (this.selectedSeries?.districts || []).map(item => this.addLetterToItem(item))
break
case 3:
data = (this.selectedModel?.districts || []).map(item => this.addLetterToItem(item))
break
// case 2:
// data = (this.selectedSeries?.districts || []).map(item => this.addLetterToItem(item))
// break
// case 3:
// data = (this.selectedModel?.districts || []).map(item => this.addLetterToItem(item))
// break
default:
data = []
}
......@@ -155,17 +155,6 @@ export default {
this.currentStep = 0
} else if (index === 1 && this.selectedBrand) {
this.currentStep = 1
} else if (index === 2 && this.selectedSeries) {
this.currentStep = 2
} else if (index === 3 && this.selectedModel) {
// 如果还没有年份数据,则加载
if (!this.selectedModel.districts || this.selectedModel.districts.length === 0) {
this.loadYearDataForModel(this.selectedModel).then(() => {
this.currentStep = 3
})
} else {
this.currentStep = 3
}
}
// 重置当前步骤的选中ID
......@@ -188,19 +177,12 @@ export default {
this.selectedSeries = item
this.selectedModel = null
this.selectedYear = null
this.currentStep = 2
this.$emit('series-selected', item)
} else if (this.currentStep === 2) {
this.selectedModel = item
this.selectedYear = null
this.$emit('model-selected', item)
// 当点击第三层车型选择时,才去请求第四级数据
// this.loadYearDataForModel(item).then(years => {
// if (years && years.length > 0) {
// this.currentStep = 3
// }
// this.$emit('model-selected', item)
// })
}
this.selectionResult = {
province: this.selectedBrand,
city: this.selectedSeries
}
},
......@@ -298,6 +280,11 @@ export default {
console.error('获取首字母失败:', error)
return { ...item, letter: '#' }
}
},
handleConfirm() {
console.log(this.selectionResult)
this.$emit('city-selected', this.selectionResult)
}
}
}
......
<template>
<view class="stepper-navigation" :class="direction">
<view class="stepper-container">
<view v-for="(step, index) in steps" :key="index" class="step-item">
<!-- 左侧点线区域 -->
<view class="step-left-area">
<view class="step-number-circle" :class="{ active: currentStep >= index + 1 }">
<!-- 激活状态下显示三个圆圈 -->
<view v-if="currentStep >= index + 1" class="circle-group">
<view class="circle circle-1"></view>
<view class="circle circle-2"></view>
<view class="circle circle-3"></view>
</view>
</view>
<!-- 连接线 - 动态适应距离 -->
<view v-if="index < steps.length - 1" class="dash-line-wrapper">
<view class="dash-line" :class="{ active: currentStep >= index + 2 }"></view>
</view>
</view>
<!-- 右侧名称和内容区域 -->
<view class="step-right-area">
<view class="step-name" :class="{ active: currentStep >= index + 1 }">
{{ step.roundNo ? `第${step.roundNo}轮报价` : '编辑记录' }}
</view>
<!-- 可自定义添加其他内容 -->
<slot :step="step" :indexContent="index"></slot>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'StepperNavigation',
props: {
// 当前步骤,从1开始
currentStep: {
type: Number,
default: 1
},
// 步骤数据数组,每项可以包含name属性
steps: {
type: Array,
default: () => [{ name: '步骤1' }, { name: '步骤2' }, { name: '步骤3' }]
},
// 显示方向:'horizontal'(水平) 或 'vertical'(垂直)
direction: {
type: String,
default: 'horizontal',
validator: value => {
return ['horizontal', 'vertical'].includes(value)
}
}
}
}
</script>
<style scoped lang="scss">
// 基础样式
.stepper-navigation {
/* 基础样式 */
}
/* 步骤容器 */
.stepper-container {
padding: toRpx(32) 0;
}
/* 步骤项 */
.step-item {
display: flex;
margin-bottom: toRpx(16);
}
/* 左侧点线区域 */
.step-left-area {
display: flex;
flex-direction: column;
align-items: center;
margin-right: toRpx(16);
position: relative;
}
/* 步骤数字圆圈 */
.step-number-circle {
width: toRpx(40);
height: toRpx(40);
display: flex;
align-items: center;
justify-content: center;
position: relative;
flex-shrink: 0;
}
/* 不激活状态 - 一个圆圈 */
.step-number-circle::before {
content: '';
width: toRpx(20);
height: toRpx(20);
border-radius: 50%;
background: #8eb2fb;
position: absolute;
z-index: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* 激活状态 - 三个圆圈组 */
.step-number-circle.active {
background: transparent;
}
.step-number-circle.active::before {
display: none;
}
/* 三个圆圈的样式 */
.circle-group {
position: relative;
width: toRpx(40);
height: toRpx(40);
display: flex;
align-items: center;
justify-content: center;
}
.circle {
position: absolute;
border-radius: 50%;
}
/* 三个圆圈的定位和大小 */
.circle-1 {
width: toRpx(14);
height: toRpx(14);
z-index: 3;
background: #ffffff;
border: 2rpx solid #4673ff;
}
.circle-2 {
width: toRpx(20);
height: toRpx(20);
z-index: 2;
background: #4673ff;
}
.circle-3 {
width: toRpx(36);
height: toRpx(36);
z-index: 1;
background: #d6e4ff;
}
/* 右侧名称和内容区域 */
.step-right-area {
display: flex;
flex-direction: column;
justify-content: center;
flex: 1;
}
.step-name {
color: #333333;
font-size: toRpx(32);
font-weight: 500;
word-wrap: break-word;
white-space: normal;
margin-bottom: toRpx(20);
}
/* 连接线容器 */
.dash-line-wrapper {
flex: 1;
display: flex;
align-items: center;
min-height: toRpx(48);
}
/* 连接线样式 */
.dash-line {
width: toRpx(4);
background: #d7e7fe;
flex: 1;
height: 100%;
}
.dash-line.active {
background: #4673ff;
}
/* 水平方向特定样式 */
.horizontal .stepper-container {
display: flex;
flex-wrap: wrap;
}
.horizontal .step-item {
flex-direction: column;
align-items: center;
margin-right: toRpx(32);
margin-bottom: toRpx(0);
}
.horizontal .step-left-area {
flex-direction: row;
margin-right: 0;
margin-bottom: toRpx(16);
}
.horizontal .step-right-area {
align-items: center;
}
.horizontal .dash-line-wrapper {
min-width: toRpx(64);
min-height: 0;
margin: 0 toRpx(16);
}
.horizontal .dash-line {
height: toRpx(4);
width: 100%;
}
</style>
<!-- evaluationCard.vue -->
<template>
<view class="card-box">
<view class="card-box" v-if="carInfo.evalOrderNo">
<view class="flex align-center justify-between mb-24">
<view class="status-box">
<text class="label">工单编号:</text>
......
......@@ -17,7 +17,7 @@
</view>
<radio-group class="radio-group flex align-center" @change="radioChange">
<label class="uni-list-cell uni-list-cell-pd align-center flex ml-48" v-for="(item, index) in radioList" :key="item.value">
<radio style="transform: scale(0.7)" :value="item.value" :checked="index + 1 === current" />
<radio style="transform: scale(0.7)" :value="item.value" :checked="current === index" />
<view class="radio-name">{{ item.name }}</view>
</label>
</radio-group>
......@@ -30,7 +30,7 @@
<view class="h2-title mt-32">签约个人信息</view>
<view class="sign-info-box">
<view v-if="formData.paymentType" class="fromBox">
<FormCell :formFields="formFields" :formData="formData" @handleCell="handleCell" @inputChange="handleInputChange" @inputInvalid="handleInputInvalid" />
<FormCell :formFields="formFields" :formData="formData" @handleCell="handleCell" @inputChange="handleInputChange" @inputInvalid="handleInputInvalid" @blurChange="blurChange" />
<view class="upload-container mb-24">
<view class="form-item flex align-center justify-between">
<view class="from-label">身份证正面</view>
......@@ -267,7 +267,7 @@ export default {
comfirmPage: false,
signInfo: {},
selectDate: '',
current: 0,
current: null,
noDataBg: require('@/assets/images/common/sign-no-data.png'),
radioList: [
{
......@@ -387,6 +387,7 @@ export default {
},
formFields: [
{
// 定金字段 - 仅在paymentType=1时显示
key: 'depositPrice',
label: '定金金额',
required: true,
......@@ -397,9 +398,11 @@ export default {
targetKey: 'depositPrice',
targetObj: '',
type: 'input',
pattern: '^\\d*$' // 只允许数字输入
pattern: '^\\d*$', // 只允许数字输入
disabled: true
},
{
// 尾款字段 - 仅在paymentType=1时显示
key: 'finalPrice',
label: '尾款金额',
required: true,
......@@ -410,8 +413,30 @@ export default {
targetKey: 'finalPrice',
targetObj: '',
type: 'input',
pattern: '^\\d*$' // 只允许数字输入
pattern: '^\\d*$', // 只允许数字输入
visible: function () {
// 添加visible属性控制显示
return this.formData.paymentType === 1
}
},
// {
// // 全款字段 - 仅在paymentType=2时显示
// key: 'fullPrice',
// label: '全款金额',
// required: true,
// fullWidth: false,
// targetNameKey: 'sellerName',
// sourceNameKey: 'staffName',
// sourceKey: 'uuid',
// targetKey: 'fullPrice',
// targetObj: '',
// type: 'input',
// pattern: '^\\d*$', // 只允许数字输入
// visible: function () {
// // 添加visible属性控制显示
// return this.formData.paymentType === 2
// }
// },
{
key: 'evalPrice',
label: '评估价',
......@@ -444,7 +469,9 @@ export default {
sourceNameKey: 'staffName',
sourceKey: 'uuid',
targetKey: 'phone',
type: 'input'
type: 'input',
inputType: 'number',
pattern: '^[0-9]{11}$'
},
{
key: 'idCard',
......@@ -604,12 +631,34 @@ export default {
console.log('radioChange', e)
const value = e.detail.value
this.formData.paymentType = value
if (value === 1) {
this.formData.fullPrice = this.$route.query.evalPrice
// 定金+尾款模式
// 如果之前有填写全款金额,则将其分配给定金和尾款
if (this.formData.fullPrice > 0) {
this.formData.depositPrice = Math.round(this.formData.fullPrice * 0.3) // 例如30%作为定金
this.formData.finalPrice = this.formData.fullPrice - this.formData.depositPrice
}
// 确保评估价已设置
if (this.$route.query.evalPrice && !this.formData.fullPrice) {
this.formData.fullPrice = this.$route.query.evalPrice
}
} else if (value === 2) {
// 全款模式
// 如果之前有填写定金和尾款,则计算总和作为全款金额
if (this.formData.depositPrice > 0 || this.formData.finalPrice > 0) {
this.formData.fullPrice = parseInt(this.formData.depositPrice || 0) + parseInt(this.formData.finalPrice || 0)
}
// 确保评估价已设置
if (this.$route.query.evalPrice && !this.formData.fullPrice) {
this.formData.fullPrice = this.$route.query.evalPrice
}
}
// 设置当前选中的索引
this.current = this.radioList.findIndex(item => item.value === value)
},
blurChange(value, field) {},
checkboxChange(e) {
console.log('checkboxChange', e.detail.value)
// 创建结果对象,将选中的key设为1,未选中的设为0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!