Bladeren bron

feat(警告页面): 添加灰色状态图标并简化城市定位逻辑

添加不同状态的灰色警告图标用于已处理警告
移除城市列表组件中冗余的经纬度定位逻辑
调整弹窗高度为50%以改善用户体验
allen 2 weken geleden
bovenliggende
commit
fd823cc45f

+ 2 - 47
components/bazaar-city_list/index.vue

@@ -6,7 +6,7 @@
 					<!-- 定位城市 -->
 					<view class="city-list-content" id="location_city">
 						<view class="city-title">定位城市</view>
-						<view class="city-list city-list-inline" @tap="changeLocation">
+						<view class="city-list city-list-inline" @tap="location">
 							<view class="location-city">{{locationCity}}</view>
 						</view>
 						<view class="location-city-btn" @click="back">
@@ -63,18 +63,6 @@
 				type:Function,
 				default:function(){}
 			},
-			lat:{
-				type:Number,
-				default:0
-			},
-			lng:{
-				type:Number,
-				default:0
-			},
-			city:{
-				type:String,
-				default:""
-			}
 		},
 		computed:{
 			fixedTitle(){
@@ -186,33 +174,6 @@
 					}
 				});
 			},
-			getLocationByCoords(lng, lat){
-				let That = this;
-				uni.chooseLocation({
-				    success(res){
-						console.log(res);
-						uni.setStorage({
-							key:"location",
-							data:[res.longitude,res.latitude]
-						})
-						console.log(res.address);
-						That.locationCity = res && res.address;
-						That.locationName = res && res.name;
-						That.selectedCity({city:That.locationCity,name:That.locationName});
-				    },
-					fail(){
-						That.locationCity = "定位失败,请点击重试";
-						That.locationName = "";
-					}
-				});
-			},
-			changeLocation(){
-				if(this.lat && this.lng){
-					this.getLocationByCoords(this.lng, this.lat)
-				}else{
-					this.location();
-				}
-			},
 			// 滚动条Y距离
 			scroll(e){
 				this.scrollY = e.detail && e.detail.scrollTop;
@@ -234,13 +195,7 @@
 			this.initCityList();
 		},
 		mounted(){
-			// 优先使用传入的经纬度,如果没有再调用定位
-			console.log(this.lat,this.lng,'经纬度为2222')
-			if(this.lat && this.lng){
-				this.getLocationByCoords(this.lng, this.lat)
-			}else{
-				this.location();
-			}
+			this.location();
 			this.initTop();
 		}
 	}

BIN
pages/warning/assets/important-gray.png


BIN
pages/warning/assets/urgent-gray.png


+ 43 - 8
pages/warning/index.vue

@@ -70,7 +70,12 @@
               <text class="type-text">{{ warning.warning_title }}</text>
               <text class="device-type">{{ warning.device_type }}</text>
             </view>
-            <view class="warning-level" :class="warning.level == '0' ? 'level-normal' :warning.level == '1'? 'level-important':'level-urgent'">
+            <view class="warning-level" 
+            :class="
+              warning.level == '0' ? (warning.status != '0' ? 'level-normal-gray' : 'level-normal') :
+              warning.level == '1'? (warning.status != '0' ? 'level-important-gray' : 'level-important'): 
+              (warning.status != '0' ? 'level-urgent-gray' : 'level-urgent')
+            ">
             </view>
           </view>
           <view class="warning-content">
@@ -135,9 +140,13 @@
       </view>
     </view>
 		<u-calendar v-model="showDatePicker" :mode="mode" @change="changeCalendar"></u-calendar>
-    <u-popup v-model="popupShow" mode="bottom" height="80%" border-radius="20">
+    <u-popup v-model="popupShow" mode="bottom" height="50%" border-radius="20">
       <view class="popup-container">
-        <view class="popup-icon" :class="current.level == '0' ? 'popup-level-normal' :current.level == '1'? 'popup-level-important':'popup-level-urgent'">
+        <view class="popup-icon" :class="
+          current.level == '0' ? (current.status != '0' ? 'popup-level-normal-gray' : 'popup-level-normal') :
+          current.level == '1'? (current.status != '0' ? 'popup-level-important-gray' : 'popup-level-important'): 
+          (current.status != '0' ? 'popup-level-urgent-gray' : 'popup-level-urgent')
+        ">
         </view>
         <view class="popup-header">{{ current.warning_title }}</view>
         <view class="popup-type">
@@ -151,7 +160,7 @@
         </view>
       </view>
 		</u-popup>
-    <u-popup v-model="popupManualShow" mode="bottom" height="80%" border-radius="20">
+    <u-popup v-model="popupManualShow" mode="bottom" height="50%" border-radius="20">
       <view class="popup-container" style="margin-top:40rpx">
         <view class="popup-content">{{ currentManual.conf }}</view>
         <view class="popup-time">{{ formatTime(currentManual.create_time) }}</view>
@@ -506,13 +515,26 @@ export default {
       background-repeat: no-repeat;
       background-size: 100%;
     }
-
+    &.popup-level-normal-gray {
+      background: url('./assets/normal-gray.png');
+      background-repeat: no-repeat;
+      background-size: 100%;
+    }
+    &.popup-level-important-gray {
+      background: url('./assets/important-gray.png');
+      background-repeat: no-repeat;
+      background-size: 100%;
+ }
     &.popup-level-important {
       background: url('./assets/important.png');
       background-repeat: no-repeat;
       background-size: 100%;
     }
-
+    &.popup-level-urgent-gray {
+      background: url('./assets/urgent-gray.png');
+      background-repeat: no-repeat;
+      background-size: 100%;
+    }
     &.popup-level-urgent {
       background: url('./assets/urgent.png');
       background-repeat: no-repeat;
@@ -743,13 +765,26 @@ export default {
           background-repeat: no-repeat;
           background-size: 100%;
         }
-
+        &.level-normal-gray {
+          background: url('./assets/normal-gray.png');
+          background-repeat: no-repeat;
+          background-size: 100%;
+        }
         &.level-important {
           background: url('./assets/important.png');
           background-repeat: no-repeat;
           background-size: 100%;
         }
-
+        &.level-important-gray {
+          background: url('./assets/important-gray.png');
+          background-repeat: no-repeat;
+          background-size: 100%;
+        }
+        &.level-urgent-gray {
+          background: url('./assets/urgent-gray.png');
+          background-repeat: no-repeat;
+          background-size: 100%;
+        }
         &.level-urgent {
           background: url('./assets/urgent.png');
           background-repeat: no-repeat;