Commit 469a3338 authored by 吴春's avatar 吴春

取票功能

parent 81e313fe
......@@ -80,11 +80,13 @@ namespace EheMall.Admin.PermissionService.Initialize
_eventBus.Subscribe<MsgDeleteCommand>(new SysMessageHandler());
//短信
this._eventBus.Subscribe<CheckCodeSendCommand>(new PhoneMsgHandler());
this._eventBus.Subscribe<PhoneMsgVerifyCommand>(new PhoneMsgHandler());
this._eventBus.Subscribe<PhoneMsgUpdateCommand>(new PhoneMsgHandler());
this._eventBus.Subscribe<SendMsgCommand>(new SendMsgHandler());
//系统设置
this._eventBus.Subscribe<SystemSettingUpdateCommand>(new SystemSettingHandler());
......
......@@ -37,16 +37,23 @@ namespace EheMall.Business.Handlers
public void HandleEvent(MemberUpdatePWCommand eventData)
{
var entity = this._service.Get(eventData.ID);
if (!string.IsNullOrWhiteSpace(eventData.PassWord))
var msg = new PhoneMsgVerifyCommand() { sCode = eventData.SecurityCode, sPhone = eventData.MobilePhone, iType = eventData.Type };
this._eventBus.Publish(msg);
if (msg.bResult)
{
entity.PassWord = eventData.PassWord.Trim().MD5();
}
if (!string.IsNullOrWhiteSpace(eventData.MobilePhone)) {
entity.MobilePhone = eventData.MobilePhone;
var entity = this._service.Get(eventData.ID);
if (!string.IsNullOrWhiteSpace(eventData.PassWord))
{
entity.PassWord = eventData.PassWord.Trim().MD5();
}
if (!string.IsNullOrWhiteSpace(eventData.MobilePhone))
{
entity.MobilePhone = eventData.MobilePhone;
}
var data = _repository.Update(entity);
this._unitOfWork.Commit();
}
var data = _repository.Update(entity);
this._unitOfWork.Commit();
}
/// <summary>
......@@ -62,7 +69,8 @@ namespace EheMall.Business.Handlers
{
entity.PassWord = Password;
}
else {
else
{
entity.PassWord = entity.PassWord.Trim().MD5();
}
var data = _repository.Update(entity);
......
......@@ -18,6 +18,8 @@ namespace EheMall.Business.Handlers
/// 验证类短信发送及验证
/// </summary>
public class PhoneMsgHandler : ICommandHandlers,
IEventHandler<CheckCodeSendCommand>,
IEventHandler<PhoneMsgVerifyCommand>,
IEventHandler<PhoneMsgUpdateCommand>
{
[AutofacResolve]
......@@ -197,26 +199,25 @@ namespace EheMall.Business.Handlers
eventData.bResult = bResult;
eventData.sMessage = "手机号码不存在";
}
TypeStr = "SMS_132045009";
TypeStr = "SMS_150170938";
}
if (bResult)
{
string sCode = StringExtensions.GenerateRandomDigitCode(5);
try
{
Business.Services.SMSService.SendCode(eventData.sPhone, eventData.sCode, TypeStr);
// Business.Services.SMSService.SendCode(eventData.sPhone, sCode, TypeStr);
var entity = eventData.Map<EHECD_PhoneMsg>();
entity.sCode = sCode;
//entity.sCode = sCode;
entity.dAddTime = DateTime.Now;
entity.dExpireTime = DateTime.Now.AddMinutes(3);
entity.sIp = Helpers.CommonHelper.GetIp();
eventData.bResult = bResult;
eventData.sCode = sCode;
var log = _repository.Insert(entity);
this.WriteLog(log, _unitOfWork.Commit());
eventData.sCode = "";
}
catch (Exception)
catch (Exception ex)
{
eventData.bResult = false;
eventData.sMessage = "短信发送失败";
......@@ -256,6 +257,95 @@ namespace EheMall.Business.Handlers
#endregion
}
/// <summary>
/// 验证码验证(不修改验证码的状态)
/// </summary>
/// <param name="eventData"></param>
public void HandleEvent(PhoneMsgVerifyCommand eventData)
{
#region 验证码验证(不修改验证码的状态)
//验证码类型 iType 1001 - 修改密码;1002 - 修改手机号码;1003 - 通知剧场人员;1004 - 下单发短信
//返回的信息 --1:注册成功 2:手机号码已存在 3:验证码已过期 4:验证码无效
string sPhone = eventData.sPhone.Trim();
Dictionary<string, object> paramsList = new Dictionary<string, object>();
paramsList["sPhone"] = sPhone;
Dictionary<string, object> conditionList = new Dictionary<string, object>();
conditionList["sPhone"] = sPhone;
conditionList["iType"] = eventData.iType;
conditionList["sCode"] = eventData.sCode;
var phoneMsg = phoneMsgService.GetPhoneMsg(conditionList);
if (phoneMsg == null)
{
eventData.bResult = false;
eventData.sMessage = "验证码无效";
}
else
{
if (eventData.iType == 1001)
{
var item = memberService.GetByPhone(sPhone);
#region 注册
if (item == null)
{
if (DateTime.Compare(phoneMsg.dExpireTime, DateTime.Now) >= 0)
{
eventData.bResult = true;
eventData.sMessage = "验证码验证成功";
}
else
{
eventData.bResult = false;
eventData.sMessage = "验证码已过期";
}
}
else
{
eventData.bResult = false;
eventData.sMessage = "手机号码已存在";
}
#endregion
}
else if (eventData.iType == 1002 || eventData.iType == 1003)
{
var item = memberService.GetByPhone(sPhone);
#region 登录密码、支付密码
if (item != null)
{
if (DateTime.Compare(phoneMsg.dExpireTime, DateTime.Now) >= 0)
{
eventData.bResult = true;
eventData.sMessage = "验证码验证成功";
}
else
{
eventData.bResult = false;
eventData.sMessage = "验证码已过期";
}
}
else
{
eventData.bResult = false;
eventData.sMessage = "手机号码不已存在";
}
#endregion
}
else if (eventData.iType == 1006)
{
if (DateTime.Compare(phoneMsg.dExpireTime, DateTime.Now) >= 0)
{
eventData.bResult = true;
eventData.sMessage = "验证码验证成功";
}
else
{
eventData.bResult = false;
eventData.sMessage = "验证码已过期";
}
}
}
#endregion
}
#region 发送短信时对手机号码的进行验证
/// <summary>
......
......@@ -73,6 +73,16 @@ namespace EheMall.Business.Handlers
item.OrderID = entity.ID;
_repositoryOrderSeat.Insert(item);
}
var msg = new CheckCodeSendCommand()
{
sCode = eventData.SucceedInfo + "下单成功,取票码:" + entity.CollectingTickets,
iType = 1004,
sPhone = eventData.Mobile,
sKey = Helpers.PhoneMsgHelper.GenerateKey()
};
Infrastructure.EngineContext.Current.ResolveOptional<Events.IEventBus>().Publish(msg);
this.WriteLog(data, _unitOfWork.Commit());
}
}
......@@ -160,8 +170,9 @@ namespace EheMall.Business.Handlers
public void HandleEvent(UpdateOrderStateCommand eventData)
{
var data = _repository.Get(eventData.ID);
var data = _repository.Get(eventData.OrderID);
data.OrderState = OrderStateEnum.Ticket;
_repository.Update(data);
this.WriteLog(data, _unitOfWork.Commit());
}
}
......
......@@ -183,6 +183,10 @@ left join Theater t on s.{nameof(Screening.TheaterId)}=t.ID)
{
sCondition.AppendFormat(" And s.StartTime >= '{0}'", inputs["StartTime"] + " " + System.DateTime.Now.ToString("HH:mm:ss"));
}
if (inputs.IsExitsAndNotEmpty("EndTime"))
{
sCondition.AppendFormat(" And s.StartTime <= '{0}'", inputs["EndTime"] + " 23:59:59");
}
sCondition.Append(" AND s.bIsDeleted=0 ");
var list = DBHelper.Query<Screening>($@"
select s.*,t.sName as TheaterName
......
......@@ -55,7 +55,13 @@ namespace EheMall.Models
CreateMap<PhoneMsgUpdateCommand, EHECD_PhoneMsg>()
.ForMember(des => des.iState, c => c.UseValue(0));
//短信
CreateMap<CheckCodeSendCommand, EHECD_PhoneMsg>()
.ForMember(des => des.dAddTime, c => c.UseValue(DateTime.Now))
.ForMember(des => des.iState, c => c.UseValue(1));
CreateMap<PhoneMsgUpdateCommand, EHECD_PhoneMsg>()
.ForMember(des => des.iState, c => c.UseValue(0));
//系统设置
CreateMap<SystemSettingUpdateCommand, EHECD_SystemSetting>();
......
......@@ -14,6 +14,8 @@ namespace EheMall.Models.Commands
get; set;
}
public int Type { get; set; }
public string SecurityCode { get; set; }
public string MobilePhone { get; set; }
......
......@@ -49,5 +49,7 @@ namespace EheMall.Models.Commands
/// 创建时间
/// </summary>
public DateTime UpdateDate { get; set; }
public int ExchangeTime { get; set; }
}
}
......@@ -44,5 +44,7 @@ namespace EheMall.Models.Commands
public string priceList { get; set; }
public string seatList { get; set; }
public int ExchangeTime { get; set; }
}
}
......@@ -18,7 +18,7 @@ namespace EheMall.Models
public string sCode { get; set; }
/// <summary>
/// 验证码类型 1001-注册;1002-找回登录密码;1003-设置支付密码;1004-找回支付密码;1006-修改手机号
/// 验证码类型 1001 - 修改密码;1002 - 修改手机号码;1003 - 通知剧场人员;1004 - 下单发短信
/// </summary>
public int iType { get; set; }
......
......@@ -67,5 +67,7 @@ namespace EheMall.Models.Commands
/// 订单座位
/// </summary>
public List<OrderSeat> OrderSeatList { get; set; }
public string SucceedInfo { get; set; }
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -60,6 +60,12 @@ namespace EheMall.Models
/// </summary>
public DateTime UpdateDate { get; set; }
/// <summary>
/// 取票时间
/// </summary>
[NotMapped]
public int ExchangeTime { get; set; }
#region 扩展字段
/// <summary>
......
......@@ -34,6 +34,13 @@
<input type="text" class="form-control" name="ShowTime" id="ShowTime" placeholder="分钟" />
</div>
</div>
<div class="form-group">
<label class="col-lg-1 control-label col-md-2 col-sm-2 left-css h-48 h-l-35 w-auto1">提前取票时间(分钟)</label>
<div class="col-lg-7 col-md-3 col-sm-3 right-css h-48">
<input type="text" class="form-control" name="ExchangeTime" id="ExchangeTime" placeholder="分钟" style=" width:70%; display: initial" />
<span>以本场开始时间为准,提前取票时间,0为不限</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-1 control-label col-md-2 col-sm-2 left-css h-48 h-l-35 w-auto1">发布状态</label>
<div class="col-lg-7 col-md-3 col-sm-3 right-css h-48">
......@@ -81,7 +88,7 @@
<div style="height: 40px;line-height: 40px;">座位设置 <span style="color:red;">温馨提示:所选的座位不能在线上销售</span></div>
<div id="SeatDiv">
</div>
<div class="form-group m-t-10">
<div class="col-lg-3 col-md-5 col-sm-5 text-center">
......@@ -235,6 +242,14 @@
}
}
},
ExchangeTime: {
validators: {
regexp: {
regexp: /^[1-9][0-9]*$/,
message: "提前取票时间不正确"
}
}
},
Status: {
validators: {
notEmpty: {
......
......@@ -28,6 +28,13 @@
<input type="text" class="form-control" name="StartTime" id="StartTime" readonly="readonly" value="@Model.StartTime" />
</div>
</div>
<div class="form-group">
<label class="col-lg-1 control-label col-md-2 col-sm-2 left-css h-48 h-l-35 w-auto1">提前取票时间(分钟)</label>
<div class="col-lg-7 col-md-3 col-sm-3 right-css h-48">
<input type="text" class="form-control" name="ExchangeTime" id="ExchangeTime" placeholder="分钟" value="@Model.ExchangeTime" style=" width:70%; display: initial" />
<span>以本场开始时间为准,提前取票时间,0为不限</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-1 control-label col-md-2 col-sm-2 left-css h-48 h-l-35 w-auto1">演出时长(分钟)</label>
<div class="col-lg-7 col-md-3 col-sm-3 right-css h-48">
......@@ -248,6 +255,14 @@
}
}
},
ExchangeTime: {
validators: {
regexp: {
regexp: /^[1-9][0-9]*$/,
message: "提前取票时间不正确"
}
}
},
Status: {
validators: {
notEmpty: {
......
......@@ -45,13 +45,14 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
{
return View();
}
public ActionResult ScreeningBind(string StartTime, string Name, int PageIndex, int iPageSize)
public ActionResult ScreeningBind(string StartTime, string EndTime, string Name, int PageIndex, int iPageSize)
{
JObject inputs = new JObject();
inputs["iPageIndex"] = (PageIndex + 1).ToString();
inputs["iPageSize"] = iPageSize.ToString();
inputs["sOrderBy"] = "StartTime desc";
inputs["StartTime"] = StartTime;
inputs["EndTime"] = EndTime;
inputs["Name"] = Name;
inputs["Status"] = 0;
long icount = 0;
......@@ -60,11 +61,12 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
}
public ActionResult GetTotalCount(string StartTime, string Name)
public ActionResult GetTotalCount(string StartTime, string EndTime, string Name)
{
JObject inputs = new JObject();
inputs["sOrderBy"] = "StartTime desc";
inputs["StartTime"] = StartTime;
inputs["EndTime"] = EndTime;
inputs["Status"] = 0;
inputs["Name"] = Name;
IEnumerable<Screening> list = _ScreeningService.GetListBy(inputs);
......@@ -221,6 +223,7 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
return View(TSList);
}
[HttpPost]
public ActionResult SaveOrder(AdminOrderCommand entity)
{
if (Request.IsAjaxRequest())
......@@ -417,5 +420,80 @@ namespace EheMall.Web.Areas.TicketMall.Controllers
public ActionResult ExchangeTicket()
{
return View();
}
#region 取票
public ActionResult ExchangeTicketBind(string StartTime, string EndTime, string Name, int PageIndex, int iPageSize)
{
JObject inputs = new JObject();
inputs["iPageIndex"] = (PageIndex + 1).ToString();
inputs["iPageSize"] = iPageSize.ToString();
inputs["sOrderBy"] = "StartTime desc";
inputs["StartTime"] = StartTime;
inputs["EndTime"] = EndTime;
inputs["Name"] = Name;
inputs["Status"] = 0;
long icount = 0;
IEnumerable<Screening> list = _ScreeningService.GetPageList(inputs, out icount);
return PartialView("_ExchangeTicket", list);
}
/// <summary>
/// 取票码
/// </summary>
/// <returns></returns>
public ActionResult CollectingTickets()
{
return View();
}
public ActionResult ExchangeDetails(string CollectingTickets)
{
TheaterOrder model = new TheaterOrder();
Theater theaterModel = new Theater();
Screening screeningModel = new Screening();
if (!string.IsNullOrWhiteSpace(CollectingTickets))
{
model = _TheaterOrderServices.GetOrderByCollectingTickets(CollectingTickets).FirstOrDefault();
model.OrderDetailList = new List<OrderDetail>();
model.OrderDetailList = _OrderDetailServices.GetListByArticleTypeID(model.ID).ToList();
theaterModel = _TheaterServices.Get(model.TheaterID);
screeningModel = _ScreeningService.Get(model.ScreeningID);
screeningModel.TheaterName = theaterModel.sName;
}
ViewBag.screeningModel = screeningModel;
return View(model);
}
[HttpPost]
public ActionResult UpdateOrderState(UpdateOrderStateCommand entity)
{
if (Request.IsAjaxRequest())
{
try
{
var model = _TheaterOrderServices.Get(entity.OrderID);
if (model.OrderState != OrderStateEnum.Normal)
{
return Json(new { valid = false, message = "当前订单" + Helpers.EnumHelper.GetEnumName(model.OrderState) });
}
entity.iLogUserId = LoginUser.ID;
entity.sLogUserName = LoginUser.sUserName;
this._eventBus.Publish(entity);
return Json(new { valid = true, message = "操作成功" });
}
catch (Exception ex)
{
return Json(new { valid = false, message = "操作失败" });
}
}
return View();
}
#endregion
}
}
\ No newline at end of file
......@@ -283,11 +283,12 @@
type: "post",
url: "@Url.Action("SendCode")",
data: { Type: type},
success: function (data) {
if (data.bResult) {
success: function (data) {
console.log(data);
if (data.Success) {
layer.msg('发送成功', { icon: 1 });
} else {
layer.msg(data.sMessage, { icon: 2 });
layer.msg(data.Messages.join(','), { icon: 2 });
}
}
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
<meta name="renderer" content="webkit">
<title>芙蓉国粹—抢票系统</title>
<meta name="keywords" content="芙蓉国粹—抢票系统" />
<meta name="description" content="芙蓉国粹—抢票系统" />
<link href="/Areas/TicketMall/Content/layui/css/layui.css" rel="stylesheet" />
<link rel="stylesheet" href="/Areas/TicketMall/Content/css/jquery.ui.css" />
<link href="/Areas/TicketMall/Content/css/public.css" rel="stylesheet" />
<link href="/Areas/TicketMall/Content/css/main.css" rel="stylesheet" />
<script src="/Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="/Areas/TicketMall/Content/js/jquery.ui.js"></script>
<script type="text/javascript" src="/Areas/TicketMall/Content/js/moment.min.js"></script>
<script src="/Areas/TicketMall/Content/js/layer/layer.js"></script>
<script src="/Areas/TicketMall/Content/layui/layui.js"></script>
<script src="~/Areas/TicketMall/Content/js/jquery.flexslider-min.js"></script>
<script src="~/Areas/TicketMall/Content/js/lib/jquery.pagination.js"></script>
<style>
.CollectTitle {
color: #333333;
font-weight: bold;
font-size: 16px;
margin: 30px 0;
}
.codeInput {
width: 310px;
height: 34px;
padding-left: 16px;
border: 1px solid #BBBBBB;
}
.TicketSureBtn {
width: 100px;
height: 34px;
background-color: #8C1324;
cursor: pointer;
margin-top: 30px;
color: #fff;
}
</style>
</head>
<body>
<!--头部-->
<header class="w1240 clearfix">
<div class="logo fl">
<a href="/TicketMall/SaleTheater/Index"><img src="/Areas/TicketMall/Content/Sp_img/logo.png" alt="芙蓉国粹—抢票系统"> </a>
</div>
<div class="codebox fr">
<ul>
<li>
<img src="/Areas/TicketMall/Content/Sp_img/201816040903.jpg" width="74" height="74" alt="" />
<span>关注公众号</span>
</li>
<li>
<img src="/Areas/TicketMall/Content/Sp_img/201816040903.jpg" width="74" height="74" alt="" />
<span>联系客服</span>
</li>
</ul>
</div>
</header>
<!--导航-->
<!--轮播图-->
<!--热门戏剧-->
<div class="w100 clearfix">
<div class="w1240">
<div class="CollectTitle">输入取票码</div>
<input type="text" placeholder="请输入取票码" class="codeInput" />
<div>
<input type="button" value="确认" class="TicketSureBtn" />
</div>
</div>
</div>
<div class="hotbox w100 clearfix">
<div class="fast w1240 pt35 clearfix">
<ul>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast01.png" width="52" height="52" alt="">
</div>
<div class="text fl">
<h3>Fast·01</h3>
<span><a href="#"> 快速选座购票/选票</a> </span>
</div>
</div>
</li>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast02.png" width="51" height="53" alt="">
</div>
<div class="text fl">
<h3>Fast·02</h3>
<span><a href="#">剧院出票/取票</a> </span>
</div>
</div>
</li>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast03.png" width="41" height="56" alt="">
</div>
<div class="text fl">
<h3>Fast·03</h3>
<span><a href="#"> 真票真戏/保障</a> </span>
</div>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>
<script type="text/javascript">
$(function () {
$(".TicketSureBtn").click(function () {
location.href = "/TicketMall/SaleTheater/ExchangeDetails?CollectingTickets=" + $(".codeInput").val();
});
});
</script>
\ No newline at end of file
@using EheMall.Models;
@using EheMall.Models.Models;
@model TheaterOrder
@{
Screening screening = ViewBag.screeningModel as Screening;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
<meta name="renderer" content="webkit">
<title>芙蓉国粹—抢票系统</title>
<meta name="keywords" content="芙蓉国粹—抢票系统" />
<meta name="description" content="芙蓉国粹—抢票系统" />
<link href="/Areas/TicketMall/Content/layui/css/layui.css" rel="stylesheet" />
<link rel="stylesheet" href="/Areas/TicketMall/Content/css/jquery.ui.css" />
<link href="/Areas/TicketMall/Content/css/public.css" rel="stylesheet" />
<link href="/Areas/TicketMall/Content/css/main.css" rel="stylesheet" />
<script src="/Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="/Areas/TicketMall/Content/js/jquery.ui.js"></script>
<script type="text/javascript" src="/Areas/TicketMall/Content/js/moment.min.js"></script>
<script src="/Areas/TicketMall/Content/js/layer/layer.js"></script>
<script src="/Areas/TicketMall/Content/layui/layui.js"></script>
<script src="~/Areas/TicketMall/Content/js/jquery.flexslider-min.js"></script>
<script src="~/Areas/TicketMall/Content/js/lib/jquery.pagination.js"></script>
<style>
.CollectTitle {
color: #333333;
font-weight: bold;
font-size: 16px;
margin: 30px 0;
}
.TDSureBtn {
width: 100px;
height: 34px;
background-color: #8C1324;
cursor: pointer;
margin-top: 30px;
color: #fff;
float: left;
}
.TDList {
width: 100%;
height: 127px;
border: 1px solid #DDDDDD;
}
.TD_info {
float: left;
}
.leftIMG {
float: left;
width: 82px;
height: 103px;
margin: 15px;
}
.leftIMG img {
width: 100%;
height: 100%;
}
.TD_left_right {
float: left;
margin-left: 20px;
}
.TD_title {
color: #393939;
font-size: 14px;
margin-top: 20px;
}
.TD_left_right div, .TD_right div {
margin-bottom: 10px;
}
.TD_comDetail {
color: #777777;
font-size: 12px;
}
.TD_right {
float: right;
margin: 15px;
}
.TD_Num {
margin-left: 5px;
color: #FF7800;
}
.TD_right div {
text-align: right;
}
.combig {
font-size: 14px;
font-weight: bold
}
</style>
</head>
<body>
<!--头部-->
<header class="w1240 clearfix">
<div class="logo fl">
<a href="/TicketMall/SaleTheater/Index"><img src="/Areas/TicketMall/Content/Sp_img/logo.png" alt="芙蓉国粹—抢票系统"> </a>
</div>
<div class="codebox fr">
<ul>
<li>
<img src="/Areas/TicketMall/Content/Sp_img/201816040903.jpg" width="74" height="74" alt="" />
<span>关注公众号</span>
</li>
<li>
<img src="/Areas/TicketMall/Content/Sp_img/201816040903.jpg" width="74" height="74" alt="" />
<span>联系客服</span>
</li>
</ul>
</div>
</header>
<!--我的产品-->
<div class="w100 clearfix">
<div class="w1240">
<div class="CollectTitle">票卷详情</div>
<div class="TDcontent">
<div class="TDList clearfix">
<div class="TD_info clearfix">
<div class="leftIMG">
<img src="@screening.Image" alt="" onerror="this.src='/Areas/TicketMall/Content/Sp_img/images-moren.png'">
</div>
<div class="TD_left_right">
<div class="TD_title"> @screening.Name</div>
<div class="TD_comDetail">时长:<text>@screening.ShowTime</text>分钟</div>
<div class="TD_comDetail">剧场:@screening.TheaterName</div>
<div class="TD_comDetail">场次:@screening.StartTime.ToString("yyyy-MM-dd HH:mm")</div>
</div>
</div>
<div class="TD_right">
<div>
共计<span class="TD_Num"><span class="combig">@Model.iBuyCount</span></span>
<span style="margin-left:30px;">
总价<span class="TD_Num">¥<span class="combig">@Model.TotalPrice.ToString("f2")</span></span>
</span>
</div>
@if (Model.OrderDetailList != null && Model.OrderDetailList.Any())
{
foreach (var item in Model.OrderDetailList)
{
if (item.ParticularlyNum > 0)
{
<div>特票:¥<text>@item.ParticularlyPrice</text>*<text>@item.ParticularlyNum</text></div>
}
if (item.FirstNum > 0)
{
<div>甲票:¥<text>@item.FirstPrice</text>*<text>@item.FirstNum</text></div>
}
if (item.ScondNum > 0)
{
<div>乙票:¥<text>@item.ScondPrice</text>*<text>@item.ScondNum</text></div>
}
if (item.ThirdNum > 0)
{
<div>丙票:¥<text>@item.ThirdPrice</text>*<text>@item.ThirdNum</text></div>
}
}
}
</div>
</div>
</div>
<div class="clearfix">
<input type="button" value="确认出票" class="TDSureBtn" />
</div>
</div>
<script src="../js/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$(".TDSureBtn").click(function () {
$.ajax({
type: "post",
url: "@Url.Action("UpdateOrderState")",
data: { "OrderID": '@Model.ID'},
success: function(data) {
if (data.valid) {
layer.msg('取票成功', {
icon: 1,//提示的样式
end: function () {
location.href = "@Url.Action("ExchangeTicket")";
}
});
} else {
$(this).prop("disable", false);
layer.msg(data.message, { icon: 2 });
}
}
});
});
});
</script>
</div>
<div class="hotbox w100 clearfix">
<div class="fast w1240 pt35 clearfix">
<ul>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast01.png" width="52" height="52" alt="">
</div>
<div class="text fl">
<h3>Fast·01</h3>
<span><a href="#"> 快速选座购票/选票</a> </span>
</div>
</div>
</li>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast02.png" width="51" height="53" alt="">
</div>
<div class="text fl">
<h3>Fast·02</h3>
<span><a href="#">剧院出票/取票</a> </span>
</div>
</div>
</li>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast03.png" width="41" height="56" alt="">
</div>
<div class="text fl">
<h3>Fast·03</h3>
<span><a href="#"> 真票真戏/保障</a> </span>
</div>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>
@*<script type="text/javascript">
$(function () {
$(".TicketSureBtn").click(function () {
location.href = "";
});
});
</script>*@
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
<meta name="renderer" content="webkit">
<title>芙蓉国粹—抢票系统</title>
<meta name="keywords" content="芙蓉国粹—抢票系统" />
<meta name="description" content="芙蓉国粹—抢票系统" />
<link href="/Areas/TicketMall/Content/layui/css/layui.css" rel="stylesheet" />
<link rel="stylesheet" href="/Areas/TicketMall/Content/css/jquery.ui.css" />
<link href="/Areas/TicketMall/Content/css/public.css" rel="stylesheet" />
<link href="/Areas/TicketMall/Content/css/main.css" rel="stylesheet" />
<script src="/Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="/Areas/TicketMall/Content/js/jquery.ui.js"></script>
<script type="text/javascript" src="/Areas/TicketMall/Content/js/moment.min.js"></script>
<script src="/Areas/TicketMall/Content/js/layer/layer.js"></script>
<script src="/Areas/TicketMall/Content/layui/layui.js"></script>
<script src="~/Areas/TicketMall/Content/js/jquery.flexslider-min.js"></script>
<script src="~/Areas/TicketMall/Content/js/lib/jquery.pagination.js"></script>
<style>
.CollectTitle {
color: #333333;
font-weight: bold;
font-size: 16px;
margin: 30px 0;
}
.collTable {
width: 100%;
border-collapse: collapse;
}
.collTable td, th {
border: 1px solid #DDDDDD;
height: 42px;
text-align: left;
padding-left: 30px;
}
.collTable tr:nth-child(even) {
background-color: #F9F9F9;
}
.collTicket {
width: 45px;
height: 25px;
background-color: #8C1324;
color: #fff;
cursor: pointer;
}
.TakeOutBtn {
width: 100px;
height: 34px;
color: #fff;
cursor: pointer;
background-color: #8C1324;
}
/*没有勾选button样式*/
.notCked {
background-color: #AAAAAA !important;
cursor: default;
}
</style>
</head>
<body>
<!--头部-->
<header class="w1240 clearfix">
<div class="logo fl">
<a href="/TicketMall/SaleTheater/Index"><img src="/Areas/TicketMall/Content/Sp_img/logo.png" alt="芙蓉国粹—抢票系统"> </a>
</div>
<div class="codebox fr">
<ul>
<li>
<img src="/Areas/TicketMall/Content/Sp_img/201816040903.jpg" width="74" height="74" alt="" />
<span>关注公众号</span>
</li>
<li>
<img src="/Areas/TicketMall/Content/Sp_img/201816040903.jpg" width="74" height="74" alt="" />
<span>联系客服</span>
</li>
</ul>
</div>
</header>
<!--导航-->
<!--轮播图-->
<!--热门戏剧-->
<div class="w100 clearfix">
<div class="w1240">
<div class="CollectTitle">当前可取票</div>
<table class="collTable">
<tr>
@*<th width="60">
<input id="selectAll" type="checkbox" />
</th>*@
<th width="580">名称</th>
<th>时长</th>
<th>剧场</th>
<th>场次</th>
<th width="150">操作</th>
</tr>
<tbody id="hotcont"></tbody>
@*<div class="hotcont w1240" id="hotcont">
</div>*@
@*<tr>
<td>
<input type="checkbox" class="SelectSingle" />
</td>
<td>长安大戏院2月17日 李林晓京剧专场演出——京剧《战马超》《春闺梦》</td>
<td>30分钟</td>
<td>3号厅</td>
<td>1月11日 15:30</td>
<td>
<input type="button" class="collTicket" value="取票" />
</td>
</tr>*@
</table>
<div class="pagination" id="Pagination">
</div>
</div>
</div>
<div class="hotbox w100 clearfix">
<div class="fast w1240 pt35 clearfix">
<ul>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast01.png" width="52" height="52" alt="">
</div>
<div class="text fl">
<h3>Fast·01</h3>
<span><a href="#"> 快速选座购票/选票</a> </span>
</div>
</div>
</li>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast02.png" width="51" height="53" alt="">
</div>
<div class="text fl">
<h3>Fast·02</h3>
<span><a href="#">剧院出票/取票</a> </span>
</div>
</div>
</li>
<li>
<div class="fastinfo">
<div class="pic fl">
<img src="/Areas/TicketMall/Content/Sp_img/fast03.png" width="41" height="56" alt="">
</div>
<div class="text fl">
<h3>Fast·03</h3>
<span><a href="#"> 真票真戏/保障</a> </span>
</div>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>
<script type="text/javascript">
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#StartTime', //指定元素
min: 0
});
});
var pageSize =8; //每页显示多少条记录
var total; //总共多少记录
$(function () {
TotalPage();
Init(0); //注意参数,初始页面默认传到后台的参数,第一页是0;
$("#submitKey").click(function () {
TotalPage();
Init(0);
});
});
function PageCallback(index, jq) { //前一个表示您当前点击的那个分页的页数索引值,后一个参数表示装载容器。
Init(index);
}
function TotalPage() {
$.ajax({
type: "post",
url: '@Url.Action("GetTotalCount")',
async: false,
data: { "StartTime": '@System.DateTime.Now.ToString("yyyy-MM-dd")', "EndTime": '@System.DateTime.Now.ToString("yyyy-MM-dd")', "Name": ""},
dataType: "json",
success: function (data) {
total = data.TotalCount;
if (parseInt(pageSize) < parseInt(total)) {
$("#Pagination").pagination(total, { //total不能少
callback: PageCallback,
prev_text: "<",
next_text: ">",
items_per_page: pageSize,
num_display_entries: 4, //连续分页主体部分显示的分页条目数
num_edge_entries: 1, //两侧显示的首尾分页的条目数
});
}
},
error: function () {
layer.msg("请求超时,请重试!", { icon: 2 });
}
});
}
function Init(pageIndex) { //这个参数就是点击的那个分页的页数索引值,第一页为0,上面提到了,下面这部分就是AJAX传值了。
$.ajax({
type: "post",
url: '@Url.Action("ExchangeTicketBind")',
async: false,
data: { "StartTime": '@System.DateTime.Now.ToString("yyyy-MM-dd")', "EndTime": '@System.DateTime.Now.ToString("yyyy-MM-dd")', "Name": "", "PageIndex": pageIndex, "iPageSize": pageSize},
dataType: "html",
success: function (data) {
$("#hotcont").html(data ? data : "");
},
error: function () {
layer.msg('请求超时,请重试', { icon: 2 });
}
});
};
function CollTicket() {
location.href = "@Url.Action("CollectingTickets")";
}
</script>
\ No newline at end of file
......@@ -170,7 +170,7 @@
}
},
error: function () {
alert("请求超时,请重试!");
layer.msg("请求超时,请重试!", { icon: 2 });
}
});
}
......

