Bladeren bron

修改连接接口

zs 1 jaar geleden
bovenliggende
commit
f8240db675

+ 17 - 25
pages/select/index.vue

@@ -20,10 +20,10 @@
 							<view class="list" v-for="(item, index) in carList" :key="index" @tap="toCommon(item,'0')">
 								<view class="icon">
 									<image class="image"
-										:src="item.url&&item.url.length>0?item.url[0].url:'/static/logo.png'">
+										:src="item.logo&&item.logo.length>0?item.logo[0].url:'/static/logo.png'">
 									</image>
 								</view>
-								<view class="title">{{item.title}}</view>
+								<view class="title">{{item.name}}</view>
 							</view>
 						</view>
 						<view class="one_1 one_3">
@@ -40,7 +40,8 @@
 							</view>
 							<view class="right">
 								<view class="name textOver">{{item.series||'暂无'}} {{item.year||'暂无'}}款
-									{{item.style||'暂无'}}</view>
+									{{item.style||'暂无'}}
+								</view>
 								<view class="other">
 									<text v-if="item.year">{{item.year||'暂无'}}年 | </text>
 									<text v-if="item.mileage">{{item.mileage||'暂无'}}公里 | </text>
@@ -101,38 +102,29 @@
 			type: '3',
 		}
 	])
-	const carList = ref([
-		{
-			title: '大众',
-			type: '0',
-		},
-		{
-			title: '宝马',
-			type: '1',
-		},
-		{
-			title: '本田',
-			type: '2',
-		},
-		{
-			title: '丰田',
-			type: '3',
-		},
-		{
-			title: '更多品牌',
-			type: '4',
-		}
-	])
+	const carList = ref([])
 	onShow(async () => {
+		await searchOther();
 		await searchConfig();
 		await clearPage();
 		await search();
 	})
 	onPullDownRefresh(async () => {
 		await clearPage();
+		await searchOther();
 		await search();
 		uni.stopPullDownRefresh();
 	})
