Browse Source

refactor(ui): 优化城市选择组件和页面样式

- 简化城市选择组件,移除热门城市和字母导航功能
- 添加确定按钮并优化返回逻辑
- 调整设备修改页面的城市选择交互
- 更新API请求基础URL配置
- 修复城市选择方法命名和参数传递问题
- 移除不必要的flex属性
- 更新manifest版本号
allen 1 ngày trước cách đây
mục cha
commit
e1e1429eb3

+ 30 - 8
components/bazaar-city_list/index.vue

@@ -9,9 +9,12 @@
 						<view class="city-list city-list-inline" @tap="location">
 							<view class="location-city">{{locationCity}}</view>
 						</view>
+						<view class="location-city-btn" @click="back">
+							确定
+						</view>
 					</view>
 					<!-- 热门城市 -->
-					<view id="hotcity" class="city-list-content">
+				<!-- 	<view id="hotcity" class="city-list-content">
 						<view class="city-title">
 							{{hotcity.title}}
 						</view> 
@@ -20,9 +23,9 @@
 								{{item}}
 							</view>
 						</view>
-					</view>
+					</view> -->
 					<!-- 城市列表 -->
-					<view id="citytitle" class="city-list-content">
+				<!-- 	<view id="citytitle" class="city-list-content">
 						<view class="city_title_wrap" v-for="(city,index) in citylist" :key="`citylist${index}`">
 							<view class="city-title city-title-letter">
 								{{city.title}}
@@ -33,7 +36,7 @@
 								</view>
 							</view>
 						</view>
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</scroll-view>
@@ -42,13 +45,13 @@
 			<view class="city-title">{{fixedTitle}}</view>
 		</view>
 		<!-- 侧边栏导航 -->
-		<view class="navrightcity">
+	<!-- 	<view class="navrightcity">
 			<view class="nav-item nav-letter" @tap="scroll_to_city(0)">定</view>
 			<view class="nav-item nav-letter" @tap="scroll_to_city(1)">热</view>
 			<view v-for="(item,index) in citylist" :key="`nav${index}`" class="nav-item nav-letter" @click="scroll_to_city(index+2)">
 				{{item.title}}
 			</view>
-		</view>
+		</view> -->
 	</view>
 </template>
 
@@ -148,7 +151,6 @@
 			// 获取城市
 			// selectedCity({city}){
 			selectedCity(city){
-				console.log(city);
 				this.getCity&&this.getCity({city});
 			},
 			// 定位操作
@@ -181,6 +183,18 @@
 				this.scrollTop = this.tops[index]
 				this.scrollY = scrollY
 				this.cityScroll.scrollTo(0, -scrollY, 300)
+			},
+			back(){
+				//判断当前路由如果有上一页就返回上一页
+				let pages = getCurrentPages()
+				if(pages.length > 1){
+					uni.navigateBack({
+						delta: 1
+					})
+				}
+				// uni.navigateBack({
+				// 	delta:1
+				// })
 			}
 		},
 		// 页面挂载后进行异步操作
@@ -296,4 +310,12 @@
 			background-color: #ebebeb;
 		}
 	}
-</style>
+	.location-city-btn{
+		color: #FFFFFF;
+		margin: 15px 0 0 20px;
+		height: 33px;
+		background-color: #71cd9a;
+		text-align: center;
+		line-height: 33px;
+	}
+</style>

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "智控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
-    "versionName" : "1.15.10",
-    "versionCode" : 11510,
+    "versionName" : "1.15.11",
+    "versionCode" : 11511,
     "transformPx" : false,
     "sassImplementationName" : "node-sass",
     /* 5+App特有相关 */

+ 1 - 3
pages.json

@@ -534,9 +534,7 @@
       "style": {
         "navigationBarTitleText": "",
         "enablePullDownRefresh": false,
-        "app-plus": {
-          "softinputMode": "adjustResize"
-        }
+        "navigationStyle": "custom"
       }
     },
     {

+ 4 - 3
pages/equipList2/seabox/modification.vue

@@ -7,7 +7,8 @@
 			</view>
 			<view class="mod">
 				<view class="mod_name">
-					<p>设备名称</p>
+					<p>
+					<text style="color: #ff0000;">*</text>设备名称</p>
 					<input type="text" v-model="moddata.device_name" :class="quanxian.namealter?'namebg':''" />
 				</view>
 				<view class="mod_id">
@@ -18,12 +19,12 @@
 					<p>适配用户</p>
 					<input type="text" :value="moddata.real_name==''?'无':moddata.real_name" disabled />
 				</view>
-				<view class="mod_city" @click="amendcity">
+				<view class="mod_city">
 					<view style="width: 90%;">
 						<p><span style="color: #ff0000;" v-if="quanxian.cityalter">*</span>设备位置</p>
 						<input type="text" :value="city" disabled />
 					</view>
-					<u-icon name="arrow-right"></u-icon>
+					<!-- <u-icon name="arrow-right"></u-icon> -->
 				</view>
 				<view class="mod_time">
 					<p>设备添加时间</p>

+ 3 - 7
pages/fourBase/city.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<citySelect :getCity="getCity"></citySelect>	
+		<citySelect :getCity="getCityA"></citySelect>	
 	</view>
 </template>
 
@@ -17,9 +17,9 @@
 		},
 		methods: {
 			getCity({
-				city
+				e
 			}){
-				console.log('get city -------------- 1211414413212')
+				console.log(e)
 				//city 城市名称
 				//name 定位名称
 				if(city.city == undefined){
@@ -28,13 +28,9 @@
 					var add = city.city
 				}
 				let pages = getCurrentPages()
-				console.log(pages.length,' get city pages length')
 				let nowpage = pages[pages.length - 1]
 				let prevpage = pages[pages.length - 2]
 				prevpage.$vm.city = add
-				uni.navigateBack({
-					delta:1
-				})
 			}
 		}
 	}

+ 0 - 1
pages/index/index.vue

@@ -471,7 +471,6 @@
 		}
 		.weatext {
 			gap: 8rpx;
-			flex: 1;
 			display: flex;
 			flex-direction: column;
 			padding-left: 44rpx;

+ 6 - 6
util/api.js

@@ -4,15 +4,15 @@ export const myRequest = (options) => {
   let BASE_URL = uni.getStorageSync('http');
   console.log(BASE_URL, 'my request', process.env.NODE_ENV);
   if (BASE_URL == '') {
-    // BASE_URL =
-    //   process.env.NODE_ENV === 'development'
-    //     ? 'https://uat.hnyfwlw.com'
-    //     : 'https://web.hnyfwlw.com';
+    //  BASE_URL =
+    //    process.env.NODE_ENV === 'development'
+    //      ? 'https://uat.hnyfwlw.com'
+    //      : 'https://web.hnyfwlw.com';
     // BASE_URL = 'http://192.168.1.107:8000'
-    BASE_URL = 'http://218.28.198.186:10508';
+    // BASE_URL = 'http://218.28.198.186:10508';
     // BASE_URL = 'http://8.136.98.49:8002';
   }
-  // BASE_URL = config.productAPI;
+  BASE_URL = config.productAPI;
   // BASE_URL = config.developAPI;
   var session_key = '';
   session_key = uni.getStorageSync('session_key');