zhangyun 4 år sedan
förälder
incheckning
ca41cc66a0

+ 0 - 13
js_sdk/u-charts/package.json

@@ -1,13 +0,0 @@
-{
-    "id": "u-charts",
-    "name": "uCharts高性能跨全端图表",
-    "version": "1.9.6.20210214",
-    "description": "支持H5、PC、APP、小程序(微信/支付宝/百度/头条/QQ/360)Vue、Taro",
-    "keywords": [
-        "echarts",
-        "canvas2d",
-        "F2",
-        "图表",
-        "跨全端"
-    ]
-}

+ 0 - 471
js_sdk/u-charts/u-charts/config.js

@@ -1,471 +0,0 @@
-/*
- * uCharts组件 默认配置文件,如有修改,更新前请备份此文件!!
- * Copyright (c) 2021 QIUN秋云 https://www.ucharts.cn All rights reserved.
- * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- * 
- * uCharts官方网站
- * https://www.uCharts.cn
- * 
- * 开源地址:
- * https://gitee.com/uCharts/uCharts
- * 
- * uni-app插件市场地址:
- * http://ext.dcloud.net.cn/plugin?id=271
- * 
- */
-module.exports = {
-	"type":["pie","ring","rose","word","funnel","map","arcbar","line","column","area","radar","gauge","candle","mix","point","bubble"],
-	"categories":["line","column","area","radar","gauge","candle","mix","point","bubble"],
-	//以上数据请勿改动,下面是自定义默认配置,请添加项目所需的个性配置
-	"pie":{
-		type: 'pie',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-			padding:5,
-			lineHeight:11,
-			margin:0,
-		},
-		dataLabel: true,
-		extra: {
-			pie: {
-		    border:true,
-		    borderColor:'#FFFFFF',
-		    borderWidth:3
-			}
-		}
-	},
-	"ring":{
-		type: 'ring',
-		padding:[5,5,5,5],
-		legend:{
-			show:true,
-			position:'right',
-			float:'center',
-			itemGap:10,
-			padding:5,
-			lineHeight:26,
-			margin:5,
-			borderWidth :1
-		},
-		disablePieStroke: true,
-		dataLabel: true,
-		subtitle: {
-			name: '70%',
-			color: '#7cb5ec',
-			fontSize: 25,
-		},
-		title: {
-			name: '收益率',
-			color: '#666666',
-			fontSize: 15,
-		},
-		extra: {
-			pie: {
-			  offsetAngle: 0,
-			  ringWidth: 40,
-			  labelWidth:15
-			}
-		}
-	},
-	"rose":{
-		type: 'rose',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-			position:'left',
-			float:'center',
-			itemGap:10,
-			padding:5,
-			lineHeight:26,
-			margin:5,
-			borderWidth :1
-		},
-		dataLabel: true,
-		extra: {
-			rose: {
-				type:'area',
-				minRadius:50,
-				activeOpacity:0.5,
-				offsetAngle:0,
-				labelWidth:15
-			}
-		}
-	},
-	"word":{
-		type: 'word',
-		extra: {
-			word: {
-				type: 'normal'
-			}
-		}
-	},
-	"funnel":{
-		type: 'funnel',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-			padding:5,
-			lineHeight:11,
-			margin:0,
-		},
-		dataLabel: true,
-		extra: {
-			funnel: {
-		    border:true,
-		    borderWidth:2,
-		    borderColor:'#FFFFFF'
-			}
-		}
-	},
-	"map":{
-		type: 'map',
-		padding:[0,0,0,0],
-		legend:{
-			show:false
-		},
-		dataLabel:true,
-		extra: {
-			map: {
-		    border:true,
-		    borderWidth:1,
-		    borderColor:'#666666',
-		    fillOpacity:0.6
-			}
-		}
-	},
-	"arcbar":{
-		type: 'arcbar',
-		legend:{show:false},
-		dataLabel: true,
-		title: {
-			name: "百分比",
-			color: '#00FF00',
-			fontSize: 25
-		},
-		subtitle: {
-			name: "默认标题",
-			color: '#666666',
-			fontSize: 15
-		},
-		extra: {
-			arcbar:{
-				type:'default',
-				width: 12,
-			}
-		}
-	},
-	"line":{
-		type: 'line',
-		padding:[15,30,0,15],
-		legend:{
-			show:true,
-			padding:5,
-			lineHeight:11,
-			margin:0,
-		},
-		dataLabel: true,
-		dataPointShape:true,
-		xAxis: {
-			disableGrid: true,
-		},
-		yAxis: {
-			gridType: 'dash',
-			gridColor: '#CCCCCC',
-			dashLength: 8,
-			splitNumber: 4,
-			format: val => {
-				return val.toFixed(0);
-			}
-		},
-		extra: {
-			line:{
-				type: 'straight'
-			}
-		}
-	},
-	"column":{
-		type: 'column',
-		padding:[15,5,0,15],
-		legend:{
-			show:true,
-			padding:5,
-			lineHeight:11,
-			margin:0,
-		},
-		animation: true,
-		dataLabel: true,
-		xAxis: {
-			disableGrid:true,
-		},
-		yAxis: {
-		  data:[{
-		    position:'right',
-				axisLine:false,
-		    format:(val)=>{return val.toFixed(0)},
-		  }]
-		},
-		extra: {
-			column: {
-				type:'group',
-				width:30
-			}
-		}
-	},
-	"area":{
-		type: 'area',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-		},
-		dataLabel:true,
-		dataPointShape:true,
-		xAxis: {
-			disableGrid:true,
-		},
-		yAxis: {
-			gridType:'dash',
-			gridColor:'#CCCCCC',
-			dashLength:8,
-			splitNumber:5,
-		},
-		extra: {
-			area:{
-				type: 'straight',
-				opacity:0.2,
-				addLine:true,
-				width:2,
-				gradient:false
-			}
-		}
-	},
-	"radar":{
-		type: 'radar',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-			padding:5,
-			lineHeight:11,
-			margin:0,
-		},
-		animation: true,
-		dataLabel: true,
-		extra: {
-			radar: {
-				max: 200,
-				gridType:'radar'//radar或者circle可选,网格样式,默认radar
-			}
-		}
-	},
-	"gauge":{
-		type: 'gauge',
-		legend:{show:false},
-		animation: true,
-		dataLabel: true,
-		title: {
-			name: "字符串类型",
-			color: '#00FF00',
-			fontSize: 25,
-			offsetY:50,
-		},
-		subtitle: {
-			name: "字符串类型",
-			color: '#666666',
-			fontSize: 15,
-			offsetY:-50,
-		},
-		extra: {
-			gauge:{
-				type:'default',
-				width: 30,
-				startAngle:0.75,
-				endAngle:0.25,
-				startNumber:0,
-				endNumber:100,
-				splitLine:{
-					fixRadius:0,
-					splitNumber:10,
-					width: 30,
-					color:'#FFFFFF',
-					childNumber:5,
-					childWidth:30*0.4,
-				},
-				pointer:{
-					width: 30*0.8,
-					color:'auto'
-				}
-			}
-		}
-	},
-	"candle":{
-		type: 'candle',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-			padding:5,
-			lineHeight:11,
-			margin:8,
-		},
-		enableMarkLine: true,
-		enableScroll: true,
-		dataLabel: false,
-		dataPointShape: true,
-		xAxis: {
-			disableGrid:true,
-			labelCount:4,
-			itemCount:5,
-			scrollShow:true,
-			scrollAlign:'right',
-		},
-		yAxis: {
-			gridType:'dash',
-			splitNumber:5,
-			format:(val)=>{return val.toFixed(0)}
-		},
-		extra: {
-			candle:{
-				color:{
-					upLine:'#f04864',
-					upFill:'#f04864',
-					downLine:'#2fc25b',
-					downFill:'#2fc25b'
-				},
-				average:{
-					show:true,
-					name:['MA5','MA10','MA30'],
-					day:[5,10,20],
-					color:['#1890ff', '#2fc25b', '#facc14']
-				}
-			},
-			tooltip:{
-				bgColor:'#000000',
-				bgOpacity:0.7,
-				gridType:'dash',
-				dashLength:5,
-				gridColor:'#1890ff',
-				fontColor:'#FFFFFF',
-				horizentalLine:true,
-				xAxisLabel:true,
-				yAxisLabel:true,
-				labelBgColor:'#DFE8FF',
-				labelBgOpacity:0.95,
-				labelAlign:'left',
-				labelFontColor:'#666666'
-			},
-		  markLine: {
-		    type: 'dash',
-		    dashLength: 5,
-		    data: [{
-		      value:2150,
-		      lineColor: '#f04864',
-		      showLabel:true
-		    },{
-		      value:2350,
-		      lineColor: '#f04864',
-		      showLabel:true
-		    }]
-		  }
-		}
-	},
-	"mix":{
-		type: 'mix',
-		padding:[15,15,0,15],
-		legend:{
-			show:true,
-		  position:'bottom',
-		  float:'center',
-			padding:5,
-			lineHeight:11,
-			margin:6,
-		},
-		dataLabel: true,
-		dataPointShape: true,
-		xAxis: {
-			disableGrid:true,
-		},
-		yAxis: {
-		  data:[{
-		    calibration:true,
-		    position:'left',
-		    title:'折线',
-		    titleFontSize:12,
-		    format:(val)=>{return val.toFixed(0)+'度'}
-		  },{
-		    calibration:true,
-		    position:'right',
-		    min:0,
-		    max:200,
-		    title:'柱状图',
-		    titleFontSize:12,
-		    format:(val)=>{return val.toFixed(0)+'元'}
-		  },{
-		    calibration:true,
-		    position:'right',
-		    min:0,
-		    max:200,
-		    title:'点',
-		    titleFontSize:12
-		  }],
-		  showTitle:true,
-			gridType:'dash',
-			dashLength:4,
-			splitNumber:5
-		},
-		extra: {
-		  column:{
-		    width:20
-		  }
-		}
-	},
-	"point":{
-		type: 'point',
-		padding:[15,30,0,15],
-		legend:{
-			show:true
-		},
-		dataLabel: false,
-		dataPointShape:true,
-		xAxis: {
-			disableGrid: true,
-			labelCount: 4
-		},
-		yAxis: {
-			gridType: 'dash',
-			gridColor: '#CCCCCC',
-			dashLength: 8,
-			splitNumber: 4,
-			format: val => {
-				return val.toFixed(1);
-			}
-		},
-		extra: {
-			point:{
-			}
-		}
-	},
-	"bubble":{
-		type: 'bubble',
-		padding:[15,30,0,15],
-		legend:{
-			show:true
-		},
-		dataLabel: true,
-		xAxis: {
-			disableGrid: true,
-			labelCount: 4
-		},
-		yAxis: {
-			gridType: 'dash',
-			gridColor: '#CCCCCC',
-			dashLength: 8,
-			splitNumber: 4,
-			format: val => {
-				return val.toFixed(1);
-			}
-		},
-		extra: {
-			bubble:{
-			}
-		}
-	}
-}

