Browse Source

2021-3-31

zhangyun 5 years ago
parent
commit
02605e3a03
64 changed files with 9784 additions and 4567 deletions
  1. 0 17
      App.vue
  2. 125 0
      components/bazaar-city_list/citylist.json
  3. 299 0
      components/bazaar-city_list/index.vue
  4. 1063 0
      components/city.js
  5. 454 0
      components/linzq-citySelect/linzq-citySelect.vue
  6. 140 0
      components/popup-layer/popup-layer.vue
  7. 7 18
      manifest.json
  8. 9 0
      pages.json
  9. 118 41
      pages/afterSale/addafter.vue
  10. 23 5
      pages/afterSale/index.vue
  11. 53 7
      pages/afterSale/search.vue
  12. 12 9
      pages/cb/bzy/equip-set/bzyhistoryile.vue
  13. 2 1
      pages/cb/cbd/equip-set/equip-set.vue
  14. 27 11
      pages/cb/cbd/equip-set/historyfile.vue
  15. 148 10
      pages/cb/cbd/equip-set/imgpage.vue
  16. 1 1
      pages/cb/equip-detail/equip-detail.vue
  17. 28 1
      pages/cb/index/index.vue
  18. 2 0
      pages/cb/sim/sim.vue
  19. 20 12
      pages/cb/xy/equip-set/xyhistoryile.vue
  20. 9 12
      pages/environment/equipment.vue
  21. 17 22
      pages/environment/history.vue
  22. 29 2
      pages/environment/index.vue
  23. 123 37
      pages/equipList/index.vue
  24. 96 12
      pages/equipList/modification.vue
  25. 85 45
      pages/equipList/search.vue
  26. 54 29
      pages/equipMange/index/assignment.vue
  27. 36 2
      pages/equipMange/index/index.vue
  28. 8 1
      pages/equipMange/index/useroperation.vue
  29. 37 3
      pages/expertDiagnosis/exchangeShare.vue
  30. 9 2
      pages/expertDiagnosis/index.vue
  31. 0 1
      pages/expertDiagnosis/particulars.vue
  32. 116 7
      pages/expertDiagnosis/postmessage.vue
  33. 70 43
      pages/expertDiagnosis/wormcase.vue
  34. 48 53
      pages/fourBase/addbase.vue
  35. 28 1
      pages/fourBase/allocation.vue
  36. 30 4
      pages/fourBase/basefacility.vue
  37. 43 0
      pages/fourBase/city.vue
  38. 33 4
      pages/fourBase/index.vue
  39. 36 39
      pages/fourBase/modification.vue
  40. 12 0
      pages/login/login.vue
  41. 29 2
      pages/monitor/index.vue
  42. 11 10
      pages/prevention/equipmentdetails.vue
  43. 29 2
      pages/prevention/index.vue
  44. 10 5
      pages/prevention/search.vue
  45. 11 1
      pages/prevention/sim.vue
  46. 22 18
      pages/prevention/ucharts.vue
  47. BIN
      static/image/6209a98f0cb3b5086f2ca36152c9269.png
  48. BIN
      unpackage/cache/apk/__UNI__DBA6730_cm.apk
  49. 1 1
      unpackage/cache/apk/apkurl
  50. 1 1
      unpackage/cache/apk/cmManifestCache.json
  51. 2 2
      unpackage/cache/wgt/__UNI__DBA6730/app-config-service.js
  52. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/app-service.js
  53. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/app-view.js
  54. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/manifest.json
  55. 2 2
      unpackage/dist/build/app-plus/app-config-service.js
  56. 1 1
      unpackage/dist/build/app-plus/app-service.js
  57. 1 1
      unpackage/dist/build/app-plus/app-view.js
  58. 1 1
      unpackage/dist/build/app-plus/manifest.json
  59. 2 2
      unpackage/dist/dev/app-plus/app-config-service.js
  60. 3864 2786
      unpackage/dist/dev/app-plus/app-service.js
  61. 2343 1276
      unpackage/dist/dev/app-plus/app-view.js
  62. 1 1
      unpackage/dist/dev/app-plus/manifest.json
  63. BIN
      unpackage/dist/dev/app-plus/static/image/6209a98f0cb3b5086f2ca36152c9269.png
  64. BIN
      unpackage/release/apk/__UNI__DBA6730_20210323100614.apk

+ 0 - 17
App.vue

@@ -1,22 +1,5 @@
 <script>
 	export default {
-		onLaunch: function() {
-			uni.getStorage({
-				key: 'session_key',
-				success: (res) => {
-					if(res.data!=""){
-						uni.switchTab({
-							url: "./pages/index/index"
-						})
-					}else{
-						uni.switchTab({
-							url: "./pages/login/login"
-						})
-						console.log(2)
-					}
-				}
-			})
-		},
 		onShow: function() {
 			console.log('App Show')
 		},

File diff suppressed because it is too large
+ 125 - 0
components/bazaar-city_list/citylist.json


+ 299 - 0
components/bazaar-city_list/index.vue

@@ -0,0 +1,299 @@
+<template>
+	<view class="citylist">
+		<scroll-view :style="{'height':windowH}" scroll-y="true" :scroll-top="scrollTop"  show-scrollbar="false" @scroll="scroll" >
+			<view>
+				<view class="city-list-container">
+					<!-- 定位城市 -->
+					<view class="city-list-content" id="location_city">
+						<view class="city-title">定位城市</view>
+						<view class="city-list city-list-inline" @tap="location">
+							<view class="location-city">{{locationCity}}</view>
+						</view>
+					</view>
+					<!-- 热门城市 -->
+					<view id="hotcity" class="city-list-content">
+						<view class="city-title">
+							{{hotcity.title}}
+						</view> 
+						<view class="city-list city-list-inline">
+							<view class="city-item" v-for="(item,index) in hotcity.lists" :key="`city${index}`" @tap="selectedCity(item)">
+								{{item}}
+							</view>
+						</view>
+					</view>
+					<!-- 城市列表 -->
+					<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}}
+							</view>
+							<view class="city-list city-list-block">
+								<view class="city-item" v-for="(item,index) in city.lists" :key="`item${index}`" @tap="selectedCity(item)">
+									{{item}}
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+		<!-- 固定顶部 -->
+		<view class="fixtitle" :style="{transform:fixedStyle}">
+			<view class="city-title">{{fixedTitle}}</view>
+		</view>
+		<!-- 侧边栏导航 -->
+		<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>
+</template>
+
+<script>
+	import CL from './citylist.json'
+	export default{
+		props:{
+			getCity:{
+				type:Function,
+				default:function(){}
+			}
+		},
+		computed:{
+			fixedTitle(){
+				if (this.scrollY < 0) {
+					return ''
+				}
+				return this.title && this.title[this.currentIndex]
+			}
+		},
+		watch:{
+			scrollY(newY){
+				const {tops} = this
+				const index = tops.findIndex((top, index) => {
+					this.diff = tops[index + 1] - newY
+					return newY >= top && newY < tops[index + 1]
+				})
+				this.currentIndex = index;
+			},
+			diff(newVal) {
+				let fixedTop = (newVal > 0 && newVal < 30) ? newVal - 30 : 0
+				if (this.fixedTop === fixedTop) {
+					this.fixedStyle = `translate3d(0,0,0)`
+				}
+				this.fixedTop = fixedTop
+				this.fixedStyle = `translate3d(0,${this.fixedTop}px,0)`
+			}
+		},
+		data(){
+			return{
+				scrollY:-1,//滚动记录
+				tops:[],//每一个.city-title 距离顶部的距离
+				diff:-1, // 
+				citylist:{},
+				hotcity:{},
+				currentIndex:0,
+				title:[],
+				windowH:"",
+				scrollTop:0,
+				fixedStyle:"translate3d(0,0,0)",
+				fixedTop:0,
+				locationCity:"定位中...."
+			}
+		},
+		methods:{
+			// 初始化数据列表
+			initCityList(){
+				let title = [];
+				this.hotcity = CL.hotcity;
+				this.citylist = CL.city
+				title.push("定位城市");
+				title.push(this.hotcity.title);
+				for(let i in this.citylist){
+					title.push(this.citylist[i].title)
+				}
+				this.title = title;
+				let sysInfo = uni.getSystemInfoSync();
+				this.windowH = sysInfo.windowHeight + "px"
+			} ,
+			initTop(){
+				// 1. 初始化tops
+				const query = uni.createSelectorQuery();
+				query.select('#location_city').boundingClientRect()
+				.select('#hotcity').boundingClientRect()
+				.selectAll('.city_title_wrap').boundingClientRect()
+				.exec((list)=>{
+					let tops = []
+					let top = 0
+					tops.push(top);
+					if(list[0]){
+						top += list[0].height;
+						tops.push(top)
+					}
+					if(list[1]){
+						top += list[1].height;
+						tops.push(top)
+					}
+					if(list[2].length !== 0){
+						for(let i in list[2]){
+							top+= list[2][i].height
+							tops.push(top);
+						}
+					}
+					this.tops = tops;
+				})
+			},
+			// 获取城市
+			// selectedCity({city}){
+			selectedCity(city){
+				// console.log(city);
+				this.getCity&&this.getCity({city});
+			},
+			// 定位操作
+			location(){
+				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 = "";
+					}
+				});
+			},
+			// 滚动条Y距离
+			scroll(e){
+				this.scrollY = e.detail && e.detail.scrollTop;
+			},
+			// 滚动到指定位置
+			scroll_to_city(index){
+				this.scrollTop = this.tops[index]
+				this.scrollY = scrollY
+				this.cityScroll.scrollTo(0, -scrollY, 300)
+			}
+		},
+		// 页面挂载后进行异步操作
+		created(){
+			this.initCityList();
+		},
+		mounted(){
+			this.location();
+			this.initTop();
+		}
+	}
+</script>
+
+<style lang="less">
+	.citylist{
+		width: 100%;
+		height: 100%;
+		overflow: hidden;
+		position: relative;
+	}
+	.city-list-container{
+		width: 100%;
+		height: 100%;
+		background-color: #ebebeb;
+		font-size: 14px;
+		color: #333;
+		.city-list-content{
+			margin-right: 25px;
+		}
+		.city-title{
+			padding-left: 15px;
+			line-height: 30px;
+		}
+		.city-list{
+			padding-right: 30px;
+		}
+		.city-title-letter {
+			padding-left: 25px;
+		}
+		.city-list-block {
+			background-color: #f5f5f5;
+			.city-item {
+				height: 44px;
+				line-height: 44px;
+				margin-left: 15px;
+				border-bottom: 1px solid #c8c7cc;
+				&:last-child{
+					border: 0;
+				}
+			}
+		}
+		.city-list-inline {
+			background-color: #f5f5f5;
+			padding-bottom: 8px;
+			overflow: hidden;
+			&::after{
+				content: "";
+				clear: both;
+			}
+			.location-city,.city-item {
+				float: left;
+				background: #fff;
+				width: 29%;
+				height: 33px;
+				margin-top: 15px;
+				margin-left: 4%;
+				padding: 0 4px;
+				border: 1px solid #e6e6e6;
+				border-radius: 3px;
+				line-height: 33px;
+				text-align: center;
+				box-sizing: border-box;
+				white-space: nowrap;
+				overflow: hidden;
+				text-overflow: ellipsis;
+			}
+			.location-city{
+				width: auto;
+				min-width: 30%;
+				padding: 0 20px;
+			}
+		}
+	}
+	.navrightcity {
+		position: fixed;
+		top: 50%;
+		transform: translateY(-50%);
+		right: 0;
+		width: 35px;
+		z-index: 10;
+		text-align: center;
+		font-size: 12px;
+		.nav-item {
+			height: 16px;
+			height: 2.8vh;
+		}
+		.nav-letter {
+			width: 15px;
+			margin-left: 15px;
+		}
+	}
+	.fixtitle{
+		width: 100%;
+		position: fixed;
+		top: 0;
+		left: 0;
+		overflow: hidden;
+		.city-title{
+			padding-left: 15px;
+			line-height: 30px;
+			font-size: 14px;
+			color: #333;
+			background-color: #ebebeb;
+		}
+	}
+</style>

File diff suppressed because it is too large
+ 1063 - 0
components/city.js


+ 454 - 0
components/linzq-citySelect/linzq-citySelect.vue

