Bladeren bron

搜索优化

shish 7 maanden geleden
bovenliggende
commit
492bed2da6

+ 1 - 4
ghsApp/src/components/app-area-sel.vue

@@ -6,12 +6,9 @@
 					<div class="map-top-tit">地址</div>
 					<app-close icon="iconguanbi" @close="hidePopup" />
 				</div>
-				<!-- 搜索 -->
 				<div class="map-search">
-					<app-search-module ref="aaaaa" placeholder="请输入地址搜索" :focus="false" @input="searchFn" />
+					<app-search-module ref="aaaaa" fontSize="30" height="120" placeholder="请输入地址搜索" :focus="false" @input="searchFn" />
 				</div>
-				
-				<!-- 列表 -->
 				<scroll-view class="near-list" scroll-y>
 					<view v-for="(item,index) in nearListData" :key="index" @click="switchAddress(item,index)" class="near-item">
 						<div class="current-site" :class="{'active' : currentSelectAddress === index}"></div>

+ 4 - 4
ghsApp/src/components/module/app-search.vue

@@ -1,6 +1,6 @@
 <template>
-	<div class="app-search-module" :style="{ height: height + 'upx' }">
-		<div class="map-search" :style="{ backgroundColor: backColor }" style="height:72upx">
+	<div class="app-search-module" :style="{ height: height + 'rpx' }">
+		<div class="map-search" :style="{ backgroundColor: backColor }" style="height:90upx">
 			<div class="icon-wrap" v-if="isIcon">
 				<i class="iconfont" :class="[icon]"></i>
 			</div>
@@ -12,7 +12,7 @@
 					:focus="focus"
 					@input="inputFn"
 					@focus="inputEmptyFn"
-					:style="{ fontSize: fontSize + 'upx' }"
+					:style="{ fontSize: fontSize + 'rpx' }"
 					:placeholder="placeholder"
 					placeholder-class="placeholder"
 					@confirm="searchFn"
@@ -21,7 +21,7 @@
 			</div>
 		</div>
 		<block v-if="isBtn">
-			<button v-if="isTextBtn" class="search-btn" :style="{ fontSize: fontSize + 'upx' }" @click="searchFn" > {{ btnText }} </button>
+			<button v-if="isTextBtn" class="search-btn" :style="{ fontSize: fontSize + 'rpx' }" @click="searchFn" > {{ btnText }} </button>
 			<button v-else class="search-btn admin-button-com middle blue" :style="{ fontSize: fontSize + 'upx' }" @click="searchFn" > {{ btnText }} </button>
 		</block>
 	</div>

+ 1 - 38
ghsApp/src/components/plugin/simple-address.vue

@@ -79,24 +79,6 @@
 						</view>
 					</view>
 					
-					<!-- 热门城市 -->
-					<view class="hot-section">
-						<view class="section-title">
-							<text class="section-title-text">热门城市</text>
-						</view>
-						<view class="hot-cities">
-							<view 
-								v-for="(city, index) in hotCities" 
-								:key="index"
-								class="hot-city-item"
-								:class="{ 'selected': isSelected(city) }"
-								@click="selectHotCity(city)"
-							>
-								<text class="hot-city-text">{{ city.cityName }}</text>
-							</view>
-						</view>
-					</view>
-					
 					<!-- 省份城市列表 -->
 					<view class="province-section">
 						<view class="section-title">