@using EheMall.Models;
@model List<Screening>
@if (Model != null && Model.Any())
{
foreach (var item in Model)
{
<tr>
@*<td>
<input type="checkbox" class="SelectSingle" />
</td>*@
<td>@item.Name</td>
<td><text>@item.ShowTime</text>分钟</td>
<td>@item.TheaterName</td>
<td>@item.StartTime.ToString("yyyy-MM-dd HH:mm")</td>
<td>
<input type="button" class="collTicket" value="取票" onclick="CollTicket()" />
</td>
</tr>
@*<li>
<div class="pic">
<a href="/TicketMall/SaleTheater/SaleTicket?ScreeningID=@item.ID">
<img src="@item.Image" alt="" width="253" height="181" onerror="this.src='/Areas/TicketMall/Content/Sp_img/images-moren.png'">
</a>
</div>
<div class="text">
<span>@item.Name</span>
<div class="vote">
<a href="/TicketMall/SaleTheater/SaleTicket?ScreeningID=@item.ID">抢票</a>
</div>
</div>
</li>*@
}
}
else
{
<tr><td colspan="5" style="text-align:center;"> <div style="text-align:center;margin:20px 0px;"><img src="/Areas/TicketMall/Content/Sp_img/no.png" /></div></td></tr>
}
......@@ -823,6 +823,10 @@
<Content Include="Areas\TicketMall\Content\layui\font\iconfont.eot" />
<Content Include="Areas\TicketMall\Content\layui\font\iconfont.ttf" />
<Content Include="Areas\TicketMall\Content\layui\font\iconfont.woff" />
<Content Include="Areas\TicketMall\Views\SaleTheater\ExchangeTicket.cshtml" />
<Content Include="Areas\TicketMall\Views\SaleTheater\_ExchangeTicket.cshtml" />
<Content Include="Areas\TicketMall\Views\SaleTheater\CollectingTickets.cshtml" />
<Content Include="Areas\TicketMall\Views\SaleTheater\ExchangeDetails.cshtml" />
<None Include="Properties\PublishProfiles\publish.pubxml" />
<None Include="Scripts\jquery-1.8.0.intellisense.js" />
<Content Include="Scripts\jquery-1.10.2.js" />
......
......@@ -10,7 +10,7 @@
</WebStackScaffolding_LayoutPageFile>
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<UseIISExpress>true</UseIISExpress>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment