Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
jgdl
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-07-16 16:54:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
524734f19187c9fd9cbf22d4c8cfb3339203a129
524734f1
1 parent
74909fce
feat(车辆认证): 添加车辆认证状态样式和按钮逻辑
- 为不同认证状态添加对应的样式类 - 在车辆列表和认证车辆页面添加认证按钮 - 实现认证按钮跳转逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
7 deletions
src/pages/myAuthCar/index.less
src/pages/myAuthCar/index.vue
src/pages/myCar/index.less
src/pages/myCar/index.vue
src/pages/myAuthCar/index.less
View file @
524734f
...
...
@@ -82,10 +82,14 @@
border-radius: 8rpx;
padding: 12rpx;
margin-top: 8rpx;
text {
font-size: 22rpx;
color: #dc2626;
line-height: 1.4;
}
}
.action-buttons {
gap: 30rpx;
}
...
...
src/pages/myAuthCar/index.vue
View file @
524734f
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-16 1
5:59:35
* @LastEditTime: 2025-07-16 1
6:53:13
* @FilePath: /jgdl/src/pages/myAuthCar/index.vue
* @Description: 我的认证车页面
-->
...
...
@@ -56,6 +56,8 @@
¥ {{ item.market_price?.toLocaleString() }}
</text>
</view>
</view>
<view class="action-buttons mt-4">
<nut-button
v-if="item.review_status === 7"
@click.stop="handleSellClick(item)"
...
...
@@ -66,6 +68,15 @@
>
我要卖车
</nut-button>
<nut-button
v-if="item.verification_status === 1 || item.verification_status === 7"
size="small"
type="primary"
@click="authCar(item.id)"
color="orange"
>
认证
</nut-button>
</view>
</view>
</view>
...
...
@@ -259,6 +270,15 @@ const showToast = (message, type = 'success') => {
})
}
/**
* 认证车源
*/
const authCar = (carId) => {
Taro.navigateTo({
url: `/pages/setAuthCar/index?id=${carId}&mode=edit`
})
}
// ==================== 生命周期 ====================
onMounted(() => {
initData()
...
...
src/pages/myCar/index.less
View file @
524734f
...
...
@@ -80,13 +80,21 @@
background: linear-gradient(135deg, #10b981, #059669);
}
&.
offline
{
background: linear-gradient(135deg, #
ef4444, #dc2626
);
&.
unverified
{
background: linear-gradient(135deg, #
6b7280, #4b5563
);
}
&.review {
background: linear-gradient(135deg, #f59e0b, #d97706);
}
&.failed {
background: linear-gradient(135deg, #ef4444, #dc2626);
}
&.offline {
background: linear-gradient(135deg, #ef4444, #dc2626);
}
}
.status-icon {
...
...
src/pages/myCar/index.vue
View file @
524734f
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-16 1
5:50:35
* @LastEditTime: 2025-07-16 1
6:51:29
* @FilePath: /jgdl/src/pages/myCar/index.vue
* @Description: 文件描述
-->
...
...
@@ -43,7 +43,7 @@
<view class="car-title">{{ car.manufacture_year }}款 {{ car.brand }} {{ car.model }}</view>
<!-- 状态标识 -->
<view class="status-badges">
<view v-if="car.verification_status" class="status-badge
verified
">
<view v-if="car.verification_status" class="status-badge
" :class="getVerificationStatusClass(car.verification_status)
">
<text>{{ verifyStatus[car.verification_status] }}</text>
</view>
<!-- 审核状态为3时显示上架/下架状态,否则显示审核状态 -->
...
...
@@ -82,7 +82,7 @@
{{ car.status === 5 ? '上架' : '下架' }}
</nut-button>
<nut-button
v-if="car.verification_status === 1"
v-if="car.verification_status === 1
|| car.verification_status === 7
"
size="small"
type="primary"
@click="authCar(car.id)"
...
...
@@ -150,6 +150,20 @@ const reviewStatus = ref({
})
/**
* 获取认证状态样式类
* @param {number} status - 认证状态 (1=未认证, 3=认证待审核, 5=已认证, 7=认证失败)
*/
const getVerificationStatusClass = (status) => {
const classMap = {
1: 'unverified',
3: 'review',
5: 'verified',
7: 'failed'
}
return classMap[status] || 'unverified'
}
/**
* 滚动样式 - 考虑header和TabBar的高度
*/
const scrollStyle = computed(() => {
...
...
Please
register
or
login
to post a comment