Commit 96107765 by cen

feat: 新加车型提示

1 parent b01dbdf7
...@@ -228,7 +228,10 @@ Component({ ...@@ -228,7 +228,10 @@ Component({
// 品牌车型 // 品牌车型
handleJumpBrand(e) { handleJumpBrand(e) {
wx.$router.go('packageEquity.carBrands') const thisPage = wx.$router.getPageInstance()
const carTips = thisPage?.data?.carTips || ''
const url = carTips ? `packageEquity.carBrands?cartips=${encodeURIComponent(carTips)}` : 'packageEquity.carBrands'
wx.$router.go(url)
}, },
handleCellClick(e) { handleCellClick(e) {
......
...@@ -7,7 +7,8 @@ Page({ ...@@ -7,7 +7,8 @@ Page({
data: { data: {
inputHeight: 0, inputHeight: 0,
searchValue: '', searchValue: '',
scrollTop: 0 scrollTop: 0,
cartips: ''
}, },
/** /**
...@@ -20,6 +21,12 @@ Page({ ...@@ -20,6 +21,12 @@ Page({
}) })
}) })
if (options.level == 2) this.level = 2 if (options.level == 2) this.level = 2
// 接收 carTips 参数
if (options.cartips) {
this.setData({
cartips: decodeURIComponent(options.cartips)
})
}
carLifeApi.getCarBrandList().then(res => { carLifeApi.getCarBrandList().then(res => {
// this.setLocalStorage('wx_scrm_car_brand_list', carInfo) // this.setLocalStorage('wx_scrm_car_brand_list', carInfo)
const carInfo = res.data const carInfo = res.data
......
<!--packageEquity/pages/carEquity/carBrands/carBrands.wxml--> <!-- packageEquity/pages/carEquity/carBrands/carBrands.wxml -->
<view class="car-brands-box"> <view class="car-brands-box">
<view class="car-brands"> <view class="car-brands">
<view wx-if="{{cartips}}" class="cartips">{{cartips}}</view>
<search-input bindsearch="search" value="{{searchValue}}" id="search-input" /> <search-input bindsearch="search" value="{{searchValue}}" id="search-input" />
<scroll-view style="height:calc(100vh - {{inputHeight}}px);" scroll-y scroll-into-view="{{letter}}" scroll-top="{{scrollTopNum}}" bindscroll="scroll"> <scroll-view style="height:calc(100vh - {{inputHeight}}px);" scroll-y scroll-into-view="{{letter}}" scroll-top="{{scrollTopNum}}" bindscroll="scroll">
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
...@@ -25,27 +26,25 @@ ...@@ -25,27 +26,25 @@
<view class="nothing">暂无数据</view> <view class="nothing">暂无数据</view>
</block> </block>
</block> </block>
</scroll-view> </scroll-view>
<view class="side-bar" id="side-bar"> <view class="side-bar" id="side-bar">
<block wx:for="{{brandList}}" wx:key="index"> <block wx:for="{{brandList}}" wx:key="index">
<view data-letter="{{item.letter}}" class="view {{item.active?'active':''}}" capture-catch:touchstart="start" id="letter-{{item.letter}}" data-index="{{index}}" capture-catch:touchmove="move" capture-catch:touchend="end">{{item.letter}} <view data-letter="{{item.letter}}" class="view {{item.active?'active':''}}" capture-catch:touchstart="start" id="letter-{{item.letter}}" data-index="{{index}}" capture-catch:touchmove="move" capture-catch:touchend="end">
{{item.letter}}
</view> </view>
</block> </block>
</view> </view>
<!-- 提示 --> <!-- 提示 -->
<view class='tips' hidden='{{!showTip}}'>{{letter}}</view> <view class='tips' hidden='{{!showTip}}'>{{letter}}</view>
</view> </view>
<block wx:if="{{carSeriesList.length}}"> <block wx:if="{{carSeriesList.length}}">
<view class="car-type-box"> <view class="car-type-box">
<view class="bg" bindtap="cancel" ></view> <view class="bg" bindtap="cancel"></view>
<view class="brands-box"> <view class="brands-box">
<block wx:for="{{carSeriesList}}" wx:key="index"> <block wx:for="{{carSeriesList}}" wx:key="index">
<view class="title" bindtap="choose" data-item="{{item}}">{{item.name}} <view class="title" bindtap="choose" data-item="{{item}}">{{item.name}}</view>
</view>
</block> </block>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,15 @@ ...@@ -4,6 +4,15 @@
align-items: center; align-items: center;
transform: translateY(0); transform: translateY(0);
} }
.cartips {
border-radius: var(--fontSize16);
background: #fef4e8;
color: #ff9d0a;
font-size: var(--fontSize26);
font-weight: 400;
padding: var(--fontSize8) var(--fontSize16);
margin: var(--fontSize16) var(--fontSize32) 0 var(--fontSize32);
}
.car-brands-box { .car-brands-box {
width: 100%; width: 100%;
...@@ -15,12 +24,11 @@ ...@@ -15,12 +24,11 @@
position: relative; position: relative;
} }
.car-brands .title { .car-brands .title {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 2; z-index: 2;
background: #F7F8FA; background: #f7f8fa;
font-size: var(--fontSize24); font-size: var(--fontSize24);
color: #323233; color: #323233;
padding-left: var(--fontSize32); padding-left: var(--fontSize32);
...@@ -38,17 +46,17 @@ ...@@ -38,17 +46,17 @@
.list::after { .list::after {
position: absolute; position: absolute;
box-sizing: border-box; box-sizing: border-box;
content: ' '; content: " ";
pointer-events: none; pointer-events: none;
right: var(--fontSize32); right: var(--fontSize32);
bottom: 0; bottom: 0;
left: var(--fontSize32); left: var(--fontSize32);
border-bottom: var(--fontSize1) solid #ebedf0; border-bottom: var(--fontSize1) solid #ebedf0;
} }
.list .icon{ .list .icon {
width: var(--fontSize68); width: var(--fontSize68);
height: var(--fontSize68); height: var(--fontSize68);
margin-right: var(--fontSize8); margin-right: var(--fontSize8);
} }
.side-bar { .side-bar {
...@@ -59,7 +67,7 @@ ...@@ -59,7 +67,7 @@
color: #4c4c4c; color: #4c4c4c;
width: 10%; width: 10%;
opacity: 0; opacity: 0;
animation: show-side-bar .5s forwards; animation: show-side-bar 0.5s forwards;
} }
@keyframes show-side-bar { @keyframes show-side-bar {
...@@ -114,7 +122,7 @@ ...@@ -114,7 +122,7 @@
} }
@media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) { @media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
.side-bar{ .side-bar {
font-size: var(--fontSize18); font-size: var(--fontSize18);
} }
} }
...@@ -160,7 +168,7 @@ ...@@ -160,7 +168,7 @@
box-sizing: border-box; box-sizing: border-box;
padding-left: 32rpx; padding-left: 32rpx;
color: #969799; color: #969799;
background: #F7F8FA; background: #f7f8fa;
} }
.car-type-box .brands-box .brands-list { .car-type-box .brands-box .brands-list {
...@@ -168,15 +176,15 @@ ...@@ -168,15 +176,15 @@
box-sizing: border-box; box-sizing: border-box;
padding-left: 32rpx; padding-left: 32rpx;
border-bottom: 1rpx solid #e9e9e9; border-bottom: 1rpx solid #e9e9e9;
animation: show-car-type .25s forwards; animation: show-car-type 0.25s forwards;
} }
@keyframes show-car-type{ @keyframes show-car-type {
0%{ 0% {
min-height: 0; min-height: 0;
opacity: 0; opacity: 0;
} }
100%{ 100% {
min-height: 100rpx; min-height: 100rpx;
opacity: 1; opacity: 1;
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -332,4 +332,10 @@ module.exports = { ...@@ -332,4 +332,10 @@ module.exports = {
returnAll: true, returnAll: true,
}); });
}, },
/** 根据VIN查询查博士数据 */
queryByVin(data) {
return newApi.post(`/chaboshi/queryByVin`, data, {
returnAll: true,
});
},
}; };
...@@ -27,6 +27,7 @@ Page({ ...@@ -27,6 +27,7 @@ Page({
isEdit: false, // 是否为编辑模式 isEdit: false, // 是否为编辑模式
detailsInfo: null, // 详情数据(编辑模式使用) detailsInfo: null, // 详情数据(编辑模式使用)
statusMap, // 状态映射 statusMap, // 状态映射
carTips: "", // 车辆提示信息(从车架号识别获取)
// FirstStep 的 picker 状态(移到页面级别避免被 scroll-view 遮挡) // FirstStep 的 picker 状态(移到页面级别避免被 scroll-view 遮挡)
firstStepReferrerPicker: false, firstStepReferrerPicker: false,
firstStepDeliveryPicker: false, firstStepDeliveryPicker: false,
...@@ -517,7 +518,7 @@ Page({ ...@@ -517,7 +518,7 @@ Page({
reWrite(type, data) { reWrite(type, data) {
let { formData } = this.data; let { formData } = this.data;
console.log("ASCSAC",type); console.log("ASCSAC", type);
if (type === "licensePlate") { if (type === "licensePlate") {
// 行驶证识别 // 行驶证识别
// 根据返回数据结构映射到表单字段 // 根据返回数据结构映射到表单字段
...@@ -589,7 +590,6 @@ Page({ ...@@ -589,7 +590,6 @@ Page({
} }
}); });
const upperVin = formatVinInput(vin); const upperVin = formatVinInput(vin);
// 先验证车架号 // 先验证车架号
validateVin(upperVin) validateVin(upperVin)
.then((result) => { .then((result) => {
...@@ -658,21 +658,29 @@ Page({ ...@@ -658,21 +658,29 @@ Page({
if (vin) { if (vin) {
// 转换为大写 // 转换为大写
const upperVin = formatVinInput(vin); const upperVin = formatVinInput(vin);
newApi.queryByVin({ vin: upperVin }).then((res) => {
console.log(res, "res");
if (res.data.code == 0) {
const carTips = res.data.data.base.commonName || "";
this.setData({ carTips });
} else {
this.setData({ carTips: "" });
}
});
// 先验证车架号 // 先验证车架号
validateVin(upperVin) validateVin(upperVin)
.then((result) => { .then((result) => {
// validateVin 返回 { success, message, data, vin } // validateVin 返回 { success, message, data, vin }
// data 中包含后端接口返回的完整数据 // data 中包含后端接口返回的完整数据
let { valid } = result.data.data || {}; let { valid } = result.data.data || {};
// 将 valid 值赋值到 FirstStep 组件的 vinValid 属性 // 将 valid 值赋值到 FirstStep 组件的 vinValid 属性
const firstStepComponent = this.selectComponent("#FirstStep"); const firstStepComponent = this.selectComponent("#FirstStep");
if (firstStepComponent) { if (firstStepComponent) {
firstStepComponent.setData({ firstStepComponent.setData({
vinValid: valid, vinValid: valid,
}); });
} }
if (valid) { if (valid) {
// 验证通过,赋值到表单 // 验证通过,赋值到表单
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!