+ 0 - 267
js_sdk/u-charts/u-charts/demodata.json

@@ -1,267 +0,0 @@
-{
-	"Column": {
-		"categories": ["2016", "2017", "2018", "2019", "2020", "2021"],
-		"series": [{
-			"name": "目标值",
-			"data": [35, 36, 31, 33, 13, 34]
-		}, {
-			"name": "完成量",
-			"data": [18, 27, 21, 24, 6, 28]
-		}]
-	},
-	"ColumnA": {
-		"categories": ["2016", "2017", "2018", "2019", "2020", "2021"],
-		"series": [{
-			"name": "成交量1",
-			"data": [15, {
-				"value": 20,
-				"color": "#f04864"
-			}, 45, 37, 43, 34]
-		}, {
-			"name": "成交量2",
-			"data": [30, {
-				"value": 40,
-				"color": "#facc14"
-			}, 25, 14, 34, 18]
-		}]
-	},
-	"Mix": {
-		"categories": ["2016", "2017", "2018", "2019", "2020", "2021"],
-		"series": [{
-			"name": "曲面",
-			"data": [70, 50, 85, 130, 64, 88],
-			"type": "area",
-			"style": "curve"
-		}, {
-			"name": "柱1",
-			"data": [40, 30, 55, 110, 24, 58],
-			"type": "column"
-		}, {
-			"name": "柱2",
-			"data": [50, 20, 75, 60, 34, 38],
-			"type": "column"
-		}, {
-			"name": "曲线",
-			"data": [70, 50, 85, 130, 64, 88],
-			"type": "line",
-			"style": "curve",
-			"color": "#1890ff",
-			"disableLegend": true
-		}, {
-			"name": "折线",
-			"data": [120, 140, 105, 170, 95, 160],
-			"type": "line",
-			"color": "#2fc25b"
-		}, {
-			"name": "点",
-			"data": [100, 80, 125, 150, 112, 132],
-			"type": "point",
-			"color": "#f04864"
-		}]
-	},
-	"Line": {
-		"categories": ["2016", "2017", "2018", "2019", "2020", "2021"],
-		"series": [{
-			"name": "成交量A",
-			"data": [35, 8, 25, 37, 4, 20]
-		}, {
-			"name": "成交量B",
-			"data": [70, 40, 65, 100, 44, 68]
-		}, {
-			"name": "成交量C",
-			"data": [100, 80, 95, 150, 112, 132]
-		}]
-	},
-	"Pie": {
-		"series": [{
-			"name": "一班",
-			"data": 50
-		}, {
-			"name": "二班",
-			"data": 30
-		}, {
-			"name": "三班",
-			"data": 20
-		}, {
-			"name": "四班",
-			"data": 18
-		}, {
-			"name": "五班",
-			"data": 8
-		}]
-	},
-	"Radar": {
-		"categories": ["维度1", "维度2", "维度3", "维度4", "维度5", "维度6"],
-		"series": [{
-			"name": "成交量1",
-			"data": [90, 110, 165, 195, 187, 172]
-		}, {
-			"name": "成交量2",
-			"data": [190, 210, 105, 35, 27, 102]
-		}]
-	},
-	"Arcbar": {
-		"series": [{
-			"name": "正确率",
-			"data": 0.29,
-			"color": "#2fc25b"
-		}]
-	},
-	"Gauge": {
-		"categories": [{
-			"value": 0.2,
-			"color": "#1890ff"
-		}, {
-			"value": 0.8,
-			"color": "#2fc25b"
-		}, {
-			"value": 1,
-			"color": "#f04864"
-		}],
-		"series": [{
-			"name": "完成率",
-			"data": 0.66
-		}]
-	},
-	"Candle": {
-		"categories": [
-			"2020/1/24", "2020/1/25", "2020/1/28", "2020/1/29", "2020/1/30",
-			"2020/1/31", "2020/2/1", "2020/2/4", "2020/2/5", "2020/2/6",
-			"2020/2/7", "2020/2/8", "2020/2/18", "2020/2/19", "2020/2/20",
-			"2020/2/21", "2020/2/22", "2020/2/25", "2020/2/26", "2020/2/27",
-			"2020/2/28", "2020/3/1", "2020/3/4", "2020/3/5", "2020/3/6",
-			"2020/3/7", "2020/3/8", "2020/3/11", "2020/3/12", "2020/3/13",
-			"2020/3/14", "2020/3/15", "2020/3/18", "2020/3/19", "2020/3/20",
-			"2020/3/21", "2020/3/22", "2020/3/25", "2020/3/26", "2020/3/27",
-			"2020/3/28", "2020/3/29", "2020/4/1", "2020/4/2", "2020/4/3",
-			"2020/4/8", "2020/4/9", "2020/4/10", "2020/4/11", "2020/4/12",
-			"2020/4/15", "2020/4/16", "2020/4/17", "2020/4/18", "2020/4/19",
-			"2020/4/22", "2020/4/23", "2020/4/24", "2020/4/25", "2020/4/26",
-			"2020/5/2", "2020/5/3", "2020/5/6", "2020/5/7", "2020/5/8",
-			"2020/5/9", "2020/5/10", "2020/5/13", "2020/5/14", "2020/5/15",
-			"2020/5/16", "2020/5/17", "2020/5/20", "2020/5/21", "2020/5/22",
-			"2020/5/23", "2020/5/24", "2020/5/27", "2020/5/28", "2020/5/29",
-			"2020/5/30", "2020/5/31", "2020/6/3", "2020/6/4", "2020/6/5",
-			"2020/6/6", "2020/6/7", "2020/6/13"
-		],
-		"series": [{
-			"name": "上证指数",
-			"data": [
-				[2320.26, 2302.6, 2287.3, 2362.94],
-				[2300, 2291.3, 2288.26, 2308.38],
-				[2295.35, 2346.5, 2295.35, 2346.92],
-				[2347.22, 2358.98, 2337.35, 2363.8],
-				[2360.75, 2382.48, 2347.89, 2383.76],
-				[2383.43, 2385.42, 2371.23, 2391.82],
-				[2377.41, 2419.02, 2369.57, 2421.15],
-				[2425.92, 2428.15, 2417.58, 2440.38],
-				[2411, 2433.13, 2403.3, 2437.42],
-				[2432.68, 2434.48, 2427.7, 2441.73],
-				[2430.69, 2418.53, 2394.22, 2433.89],
-				[2416.62, 2432.4, 2414.4, 2443.03],
-				[2441.91, 2421.56, 2415.43, 2444.8],
-				[2420.26, 2382.91, 2373.53, 2427.07],
-				[2383.49, 2397.18, 2370.61, 2397.94],
-				[2378.82, 2325.95, 2309.17, 2378.82],
-				[2322.94, 2314.16, 2308.76, 2330.88],
-				[2320.62, 2325.82, 2315.01, 2338.78],
-				[2313.74, 2293.34, 2289.89, 2340.71],
-				[2297.77, 2313.22, 2292.03, 2324.63],
-				[2322.32, 2365.59, 2308.92, 2366.16],
-				[2364.54, 2359.51, 2330.86, 2369.65],
-				[2332.08, 2273.4, 2259.25, 2333.54],
-				[2274.81, 2326.31, 2270.1, 2328.14],
-				[2333.61, 2347.18, 2321.6, 2351.44],
-				[2340.44, 2324.29, 2304.27, 2352.02],
-				[2326.42, 2318.61, 2314.59, 2333.67],
-				[2314.68, 2310.59, 2296.58, 2320.96],
-				[2309.16, 2286.6, 2264.83, 2333.29],
-				[2282.17, 2263.97, 2253.25, 2286.33],
-				[2255.77, 2270.28, 2253.31, 2276.22],
-				[2269.31, 2278.4, 2250, 2312.08],
-				[2267.29, 2240.02, 2239.21, 2276.05],
-				[2244.26, 2257.43, 2232.02, 2261.31],
-				[2257.74, 2317.37, 2257.42, 2317.86],
-				[2318.21, 2324.24, 2311.6, 2330.81],
-				[2321.4, 2328.28, 2314.97, 2332],
-				[2334.74, 2326.72, 2319.91, 2344.89],
-				[2318.58, 2297.67, 2281.12, 2319.99],
-				[2299.38, 2301.26, 2289, 2323.48],
-				[2273.55, 2236.3, 2232.91, 2273.55],
-				[2238.49, 2236.62, 2228.81, 2246.87],
-				[2229.46, 2234.4, 2227.31, 2243.95],
-				[2234.9, 2227.74, 2220.44, 2253.42],
-				[2232.69, 2225.29, 2217.25, 2241.34],
-				[2196.24, 2211.59, 2180.67, 2212.59],
-				[2215.47, 2225.77, 2215.47, 2234.73],
-				[2224.93, 2226.13, 2212.56, 2233.04],
-				[2236.98, 2219.55, 2217.26, 2242.48],
-				[2218.09, 2206.78, 2204.44, 2226.26],
-				[2199.91, 2181.94, 2177.39, 2204.99],
-				[2169.63, 2194.85, 2165.78, 2196.43],
-				[2195.03, 2193.8, 2178.47, 2197.51],
-				[2181.82, 2197.6, 2175.44, 2206.03],
-				[2201.12, 2244.64, 2200.58, 2250.11],
-				[2236.4, 2242.17, 2232.26, 2245.12],
-				[2242.62, 2184.54, 2182.81, 2242.62],
-				[2187.35, 2218.32, 2184.11, 2226.12],
-				[2213.19, 2199.31, 2191.85, 2224.63],
-				[2203.89, 2177.91, 2173.86, 2210.58],
-				[2170.78, 2174.12, 2161.14, 2179.65],
-				[2179.05, 2205.5, 2179.05, 2222.81],
-				[2212.5, 2231.17, 2212.5, 2236.07],
-				[2227.86, 2235.57, 2219.44, 2240.26],
-				[2242.39, 2246.3, 2235.42, 2255.21],
-				[2246.96, 2232.97, 2221.38, 2247.86],
-				[2228.82, 2246.83, 2225.81, 2247.67],
-				[2247.68, 2241.92, 2231.36, 2250.85],
-				[2238.9, 2217.01, 2205.87, 2239.93],
-				[2217.09, 2224.8, 2213.58, 2225.19],
-				[2221.34, 2251.81, 2210.77, 2252.87],
-				[2249.81, 2282.87, 2248.41, 2288.09],
-				[2286.33, 2299.99, 2281.9, 2309.39],
-				[2297.11, 2305.11, 2290.12, 2305.3],
-				[2303.75, 2302.4, 2292.43, 2314.18],
-				[2293.81, 2275.67, 2274.1, 2304.95],
-				[2281.45, 2288.53, 2270.25, 2292.59],
-				[2286.66, 2293.08, 2283.94, 2301.7],
-				[2293.4, 2321.32, 2281.47, 2322.1],
-				[2323.54, 2324.02, 2321.17, 2334.33],
-				[2316.25, 2317.75, 2310.49, 2325.72],
-				[2320.74, 2300.59, 2299.37, 2325.53],
-				[2300.21, 2299.25, 2294.11, 2313.43],
-				[2297.1, 2272.42, 2264.76, 2297.1],
-				[2270.71, 2270.93, 2260.87, 2276.86],
-				[2264.43, 2242.11, 2240.07, 2266.69],
-				[2242.26, 2210.9, 2205.07, 2250.63],
-				[2190.1, 2148.35, 2126.22, 2190.1]
-			]
-		}]
-	},
-	"CandleColumn": {
-		"categories": [
-			"2020/1/24", "2020/1/25", "2020/1/28", "2020/1/29", "2020/1/30",
-			"2020/1/31", "2020/2/1", "2020/2/4", "2020/2/5", "2020/2/6",
-			"2020/2/7", "2020/2/8", "2020/2/18", "2020/2/19", "2020/2/20",
-			"2020/2/21", "2020/2/22", "2020/2/25", "2020/2/26", "2020/2/27",
-			"2020/2/28", "2020/3/1", "2020/3/4", "2020/3/5", "2020/3/6",
-			"2020/3/7", "2020/3/8", "2020/3/11", "2020/3/12", "2020/3/13",
-			"2020/3/14", "2020/3/15", "2020/3/18", "2020/3/19", "2020/3/20",
-			"2020/3/21", "2020/3/22", "2020/3/25", "2020/3/26", "2020/3/27",
-			"2020/3/28", "2020/3/29", "2020/4/1", "2020/4/2", "2020/4/3",
-			"2020/4/8", "2020/4/9", "2020/4/10", "2020/4/11", "2020/4/12",
-			"2020/4/15", "2020/4/16", "2020/4/17", "2020/4/18", "2020/4/19",
-			"2020/4/22", "2020/4/23", "2020/4/24", "2020/4/25", "2020/4/26",
-			"2020/5/2", "2020/5/3", "2020/5/6", "2020/5/7", "2020/5/8",
-			"2020/5/9", "2020/5/10", "2020/5/13", "2020/5/14", "2020/5/15",
-			"2020/5/16", "2020/5/17", "2020/5/20", "2020/5/21", "2020/5/22",
-			"2020/5/23", "2020/5/24", "2020/5/27", "2020/5/28", "2020/5/29",
-			"2020/5/30", "2020/5/31", "2020/6/3", "2020/6/4", "2020/6/5",
-			"2020/6/6", "2020/6/7", "2020/6/13"
-		],
-		"series": [{
-			"name": "成交量1",
-			"data": [15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45, 37, 43, 15, 20, 45]
-		}]
-	}
-}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 41
js_sdk/u-charts/u-charts/mapdata.json