@@ -0,0 +1,454 @@
+<template>
+	<div class="wrapper" :style="'top:'+statusBarHeight+'px'">
+		<div class="header">
+			<view class="back_div">
+				<image class="back_img" @click="back_city()" src="../../static/back_img.png" mode=""></image>
+			</view>
+			<input class="input" @input="onInput" placeholder="中文/拼音/首字母" v-model="searchValue" />
+		</div>
+		<scroll-view class="calendar-list" scroll-y="true" :scroll-into-view="scrollIntoId">
+			<view v-if="disdingwei" id="hot">
+				<!-- 定位模块 -->
+				<view class="dingwei">
+					<view class="dingwei_Tips">
+						当前定位
+					</view>
+					<view class="dingwei_city">
+						<view class="dingwei_city_one">
+							{{position}}
+						</view>
+						<view class="dingweis_div" @click="getWarpweft">
+							<image class="dingweis" src="../../static/dingweis.png" mode=""></image>
+							<text>{{po_tips}}</text>
+						</view>
+					</view>
+				</view>
+
+				<!-- 最近模块 -->
+				<view class="dingwei" v-if="Visit.length>=0">
+					<view class="dingwei_Tips">
+						最近访问
+					</view>
+					<view class="dingwei_city dingwei_city_zuijin">
+						<view class="dingwei_city_one toright" v-for="(item,index) in Visit" v-if="index<2" @click="back_city(item)">
+							{{item.cityName}}
+						</view> 
+					</view>
+				</view>
+
+			</view>
+
+
+			<!-- 城市列表 -->
+			<view v-if="searchValue == ''" v-for="(item, index) in list" :id="getId(index)" :key="index">
+				<view class="letter-header">{{ getId(index) }}</view>
+				<view class="city-div" v-for="(city, i) in item" :key="i" @click="back_city(city)">
+					<text class="city">{{ city.cityName }}</text>
+				</view>
+			</view>
+			<!-- 搜索结果 -->
+			<view class="city-div" v-for="(item, index) in searchList" @click="back_city(item)">
+				<text class="city">{{ item.cityName }}</text>
+			</view>
+		</scroll-view>
+
+		<!-- 右侧字母 -->
+		<view class="letters" v-if="searchValue == ''">
+			<view class="letters-item" @click="scrollTo('hot')">最近</view>
+			<view class="letters-item" v-for="item in letter" :key="item" @click="scrollTo(item)">{{ item }}</view>
+		</view>
+
+		<!-- 选中之后字母 -->
+		<view class="mask" v-if="showMask">
+			<view class="mask-r">{{selectLetter}}</view>
+		</view>
+	</div>
+</template>
+
+<script>
+	import Citys from '../city.js';
+	export default {
+		components: {},
+		props: {},
+
+		computed: {
+			hotCity() {
+				return Citys.hotCity;
+			},
+
+			citys() {
+				return Citys.cities;
+			}
+		},
+
+		data() {
+			return {
+				statusBarHeight: this.statusBarHeight,
+				ImgUrl: this.ImgUrl,
+				letter: [],
+				selectLetter: '',
+				searchValue: '',
+				scrollIntoId: '',
+				list: [],
+				tId: null,
+				searchList: [],
+				showMask: false,
+				disdingwei: true,
+				Visit: [], //最近访问
+				position: '青岛',
+				longitude: '', //经度
+				latitude: '', //纬度
+				seconds: 3,
+				po_tips: '重新定位',
+			}
+		},
+
+		created() {
+			//获取存储的最近访问
+			var that = this
+			uni.getStorage({
+				key: 'Visit_key',
+				success: function(res) {
+					that.Visit = res.data
+				}
+			});
+			//获取定位 经度纬度
+			that.getWarpweft()
+			//获取city.js 的程序字母
+			var mu = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'w', 'x', 'y',
+				'z'
+			];
+			var tmp = [];
+			for (var i = 0; i < mu.length; i++) {
+				var item = mu[i];
+				for (var j = 0; j < this.citys.length; j++) {
+					var py = this.citys[j].py;
+					if (py.substring(0, 1) == item) {
+						if (tmp.indexOf(item) == -1) {
+							this.list[i] = [this.citys[j]];
+							tmp.push(item);
+							this.letter.push(item.toUpperCase());
+						} else {
+							this.list[i].push(this.citys[j]);
+						}
+					}
+				}
+			}
+		},
+		methods: {
+			getId(index) {
+				return this.letter[index];
+			},
+
+			scrollTo(letter) {
+				this.showMask = true
+				this.selectLetter = letter == 'hot' ? '最' : letter
+				setTimeout(() => {
+					this.showMask = false
+				}, 300);
+				this.scrollIntoId = letter;
+			},
+
+
+			query(source, text) {
+				let res = [];
+				var self = this;
+				res = source.filter(item => {
+					const arr = [];
+					let isHave = false;
+					Object.keys(item).forEach(prop => {
+						const itemStr = item[prop];
+						self.isString(itemStr) &&
+							itemStr.split(',').forEach(val => {
+								arr.push(val);
+							});
+					});
+					arr.some(val => {
+						isHave = new RegExp('^' + text).test(val);
+						return isHave;
+					});
+					return isHave;
+				});
+				console.log(JSON.stringify(res));
+				return res;
+			},
+
+			isString(obj) {
+				return typeof obj === 'string';
+			},
+
+			onInput(e) {
+				const value = e.target.value;
+				console.log(value);
+				if (value !== '' && this.citys && this.citys.length > 0) {
+					const queryData = this.query(this.citys, String(value).trim());
+					this.searchList = queryData;
+					this.disdingwei = false
+				} else {
+					this.searchList = [];
+					this.disdingwei = true
+				}
+			},
+
+			back_city(item) {
+				if (item) {
+					this.$emit('back_city', item);
+					//unshift 把数据插入到首位,与push相反
+					this.Visit.unshift(item)
+					this.searchValue = "";
+					this.disdingwei = true
+					var arr = this.Visit
+					//数组去重
+					function distinct(arr) {
+						let newArr = []
+						for (let i = 0; i < arr.length; i++) {
+							if (newArr.indexOf(arr[i]) < 0) {
+								newArr.push(arr[i])
+							}
+						}
+						return newArr
+					}
+					this.Visit = distinct(arr)
+					console.log(this.Visit, "---最近访问")
+					uni.setStorage({
+						key: 'Visit_key',
+						data: this.Visit
+					});
+				} else {
+					this.$emit('back_city', 'no');
+				}
+
+			},
+			getWarpweft() {
+				var that = this
+				that.po_tips = '定位中...'
+				let countdown = setInterval(() => {
+					that.seconds--;
+					uni.getLocation({
+						type: 'wgs84',
+						success: function(res) {
+							console.log('当前位置的经度:' + res.longitude);
+							console.log('当前位置的纬度:' + res.latitude);
+							that.longitude = res.longitude
+							that.latitude = res.latitude
+						}
+					});
+					if (that.seconds <= 0) {
+						that.seconds = 3
+						that.po_tips = '重新定位'
+						clearInterval(countdown);
+					}
+				}, 1000);
+			}
+		}
+	};
+</script>
+
+<style scoped>
+	.wrapper {
+		position: fixed;
+		z-index: 999999;
+		background: #ffffff;
+		height: 100%;
+		width: 100%;
+		top: 0px;
+		left: 0px;
+	}
+
+	.mask {
+		position: absolute;
+		bottom: 0upx;
+		top: 83upx;
+		left: 0upx;
+		right: 0upx;
+		width: 750upx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		background: rgba(0, 0, 0, 0);
+	}
+
+	.mask-r {
+		height: 120upx;
+		width: 120upx;
+		border-radius: 60upx;
+		display: flex;
+		background: rgba(0, 0, 0, 0.5);
+		justify-content: center;
+		align-items: center;
+		font-size: 40upx;
+		color: #FFFFFF
+	}
+
+	.content {
+		height: 100%;
+		width: 100%;
+		background-color: #ffffff;
+	}
+
+	.header {
+		height: 85upx;
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+	}
+
+
+	.back_div {
+		width: 65upx;
+		height: 100%;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.back_img {
+		width: 35upx;
+		height: 35upx;
+	}
+
+	.input {
+		font-size: 28upx;
+		width: 620upx;
+		height: 55upx;
+		border-radius: 40upx;
+		background-color: #F5F5F5;
+		padding-left: 20upx;
+		padding-right: 20upx;
+		box-sizing: border-box;
+	}
+
+	.title {
+		font-size: 30upx;
+		color: white;
+	}
+
+	.show {
+		left: 0;
+		width: 100%;
+		transition: left 0.3s ease;
+	}
+
+	.hide {
+		left: 100%;
+		width: 100%;
+		transition: left 0.3s ease;
+	}
+
+
+	.title {
+		font-size: 30upx;
+		color: white;
+	}
+
+	.calendar-list {
+		position: absolute;
+		top: 83upx;
+		bottom: 0upx;
+		width: 100%;
+		background-color: #FFFFFF;
+	}
+
+	.letters {
+		position: absolute;
+		right: 30upx;
+		bottom: 0px;
+		width: 50upx;
+		top: 260upx;
+		color: #2f9bfe;
+		text-align: center;
+		font-size: 24upx;
+	}
+
+	.letters-item {
+		margin-bottom: 5upx;
+	}
+
+	.letter-header {
+		height: 45upx;
+		font-size: 22upx;
+		color: #333333;
+		padding-left: 24upx;
+		box-sizing: border-box;
+		display: flex;
+		align-items: center;
+		background-color: #ebedef;
+
+	}
+
+	.city-div {
+		width: 660upx;
+		height: 85upx;
+		margin-left: 24upx;
+		border-bottom-width: 0.5upx;
+		border-bottom-color: #ebedef;
+		border-bottom-style: solid;
+		display: flex;
+		align-items: center;
+		margin-right: 35upx;
+	}
+
+	.city {
+		font-size: 28upx;
+		color: #000000;
+		padding-left: 30upx;
+	}
+
+	.dingwei {
+		width: 100%;
+		padding-top: 25upx;
+		box-sizing: border-box;
+		margin-bottom: 26upx;
+	}
+
+	.dingwei_Tips {
+		margin-left: 24upx;
+		margin-bottom: 24upx;
+		font-size: 24upx;
+		color: #A5A5A5;
+	}
+
+	.dingwei_city {
+		width: 100%;
+		height: 60upx;
+		padding-left: 55upx;
+		padding-right: 70upx;
+		box-sizing: border-box;
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.dingwei_city_one {
+		width: 185upx;
+		height: 60upx;
+		background-color: #F5F5F5;
+		border-radius: 10upx;
+		font-size: 32upx;
+		color: #333333;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.dingweis_div {
+		display: flex;
+		align-content: flex-end;
+		align-items: center;
+		font-size: 24upx;
+		color: #FD5745;
+	}
+
+	.dingweis {
+		width: 32upx;
+		height: 32upx;
+	}
+
+	.dingwei_city_zuijin {
+		display: flex;
+		justify-content: flex-start;
+	}
+
+	.toright {
+		margin-right: 25upx;
+	}
+</style>

+ 140 - 0
components/popup-layer/popup-layer.vue

@@ -0,0 +1,140 @@
+<template>
+	<view>
+		<view v-show="ifshow" @tap="ableClose" @touchmove.stop.prevent class="popup-layer" >
+			
+		</view>
+		<view ref="popRef"  class="popup-content"   @tap.stop="stopEvent" :style="_location">
+			<slot></slot>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'popup-layer',
+		model: {
+			prop: "showPop",
+			event: "change"
+		},
+		props: {
+			showPop:{
+				type:Boolean,
+				default:false,
+			},
+			direction: {
+				type: String,
+				default: 'top', // 方向  top,bottom,left,right 
+			},
+			autoClose: {
+				type: Boolean,
+				default: true,
+			}
+		},
+		data() {
+			return {
+				ifshow: false, // 是否展示,
+				translateValue: -100, // 位移距离
+				site:-100,
+				timer: null,
+				iftoggle: false,
+
+			};
+		},
+		computed: {
+			_translate() {
+				const transformObj = {
+					'top': `transform:translateY(${-this.translateValue}%)`,
+					'bottom': `transform:translateY(${this.translateValue}%)`,
+					'left': `transform:translateX(${-this.translateValue}%)`,
+					'right': `transform:translateX(${this.translateValue}%)`
+				};
+				return transformObj[this.direction]
+			},
+			_location() {
+				const positionValue = {
+					'top': `bottom:${this.site}%;width:100%;`,
+					'bottom': `top:${this.site}%;width:100%;`,
+					'left': `right:0px;top:0;height:100%;`,
+					'right': `left:0px;top:0;height:100%;`,
+				};
+				return positionValue[this.direction]+ this._translate;
+			}
+		},
+		mounted(){
+			if(this.showPop){
+				// console.log(222);
+				this.show();
+			}
+		},
+		watch:{
+			showPop(value){
+				console.log(value)
+				if(value){
+					this.show();
+				}else{
+					this.close();
+				}
+			}	
+		},
+		methods: {
+			stopMove(event){
+				return;
+			},
+			show(events) {
+				this.ifshow = true;
+				this.site=0;
+				let _open = setTimeout(() => {
+					this.translateValue = 0;
+					_open = null;
+				}, 100)
+				let _toggle = setTimeout(() => {
+					this.iftoggle = true;
+					_toggle = null;
+				}, 300);
+			},
+			close() {
+				if (this.timer !== null || !this.iftoggle) {
+					return;
+				}
+				this.translateValue = -100;
+				this.timer = setTimeout(() => {
+					this.ifshow = false;
+					this.timer = null;
+					this.iftoggle = false;
+					this.$emit('closeCallBack', null);
+					this.$emit('change',false)
+				}, 300);
+			},
+			ableClose() {
+				if (this.autoClose) {
+					this.close();
+				}
+			},
+			stopEvent(event) {},
+			doSome(){
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	.popup-layer {
+		position: fixed;
+		z-index: 999999;
+		// background: rgba(0, 0, 0, .3);
+		height: 100%;
+		width: 100%;
+		top: 0px;
+		left: 0px;
+		overflow: hidden;
+	}
+
+	.popup-content {
+		position: fixed;
+		z-index: 1000000;
+		background: #FFFFFF;
+		transition: transform .2s ease;
+		overflow: hidden; 
+	}
+</style>

+ 7 - 18
manifest.json

@@ -16,6 +16,9 @@
             "autoclose" : true,
             "delay" : 0
         },
+        "compatible" : {
+            "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持  
+        },
         /* 模块配置 */
         "modules" : {
             "Geolocation" : {},
@@ -60,14 +63,14 @@
                 "geolocation" : {
                     "amap" : {
                         "__platform__" : [ "android" ],
-                        "appkey_ios" : "ed68829a9567cb9e4c9dd45b4b7f65d5",
-                        "appkey_android" : "ed68829a9567cb9e4c9dd45b4b7f65d5"
+                        "appkey_ios" : "ac51ca831a1a737daebf4f455bf862ca",
+                        "appkey_android" : "ac51ca831a1a737daebf4f455bf862ca"
                     }
                 },
                 "maps" : {
                     "amap" : {
-                        "appkey_ios" : "ed68829a9567cb9e4c9dd45b4b7f65d5",
-                        "appkey_android" : "ed68829a9567cb9e4c9dd45b4b7f65d5"
+                        "appkey_ios" : "ac51ca831a1a737daebf4f455bf862ca",
+                        "appkey_android" : "ac51ca831a1a737daebf4f455bf862ca"
                     }
                 },
                 "ad" : {}
@@ -137,20 +140,6 @@
                     "key" : "B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ"
                 }
             }
-        },
-        "devServer" : {
-            // "port": 8080,
-            // "disableHostCheck" : true,
-            "proxy" : {
-                "/dpc" : {
-                    "target" : "https://apis.map.qq.com/ws",
-                    "changeOrigin" : true,
-                    "secure" : false,
-                    "pathRewrite" : {
-                        "^/dpc" : "/dpc"
-                    }
-                }
-            }
         }
     }
 }

+ 9 - 0
pages.json

@@ -828,6 +828,15 @@
 				"navigationBarTitleText": "设备分布",
 				"enablePullDownRefresh": false
 			}
+		}, {
+			"path": "pages/fourBase/city",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false,
+				"app-plus": {
+					"softinputMode": "adjustResize"
+				}
+			}
 
 		}
 	],

+ 118 - 41
pages/afterSale/addafter.vue

@@ -33,28 +33,42 @@
 							</view>
 							<view class="uploading" v-if="uploadingTF[index]">
 								<u-icon name="close" class="delete" @click="deletes(index)"></u-icon>
-								<image :src="imageList[index]" mode="" class="uploading"></image>
+								<image :src="imageList[index]" mode="" class="uploading" @click="examine(imageList[index])"></image>
 							</view>
 						</view>
