From 4dc2236babbf99787044c0fa29be9cb5fa850144 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期日, 19 十月 2025 21:06:07 +0800
Subject: [PATCH] feat: 1.2.0.1
---
apps/cMiniApp/src/subpackages/city/citySelect/citySelect.vue | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 55 insertions(+), 5 deletions(-)
diff --git a/apps/cMiniApp/src/subpackages/city/citySelect/citySelect.vue b/apps/cMiniApp/src/subpackages/city/citySelect/citySelect.vue
index 98d5e2e..b6718bc 100644
--- a/apps/cMiniApp/src/subpackages/city/citySelect/citySelect.vue
+++ b/apps/cMiniApp/src/subpackages/city/citySelect/citySelect.vue
@@ -1,7 +1,16 @@
<template>
<PageLayout title="閫夋嫨鍩庡競" class="citySelect-page-wrapper" :need-auth="false">
<ContentView class="citySelect-content-wrapper">
- <div class="current-city">褰撳墠鍩庡競锛歿{ locationCity }}</div>
+ <!-- <div class="current-city">褰撳墠鍩庡競锛歿{ locationCity }}</div> -->
+ <div class="home-searchbar-wrapper">
+ <div class="city-btn-wrapper">
+ <div class="city-btn">
+ <img :src="IconLocaltion" class="city-btn-icon" />
+ <div class="city-btn-text">褰撳墠瀹氫綅锛歿{ locationCity }}</div>
+ </div>
+ </div>
+ <div class="reset-localtion" @click="resetLocation">閲嶆柊瀹氫綅</div>
+ </div>
<Elevator :index-list="elevatorData" :height="'100%'" @click-item="clickItem" />
</ContentView>
</PageLayout>
@@ -15,6 +24,8 @@
import { groupBy, sortBy } from 'lodash';
import { useUserStore } from '@/stores/modules/user';
import { Elevator } from '@12333/components';
+import IconLocaltion from '@/assets/task/icon-localtion.png';
+import { setLocationCity } from '@/utils';
defineOptions({
name: 'citySelect',
@@ -43,25 +54,64 @@
list: cityGroups[key].map((x) => ({
name: x.areaName,
id: x.areaCode,
- parentId: x.parentId,
+ parentId: x.parentCode,
})),
});
}
return _elevatorData;
});
-console.log('elevatorData: ', elevatorData);
-
const clickItem = (key: string, item: any) => {
- console.log('item: ', item, getAreaByAreaCode(item.parentId).areaName);
userStore.setLocationCity(item.name, getAreaByAreaCode(item.parentId).areaName);
};
+
+async function resetLocation() {
+ try {
+ await setLocationCity();
+ } catch (error) {}
+}
</script>
<style lang="scss">
@import '@/styles/common.scss';
.citySelect-page-wrapper {
+ .home-searchbar-wrapper {
+ padding: 32px 0 28px;
+ display: flex;
+ align-items: center;
+
+ .city-btn-wrapper {
+ flex: 1;
+ min-width: 0;
+
+ .city-btn {
+ display: flex;
+ align-items: center;
+ padding-right: 36px;
+ color: boleGetCssVar('text-color', 'primary');
+
+ .city-btn-icon {
+ width: 40px;
+ height: 40px;
+ }
+
+ .city-btn-text {
+ @include ellipsis;
+ margin-left: 12px;
+ font-size: 30px;
+ }
+ }
+ }
+
+ .reset-localtion {
+ font-weight: 400;
+ font-size: 24px;
+ color: boleGetCssVar('color', 'primary');
+ line-height: 28px;
+ }
+ }
+
.current-city {
padding: 20px 0;
color: boleGetCssVar('text-color', 'primary');
--
Gitblit v1.9.1