Ver código fonte

fix(设备管理): 修复设备位置修改和报修详情显示问题

修复设备位置修改时经纬度未传递的问题,优化城市选择组件支持传入经纬度
修正报修详情页面中"保修"为"报修"的文本错误
在警告页面切换标签时重置页码为1
allen 1 semana atrás
pai
commit
7afa423072

+ 47 - 2
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="location">
+						<view class="city-list city-list-inline" @tap="changeLocation">
 							<view class="location-city">{{locationCity}}</view>
 						</view>
 						<view class="location-city-btn" @click="back">
@@ -62,6 +62,18 @@
 			getCity:{
 				type:Function,
 				default:function(){}
+			},
+			lat:{
+				type:Number,
+				default:0
+			},
+			lng:{
+				type:Number,
+				default:0
+			},
+			city:{
+				type:String,
+				default:""
 			}
 		},
 		computed:{
@@ -174,6 +186,33 @@
 					}
 				});
 			},
+			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;
@@ -195,7 +234,13 @@
 			this.initCityList();
 		},
 		mounted(){
-			this.location();
+			// 优先使用传入的经纬度,如果没有再调用定位
+			console.log(this.lat,this.lng,'经纬度为2222')
+			if(this.lat && this.lng){
+				this.getLocationByCoords(this.lng, this.lat)
+			}else{
+				this.location();
+			}
 			this.initTop();
 		}
 	}

+ 1 - 1
pages/afterSale/addafter.vue

@@ -38,7 +38,7 @@
 					<image :src="$imageURL+'/bigdata_app'+'/image/afterSale/5d9b8db91f11175aa5277fef40581ab.png'" mode=""></image>
 				</view>
 				<view class="addafter_con_bot">
-					<p class="addafter_con_bot_title">修详情</p>
+					<p class="addafter_con_bot_title">修详情</p>
 					<textarea v-model="adddata.text" placeholder="请描述设备问题" class="textarea" placeholder-style="color: #62BF89;font-size:26rpx" />
 					<p style="color: #808080;font-size: 24rpx;">{{adddata.text.length}}/140</p>
 					<view class="imgvideo">

+ 1 - 1
pages/deviceDetails/weatherStation/devRepair.vue

@@ -50,7 +50,7 @@
           </u-form-item>
         </view>
         <view class="repaid-board">
-          <view class="title">修详情</view>
+          <view class="title">修详情</view>
           <u-input
             v-model="baseForm.errordesc"
             placeholder="请描述设备问题"

+ 6 - 4
pages/equipList/seabox/modification.vue

@@ -75,10 +75,12 @@
 					});
 				}
 			},
-			async eqlistname() { //修改设备名称
+			async eqlistname(lat, lng) { //修改设备名称
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
 					data: {
+						lat: lat,
+						lng: lng,
 						device_id: this.moddata.imei,
 						device_name: this.moddata.device_name,
 					}
@@ -124,8 +126,8 @@
 				this.selectaddress(this.moddata.lng, this.moddata.lat)
 			},
 			btn() {
-				this.eqlistcity(this.moddata.lat, this.moddata.lng)
-				this.eqlistname()
+				// this.eqlistcity(this.moddata.lat, this.moddata.lng)
+				this.eqlistname(this.moddata.lat, this.moddata.lng)
 			},
 			clickLeft() {
 				uni.navigateBack({
@@ -136,7 +138,7 @@
 				if(this.quanxian.cityalter){
 					this.selectcityTF = true
 					uni.navigateTo({
-						url: "../../fourBase/city"
+						url: "../../fourBase/city?lat=" + this.moddata.lat + "&lng=" + this.moddata.lng + "&city=" + this.moddata.city
 					})
 				}else{
 					uni.showToast({

+ 9 - 2
pages/fourBase/city.vue

@@ -1,18 +1,25 @@
 <template>
 	<view>
-		<citySelect :getCity="getCityA"></citySelect>	
+		<citySelect :getCity="getCity" :lat="lat" :lng="lng" :city="city"></citySelect>	
 	</view>
 </template>
 
 <script>
 	import citySelect from '../../components/bazaar-city_list/index.vue';
 	export default {
+		onLoad(options) {
+			this.lat = options.lat
+			this.lng = options.lng
+			this.city = options.city
+		},
 		components:{
 			citySelect
 		},
 		data() {
 			return {
-				
+				lat: "",
+				lng: "",
+				city: "",
 			}
 		},
 		methods: {

+ 1 - 0
pages/warning/index.vue

@@ -205,6 +205,7 @@ export default {
   methods: {
     activeTabHandler(index){
       this.activeTab = index;
+      this.page = 1;
       if(index == 0){
         this.getWarningList();
       }else if(index == 1){