+ 0 - 6
js_sdk/u-charts/u-charts/readme.md

@@ -1,6 +0,0 @@
-# uCharts JSSDK说明
-1、如不使用uCharts组件,可直接引用u-charts.js,打包编译后会`自动压缩`,压缩后体积约为`90kb`。
-2、如果90kb的体积仍需压缩,请手动删除u-charts.js内您不需要的图表类型,如k线图candle。
-3、config.js为uCharts组件的用户配置文件,升级前请`自行备份config.js`文件,以免被强制覆盖。
-4、demodata.json为标准数据格式,仅供演示使用。
-5、mapdata.json为地图数据格式,遵循geoJson地图数据交换格式参考:http://datav.aliyun.com/tools/atlas/

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 5687
js_sdk/u-charts/u-charts/u-charts.js


+ 0 - 443
js_sdk/u-charts/u-charts/u-charts.vue

@@ -1,443 +0,0 @@
-<template>
-	<view class="chartsview" :style="{ background: background }">
-		<view v-show="mixinDatacomLoading"><view class="uni-icons-spinner-cycle">Loading...</view></view>
-		<view v-show="mixinDatacomErrorMessage">
-			<view class="uni-icons-info-filled">{{ mixinDatacomErrorMessage }}</view>
-		</view>
-		<canvas
-			:id="canvasId"
-			:canvas-id="canvasId"
-			:style="{ width: cWidth + 'px', height: cHeight + 'px' }"
-			:type="canvas2d?'2d':''"
-			@tap="tap"
-			@cilck="tap"
-			@touch="tap"
-			@touchstart="touchStart"
-			@touchmove="touchMove"
-			@touchend="touchEnd"
-			@mousemove="mouseMove"
-			@mousedown="mousedown"
-			@mouseup="mouseup"
-			@error="error"
-			v-show="showchart"
-		/>
-	</view>
-</template>
-
-<script>
-import qiunCharts from '../../js_sdk/u-charts/u-charts.js';
-import config from '../../js_sdk/u-charts/config.js';
-var canvases = {};
-var options = {};
-var chartdom = null;
-export default {
-	mixins: [uniCloud.mixinDatacom],
-	props: {
-		type: {
-			type: String,
-			default: null
-		},
-		canvasId: {
-			type: String,
-			default: "uchartsid"
-		},
-		canvas2d: {
-			type: Boolean,
-			default: false
-		},
-		pixelRatio: {
-			type: Number,
-			default: 1
-		},
-		background: {
-			type: String,
-			default: 'none'
-		},
-		animation:{
-			type: Boolean,
-			default: true
-		},
-		chartData: {
-			type: Object,
-			default() {
-				return {
-					categories: [],
-					series: []
-				};
-			}
-		},
-		opts: {
-			type: Object,
-			default: () => ({})
-		},
-		inScrollView:{
-			type: Boolean,
-			default: false
-		},
-		show:{
-			type: Boolean,
-			default: false
-		}
-	},
-	data() {
-		return {
-			cWidth: 375,
-			cHeight: 250,
-			showchart: false,
-			defaultOpts: {}
-		};
-	},
-	mounted() {
-		if(this.canvasId=='uchartsid'){
-			console.warn("注意:请在uCharts组件传入canvasId,以免单页多图产生图表错乱!")
-		}
-		if (this.type && config.type.includes(this.type)) {
-			this.defaultOpts = Object.assign({},config[this.type])
-			this.load()
-		} else {
-			this.mixinDatacomLoading = false
-			this.showchart = false
-			this.mixinDatacomErrorMessage = '参数错误:props参数中type类型不正确'
-		}
-		uni.onWindowResize(res => {
-			this.init()
-		})
-	},
-	watch: {
-		chartData(val, oldval) {
-			if (!this.type || !config.type.includes(this.type)) {
-				this.mixinDatacomLoading = false
-				this.showchart = false
-				this.mixinDatacomErrorMessage = '参数错误:props参数中type不正确'
-				return
-			}
-			if (typeof val === 'object') {
-				if (this.collection != '') {
-					if (config.categories.includes(this.type) && val.categories.length == 0 ) {
-						this.mixinDatacomLoading = false
-						this.showchart = false
-						this.mixinDatacomErrorMessage = '数据错误:chartData中缺少categories'
-					} else {
-						this.mixinDatacomLoading = false
-						this.mixinDatacomErrorMessage = null
-						this.$nextTick(function() {
-							this.init()
-						})
-					}
-				} else {
-					this.mixinDatacomLoading = false
-					this.mixinDatacomErrorMessage = null
-					this.$nextTick(function() {
-						this.init()
-					});
-				}
-			} else {
-				this.mixinDatacomLoading = false
-				this.showchart = false
-				this.mixinDatacomErrorMessage = '参数错误:chartData数据类型错误'
-			}
-		},
-		show(val, oldval) {
-			if (val) {
-				if (this.collection != '') {
-					if (config.categories.includes(this.type) && this.chartData.categories.length == 0 ) {
-						this.mixinDatacomLoading = false
-						this.showchart = false
-						this.mixinDatacomErrorMessage = '数据错误:chartData中缺少categories'
-					} else {
-						this.mixinDatacomLoading = false
-						this.mixinDatacomErrorMessage = null
-						this.$nextTick(function() {
-							this.init()
-						})
-					}
-				} else {
-					this.mixinDatacomLoading = false
-					this.mixinDatacomErrorMessage = null
-					this.$nextTick(function() {
-						this.init()
-					});
-				}
-			}
-		}
-	},
-	methods: {
-		load() {
-			if (this.mixinDatacomLoading == true) {
-				return
-			}
-			this.mixinDatacomLoading = true
-			if (this.collection != '') {
-				this.mixinDatacomGet()
-					.then(res => {
-						this.mixinDatacomLoading = false
-						const { data, count } = res.result
-						this.mixinDatacomResData = data
-						if (config.categories.includes(this.type) && this.chartData.categories.length == 0) {
-							this.mixinDatacomLoading = false
-							this.showchart = false
-							this.mixinDatacomErrorMessage = '数据错误:chartData中缺少categories'
-						} else {
-							this.init()
-						}
-					})
-					.catch(err => {
-						if (this.collection == '') {
-							if (this.chartData.series.length > 0) {
-								this.mixinDatacomLoading = false
-								this.init()
-							}
-						} else {
-							this.mixinDatacomLoading = false
-							this.showchart = false
-							this.mixinDatacomErrorMessage = '请求错误:' + err
-						}
-					});
-			}else{
-				if (this.chartData.series.length > 0) {
-					this.mixinDatacomLoading = false
-					this.init()
-				}
-			}
-		},
-		onMixinDatacomPropsChange(needReset, changed) {
-			if (needReset) {
-				if(options[this.canvasId] !== undefined){
-					options[this.canvasId].context.clearRect(0, 0, options[this.canvasId].width, options[this.canvasId].height)
-					options[this.canvasId].context.draw()
-				}
-				this.showchart = false;
-				this.load()
-			}
-		},
-		cloudDataInit() {
-			let temp = {}
-			let series=[]
-			let resdata = this.mixinDatacomResData
-			let categories = options[this.canvasId].categories
-			resdata.map(function (item, index) {
-				if(item.type!=undefined && !temp[item.type]){
-					series.push({name:item.type,data:[]})
-					temp[item.type] = true;
-				}
-			})
-			if(series.length==0){
-				let seriesname="默认分组"
-				if(this.chartData.series.length>0){
-					seriesname=this.chartData.series[0].name
-				}
-				series=[{name:seriesname,data:[]}]
-				for (let j = 0; j < categories.length; j++) {
-					let seriesdata = 0;
-					for (let i = 0; i < resdata.length; i++) {
-						if(resdata[i].label == categories[j]){
-							seriesdata = resdata[i].value
-						}
-					}
-					series[0].data.push(seriesdata)
-				}
-			}else{
-				for (let k = 0; k < series.length; k++) {
-					if(categories.length>0){
-						for (let j = 0; j < categories.length; j++) {
-							let seriesdata = 0;
-							for (let i = 0; i < resdata.length; i++) {
-								if(series[k].name == resdata[i].type && resdata[i].label == categories[j]){
-									seriesdata = resdata[i].value
-								}
-							}
-							series[k].data.push(seriesdata)
-						}
-					}else{
-						for (let i = 0; i < resdata.length; i++) {
-							if(series[k].name == resdata[i].type){
-								series[k].data.push(resdata[i].type)
-							}
-						}
-					}
-				}
-			}
-			return series;
-		},
-		init() {
-			chartdom = uni.createSelectorQuery().in(this).select('.chartsview');
-			chartdom.boundingClientRect(data => {
-				if(data.width>0 && data.height>0){
-					this.cWidth = data.width
-					this.cHeight = data.height
-					options[this.canvasId] = Object.assign(this.defaultOpts, this.opts)
-					options[this.canvasId].canvasId = this.canvasId
-					options[this.canvasId].categories = this.chartData.categories
-					if (this.collection == '') {
-						options[this.canvasId].series = this.chartData.series
-					}else{
-						options[this.canvasId].series = this.cloudDataInit()
-					}
-					options[this.canvasId].background = this.background == 'none' ? '#FFFFFF' : this.background
-					options[this.canvasId].pixelRatio = this.pixelRatio
-					options[this.canvasId].animation = this.animation
-					options[this.canvasId].width = data.width * this.pixelRatio
-					options[this.canvasId].height = data.height * this.pixelRatio
-					if(this.canvas2d){
-						options[this.canvasId].canvas2d = this.canvas2d
-						const query = uni.createSelectorQuery().in(this)
-						query.select('#'+this.canvasId)
-							.fields({ node: true, size: true })
-							.exec((res) => {
-								const canvas = res[0].node
-								const ctx = canvas.getContext('2d')
-								options[this.canvasId].context = ctx
-								canvas.width = data.width * this.pixelRatio
-								canvas.height = data.height * this.pixelRatio
-								canvas._width = data.width * this.pixelRatio
-								canvas._height = data.height * this.pixelRatio
-								if(!this.mixinDatacomLoading){
-									this.showchart = true
-								}
-								this.newChart()
-							})
-					}else{
-						options[this.canvasId].context = uni.createCanvasContext(this.canvasId,this)
-						if(!this.mixinDatacomLoading){
-							this.showchart = true
-						}
-						this.newChart()
-					}
-				}else{
-					this.mixinDatacomLoading = false
-					this.showchart = false
-					this.mixinDatacomErrorMessage = '布局错误:请尝试props绑定show状态'
-				}
-			}).exec();
-		},
-		newChart() {
-			canvases[this.canvasId] = new qiunCharts(options[this.canvasId])
-			canvases[this.canvasId].addEventListener('renderComplete', () => {
-				this.$emit("complete",{complete:true,charts:canvases[this.canvasId]})
-			});
-			canvases[this.canvasId].addEventListener('scrollLeft', () => {
-				this.$emit("scrollLeft",{scrollLeft:true,charts:canvases[this.canvasId]})
-			});
-			canvases[this.canvasId].addEventListener('scrollRight', () => {
-				this.$emit("scrollRight",{scrollRight:true,charts:canvases[this.canvasId]})
-			});
-		},
-		tap(e) {
-			let currentIndex=null
-			let legendIndex=null
-			if(this.inScrollView){
-				e.type = 'click'
-			}
-			if (e.type == 'click') {
-				chartdom = uni.createSelectorQuery().in(this).select('.chartsview')
-				chartdom.boundingClientRect(data => {
-					e.changedTouches.unshift({ x: e.detail.x - data.left, y: e.detail.y - data.top })
-					e.mp.changedTouches.unshift({ x: e.detail.x - data.left, y: e.detail.y - data.top })
-					canvases[this.canvasId].touchLegend(e)
-					canvases[this.canvasId].showToolTip(e, {
-						format: function(item, category) {
-							if(category){
-								return category + ' ' + item.name + ':' + item.data
-							}else{
-								return item.name + ':' + item.data
-							}
-						}
-					})
-					currentIndex=canvases[this.canvasId].getCurrentDataIndex(e)
-					legendIndex=canvases[this.canvasId].getLegendDataIndex(e) 
-					this.$emit("getIndex",{event:e,currentIndex:currentIndex,legendIndex:legendIndex,charts:canvases[this.canvasId]})
-				}).exec();
-			} else {
-				e.changedTouches.unshift({ x: e.detail.x - e.currentTarget.offsetLeft, y: e.detail.y - e.currentTarget.offsetTop })
-				e.mp.changedTouches.unshift({ x: e.detail.x - e.currentTarget.offsetLeft, y: e.detail.y - e.currentTarget.offsetTop })
-				canvases[this.canvasId].touchLegend(e)
-				canvases[this.canvasId].showToolTip(e, {
-					format: function(item, category) {
-						if(category){
-							return category + ' ' + item.name + ':' + item.data
-						}else{
-							return item.name + ':' + item.data
-						}
-					}
-				});
-				currentIndex=canvases[this.canvasId].getCurrentDataIndex(e)
-				legendIndex=canvases[this.canvasId].getLegendDataIndex(e) 
-				this.$emit("getIndex",{event:e,currentIndex:currentIndex,legendIndex:legendIndex,charts:canvases[this.canvasId]})
-			}
-		},
-		touchStart(e) {
-			canvases[this.canvasId].scrollStart(e)
-			this.$emit("touchStart",{event:e,charts:canvases[this.canvasId]})
-		},
-		touchMove(e) {
-			canvases[this.canvasId].scroll(e)
-			this.$emit("touchMove",{event:e,charts:canvases[this.canvasId]})
-		},
-		touchEnd(e) {
-			canvases[this.canvasId].scrollEnd(e)
-			this.$emit("touchEnd",{event:e,charts:canvases[this.canvasId]})
-		},
-		mousedown(e){
-			if(options[this.canvasId].enableScroll){
-				chartdom = uni.createSelectorQuery().in(this).select('.chartsview')
-				chartdom.boundingClientRect(data => {
-					e.changedTouches.unshift({ x: e.pageX - data.left, y: e.clientY-data.top })
-					e.mp.changedTouches.unshift({ x: e.pageX - data.left, y: e.clientY-data.top })
-					canvases[this.canvasId].scrollStart(e)
-					options[this.canvasId].mousedown=true;
-					this.$emit("touchStart",{event:e,charts:canvases[this.canvasId]})
-				}).exec();
-			}
-		},
-		mouseMove(e) {
-			if (options[this.canvasId].series.length > 0) {
-				chartdom = uni.createSelectorQuery().in(this).select('.chartsview')
-				chartdom.boundingClientRect(data => {
-					e.changedTouches.unshift({ x: e.pageX - data.left, y: e.clientY-data.top })
-					e.mp.changedTouches.unshift({ x: e.pageX - data.left, y: e.clientY-data.top })
-					if(options[this.canvasId].enableScroll && options[this.canvasId].mousedown){
-						canvases[this.canvasId].scroll(e)
-						this.$emit("touchMove",{event:e,charts:canvases[this.canvasId]})
-					}else{
-						canvases[this.canvasId].showToolTip(e, {
-							format: function(item, category) {
-								if(category){
-									return category + ' ' + item.name + ':' + item.data
-								}else{
-									return item.name + ':' + item.data
-								}
-							}
-						});
-					}
-				}).exec()
-			}
-		},
-		mouseup(e){
-			if(options[this.canvasId].enableScroll){
-				chartdom = uni.createSelectorQuery().in(this).select('.chartsview')
-				chartdom.boundingClientRect(data => {
-					e.changedTouches.unshift({ x: e.pageX - data.left, y: e.clientY-data.top })
-					e.mp.changedTouches.unshift({ x: e.pageX - data.left, y: e.clientY-data.top })
-					canvases[this.canvasId].scrollEnd(e)
-					options[this.canvasId].mousedown=false;
-					this.$emit("touchEnd",{event:e,charts:canvases[this.canvasId]})
-				}).exec();
-			}
-		},
-		error(e) {
-			console.log(e)
-		}
-	}
-};
-</script>
-
-<style scoped>
-.chartsview {
-	width: 100%;
-	height: 100%;
-	display: flex;
-	flex: 1;
-	justify-content: center;
-	align-items: center;
-}
-</style>