-						<view class="imgvideo_video" v-for="(item,index) in 3">
+						<view class="imgvideo_video" v-for="(item,index) in 1">
 							<view @click="gainvideo(index)">
 								<image src="../../static/image/afterSale/80314eaa07c32e9c76537a8a8224130.png" mode="" v-if="!uploadingTF[index+3]"></image>
 							</view>
 							<view class="uploading" v-if="uploadingTF[index+3]">
-								<u-icon name="close" class="delete" @click="deletes(index+3)"></u-icon>
-								<video :src="BASE_URL+selfList[index]" controls class="uploading"></video>
+								<video :src="BASE_URL+selfList" :controls="false" class="uploading" ></video>
+								<view class="yulan" @click="yulan(index)">
+									预览
+								</view>
+								<view class="deletes" @click="deletes(index+3)">
+									删除
+								</view>
 							</view>
 						</view>
 					</view>
 					<button @click="btn" :disabled="btnisTorF">提 交</button>
 				</view>
 		</view>
-		
 		</view>
+		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="imgs" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
+		<u-modal v-model="videoshow" :mask-close-able="true" :show-confirm-button="false" title="视频预览" class="model">
+			<view class="model_box">
+				<video :src="BASE_URL+selfList" controls style="width:90%;"></video>
+			</view>
+		</u-modal>
 	</view>
 </template>
 <script>
+	import kpsImageCutter from "@/components/ksp-image-cutter/ksp-image-cutter.vue";
 	export default {
+		components:{
+			kpsImageCutter
+		},
 		data() {
 			return {
 				BASE_URL: 'http://182.92.193.64:8002',
@@ -69,7 +83,7 @@
 				},
 				imageList:[],//图片链接
 				uploadingTF:[false,false,false,false,false,false],//图片的删除
-				selfList:[],//视频链接
+				selfList:'',//视频链接
 				actionSheetList: [//设备选项
 					{
 						text: '杀虫灯'
@@ -97,7 +111,11 @@
 				btnisTorF:false,
 				deviceid:false,//设备号判断
 				imageFile:[],
-				phoneTF:true//手机号判断
+				phoneTF:true,//手机号判断
+				imgs:'',
+				imgindex:null,
+				videoindex:0,
+				videoshow:false
 			}
 		},
 		methods: {
@@ -107,43 +125,43 @@
 				})
 			},
 			gainimg(index){//添加图片
+				this.imgindex = index
 				uni.chooseImage({
 				    count: 1, //默认9
 				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 				    sourceType: ['album','camera'], //从相册选择
 				    success: (res)=> {
-						uni.uploadFile({
-						    url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
-							filePath: res.tempFilePaths[0],
-						    name: 'img_file',
-						    formData: {
-						        'user': 'test'
-						    },
-						    success: (uploadFileRes) => {
-								this.imageList[index]=JSON.parse(uploadFileRes.data).data.src
-								this.$forceUpdate() //强制刷新视图
-								this.uploadingTF[index]=true
-						    }
-						});
+						this.imgs = res.tempFilePaths[0]
 					}
 				});
 			},
 			gainvideo(index){//添加视频
 				uni.chooseVideo({
 				    count: 1,
-					mediaType:['video'],
+					sourceType:['album', 'camera'],
 				    success:(res)=> {
+						console.log(res)
 						uni.uploadFile({
 						    url: 'http://182.92.193.64:8002/api/api_gateway?method=after_sale.after_sale_manage.video_upload', //仅为示例,非真实的接口地址
-						    file: res.tempFile,
+						    filePath: res.tempFilePath,
 						    name: 'upload',
+							fileType:"video",
 						    formData: {
 						        'user': 'test'
 						    },
 						    success: (uploadFileRes) => {
-								this.selfList[index]=JSON.parse(uploadFileRes.data).data.data.src
-								this.$forceUpdate() //强制刷新视图
-								this.uploadingTF[index+3]=true
+								console.log(uploadFileRes)
+								if(uploadFileRes.statusCode == 200){
+									this.selfList=JSON.parse(uploadFileRes.data).data.data.src
+									this.$forceUpdate() //强制刷新视图
+									this.uploadingTF[index+3] = true
+								}else{
+									uni.showToast({
+									    title: '请将视频压缩后上传!',
+									    duration: 2000,
+										icon:"none"
+									});
+								}
 						    }
 						});
 				    }
@@ -220,17 +238,50 @@
 			},
 			addID(){
 				this.getID(this.adddata.id)
+			},
+			examine(url) {
+				var imgarr =[]
+				imgarr.push(url)
+				console.log(imgarr)
+				uni.previewImage({
+					urls: imgarr
+				});
+			},
+			onok(ev){
+				uni.uploadFile({
+				    url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+					filePath: ev.path,
+				    name: 'img_file',
+				    formData: {
+				        'user': 'test'
+				    },
+				    success: (uploadFileRes) => {
+						this.imageList[this.imgindex]=JSON.parse(uploadFileRes.data).data.src
+						this.$forceUpdate() //强制刷新视图
+						this.uploadingTF[this.imgindex]=true
+				    }
+				});
+				this.imgs = ""
+			},
+			oncancle(){
+				this.imgs = ""
+			},
+			yulan(index){
+				this.videoindex = index
+				this.videoshow = !this.videoshow
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
+	page{
+		background-color: #71CD9A;
+	}
 	.addafter_con{
 		width: 100%;
-		padding: 110rpx 0;
-		background-color: #71CD9A;
-		box-sizing: border-box;
+		position: absolute;
+		top: 54px;
 		.addafter_con_top{
 			width: 90%;
 			margin: 0 auto;
@@ -292,7 +343,6 @@
 			margin-top: 20rpx;
 			background-color: #FFFFFF;
 			display: flex;
-			justify-content: space-around;
 			flex-wrap: wrap;
 			.imgvideo_img,.imgvideo_video{
 				width: 30%;
@@ -300,7 +350,7 @@
 				border: 2rpx dashed #A3DABD;
 				text-align: center;
 				line-height: 160rpx;
-				margin-bottom: 20rpx;
+				margin:0 10rpx 20rpx 8rpx;
 				position: relative;
 				image{
 					width: 40rpx;
@@ -312,16 +362,34 @@
 					position: absolute;
 					top: 0;
 					left: 0;
-					.delete{
-						position: absolute;
-						top: -12rpx;
-						right: -12rpx;
-						font-size: 36rpx;
-						background-color: #FE0000;
-						border-radius: 50%;
-						color: #ffffff;
-						z-index: 50;
-					}
+				}
+				.delete{
+					position: absolute;
+					top: -12rpx;
+					right: -12rpx;
+					font-size: 36rpx;
+					background-color: #FE0000;
+					border-radius: 50%;
+					color: #ffffff;
+					z-index: 50;
+				}
+				.deletes{
+					width: 80%;
+					height: 50rpx;
+					margin-left: 110%;
+					font-size: 24rpx;
+					background-color: #FE0000;
+					color: #FFFDEF;
+					line-height: 50rpx;
+				}
+				.yulan{
+					width: 80%;
+					height: 50rpx;
+					margin: 0 0 20rpx 110%;
+					font-size: 24rpx;
+					background-color: #62BF89;
+					color: #FFFDEF;
+					line-height: 50rpx;
 				}
 			}
 		}
@@ -332,7 +400,16 @@
 			line-height: 60rpx;
 			color: #FFFFFF;
 			background-color: #50CE87;
-			margin-top: 40rpx;
+			margin-top: 60rpx;
+		}
+	}
+	.model {
+		width: 90%;
+		.model_box {
+			width: 90%;
+			margin: 40rpx auto 48rpx;
+			display: flex;
+			justify-content: center;
 		}
 	}
 </style>

+ 23 - 5
pages/afterSale/index.vue

@@ -22,7 +22,7 @@
 					<p>故障上报时间:{{item.uptime|timeFormat()}}</p>
 				</view>
 				<view class="aftersale_item_operate">
-					<button class="fault" @click="fault(item.errordesc)">故障原因</button>
+					<button :class="item.errordesc?'fault':'none'" :disabled="!item.errordesc" @click="fault(item.errordesc)">故障原因</button>
 					<button :class="item.errorimg.length!=0?'imgs':'none'" :disabled="item.errorimg.length==0" @click="faultImg(item.errorimg)">图片</button>
 					<button :class="item.errorvideo?'video':'none'" :disabled="!item.errorvideo" @click="faultVideo(item.errorvideo)">视频</button>
 				</view>
@@ -34,7 +34,7 @@
 		<u-modal v-model="show" :mask-close-able="maskcloseable" :show-confirm-button="showconfirmbutton" :title="title" class="model">
 			<view class="model_box">
 				<p v-if="faultinfo_tf">{{faultinfo}}</p>
-				<u-swiper :list="faultimg" v-if="faultimg_tf" class="uswiper" height="400" style="width: 100%;"></u-swiper>
+				<u-swiper :list="faultimg" v-if="faultimg_tf" class="uswiper" height="400" style="width: 100%;" @click="examine(faultimg)"></u-swiper>
 				<video :src="BASE_URL+faultvideo" controls v-if="faultvideo_tf" style="width:90%;"></video>
 			</view>
 		</u-modal>
@@ -74,15 +74,19 @@
 				faultvideo: '',//故障视频
 				faultvideo_tf:false,//故障视频显示
 				faultimg: [],//故障图片
-				faultimg_tf: false//故障图片显示
+				faultimg_tf: false,//故障图片显示
+				page:1
 			}
 		},
 		methods: {
 			async getAftersale() {
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_info',
+					data:{
+						page:this.page
+					}
 				})
-				this.faultdata = res.data
+				this.faultdata =this.faultdata.concat(res.data)
 				for (var i = 0; i < this.faultdata.length; i++) {
 					this.faultdata[i].errorimg = JSON.parse(this.faultdata[i].errorimg)
 					if (this.faultdata[i].errorimg == null) {
@@ -140,10 +144,24 @@
 				uni.switchTab({
 					url:"../index/index"
 				})
-			}
+			},
+			examine(url) {
+				var imgarr =[]
+				for(var i=0;i<url.length;i++){
+					imgarr.push(url[i].image)
+				}
+				console.log(imgarr)
+				uni.previewImage({
+					urls: imgarr
+				});
+			},
 		},
 		onLoad() { 
 			this.getAftersale()
+		},
+		onReachBottom() {
+			this.page++
+			this.getAftersale()
 		}
 	}
 </script>

+ 53 - 7
pages/afterSale/search.vue

@@ -4,11 +4,14 @@
 		<view style="position: fixed;z-index: 100;top: 44px;">
 			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回"></uni-nav-bar>
 			<view class="search_top_input">
-				<input type="text" value="" placeholder="请输入设备ID"  v-model="imports"/>
+				<input type="text" value="" placeholder="请输入设备ID"  v-model="imports" @input="searchinp"/>
 				<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
 			</view>
 		</view>
-		<view class="aftersale">
+		<view class="aftersaleinfo" v-if="aftersaleinfotf">
+			暂无此设备信息
+		</view>
+		<view class="aftersale" v-else>
 			<view class="aftersale_item" v-for="(item,index) in faultdata" :key="index">
 				<view class="aftersale_item_title">
 					<u-icon name="calendar" color="#71D8AF" size="34"></u-icon>
@@ -33,13 +36,17 @@
 		<u-modal v-model="show" :mask-close-able="maskcloseable" :show-confirm-button="showconfirmbutton" :title="title" class="model">
 			<view class="model_box">
 				<p v-if="faultinfo_tf">{{faultinfo}}</p>
-				<u-swiper :list="faultimg" v-if="faultimg_tf" class="uswiper" height="400" ></u-swiper>
+				<u-swiper :list="faultimg" v-if="faultimg_tf" class="uswiper" height="400" style="width: 100%;" @click="examine(faultimg)"></u-swiper>
 				<video :src="BASE_URL+faultvideo" controls v-if="faultvideo_tf" style="width: 90%;"></video>
 			</view>
 		</u-modal>
 	</view>
 </template>
 <script>
+	import {
+		Debounce,
+		Throttle
+	} from "../../util/anitthro.js"
 	export default {
 		data() {
 			return {
@@ -74,7 +81,9 @@
 				faultvideo: '',//故障视频
 				faultvideo_tf:false,//故障视频显示
 				faultimg: [],//故障图片
-				faultimg_tf: false//故障图片显示
+				faultimg_tf: false,//故障图片显示
+				aftersaleinfotf:'',
+				page:1
 			}
 		},
 		methods: {
@@ -82,10 +91,17 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_info',
 					data:{
-						f_id:num
+						f_id:num,
+						page:this.page
 					}
 				})
-				this.faultdata = res.data
+				this.faultdata =this.faultdata.concat(res.data)
+				console.log(this.faultdata)
+				if(this.faultdata.length==0){
+					this.aftersaleinfotf = true
+				}else{
+					this.aftersaleinfotf = false
+				}
 				for (var i = 0; i < this.faultdata.length; i++) {
 					this.faultdata[i].errorimg = JSON.parse(this.faultdata[i].errorimg)
 					if (this.faultdata[i].errorimg == null) {
@@ -111,6 +127,7 @@
 					obj.image = info[i]
 					this.faultimg.push(obj)
 				}
+				console.log(this.faultimg)
 				this.title="故障图片"
 				this.show = true
 				this.faultimg_tf = true
@@ -129,7 +146,27 @@
 				uni.navigateTo({
 					url:"./index"
 				})
-			}
+			},
+			searchinp() {
+				Debounce(() => {
+					this.eqlistdata = []
+					this.search()
+				}, 1000)()
+			},
+			examine(url) {
+				var imgarr =[]
+				for(var i=0;i<url.length;i++){
+					imgarr.push(url[i].image)
+				}
+				console.log(imgarr)
+				uni.previewImage({
+					urls: imgarr
+				});
+			},
+		},
+		onReachBottom() {
+			this.page++
+			this.getAftersale(Number(this.imports))
 		}
 	}
 </script>
@@ -155,6 +192,15 @@
 			right: 26rpx;
 		}
 	}
