hookehuyr

refactor(页面): 更新筛选器默认值和选项

将新车上架页面的筛选器默认值从中文改为'all',并更新相关选项值
在首页添加推荐车源API导入(暂未启用)
1 <!-- 1 <!--
2 * @Date: 2025-06-28 10:33:00 2 * @Date: 2025-06-28 10:33:00
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-07-07 16:02:49 4 + * @LastEditTime: 2025-07-09 16:08:53
5 * @FilePath: /jgdl/src/pages/index/index.vue 5 * @FilePath: /jgdl/src/pages/index/index.vue
6 * @Description: 捡个电驴首页 6 * @Description: 捡个电驴首页
7 --> 7 -->
...@@ -167,6 +167,8 @@ import { Clock, Star, RectRight, Check, Search2, Shop, Heart1, HeartFill } from ...@@ -167,6 +167,8 @@ import { Clock, Star, RectRight, Check, Search2, Shop, Heart1, HeartFill } from
167 import TabBar from '@/components/TabBar.vue' 167 import TabBar from '@/components/TabBar.vue'
168 import SearchPopup from '@/components/SearchPopup.vue' 168 import SearchPopup from '@/components/SearchPopup.vue'
169 import "./index.less"; 169 import "./index.less";
170 +// 导入接口
171 +import { getRecommendVehicleAPI } from '@/api/car';
170 172
171 // 响应式数据 173 // 响应式数据
172 const searchValue = ref('') 174 const searchValue = ref('')
...@@ -380,8 +382,13 @@ useReady(async () => { ...@@ -380,8 +382,13 @@ useReady(async () => {
380 }); 382 });
381 }) 383 })
382 384
383 -onMounted(() => { 385 +onMounted(async () => {
384 console.warn('index mounted') 386 console.warn('index mounted')
387 + // 获取推荐车源
388 + // const res = await getRecommendVehicleAPI()
389 + // if (res.code) {
390 + // recommendVehicleList.value = res.data
391 + // }
385 }) 392 })
386 393
387 // 分享功能 394 // 分享功能
......
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-07-08 10:29:08 4 + * @LastEditTime: 2025-07-10 09:54:21
5 * @FilePath: /jgdl/src/pages/newCarList/index.vue 5 * @FilePath: /jgdl/src/pages/newCarList/index.vue
6 * @Description: 最新上架页面 6 * @Description: 最新上架页面
7 --> 7 -->
...@@ -126,13 +126,13 @@ const onBlurSearch = () => { ...@@ -126,13 +126,13 @@ const onBlurSearch = () => {
126 const favoriteIds = ref(['2', '4', '6']) 126 const favoriteIds = ref(['2', '4', '6'])
127 127
128 // Filter states - 使用NutUI Menu组件 128 // Filter states - 使用NutUI Menu组件
129 -const selectedBrand = ref('全部品牌') 129 +const selectedBrand = ref('all')
130 -const selectedYear = ref('出厂年份') 130 +const selectedYear = ref('all')
131 -const selectedSchool = ref('所在学校') 131 +const selectedSchool = ref('all')
132 132
133 // Menu选项数据 133 // Menu选项数据
134 const brandOptions = ref([ 134 const brandOptions = ref([
135 - { text: '全部品牌', value: '全部品牌' }, 135 + { text: '全部品牌', value: 'all' },
136 { text: '雅迪', value: '雅迪' }, 136 { text: '雅迪', value: '雅迪' },
137 { text: '台铃', value: '台铃' }, 137 { text: '台铃', value: '台铃' },
138 { text: '小鸟', value: '小鸟' }, 138 { text: '小鸟', value: '小鸟' },
...@@ -142,7 +142,7 @@ const brandOptions = ref([ ...@@ -142,7 +142,7 @@ const brandOptions = ref([
142 ]) 142 ])
143 143
144 const yearOptions = ref([ 144 const yearOptions = ref([
145 - { text: '出厂年份', value: '出厂年份' }, 145 + { text: '出厂年份', value: 'all' },
146 { text: '2024年', value: '2024年' }, 146 { text: '2024年', value: '2024年' },
147 { text: '2023年', value: '2023年' }, 147 { text: '2023年', value: '2023年' },
148 { text: '2022年', value: '2022年' }, 148 { text: '2022年', value: '2022年' },
...@@ -151,7 +151,7 @@ const yearOptions = ref([ ...@@ -151,7 +151,7 @@ const yearOptions = ref([
151 ]) 151 ])
152 152
153 const schoolOptions = ref([ 153 const schoolOptions = ref([
154 - { text: '所在学校', value: '所在学校' }, 154 + { text: '所在学校', value: 'all' },
155 { text: '上海理工大学', value: '上海理工大学' }, 155 { text: '上海理工大学', value: '上海理工大学' },
156 { text: '上海复旦大学', value: '上海复旦大学' }, 156 { text: '上海复旦大学', value: '上海复旦大学' },
157 { text: '上海同济大学', value: '上海同济大学' }, 157 { text: '上海同济大学', value: '上海同济大学' },
......