+	const searchOther = async () => {
+		let res;
+		// 品牌
+		res = await $api(`brand`, 'GET', { skip: 0, limit: 4, is_use: '0' });
+		if (res.errcode === 0) carList.value = res.data;
+		carList.value.push({
+			name: '更多品牌',
+			type: '4',
+		})
+	};
 	// config信息
 	const searchConfig = async () => {
 		config.value = uni.getStorageSync('config');

+ 12 - 182
pagesHome/condition/common/classify.js

@@ -42,202 +42,32 @@ export default [{
 	},
 	{
 		"name": "变速箱",
-		"type": '0',
-		"foods": [{
-				title: '手动',
-				type: '0',
-				is_open: false
-			},
-			{
-				title: '自动',
-				type: '1',
-				is_open: false
-			}
-		]
+		"type": 'boxType',
+		"foods": []
 	},
 	{
 		"name": "车身结构",
-		"type": '0',
-		"foods": [{
-				title: '两厢',
-				type: '0',
-				is_open: false
-			},
-			{
-				title: '三厢',
-				type: '1',
-				is_open: false
-			},
-			{
-				title: '掀背',
-				type: '2',
-				is_open: false
-			},
-			{
-				title: '硬顶敞篷',
-				type: '3',
-				is_open: false
-			},
-			{
-				title: '软顶敞篷',
-				type: '4',
-				is_open: false
-			},
-			{
-				title: '硬顶跑车',
-				type: '5',
-				is_open: false
-			},
-			{
-				title: '旅行版',
-				type: '6',
-				is_open: false
-			}
-		]
+		"type": 'structure',
+		"foods": []
 	},
 	{
 		"name": "排放标准",
-		"type": '0',
-		"foods": [{
-				title: '国二',
-				type: '0',
-				is_open: false
-			},
-			{
-				title: '国三',
-				type: '1',
-				is_open: false
-			},
-			{
-				title: '国四',
-				type: '2',
-				is_open: false
-			},
-			{
-				title: '国五',
-				type: '3',
-				is_open: false
-			},
-			{
-				title: '国六',
-				type: '4',
-				is_open: false
-			},
-			{
-				title: '国六b',
-				type: '5',
-				is_open: false
-			}
-		]
+		"type": 'emission',
+		"foods": []
 	},
 	{
 		"name": "能源类型",
-		"type": '0',
-		"foods": [{
-				title: '汽油',
-				type: '0',
-				is_open: false
-			},
-			{
-				title: '柴油',
-				type: '1',
-				is_open: false
-			},
-			{
-				title: '油电混合',
-				type: '2',
-				is_open: false
-			},
-			{
-				title: '纯电动',
-				type: '3',
-				is_open: false
-			},
-			{
-				title: '插电式混合',
-				type: '4',
-				is_open: false
-			},
-			{
-				title: '增程式',
-				type: '5',
-				is_open: false
-			}
-		]
+		"type": 'energy',
+		"foods": []
 	},
 	{
 		"name": "排量",
-		"type": '0',
-		"foods": [{
-				title: '1.0及以下',
-				type: '0',
-				is_open: false
-			},
-			{
-				title: '1.1-1.6L',
-				type: '1',
-				is_open: false
-			},
-			{
-				title: '1.7-2.0L',
-				type: '2',
-				is_open: false
-			},
-			{
-				title: '2.1-2.5L',
-				type: '3',
-				is_open: false
-			},
-			{
-				title: '2.6-3.0L',
-				type: '4',
-				is_open: false
-			},
-			{
-				title: '3.1-4.0L',
-				type: '5',
-				is_open: false
-			},
-			{
-				title: '4.0L以上',
-				type: '6',
-				is_open: false
-			}
-		]
+		"type": 'displacement',
+		"foods": []
 	},
 	{
 		"name": "座椅",
-		"type": '0',
-		"foods": [{
-				title: '2座',
-				type: '0',
-				is_open: false
-			},
-			{
-				title: '4座',
-				type: '1',
-				is_open: false
-			},
-			{
-				title: '5座',
-				type: '2',
-				is_open: false
-			},
-			{
-				title: '6座',
-				type: '3',
-				is_open: false
-			},
-			{
-				title: '7座',
-				type: '4',
-				is_open: false
-			},
-			{
-				title: '7座以上',
-				type: '5',
-				is_open: false
-			}
-		]
+		"type": 'set',
+		"foods": []
 	},
 ]

+ 88 - 20
pagesHome/condition/index.vue

@@ -25,22 +25,21 @@
 										</view>
 									</view>
 									<view class="item-container">
-										<view v-if="item.type=='0'" class="thumb-box1"
-											v-for="(item1, index1) in item.foods" :key="index1"
-											@tap="toSelect(item,item1)">
-											<view :class="[item1.is_open==false?'title_1':'title_2']">{{item1.title}}
-											</view>
-										</view>
-										<view v-else-if="item.type=='1'" class="thumb-box2">
+										<view v-if="item.type=='1'" class="thumb-box1">
 											<u-button :text="item.text" size="normal" type="info"
 												@click="toCommon(item.value)"></u-button>
 										</view>
-										<view v-else-if="item.type=='2'" class="thumb-box3">
+										<view v-else-if="item.type=='2'" class="thumb-box2">
 											<slider-range :value="item.value" :min="item.min" :max="item.max"
 												:step="item.step" :scale="{ show: true}"
 												@change="event=>changeSliderValue(event,item)">
 											</slider-range>
 										</view>
+										<view v-else class="thumb-box3" v-for="(item1, index1) in item.foods"
+											:key="index1" @tap="toSelect(item,item1)">
+											<view :class="[item1?.is_open==false?'title_1':'title_2']">{{item1.label}}
+											</view>
+										</view>
 									</view>
 								</view>
 							</view>
@@ -79,11 +78,18 @@
 	const scrollTop = ref(0); //tab标题的滚动条位置
 	const current = ref(0); // 预设当前项的值
 	const itemId = ref(''); // 栏目右边scroll-view用于滚动的id
-	const tabbar = ref(classifyData);
+	const tabbar = ref([]);
 	const scrollRightTop = ref(0); // 右边栏目scroll-view的滚动条高度
 	const brandInfo = ref({}); // 车牌信息
 	const cityInfo = ref({}); // 城市信息
 	const searchList = ref([]); // 选中的搜索信息
+	// 字典表
+	const boxTypeList = ref([]);
+	const structureList = ref([]);
+	const emissionList = ref([]);
+	const energyList = ref([]);
+	const displacementList = ref([]);
+	const setList = ref([]);
 	onLoad(async (options) => {
 		id.value = options && options.id
 		await searchOther();
@@ -109,13 +115,73 @@
 	// 查询其他信息
 	const searchOther = async () => {
 		let res;
+		// 变速箱
+		res = await $api(`dictData`, 'GET', { code: 'boxType', is_use: '0' });
+		if (res.errcode === 0) boxTypeList.value = res.data;
+		// 车身结构
+		res = await $api(`dictData`, 'GET', { code: 'structure', is_use: '0' });
+		if (res.errcode === 0) structureList.value = res.data;
+		// 排放标准
+		res = await $api(`dictData`, 'GET', { code: 'emission', is_use: '0' });
+		if (res.errcode === 0) emissionList.value = res.data;
+		// 能源类型
+		res = await $api(`dictData`, 'GET', { code: 'energy', is_use: '0' });
+		if (res.errcode === 0) energyList.value = res.data;
+		// 排量
+		res = await $api(`dictData`, 'GET', { code: 'displacement', is_use: '0' });
+		if (res.errcode === 0) displacementList.value = res.data;
+		// 座椅
+		res = await $api(`dictData`, 'GET', { code: 'set', is_use: '0' });
+		if (res.errcode === 0) setList.value = res.data;
 	};
 	// config信息
 	const searchConfig = async () => {
 		config.value = uni.getStorageSync('config');
 	};
 	// 查询
-	const search = async () => { };
+	const search = async () => {
+		const data = classifyData.map((item, index) => {
+			if (item.type == 'boxType') {
+				// 变速箱
+				boxTypeList.value.forEach(v => {
+					v['is_open'] = false;
+				});
+				item.foods = boxTypeList.value;
+			} else if (item.type == 'structure') {
+				// 车身结构
+				structureList.value.forEach(v => {
+					v['is_open'] = false;
+				});
+				item.foods = structureList.value;
+			} else if (item.type == 'emission') {
+				// 排放标准
+				emissionList.value.forEach(v => {
+					v['is_open'] = false;
+				});
+				item.foods = emissionList.value;
+			} else if (item.type == 'energy') {
+				// 能源类型
+				energyList.value.forEach(v => {
+					v['is_open'] = false;
+				});
+				item.foods = energyList.value
+			} else if (item.type == 'displacement') {
+				// 排量
+				displacementList.value.forEach(v => {
+					v['is_open'] = false;
+				});
+				item.foods = displacementList.value;
+			} else if (item.type == 'set') {
+				// 座椅
+				setList.value.forEach(v => {
+					v['is_open'] = false;
+				});
+				item.foods = setList.value;
+			}
+			return item
+		})
+		tabbar.value = data
+	};
 	// 点击左边的栏目切换
 	const swichMenu = (index) => {
 		if (index == current.value) return;
@@ -150,12 +216,12 @@
 		})
 	};
 	// 选择
-	const toSelect = async (value, data) => {
+	const toSelect = async (arr, data) => {
 		searchList.value.push(data)
 		tabbar.value = tabbar.value.map((item, index) => {
-			if (item.name == value.name) {
+			if (item.type == arr.type) {
 				item.foods = item.foods.map((item1, index1) => {
-					if (item1.title == data.title) item1.is_open = !item1.is_open
+					if (item1.value == data.value) item1.is_open = !item1.is_open
 					return item1
 				})
 			}
@@ -250,7 +316,16 @@
 				display: flex;
 				flex-wrap: wrap;
 
+
 				.thumb-box1 {
+					width: 100%;
+				}
+
+				.thumb-box2 {
+					width: 100%;
+				}
+
+				.thumb-box3 {
 					font-size: var(--font12Size);
 					width: 23vw;
 					text-align: center;
@@ -269,13 +344,6 @@
 					}
 				}
 
-				.thumb-box2 {
-					width: 100%;
-				}
-
-				.thumb-box3 {
-					width: 100%;
-				}
 			}
 		}
 

+ 108 - 25
pagesHome/record/index.vue

@@ -10,7 +10,7 @@
 						商品编号
 					</view>
 					<view class="right">
-						{{info.num||'暂无'}}
+						{{info._id||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -18,7 +18,8 @@
 						商品名称
 					</view>
 					<view class="right">
-						{{info.name||'暂无'}}
+						{{info.series||'暂无'}} {{info.year||'暂无'}}款
+						{{info.style||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -26,7 +27,7 @@
 						车辆识别号(VIN)
 					</view>
 					<view class="right">
-						{{info.feel||'暂无'}}
+						{{info.vin||'暂无'}}
 					</view>
 				</view>
 			</view>
@@ -37,7 +38,7 @@
 						表显里程
 					</view>
 					<view class="right">
-						{{info.km||'暂无'}}
+						{{info.mileage||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -45,7 +46,7 @@
 						排放标准
 					</view>
 					<view class="right">
-						{{info.emission||'暂无'}}
+						{{getDict(info.emission, 'emission')}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -53,7 +54,7 @@
 						首次上牌
 					</view>
 					<view class="right">
-						{{info.first||'暂无'}}
+						{{info.f_time||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -61,7 +62,7 @@
 						过户次数
 					</view>
 					<view class="right">
-						{{info.number||'暂无'}}
+						{{info.number||'0'}}次
 					</view>
 				</view>
 				<view class="table_column">
@@ -69,7 +70,7 @@
 						车源地
 					</view>
 					<view class="right">
-						{{info.city||'暂无'}}
+						{{info.place||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -77,7 +78,7 @@
 						车牌地
 					</view>
 					<view class="right">
-						{{info.address||'暂无'}}
+						{{info.license||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -85,7 +86,7 @@
 						外观颜色
 					</view>
 					<view class="right">
-						{{info.color||'暂无'}}
+						{{info.out_color||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -93,7 +94,7 @@
 						内饰颜色
 					</view>
 					<view class="right">
-						{{info.colorn||'暂无'}}
+						{{info.in_color||'暂无'}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -101,7 +102,7 @@
 						车辆使用性质
 					</view>
 					<view class="right">
-						{{info.nature||'暂无'}}
+						{{getDict(info.use_type, 'use_type')}}
 					</view>
 				</view>
 			</view>
@@ -112,7 +113,7 @@
 						能源类型
 					</view>
 					<view class="right">
-						{{info.type||'暂无'}}
+						{{getDict(info.energy, 'energy')}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -120,7 +121,7 @@
 						排量
 					</view>
 					<view class="right">
-						{{info.displacement||'暂无'}}
+						{{getDict(info.displacement, 'displacement')}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -128,7 +129,7 @@
 						级别
 					</view>
 					<view class="right">
-						{{info.level||'暂无'}}
+						{{getDict(info.level, 'level')}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -136,7 +137,7 @@
 						变速箱
 					</view>
 					<view class="right">
-						{{info.gearbox||'暂无'}}
+						{{getDict(info.type, 'type')}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -144,7 +145,7 @@
 						驱动方式
 					</view>
 					<view class="right">
-						{{info.way||'暂无'}}
+						{{getDict(info.drive, 'drive')}}
 					</view>
 				</view>
 				<view class="table_column">
@@ -152,7 +153,7 @@
 						座位数
 					</view>
 					<view class="right">
-						{{info.seat||'暂无'}}
+						{{getDict(info.set, 'set')}}
 					</view>
 				</view>
 			</view>
@@ -175,12 +176,17 @@
 	const config = ref({});
 	const id = ref('');
 	const text = ref('以下内容为商家填写 购车前请谨慎核对,以实际情况为准');
-	const info = ref({
-
-		num: '13238468', name: '雅阁 2015款 2.0L LX 舒适版', feel: '车辆识别号(VIN)', km: '8.70万公里', emission: '国V', first: "2016-03",
-		number: '0次', city: '长春', address: '长春', color: '黑色', colorn: '深色', nature: '非营运', type: '汽油', displacement: '2.0L', level: '中型车', gearbox: '自动', way: '前驱', seat: '5座'
-
-	});
+	const info = ref({});
+	// 字典表
+	const useTypeList = ref([]);
+	const boxTypeList = ref([]);
+	const structureList = ref([]);
+	const emissionList = ref([]);
+	const energyList = ref([]);
+	const displacementList = ref([]);
+	const setList = ref([]);
+	const levelList = ref([]);
+	const driveList = ref([]);
 	onLoad(async (options) => {
 		id.value = options && options.id
 		await searchConfig();
@@ -190,13 +196,90 @@
 	// 查询其他信息
 	const searchOther = async () => {
 		let res;
+		// 车辆使用性质
+		res = await $api(`dictData`, 'GET', { code: 'useType', is_use: '0' });
+		if (res.errcode === 0) useTypeList.value = res.data;
+		// 变速箱
+		res = await $api(`dictData`, 'GET', { code: 'boxType', is_use: '0' });
+		if (res.errcode === 0) boxTypeList.value = res.data;
+		// 车身结构
+		res = await $api(`dictData`, 'GET', { code: 'structure', is_use: '0' });
+		if (res.errcode === 0) structureList.value = res.data;
+		// 排放标准
+		res = await $api(`dictData`, 'GET', { code: 'emission', is_use: '0' });
+		if (res.errcode === 0) emissionList.value = res.data;
+		// 能源类型
+		res = await $api(`dictData`, 'GET', { code: 'energy', is_use: '0' });
+		if (res.errcode === 0) energyList.value = res.data;
+		// 排量
+		res = await $api(`dictData`, 'GET', { code: 'displacement', is_use: '0' });
+		if (res.errcode === 0) displacementList.value = res.data;
+		// 座椅
+		res = await $api(`dictData`, 'GET', { code: 'set', is_use: '0' });
+		if (res.errcode === 0) setList.value = res.data;
+		// 车辆级别
+		res = await $api(`dictData`, 'GET', { code: 'level', is_use: '0' });
+		if (res.errcode === 0) levelList.value = res.data;
+		// 驱动方式
+		res = await $api(`dictData`, 'GET', { code: 'drive', is_use: '0' });
+		if (res.errcode === 0) driveList.value = res.data;
 	};
 	// config信息
 	const searchConfig = async () => {
 		config.value = uni.getStorageSync('config');
 	};
 	// 查询
-	const search = async () => { };
+	const search = async () => {
+		if (id.value) {
+			const res = await $api(`car/${id.value}`, 'GET', {});
+			if (res.errcode === 0) {
+				info.value = res.data
+			} else {
+				uni.showToast({
+					title: res.errmsg || '',
+					icon: 'error',
+				});
+			}
+		}
+	};
+	// 数据处理
+	const getDict = (data, model) => {
+		let list;
+		switch (model) {
+			case 'use_type':
+				list = useTypeList.value;
+				break;
+			case 'type':
+				list = boxTypeList.value;
+				break;
+			case 'structure':
+				list = structureList.value;
+				break;
+			case 'emission':
+				list = emissionList.value;
+				break;
+			case 'energy':
+				list = energyList.value;
+				break;
+			case 'displacement':
+				list = displacementList.value;
+				break;
+			case 'set':
+				list = setList.value;
+				break;
+			case 'level':
+				list = levelList.value;
+				break;
+			case 'drive':
+				list = driveList.value;
+				break;
+			default:
+				break;
+		}
+		if (!list) return;
+		const res = list.find((f) => f.value == data);
+		return res?.label || '暂无';
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 15 - 24
unpackage/dist/dev/mp-weixin/pages/select/index.js

@@ -41,38 +41,29 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         type: "3"
       }
     ]);
-    const carList = common_vendor.ref([
-      {
-        title: "大众",
-        type: "0"
-      },
-      {
-        title: "宝马",
-        type: "1"
-      },
-      {
-        title: "本田",
-        type: "2"
-      },
-      {
-        title: "丰田",
-        type: "3"
-      },
-      {
-        title: "更多品牌",
-        type: "4"
-      }
-    ]);
+    const carList = common_vendor.ref([]);
     common_vendor.onShow(async () => {
+      await searchOther();
       await searchConfig();
       await clearPage();
       await search();
     });
     common_vendor.onPullDownRefresh(async () => {
       await clearPage();
+      await searchOther();
       await search();
       common_vendor.index.stopPullDownRefresh();
     });
+    const searchOther = async () => {
+      let res;
+      res = await $api(`brand`, "GET", { skip: 0, limit: 4, is_use: "0" });
+      if (res.errcode === 0)
+        carList.value = res.data;
+      carList.value.push({
+        name: "更多品牌",
+        type: "4"
+      });
+    };
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
     };
@@ -154,8 +145,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }),
         c: common_vendor.f(carList.value, (item, index, i0) => {
           return {
-            a: item.url && item.url.length > 0 ? item.url[0].url : "/static/logo.png",
-            b: common_vendor.t(item.title),
+            a: item.logo && item.logo.length > 0 ? item.logo[0].url : "/static/logo.png",
+            b: common_vendor.t(item.name),
             c: index,
             d: common_vendor.o(($event) => toCommon(item, "0"), index)
           };

+ 12 - 188
unpackage/dist/dev/mp-weixin/pagesHome/condition/common/classify.js

@@ -44,209 +44,33 @@ const classifyData = [
   },
   {
     "name": "变速箱",
-    "type": "0",
-    "foods": [
-      {
-        title: "手动",
-        type: "0",
-        is_open: false
-      },
-      {
-        title: "自动",
-        type: "1",
-        is_open: false
-      }
-    ]
+    "type": "boxType",
+    "foods": []
   },
   {
     "name": "车身结构",
-    "type": "0",
-    "foods": [
-      {
-        title: "两厢",
-        type: "0",
-        is_open: false
-      },
-      {
-        title: "三厢",
-        type: "1",
-        is_open: false
-      },
-      {
-        title: "掀背",
-        type: "2",
-        is_open: false
-      },
-      {
-        title: "硬顶敞篷",
-        type: "3",
-        is_open: false
-      },
-      {
-        title: "软顶敞篷",
-        type: "4",
-        is_open: false
-      },
-      {
-        title: "硬顶跑车",
-        type: "5",
-        is_open: false
-      },
-      {
-        title: "旅行版",
-        type: "6",
-        is_open: false
-      }
-    ]
+    "type": "structure",
+    "foods": []
   },
   {
     "name": "排放标准",
-    "type": "0",
-    "foods": [
-      {
-        title: "国二",
-        type: "0",
-        is_open: false
-      },
-      {
-        title: "国三",
-        type: "1",
-        is_open: false
-      },
-      {
-        title: "国四",
-        type: "2",
-        is_open: false
-      },
-      {
-        title: "国五",
-        type: "3",
-        is_open: false
-      },
-      {
-        title: "国六",
-        type: "4",
-        is_open: false
-      },
-      {
-        title: "国六b",
-        type: "5",
-        is_open: false
-      }
-    ]
+    "type": "emission",
+    "foods": []
   },
   {
     "name": "能源类型",
-    "type": "0",
-    "foods": [
-      {
-        title: "汽油",
-        type: "0",
-        is_open: false
-      },
-      {
-        title: "柴油",
-        type: "1",
-        is_open: false
-      },
-      {
-        title: "油电混合",
-        type: "2",
-        is_open: false
-      },
-      {
-        title: "纯电动",
-        type: "3",
-        is_open: false
-      },
-      {
-        title: "插电式混合",
-        type: "4",
-        is_open: false
-      },
-      {
-        title: "增程式",
-        type: "5",
-        is_open: false
-      }
-    ]
+    "type": "energy",
+    "foods": []
   },
   {
     "name": "排量",
-    "type": "0",
-    "foods": [
-      {
-        title: "1.0及以下",
-        type: "0",
-        is_open: false
-      },
-      {
-        title: "1.1-1.6L",
-        type: "1",
-        is_open: false
-      },
-      {
-        title: "1.7-2.0L",
-        type: "2",
-        is_open: false
-      },
-      {
-        title: "2.1-2.5L",
-        type: "3",
-        is_open: false
-      },
-      {
-        title: "2.6-3.0L",
-        type: "4",
-        is_open: false
-      },
-      {
-        title: "3.1-4.0L",
-        type: "5",
-        is_open: false
-      },
-      {
-        title: "4.0L以上",
-        type: "6",
-        is_open: false
-      }
-    ]
+    "type": "displacement",
+    "foods": []
   },
   {
     "name": "座椅",
-    "type": "0",
-    "foods": [
-      {
-        title: "2座",
-        type: "0",
-        is_open: false
-      },
-      {
-        title: "4座",
-        type: "1",
-        is_open: false
-      },
-      {
-        title: "5座",
-        type: "2",
-        is_open: false
-      },
-      {
-        title: "6座",
-        type: "3",
-        is_open: false
-      },
-      {
-        title: "7座",
-        type: "4",
-        is_open: false
-      },
-      {
-        title: "7座以上",
-        type: "5",
-        is_open: false
-      }
-    ]
+    "type": "set",
+    "foods": []
   }
 ];
 exports.classifyData = classifyData;

+ 86 - 27
unpackage/dist/dev/mp-weixin/pagesHome/condition/index.js

@@ -14,7 +14,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
     var _a;
-    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
     common_vendor.computed(() => {
       return common_vendor.index.getStorageSync("openid");
     });
@@ -24,11 +24,17 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const scrollTop = common_vendor.ref(0);
     const current = common_vendor.ref(0);
     const itemId = common_vendor.ref("");
-    const tabbar = common_vendor.ref(pagesHome_condition_common_classify.classifyData);
+    const tabbar = common_vendor.ref([]);
     const scrollRightTop = common_vendor.ref(0);
     const brandInfo = common_vendor.ref({});
     const cityInfo = common_vendor.ref({});
     const searchList = common_vendor.ref([]);
+    const boxTypeList = common_vendor.ref([]);
+    const structureList = common_vendor.ref([]);
+    const emissionList = common_vendor.ref([]);
+    const energyList = common_vendor.ref([]);
+    const displacementList = common_vendor.ref([]);
+    const setList = common_vendor.ref([]);
     common_vendor.onLoad(async (options) => {
       id.value = options && options.id;
       await searchOther();
@@ -54,11 +60,65 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       });
     });
     const searchOther = async () => {
+      let res;
+      res = await $api(`dictData`, "GET", { code: "boxType", is_use: "0" });
+      if (res.errcode === 0)
+        boxTypeList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "structure", is_use: "0" });
+      if (res.errcode === 0)
+        structureList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "emission", is_use: "0" });
+      if (res.errcode === 0)
+        emissionList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "energy", is_use: "0" });
+      if (res.errcode === 0)
+        energyList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "displacement", is_use: "0" });
+      if (res.errcode === 0)
+        displacementList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "set", is_use: "0" });
+      if (res.errcode === 0)
+        setList.value = res.data;
     };
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
     };
     const search = async () => {
+      const data = pagesHome_condition_common_classify.classifyData.map((item, index) => {
+        if (item.type == "boxType") {
+          boxTypeList.value.forEach((v) => {
+            v["is_open"] = false;
+          });
+          item.foods = boxTypeList.value;
+        } else if (item.type == "structure") {
+          structureList.value.forEach((v) => {
+            v["is_open"] = false;
+          });
+          item.foods = structureList.value;
+        } else if (item.type == "emission") {
+          emissionList.value.forEach((v) => {
+            v["is_open"] = false;
+          });
+          item.foods = emissionList.value;
+        } else if (item.type == "energy") {
+          energyList.value.forEach((v) => {
+            v["is_open"] = false;
+          });
+          item.foods = energyList.value;
+        } else if (item.type == "displacement") {
+          displacementList.value.forEach((v) => {
+            v["is_open"] = false;
+          });
+          item.foods = displacementList.value;
+        } else if (item.type == "set") {
+          setList.value.forEach((v) => {
+            v["is_open"] = false;
+          });
+          item.foods = setList.value;
+        }
+        return item;
+      });
+      tabbar.value = data;
     };
     const swichMenu = (index) => {
       if (index == current.value)
@@ -92,12 +152,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         return item;
       });
     };
-    const toSelect = async (value, data) => {
+    const toSelect = async (arr, data) => {
       searchList.value.push(data);
       tabbar.value = tabbar.value.map((item, index) => {
-        if (item.name == value.name) {
+        if (item.type == arr.type) {
           item.foods = item.foods.map((item1, index1) => {
-            if (item1.title == data.title)
+            if (item1.value == data.value)
               item1.is_open = !item1.is_open;
             return item1;
           });
@@ -127,28 +187,19 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
             d: common_vendor.t(item.unit),
             e: common_vendor.t(item.content || "不限")
           }, {
-            f: item.type == "0"
-          }, item.type == "0" ? {
-            g: common_vendor.f(item.foods, (item1, index1, i1) => {
-              return {
-                a: common_vendor.t(item1.title),
-                b: common_vendor.n(item1.is_open == false ? "title_1" : "title_2"),
-                c: index1,
-                d: common_vendor.o(($event) => toSelect(item, item1), index1)
-              };
-            })
-          } : item.type == "1" ? {
-            i: common_vendor.o(($event) => toCommon(item.value), index),
-            j: "4b99813d-0-" + i0,
-            k: common_vendor.p({
+            f: item.type == "1"
+          }, item.type == "1" ? {
+            g: common_vendor.o(($event) => toCommon(item.value), index),
+            h: "4b99813d-0-" + i0,
+            i: common_vendor.p({
               text: item.text,
               size: "normal",
               type: "info"
             })
           } : item.type == "2" ? {
-            m: common_vendor.o((event) => changeSliderValue(event, item), index),
-            n: "4b99813d-1-" + i0,
-            o: common_vendor.p({
+            k: common_vendor.o((event) => changeSliderValue(event, item), index),
+            l: "4b99813d-1-" + i0,
+            m: common_vendor.p({
               value: item.value,
               min: item.min,
               max: item.max,
@@ -157,11 +208,19 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
                 show: true
               }
             })
-          } : {}, {
-            h: item.type == "1",
-            l: item.type == "2",
-            p: "item" + index,
-            q: index
+          } : {
+            n: common_vendor.f(item.foods, (item1, index1, i1) => {
+              return {
+                a: common_vendor.t(item1.label),
+                b: common_vendor.n((item1 == null ? void 0 : item1.is_open) == false ? "title_1" : "title_2"),
+                c: index1,
+                d: common_vendor.o(($event) => toSelect(item, item1), index1)
+              };
+            })
+          }, {
+            j: item.type == "2",
+            o: "item" + index,
+            p: index
           });
         }),
         d: scrollRightTop.value,

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/condition/index.wxml


+ 8 - 8
unpackage/dist/dev/mp-weixin/pagesHome/condition/index.wxss

@@ -79,27 +79,27 @@
   flex-wrap: wrap;
 }
 .content .info .item-container .thumb-box1.data-v-4b99813d {
+  width: 100%;
+}
+.content .info .item-container .thumb-box2.data-v-4b99813d {
+  width: 100%;
+}
+.content .info .item-container .thumb-box3.data-v-4b99813d {
   font-size: var(--font12Size);
   width: 23vw;
   text-align: center;
 }
-.content .info .item-container .thumb-box1 .title_1.data-v-4b99813d {
+.content .info .item-container .thumb-box3 .title_1.data-v-4b99813d {
   padding: 2vw;
   margin: 1vw;
   background-color: var(--f5Color);
 }
-.content .info .item-container .thumb-box1 .title_2.data-v-4b99813d {
+.content .info .item-container .thumb-box3 .title_2.data-v-4b99813d {
   padding: 2vw;
   margin: 1vw;
   background: rgba(255, 222, 173, 0.35);
   border: 1px solid var(--fFFColor);
 }
-.content .info .item-container .thumb-box2.data-v-4b99813d {
-  width: 100%;
-}
-.content .info .item-container .thumb-box3.data-v-4b99813d {
-  width: 100%;
-}
 .content .foot.data-v-4b99813d {
   display: flex;
   justify-content: space-around;

+ 107 - 40
unpackage/dist/dev/mp-weixin/pagesHome/record/index.js

@@ -14,33 +14,23 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
     var _a;
-    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
     common_vendor.computed(() => {
       return common_vendor.index.getStorageSync("openid");
     });
     const config = common_vendor.ref({});
     const id = common_vendor.ref("");
     const text = common_vendor.ref("以下内容为商家填写 购车前请谨慎核对,以实际情况为准");
-    const info = common_vendor.ref({
-      num: "13238468",
-      name: "雅阁 2015款 2.0L LX 舒适版",
-      feel: "车辆识别号(VIN)",
-      km: "8.70万公里",
-      emission: "国V",
-      first: "2016-03",
-      number: "0次",
-      city: "长春",
-      address: "长春",
-      color: "黑色",
-      colorn: "深色",
-      nature: "非营运",
-      type: "汽油",
-      displacement: "2.0L",
-      level: "中型车",
-      gearbox: "自动",
-      way: "前驱",
-      seat: "5座"
-    });
+    const info = common_vendor.ref({});
+    const useTypeList = common_vendor.ref([]);
+    const boxTypeList = common_vendor.ref([]);
+    const structureList = common_vendor.ref([]);
+    const emissionList = common_vendor.ref([]);
+    const energyList = common_vendor.ref([]);
+    const displacementList = common_vendor.ref([]);
+    const setList = common_vendor.ref([]);
+    const levelList = common_vendor.ref([]);
+    const driveList = common_vendor.ref([]);
     common_vendor.onLoad(async (options) => {
       id.value = options && options.id;
       await searchConfig();
@@ -48,36 +38,113 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       await search();
     });
     const searchOther = async () => {
+      let res;
+      res = await $api(`dictData`, "GET", { code: "useType", is_use: "0" });
+      if (res.errcode === 0)
+        useTypeList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "boxType", is_use: "0" });
+      if (res.errcode === 0)
+        boxTypeList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "structure", is_use: "0" });
+      if (res.errcode === 0)
+        structureList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "emission", is_use: "0" });
+      if (res.errcode === 0)
+        emissionList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "energy", is_use: "0" });
+      if (res.errcode === 0)
+        energyList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "displacement", is_use: "0" });
+      if (res.errcode === 0)
+        displacementList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "set", is_use: "0" });
+      if (res.errcode === 0)
+        setList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "level", is_use: "0" });
+      if (res.errcode === 0)
+        levelList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "drive", is_use: "0" });
+      if (res.errcode === 0)
+        driveList.value = res.data;
     };
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
     };
     const search = async () => {
+      if (id.value) {
+        const res = await $api(`car/${id.value}`, "GET", {});
+        if (res.errcode === 0) {
+          info.value = res.data;
+        } else {
+          common_vendor.index.showToast({
+            title: res.errmsg || "",
+            icon: "error"
+          });
+        }
+      }
+    };
+    const getDict = (data, model) => {
+      let list;
+      switch (model) {
+        case "use_type":
+          list = useTypeList.value;
+          break;
+        case "type":
+          list = boxTypeList.value;
+          break;
+        case "structure":
+          list = structureList.value;
+          break;
+        case "emission":
+          list = emissionList.value;
+          break;
+        case "energy":
+          list = energyList.value;
+          break;
+        case "displacement":
+          list = displacementList.value;
+          break;
+        case "set":
+          list = setList.value;
+          break;
+        case "level":
+          list = levelList.value;
+          break;
+        case "drive":
+          list = driveList.value;
+          break;
+      }
+      if (!list)
+        return;
+      const res = list.find((f) => f.value == data);
+      return (res == null ? void 0 : res.label) || "暂无";
     };
     return (_ctx, _cache) => {
       return {
         a: common_vendor.p({
           text: text.value
         }),
-        b: common_vendor.t(info.value.num || "暂无"),
-        c: common_vendor.t(info.value.name || "暂无"),
-        d: common_vendor.t(info.value.feel || "暂无"),
-        e: common_vendor.t(info.value.km || "暂无"),
-        f: common_vendor.t(info.value.emission || "暂无"),
-        g: common_vendor.t(info.value.first || "暂无"),
-        h: common_vendor.t(info.value.number || "暂无"),
-        i: common_vendor.t(info.value.city || "暂无"),
-        j: common_vendor.t(info.value.address || "暂无"),
-        k: common_vendor.t(info.value.color || "暂无"),
-        l: common_vendor.t(info.value.colorn || "暂无"),
-        m: common_vendor.t(info.value.nature || "暂无"),
-        n: common_vendor.t(info.value.type || "暂无"),
-        o: common_vendor.t(info.value.displacement || "暂无"),
-        p: common_vendor.t(info.value.level || "暂无"),
-        q: common_vendor.t(info.value.gearbox || "暂无"),
-        r: common_vendor.t(info.value.way || "暂无"),
-        s: common_vendor.t(info.value.seat || "暂无"),
-        t: common_vendor.p({
+        b: common_vendor.t(info.value._id || "暂无"),
+        c: common_vendor.t(info.value.series || "暂无"),
+        d: common_vendor.t(info.value.year || "暂无"),
+        e: common_vendor.t(info.value.style || "暂无"),
+        f: common_vendor.t(info.value.vin || "暂无"),
+        g: common_vendor.t(info.value.mileage || "暂无"),
+        h: common_vendor.t(getDict(info.value.emission, "emission")),
+        i: common_vendor.t(info.value.f_time || "暂无"),
+        j: common_vendor.t(info.value.number || "0"),
+        k: common_vendor.t(info.value.place || "暂无"),
+        l: common_vendor.t(info.value.license || "暂无"),
+        m: common_vendor.t(info.value.out_color || "暂无"),
+        n: common_vendor.t(info.value.in_color || "暂无"),
+        o: common_vendor.t(getDict(info.value.use_type, "use_type")),
+        p: common_vendor.t(getDict(info.value.energy, "energy")),
+        q: common_vendor.t(getDict(info.value.displacement, "displacement")),
+        r: common_vendor.t(getDict(info.value.level, "level")),
+        s: common_vendor.t(getDict(info.value.type, "type")),
+        t: common_vendor.t(getDict(info.value.drive, "drive")),
+        v: common_vendor.t(getDict(info.value.set, "set")),
+        w: common_vendor.p({
           text: "以上为全部内容"
         })
       };

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/record/index.wxml