+	.aftersaleinfo{
+		width: 100%;
+		position: relative;
+		top: 98px;
+		height: 100rpx;
+		text-align: center;
+		line-height: 100rpx;
+		font-size: 32rpx;
+	}
 	.aftersale {
 		width: 100%;
 		// margin-top: 20rpx;

+ 12 - 9
pages/cb/bzy/equip-set/bzyhistoryile.vue

@@ -26,6 +26,7 @@
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 							<td class="td">{{items.d_h_t.ds==0?"关":"开"}}</td>
 							<td class="td">{{items.d_h_t.at}}</td>
 							<td class="td">{{items.d_h_t.ah}}</td>
@@ -38,7 +39,6 @@
 							<td class="td">{{items.d_h_t.current}}</td>
 							<td class="td">{{items.d_h_t.vbat}}</td>
 							<td class="td">{{items.d_h_t.dver}}</td>
-							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 						</tr>
 						<tr class="tr" v-if="forbidden">
 							<td class="td" v-for="item in 13">暂无数据</td>
@@ -82,8 +82,8 @@
 				page: 1,
 				pagesum:null,
 				historylistdata: [],
-				thdata: ["设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓温度设定温度(°C)", "保温仓温度当前温度(°C)", "电池状态", "雨控状态", "摄像头状态", "信号强度", "电流(mA)",
-					"电压(V)", "设备版本", "上报时间"
+				thdata: ["上报时间","设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓温度设定温度(°C)", "保温仓温度当前温度(°C)", "电池状态", "雨控状态", "摄像头状态", "信号强度", "电流(mA)",
+					"电压(V)", "设备版本"
 				],
 				forbidden: false,
 				canvastishiTF: false,
@@ -122,10 +122,10 @@
 					var xtitle = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
-						arr1.unshift(res[i].new_tem)
-						arr2.unshift(res[i].new_hum)
-						arr3.unshift(res[i].others)
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.unshift(res[i].temperature==""?"0":res[i].temperature)
+						arr2.unshift(res[i].humidity==""?"0":res[i].humidity)
+						arr3.unshift(res[i].others==""?"0":res[i].others)
 					}
 					var obj = [{
 						name: '温度',
@@ -226,7 +226,7 @@
 						disableGrid: true,
 						type: 'grid',
 						gridType: 'dash',
-						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						// scrollAlign: 'left', //滚动条初始位置
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
@@ -343,10 +343,13 @@
 					line-height: 52rpx;
 					border: 2rpx solid #F1F1F1;
 				}
-
 				.th {
 					height: 100rpx;
 				}
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
 			}
 		}
 

+ 2 - 1
pages/cb/cbd/equip-set/equip-set.vue

@@ -203,7 +203,7 @@
 		data() {
 			return {
 				d_id:'',
-				dsArr:['开机','关机'],
+				dsArr:['关机','开机'],
 				dsIndex:0,
 				wsArr:['待机','工作'],
 				wsIndex:0,
@@ -436,6 +436,7 @@
 				this.etLabel=
 					res.et && res.et < 10 ? '0' + res.et + ':00' : res.et + ':00'
 				this.equipContrlForm=res
+				console.log(this.equipContrlForm)
 			},
 			async submit(){
 				console.log(this.equipContrlForm)

+ 27 - 11
pages/cb/cbd/equip-set/historyfile.vue

@@ -25,21 +25,22 @@
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 							<td class="td">{{items.d_h_t.at==""?"--":items.d_h_t.at}}</td>
 							<td class="td">{{items.d_h_t.ah==""?"--":items.d_h_t.ah}}</td>
 							<td class="td">{{items.d_h_t.hrt}}</td>
 							<td class="td">{{items.d_h_t.rps==0?"正常":"雨控"}}</td>
 							<td class="td">{{items.d_h_t.tps==0?"正常":"温控"}}</td>
-							<td class="td">{{items.d_h_t.lamp==0?"灭":"亮"}}</td>
+							<td class="td">{{items.d_h_t.lps==0?"正常":"光控"}}</td>
+							<td class="td">{{items.d_h_t.dg}}</td>
 							<td class="td">{{items.d_h_t.csq}}</td>
 							<td class="td">{{items.d_h_t.current}}</td>
 							<td class="td">{{items.d_h_t.vbat}}</td>
-							<td class="td">{{items.d_h_t.lat}}</td>
 							<td class="td">{{items.d_h_t.lng}}</td>
-							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.lat}}</td>
 						</tr>
 						<tr class="tr" v-if="forbidden">
-							<td class="td" v-for="item in 13">暂无数据</td>
+							<td class="td" v-for="item in 12">暂无数据</td>
 						</tr>
 					</table>
 				</scroll-view>
@@ -79,7 +80,7 @@
 				device_id: '',
 				page: 1,
 				historylistdata: [],
-				thdata: ["环境温度(°C)", "环境湿度(%)", "加热仓温度(°C)", "雨控状态", "温控状态", "灯管状态", "信号强度", "电流(mA)", "电压(V)", "经度", "纬度", "上报时间"],
+				thdata: ["上报时间","环境温度(°C)", "环境湿度(%)", "加热仓温度(°C)", "雨控状态", "温控状态","光控状态","灯管状态","信号强度", "电流(mA)", "电压(V)", "经度", "纬度"],
 				forbidden: false,
 				cWidth: '400',
 				cHeight: '400',
@@ -112,11 +113,12 @@
 					var xtitle = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
-						arr1.unshift(res[i].new_tem==""?"0":res[i].new_tem)
-						arr2.unshift(res[i].new_hum==""?"0":res[i].new_hum)
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.unshift(res[i].temperature==""?"0":res[i].temperature)
+						arr2.unshift(res[i].humidity==""?"0":res[i].humidity)
 						arr3.unshift(res[i].others==""?"0":res[i].others)
 					}
+					// console.log(arr1)
 					var obj = [{
 						name: '温度',
 						data: arr1,
@@ -126,7 +128,7 @@
 						data: arr2,
 						color: '#6CBBFF'
 					}, {
-						name: '保温仓温度',
+						name: '加热仓温度',
 						data: arr3,
 						color: '#FF3F3F'
 					}]
@@ -146,7 +148,6 @@
 					}
 				})
 				this.historylistdata = res.data
-				console.log(res.counts)
 				this.pagesum =Math.ceil(res.counts/10)+1
 				if (res.data.length == 0) {
 					this.forbidden = true
@@ -155,6 +156,17 @@
 					this.forbidden = false
 					console.log(res.data.length)
 				}
+				for(var i=0;i<this.historylistdata.length;i++){
+					if(Number(this.historylistdata[i].d_h_t.ws) == 0){
+						this.historylistdata[i].d_h_t.dg = "待机" 
+					}else if(Number(this.historylistdata[i].d_h_t.ws) == 1){
+						if(Number(this.historylistdata[i].d_h_t.lamp) == 0){
+							this.historylistdata[i].d_h_t.dg  = "工作" 
+						}else if(Number(this.historylistdata[i].d_h_t.lamp) == 1){
+							this.historylistdata[i].d_h_t.dg  = "异常" 
+						}
+					}
+				}
 				console.log(this.historylistdata)
 			},
 			changeindex(index) {
@@ -217,7 +229,7 @@
 						disableGrid: true,
 						type: 'grid',
 						gridType: 'dash',
-						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						// scrollAlign: 'left', //滚动条初始位置
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
@@ -334,6 +346,10 @@
 					line-height: 52rpx;
 					border: 2rpx solid #F1F1F1;
 				}
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
 			}
 		}
 

+ 148 - 10
pages/cb/cbd/equip-set/imgpage.vue

@@ -3,14 +3,24 @@
 		<view class="status_bar"></view>
 		<view class="" style="position: relative;top: 44px;">
 			<view style="position: fixed;z-index: 100;">
-				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="查看图片"></uni-nav-bar>
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="查看图片" rightIcon="camera" @clickRight="clickRight"></uni-nav-bar>
 			</view>
 			<p class="tishi" v-if="tishi">暂无数据</p>
+			<view class="timeshow" v-else>
+				<view class="timeshow_tate" @click="selecttimestate">
+					{{timestate|timeFormat()}}
+				</view>
+				<view class="timeshow_end" @click="selecttimeend">
+					{{timeend|timeFormat()}}
+				</view>
+				<u-icon name="search" size="36" @click="search"></u-icon>
+				<u-picker mode="time" v-model="timeshow" :params="params" @confirm="confirm"></u-picker>
+			</view>
 			<view class="imglist">
 				<view class="imglist_box" v-for="(item,index) in imglists" :key="index">
 					<view class="imglist_left">
 						<image src="../../../../static/image/cb/jiazai.ui.gif" mode=""></image>
-						<image :src="item.addr" mode=""></image>
+						<image :src="item.addr" mode="" @click="examine(item)"></image>
 					</view>
 					<view class="imglist_right">
 						<view class="icon_box" @click="delimg(item.id)">
@@ -30,6 +40,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -39,18 +52,35 @@
 			return {
 				page: 1,
 				imglists: [],
-				tishi: true
+				tishi: true,
+				d_id: '',
+				timeend: null, //当前时间 也是搜索的结束时间
+				timestate: null,
+				timeshow: false,
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: true,
+					minute: true,
+					second: false
+				},
+				flag:1,
+				self:true,
+				isTop:false
 			}
 		},
 		methods: {
 			//forecast.forecast_system.equip_photofo
-			async imglistdata() { //获取图片列表
+			async imglistdata(time_begin,time_end) { //获取图片列表
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.forecast_system.equip_photo',
 					data: {
 						device_id: this.device_id,
 						page: this.page,
-						ret: "list"
+						ret: "list",
+						time_begin:time_begin,//开始时间
+						time_end:time_end,//结束时间
 					}
 				})
 				this.imglists = this.imglists.concat(res.data)
@@ -92,6 +122,24 @@
 					}
 				})
 			},
