t.width-t.padding[1]-t.padding[3]?(a.push(g),p.push(n-t.legend.itemGap),n=l,g=[i]):(n+=l,g.push(i))}if(g.length){a.push(g),p.push(n-t.legend.itemGap),l.widthArr=p;let e=o.apply(null,p);switch(t.legend.float){case"left":l.area.start.x=t.padding[3],l.area.end.x=t.padding[3]+2*r;break;case"right":l.area.start.x=t.width-t.padding[1]-e-2*r,l.area.end.x=t.width-t.padding[1];break;default:l.area.start.x=(t.width-e)/2-r,l.area.end.x=(t.width+e)/2+r;}l.area.width=e+2*r,l.area.wholeWidth=e+2*r,l.area.height=a.length*x+2*r,l.area.wholeHeight=a.length*x+2*r+2*s,l.points=a}}else{let i=e.length,a=t.height-t.padding[0]-t.padding[2]-2*s-2*r,o=Math.min(n(a/x),i);switch(l.area.height=o*x+2*r,l.area.wholeHeight=o*x+2*r,t.legend.float){case"top":l.area.start.y=t.padding[0]+s,l.area.end.y=t.padding[0]+s+l.area.height;break;case"bottom":l.area.start.y=t.height-t.padding[2]-s-l.area.height,l.area.end.y=t.height-t.padding[2]-s;break;default:l.area.start.y=(t.height-l.area.height)/2,l.area.end.y=(t.height+l.area.height)/2;}let p=0==i%o?i/o:n(i/o+1),g=[];for(let t,a=0;aa&&(a=e);l.widthArr.push(a),l.heightArr.push(i.length*x+2*r)}let e=0;for(let t=0;ta&&(o.angle=45*Math.PI/180,o.xAxisHeight=2*i.xAxisTextPadding+l*Math.sin(o.angle)),o}function getRadarDataPoints(e,t,i,a,o){var n=Math.max,l=5=a.oldData?(n._endAngle_-n._oldAngle_)*o+a.oldAngle:n._oldAngle_-(n._oldAngle_-n._endAngle_)*o,2<=n._proportion_&&(n._proportion_%=2)}return e}function getPieTextMaxLength(e){e=getPieDataPoints(e);let t=0;for(let a=0;a=e.width&&(e.width=1),e.x+=(a+.5-i/2)*e.width,e)})}function fixColumeMeterData(e,t,i,a,o,n,l){return e.map(function(e){return null===e?null:(e.width=Math.ceil((t-2*o.columePadding)/2),n.extra.column&&n.extra.column.width&&0<+n.extra.column.width&&(e.width=Math.min(e.width,+n.extra.column.width)),0s.x&&(h-=measureText(a.categories[r]||"")),n.beginPath(),n.setFontSize(o.fontSize),n.setFillStyle(l.labelColor||"#666666"),n.fillText(a.categories[r]||"",h,c+o.fontSize/2),n.closePath(),n.stroke()})}function drawPieText(e,t,a,o,i,n){var l=Math.cos,r=Math.sin,s=Math.min,d=Math.max,h=Math.PI,c=a.pieChartLinePadding,x=[],p=null,g=e.map(function(e){var t=2*h-(e._start_+2*h*e._proportion_/2),i=e.format?e.format(+e._proportion_.toFixed(2)):util.toFixed(100*e._proportion_)+"%",a=e.color,o=e._radius_;return{arc:t,text:i,color:a,radius:o,textColor:e.textColor,textSize:e.textSize}});for(let h=0;ht?m=d(f,p.start.y):0y&&(y-=u);let S={lineStart:{x:o,y:n},lineEnd:{x:t,y:i},start:{x:y,y:m},width:u,height:a.fontSize,text:e.text,color:e.color,textColor:e.textColor,textSize:e.textSize};p=avoidCollision(S,p),x.push(p)}for(let l=0;le.start.x?s.x+e.width:s.x,c=0>e.start.x?s.x-5:s.x+5;o.quadraticCurveTo(r.x,r.y,d,s.y),o.moveTo(i.x,i.y),o.stroke(),o.closePath(),o.beginPath(),o.moveTo(s.x+e.width,s.y),o.arc(d,s.y,2,0,2*h),o.closePath(),o.fill(),o.beginPath(),o.setFontSize(e.textSize||a.fontSize),o.setFillStyle(e.textColor||"#666666"),o.fillText(e.text,c,s.y+3),o.closePath(),o.stroke(),o.closePath()}}function drawToolTipSplitLine(e,t,i,a){var o=t.extra.tooltip||{};o.gridType=null==o.gridType?"solid":o.gridType,o.dashLength=null==o.dashLength?4:o.dashLength;var n=t.area[0],l=t.height-t.area[2];if("dash"==o.gridType&&a.setLineDash([o.dashLength,o.dashLength]),a.setStrokeStyle(o.gridColor||"#cccccc"),a.setLineWidth(1*t.pixelRatio),a.beginPath(),a.moveTo(e,n),a.lineTo(e,l),a.stroke(),a.setLineDash([]),o.xAxisLabel){let n=t.categories[t.tooltip.index];a.setFontSize(i.fontSize);let r=measureText(n,i.fontSize),s=e-i.toolTipPadding-.5*r,d=l;a.beginPath(),a.setFillStyle(hexToRgb(o.labelBgColor||i.toolTipBackground,o.labelBgOpacity||i.toolTipOpacity)),a.setStrokeStyle(o.labelBgColor||i.toolTipBackground),a.setLineWidth(1*t.pixelRatio),a.rect(s,d,r+2*i.toolTipPadding,i.fontSize+2*i.toolTipPadding),a.closePath(),a.stroke(),a.fill(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(o.labelFontColor||i.fontColor),a.fillText(n,s+2*i.toolTipPadding,d+i.toolTipPadding+i.fontSize),a.closePath(),a.stroke()}}function drawMarkLine(e,t,a,i,o){let n=assign({},{type:"solid",dashLength:4,data:[]},a.extra.markLine),l=a.area[3],r=a.width-a.padding[1],s=calMarkLineData(e,t,n.data,a);for(let d,h=0;hi.width&&(h=!0),p+t.y>i.height&&(t.y=i.height-p),o.beginPath(),o.setFillStyle(hexToRgb(l.bgColor||a.toolTipBackground,l.bgOpacity||a.toolTipOpacity)),h?(o.moveTo(t.x,t.y+10*i.pixelRatio),o.lineTo(t.x-d,t.y+10*i.pixelRatio-5*i.pixelRatio),o.lineTo(t.x-d,t.y),o.lineTo(t.x-d-n(x),t.y),o.lineTo(t.x-d-n(x),t.y+p),o.lineTo(t.x-d,t.y+p),o.lineTo(t.x-d,t.y+10*i.pixelRatio+5*i.pixelRatio),o.lineTo(t.x,t.y+10*i.pixelRatio)):(o.moveTo(t.x,t.y+10*i.pixelRatio),o.lineTo(t.x+d,t.y+10*i.pixelRatio-5*i.pixelRatio),o.lineTo(t.x+d,t.y),o.lineTo(t.x+d+n(x),t.y),o.lineTo(t.x+d+n(x),t.y+p),o.lineTo(t.x+d,t.y+p),o.lineTo(t.x+d,t.y+10*i.pixelRatio+5*i.pixelRatio),o.lineTo(t.x,t.y+10*i.pixelRatio)),o.closePath(),o.fill(),e.forEach(function(e,i){if(null!==e.color){o.beginPath(),o.setFillStyle(e.color);var n=t.x+d+2*a.toolTipPadding,l=t.y+(a.toolTipLineHeight-a.fontSize)/2+a.toolTipLineHeight*i+a.toolTipPadding+1;h&&(n=t.x-x-d+2*a.toolTipPadding),o.fillRect(n,l,r,a.fontSize),o.closePath()}}),e.forEach(function(e,i){var n=t.x+d+2*a.toolTipPadding+r+s;h&&(n=t.x-x-d+2*a.toolTipPadding+ +r+s);var c=t.y+(a.toolTipLineHeight-a.fontSize)/2+a.toolTipLineHeight*i+a.toolTipPadding;o.beginPath(),o.setFontSize(a.fontSize),o.setFillStyle(l.fontColor),o.fillText(e.text,n,c+a.fontSize),o.closePath(),o.stroke()})}function drawYAxisTitle(e,t,i,a){var o=i.xAxisHeight+(t.height-i.xAxisHeight-measureText(e))/2;a.save(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(t.yAxis.titleFontColor||"#333333"),a.translate(0,t.height),a.rotate(-90*Math.PI/180),a.fillText(e,o,t.padding[3]+.5*i.fontSize),a.closePath(),a.stroke(),a.restore()}function drawColumnDataPoints(e,t,i,a){let o=4t._scrollDistance_&&o.fillRect(0,0,r,h),o.fillRect(s,0,t.width,h),o.closePath(),o.stroke();for(var c=[],x=0;x<=a.yAxisSplit;x++)c.push(t.area[0]+l*x);var p=t.yAxis.fontSize||a.fontSize;e.forEach(function(e,i){var n=c[i]?c[i]:d;o.beginPath(),o.setFontSize(p),o.setFillStyle(t.yAxis.fontColor||"#666666"),o.fillText(e,t.area[3]-a.yAxisWidth,n+p/2),o.closePath(),o.stroke()}),t.yAxis.title&&drawYAxisTitle(t.yAxis.title,t,a,o)}}function drawLegend(e,t,i,a,o){if(!1===t.legend.show)return;let n=o.legendData,l=n.points,r=n.area,s=t.legend.padding,d=t.legend.fontSize,h=15*t.pixelRatio,c=5*t.pixelRatio,x=t.legend.itemGap,p=Math.max(t.legend.lineHeight*t.pixelRatio,d);a.beginPath(),a.setLineWidth(t.legend.borderWidth),a.setStrokeStyle(t.legend.borderColor),a.setFillStyle(t.legend.backgroundColor),a.moveTo(r.start.x,r.start.y),a.rect(r.start.x,r.start.y,r.width,r.height),a.closePath(),a.fill(),a.stroke(),l.forEach(function(e,o){let l=0,g=0;l=n.widthArr[o],g=n.heightArr[o];let y=0,f=0;"top"==t.legend.position||"bottom"==t.legend.position?(y=r.start.x+(r.width-l)/2,f=r.start.y+s+o*p):(l=0==o?0:n.widthArr[o-1],y=r.start.x+s+l,f=r.start.y+s+(r.height-g)/2),a.setFontSize(i.fontSize);for(let n,l=0;l(e/=.5)?.5*t(e,3):.5*(t(e-2,3)+2)},linear:function(e){return e}};function Animation(e){this.isStop=!1,e.duration="undefined"==typeof e.duration?1e3:e.duration,e.timing=e.timing||"linear";var t=function(){return"undefined"==typeof requestAnimationFrame?"undefined"==typeof setTimeout?function(e){e(null)}:function(e,t){setTimeout(function(){var t=+new Date;e(t)},t)}:requestAnimationFrame}(),i=null,a=function(o){if(null===o||!0===this.isStop)return e.onProcess&&e.onProcess(1),void(e.onAnimationFinish&&e.onAnimationFinish());if(null===i&&(i=o),o-io;o++)t.area[o]=t.padding[o];var h=calLegendData(s,t,i,t.chartData),c=h.area.wholeHeight,x=h.area.wholeWidth;switch(i.legendHeight=c,t.legend.position){case"top":t.area[0]+=c;break;case"bottom":t.area[2]+=c;break;case"left":t.area[3]+=x;break;case"right":t.area[1]+=x;}let p=calYAxisData(n,t,i),g=p.yAxisWidth;if("line"===t.type||"column"===t.type||"area"===t.type||"mix"===t.type||"candle"===t.type?(i.yAxisWidth=g,t.area[3]+=g):i.yAxisWidth=g,t.chartData.yAxisData=p,t.categories&&t.categories.length){t.chartData.xAxisData=getXAxisPoints(t.categories,t,i);let e=calCategoriesData(t.categories,t,i,t.chartData.xAxisData.eachSpacing),a=e.xAxisHeight,o=e.angle;i.xAxisHeight=a,i._xAxisTextAngle_=o,t.area[2]+=a,t.chartData.categoriesData=e}if(t.enableScroll&&"right"==t.xAxis.scrollAlign&&void 0===t._scrollDistance_){let e=0,i=t.chartData.xAxisData.xAxisPoints,a=t.chartData.xAxisData.startX,n=t.chartData.xAxisData.endX,l=t.chartData.xAxisData.eachSpacing,r=l*(i.length-1);e=n-a-r,o.scrollOption={currentOffset:e,startTouchX:e,distance:0,lastMoveTime:0},t._scrollDistance_=e}("pie"===e||"ring"===e||"rose"===e)&&(i._pieTextMaxLength_=!1===t.dataLabel?0:getPieTextMaxLength(d)),"line"===e?this.animationInstance=new Animation({timing:"easeIn",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),drawYAxisGrid(l,t,i,a),drawXAxis(l,t,i,a);var o=drawLineDataPoints(n,t,i,a,e),r=o.xAxisPoints,s=o.calPoints,d=o.eachSpacing;t.chartData.xAxisPoints=r,t.chartData.calPoints=s,t.chartData.eachSpacing=d,drawYAxis(n,t,i,a),drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e,d,r),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"mix"===e?this.animationInstance=new Animation({timing:"easeIn",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),drawYAxisGrid(l,t,i,a),drawXAxis(l,t,i,a);var o=drawMixDataPoints(n,t,i,a,e),r=o.xAxisPoints,s=o.calPoints,d=o.eachSpacing;t.chartData.xAxisPoints=r,t.chartData.calPoints=s,t.chartData.eachSpacing=d,drawYAxis(n,t,i,a),drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e,d,r),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"column"===e?this.animationInstance=new Animation({timing:"easeIn",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),drawYAxisGrid(l,t,i,a),drawYAxis(n,t,i,a),drawXAxis(l,t,i,a);var o=drawColumnDataPoints(n,t,i,a,e),r=o.xAxisPoints,s=o.calPoints,d=o.eachSpacing;t.chartData.xAxisPoints=r,t.chartData.calPoints=s,t.chartData.eachSpacing=d,drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e,d,r),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"area"===e?this.animationInstance=new Animation({timing:"easeIn",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),drawYAxisGrid(l,t,i,a),drawXAxis(l,t,i,a);var o=drawAreaDataPoints(n,t,i,a,e),r=o.xAxisPoints,s=o.calPoints,d=o.eachSpacing;t.chartData.xAxisPoints=r,t.chartData.calPoints=s,t.chartData.eachSpacing=d,drawYAxis(n,t,i,a),drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e,d,r),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"ring"===e||"pie"===e?this.animationInstance=new Animation({timing:"easeInOut",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),t.chartData.pieData=drawPieDataPoints(n,t,i,a,e),drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"rose"===e?this.animationInstance=new Animation({timing:"easeInOut",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),t.chartData.pieData=drawRoseDataPoints(n,t,i,a,e),drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"radar"===e?this.animationInstance=new Animation({timing:"easeInOut",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),t.chartData.radarData=drawRadarDataPoints(n,t,i,a,e),drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"arcbar"===e?this.animationInstance=new Animation({timing:"easeInOut",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),t.chartData.arcbarData=drawArcbarDataPoints(n,t,i,a,e),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"gauge"===e?this.animationInstance=new Animation({timing:"easeInOut",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),t.chartData.gaugeData=drawGaugeDataPoints(l,n,t,i,a,e),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):"candle"===e?this.animationInstance=new Animation({timing:"easeIn",duration:r,onProcess:function(e){a.clearRect(0,0,t.width,t.height),t.rotate&&contextRotate(a,t),drawYAxisGrid(l,t,i,a),drawXAxis(l,t,i,a);var o=drawCandleDataPoints(n,s,t,i,a,e),r=o.xAxisPoints,d=o.calPoints,h=o.eachSpacing;t.chartData.xAxisPoints=r,t.chartData.calPoints=d,t.chartData.eachSpacing=h,drawYAxis(n,t,i,a),s?drawLegend(s,t,i,a,t.chartData):drawLegend(t.series,t,i,a,t.chartData),drawToolTipBridge(t,i,a,e,h,r),drawCanvas(t,a)},onAnimationFinish:function(){o.event.trigger("renderComplete")}}):void 0}function Event(){this.events={}}Event.prototype.addEventListener=function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},Event.prototype.trigger=function(){for(var e=arguments.length,t=Array(e),i=0;it;t++)e.padding[t]*=e.pixelRatio;t.yAxisWidth=config.yAxisWidth*e.pixelRatio,t.xAxisHeight=config.xAxisHeight*e.pixelRatio,e.enableScroll&&e.xAxis.scrollShow&&(t.xAxisHeight+=6*e.pixelRatio),t.xAxisLineHeight=config.xAxisLineHeight*e.pixelRatio,t.legendHeight=config.legendHeight*e.pixelRatio,t.fontSize=e.fontSize,t.titleFontSize=config.titleFontSize*e.pixelRatio,t.subtitleFontSize=config.subtitleFontSize*e.pixelRatio,t.toolTipPadding=config.toolTipPadding*e.pixelRatio,t.toolTipLineHeight=config.toolTipLineHeight*e.pixelRatio,t.columePadding=config.columePadding*e.pixelRatio,e.$this=e.$this?e.$this:this,this.context=uni.createCanvasContext(e.canvasId,e.$this),e.chartData={},this.event=new Event,this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0},this.opts=e,this.config=t,drawCharts.call(this,e.type,e,t,this.context)};Charts.prototype.updateData=function(){let e=0",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+ },
+ /* ios打包配置 */
+ "ios" : {},
+ /* SDK配置 */
+ "sdkConfigs" : {}
+ }
+ },
+ /* 快应用特有相关 */
+ "quickapp" : {},
+ /* 小程序特有相关 */
+ "mp-weixin" : {
+ "appid" : "wx7ee0db110b58b021",
+ "setting" : {
+ "urlCheck" : false,
+ "minified" : true,
+ "postcss" : true,
+ "es6" : true
+ },
+ "usingComponents" : true
+ },
+ "mp-alipay" : {
+ "usingComponents" : true
+ },
+ "mp-baidu" : {
+ "usingComponents" : true
+ },
+ "mp-toutiao" : {
+ "usingComponents" : true
+ }
+}
diff --git a/pages.json b/pages.json
new file mode 100644
index 0000000..b106ac8
--- /dev/null
+++ b/pages.json
@@ -0,0 +1,79 @@
+{
+ "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+ {
+ "path": "pages/login/login",
+ "style": {
+ "backgroundColor": "#f5f6f8",
+ "navigationBarTitleText": "登录",
+ "app-plus": {}
+ }
+ },
+ {
+ "path": "pages/home/home",
+ "style": {
+ "navigationBarTitleText": "首页"
+ }
+ },
+ {
+ "path": "pages/device/device",
+ "style": {
+ "navigationBarTitleText": "设备"
+ }
+ },
+ {
+ "path": "pages/location/location",
+ "style": {
+ "navigationBarTitleText": "定位"
+ }
+ },
+ {
+ "path": "pages/user/user",
+ "style": {
+ "navigationBarTitleText": "我的"
+ }
+ },
+ {
+ "path": "pages/device/detail/index",
+ "style": {
+ "navigationBarTitleText": " 设备详情"
+ }
+ }
+ ],
+ "globalStyle": {
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "芯域物联",
+ "navigationBarBackgroundColor": "#F8F8F8",
+ "backgroundColor": "#F8F8F8"
+ },
+ "tabBar": {
+ "backgroundColor": "#ffffff",
+ "color": "#cdcdcd",
+ "selectedColor": "#50B7EA",
+ "borderStyle": "white",
+ "list": [{
+ "pagePath": "pages/home/home",
+ "iconPath": "static/home.png",
+ "selectedIconPath": "static/home_active.png",
+ "text": "首页"
+ },
+ {
+ "pagePath": "pages/device/device",
+ "iconPath": "static/device.png",
+ "selectedIconPath": "static/device_active.png",
+ "text": "设备"
+ },
+ {
+ "pagePath": "pages/location/location",
+ "iconPath": "static/location.png",
+ "selectedIconPath": "static/location_active.png",
+ "text": "定位"
+ },
+ {
+ "pagePath": "pages/user/user",
+ "iconPath": "static/user.png",
+ "selectedIconPath": "static/user_active.png",
+ "text": "我的"
+ }
+ ]
+ }
+}
diff --git a/pages/device/detail/device-info.vue b/pages/device/detail/device-info.vue
new file mode 100644
index 0000000..1115aaa
--- /dev/null
+++ b/pages/device/detail/device-info.vue
@@ -0,0 +1,50 @@
+
+
+
+ 设备信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/device/detail/index.vue b/pages/device/detail/index.vue
new file mode 100644
index 0000000..1920f87
--- /dev/null
+++ b/pages/device/detail/index.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/device/detail/real-data.vue b/pages/device/detail/real-data.vue
new file mode 100644
index 0000000..f24a129
--- /dev/null
+++ b/pages/device/detail/real-data.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/device/device.vue b/pages/device/device.vue
new file mode 100644
index 0000000..4144a0a
--- /dev/null
+++ b/pages/device/device.vue
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/home/home.vue b/pages/home/home.vue
new file mode 100644
index 0000000..e31a8cc
--- /dev/null
+++ b/pages/home/home.vue
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+
+
+
+ 网关
+
+
+
+ 终端
+
+
+
+ 设备概览
+
+
+
+
+
+
+
+
+
diff --git a/pages/location/location.vue b/pages/location/location.vue
new file mode 100644
index 0000000..4cd5700
--- /dev/null
+++ b/pages/location/location.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/login/login.vue b/pages/login/login.vue
new file mode 100644
index 0000000..3301eb6
--- /dev/null
+++ b/pages/login/login.vue
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/user/user.vue b/pages/user/user.vue
new file mode 100644
index 0000000..7df78fb
--- /dev/null
+++ b/pages/user/user.vue
@@ -0,0 +1,208 @@
+
+
+
+
+
+ Hi,{{hasLogin ? userInfo.nickName : '您未登录'}}
+
+
+
+
+
+
+ 帐号管理
+
+
+
+
+ 新消息通知
+
+
+
+
+
+
+ 帮助与反馈
+
+
+
+
+ 服务条款及隐私
+
+
+
+
+
+
+ 关于应用
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/static/banner1.png b/static/banner1.png
new file mode 100644
index 0000000..d277a30
Binary files /dev/null and b/static/banner1.png differ
diff --git a/static/banner2.png b/static/banner2.png
new file mode 100644
index 0000000..058f9a6
Binary files /dev/null and b/static/banner2.png differ
diff --git a/static/device.png b/static/device.png
new file mode 100644
index 0000000..ef0f560
Binary files /dev/null and b/static/device.png differ
diff --git a/static/device_active.png b/static/device_active.png
new file mode 100644
index 0000000..185f71c
Binary files /dev/null and b/static/device_active.png differ
diff --git a/static/dtu.png b/static/dtu.png
new file mode 100644
index 0000000..08e5884
Binary files /dev/null and b/static/dtu.png differ
diff --git a/static/gateway.png b/static/gateway.png
new file mode 100644
index 0000000..aa3f4c7
Binary files /dev/null and b/static/gateway.png differ
diff --git a/static/head.png b/static/head.png
new file mode 100644
index 0000000..be6fa38
Binary files /dev/null and b/static/head.png differ
diff --git a/static/home.png b/static/home.png
new file mode 100644
index 0000000..2b0a0a5
Binary files /dev/null and b/static/home.png differ
diff --git a/static/home_active.png b/static/home_active.png
new file mode 100644
index 0000000..e2cf0af
Binary files /dev/null and b/static/home_active.png differ
diff --git a/static/humiture.png b/static/humiture.png
new file mode 100644
index 0000000..e667c63
Binary files /dev/null and b/static/humiture.png differ
diff --git a/static/icon_del.png b/static/icon_del.png
new file mode 100644
index 0000000..6999171
Binary files /dev/null and b/static/icon_del.png differ
diff --git a/static/icon_pwd.png b/static/icon_pwd.png
new file mode 100644
index 0000000..d86afd6
Binary files /dev/null and b/static/icon_pwd.png differ
diff --git a/static/icon_pwd_switch.png b/static/icon_pwd_switch.png
new file mode 100644
index 0000000..189405b
Binary files /dev/null and b/static/icon_pwd_switch.png differ
diff --git a/static/icon_user.png b/static/icon_user.png
new file mode 100644
index 0000000..6609b63
Binary files /dev/null and b/static/icon_user.png differ
diff --git a/static/location.png b/static/location.png
new file mode 100644
index 0000000..2d1e8ca
Binary files /dev/null and b/static/location.png differ
diff --git a/static/location_active.png b/static/location_active.png
new file mode 100644
index 0000000..1e57383
Binary files /dev/null and b/static/location_active.png differ
diff --git a/static/logo.png b/static/logo.png
new file mode 100644
index 0000000..b5771e2
Binary files /dev/null and b/static/logo.png differ
diff --git a/static/user.png b/static/user.png
new file mode 100644
index 0000000..fb16601
Binary files /dev/null and b/static/user.png differ
diff --git a/static/user_active.png b/static/user_active.png
new file mode 100644
index 0000000..dfdabc3
Binary files /dev/null and b/static/user_active.png differ
diff --git a/store/getters.js b/store/getters.js
new file mode 100644
index 0000000..3b7c4a5
--- /dev/null
+++ b/store/getters.js
@@ -0,0 +1,7 @@
+const getters = {
+ token: state => state.user.token,
+ avatar: state => state.user.avatar,
+ name: state => state.user.name,
+ roles: state => state.user.roles
+}
+export default getters
diff --git a/store/index.js b/store/index.js
new file mode 100644
index 0000000..95a926a
--- /dev/null
+++ b/store/index.js
@@ -0,0 +1,15 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+import user from './user'
+import getters from './getters'
+
+Vue.use(Vuex)
+
+const store = new Vuex.Store({
+ modules: {
+ user
+ },
+ getters
+})
+
+export default store
diff --git a/store/user.js b/store/user.js
new file mode 100644
index 0000000..a45d105
--- /dev/null
+++ b/store/user.js
@@ -0,0 +1,87 @@
+import { login, logout, getInfo } from '@/api/login'
+import { getToken, setToken, removeToken } from '@/common/auth'
+
+const user = {
+ state: {
+ token: getToken(),
+ name: '',
+ avatar: '',
+ roles: []
+ },
+
+ mutations: {
+ SET_TOKEN: (state, token) => {
+ state.token = token
+ },
+ SET_NAME: (state, name) => {
+ state.name = name
+ },
+ SET_AVATAR: (state, avatar) => {
+ state.avatar = avatar
+ },
+ SET_ROLES: (state, roles) => {
+ state.roles = roles
+ }
+ },
+
+ actions: {
+ // 登录
+ Login({ commit }, userInfo) {
+ const username = userInfo.username.trim()
+ return new Promise((resolve, reject) => {
+ login(username, userInfo.password).then(response => {
+ const data = response.data
+ setToken(data.token)
+ commit('SET_TOKEN', data.token)
+ resolve()
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+ // 获取用户信息
+ GetInfo({ commit, state }) {
+ return new Promise((resolve, reject) => {
+ getInfo(state.token).then(response => {
+ const data = response.data
+ // if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
+ // commit('SET_ROLES', data.roles)
+ // } else {
+ // reject('getInfo: roles must be a non-null array !')
+ // }
+ commit('SET_NAME', data.name)
+ commit('SET_AVATAR', data.avatar)
+ resolve(response)
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+ // 登出
+ LogOut({ commit, state }) {
+ return new Promise((resolve, reject) => {
+ logout(state.token).then(() => {
+ commit('SET_TOKEN', '')
+ commit('SET_ROLES', [])
+ removeToken()
+ resolve()
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+ // 前端 登出
+ FedLogOut({ commit }) {
+ return new Promise(resolve => {
+ commit('SET_TOKEN', '')
+ removeToken()
+ resolve()
+ })
+ }
+ }
+}
+
+export default user
diff --git a/uni.scss b/uni.scss
new file mode 100644
index 0000000..b9ce20d
--- /dev/null
+++ b/uni.scss
@@ -0,0 +1,106 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:24upx;
+$uni-font-size-base:28upx;
+$uni-font-size-lg:32upx;
+
+/* 图片尺寸 */
+$uni-img-size-sm:40upx;
+$uni-img-size-base:52upx;
+$uni-img-size-lg:80upx;
+
+/* Border Radius */
+$uni-border-radius-sm: 4upx;
+$uni-border-radius-base: 6upx;
+$uni-border-radius-lg: 12upx;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 10px;
+$uni-spacing-row-base: 20upx;
+$uni-spacing-row-lg: 30upx;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 8upx;
+$uni-spacing-col-base: 16upx;
+$uni-spacing-col-lg: 24upx;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:40upx;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:36upx;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:30upx;
+
+// custom
+
+/* 页面左右间距 */
+$page-row-spacing: 30upx;
+$page-color-base: #f8f8f8;
+$page-color-light: #f8f6fc;
+$base-color: #fa436a;
+
+/* 文字尺寸 */
+$font-sm: 24upx;
+$font-base: 28upx;
+$font-lg: 32upx;
+/*文字颜色*/
+$font-color-dark: #303133;
+$font-color-base: #606266;
+$font-color-light: #909399;
+$font-color-disabled: #C0C4CC;
+$font-color-spec: #4399fc;
+/* 边框颜色 */
+$border-color-dark: #DCDFE6;
+$border-color-base: #E4E7ED;
+$border-color-light: #EBEEF5;
+/* 图片加载中颜色 */
+$image-bg-color: #eee;
+/* 行为相关颜色 */
+$uni-color-primary:#fa436a;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;