Commit f59a562f by 胡悦

refactor: 移除LogCat中未使用的Android相关代码并优化评估表单详情页的tab显示逻辑

移除LogCat.js中注释掉的Android平台特定代码,简化实现
在evaluationFormDetails.vue中动态控制tab显示,根据数据存在性决定是否展示对应tab
1 parent ca9812bd
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
<view class="box-class mt-16"> <view class="box-class mt-16">
<view class="tab-container"> <view class="tab-container">
<scroll-view scroll-x enable-flex class="tab-scroll"> <scroll-view scroll-x enable-flex class="tab-scroll">
<view v-for="(tab, index) in tabs" :key="index" :class="['tab-item', { active: activeTab === index }]" @click.stop="switchTab(index)"> <template v-for="(tab, index) in tabs">
<view :key="index" v-if="!tab.hidden" :class="['tab-item', { active: activeTab === index }]" @click.stop="switchTab(index)">
{{ tab.name }} {{ tab.name }}
</view> </view>
</template>
</scroll-view> </scroll-view>
</view> </view>
<view class="tab-panel" :class="{ 'no-bac': activeTab != 1 && activeTab != 0 }"> <view class="tab-panel" :class="{ 'no-bac': activeTab != 1 && activeTab != 0 }">
...@@ -382,11 +384,11 @@ export default { ...@@ -382,11 +384,11 @@ export default {
{ name: '车辆信息', key: 'carInfo' }, { name: '车辆信息', key: 'carInfo' },
{ name: '牌证信息', key: 'carLicense' }, { name: '牌证信息', key: 'carLicense' },
{ name: '图像信息', key: 'images' }, { name: '图像信息', key: 'images' },
{ name: '评估信息', key: 'evaluation' }, { name: '评估信息', key: 'evaluation', hidden: true },
{ name: '签约信息', key: 'contract' }, { name: '签约信息', key: 'contract', hidden: true },
{ name: '支付信息', key: 'payment' }, { name: '支付信息', key: 'payment', hidden: true },
{ name: '交车确认', key: 'delivery' }, { name: '交车确认', key: 'delivery', hidden: true },
{ name: '编辑记录', key: 'editRecords' } { name: '编辑记录', key: 'editRecords', hidden: true }
], ],
carInfoItems: [ carInfoItems: [
{ label: '销售顾问', key: 'basic.sellerName' }, { label: '销售顾问', key: 'basic.sellerName' },
...@@ -548,6 +550,22 @@ export default { ...@@ -548,6 +550,22 @@ export default {
console.log('res:', res) console.log('res:', res)
if (res.data.code == 0) { if (res.data.code == 0) {
that.detailsInfo = res.data.data that.detailsInfo = res.data.data
// 判断评估信息
if (that.detailsInfo.priceHistory && that.detailsInfo.priceHistory.length > 0) {
that.tabs.find(i => i.key === 'evaluation').hidden = false
}
if (that.detailsInfo.paymentList && that.detailsInfo.paymentList.length > 0) {
// 判断支付信息
that.tabs.find(i => i.key === 'payment').hidden = false
}
if (that.detailsInfo.signingInfo.saleContract) {
// 判断签约信息
that.tabs.find(i => i.key === 'contract').hidden = false
}
if (that.detailsInfo.editLogList && that.detailsInfo.editLogList.length > 0) {
// 判断编辑记录
that.tabs.find(i => i.key === 'editRecords').hidden = false
}
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!