+			//forecast.send_control.admin_device_control 拍照 
+			async takephoto() { //统计
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+					data: {
+						device_type_id: 3,
+						d_id: this.d_id,
+						cmd: "takephoto"
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+				}
+			},
 			clickLeft() {
 				uni.navigateBack({
 					delta: 1
@@ -121,17 +169,72 @@
 				uni.navigateTo({
 					url: "./addimg?id=" + id + "&device_id" + this.device_id
 				})
+			},
+			examine(url) {
+				console.log(url)
+				var imgarr = []
+				imgarr.push(url.addr)
+				console.log(imgarr)
+				uni.previewImage({
+					urls: imgarr
+				});
+			},
+			clickRight() { //下发拍照指令
+				this.takephoto()
+			},
+			confirm(val){//时间选择框确定按钮
+				
+				var time = val.year+"-"+val.month+"-"+val.day+" "+val.hour+":"+val.minute+":00"
+				if(this.flag==1){
+					this.timestate = +new Date(time)/1000
+				}else if(this.flag==2){
+					this.timeend = +new Date(time)/1000
+				}
+			},
+			selecttimestate(){//开始时间选择
+				this.timeshow = !this.timeshow
+				this.flag = 1
+			},
+			selecttimeend(){//结束时间选择
+				this.timeshow = !this.timeshow
+				this.flag = 2
+			},
+			search(){//按时间搜索
+				this.imglists=[]
+				this.page = 1
+				this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
+				this.self = false
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		onLoad(option) {
 			console.log(option)
 			this.device_id = option.device_id
-			this.imglistdata()
+			this.d_id = option.d_id
+			this.imglistdata('','')
+			this.timeend = +new Date() / 1000
+			this.timestate = this.timeend - 60 * 60 * 24
 		},
 		onReachBottom() {
 			this.page++
-			this.imglistdata()
-		}
+			if(this.self){
+				this.imglistdata('','')
+			}else{
+				this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
+			}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -145,9 +248,31 @@
 		font-size: 40rpx;
 	}
 
+	.timeshow {
+		width: 96%;
+		height: 50rpx;
+		background-color: #FFFFFF;
+		position: fixed;
+		top: 84px;
+		left: 2.5%;
+		display: flex;
+		z-index: 100;
+		padding-top: 10px;
+
+		.timeshow_tate,
+		.timeshow_end {
+			height: 50rpx;
+			width: 45%;
+			line-height: 50rpx;
+			text-align: center;
+			margin-right: 10rpx;
+			background-color: #56C877;
+			color: #FFFFFF;
+		}
+	}
 	.imglist {
 		position: absolute;
-		top: 54px;
+		top: 84px;
 		width: 95%;
 		left: 2.5%;
 
@@ -174,19 +299,32 @@
 		.imglist_right {
 			margin-left: 40rpx;
 			padding: 10rpx 0;
-			.icon_box{
+
+			.icon_box {
 				margin-bottom: 12rpx;
 				font-size: 24rpx;
+
 				.iconfont {
 					margin-right: 20rpx;
 					color: #56C877;
 					font-size: 32rpx;
 				}
 			}
+
 			p:last-child {
 				margin-bottom: 0;
 			}
 
 		}
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 1 - 1
pages/cb/equip-detail/equip-detail.vue

@@ -592,7 +592,7 @@
 				margin: 10rpx;
 				width: 345rpx;
 				justify-content: flex-start;
-				padding: 20rpx;
+				padding: 20rpx 10rpx;
 				box-sizing: border-box;
 				border-radius: 4px;
 				box-shadow: 0px 0px 5px 3px rgba(136, 136, 136, .1);

+ 28 - 1
pages/cb/index/index.vue

@@ -18,7 +18,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="" style="position: absolute;top: 190px;width: 100%;">
+			<view class="" style="position: absolute;top: 180px;width: 100%;">
 				<view class="content">
 					<template v-for="(item,index) in equipArr[active].list" >
 						<equipItem @click.native="itemClick(item)" v-bind:item="item" :key="index">
@@ -30,6 +30,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -57,6 +60,7 @@
 					pageIndex:1,
 				}],
 				device_id:'',//筛选的设备id
+				isTop:false
 			}
 		},
 		onLoad(){
@@ -89,6 +93,13 @@
 			this.equipArr[act].pageIndex++;
 			this.getEquipList(act)
 		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 		methods: {
 			async getEquipList(act){
 			 const res=await this.$myRequest({
@@ -132,6 +143,12 @@
 				uni.switchTab({
 					url:"../../index/index"
 				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		components:{
@@ -174,4 +191,14 @@ image{
 		}
 	}
 }
+.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 2 - 0
pages/cb/sim/sim.vue

@@ -192,10 +192,12 @@
 <style lang="scss">
 	page{
 		padding:30rpx;
+		box-sizing: border-box;
 		.section{
 			padding:30rpx;
 			box-shadow: 0px 0px 5px 3px rgba(136,136,136,.1);
 			margin-bottom:20rpx;
+			box-sizing: border-box;
 			.item{
 				line-height:56rpx;
 				font-size:26rpx;

+ 20 - 12
pages/cb/xy/equip-set/xyhistoryile.vue

@@ -39,6 +39,7 @@
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 							<td class="td">{{items.d_h_t.proj}}</td>
 							<td class="td">{{items.d_h_t.ds==0?"关":"开"}}</td>
 							<td class="td">{{items.d_h_t.ws==0?"待机":"工作"}}</td>
@@ -51,7 +52,6 @@
 							<td class="td">{{items.d_h_t.infr_ct}}</td>
 							<td class="td">{{items.d_h_t.csq}}</td>
 							<td class="td">{{items.d_h_t.dver}}</td>
-							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 						</tr>
 						<tr class="tr" v-if="forbidden">
 							<td class="td" v-for="item in 13">暂无数据</td>
@@ -86,7 +86,7 @@
 				cWidth: '400',
 				cHeight: '400',
 				pixelRatio: 1,
-				canvastishiTF:false,
+				canvastishiTF: false,
 				d_id: '',
 				start_time: strrttime,
 				end_time: newtime,
@@ -96,13 +96,13 @@
 				device_id: '',
 				page: 1,
 				historylistdata: [],
-				thdata: ["型号", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "充电电压(V)", "电池电压(V)", "电池状态", "充电状态", "红外计数值", "信号强度", "版本号",
-					"上报时间"
+				thdata: ["上报时间", "型号", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "充电电压(V)", "电池电压(V)", "电池状态", "充电状态", "红外计数值", "信号强度",
+					"版本号"
 				],
 				forbidden: false,
 				wind_sped: '', //风速
 				wind_drec: '',
-				pagesum:null
+				pagesum: null
 			}
 		},
 		methods: {
@@ -150,15 +150,15 @@
 					this.canvastishiTF = false
 				} else {
 					this.canvastishiTF = true
-				
+
 					var arr1 = []
 					var arr2 = []
 					var xtitle = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
-						arr1.unshift(res[i].new_tem==""?"0":res[i].new_tem)
-						arr2.unshift(res[i].new_hum==""?"0":res[i].new_hum)
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.unshift(res[i].temperature==""?"0":res[i].temperature)
+						arr2.unshift(res[i].humidity==""?"0":res[i].humidity)
 					}
 					var obj = [{
 						name: '温度',
@@ -185,7 +185,7 @@
 					}
 				})
 				this.historylistdata = res.data
-				this.pagesum =Math.ceil(res.counts/10)+1
+				this.pagesum = Math.ceil(res.counts / 10)+1
 				if (res.data.length == 0) {
 					this.forbidden = true
 				} else {
@@ -262,7 +262,7 @@
 						disableGrid: true,
 						type: 'grid',
 						gridType: 'dash',
-						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						// scrollAlign: 'left', //滚动条初始位置
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
@@ -316,7 +316,8 @@
 		box-shadow: 0 0 10rpx #bcb9ca;
 		padding-top: 20rpx;
 		height: 550rpx;
-		.canvastishi{
+
+		.canvastishi {
 			font-size: 32rpx;
 			position: absolute;
 			top: 50%;
@@ -324,6 +325,7 @@
 			margin-left: -64rpx;
 			margin-top: -21rpx;
 		}
+
 		.shuju_one_title {
 			width: 70%;
 			margin: 0 auto;
@@ -359,6 +361,7 @@
 		box-shadow: 0 0 10rpx #bcb9ca;
 		padding: 20rpx;
 		box-sizing: border-box;
+
 		.wind_titie {
 			border-left: 6rpx solid #26D696;
 			height: 34rpx;
@@ -410,6 +413,11 @@
 					line-height: 52rpx;
 					border: 2rpx solid #F1F1F1;
 				}
+
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
 			}
 		}
 

+ 9 - 12
pages/environment/equipment.vue

@@ -98,23 +98,20 @@
 			},
 			reverseGeocode(lat,lng){
 				uni.request({
-					url: '/dpc/geocoder/v1',
-					data:{
-						location:lat+','+lng,
-						key:"B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ",
-						get_poi:1
-					},
-					success: (res) => {
-						this.city = res.data.result.address
-						console.log(res)
-					}
-				})
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + lng + "," +lat  + "&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",
+					dataType: "json",
+					complete: ress => {
+						console.log(ress)
+						this.city = ress.data.regeocode.formatted_address
+					}  
+				});
 			}
 		},
 		onLoad(option) {
 			this.$forceUpdate()
 			this.eqinfo.item = JSON.parse(option.shebei)
-			console.log(this.eqinfo)
+			console.log(JSON.parse(option.shebei))
 			this.history()
 			if(this.eqinfo.item.lat==''||this.eqinfo.item.lng==""){
 				console.log(1)

+ 17 - 22
pages/environment/history.vue

@@ -104,7 +104,7 @@
 				historydatas: [],
 				page: 1,
 				forbidden: false,
-				pagesum:null
+				pagesum: null
 			}
 		},
 		methods: { //weather.weather.qxz_detail
@@ -120,7 +120,7 @@
 				})
 				this.historydatas = res
 				console.log(res)
-				this.pagesum =Math.ceil(res.nums/10)+1
+				this.pagesum = Math.ceil(res.nums / 10) + 1
 				if (res.data.length == 0) {
 					this.forbidden = true
 				} else {
@@ -145,26 +145,26 @@
 					var linearr = []
 					for (var i = 0; i < res.data.length; i++) {
 						var times = new Date(res.data[i].time * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
 					}
 					for (var key in res.conf) {
 						var obj = {}
-						if(res.conf[key]!=""){
+						if (res.conf[key] != "") {
 							obj.name = res.conf[key]
 						}
 						var arr = []
 						for (var i = 0; i < res.data.length; i++) {
-							if(parseFloat(res.data[i].dat[key])!=-99.99){
+							if (parseFloat(res.data[i].dat[key]) != -99.99) {
 								arr.push(parseFloat(res.data[i].dat[key]))
 							}
 						}
-						obj.data=arr
-						if(obj.name){
+						obj.data = arr
+						if (obj.name) {
 							linearr.push(obj)
 						}
 					}
-					this.canvastishiTF = linearr.some((item)=>{
-						return item.data.length!=0;
+					this.canvastishiTF = linearr.some((item) => {
+						return item.data.length != 0;
 					})
 					console.log(this.canvastishiTF)
 					this.showColumn("canvasColumnA", xtitle, linearr)
@@ -227,7 +227,7 @@
 						disableGrid: true,
 						type: 'grid',
 						gridType: 'dash',
-						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						// scrollAlign: 'left', //滚动条初始位置
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
@@ -265,7 +265,7 @@
 			this.id = option.device_id
 			this.end = presenttime / 1000
 			this.begintime = presenttime / 1000 - 24 * 60 * 60
-			console.log(new Date(1616145097*1000),new Date(1616231497*1000))
+			console.log(new Date(1616145097 * 1000), new Date(1616231497 * 1000))
 			this.historydata(option.device_id)
 			this.listhistorydata(option.device_id)
 		}
@@ -278,11 +278,13 @@
 		top: 54px;
 		width: 90%;
 		left: 5%;
+
 		.canvasbox {
 			width: 100%;
 			height: 550rpx;
 			position: relative;
 			box-shadow: 0 0 10rpx #bcb9ca;
+
 			.canvastishi {
 				font-size: 32rpx;
 				position: absolute;
@@ -409,17 +411,10 @@
 					border: 2rpx solid #F1F1F1;
 				}
 
-				// 			.th:last-child,
-				// 			.td:last-child {
-				// 				width: 300rpx;
-				// 			}
-
-				// 			.th:nth-last-child(2),
-				// 			.th:nth-last-child(3),
-				// 			.td:nth-last-child(2),
-				// 			.td:nth-last-child(3) {
-				// 				width: 200rpx;
-				// 			}
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
 			}
 		}
 

+ 29 - 2
pages/environment/index.vue

@@ -21,6 +21,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -31,6 +34,7 @@
 				page: 1,
 				size: 10,
 				eqlistdata: [],
+				isTop:false
 			}
 		},
 		methods: {
@@ -58,6 +62,12 @@
 				uni.navigateTo({
 					url: "./equipment?shebei=" + JSON.stringify(data)
 				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		onLoad() {
@@ -66,7 +76,14 @@
 		onReachBottom() {
 			this.page++
 			this.eqlist()
-		}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -86,7 +103,7 @@
 	.prevents {
 		width: 100%;
 		position: absolute;
-		top: 244rpx;
+		top: 140px;
 
 		.prevents_item {
 			width: 95%;
@@ -129,4 +146,14 @@
 			}
 		}
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 123 - 37
pages/equipList/index.vue

@@ -11,7 +11,7 @@
 			</view>
 		</view>
 		<view class="list">
-			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index">
+			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index" @click="historys(item)">
 				<view class="list_item_top">
 					<p class="p1">
 						<image :src="images[current].path" mode=""></image>
@@ -24,11 +24,14 @@
 					<p>适配用户:{{item.device_user==''?"无":item.device_user}}</p>
 					<p>添加设备时间:{{item.addtime|timeFormat()}}</p>
 				</view>
-				<view class="list_item_btn" @click="modification(item)">
-					修改名称
+				<view class="list_item_btn" @click.stop="modification(item)">
+					信息修改
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -50,10 +53,10 @@
 					name: "孢子仪"
 				}],
 				current: 0,
-				page:1,
-				size:10,
+				page: 1,
+				size: 10,
 				images: [{
-						path: "../../static/image/fourMoodBase/3.png",//
+						path: "../../static/image/fourMoodBase/3.png", //
 						id: 2
 					},
 					{
@@ -68,12 +71,13 @@
 					}, {
 						path: "../../static/image/fourMoodBase/2.png",
 						id: 6
-					},{
+					}, {
 						path: "../../static/image/fourMoodBase/4.png",
 						id: 7
 					}
 				],
-				eqlistdata:[]
+				eqlistdata: [],
+				isTop: false
 			}
 		},
 		methods: {
@@ -81,62 +85,124 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
 					data: {
-						device_type_id: this.current+2,
-						page:this.page,
-						size:this.size,
+						device_type_id: this.current + 2,
+						page: this.page,
+						page_size: this.size,
 					}
 				})
-				this.eqlistdata=this.eqlistdata.concat(res.data) 
-				console.log(this.eqlistdata)
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+				console.log(res)
+			},
+			//camera.camera_manage.list_camera
+			async camera() { //设备列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=camera.camera_manage.list_camera',
+					data: {
+						page_size: 1,
+					}
+				})
+				this.accessToken = res.accessToken
 			},
 			change(index) { //头部导航栏的点击
 				console.log(index)
-				this.page=1
-				this.eqlistdata=[]
+				this.page = 1
+				this.eqlistdata = []
 				this.current = index
 				this.eqlist()
 			},
-			clickRight(){//搜索
+			clickRight() { //搜索
 				uni.navigateTo({
-					url:"./search"
+					url: "./search?id=" + (this.current + 2)
 				})
 			},
-			modification(item){
+			modification(item) {
 				uni.navigateTo({
-					url:"./modification?data="+JSON.stringify(item)
+					url: "./modification?data=" + JSON.stringify(item) + "&id=" + (this.current + 2)
+				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
 				})
+			},
+			historys(item) {
+				switch (this.current + 2) {
+					case 2:
+						uni.navigateTo({
+							url: "../prevention/equipmentdetails?shebei=" + JSON.stringify(item)
+						})
+						break;
+					case 5:
+						console.log(item)
+						var obj = {}
+						obj.d_id = item.d_id
+						obj.equip_id = item.imei
+						obj.is_online = item.is_online
+						obj.lat = item.lat
+						obj.lng = item.lng
+						obj.equip_name = item.device_name
+						obj.uptime = item.addtime
+						uni.navigateTo({
+							url: "../environment/equipment?shebei=" + JSON.stringify(obj)
+						})
+						break;
+					case 6:
+						uni.navigateTo({
+							url: "/pages/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken
+						})
+						break;
+					default:
+						item.type = this.current + 2
+						uni.navigateTo({
+							url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item)
+						})
+						break;
+				}
 			}
 		},
-		onLoad(){
+		onLoad() {
 			this.eqlist()
+			this.camera()
 		},
 		onReachBottom() {
 			this.page++
 			this.eqlist()
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
 		}
 	}
 </script>
 <style lang="scss">
-	/deep/.uni-icons{
-			font-size: 40rpx !important;
-		}
-	.utabs_box{
+	/deep/.uni-icons {
+		font-size: 40rpx !important;
+	}
+
+	.utabs_box {
 		width: 100%;
 		position: fixed;
 		top: 88px;
 		background-color: #FFFFFF;
 		z-index: 100;
+
 		.utabs {
 			width: 95%;
 			margin: 0 auto;
 		}
 	}
-	.list{
+
+	.list {
 		width: 100%;
 		background-color: #FDFDFD;
 		margin-top: 280rpx;
 		margin-bottom: 100rpx;
-		.list_item{
+
+		.list_item {
 			width: 90%;
 			margin: 20rpx auto;
 			padding: 20rpx 20rpx;
@@ -144,46 +210,55 @@
 			position: relative;
 			background-color: #FFFFFF;
 			box-shadow: 0 0 10rpx #bcb9ca;
-			.list_item_top{
+
+			.list_item_top {
 				display: flex;
 				justify-content: space-between;
-				.p1{
+
+				.p1 {
 					height: 60rpx;
 					line-height: 60rpx;
 					font-size: 28rpx;
-					image{
+
+					image {
 						width: 40rpx;
 						height: 40rpx;
-						vertical-align:text-top;
+						vertical-align: text-top;
 						margin-right: 20rpx;
 					}
 				}
-				.p2{
+
+				.p2 {
 					height: 60rpx;
 					line-height: 60rpx;
 					font-size: 28rpx;
 					color: #42b983;
 				}
-				.p_out{
+
+				.p_out {
 					height: 60rpx;
 					line-height: 60rpx;
 					font-size: 28rpx;
 					color: red;
 				}
 			}
-			.list_item_text{
+
+			.list_item_text {
 				margin-top: 20rpx;
-				p{
+
+				p {
 					font-size: 24rpx;
 					color: #636363;
 					margin-top: 10rpx;
 				}
-				p:first-child{
+
+				p:first-child {
 					font-size: 28rpx;
 					font-weight: 700;
 				}
 			}
-			.list_item_btn{
+
+			.list_item_btn {
 				width: 126rpx;
 				color: #42b983;
 				height: 40rpx;
@@ -198,5 +273,16 @@
 			}
 		}
 	}
-</style>
 
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
+</style>

+ 96 - 12
pages/equipList/modification.vue

@@ -7,7 +7,7 @@
 			</view>
 			<view class="mod">
 				<view class="mod_name">
-					<p>设备名称</p>
+					<p><span style="color: #ff0000;">*</span>设备名称</p>
 					<input type="text" v-model="moddata.device_name" style="background-color: #FAFAFA;" />
 				</view>
 				<view class="mod_id">
@@ -18,10 +18,18 @@
 					<p>适配用户</p>
 					<input type="text" :value="moddata.real_name==''?'无':moddata.real_name" disabled />
 				</view>
+				<view class="mod_city" @click="amendcity">
+					<p><span style="color: #ff0000;">*</span>设备位置</p>
+					<view style="display: flex;">
+						<input type="text" :value="city" disabled style="width: 400rpx;" />
+						<u-icon name="arrow-right"></u-icon>
+					</view>
+				</view>
 				<view class="mod_time">
 					<p>设备添加时间</p>
 					<input type="text" :value="moddata.addtime|timeFormat()" disabled />
 				</view>
+				<p style="width: 90%;margin: 0 auto;text-align: right;color: #06B535;"><span style="color: #ff0000;">*</span>为可修改</p>
 				<view class="sub" @click="btn">
 					提 交
 				</view>
@@ -34,31 +42,106 @@
 	export default {
 		data() {
 			return {
-				moddata: []
+				moddata: [],
+				city: "",
+				selectcityTF: false
 			}
 		},
 		methods: {
-			async eqlist() { //设备列表
+			async eqlistcity(lat, lng) { //修改设备定位
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
+					data: {
+						device_id: this.moddata.imei,
+						lat: lat,
+						lng: lng
+					}
+				})
+				console.log(res)
+				if (res==false) {
+					uni.showModal({
+						title: "修改地址失败",
+						icon: "none"
+					})
+				}
+			},
+			async eqlistname() { //修改设备名称
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
 					data: {
-						device_id: this.moddata.device_id,
-						device_name: this.moddata.device_name
+						device_id: this.moddata.imei,
+						device_name: this.moddata.device_name,
+					}
+				})
+				console.log(res)
+				if (res==false) {
+					uni.showModal({
+						title: "修改名称失败",
+						icon: "none"
+					})
+				}
+			},
+			async eqlistuser(id, imei) { //获取设备信息
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: id,
+						device_id: imei,
 					}
 				})
+				this.moddata = res.data[0]
+				this.selectaddress(this.moddata.lng, this.moddata.lat)
 			},
 			btn() {
-				this.eqlist()
+				this.eqlistcity(this.moddata.lat, this.moddata.lng)
+				this.eqlistname()
+				uni.removeStorage({
+					key: "location"
+				})
+				this.clickLeft()
 			},
 			clickLeft() {
-				uni.switchTab({
-					url: "./index"
+				uni.navigateBack({
+					delta:1
 				})
-			}
+			},
+			amendcity() { //修改设备地址
+				this.selectcityTF = true
+				uni.navigateTo({
+					url: "../fourBase/city"
+				})
+			},
+			selectaddress(lng, lat) { //获取分布位置
+				uni.request({
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + lng + "," + lat +
+						"&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",
+					dataType: "json",
+					complete: ress => {
+						// console.log(ress)
+						if (ress.data.regeocode.formatted_address.length == 0) {
+							this.city = "--"
+						} else {
+							this.city = ress.data.regeocode.formatted_address
+						}
+					}
+				});
+			},
 		},
 		onLoad(option) {
-			this.moddata = JSON.parse(option.data)
-			console.log(this.moddata)
+			this.eqlistuser(option.id, JSON.parse(option.data).imei)
+		},
+		onShow(){
+			uni.getStorage({
+				key: "location",
+				success: (res) => {
+					// console.log(res);
+					this.moddata.lat = res.data[1]
+					this.moddata.lng = res.data[0]
+					this.selectaddress(this.moddata.lng, this.moddata.lat)
+				}
+			})
+			
 		}
 	}
 </script>
@@ -74,7 +157,8 @@
 		.mod_name,
 		.mod_id,
 		.mod_user,
-		.mod_time {
+		.mod_time,
+		.mod_city {
 			width: 90%;
 			margin: 30rpx auto;
 			display: flex;

+ 85 - 45
pages/equipList/search.vue

@@ -1,22 +1,15 @@
 <template>
 	<view>
 		<view class="status_bar"></view>
-		<view style="position: fixed;top: 44px; z-index: 100;height: 160rpx;background-color: #FFFFFF;">
-			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" style="margin-top: 36rpx;"></uni-nav-bar>
-			<view class="">
-				<view class="search_top_input">
-					<input type="text" v-model="value" placeholder="请选择设备类型" disabled @click="show = true" />
-					<u-icon name="arrow-down-fill" size="20" class="icon" @click="show = true"></u-icon>
-					<u-action-sheet :list="options1" v-model="show" @click="actionSheetCallback"></u-action-sheet>
-				</view>
-				<view class="search_bot_input">
-					<input type="text" value="" placeholder="请输入设备ID" v-model="imports" />
-					<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
-				</view>
+		<view style="position: fixed;top: 44px; z-index: 100;height: 80rpx;background-color: #FFFFFF;padding-top: 10px;">
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回"></uni-nav-bar>
+			<view class="search_bot_input">
+				<input type="text" value="" placeholder="请输入设备ID" v-model="imports" @input="searchinput" />
+				<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
 			</view>
 		</view>
 		<view class="list">
-			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index">
+			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index" @click="historys(item)">
 				<view class="list_item_top">
 					<p class="p1">
 						<image :src="images[current].path" mode=""></image>
@@ -29,7 +22,7 @@
 					<p>适配用户:{{item.device_user==''?"无":item.device_user}}</p>
 					<p>添加设备时间:{{item.addtime|timeFormat()}}</p>
 				</view>
-				<view class="list_item_btn">
+				<view class="list_item_btn" @click.stop="modification(item)">
 					修改名称
 				</view>
 			</view>
@@ -41,28 +34,13 @@
 </template>
 
 <script>
+	import {
+		Debounce,
+		Throttle
+	} from "../../util/anitthro.js"
 	export default {
 		data() {
 			return {
-				options1: [{
-						text: '杀虫灯',
-					},
-					{
-						text: '测报灯',
-					},
-					{
-						text: '智能性诱',
-					},
-					{
-						text: '环境检测',
-					},
-					{
-						text: '监控设备',
-					},
-					{
-						text: '孢子仪',
-					},
-				],
 				imports: '',
 				eqlistdata: [],
 				current: 0,
@@ -88,9 +66,9 @@
 					}
 				],
 				eqlistdatatf: false, //暂无数据
-				show: false, //选择框
-				value: '', //选择框值
-				indexs: 2 //设备id
+				indexs: 2, //设备id
+				page: 1,
+				size: 10
 			}
 		},
 		methods: {
@@ -99,10 +77,12 @@
 					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
 					data: {
 						device_type_id: this.indexs,
-						device_id: this.imports
+						device_id: this.imports,
+						page: this.page,
+						page_size: this.size,
 					}
 				})
-				this.eqlistdata = res.data
+				this.eqlistdata = this.eqlistdata.concat(res.data)
 				if (this.eqlistdata.length == 0) {
 					this.eqlistdatatf = true
 				} else {
@@ -115,13 +95,71 @@
 				})
 			},
 			search() { //搜索
+				this.eqlistdata = []
+				this.page = 1
 				this.eqlist()
 			},
-			actionSheetCallback(index) { //选择框
-				this.value = this.options1[index].text;
-				this.indexs = index + 2
+			searchinput() {
+				Debounce(() => {
+					this.eqlistdata = []
+					this.page = 1
+					this.eqlist()
+				}, 1000)()
+			},
+			modification(item) {
+				uni.navigateTo({
+					url: "./modification?data=" + JSON.stringify(item) + "&id=" + (this.indexs)
+				})
+			},
+			historys(item) {
+				switch (this.indexs) {
+					case 2:
+						uni.navigateTo({
+							url: "../prevention/equipmentdetails?shebei=" + JSON.stringify(item)
+						})
+						break;
+					case 5:
+						console.log(item)
+						var obj = {}
+						obj.d_id = item.d_id
+						obj.equip_id = item.imei
+						obj.is_online = item.is_online
+						obj.lat = item.lat
+						obj.lng = item.lng
+						obj.equip_name = item.device_name
+						obj.uptime = item.addtime
+						uni.navigateTo({
+							url: "../environment/equipment?shebei=" + JSON.stringify(obj)
+						})
+						break;
+					case 6:
+						uni.navigateTo({
+							url: "/pages/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken
+						})
+						break;
+					default:
+						item.type = this.indexs
+						uni.navigateTo({
+							url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item)
+						})
+						break;
+				}
 			}
-		}
+		},
+		onLoad(option) {
+			this.indexs = option.id
+		},
+		onReachBottom() {
+			this.page++
+			this.eqlist()
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
 	}
 </script>
 <style lang="scss">
@@ -135,6 +173,7 @@
 		right: 18rpx;
 		padding-top: 8rpx;
 		box-sizing: border-box;
+
 		input {
 			width: 85%;
 			text-indent: 1rem;
@@ -154,10 +193,11 @@
 		background-color: #E4E4E4;
 		border-radius: 27rpx;
 		position: absolute;
-		top: 44px;
+		top: 18px;
 		right: 18rpx;
-		padding-top: 8rpx;
 		box-sizing: border-box;
+		padding-top: 8rpx;
+
 		input {
 			width: 85%;
 			text-indent: 1rem;
@@ -175,7 +215,7 @@
 		width: 100%;
 		background-color: #FDFDFD;
 		position: absolute;
-		top: 260rpx;
+		top: 100px;
 
 		.list_item {
 			width: 95%;

+ 54 - 29
pages/equipMange/index/assignment.vue

@@ -32,35 +32,11 @@
 				<button @click="canfirm" class="canfirm">确定分配</button>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
-<style lang="scss">
-	.allocbtn {
-		width: 100%;
-		position: fixed;
-		bottom: 0;
-		z-index: 100;
-		display: flex;
-
-		button {
-			width: 50%;
-			font-size: 24rpx;
-			height: 80rpx;
-			line-height: 80rpx;
-			border-radius: 0;
-		}
-
-		.cancel {
-			background-color: #C8C7CC;
-			color: #555555;
-		}
-
-		.canfirm {
-			color: white;
-			background-color: #42b983;
-		}
-	}
-</style>
 <script>
 	export default {
 		data() {
@@ -117,7 +93,8 @@
 				allocationvalues2: [], //选项框更改后的数据
 				allocationvalues3: [], //头部导航栏点击后的数据
 				allocationvaluesTF: false, //判断选项框是否变动
-				topbarTF: false //判断头部导航栏是否变更
+				topbarTF: false ,//判断头部导航栏是否变更
+				isTop:false
 			}
 		},
 		methods: {
@@ -218,6 +195,12 @@
 					url: './useroperation?item=' + JSON.stringify(this.user_info)
 				})
 			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			}
 		},
 		onLoad(option) {
 			this.user_info = JSON.parse(option.item)
@@ -226,7 +209,14 @@
 		onReachBottom() {
 			this.data.page++
 			this.getAssign(this.data)
-		}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -304,4 +294,39 @@
 			}
 		}
 	}
+	.allocbtn {
+		width: 100%;
+		position: fixed;
+		bottom: 0;
+		z-index: 100;
+		display: flex;
+	
+		button {
+			width: 50%;
+			font-size: 24rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 0;
+		}
+	
+		.cancel {
+			background-color: #C8C7CC;
+			color: #555555;
+		}
+	
+		.canfirm {
+			color: white;
+			background-color: #42b983;
+		}
+	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 36 - 2
pages/equipMange/index/index.vue

@@ -20,6 +20,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -44,7 +47,8 @@
 					page: 1,
 					page_size: 10,
 					username: ''
-				}
+				},
+				isTop:false
 			}
 		},
 		methods: {
@@ -85,6 +89,12 @@
 					this.userlists = []
 					this.getState(this.argument)
 				}, 1000)()
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		}, //user.login.users_info
 		onLoad() {
@@ -99,7 +109,21 @@
 			setTimeout(function() {
 				uni.stopPullDownRefresh(); //停止下拉刷新动画
 			}, 1000);
-		}
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 1
@@ -149,4 +173,14 @@
 			}
 		}
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 8 - 1
pages/equipMange/index/useroperation.vue