+ 14 - 0
mainfest.js

@@ -0,0 +1,14 @@
+"h5": {
+        "devServer": {
+            "port": 80,
+            "disableHostCheck": true,
+            "proxy": {
+                "/dpc": {
+                    "target": "https://apis.map.qq.com",
+                    "changeOrigin": true,
+                    "secure": false,
+                    "pathRewrite":{"^/dpc":""}
+                }
+            }
+        }
+    }

+ 18 - 2
manifest.json

@@ -88,7 +88,23 @@
     },
     "h5" : {
         "sdkConfigs" : {
-            "maps" : {}
-        }
+            "maps" : {
+                "qqmap" : {
+                    "key" : "B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ"
+                }
+            }
+        },
+		"devServer": {
+		    "port": 80,
+		    "disableHostCheck": true,
+		    "proxy": {
+		        "/dpc": {
+		            "target": "https://apis.map.qq.com/ws",
+		            "changeOrigin": true,
+		            "secure": false,
+		            "pathRewrite":{"^/dpc":"/"}
+		        }
+		    }
+		}
     }
 }

+ 11 - 2
pages.json

@@ -44,7 +44,6 @@
                 "navigationBarTitleText": "个人信息",
                 "enablePullDownRefresh": false
             }
-            
         }
         ,{
             "path" : "pages/my/feedback/feedback",
@@ -341,7 +340,7 @@
             
         }
         ,{
-            "path" : "pages/fourBase/fourbasemap",
+            "path" : "pages/fourBase/basefacility",
             "style" :                                                                                    
             {
                 "navigationBarTitleText": "",
@@ -559,6 +558,16 @@
             }
             
         }
