Commit d60131a7 by 李伟康

fix(components): 修复 GlCell 和 SkuGoodsList 中的 key 及样式问题

- 为 `GlCell.vue` 中的 `view` 元素添加 `:key="idx"` 以解决 Vue 列表渲染警告
- 调整 radio 样式缩放值,优化显示效果
- 修正 `SkuGoodsList.vue` 中删除选中项时索引查找逻辑,确保正确移除对应元素
- 增加 `word-break: break-all` 样式以防止商品名称换行异常

fix(pages): 优化订单创建页面 VIN 校验与报价信息处理

- 将 VIN 码校验提取至工具函数 `utils.validateVIN` 统一管理
- 在获取权益订单报价信息时增加错误捕获并提示用户
- 补充价格转换处理,保证数据精度
- 改进支付方式选择逻辑,支持回显已选类型
- 提交前对订单价格进行 hundred 倍数处理以适配后端接口要求
1 parent dc719d4d
......@@ -23,7 +23,7 @@
</view>
</template>
<template v-for="(item, idx) in items">
<view v-if="!item.hidden">
<view v-if="!item.hidden" :key="idx">
<view
class="cell-row"
:key="idx"
......@@ -93,7 +93,7 @@
:key="radio.value + item.value"
>
<radio
style="transform: scale(0.7)"
style="transform: scale(0.65) translateY(-3px)"
:value="radio.value"
:disabled="item.disabled || radio.disabled"
:checked="radio.value == item.current"
......
......@@ -341,17 +341,26 @@ export default {
let { goodsId } = i.goods
id = String(goodsId)
}
let { currentIds } = this,
index = currentIds.indexOf(id)
if (index == -1) {
let { currentIds, chooseList } = this,
delIndex = currentIds.indexOf(id)
if (delIndex == -1) {
this.currentIds.push(id)
this.chooseList.push(i)
} else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
this.currentIds.splice(delIndex, 1)
const delChooseIndex = chooseList.findIndex(e => {
let chooseId = ''
if (e.goodsFlag == 3) chooseId = e.packageGoods.packageCode
if (e.goodsFlag == 1) chooseId = String(e.goods.goodsId)
if (e.goodsFlag == i.goodsFlag) {
if (id == chooseId) return e
}
})
if (delChooseIndex != -1) this.chooseList.splice(delChooseIndex, 1)
}
this.$emit('choose', this.chooseList)
}
this.$emit('choose', this.chooseList)
} catch (error) {
console.log(error)
}
......@@ -374,7 +383,6 @@ export default {
chooseList.map(e => {
if (e.goodsFlag == 2) ids.push(e.multipleSpecificationsGoods.id)
})
return ids.includes(i.multipleSpecificationsGoods.id)
}
if (goodsFlag == 3) id = packageGoods.packageCode
......@@ -551,9 +559,10 @@ export default {
.title {
min-height: toRpx(88);
padding: toRpx(24) 0 toRpx(20);
.goods-name {
max-width: 80%;
}
}
.goods-name {
max-width: 80%;
word-break: break-all;
}
.base-tips {
margin-bottom: 20rpx;
......
......@@ -431,15 +431,7 @@ export default {
}
if (this.orderObj.standNo) {
const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/
console.log(this.orderObj.standNo, vinRex.test(this.orderObj.standNo))
if (!vinRex.test(this.orderObj.standNo)) {
uni.showToast({
title: `请输入正确的VIN码`,
icon: 'none'
})
return false
}
if (!utils.validateVIN(this.orderObj.standNo)) throw '车架号校验不匹配,请核对后重新输入'
}
// 处理onlyLabel为true的特殊校验
......
......@@ -102,7 +102,7 @@ const FORM_LIST = [
value: 'carBrandText',
type: 'select',
key: 'carBrand',
required:false
required: false
},
{
label: '车辆颜色',
......@@ -115,7 +115,7 @@ const FORM_LIST = [
value: 'carVin',
maxlength: '17',
type: 'input',
required:false
required: false
},
{
label: '座位数',
......@@ -129,7 +129,8 @@ const FORM_LIST = [
value: 'price',
maxlength: '8',
type: 'input',
required: true
required: true,
inputType: 'digit'
}
],
[
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!