@@ -261,7 +261,14 @@
 			}
 			this.getGroup()
 			this.getThemes()
-		}
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
 	}
 </script>
 

+ 37 - 3
pages/expertDiagnosis/exchangeShare.vue

@@ -33,6 +33,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 <script>
@@ -49,7 +52,8 @@
 				post_show: false,
 				defaultimg: '/images/expertDiagnosis/img01.png',
 				page:1,
-				myTF:false //判断是全部发帖还是我的发帖
+				myTF:false ,//判断是全部发帖还是我的发帖
+				isTop:false
 			}
 		},
 		methods: {
@@ -86,7 +90,7 @@
 			},
 			clickLeft() {
 				uni.navigateTo({
-					url: 'index'
+					url: './index'
 				})
 			},
 			particulars(items) { //详情页
@@ -134,6 +138,12 @@
 				    }
 				});
 				
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		onLoad() {
@@ -149,7 +159,21 @@
 				let str = ""
 				this.getInvitation(str)
 			}
-		}
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -252,4 +276,14 @@
 			}
 		}
 	}
+	.top { 
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 9 - 2
pages/expertDiagnosis/index.vue

@@ -103,14 +103,21 @@
 			this.getCooperation(1)
 			this.getCooperation(2)
 			this.getCooperation(3)
-		}
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
 	}
 </script>
 
 <style lang="scss">
 	.expertimages {
 		width: 100%;
-		height: 154rpx;
+		height: 200rpx;
 		margin-top: 88rpx;
 	}
 

+ 0 - 1
pages/expertDiagnosis/particulars.vue

@@ -105,7 +105,6 @@
 					this.getDiscuss(obj)
 					this.issuedata = ''
 				}
-
 			},
 			focus(e) {
 				this.height = e.detail.height

+ 116 - 7
pages/expertDiagnosis/postmessage.vue

@@ -9,19 +9,36 @@
 				</view>
 				<view class="post_contert">
 					<textarea v-model="mainbody" placeholder="请输入正文" />
+					<view class="imgvideo_img">
+						<view @click="gainimg" class="imgbg">
+							<image src="../../static/image/afterSale/eee1e84bb85f6f6ff5c5866a3a42779.png" mode="" v-if="!uploadingTF"></image>
+						</view>
+						<view class="uploading" v-if="uploadingTF">
+							<u-icon name="close" class="delete" @click="deletes"></u-icon>
+							<image :src="path" mode="" class="uploading" @click="examine(path)"></image>
+						</view>
 					</view>
-			<button class="post_btn" @click="post">发布</button>
-		</view>
+				</view>
+				<button class="post_btn" @click="post">发布</button>
+			</view>
 		</view>
+		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="url" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
 	</view>
 </template>
 
 <script>
+	import kpsImageCutter from "@/components/ksp-image-cutter/ksp-image-cutter.vue";
 	export default {
+		components:{
+			kpsImageCutter
+		},
 		data() {
 			return {
 				title:'',  
-				mainbody:''
+				mainbody:'',
+				uploadingTF:false,
+				url:"",
+				path:""
 			}
 		},
 		methods: {
@@ -30,7 +47,8 @@
 					url: '/api/api_gateway?method=pest.pests.pests_new_idea',
 					data:{
 						title:data.title,
-						content:data.content
+						content:data.content,
+						img_urls:this.path
 					}
 				})
 				console.log(res)
@@ -41,6 +59,9 @@
 					obj.title=this.title
 					obj.content=this.mainbody
 					this.getPostmessage(obj)
+					uni.navigateTo({
+						url: './exchangeShare'
+					})
 				}
 			},
 			clickLeft(){
@@ -48,21 +69,65 @@
 					url: './exchangeShare'
 				})
 			},