+        ,{
+            "path" : "pages/fourBase/modification",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "四情基地编辑基地",
+                "enablePullDownRefresh": false,
+				"navigationStyle":"custom"
+            }
+            
+        }
     ],
 	"condition": { //模式配置,仅开发期间生效
 	    "current": 3, //当前激活的模式(list 的索引项)

+ 37 - 22
pages/environment/equipment.vue

@@ -10,6 +10,7 @@
 				<p style="font-size: 32rpx;">设备 ID:{{eqinfo.item.equip_id}}</p>
 				<p>设备名称:{{eqinfo.item.equip_name?eqinfo.item.equip_name:"无"}}</p>
 				<p>最近上报时间:{{eqinfo.item.uptime|timeFormat()}}</p>
+				<p>地址:{{city}}</p>
 			</view>
 		</view>
 		<view class="control">
@@ -51,13 +52,14 @@
 			return {
 				eqinfo: {},
 				olddata: {},
-				olddatas: ["#fba825","#53d67c","#008cf2","#fb504d","#d87ffc","#4ec5f0"],
+				olddatas: ["#fba825", "#53d67c", "#008cf2", "#fb504d", "#d87ffc", "#4ec5f0"],
+				city: ""
 			}
 		},
 		methods: {
-			clickLeft(){
+			clickLeft() {
 				uni.navigateBack({
-					delta:1
+					delta: 1
 				})
 			},
 			async history() { //设备列表
@@ -68,27 +70,27 @@
 					}
 				})
 				this.olddata = res
-				for(var key in this.olddata.conf){
-					if(this.olddata.conf[key].indexOf("#")!=-1){
-						this.olddata.conf[key] = this.olddata.conf[key].replace("#","(")+")"
+				for (var key in this.olddata.conf) {
+					if (this.olddata.conf[key].indexOf("#") != -1) {
+						this.olddata.conf[key] = this.olddata.conf[key].replace("#", "(") + ")"
 					}
 					this.olddata.dat[key] = this.olddata.dat[key].split("#")
 				}
 				console.log(this.olddata)
 			},
-			control(){//设备控制
+			control() { //设备控制
 				uni.navigateTo({
-					url:"./contros?id="+this.eqinfo.item.d_id
+					url: "./contros?id=" + this.eqinfo.item.d_id
 				})
 			},
-			information(){//24小时数据
+			information() { //24小时数据
 				uni.navigateTo({
-					url:"./onedaythedata?id="+this.eqinfo.item.equip_id
+					url: "./onedaythedata?id=" + this.eqinfo.item.equip_id
 				})
 			},
-			charts(){//历史数据
+			charts() { //历史数据
 				uni.navigateTo({
-					url:"./history?device_id="+this.eqinfo.item.equip_id
+					url: "./history?device_id=" + this.eqinfo.item.equip_id
 				})
 			}
 		},
@@ -96,6 +98,13 @@
 			this.$forceUpdate()
 			this.eqinfo.item = JSON.parse(option.shebei)
 			console.log(this.eqinfo)
+			uni.request({
+				url: '/dpc/geocoder/v1?location='+this.eqinfo.item.lat+","+this.eqinfo.item.lng+'&key=B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ',
+				success: (res) => {
+					this.city = res.data.result.address
+					console.log(res.data.result.address)
+				}
+			})
 			this.history()
 		}
 	}
@@ -130,6 +139,7 @@
 			}
 		}
 	}
+
 	.control {
 		width: 90%;
 		position: absolute;
@@ -139,67 +149,72 @@
 		justify-content: space-between;
 		text-align: center;
 		padding: 0 30rpx;
-	
+		box-sizing: border-box;
+
 		.control_item {
 			width: 128rpx;
 			height: 120rpx;
-	
+
 			image {
 				width: 70rpx;
 				height: 70rpx;
 			}
-	
+
 			p {
 				font-size: 24rpx;
 			}
 		}
 	}
