123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
-
- @{
- ViewBag.Title = "车辆信息管理";
- Layout = "~/Views/Shared/_Lymap.cshtml";
- }
- @using MES.Production.Service;
- @using Central.Control.Domain;
- @using Ant.Service.Common;
- @using Ant.Service.Common.Enums;
- @using MES.Production.Entity;
- @using CommonToolHelper;
- @model UserCarMapModel
- <!-- 重点参数:infoTitle, infoBody -->
- <!doctype html>
- <html lang="zh-CN">
- <head>
- <!-- 原始地址://webapi.amap.com/ui/1.0/ui/overlay/SimpleInfoWindow/examples/index.html -->
- <base href="http://webapi.amap.com/ui/1.0/ui/overlay/SimpleInfoWindow/examples/" />
- <meta charset="utf-8">
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
- <script src="http://@HttpContext.Current.Request.Url.Host:@Request.Url.Port/Content/js/jquery/jquery-1.8.2.min.js"></script>
- <title>地图</title>
- <style>
- html,
- body,
- #container {
- width: 99%;
- height: 550px;
- margin: 0px;
- }
- p.my-desc {
- margin: 5px 0;
- line-height: 150%;
- }
- body {
- background-color: white;
- }
- #div1 {
- width: 100px;
- height: 30px;
- border-radius: 50px;
- position: relative;
- }
- #div2 {
- width: 30px;
- height: 28px;
- border-radius: 30px;
- position: absolute;
- background: white;
- box-shadow: 0px 2px 4px rgba(0,0,0,0.4);
- }
- .open1 {
- background: rgba(0,184,0,0.8);
- }
- .open2 {
- top: 2px;
- right: 1px;
- }
- .close1 {
- background: red;
- border: 3px solid rgba(136, 11, 11, 0);
- border-left: transparent;
- }
- .close2 {
- left: 0px;
- top: 0px;
- border: 2px solid rgba(0,0,0,0.1);
- }
- .changeicon {
- float: right;
- margin-right: -15px;
- position: absolute;
- right: -7px;
- top: 0px;
- border: none;
- background-color: #18a689;
- color: #FFFFFF;
- line-height: 33px;
- height: 33px;
- }
- </style>
- </head>
- <body>
- <div id="container"></div>
- <div class="row white-bg animated fadeInRight">
- <div class="wrapper-content">
- <div class="panel-body">
- <div class="tab-content">
- <div id="tab-1" class="tab-pane active">
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">农机名称:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.carName</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">农机状态:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.carNote</label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">农机IMEI号:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.carId</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">车架号:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.barCode</label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">农机型号:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.CarModel</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">出厂编号:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.FactoryNumber</label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">是否在线:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@(Model.isOnLine == 0 ? "不在线" : "在线")</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">所属经销商:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.distributorsName</label>
- </div>
- </div>
- </div>
- </div>
- @{
- if (Model.carType.ToInt32() != 4)
- {
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">农机油压:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.hydraulic </label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">农机水温:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.temperature </label>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">农机转速:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.speed </label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">蓄电池电压:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@(Model.voltage) </label>
- </div>
- </div>
- </div>
- </div>
- }
- }
- @{
- if (Model.carState.ToInt32() == MES.Production.Entity.Enum.CarState.Sales.GetHashCode())
- {
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">购买人:</label>
- <div class="col-lg-8" style="width:45% !important">
- <label style="margin-top:7px;">@Model.purchaserName</label>
- </div>
- </div>
- </div>
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">购买人电话:</label>
- <div class="col-lg-8">
- <label style="margin-top:7px;">@Model.purchaserTel</label>
- </div>
- </div>
- </div>
- </div>
- }
- }
- <div class="clearfix f-hafl">
- <div class="col-hafl">
- <div class="form-group">
- <label class="col-lg-3 control-label">地图切换:</label>
- <div class="col-lg-8">
- <label class="radio-inline">
- <div id="div1" class="open1">
- <div id="div2" class="close2" onclick="myrefresh('')"></div>
- </div>
- </label>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript" src='http://webapi.amap.com/maps?v=1.4.2&key=fa36ec6323075f37020083ceffe8eb24'></script>
- <!-- UI组件库 1.0 -->
- <script src="http://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
- <script type="text/javascript">
- //创建地图
- //window.onload = function () {
- // var div2 = document.getElementById("div2");
- // var div1 = document.getElementById("div1");
- // div2.onclick = function () {
- // div1.className = (div1.className == "close1") ? "open1" : "close1";
- // div2.className = (div2.className == "close2") ? "open2" : "close2";
- // }
- //}
- $(function () {
- var div2 = document.getElementById("div2");
- myrefresh(div2.className);
- var div2 = document.getElementById("div2");
- var div1 = document.getElementById("div1");
- var lock = "@Model.LockState.ToString()";
- if (lock=="True") {
- div1.className = "close1";
- div2.className = "close2";
- }
- else {
- div1.className = "open1";
- div2.className = "open2";
- }
- });
- function SendLockCarCmd() {
- var urlstr = "http://" + window.location.host + "/";
- var div2 = document.getElementById("div2");
- var div1 = document.getElementById("div1");
- if (div1.className == "close1") {
- div1.className = "open1";
- }
- else {
- div1.className = "close1";
- }
- if (div2.className == "close2") {
- div2.className = "open2";
- }
- else {
- div2.className = "close2";
- }
- if (div1.className == "close1") {
- $.ajax({
- url: urlstr + 'Sys/Car/SendLockCarCmd?carid='+@Model.carId,
- data: null,
- type: 'get',
- dataType: 'json',
- async: false,
- cache: false,
- success: function (res) {
- if (res.Status == 'y') {
- dig.msg("锁车发送成功!");
- //alert("锁车发送成功!");
- }
- }
- });
- } else {
- $.ajax({
- url: urlstr + 'Sys/Car/SendUnLockCarCmd?carid=' +@Model.carId,
- data: null,
- type: 'get',
- dataType: 'json',
- async: false,
- cache: false,
- success: function (res) {
- if (res.Status == 'y') {
- //alert("解锁发送成功!");
- dig.msg("解锁发送成功!");
- }
- }
- });
- }
- }
- //解锁
- function SendUnLockCarCmd() {
- var item = $(":radio:checked");
- var urlstr = "http://"+window.location.host + "/";
- //alert(urlstr);
- var len = item.length;
- if (len > 0) {
- if ($(":radio:checked").val() == 2)
- {
- $.ajax({
- url: urlstr + 'Sys/Car/SendUnLockCarCmd?carid='+@Model.carId,
- data: null,
- type: 'get',
- dataType: 'json',
- async: false,
- cache: false,
- success: function (res) {
- if (res.Status == 'y') {
- alert("解锁发送成功!");
- }
- }
- });
- }
- else
- {
- }
- }
- }
- function myrefresh(i) {
- var map;
- var div2 = document.getElementById("div2");
- var div1 = document.getElementById("div1");
- if (div1.className == "close1") {
- div1.className = "open1";
- }
- else {
- div1.className = "close1";
- }
- if (div2.className == "close2") {
- map = new AMap.Map('container', {
- resizeEnable: true,
- zoom: 16,
- center: [@Model.lng, @Model.lat]
- });
- div2.className = "open2";
- }
- else {
- map = new AMap.Map('container', {
- resizeEnable: true,
- layers: [new AMap.TileLayer.Satellite()],
- zoom: 16,
- center: [@Model.lng, @Model.lat]
- });
- div2.className = "close2";
- }
- AMapUI.loadUI(['overlay/SimpleInfoWindow'], function (SimpleInfoWindow) {
- var marker = new AMap.Marker({
- map: map,
- zIndex: 99999,
- offset: new AMap.Pixel(-14, -34),//相对于基点的位置
- icon: new AMap.Icon({ //复杂图标
- size: new AMap.Size(34, 49),//图标大小
- image: "@Model.imageUrl", //大图地址
- })
- });
- var infoWindow = new SimpleInfoWindow({
- infoTitle: '<strong>@Model.carName(@Model.FactoryNumber)</strong>',
- infoBody: '<p class="my-desc"><strong>@Model.Note<br/>@Model.onlineDate<br/>@Model.workHours<br/>@Model.address</strong></p>',
- //基点指向marker的头部位置
- offset: new AMap.Pixel(0, -31)
- });
- function openInfoWin() {
- infoWindow.open(map, marker.getPosition());
- }
- //marker 点击时打开
- AMap.event.addListener(marker, 'click', function () {
- openInfoWin();
- });
- });
- }
- </script>
- </body>
- </html>
|