+			gainimg(){//添加图片
+				uni.chooseImage({
+				    count: 1, //默认9
+				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+				    sourceType: ['album','camera'], //从相册选择
+				    success: (res)=> {
+						console.log(res)
+						this.url = res.tempFilePaths[0]
+					}
+				});
+			},
+			onok(ev){
+				console.log(ev)
+				uni.uploadFile({
+				    url: 'http://182.92.193.64:8002/api/api_gateway?method=pest.pests.pests_img', //仅为示例,非真实的接口地址
+					filePath: ev.path,
+				    name: 'img_file',
+				    formData: {
+				        'user': 'test'
+				    },
+				    success: (uploadFileRes) => {
+						console.log(JSON.parse(uploadFileRes.data).data.src)
+						this.path = JSON.parse(uploadFileRes.data).data.src
+						this.uploadingTF=true
+				    }
+				});
+				this.url = ''
+			},
+			oncancle(){
+				
+			},
+			examine(url) {
+				var imgarr =[]
+				imgarr.push(url)
+				console.log(imgarr)
+				uni.previewImage({
+					urls: imgarr
+				});
+			},
+			deletes(){
+				this.path = ""
+				this.uploadingTF=false
+			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	.post {
+	page{
 		background-color: #F5F5F5;
+	}
+	.post {
 		width: 100%;
-		height: 93vh;
 		padding-top: 16rpx;
-
 		.post_title {
 			padding: 40rpx 20rpx;
 			background-color: white;
 			width: 100%;
+			box-sizing: border-box;
 			input {
 				width: 90%;
 				margin: 0 auto;
@@ -75,10 +140,54 @@
 			background-color: white;
 			width: 100%;
 			height: 660rpx;
+			box-sizing: border-box;
 			textarea{
 				width: 90%;
 				margin: 0 auto;
 			}
+			.imgvideo_img{
+				width: 250rpx;
+				height: 250rpx;
+				border: 2rpx solid #57C878;
+				margin-left: 40rpx;
+				position: relative;
+				top: 0;
+				left: 0;
+				.imgbg{
+					width: 100%;
+					height: 100%;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					image{
+						width: 50rpx;
+						height: 50rpx;
+					}
+				}
+				.uploading{
+					width: 100%;
+					height: 100%;
+					.delete{
+						width: 36rpx;
+						height: 36rpx;
+						background-color: #FF0000;
+						border-radius: 50%;
+						padding: 2px 2px;
+						box-sizing: border-box;
+						position: absolute;
+						top: -18rpx;
+						right: -18rpx;
+						color: #FFFFFF;
+						z-index: 10;
+					}
+					.uploading{
+						width: 100%;
+						height: 100%;
+						position: absolute;
+						top: 0;
+					}
+				}
+			}
 		}
 		.post_btn{
 			width: 90%;

+ 70 - 43
pages/expertDiagnosis/wormcase.vue

@@ -15,47 +15,11 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
-<style lang="scss">
-	.particulars {
-		width: 100%;
-		position: relative;
-		top: 88rpx;
-		display: flex;
-		flex-wrap: wrap;
-
-		.particulars_item {
-			width: 50%;
-			padding: 20rpx;
-			box-sizing: border-box;
-
-			.imgs {
-				width: 100%;
-				height: 220rpx;
-				position: relative;
-				.imgbg{
-					width: 50%;
-					height: 50%;
-					position: absolute;
-					top: 25%;
-					left: 25%;
-				}
-				.imgs_img{
-					width: 100%;
-					height: 100%;
-					position: absolute;
-					top: 0;
-					left: 0;
-				}
-			}
-
-			p {
-				font-size: 24rpx;
-			}
-		}
-	}
-</style>
 <script>
 	export default {
 		data() {
@@ -65,7 +29,8 @@
 				data: {
 					code: null,
 					page: null
-				}
+				},
+				isTop:false
 			}
 		},
 		methods: {
@@ -88,7 +53,13 @@
 				uni.navigateTo({
 					url: "./introduce?id=" + id + "&title=" + this.title
 				})
-			}
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			},
 		},
 		onLoad(option) {
 			this.title = option.name
@@ -105,10 +76,66 @@
 		onReachBottom() {
 			this.data.page++
 			this.getCooperation(this.data)
-		}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
+<style lang="scss">
+	.particulars {
+		width: 100%;
+		position: relative;
+		top: 88rpx;
+		display: flex;
+		flex-wrap: wrap;
+
+		.particulars_item {
+			width: 50%;
+			padding: 20rpx;
+			box-sizing: border-box;
 
-<style>
+			.imgs {
+				width: 100%;
+				height: 220rpx;
+				position: relative;
 
+				.imgbg {
+					width: 50%;
+					height: 50%;
+					position: absolute;
+					top: 25%;
+					left: 25%;
+				}
+
+				.imgs_img {
+					width: 100%;
+					height: 100%;
+					position: absolute;
+					top: 0;
+					left: 0;
+				}
+			}
+
+			p {
+				font-size: 24rpx;
+			}
+		}
+	}
+
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 48 - 53
pages/fourBase/addbase.vue

@@ -38,37 +38,39 @@
 					<span>基地描述</span>
 					<textarea v-model="baseinfo.base_describe " maxlength="80" auto-height class="textarea" placeholder="请输入基地描述(不能大于80字)" />
 					</view>
-			<view class="base_text_item1" @click="map">
-				<u-icon name="Frame1" custom-prefix="custom-icon" class="icon"></u-icon>
-				<span><span style="color: #ff0000;margin: 0;">*</span>基地定位</span>
-				<input type="text" v-model="city" placeholder="请选择地址" disabled style="position: absolute;right: 60rpx;width: 60%;"/>
-				<u-icon name="arrow-right" class="iconright"></u-icon>
-			</view>
-			<view class="base_text_item1" @click="binding">
-				<u-icon name="bangding" custom-prefix="custom-icon" class="icon"></u-icon>
-				<span><span style="color: #ff0000;margin: 0;">*</span>设备绑定</span>
-				<u-icon name="arrow-right" class="iconright"></u-icon>
-			</view>
-			<view class="base_id_box">
-				<view class="base_id" v-for="(item,key,index) in base_id" :key="index">
-					<view class="base_id_item" v-for="(items,indexs) in item" :key="indexs">
-						<span>{{key}}</span>
-						<span>{{items}}</span>
+				<view class="base_text_item1" @click="map">
+					<u-icon name="Frame1" custom-prefix="custom-icon" class="icon"></u-icon>
+					<span><span style="color: #ff0000;margin: 0;">*</span>基地定位</span>
+					<input type="text" v-model="city" placeholder="请选择地址" disabled style="position: absolute;right: 60rpx;width: 60%;"/>
+					<u-icon name="arrow-right" class="iconright"></u-icon>
+				</view>
+				<view class="base_text_item1" @click="binding">
+					<u-icon name="bangding" custom-prefix="custom-icon" class="icon"></u-icon>
+					<span><span style="color: #ff0000;margin: 0;">*</span>设备绑定</span>
+					<u-icon name="arrow-right" class="iconright"></u-icon>
+				</view>
+				<view class="base_id_box">
+					<view class="base_id" v-for="(item,key,index) in base_id" :key="index">
+						<view class="base_id_item" v-for="(items,indexs) in item" :key="indexs">
+							<span>{{key}}</span>
+							<span>{{items}}</span>
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="btn" @click="tijiao">
+				<view class="btn" @click="tijiao">
 				确 定
+				</view>
 			</view>
 		</view>
-		</view>
+		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="imgs" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
 	</view>
 </template>
-<style lang="scss">
-	
-</style>
 <script>
+	import kpsImageCutter from "@/components/ksp-image-cutter/ksp-image-cutter.vue";
 	export default {
+		components:{
+			kpsImageCutter
+		},
 		data() {
 			return {
 				base_id:{},
@@ -84,7 +86,8 @@
 					lat:'',//必传(str)           纬度
 					ret:"add",//必传(str)           区分
 				},
-				city:''
+				city:'',
+				imgs:"",
 			}
 		},
 		methods: {
@@ -111,39 +114,14 @@
 						sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 						sourceType: ['album', 'camera'], //从相册选择
 						success: (res) => {
-							uni.uploadFile({
-								url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
-								filePath: res.tempFilePaths[0],
-								name: 'img_file',
-								formData: {
-									'user': 'test'
-								},
-								success: (uploadFileRes) => {
-									this.baseinfo.base_img = JSON.parse(uploadFileRes.data).data.src
-									// this.$forceUpdate() //强制刷新视图
-								}
-							});
+							this.imgs = res.tempFilePaths[0]
 						}
 					})
 			},
 			map(){
-				uni.getLocation({
-					type: 'wgs84',
-					success: (res) => {
-						console.log('当前位置的经度:' + res.longitude);
-						console.log('当前位置的纬度:' + res.latitude);
-						this.longitude = res.longitude
-						this.latitude = res.latitude
-						uni.chooseLocation({
-						    success:(res)=>{
-						        console.log('位置名称:' + res.name);//address 详细地址
-						        this.city = res.name
-						        this.baseinfo.lat = res.latitude
-						        this.baseinfo.lng = res.longitude
-						    }
-						});
-					}
-				});
+				uni.navigateTo({
+					url:"city"
+				})
 			},
 			tijiao(){
 				if(this.baseinfo.base_img==''){
@@ -218,6 +196,24 @@
 						icon:"none"
 					});
 				}
+			},
+			onok(ev){
+				uni.uploadFile({
+					url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+					filePath: ev.path,
+					name: 'img_file',
+					formData: {
+						'user': 'test'
+					},
+					success: (uploadFileRes) => {
+						this.baseinfo.base_img = JSON.parse(uploadFileRes.data).data.src
+						// this.$forceUpdate() //强制刷新视图
+					}
+				});
+				this.imgs = ''
+			},
+			oncancle(){
+				this.imgs = ''
 			}
 		},
 		onLoad() {
@@ -234,7 +230,6 @@
 						this.baseinfo.base_equip = arr.join("#")
 			    }
 			});
-			
 		}
 	}
 </script>

+ 28 - 1
pages/fourBase/allocation.vue

@@ -32,6 +32,9 @@
 				<button @click="canfirm" class="canfirm">确定分配</button>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -61,7 +64,8 @@
 				},],
 				src: '',
 				obj: {},
-				addtype: []
+				addtype: [],
+				isTop:false
 			}
 		},
 		methods: {
@@ -144,6 +148,12 @@
 
 				})
 			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			}
 		},
 		onLoad(option) {
 			console.log(option)
@@ -153,6 +163,13 @@
 			}
 			this.getFourbase()
 		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -292,4 +309,14 @@
 			background-color: #42b983;
 		}
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 30 - 4
pages/fourBase/basefacility.vue

@@ -22,6 +22,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -53,7 +56,8 @@
 					path: "../../static/image/fourMoodBase/bzy.png",
 					id: 7
 				}],
-				tishiTF: false
+				tishiTF: false,
+				isTop:false
 			}
 		},
 		methods: {
@@ -83,13 +87,25 @@
 				uni.navigateBack({
 					delta: 1
 				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		onLoad(option) {
 			this.base_id = option.id
 			this.ybase(option.id)
 		},
-
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -128,7 +144,7 @@
 				}
 
 				.equipment_top_name {
-					font-size: 24rpx;
+					font-size: 28rpx;
 					margin-left: 60rpx;
 				}
 			}
@@ -144,7 +160,7 @@
 				}
 
 				.equipment_bot_name {
-					font-size: 12px;
+					font-size: 13px;
 				}
 
 				.equipment_state {
@@ -161,4 +177,14 @@
 			}
 		}
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 43 - 0
pages/fourBase/city.vue

@@ -0,0 +1,43 @@
+<template>
+	<view>
+		<citySelect :getCity="getCity"></citySelect>	
+	</view>
+</template>
+
+<script>
+	import citySelect from '../../components/bazaar-city_list/index.vue';
+	export default {
+		components:{
+			citySelect
+		},
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			getCity({
+				city
+			}){
+				//city 城市名称
+				//name 定位名称
+				if(city.city == undefined){
+					var add = city
+				}else if(city.city != undefined){
+					var add = city.city
+				}
+				let pages = getCurrentPages()
+				let nowpage = pages[pages.length - 1]
+				let prevpage = pages[pages.length - 2]
+				prevpage.$vm.city = add
+				uni.navigateBack({
+					delta:1
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 33 - 4
pages/fourBase/index.vue

@@ -39,6 +39,9 @@
 				<u-action-sheet :list="actionSheetList" v-model="post_show" @click="message"></u-action-sheet>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 <script>
@@ -63,7 +66,8 @@
 				}],
 				post_show: false,
 				delid: "",
-				facilitynum: ""
+				facilitynum: "",
+				isTop:false
 			}
 		},
 		methods: {
@@ -74,9 +78,9 @@
 				})
 				this.baselist = this.baselist.concat(res.data)
 				console.log(this.baselist)
-				for(var i=0;i<this.baselist.length;i++){
+				for (var i = 0; i < this.baselist.length; i++) {
 					var arr = this.baselist[i].base_equip.split("#")
-					if(arr[0]==''){
+					if (arr[0] == '') {
 						arr.shift(1)
 					}
 					console.log(arr)
@@ -145,6 +149,12 @@
 					})
 				}
 				this.$forceUpdate()
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		onLoad() {
@@ -156,7 +166,14 @@
 		},
 		onShow() {
 			this.$forceUpdate()
-		}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 <style lang="scss">
@@ -278,4 +295,16 @@
 			}
 		}
 	}
+
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 36 - 39
pages/fourBase/modification.vue

@@ -62,10 +62,15 @@
 			</view>
 		</view>
 		</view>
+		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="imgs" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
 	</view>
 </template>
 <script>