@@ -199,18 +181,7 @@ export default {
 			selectedCity: null,
 			expandedProvinces: [],
 			scrollIntoView: '',
-			recentCities: [],
-			hotCities: [
-				{ provinceCode: '530000', cityCode: '530100', provinceName: '云南省', cityName: '昆明市', label: '云南省 昆明市' },
-				{ provinceCode: '110000', cityCode: '110100', provinceName: '北京市', cityName: '北京市', label: '北京市' },
-				{ provinceCode: '310000', cityCode: '310100', provinceName: '上海市', cityName: '上海市', label: '上海市' },
-				{ provinceCode: '440000', cityCode: '440100', provinceName: '广东省', cityName: '广州市', label: '广东省 广州市' },
-				{ provinceCode: '440000', cityCode: '440300', provinceName: '广东省', cityName: '深圳市', label: '广东省 深圳市' },
-				{ provinceCode: '330000', cityCode: '330100', provinceName: '浙江省', cityName: '杭州市', label: '浙江省 杭州市' },
-				{ provinceCode: '320000', cityCode: '320100', provinceName: '江苏省', cityName: '南京市', label: '江苏省 南京市' },
-				{ provinceCode: '510000', cityCode: '510100', provinceName: '四川省', cityName: '成都市', label: '四川省 成都市' },
-				{ provinceCode: '420000', cityCode: '420100', provinceName: '湖北省', cityName: '武汉市', label: '湖北省 武汉市' }
-			]
+			recentCities: []
 		}
 	},
 	watch: {
@@ -336,14 +307,6 @@ export default {
 			this._$emit('onConfirm')
 			this.close()
 		},
-		// 选择热门城市
-		selectHotCity(city) {
-			this.selectedCity = city
-			this.saveRecentCity(city)
-			// 自动确认并关闭
-			this._$emit('onConfirm')
-			this.close()
-		},
 		// 切换省份展开状态
 		toggleProvince(index) {
 			const expandIndex = this.expandedProvinces.indexOf(index)

+ 9 - 0
ghsApp/src/pagesOrder/modify.vue

@@ -48,6 +48,7 @@ import SimpleAddress from '@/components/plugin/simple-address'
 import AppAreaSel from '@/components/app-area-sel'
 const form = require('@/utils/formValidation.js')
 import { modifyAddress } from '@/api/order'
+import { getInfo } from '@/api/shop'
 import {getHasMap} from "@/api/express"
 export default {
 	name: 'modify',
@@ -97,6 +98,14 @@ export default {
 					this.couldNavigation = 1
 				}
 			})
+			getInfo().then(res=>{
+				if(res.code == 1){
+					let city = res.data.city ? res.data.city : ''
+					let province = res.data.province?res.data.province:''
+					this.form.province = province
+					this.form.city = city
+				}
+			})
 		},
 		//省市联动
 		openAddres() {

+ 1 - 1
hdApp/src/components/module/app-search.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="app-search-module" :style="{ height: height + 'rpx' }">
-		<div class="map-search" :style="{ backgroundColor: backColor }" style="height: 80upx">
+		<div class="map-search" :style="{ backgroundColor: backColor }" style="height:90upx">
 			<div class="icon-wrap" v-if="isIcon">
 				<i class="iconfont" :class="[icon]"></i>
 			</div>

+ 1 - 38
hdApp/src/components/plugin/simple-address.vue

@@ -79,24 +79,6 @@
 						</view>
 					</view>
 					
-					<!-- 热门城市 -->
-					<view class="hot-section">
-						<view class="section-title">
-							<text class="section-title-text">热门城市</text>
-						</view>
-						<view class="hot-cities">
-							<view 
-								v-for="(city, index) in hotCities" 
-								:key="index"
-								class="hot-city-item"
-								:class="{ 'selected': isSelected(city) }"
-								@click="selectHotCity(city)"
-							>
-								<text class="hot-city-text">{{ city.cityName }}</text>
-							</view>
-						</view>
-					</view>
-					
 					<!-- 省份城市列表 -->
 					<view class="province-section">
 						<view class="section-title">
@@ -203,18 +185,7 @@ export default {
 			selectedCity: null,
 			expandedProvinces: [],
 			scrollIntoView: '',
-			recentCities: [],
-			hotCities: [
-				{ provinceCode: '530000', cityCode: '530100', provinceName: '云南省', cityName: '昆明市', label: '云南省 昆明市' },
-				{ provinceCode: '110000', cityCode: '110100', provinceName: '北京市', cityName: '北京市', label: '北京市' },
-				{ provinceCode: '310000', cityCode: '310100', provinceName: '上海市', cityName: '上海市', label: '上海市' },
-				{ provinceCode: '440000', cityCode: '440100', provinceName: '广东省', cityName: '广州市', label: '广东省 广州市' },
-				{ provinceCode: '440000', cityCode: '440300', provinceName: '广东省', cityName: '深圳市', label: '广东省 深圳市' },
-				{ provinceCode: '330000', cityCode: '330100', provinceName: '浙江省', cityName: '杭州市', label: '浙江省 杭州市' },
-				{ provinceCode: '320000', cityCode: '320100', provinceName: '江苏省', cityName: '南京市', label: '江苏省 南京市' },
-				{ provinceCode: '510000', cityCode: '510100', provinceName: '四川省', cityName: '成都市', label: '四川省 成都市' },
-				{ provinceCode: '420000', cityCode: '420100', provinceName: '湖北省', cityName: '武汉市', label: '湖北省 武汉市' }
-			]
+			recentCities: []
 		}
 	},
 	watch: {
@@ -340,14 +311,6 @@ export default {
 			this._$emit('onConfirm')
 			this.close()
 		},
-		// 选择热门城市
-		selectHotCity(city) {
-			this.selectedCity = city
-			this.saveRecentCity(city)
-			// 自动确认并关闭
-			this._$emit('onConfirm')
-			this.close()
-		},
 		// 切换省份展开状态
 		toggleProvince(index) {
 			const expandIndex = this.expandedProvinces.indexOf(index)

+ 1 - 1
mallApp/src/components/app-area-sel.vue

@@ -7,7 +7,7 @@
           <app-close icon="iconguanbi" @close="hidePopup" />
         </div>
         <div class="map-search">
-          <app-search-module ref="aaaaa" placeholder="请输入你的收货地址" :focus="isFocus" @input="searchFn" />
+          <app-search-module ref="aaaaa" height="100" fontSize="32" placeholder="请输入收货地址" :focus="isFocus" @input="searchFn" />
         </div>
         <scroll-view class="near-list" scroll-y>
           <view v-for="(item,index) in nearListData" :key="index" @click="switchAddress(item,index)" class="near-item" >

+ 1 - 38
mallApp/src/components/plugin/simple-address.vue

@@ -79,24 +79,6 @@
 						</view>
 					</view>
 					
-					<!-- 热门城市 -->
-					<view class="hot-section">
-						<view class="section-title">
-							<text class="section-title-text">热门城市</text>
-						</view>
-						<view class="hot-cities">
-							<view 
-								v-for="(city, index) in hotCities" 
-								:key="index"
-								class="hot-city-item"
-								:class="{ 'selected': isSelected(city) }"
-								@click="selectHotCity(city)"
-							>
-								<text class="hot-city-text">{{ city.cityName }}</text>
-							</view>
-						</view>
-					</view>
-					
 					<!-- 省份城市列表 -->
 					<view class="province-section">
 						<view class="section-title">
@@ -203,18 +185,7 @@ export default {
 			selectedCity: null,
 			expandedProvinces: [],
 			scrollIntoView: '',
-			recentCities: [],
-			hotCities: [
-				{ provinceCode: '530000', cityCode: '530100', provinceName: '云南省', cityName: '昆明市', label: '云南省 昆明市' },
-				{ provinceCode: '110000', cityCode: '110100', provinceName: '北京市', cityName: '北京市', label: '北京市' },
-				{ provinceCode: '310000', cityCode: '310100', provinceName: '上海市', cityName: '上海市', label: '上海市' },
-				{ provinceCode: '440000', cityCode: '440100', provinceName: '广东省', cityName: '广州市', label: '广东省 广州市' },
-				{ provinceCode: '440000', cityCode: '440300', provinceName: '广东省', cityName: '深圳市', label: '广东省 深圳市' },
-				{ provinceCode: '330000', cityCode: '330100', provinceName: '浙江省', cityName: '杭州市', label: '浙江省 杭州市' },
-				{ provinceCode: '320000', cityCode: '320100', provinceName: '江苏省', cityName: '南京市', label: '江苏省 南京市' },
-				{ provinceCode: '510000', cityCode: '510100', provinceName: '四川省', cityName: '成都市', label: '四川省 成都市' },
-				{ provinceCode: '420000', cityCode: '420100', provinceName: '湖北省', cityName: '武汉市', label: '湖北省 武汉市' }
-			]
+			recentCities: []
 		}
 	},
 	watch: {
@@ -340,14 +311,6 @@ export default {
 			this._$emit('onConfirm')
 			this.close()
 		},
-		// 选择热门城市
-		selectHotCity(city) {
-			this.selectedCity = city
-			this.saveRecentCity(city)
-			// 自动确认并关闭
-			this._$emit('onConfirm')
-			this.close()
-		},
 		// 切换省份展开状态
 		toggleProvince(index) {
 			const expandIndex = this.expandedProvinces.indexOf(index)