+
 	.realtime {
 		width: 100%;
 		position: absolute;
 		top: 500rpx;
-		.realtime_title{
+
+		.realtime_title {
 			font-weight: 700;
 			width: 90%;
 			margin: 0 auto;
 		}
+
 		.realtime_text {
 			width: 90%;
 			margin: 0 auto;
-	
+
 			.realtime_text_item {
 				width: 100%;
 				display: flex;
 				justify-content: space-between;
 				flex-wrap: wrap;
 				margin-bottom: 50rpx;
-	
+
 				.realtime_text_item_info {
 					width: 48%;
 					box-shadow: 0 0 10rpx #bcb9ca;
 					margin-top: 20rpx;
 					display: flex;
 					padding: 20rpx 20rpx;
-	
+					box-sizing: border-box;
+
 					.item_info_img {
 						width: 30%;
 						text-align: center;
 						margin-right: 30rpx;
 						border-radius: 50%;
+
 						image {
 							width: 64rpx;
 							height: 64rpx;
 							margin-top: 10rpx
 						}
 					}
-	
+
 					.item_info_text {
 						font-size: 24rpx;
-	
 					}
 				}
 			}
 		}
-	
+
 	}
 </style>

+ 1 - 0
pages/environment/search.vue

@@ -100,6 +100,7 @@
 		top: 18rpx;
 		right: 18rpx;
 		padding-top: 8rpx;
+		box-sizing: border-box;
 		input{
 			width: 85%;
 			text-indent: 1rem;

+ 145 - 40
pages/fourBase/addbase.vue

@@ -6,44 +6,45 @@
 		<view class="addimg">
 			<view class="addimg_add" @click="gainimg">
 				<u-icon name="plus" size="60rpx" color="#A5A6A8"></u-icon>
-				<image :src="userinfos" mode="" class="addimg_img"></image>
+				<image :src="baseinfo.base_img" mode="" class="addimg_img"></image>
 			</view>
 		</view>
 		<view class="base_text">
 			<p class="title">基地信息</p>
 			<view class="base_text_item1">
 				<u-icon name="fangzi" custom-prefix="custom-icon" class="icon"></u-icon>
-				<span>基地名称</span>
-				<input type="text" value="" placeholder="请输入基地名称" />
+				<span><span style="color: #ff0000;margin: 0;">*</span>基地名称</span>
+				<input type="text" v-model="baseinfo.base_name" placeholder="请输入基地名称" />
 			</view>
 			<view class="base_text_item1">
 				<u-icon name="ren1" custom-prefix="custom-icon" class="icon"></u-icon>
-				<span>负责人</span>
-				<input type="text" value="" placeholder="请输入基地负责人" />
+				<span><span style="color: #ff0000;margin: 0;">*</span>负责人</span>
+				<input type="text" v-model="baseinfo.base_charge " placeholder="请输入基地负责人" />
 			</view>
 			<view class="base_text_item1">
 				<u-icon name="lianxidianhua" custom-prefix="custom-icon" class="icon"></u-icon>
-				<span>联系电话</span>
-				<input type="text" value="" placeholder="请输入联系电话" />
+				<span><span style="color: #ff0000;margin: 0;">*</span>联系电话</span>
+				<input type="text" v-model="baseinfo.base_phone" placeholder="请输入联系电话" @blur="yanzheng"/>
 			</view>
 			<view class="base_text_item1">
 				<u-icon name="mianji" custom-prefix="custom-icon" class="icon"></u-icon>
-				<span>面积(亩)</span>
-				<input type="number" value="" placeholder="请输入基地面积" />
+				<span><span style="color: #ff0000;margin: 0;">*</span>面积(亩)</span>
+				<input type="number" v-model="baseinfo.base_area" placeholder="请输入基地面积" />
 			</view>
 			<view class="base_text_item2">
 				<u-icon name="miaoshu" custom-prefix="custom-icon" class="icon"></u-icon>
 				<span>基地描述</span>
-				<textarea value="" placeholder="" auto-height class="textarea" placeholder="请输入基地描述" />
+				<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>
+				<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>
+				<span><span style="color: #ff0000;margin: 0;">*</span>设备绑定</span>
 				<u-icon name="arrow-right" class="iconright"></u-icon>
 			</view>
 			<view class="base_id_box">
@@ -54,7 +55,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="btn">
+			<view class="btn" @click="tijiao">
 				确 定
 			</view>
 		</view>
@@ -68,10 +69,29 @@
 		data() {
 			return {
 				base_id:{},
-				userinfos:''
+				baseinfo:{
+					base_name:'',//必传(str)           基地名称
+					base_charge:'',//必传(str)           负责人
+					base_phone:'',//必传(str)           联系电话
+					base_img:'',// 必传(str)           基地图片
+					base_area:'',//必传(str)           基地面积
+					base_equip:'', //必传(str)           绑定设备 如果绑定多个设备传 289#299, 如果是单一设备传298
+					base_describe:'',//非必传(str)         基地描述
+					lng:'',//必传(str)           经度
+					lat:'',//必传(str)           纬度
+					ret:"add",//必传(str)           区分
+				},
+				city:''
 			}
 		},
 		methods: {
+			//base.bases.base_list新增基地
+			async addbase() { //获取分布位置
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=base.bases.base_list',
+					data: this.baseinfo
+				})
+			},
 			clickLeft(){
 				uni.navigateTo({
 					url:"./index"
@@ -96,32 +116,113 @@
 									'user': 'test'
 								},
 								success: (uploadFileRes) => {
-									this.userinfos = JSON.parse(uploadFileRes.data).data.src
-									console.log(this.userinfos)
-									this.$forceUpdate() //强制刷新视图
+									this.baseinfo.base_img = JSON.parse(uploadFileRes.data).data.src
+									// this.$forceUpdate() //强制刷新视图
 								}
 							});
 						}
 					})
 			},
 			map(){
-				// uni.chooseLocation({
-				//     success: function (res) {
-				//         console.log('位置名称:' + res.name);
-				//         console.log('详细地址:' + res.address);
-				//         console.log('纬度:' + res.latitude);
-				//         console.log('经度:' + res.longitude);
-				//     }
-				// });
-				uni.navigateTo({
-					url:"./fourbasemap"
-				})
+				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
+						    }
+						});
+					}
+				});
+			},
+			tijiao(){
+				if(this.baseinfo.base_img==''){
+					uni.showToast({
+					    title: '请选择基地图片', 
+					    duration: 2000,
+						icon:"none"
+					});
+				
+				}else if(this.baseinfo.base_name==''){
+					uni.showToast({
+					    title: '请填写正基地名称', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_charge==''){
+					uni.showToast({
+					    title: '请填写基地负责人', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_phone==''){
+					uni.showToast({
+					    title: '请填写手机号', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_area==''){
+					uni.showToast({
+					    title: '请填写基地面积', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.lng==''){
+					uni.showToast({
+					    title: '请选择基地地址', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_id==''){
+					uni.showToast({
+					    title: '请绑定基地设备', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else{
+					if(!/^1[23456789]\d{9}$/.test(this.baseinfo.base_phone)){
+						uni.showToast({
+						    title: '请填写正确的手机号', 
+						    duration: 2000,
+							icon:"none"
+						});
+					}else{
+						console.log(this.baseinfo)
+						this.addbase()
+						localStorage.removeItem("id")
+						uni.navigateBack({
+							delta:1
+						})
+					}
+				}
+			},
+			yanzheng(){
+				if(!/^1[23456789]\d{9}$/.test(this.baseinfo.base_phone)){
+					uni.showToast({
+					    title: '请填写正确的手机号', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}
 			}
 		},
-		onLoad(option) {
-			console.log(option=={})
-			if(JSON.stringify(option) != "{}"){
-				this.base_id=JSON.parse(option.id)
+		onLoad() {
+		},
+		onShow(){
+			// this.base_id=JSON.parse(localStorage.getItem("id"))
+			if(localStorage.getItem("id")!=null){
+				var arr = []
+				for(var key in this.base_id){
+					arr.push(this.base_id[key].join("#"))
+				}
+				this.baseinfo.base_equip = arr.join("#")
 			}
 		}
 	}
@@ -164,6 +265,9 @@
 		padding: 16rpx 20rpx;
 		background-color: #F7F8FA;
 		display: flex;
+		box-sizing: border-box;
+		position: relative;
+		height: 200rpx;
 		.icon{
 			color: #5FBBA0;
 			height: 42rpx;
@@ -173,9 +277,11 @@
 		}
 		.textarea{
 			font-size: 24rpx;
-			margin-left: 20rpx;
-			width: 426rpx;
 			text-align: right;
+			position: absolute;
+			right: 20rpx;
+			width: 70%;
+			height: 200rpx;
 		}
 		
 	}
@@ -187,6 +293,7 @@
 		margin: 10rpx auto 20rpx;
 		padding: 16rpx 20rpx;
 		background-color: #F7F8FA;
+		box-sizing: border-box;
 		.icon{
 			color: #5FBBA0;
 		}
@@ -216,18 +323,16 @@
 	}
 	.base_id{
 		width: 100%;
-		display: flex;
-		justify-content: space-between;
-		flex-wrap: wrap;
 		.base_id_item{
-			width: 48%;
+			width: 95%;
 			padding: 10rpx 30rpx;
 			display: flex;
 			justify-content: space-between;
 			font-size: 28rpx;
 			background-color: #F7F8FA;
-			color: #B8B8BA;
-			margin-bottom: 10rpx;
+			color: #616162;
+			box-sizing: border-box;
+			margin: 20rpx auto;
 		}
 	}
 	.btn{

+ 20 - 24
pages/fourBase/allocation.vue

@@ -9,19 +9,13 @@
 				 bar-width="60" active-color="#42b983"></u-tabs>
 			</view>
 		</view>
-		<!-- <view class="bases_search">
-			<view class="bases_search_text">
-				<u-icon name="search" class="search" @click="searchs"></u-icon>
-				<input type="text" v-model="search" placeholder="请输入基地名称" />
-			</view>
-		</view> -->
 		<view class="ass_list">
 			<checkbox-group class="che_group" @change="checkboxchange">
 				<label class="equipment" v-for="(items,indexs) in assignments.children" :key="items.id">
 					<view class="equipment_top">
 						<image :src="assignments.src" mode="" class="equipment_top_img"></image>
 						<span class="equipment_top_name">{{assignments.type_name}}</span>
-						<checkbox :value="String(items.id)" :checked="items.check" class="ucheckbox" color="#42b983" />
+						<checkbox :value="String(items.type_name)" :checked="items.check" class="ucheckbox" color="#42b983" />
 					</view>
 					<view class="equipment_bot">
 						<p class="equipment_bot_id">设备ID:{{items.id}}</p>
@@ -48,7 +42,6 @@
 				assignments: [],
 				list: [],
 				current: 0,
-				assignment_item: [],
 				assignment_items: [],
 				images: [{
 					path: "../../static/image/fourMoodBase/测报灯.png",
@@ -64,7 +57,8 @@
 					id: 7
 				}],
 				src: '',
-				obj: {}
+				obj: {},
+				addtype:[]
 			}
 		},
 		methods: {
@@ -84,6 +78,11 @@
 				this.assignments = this.assignment[this.current]
 				for (let i = 0; i < this.assignments.children.length; i++) {
 					this.assignments.children[i].check = false
+					for(let j = 0;j<this.addtype.length;j++){
+						if(this.assignments.children[i].type_name == this.addtype[j]){
+							this.assignments.children[i].check = true
+						}
+					}
 				}
 			},
 			forchange(obj) {
@@ -93,7 +92,7 @@
 				for (let key in obj) {
 					for (let i = 0; i < key.length; i++) {
 						for (let j = 0; j < this.assignments.children.length; j++) {
-							if (Number(obj[key][i]) == this.assignments.children[j].id) {
+							if (Number(obj[key][i]) == this.assignments.children[j].type_name) {
 								this.assignments.children[j].check = true
 
 							}
@@ -106,10 +105,11 @@
 				this.current = index
 				this.assignments = this.assignment[index]
 				this.forchange(this.obj)
+				console.log(this.obj)
 			},
 			checkboxchange(e, items) {
-				this.assignment_item = e.detail.value
-				this.obj[this.assignments.type_name] = this.assignment_item
+				console.log(e.detail.value)
+				this.obj[this.assignments.type_name] = e.detail.value
 				this.forchange(this.obj)
 			},
 			clickLeft() {
@@ -121,23 +121,19 @@
 				this.clickLeft()
 			},
 			canfirm() {
-				var pages = getCurrentPages();
-				var prevPage = pages[pages.length - 2]; //上一个页面
-				if (prevPage.__page__.fullPath.indexOf("?")!=-1) {
-					prevPage.__page__.fullPath = prevPage.__page__.fullPath.slice(0, prevPage.__page__.fullPath.indexOf("?"))
-				} else {
-					prevPage.__page__.fullPath = prevPage.__page__.fullPath
-				}
-				console.log(prevPage)
-				uni.navigateTo({
-					url: prevPage.__page__.fullPath + "?id="+JSON.stringify(this.obj)
+				localStorage.setItem("id",JSON.stringify(this.obj))
+				uni.navigateBack({
+					delta:1
 				})
 			},
 		},
 		onLoad(option) {
+			if(option.type!=''){
+				this.addtype = option.type.split("#")
+				console.log(this.addtype)
+			}
 			this.getFourbase()
-			// this.forchange(this.obj)
-		}
+		},
 	}
 </script>
 

+ 149 - 0
pages/fourBase/basefacility.vue

@@ -0,0 +1,149 @@
+<template>
+	<view>
+		<view style="position: fixed;z-index: 100;">
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="基地设备"></uni-nav-bar>
+		</view>
+		<view class="ass_list">
+			<view class="equipment" v-for="(items,indexs) in assignments" :key="items.id" v-if="tishiTF">
+				<view class="equipment_top">
+					<image :src="items.src" mode="" class="equipment_top_img"></image>
+					<span class="equipment_top_name">{{items.type_name}}</span>
+				</view>
+				<view class="equipment_bot">
+					<p class="equipment_bot_id">设备ID:{{items.d_id}}</p>
+					<p class="equipment_bot_name">设备名称:{{items.device_id}}</p>
+					<view class="equipment_state">在线</view>
+				</view>
+			</view>
+			<view class="tishi" v-if="!tishiTF">
+				暂无数据
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				base_id:"",
+				assignments:[],
+				images: [{
+					path: "../../static/image/fourMoodBase/测报灯.png",
+					id: 3
+				}, {
+					path: "../../static/image/fourMoodBase/环境监测.png",
+					id: 5
+				}, {
+					path: "../../static/image/fourMoodBase/监控.png",
+					id: 6
+				}, {
+					path: "../../static/image/fourMoodBase/孢子仪.png",
+					id: 7
+				}],
+				tishiTF:false
+			}
+		},
+		methods: {
+			async ybase(id) { //获取分布位置
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=base.bases.base_map_list',
+					data:{
+						base_id:id
+					}
+				})
+				this.assignments = res
+				console.log(this.assignments)
+				for(var i=0;i<this.images.length;i++){
+					for(var j=0;j<this.assignments.length;j++){
+						if(this.assignments[j].equip_type == this.images[i].id){
+							this.assignments[j].src = this.images[i].path
+						}
+					}
+				}
+				if(this.assignments.length == 0){
+					this.tishiTF = false
+				}else{
+					this.tishiTF = true
+				}
+			},
+			clickLeft(){
+				uni.navigateBack({
+					delta:1
+				})
+			}
+		},
+		onLoad(option) {
+			this.base_id = option.id
+			this.ybase(option.id)
+		},
+
+	}
+</script>
+
+<style lang="scss">
+	.ass_list {
+		position: absolute;
+		top: 54px;
+		width: 100%;
+		margin-bottom: 40px;
+		.tishi{
+			width: 100%;
+			text-align: center;
+			height: 100rpx;
+			line-height: 100rpx;
+			font-size: 36rpx;
+		}
+		.equipment {
+			width: 90%;
+			margin: 20rpx auto;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 20rpx 30rpx;
+			box-sizing: border-box;
+			.equipment_top {
+				height: 60rpx;
+				width: 100%;
+				border-bottom: 1px solid #dfe5ec;
+				position: relative;
+
+				.equipment_top_img {
+					width: 40rpx;
+					height: 40rpx;
+					position: absolute;
+				}
+
+				.equipment_top_name {
+					font-size: 24rpx;
+					margin-left: 60rpx;
+				}
+			}
+
+			.equipment_bot {
+				padding: 30rpx 0;
+				position: relative;
+
+				.equipment_bot_id {
+					font-weight: 700;
+					font-size: 15px;
+					margin-bottom: 16rpx;
+				}
+
+				.equipment_bot_name {
+					font-size: 10px;
+				}
+
+				.equipment_state {
+					position: absolute;
+					top: 20rpx;
+					right: 0;
+					width: 100rpx;
+					height: 100rpx;
+					text-align: center;
+					line-height: 100rpx;
+					color: #42b983;
+
+				}
+			}
+		}
+	}
+</style>

+ 0 - 40
pages/fourBase/fourbasemap.vue

@@ -1,40 +0,0 @@
-<template>
-	<view>
-		<view class="maps">
-			<map class="map_item" :latitude="latitude" :longitude="longitude" scale="14" :markers="markers" :show-location="true"
-			 @markertap="markertap">
-			</map>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				title: 'map',
-				latitude: 39.909,
-				longitude: 116.39742,
-				markers: []
-			}
-		},
-		methods: {
-			
-		},
-		onLoad() {
-			
-		},
-
-	}
-</script>
-
-<style lang="scss">
-	.maps {
-		width: 100%;
-		.map_item {
-			width: 90%;
-			margin: 0 auto;
-			height: 1000rpx;
-		}
-	}
-</style>

+ 57 - 8
pages/fourBase/index.vue

@@ -11,9 +11,12 @@
 			</view>
 		</view>
 		<view class="bases">
-			<view class="bases_list" v-for="(items,index) in baselist" :key="index" @click="details">
+			<view class="bases_list" v-for="(items,index) in baselist" :key="index" @click="details(items.id)">
 				<view class="bases_list_bgi" >
 					<image :src="items.base_img" mode=""></image>
+					<view class="bgcolor">
+						
+					</view>
 				</view>
 				<view class="bases_list_text">
 					<p><span style="margin-right: 30rpx;">{{items.base_name}}</span><span>{{items.base_area}}㎡</span></p>
@@ -21,7 +24,7 @@
 					<p style="font-size: 24rpx;">联系电话:{{items.base_phone}}</p>
 					<p style="font-size: 24rpx;">地址:{{items.base_name}}</p>
 				</view>
-				<u-icon name="more-dot-fill" class="bases_list_xiangqing" @click.native.stop="XQclick"></u-icon>
+				<u-icon name="more-dot-fill" class="bases_list_xiangqing" @click.native.stop="XQclick(items)"></u-icon>
 				<view class="photoshow">
 					<image src="../../static/image/fourMoodBase/测报灯.png" mode=""></image>
 					<image src="../../static/image/fourMoodBase/杀虫灯.png" mode=""></image>
@@ -55,7 +58,9 @@
 				},{
 					text:"删除基地"
 				}],
-				post_show:false
+				post_show:false,
+				delid:"",
+				facilitynum:""
 			}
 		},
 		methods: {
@@ -67,6 +72,15 @@
 				this.baselist = this.baselist.concat(res.data)
 				console.log(this.baselist)
 			},
+			async delbase() { //基地列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=base.bases.base_list',
+					data:{
+						ret:"del",
+						base_id:this.delid.id
+					}
+				})
+			},
 			clickLeft(){//返回主页
 				uni.switchTab({
 					url:"../index/index"
@@ -79,22 +93,47 @@
 			},
 			searchinput() {//搜索
 				this.data.page=1
+				this.baselist = []
 				Debounce(() => {
 					this.getFourbase()
 				}, 1000)()
 			},
 			search(){//搜索按钮
 				this.data.page=1
+				this.baselist = []
 				this.getFourbase()
+				this.$forceUpdate()
 			},
-			details(){//详情页
-				console.log(1)
+			details(id){//详情页
+				uni.navigateTo({
+					url:"./basefacility?id="+id
+				})
 			},
-			XQclick(){//编辑
+			XQclick(item){//编辑
 				this.post_show=!this.post_show
+				this.delid = item
 			},
 			message(index){//编辑或者删除
 				console.log(index)
+				if(index==1){
+					console.log(this.delid.id)
+					uni.showModal({
+					    title: '提示',
+					    content: '确定要删除该基地吗?',
+					    success:(res)=>{
+					        if (res.confirm) {
+					           this.delbase()
+					        } else if (res.cancel) {
+					            console.log('用户点击取消');
+					        }
+					    }
+					});
+				}else{
+					uni.navigateTo({
+						url:"./modification?id="+JSON.stringify(this.delid)
+					})
+				}
+				this.$forceUpdate()
 			}
 		},
 		onLoad() {
@@ -104,6 +143,9 @@
 			this.data.page++
 			this.getFourbase()
 		},
+		onShow(){
+			this.$forceUpdate()
+		}
 	}
 </script>
 <style lang="scss">
@@ -149,6 +191,12 @@
 			position: relative;
 
 			.bases_list_bgi {
+				.bgcolor{
+					width: 100%;
+					height: 276rpx;
+					background-color: rgba(0,0,0,0.3);
+					border-radius: 25rpx;
+				}
 				image {
 					position: absolute;
 					top: 0;
@@ -156,6 +204,7 @@
 					width: 100%;
 					height: 276rpx;
 					border-radius: 25rpx;
+					z-index: -1;
 				}
 			}
 
@@ -180,7 +229,7 @@
 			}
 			.photoshow{
 				width: 160rpx;
-				height: 42rpx;
+				height: 34rpx;
 				display: flex;
 				position: absolute;
 				bottom: 26rpx;
@@ -195,7 +244,7 @@
 				}
 				.photoshow_num{
 					width: 50rpx;
-					height: 34rpx;
+					height: 30rpx;
 					border: 1px solid #FFFFFF;
 					border-radius: 17rpx;
 					text-align: center;

+ 363 - 0
pages/fourBase/modification.vue

@@ -0,0 +1,363 @@
+<template>
+	<view>
+		<view style="position: fixed;z-index: 100;">
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="基地修改"></uni-nav-bar>
+		</view>
+		<view class="addimg">
+			<view class="addimg_add" @click="gainimg">
+				<u-icon name="plus" size="60rpx" color="#A5A6A8"></u-icon>
+				<image :src="baseinfo.base_img" mode="" class="addimg_img"></image>
+			</view>
+		</view>
+		<view class="base_text">
+			<p class="title">基地信息</p>
+			<view class="base_text_item1">
+				<u-icon name="fangzi" custom-prefix="custom-icon" class="icon"></u-icon>
+				<span>基地名称</span>
+				<input type="text" v-model="baseinfo.base_name" placeholder="请输入基地名称" />
+			</view>
+			<view class="base_text_item1">
+				<u-icon name="ren1" custom-prefix="custom-icon" class="icon"></u-icon>
+				<span>负责人</span>
+				<input type="text" v-model="baseinfo.base_charge " placeholder="请输入基地负责人" />
+			</view>
+			<view class="base_text_item1">
+				<u-icon name="lianxidianhua" custom-prefix="custom-icon" class="icon"></u-icon>
+				<span>联系电话</span>
+				<input type="text" v-model="baseinfo.base_phone" placeholder="请输入联系电话" />
+			</view>
+			<view class="base_text_item1">
+				<u-icon name="mianji" custom-prefix="custom-icon" class="icon"></u-icon>
+				<span>面积(亩)</span>
+				<input type="number" v-model="baseinfo.base_area" placeholder="请输入基地面积" />
+			</view>
+			<view class="base_text_item2">
+				<u-icon name="miaoshu" custom-prefix="custom-icon" class="icon"></u-icon>
+				<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>
+				<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>
+				<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 class="btn" @click="tijiao">
+				确 定
+			</view>
+		</view>
+	</view>
+</template>
+<style lang="scss">
+	
+</style>
+<script>
+	export default {
+		data() {
+			return {
+				base_id:{},
+				baseinfo:{
+					base_name:'',//必传(str)           基地名称
+					base_charge:'',//必传(str)           负责人
+					base_phone:'',//必传(str)           联系电话
+					base_img:'',// 必传(str)           基地图片
+					base_area:'',//必传(str)           基地面积
+					base_equip:'', //必传(str)           绑定设备 如果绑定多个设备传 289#299, 如果是单一设备传298
+					base_describe:'',//非必传(str)         基地描述
+					lng:'',//必传(str)           经度
+					lat:'',//必传(str)           纬度
+				},
+				city:''
+			}
+		},
+		methods: {
+			//base.bases.base_list新增基地 //modify 修改  list  列表
+			async addbase() { //获取分布位置 
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=base.bases.base_list',
+					data:this.baseinfo
+				})
+				console.log(res)
+			},
+			clickLeft(){
+				uni.navigateTo({
+					url:"./index"
+				})
+			},
+			binding(){
+				uni.navigateTo({
+					url:"./allocation?type="+this.baseinfo.base_equip
+				})
+			},
+			gainimg() { //添加图片
+					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.baseinfo.base_img = JSON.parse(uploadFileRes.data).data.src
+									// this.$forceUpdate() //强制刷新视图
+								}
+							});
+						}
+					})
+			},
+			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
+						    }
+						});
+					}
+				});
+			},
+			tijiao(){
+				// console.log(this.baseinfo)
+				// this.addbase()
+				// localStorage.removeItem("id")
+				// uni.navigateBack({
+				// 	delta:1
+				// })
+				if(this.baseinfo.base_img==''){
+					uni.showToast({
+					    title: '请选择基地图片', 
+					    duration: 2000,
+						icon:"none"
+					});
+				
+				}else if(this.baseinfo.base_name==''){
+					uni.showToast({
+					    title: '请填写正基地名称', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_charge==''){
+					uni.showToast({
+					    title: '请填写基地负责人', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_phone==''){
+					uni.showToast({
+					    title: '请填写手机号', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_area==''){
+					uni.showToast({
+					    title: '请填写基地面积', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.lng==''){
+					uni.showToast({
+					    title: '请选择基地地址', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else if(this.baseinfo.base_id==''){
+					uni.showToast({
+					    title: '请绑定基地设备', 
+					    duration: 2000,
+						icon:"none"
+					});
+				}else{
+					if(!/^1[23456789]\d{9}$/.test(this.baseinfo.base_phone)){
+						uni.showToast({
+						    title: '请填写正确的手机号', 
+						    duration: 2000,
+							icon:"none"
+						});
+					}else{
+						console.log(this.baseinfo)
+						this.addbase()
+						localStorage.removeItem("id")
+						uni.navigateBack({
+							delta:1
+						})
+					}
+				}
+			},
+			selectaddress(lat,lng) { //获取分布位置
+				uni.request({
+					url: '/dpc/geocoder/v1?location='+lat+","+lng+'&key=B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ',
+					success: (res) => {
+						this.city = res.data.result.address
+						console.log(res.data.result.address)
+					}
+				})
+			},
+		},
+		onLoad(option) {
+			this.baseinfo = JSON.parse(option.id)
+			this.baseinfo.base_id = JSON.parse(option.id).id
+			this.baseinfo.ret = "modify"
+			delete this.baseinfo.id
+			this.selectaddress(this.baseinfo.lat,this.baseinfo.lng)
+			console.log(this.baseinfo)
+		},
+		onShow(){
+			this.base_id=JSON.parse(localStorage.getItem("id"))
+			if(localStorage.getItem("id")!=null){
+				var arr = []
+				for(var key in this.base_id){
+					arr.push(this.base_id[key].join("#"))
+				}
+				this.baseinfo.base_equip = arr.join("#")
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+.addimg{
+	position: absolute;
+	top: 108rpx;
+	width: 100%;
+	.addimg_add{
+		position: relative;
+		width: 90%;
+		height: 276rpx;
+		margin: 0 auto;
+		background-color: #F7F8FA;
+		text-align: center;
+		line-height: 276rpx;
+		color: #A7A8AA;
+		.addimg_img{
+			position: absolute;
+			top: 0;
+			width: 100%;
+			left: 0;
+			height: 276rpx;
+		}
+	}
+}
+.base_text{
+	position: absolute;
+	top: 390rpx;
+	width: 100%;
+	.title{
+		width: 90%;
+		margin: 20rpx auto;
+	}
+	.base_text_item2{
+		width: 90%;
+		margin: 10rpx auto 20rpx;
+		padding: 16rpx 20rpx;
+		background-color: #F7F8FA;
+		display: flex;
+		box-sizing: border-box;
+		position: relative;
+		height: 200rpx;
+		.icon{
+			color: #5FBBA0;
+			height: 42rpx;
+		}
+		span{
+			margin: 0 20rpx;
+		}
+		.textarea{
+			font-size: 24rpx;
+			text-align: right;
+			position: absolute;
+			right: 20rpx;
+			width: 70%;
+			height: 200rpx;
+		}
+		
+	}
+	.base_text_item1{
+		display: flex;
+		position: relative;
+		width: 90%;
+		height: 70rpx;
+		margin: 10rpx auto 20rpx;
+		padding: 16rpx 20rpx;
+		background-color: #F7F8FA;
+		box-sizing: border-box;
+		.icon{
+			color: #5FBBA0;
+		}
+		span{
+			margin: 0 20rpx;
+		}
+		input{
+			position: absolute;
+			right: 20rpx;
+			width: 70%;
+			text-align: right;
+			font-size: 24rpx;
+			margin-top: 5rpx;
+		}
+		.iconright{
+			position: absolute;
+			right: 20rpx;
+			top: 28rpx;
+			color: #B5B6B8;
+			font-size: 24rpx;
+		}
+	}
+}
+.base_id_box{
+		width: 90%;
+		margin: 20rpx auto 70rpx;
+	}
+	.base_id{
+		width: 100%;
+		.base_id_item{
+			width: 95%;
+			padding: 10rpx 30rpx;
+			display: flex;
+			justify-content: space-between;
+			font-size: 28rpx;
+			background-color: #F7F8FA;
+			color: #616162;
+			box-sizing: border-box;
+			margin: 20rpx auto;
+		}
+	}
+	.btn{
+		width: 90%;
+		position: fixed;
+		bottom: 0;
+		right: 5%;
+		text-align: center;
+		height: 70rpx;
+		line-height: 70rpx;
+		background-color: #359773;
+		font-size: 34rpx;
+		border-radius: 35rpx;
+		color: #FFFFFF;
+	}
+</style>

+ 11 - 6
pages/my/user-info/user-info.vue

@@ -94,14 +94,19 @@
 				this.compileTF = true
 			},
 			submit() {//提交按钮
-				this.userinfos.province = this.location.slice(0,this.location.indexOf("省")+1)
-				this.userinfos.city = this.location.slice(this.location.indexOf("省")+1,this.location.indexOf("市")+1)
-				this.userinfos.district = this.location.slice(this.location.indexOf("市")+1)
-				this.postusers()
-				this.compileTF = false
+				if(this.phonehint == false &&this.emailhint == false){
+					this.userinfos.province = this.location.slice(0,this.location.indexOf("省")+1)
+					this.userinfos.city = this.location.slice(this.location.indexOf("省")+1,this.location.indexOf("市")+1)
+					this.userinfos.district = this.location.slice(this.location.indexOf("市")+1)
+					this.postusers()
+					this.compileTF = false
+					uni.redirectTo({
+						url:"../index/index"
+					})
+				}
 			},
 			verifyphone() { //手机号验证
-				var reg = /^1[23456789]\d{9}$/;
+				var reg = /^1[356789]\d{9}$/;
 				if (!reg.test(this.userinfos.mobile)) {
 					this.phonehint = true
 				} else {

+ 3 - 3
pages/prevention/equipmentdetails.vue

@@ -144,9 +144,9 @@
 				})
 			},
 			sim(){//sim卡详情
-				uni.navigateTo({
-					url:"./sim?id="+this.eqinfo.item.d_id
-				})
+				// uni.navigateTo({
+				// 	url:"./sim?id="+this.eqinfo.item.d_id
+				// })
 			},
 			control(){//设备控制
 				uni.navigateTo({

+ 2 - 0
pages/prevention/sim.vue

@@ -41,7 +41,9 @@
 				})
 				this.iccid = res[0].iccid
 				this.simdata(this.iccid)
+				console.log(this.iccid)
 			},
+			
 			async simdata(data) { //设备列表
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.send_control.sim_query',

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 69
static/outfont/iconfont.css