初始化CRICS
This commit is contained in:
16
WebSite/Views/App/About.ascx
Normal file
16
WebSite/Views/App/About.ascx
Normal file
@@ -0,0 +1,16 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/About.css" />
|
||||
<div style="width: 100%; height: 100%; padding-top: 24%; width: 100%;">
|
||||
<%--<dl class="About-dl">
|
||||
<dd class="About-dd">
|
||||
<span class="About-strong" style="font-size: 26px;">
|
||||
<%: Html.AppLanguage("HotelRoomsIntelligentControlSystem", (Request.Cookies["isCN"].Value == "zh-cn"))%>
|
||||
<%: ViewData["Version"]%><%: Html.AppLanguage("Version", (Request.Cookies["isCN"].Value == "zh-cn"))%>
|
||||
</span>
|
||||
</dd>
|
||||
<dd class="About-dd">
|
||||
<span class="About-strong">
|
||||
<%: Html.AppLanguage("SimonElectric", (Request.Cookies["isCN"].Value == "zh-cn"))%></span>
|
||||
</dd>
|
||||
</dl>--%>
|
||||
</div>
|
||||
184
WebSite/Views/App/AirConditionControl.ascx
Normal file
184
WebSite/Views/App/AirConditionControl.ascx
Normal file
@@ -0,0 +1,184 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/air.css" />
|
||||
<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/Scripts/avalon.mobile.min.js"></script>
|
||||
<%@ Import Namespace="WebSite.Controllers" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
function setAirCondition(HostId, AirId, Type, Status, callback) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: RoomConfig.AirConditionControlUrl,
|
||||
type: 'POST',
|
||||
async: false,
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
roomNumber: RoomConfig.RoomNumber,
|
||||
hostId: HostId,
|
||||
airId: AirId,
|
||||
property: Type,
|
||||
status: Status
|
||||
},
|
||||
success: callback
|
||||
});
|
||||
}
|
||||
|
||||
var vm = avalon.define({
|
||||
$id: 'air-panel',
|
||||
air: [],
|
||||
hostId: '',
|
||||
airId: '',
|
||||
currentIndex: -1,
|
||||
Running: false, /*空调运行状态,0/停止,1/运行*/
|
||||
SettingTemp: 0, /*设定温度*/
|
||||
Speed: 0, /*风速:0/停止, 1/低速, 2/中速, 3/高速, 4/自动*/
|
||||
HightTemp: 35, /*最高温度*/
|
||||
LowerTemp: 16, /*最低温度*/
|
||||
Mode: 5, /*模式: 1/制冷模式,2/制热模式,4/送风模式,8/除湿模式*/
|
||||
hostAir: null,
|
||||
airClick: function (index) {
|
||||
if (vm.currentIndex == index) {
|
||||
return;
|
||||
}
|
||||
|
||||
vm.airId = vm.air[index].RoomTypeAirID;
|
||||
vm.hostId = vm.air[index].HostID;
|
||||
vm.currentIndex = index;
|
||||
|
||||
LoadAirControl(vm.hostId, vm.airId, function (r) {
|
||||
if (r != null) {
|
||||
vm.Running = r.Running;
|
||||
vm.SettingTemp = r.SettingTemp;
|
||||
vm.Speed = r.Speed;
|
||||
vm.HightTemp = r.HightTemp;
|
||||
vm.LowerTemp = r.LowerTemp;
|
||||
vm.Mode = r.Mode;
|
||||
}
|
||||
});
|
||||
}, settingAirClick: function (type, val) {
|
||||
if (vm.currentIndex == -1) {
|
||||
return;
|
||||
}
|
||||
var status = 0;
|
||||
if (type == 'OnOff') {
|
||||
vm.Running = !vm.Running;
|
||||
status = vm.Running ? 1 : 0;
|
||||
} else if (type == 'SettingTemp') {
|
||||
if (val == '+') {
|
||||
if (vm.HightTemp >= vm.SettingTemp) {
|
||||
vm.SettingTemp = vm.SettingTemp + 1;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (val == '-') {
|
||||
if (vm.LowerTemp <= vm.SettingTemp) {
|
||||
vm.SettingTemp = vm.SettingTemp - 1;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
status = vm.SettingTemp;
|
||||
} else if (type == 'Mode') {
|
||||
vm.Mode = val;
|
||||
status = vm.Mode;
|
||||
} else if (type == 'Speed') {
|
||||
vm.Speed = val;
|
||||
status = vm.Speed;
|
||||
}
|
||||
setAirCondition(vm.hostId, vm.airId, type, status, function (r) {
|
||||
if (!r.IsSuccess) {
|
||||
showTip(r.Message);
|
||||
}
|
||||
hideLoading();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function LoadAirControl(hostID, roomTypeAirID, callback) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: '/App/LoadAirSetting/',
|
||||
data: { hostId: hostID, airId: roomTypeAirID },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: callback
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: "/App/LoadAirCondition/",
|
||||
data: { roomNumber: RoomConfig.RoomNumber },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
vm.air = r;
|
||||
if (vm.air.length > 0) {
|
||||
vm.airId = vm.air[0].RoomTypeAirID;
|
||||
vm.hostId = vm.air[0].HostID;
|
||||
vm.currentIndex = 0;
|
||||
|
||||
LoadAirControl(vm.hostId, vm.airId, function (r) {
|
||||
if (r != null) {
|
||||
vm.Running = r.Running;
|
||||
vm.SettingTemp = r.SettingTemp;
|
||||
vm.Speed = r.Speed;
|
||||
vm.HightTemp = r.HightTemp;
|
||||
vm.LowerTemp = r.LowerTemp;
|
||||
vm.Mode = r.Mode;
|
||||
}
|
||||
hideLoading();
|
||||
});
|
||||
}
|
||||
hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="air-panel" ms-controller="air-panel">
|
||||
<div>
|
||||
<ul class="air-list-panel clearfix">
|
||||
<li ms-repeat="air"><a href="javascript:void(0)" class="air-btn air-btn-air" ms-class="{{$index == currentIndex? 'selected':''}}"
|
||||
ms-click='airClick($index)'>{{el.Name}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="temp-panel">
|
||||
<div class="top clearfix">
|
||||
<a href="javascript:void(0)" class="air-btn air-btn-power " ms-class="{{Running ? 'selected':''}}"
|
||||
ms-click="settingAirClick('OnOff','')"><span class="air-btn-icon air-btn-icon-power">
|
||||
</span></a>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="air-btn air-btn-temp-down" ms-click="settingAirClick('SettingTemp','-')">
|
||||
<</a>
|
||||
<div class="air-temp">
|
||||
<div style="position: absolute;right: 42%;"><em>℃</em> </div>
|
||||
<span><i>SET</i> <strong>{{SettingTemp}}</strong></span>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="air-btn air-btn-temp-up" ms-click="settingAirClick('SettingTemp','+')">
|
||||
></a>
|
||||
<div class="air-mode-panel">
|
||||
<a href="javascript:void(0)" class="air-btn air-btn-mode-cold" ms-class="{{Mode == 1 ? 'selected':''}}"
|
||||
ms-click="settingAirClick('Mode','1')"><span class="air-btn-icon air-btn-icon-mode-cold">
|
||||
</span></a><a href="javascript:void(0)" class="air-btn air-btn-mode-hot" ms-class="{{Mode == 2 ? 'selected':''}}"
|
||||
ms-click="settingAirClick('Mode','2')"><span class="air-btn-icon air-btn-icon-mode-hot">
|
||||
</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="air-divbtn clearfix">
|
||||
<a href="javascript:void(0)" ms-class="{{Speed == 4 ? 'air-auto-open':'air-auto-close'}}">
|
||||
<span ms-click="settingAirClick('Speed','4')" style=" position: relative;">
|
||||
<i style="position: absolute;bottom: 0;font-style: normal;">AUTO</i>
|
||||
</span> </a>
|
||||
<a href="javascript:void(0)">
|
||||
<span ms-class="{{Speed == 1 ? 'air-low-open':'air-low-close'}}" ms-click="settingAirClick('Speed','1')">
|
||||
</span></a>
|
||||
<a href="javascript:void(0)"><span ms-class="{{Speed == 2 ? 'air-middle-open':'air-middle-close'}}"
|
||||
ms-click="settingAirClick('Speed','2')"></span></a><a href="javascript:void(0)"><span
|
||||
ms-class="{{Speed == 3 ? 'air-high-open':'air-high-close'}}" ms-click="settingAirClick('Speed','3')">
|
||||
</span></a>
|
||||
</div>
|
||||
</div>
|
||||
102
WebSite/Views/App/CurtainControl.ascx
Normal file
102
WebSite/Views/App/CurtainControl.ascx
Normal file
@@ -0,0 +1,102 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/control.css" />
|
||||
<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/Scripts/avalon.mobile.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var vm = avalon.define({
|
||||
$id: 'curtain',
|
||||
curtainMsg: [],
|
||||
gauzeMsg: [],
|
||||
groupAddress: '',
|
||||
Status: '',
|
||||
curtainClick: function (curtainModal, curtain) {
|
||||
if (curtainModal.Status != 0) {
|
||||
curtain.CurtainOpen.Status = 0;
|
||||
curtain.CurtainClose.Status = 0;
|
||||
} else {
|
||||
curtain.CurtainOpen.Status = 0;
|
||||
curtain.CurtainClose.Status = 0;
|
||||
curtainModal.Status = 1;
|
||||
}
|
||||
setCurtain(curtain.CurtainOpen.Address, 0);
|
||||
setCurtain(curtain.CurtainClose.Address, 0);
|
||||
setCurtain(curtainModal.Address, curtainModal.Status);
|
||||
}
|
||||
});
|
||||
|
||||
function setCurtain(groupAddress, status, callback) {
|
||||
$.ajax({
|
||||
url: '/App/CurtainControl/',
|
||||
type: 'POST',
|
||||
async: false,
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
roomNumber: RoomConfig.RoomNumber,
|
||||
GroupAddress: groupAddress,
|
||||
Status: status
|
||||
},
|
||||
success: callback || function (r) {
|
||||
hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: "/App/LoadCurtain/",
|
||||
data: { roomNumber: RoomConfig.RoomNumber, deviceType: 'Curtain' },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
hideLoading();
|
||||
if (r.IsSuccess) {
|
||||
vm.curtainMsg = r.Data;
|
||||
} else {
|
||||
showTip(r.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "/App/LoadCurtain/",
|
||||
data: { roomNumber: RoomConfig.RoomNumber, deviceType: 'Gauze' },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
if (r.IsSuccess) {
|
||||
vm.gauzeMsg = r.Data;
|
||||
} else {
|
||||
showTip(r.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div id="cmain" ms-controller="curtain">
|
||||
<dl id="curtain" class="curtain cmain-list clearfix">
|
||||
<dd ms-repeat="curtainMsg">
|
||||
<a href="javascript:void(0)" class="btn-curtain-open" ms-class="active:(el.CurtainOpen.Status!=0)"
|
||||
ms-click='curtainClick(el.CurtainOpen,el)'>
|
||||
<label class="curtain-span">
|
||||
{{el.CurtainOpen.Name}}</label></a><a href="javascript:void(0)" class="btn-curtain-close"
|
||||
ms-class="active:(el.CurtainClose.Status!=0)" ms-click='curtainClick(el.CurtainClose,el)'><label
|
||||
class="curtain-span">
|
||||
{{el.CurtainClose.Name}}</label>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl id="Gauze" class="curtain cmain-list clearfix">
|
||||
<dd ms-repeat="gauzeMsg">
|
||||
<a href="javascript:void(0)" class="btn-windowScreening-open" ms-class="active:(el.CurtainOpen.Status!=0)"
|
||||
ms-click='curtainClick(el.CurtainOpen,el)'>
|
||||
<label class="curtain-span">
|
||||
{{el.CurtainOpen.Name}}</label></a> <a href="javascript:void(0)" class="btn-windowScreening-close"
|
||||
ms-class="active:(el.CurtainClose.Status!=0)" ms-click='curtainClick(el.CurtainClose,el)'>
|
||||
<label class="curtain-span">
|
||||
{{el.CurtainClose.Name}}</label></a>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
21
WebSite/Views/App/Header.ascx
Normal file
21
WebSite/Views/App/Header.ascx
Normal file
@@ -0,0 +1,21 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<div id="logo">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div id="room-number"> <%: ViewData["RoomNumber"] %></div>
|
||||
<hr />
|
||||
<div id="datetime">
|
||||
<div id="txtTime" class="time">
|
||||
</div>
|
||||
<div class="date">
|
||||
<i><%: ViewData["Date"]%></i>
|
||||
<em><%: ViewData["Week"]%></em>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="temp">
|
||||
<i> </i>
|
||||
<em>℃</em>
|
||||
<strong><%: ViewData["Temp"]%></strong>
|
||||
</div>
|
||||
</div>
|
||||
15
WebSite/Views/App/HotelIntroduction.ascx
Normal file
15
WebSite/Views/App/HotelIntroduction.ascx
Normal file
@@ -0,0 +1,15 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/hotel.css" />
|
||||
<div style=" width: 100%;height: 100%;padding-top: 10%; /* width: 90%; */overflow: auto;overflow-y: auto;">
|
||||
<dl class="hotel-dl">
|
||||
<dt class="hotel-dt"><strong class="hotel-strong" style="margin-left: 15px;">
|
||||
<%: ViewData["HoteName"] %></strong></dt>
|
||||
<dd class="hotel-dt">
|
||||
<hr />
|
||||
</dd>
|
||||
<dd class="hotel-dd">
|
||||
<%-- <textarea name="textarea" class="hotel-strong" disabled="disabled"><%: ViewData["Introduction"]%></textarea>--%>
|
||||
<%-- <span class="hotel-strong">--%><%: ViewData["Introduction"]%><%--</span>--%>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
197
WebSite/Views/App/Index.aspx
Normal file
197
WebSite/Views/App/Index.aspx
Normal file
@@ -0,0 +1,197 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
|
||||
|
||||
<%@ Import Namespace="Domain" %>
|
||||
<%
|
||||
List<AppMenu> AppMenus = ViewData["AppMenuControl"] as List<AppMenu>;
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
<title>App</title>
|
||||
<style type="text/css">
|
||||
html, body
|
||||
{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.align-center
|
||||
{
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/common.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/header.css" />
|
||||
<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/Scripts/app/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
var isCloseLoading = 0;
|
||||
|
||||
var RoomConfig = {
|
||||
RoomNumber: '<%: ViewData["RoomNumber"] %>',
|
||||
ServiceControlUrl: '/App/ServiceControl/?RoomNumber=<%: ViewData["RoomNumber"] %>',
|
||||
LightControlUrl: '/App/LightControl/?RoomNumber=<%: ViewData["RoomNumber"] %>',
|
||||
AirConditionControlUrl: '/App/AirConditionControl/?RoomNumber=<%: ViewData["RoomNumber"] %>',
|
||||
CurtainControlUrl: '/App/CurtainControl/?RoomNumber=<%: ViewData["RoomNumber"] %>',
|
||||
SceneUrl: '/App/Scene/?RoomNumber=<%: ViewData["RoomNumber"] %>',
|
||||
TelevisionUrl: '/App/Television/?RoomNumber=<%: ViewData["RoomNumber"] %>',
|
||||
HotelUrl: '/App/HotelIntroduction/',
|
||||
AboutUrl: '/App/About/'
|
||||
};
|
||||
|
||||
function sendServiceStatus(groupAddress, status) {
|
||||
$.ajax({
|
||||
url: RoomConfig.ServiceControlUrl,
|
||||
data: { GroupAddress: groupAddress, Status: status },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
if (!r.IsSuccess) {
|
||||
showMsg("", "操作失败," + r.Message);
|
||||
}
|
||||
//hideLoading();
|
||||
isCloseLoading = 1;
|
||||
},
|
||||
error: function () {
|
||||
hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ServiceSetClick(code, status) {
|
||||
showLoading();
|
||||
isCloseLoading = 0;
|
||||
//$("#" + code).attr("class", code + " " + (status ? "" : "active"));
|
||||
sendServiceStatus(code, (status ? '0' : "1"));
|
||||
}
|
||||
|
||||
function timeRefreshService() {
|
||||
$.ajax({
|
||||
url: "/App/LoadAlarm/",
|
||||
data: { roomNumber: RoomConfig.RoomNumber },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
$('#services').html("");
|
||||
var strHtml = "";
|
||||
for (var i = 0; i < r.length; i++) {
|
||||
var active = (r[i].Status ? "active" : "");
|
||||
strHtml += "<li><a id='" + r[i].Code + "' onclick=ServiceSetClick('" + r[i].Code + "'," + r[i].Status + ") ";
|
||||
strHtml += "class='" + r[i].Code + " " + active + "' href='javascript:void(0);'></a><span>" + r[i].Name + "</span></li>";
|
||||
}
|
||||
$('#services').html(strHtml);
|
||||
|
||||
|
||||
strHtml = null;
|
||||
if (isCloseLoading) { hideLoading(); }
|
||||
setTimeout('timeRefreshService()', 1000);
|
||||
},
|
||||
error: function () {
|
||||
setTimeout('timeRefreshService()', 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showLoading() {
|
||||
$('#loading').show();
|
||||
}
|
||||
function hideLoading() {
|
||||
$('#loading').hide();
|
||||
}
|
||||
function showMsg(title, content) {
|
||||
$('#msg')
|
||||
.find(".dialog-content-title").html(title || "").end()
|
||||
.find(".dialog-content-text").html(content || "").end()
|
||||
.fadeIn("fast");
|
||||
setTimeout(function () { hideMsg(); }, 3000);
|
||||
}
|
||||
|
||||
function hideMsg() {
|
||||
$("#msg").fadeOut("fast");
|
||||
}
|
||||
|
||||
function go(obj, roomNumber) {
|
||||
$("#content").html("").load(obj + "?RoomNumber=" + roomNumber);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#nav-menu li").click(function () {
|
||||
$("#nav-menu li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
|
||||
$("#content").load(RoomConfig.HotelUrl);
|
||||
|
||||
timeRefreshService();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="startTime()">
|
||||
<section id="main">
|
||||
<header><% Html.RenderPartial("Header"); %></header>
|
||||
<nav id="nav">
|
||||
<ul id="nav-menu">
|
||||
<% foreach (var item in AppMenus) { %>
|
||||
<li>
|
||||
<a href="javascript:void(0)" onclick='go("<%=item.Url %>","<%: ViewData["RoomNumber"] %>")'>
|
||||
<i style='background: url(../../<%=item.Icon %>) no-repeat center center;'></i>
|
||||
<% if (Request.Cookies["isCN"].Value == "zh-cn") { %>
|
||||
<em class="text"> <%=item.Name %></em>
|
||||
<% } else { %>
|
||||
<em class="text"> <%=item.EnglishName %></em>
|
||||
<% } %>
|
||||
</a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</nav>
|
||||
<section id="content" class="content"></section>
|
||||
<footer>
|
||||
<div>
|
||||
<a id="CN" href="javascript:void(0)" onclick="switchLanuage('cn')">
|
||||
<% if (Request.Cookies["isCN"].Value == "zh-cn") { %>
|
||||
<span class="CLanguageActive">中文</span>
|
||||
<% } else { %>
|
||||
<span class="CLanguage">中文</span>
|
||||
<%} %>
|
||||
</a>
|
||||
<a id="EN" href="javascript:void(0)" onclick="switchLanuage('en')">
|
||||
<% if (Request.Cookies["isCN"].Value == "zh-cn") { %>
|
||||
<span class="ELanguage">English</span>
|
||||
<% } else { %>
|
||||
<span class="ELanguageActive">English</span>
|
||||
<% } %>
|
||||
</a>
|
||||
</div>
|
||||
<ul id="services" class="clearfix">
|
||||
<%--<li ms-repeat="Alarm">
|
||||
<a id='{{el.Code}}' ms-click="ServiceSetClick($index)" ms-class='{{el.Code}} {{el.Status ? "active" : ""}}' href="javascript:void(0)"></a>
|
||||
<span>{{el.Name}}</span>
|
||||
</li>--%>
|
||||
</ul>
|
||||
</footer>
|
||||
<div id="loading" class="loading" style="display:none;">
|
||||
<div class="mask"></div>
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<%--<div id="tip" class="tip">
|
||||
<div class="mask"></div>
|
||||
<span class="content">aaaaaa</span>
|
||||
</div>--%>
|
||||
<div id="msg" class="dialog" style="display:none;">
|
||||
<div class="dialog-inner">
|
||||
<a href="javascript:void(0)" class="dialog-close" onclick="$('#msg').fadeOut('fast');">×</a>
|
||||
<div class="dialog-content">
|
||||
<h1 class="dialog-content-title"></h1>
|
||||
<p class="dialog-content-text"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
165
WebSite/Views/App/LightControl.ascx
Normal file
165
WebSite/Views/App/LightControl.ascx
Normal file
@@ -0,0 +1,165 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<%@ Import Namespace="WebSite.Controllers" %>
|
||||
<%
|
||||
List<Light> lightList = ViewData["LightList"] as List<Light>;
|
||||
List<Light> LightDimmerList = ViewData["LightDimmerList"] as List<Light>;
|
||||
%>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
<meta http-equiv="cache-control" content="max-age=0" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/control.css" />
|
||||
<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/Scripts/avalon.mobile.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function setBrightness(groupAddress, status, callback) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: RoomConfig.LightControlUrl,
|
||||
type: 'POST',
|
||||
async: false,
|
||||
dataType: 'JSON',
|
||||
data: { GroupAddress: groupAddress, Status: status },
|
||||
success: callback || function (r) {
|
||||
hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var vm = avalon.define({
|
||||
$id: 'Dimmer',
|
||||
setStatus: '0',
|
||||
status: 0,
|
||||
groupAddress: '',
|
||||
lightDimmer: [],
|
||||
currentIndex: 0,
|
||||
BrightnessClick: function (index) {
|
||||
vm.currentIndex = index;
|
||||
vm.setStatus = vm.lightDimmer[index].Status + '%';
|
||||
vm.status = vm.lightDimmer[index].Status;
|
||||
vm.groupAddress = vm.lightDimmer[index].GroupAddress;
|
||||
$("#trackBar").val(vm.status);
|
||||
var status = $(this).hasClass("active") ? 1 : 0;
|
||||
$("#divYS dd a").removeClass("active");
|
||||
if (status == 0) {
|
||||
$("#divYS dt").removeClass("no-active");
|
||||
$(this).toggleClass("active");
|
||||
//var groupAddress = $(this).attr("group-address");
|
||||
} else {
|
||||
$("#divYS dt").toggleClass("no-active");
|
||||
}
|
||||
},
|
||||
LightDimmerClick: function (val) {
|
||||
if (val == 'minus') {
|
||||
if (vm.status == 0) {
|
||||
return;
|
||||
}
|
||||
if ((vm.status - 1) < 0) {
|
||||
return;
|
||||
}
|
||||
vm.status = parseInt(vm.status) - 1;
|
||||
|
||||
} else if (val == 'add') {
|
||||
if (vm.status == 100) {
|
||||
return;
|
||||
}
|
||||
if ((vm.status + 1) > 100) {
|
||||
return;
|
||||
}
|
||||
vm.status = parseInt(vm.status) + 1;
|
||||
}
|
||||
|
||||
$("#trackBar").val(vm.status);
|
||||
vm.setStatus = vm.status + '%';
|
||||
vm.lightDimmer[vm.currentIndex].Status = vm.status;
|
||||
setBrightness(vm.groupAddress, vm.status, function (r) {
|
||||
hideLoading();
|
||||
if (!r.IsSuccess) {
|
||||
showTip(r.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
trackBar.addEventListener("change", function () {
|
||||
vm.status = this.value;
|
||||
vm.setStatus = vm.status + '%';
|
||||
vm.lightDimmer[vm.currentIndex].Status = vm.status;
|
||||
setBrightness(vm.groupAddress, vm.status, function (r) {
|
||||
hideLoading();
|
||||
if (!r.IsSuccess) {
|
||||
showTip(r.Message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function setLightStatus(groupAddress, status) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: RoomConfig.LightControlUrl,
|
||||
data: { GroupAddress: groupAddress, Status: status },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
hideLoading();
|
||||
if (!r.IsSuccess) {
|
||||
showTip(r.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#divWS dd a").click(function () {
|
||||
$(this).toggleClass("active");
|
||||
var groupAddress = $(this).attr("group-address");
|
||||
var status = $(this).hasClass("active") ? 1 : 0;
|
||||
setLightStatus(groupAddress, status);
|
||||
});
|
||||
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: "/App/LoadLightDimmer/",
|
||||
data: { roomNumber: RoomConfig.RoomNumber },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
vm.lightDimmer = r;
|
||||
hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="cmain">
|
||||
<dl id="divWS" class="cmain-list light-list clearfix">
|
||||
<% foreach (var item in lightList)
|
||||
{ %>
|
||||
<dd>
|
||||
<a href="javascript:void(0)" group-address='<%=item.ModalAddress %>' class='light-deng <%=item.Status != 0 ? "active":"" %>'>
|
||||
</a> <span class="light-deng-ptspan">
|
||||
<%=item.Name %></span></dd>
|
||||
<% } %>
|
||||
</dl>
|
||||
<dl id="divYS" class="cmain-list light-list clearfix" ms-controller="Dimmer">
|
||||
<div class="fd">
|
||||
<dt class="light-tiaoguan-bj no-active">
|
||||
<div>
|
||||
<a class="tiaoguang-minus" href="javascript:void(0)" ms-click="LightDimmerClick('minus')"><span>-</span></a>
|
||||
<div class="Bar">
|
||||
<input type="range" id="trackBar" min="0" max="100" step="1" />
|
||||
<span>{{ setStatus }} </span>
|
||||
</div>
|
||||
<a class="tiaoguang-add" href="javascript:void(0)" ms-click="LightDimmerClick('add')"><span>+</span></a>
|
||||
</div>
|
||||
</dt>
|
||||
</div>
|
||||
<dd ms-repeat="lightDimmer">
|
||||
<a href="javascript:void(0)" ms-click='BrightnessClick($index)' class='light-tiaoguang'>
|
||||
<span class="light-deng-count">{{el.Status}}</span></a> <span class="light-deng-span">{{el.Name}}</span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
56
WebSite/Views/App/Scene.ascx
Normal file
56
WebSite/Views/App/Scene.ascx
Normal file
@@ -0,0 +1,56 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<%@ Import Namespace="Domain" %>
|
||||
<%
|
||||
List<RoomTypeScene> AppScenes = ViewData["AppSceneControl"] as List<RoomTypeScene>;
|
||||
%>
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/control.css" />
|
||||
<script type="text/javascript">
|
||||
|
||||
function setScene(scene) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
url: RoomConfig.SceneUrl,
|
||||
data: { SceneID: scene },
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
success: function (r) {
|
||||
hideLoading();
|
||||
if (!r.IsSuccess) {
|
||||
showTip(r.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#sence dd a").click(function () {
|
||||
$("#sence dd").removeClass("active");
|
||||
$(this).parent().addClass("active");
|
||||
$("#sence dt").html($(this).attr("title") + "模式已开启");
|
||||
setScene($(this).attr("scene"));
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<div id="cmain">
|
||||
<dl id="sence" class="cmain-list clearfix">
|
||||
<% foreach (var item in AppScenes)
|
||||
{
|
||||
%>
|
||||
<dd>
|
||||
<a href="javascript:void(0)" style='background-image: url(../../<%= item.Icon %>);background-size: 100% 100%;'
|
||||
scene='<%=item.ID %>'>
|
||||
<% if (Request.Cookies["isCN"].Value.ToString() == "zh-cn")
|
||||
{ %>
|
||||
<span>
|
||||
<%=item.Name %> </span>
|
||||
<% }
|
||||
else
|
||||
{ %>
|
||||
<span>
|
||||
<%=item.EnglishName %></span>
|
||||
<% } %>
|
||||
</a>
|
||||
</dd>
|
||||
<% } %>
|
||||
</dl>
|
||||
</div>
|
||||
9
WebSite/Views/App/SystemSetting.ascx
Normal file
9
WebSite/Views/App/SystemSetting.ascx
Normal file
@@ -0,0 +1,9 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/control.css" />
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
<div id="cmain">
|
||||
系统设置
|
||||
</div>
|
||||
|
||||
64
WebSite/Views/App/Television.ascx
Normal file
64
WebSite/Views/App/Television.ascx
Normal file
@@ -0,0 +1,64 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
|
||||
<%@ Import Namespace="Domain" %>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/Styles/app/tv.css" />
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#tv-panel a').click(function () {
|
||||
$.ajax({
|
||||
url: '/App/Television',
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
RoomNumber: RoomConfig.RoomNumber,
|
||||
TvModalId: $('#hfTvModalId').val(),
|
||||
Key: $(this).attr('key')
|
||||
},
|
||||
success: function (r) {
|
||||
if (!r.IsSuccess) {
|
||||
showTip(r.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#menu li a').click(function () {
|
||||
$(this).parents('ul').find('.selected').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="tv-panel">
|
||||
<div class="top clearfix">
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-power" key='<%: TvKey.Power.ToString() %>'></a>
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-mute" key='<%: TvKey.Mute.ToString() %>'></a>
|
||||
</div>
|
||||
<div class="middle clearfix">
|
||||
<div class="tv-key-channel-panel">
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-channel-inc" key='<%: TvKey.ChannelInc.ToString() %>'>+</a>
|
||||
CH
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-channel-dec" key='<%: TvKey.ChannelDec.ToString() %>'>-</a>
|
||||
</div>
|
||||
|
||||
<div class="tv-key-dir-panel">
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-dir-left" key='<%: TvKey.Left.ToString() %>'></a>
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-dir-up" key='<%: TvKey.Up.ToString() %>'></a>
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-dir-ok" key='<%: TvKey.Ok.ToString() %>'>OK</a>
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-dir-right" key='<%: TvKey.Right.ToString() %>'></a>
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-dir-bottom" key='<%: TvKey.Down.ToString() %>'></a>
|
||||
</div>
|
||||
|
||||
<div class="tv-key-voice-panel">
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-voice-inc" key='<%: TvKey.VoiceInc.ToString() %>'>+</a>
|
||||
VOL
|
||||
<a href="javascript:void(0)" class="tv-key tv-key-voice-dec" key='<%: TvKey.VoiceDec.ToString() %>'>-</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="bottom clearfix">
|
||||
<li><a href="javascript:void(0)" class="tv-key tv-key-home" key='<%: TvKey.Home.ToString() %>'></a></li>
|
||||
<li><a href="javascript:void(0)" class="tv-key tv-key-menu" key='<%: TvKey.Menu.ToString() %>'></a></li>
|
||||
<li><a href="javascript:void(0)" class="tv-key tv-key-source" key='<%: TvKey.Source.ToString() %>'></a></li>
|
||||
<li><a href="javascript:void(0)" class="tv-key tv-key-replay" key='<%: TvKey.Replay.ToString() %>'></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user