+	import kpsImageCutter from "@/components/ksp-image-cutter/ksp-image-cutter.vue";
 	export default {
+		components:{
+			kpsImageCutter
+		},
 		data() {
 			return {
 				base_id:{},
@@ -80,7 +85,8 @@
 					lng:'',//必传(str)           经度
 					lat:'',//必传(str)           纬度
 				},
-				city:''
+				city:'',
+				imgs:""
 			}
 		},
 		methods: {
@@ -108,39 +114,14 @@
 						sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 						sourceType: ['album', 'camera'], //从相册选择
 						success: (res) => {
-							uni.uploadFile({
-								url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
-								filePath: res.tempFilePaths[0],
-								name: 'img_file',
-								formData: {
-									'user': 'test'
-								},
-								success: (uploadFileRes) => {
-									this.baseinfo.base_img = JSON.parse(uploadFileRes.data).data.src
-									// this.$forceUpdate() //强制刷新视图
-								}
-							});
+							this.imgs = res.tempFilePaths[0]
 						}
 					})
 			},
 			map(){
-				uni.getLocation({
-					type: 'gcj02',
-					success: (res) => {
-						console.log('当前位置的经度:' + res.longitude);
-						console.log('当前位置的纬度:' + res.latitude);
-						this.longitude = res.longitude
-						this.latitude = res.latitude
-						uni.chooseLocation({
-						    success:(res)=>{
-						        console.log('位置名称:' + res.name);//address 详细地址
-						        this.city = res.name
-						        this.baseinfo.lat = res.latitude
-						        this.baseinfo.lng = res.longitude
-						    }
-						});
-					}
-				});
+				uni.navigateTo({
+					url:"city"
+				})
 			},
 			tijiao(){
 				if(this.baseinfo.base_img==''){
@@ -205,20 +186,36 @@
 			},
 			selectaddress(lat,lng) { //获取分布位置
 				uni.request({
-					url: '/dpc/geocoder/v1',
-					data:{
-						location:lat+','+lng,
-						key:"B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ",
-						get_poi:1
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + lng + "," +lat  + "&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",
+					dataType: "json",
+					complete: ress => {
+						console.log(ress)
+						this.city = ress.data.regeocode.formatted_address
+					}  
+				});
+			},
+			onok(ev){
+				uni.uploadFile({
+					url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+					filePath: ev.path,
+					name: 'img_file',
+					formData: {
+						'user': 'test'
 					},
-					success: (res) => {
-						this.city = res.data.result.address
-						console.log(res)
+					success: (uploadFileRes) => {
+						this.baseinfo.base_img = JSON.parse(uploadFileRes.data).data.src
+						// this.$forceUpdate() //强制刷新视图
 					}
-				})
+				});
+				this.imgs = ''
 			},
+			oncancle(){
+				this.imgs = ''
+			}
 		},
 		onLoad(option) {
+			console.log(JSON.parse(option.id))
 			this.baseinfo = JSON.parse(option.id)
 			this.baseinfo.base_id = JSON.parse(option.id).id
 			this.baseinfo.ret = "modify"

+ 12 - 0
pages/login/login.vue

@@ -62,6 +62,18 @@
 				}
 			})
 		},
+		onShow(){
+			uni.getStorage({
+				key: 'session_key',
+				success: (res) => {
+					if(res.data!=""){
+						uni.switchTab({
+							url: "../index/index"
+						})
+					}
+				}
+			})
+		},
 		methods: {
 			async formSubmit() {
 				const res = await this.$myRequest({

+ 29 - 2
pages/monitor/index.vue

@@ -21,6 +21,9 @@
 				</template>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -32,7 +35,8 @@
 				listArr: [],
 				page: 1,
 				accessToken: '',
-				counts: ''
+				counts: '',
+				isTop:false
 			}
 		},
 		onLoad() {
@@ -54,6 +58,13 @@
 			}
 			this.getEquipList()
 		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 		methods: {
 			async getEquipList() {
 				const res = await this.$myRequest({
@@ -71,7 +82,7 @@
 						device_status: item.status
 					}
 				})
-				console.log(arr)
+				console.log(res)
 				console.log(this.listArr)
 				this.listArr = [...this.listArr, ...arr]
 				this.accessToken = res.accessToken
@@ -96,6 +107,12 @@
 				uni.navigateTo({
 					url: "/pages/webview?device_id=" + item.device_id + "&accessToken=" + this.accessToken
 				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		components: {
@@ -126,4 +143,14 @@
 		width: 95%;
 		left: 2.5%;
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 11 - 10
pages/prevention/equipmentdetails.vue

@@ -94,7 +94,7 @@
 					}, {
 						icon: '../../static/image/prevention/100.png',
 						txt: '清虫间隔(min)',
-						value: this.olddata.clt
+						value: this.olddata.clt_t
 					}, {
 						icon: '../../static/image/prevention/101.png',
 						txt: '雨控状态',
@@ -143,15 +143,16 @@
 					delta: 1
 				})
 			},
-			sim() { //sim卡详情
-				// uni.navigateTo({
-				// 	url:"./sim?id="+this.eqinfo.item.d_id
-				// })
-				uni.showToast({
-					title: '此功能暂未开放',
-					duration: 2000,
-					icon: "none"
-				});
+			sim() { 
+				// sim卡详情
+				uni.navigateTo({
+					url:"./sim?id="+this.eqinfo.item.d_id
+				})
+				// uni.showToast({
+				// 	title: '此功能暂未开放',
+				// 	duration: 2000,
+				// 	icon: "none"
+				// });
 			},
 			control() { //设备控制
 				uni.navigateTo({

+ 29 - 2
pages/prevention/index.vue

@@ -21,6 +21,9 @@
 				</view>
 			</view>
 		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
 	</view>
 </template>
 
@@ -31,6 +34,7 @@
 				page: 1,
 				size: 10,
 				eqlistdata: [],
+				isTop:false
 			}
 		},
 		methods: {
@@ -60,6 +64,12 @@
 				uni.navigateTo({
 					url: "./equipmentdetails?shebei=" + JSON.stringify(data)
 				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
 			}
 		},
 		onLoad() {
@@ -68,7 +78,14 @@
 		onReachBottom() {
 			this.page++
 			this.eqlist()
-		}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
 	}
 </script>
 
@@ -88,7 +105,7 @@
 	.prevents {
 		width: 100%;
 		position: absolute;
-		top: 254rpx;
+		top: 140px;
 
 		.prevents_item {
 			width: 95%;
@@ -131,4 +148,14 @@
 			}
 		}
 	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
 </style>

+ 10 - 5
pages/prevention/search.vue

@@ -10,15 +10,15 @@
 				</view>
 			</view>
 			<view class="prevents">
-				<view class="prevents_item" v-for="item,index in eqlistdata" :key="index">
-					<image :src="item.device_status==1?'../../static/image/prevention/6.png':'../../static/image/prevention/7.png'"
+				<view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
+					<image :src="item.is_online==1?'../../static/image/prevention/6.png':'../../static/image/prevention/7.png'"
 					 mode="" class="prevents_item_img"></image>
 					<view class="prevents_item_top">
-						<p>设备 ID:{{item.device_id}}</p>
-						<p :class="item.device_status==1?'green':'red'" v-text="item.device_status==1?'在线':'离线'"></p>
+						<p>设备 ID:{{item.imei}}</p>
+						<p :class="item.is_online==1?'green':'red'" v-text="item.is_online==1?'在线':'离线'"></p>
 					</view>
 					<view class="prevents_item_bot">
-						最新上报时间:{{item.status_time|timeFormat()}}
+						最新上报时间:{{item.addtime|timeFormat()}}
 					</view>
 				</view>
 			</view>
@@ -91,6 +91,11 @@
 			actionSheetCallback(index) { //选择框
 				this.value = this.options1[index].text;
 				// this.id = this.options1[index].id
+			},
+			eqdetails(data) {
+				uni.navigateTo({
+					url: "./equipmentdetails?shebei=" + JSON.stringify(data)
+				})
 			}
 		}
 	}

+ 11 - 1
pages/prevention/sim.vue

@@ -9,6 +9,7 @@
 				<p>sim卡查询</p>
 			</view>
 			<view class="sim_info_text">
+				<p>运营商:{{siminfo.data.carrier}}</p>
 				<p>ICCID:{{iccid}}</p>
 				<p>状态:{{state[siminfo.data.account_status]}}</p>
 				<p>套餐:{{siminfo.data.data_plan}}MB</p>
@@ -25,7 +26,16 @@
 		data() {
 			return {
 				iccid:'',
-				siminfo:[],
+				siminfo:{
+					data:{
+						carrier:"--",
+						account_status:"--",
+						data_plan:"--",
+						data_usage:"--",
+						data_balance:"--",
+						outbound_date:+new Date()/1000
+					}
+				},
 				state:['未知', '测试期' ,'沉默期' ,'使用中' ,'停机', '停机保号' ,'预销号' ,'销号'],
 				id:''
 			}

+ 22 - 18
pages/prevention/ucharts.vue

@@ -60,6 +60,7 @@
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="'b'+indexs" v-if="forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 							<td class="td">{{items.d_h_t.ds==0?"关机":"开机"}}</td>
 							<td class="td">{{items.d_h_t.ws==0?"待机":"工作"}}</td>
 							<td class="td">{{items.d_h_t.rps==0?"正常":"保护"}}</td>
@@ -71,10 +72,9 @@
 							<td class="td">{{items.d_h_t.ah}}</td>
 							<td class="td">{{items.d_h_t.cv}}</td>
 							<td class="td">{{items.d_h_t.bv}}</td>
-							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
 						</tr>
 						<tr class="tr" v-if="!forbidden">
-							<td class="td" v-for="item in 13">暂无数据</td>
+							<td class="td" v-for="item in 12">暂无数据</td>
 						</tr>
 					</table>
 				</scroll-view>
@@ -83,6 +83,9 @@
 					<view class="pagenumber_page">
 						第{{page}}页
 					</view>
+					<view class="pagenumber_page">
+						共 {{pagesum}} 页
+					</view>
 					<button @click="next" :disabled="!forbidden">下一页</button>
 				</view>
 			</view>
@@ -101,8 +104,7 @@
 	export default {
 		data() {
 			return {
-				thdata: ["设备开关", "工作状态", "雨控状态", "温控状态", "倾倒状态", "定时(h)", "电击次数", "温度(℃)", "湿度(%)", "充电电压(v)", "电池电压(v)",
-					"上报时间"
+				thdata: ["上报时间","设备开关", "工作状态", "雨控状态", "温控状态", "倾倒状态", "定时(h)", "电击次数", "温度(℃)", "湿度(%)", "充电电压(v)", "电池电压(v)",	
 				],
 				eqlistdata: [],
 				cWidth: '400',
@@ -131,7 +133,8 @@
 					end_time: null,
 					device_id: null
 				},
-				canvastishiTF:false
+				canvastishiTF:false,
+				pagesum:0
 			}
 		},
 		// 页面加载执行的函数
@@ -149,7 +152,7 @@
 		methods: { // 
 			//forecast.worm_lamp.device_polyline_data
 			// 获取数据,发请求
-			async getServerData(newtime, oldtimes) { //设备列表
+			async getServerData(newtime, oldtimes) { //设备折线图
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.device_polyline_data',
 					data: {
@@ -172,11 +175,11 @@
 					var arr5 = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
 						arr1.unshift(res[i].temperature)
 						arr2.unshift(res[i].humidity)
-						arr3.unshift(Number(res[i].others.bv)/1000)
-						arr4.unshift(Number(res[i].others.cv)/1000)
+						arr3.unshift(Number(res[i].others.bv))
+						arr4.unshift(Number(res[i].others.cv))
 						arr5.unshift(res[i].others.ct)
 					}
 					arr.unshift(arr1,arr2,arr3,arr4)
@@ -239,7 +242,7 @@
 					this.tishiTF = false
 				}
 			},
-			async historydata(newtime, oldtimes) { //设备
+			async historydata(newtime, oldtimes) { //设备表格数据
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
 					data: {
@@ -252,6 +255,7 @@
 					}
 				})
 				console.log(res.data)
+				this.pagesum = Math.ceil(res.counts/10)+1
 				this.eqlistdata = res.data
 				if (res.data.length == 0) {
 					this.forbidden = false
@@ -316,7 +320,7 @@
 						disableGrid: true,
 						type: 'grid',
 						gridType: 'dash',
-						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						// scrollAlign: 'left', //滚动条初始位置
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
@@ -352,7 +356,7 @@
 						disableGrid: true,
 						type: 'grid',
 						gridType: 'dash',
-						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						// scrollAlign: 'left', //滚动条初始位置
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
@@ -380,7 +384,7 @@
 				//下面是toolTip事件,如果滚动后不需要显示,可不填写
 				canvaColumnA.showToolTip(e, {
 					format: function(item, category) {
-						return category + ' ' + item.name + ':' + item.data
+						return category + ' ' + item.name + ':' + Number(item.data).toFixed(3)
 					}
 				});
 			},
@@ -554,15 +558,15 @@
 					border: 2rpx solid #F1F1F1;
 				}
 
-				.th:last-child,
-				.td:last-child {
+				.th:first-child,
+				.td:first-child {
 					width: 300rpx;
 				}
 
+				.th:nth-last-child(1),
 				.th:nth-last-child(2),
-				.th:nth-last-child(3),
-				.td:nth-last-child(2),
-				.td:nth-last-child(3) {
+				.td:nth-last-child(1),
+				.td:nth-last-child(2) {
 					width: 200rpx;
 				}
 			}

BIN
static/image/6209a98f0cb3b5086f2ca36152c9269.png


BIN
unpackage/cache/apk/__UNI__DBA6730_cm.apk


+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://service.dcloud.net.cn/build/download/58a55d80-8b7c-11eb-a8ad-c3f0190b7461
+https://service.dcloud.net.cn/build/download/f7e80dc0-8d38-11eb-8b39-3dfa3a743d49

File diff suppressed because it is too large
+ 1 - 1
unpackage/cache/apk/cmManifestCache.json


File diff suppressed because it is too large
+ 2 - 2
unpackage/cache/wgt/__UNI__DBA6730/app-config-service.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-service.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-view.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/manifest.json


File diff suppressed because it is too large
+ 2 - 2
unpackage/dist/build/app-plus/app-config-service.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/app-plus/manifest.json


File diff suppressed because it is too large
+ 2 - 2
unpackage/dist/dev/app-plus/app-config-service.js


File diff suppressed because it is too large
+ 3864 - 2786
unpackage/dist/dev/app-plus/app-service.js


File diff suppressed because it is too large
+ 2343 - 1276
unpackage/dist/dev/app-plus/app-view.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/manifest.json


BIN
unpackage/dist/dev/app-plus/static/image/6209a98f0cb3b5086f2ca36152c9269.png


BIN
unpackage/release/apk/__UNI__DBA6730_20210323100614.apk