更新订单
This commit is contained in:
@@ -0,0 +1,226 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using XCode;
|
||||
using Newtonsoft.Json;
|
||||
using COMCMS.Web.Common;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
public class GuestbookController : AdminBaseController
|
||||
{
|
||||
#region 留言板分类
|
||||
[MyAuthorize("viewlist", "guestbookkinds")]
|
||||
public IActionResult GuestbookCategorys()
|
||||
{
|
||||
IList<GuestbookCategory> list = GuestbookCategory.FindAll(null, GuestbookCategory._.Rank.Asc(), null, 0, 0);
|
||||
Core.Admin.WriteLogActions("查看留言分类列表页面;");
|
||||
return View(list);
|
||||
}
|
||||
//添加
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "guestbookkinds", "JSON")]
|
||||
public IActionResult AddGuestbookCategory(GuestbookCategory model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.KindName))
|
||||
{
|
||||
tip.Message = "请输入留言分类标题!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Insert();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加成功!";
|
||||
Core.Admin.WriteLogActions("添加留言分类(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//执行编辑操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "guestbookkinds", "JSON")]
|
||||
public IActionResult EditGuestbookCategory(GuestbookCategory model)
|
||||
{
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
return Json(tip);
|
||||
}
|
||||
GuestbookCategory oldentity = GuestbookCategory.Find(GuestbookCategory._.Id == model.Id);
|
||||
if (oldentity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.KindName))
|
||||
{
|
||||
tip.Message = "请输入留言分类标题!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Update();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑留言分类成功";
|
||||
Core.Admin.WriteLogActions("编辑留言分类(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
//执行删除操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "guestbookkinds", "JSON")]
|
||||
public JsonResult DelGuestbookCategory(int id)
|
||||
{
|
||||
GuestbookCategory entity = GuestbookCategory.Find(GuestbookCategory._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本留言分类!";
|
||||
return Json(tip);
|
||||
}
|
||||
//删除栏目下所有留言
|
||||
IList<Guestbook> list = Guestbook.FindAll(Guestbook._.KId == entity.Id, null, null, 0, 0);
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
list.Delete();
|
||||
}
|
||||
Core.Admin.WriteLogActions("删除留言分类(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除留言分类成功";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 留言列表
|
||||
[MyAuthorize("viewlist", "guestbook")]
|
||||
public IActionResult GuestbookList()
|
||||
{
|
||||
IList<GuestbookCategory> list = GuestbookCategory.FindAll(null, GuestbookCategory._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
return View();
|
||||
}
|
||||
[MyAuthorize("viewlist", "guestbook")]
|
||||
public IActionResult GetGuesbookList(string keyword, int page = 1, int limit = 20)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Guestbook._.Id > 0;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
{
|
||||
if (Utils.IsInt(keyword))
|
||||
{
|
||||
ex &= (Guestbook._.Id == int.Parse(keyword) | Guestbook._.Title.Contains(keyword));
|
||||
}
|
||||
else
|
||||
{
|
||||
ex &= Guestbook._.Title.Contains(keyword);
|
||||
}
|
||||
}
|
||||
string kid = Request.Query["kid"];
|
||||
if (Utils.IsInt(kid) && int.Parse(kid) > 0)
|
||||
{
|
||||
ex &= Guestbook._.KId == int.Parse(kid);
|
||||
}
|
||||
IList<Guestbook> list = Guestbook.FindAll(ex, Guestbook._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||
long totalCount = Guestbook.FindCount(ex, Guestbook._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||
Core.Admin.WriteLogActions("查看留言列表(page:" + page + ");");
|
||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 编辑留言
|
||||
[MyAuthorize("edit", "guestbook")]
|
||||
public IActionResult EditGuestbook(int id)
|
||||
{
|
||||
IList<GuestbookCategory> list = GuestbookCategory.FindAll(GuestbookCategory._.Id > 0, GuestbookCategory._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
Guestbook entity = Guestbook.Find(Guestbook._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
if (entity.IsRead != 1)
|
||||
{
|
||||
entity.IsRead = 1;
|
||||
entity.Update();
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("查看/回复留言(" + id + ");");
|
||||
|
||||
return View(entity);
|
||||
}
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "guestbook", "JSON")]
|
||||
public IActionResult EditGuestbook(FormCollection fc)
|
||||
{
|
||||
string id = fc["Id"];
|
||||
if (!Utils.IsInt(id) || int.Parse(id) <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Guestbook entity = Guestbook.FindById(int.Parse(id));
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录";
|
||||
return Json(tip);
|
||||
}
|
||||
string kid = fc["KId"];
|
||||
if (Utils.IsInt(kid) && int.Parse(kid) != entity.KId)
|
||||
{
|
||||
entity.KId = int.Parse(kid);
|
||||
}
|
||||
string isverify = fc["IsVerify"];
|
||||
if (!string.IsNullOrEmpty(isverify) && isverify == "1")
|
||||
{
|
||||
entity.IsVerify = 1;
|
||||
}
|
||||
else
|
||||
entity.IsVerify = 0;
|
||||
string replayuser = fc["ReplyUser"];
|
||||
entity.ReplyNickName = replayuser;
|
||||
string reply = fc["Reply"];
|
||||
entity.ReplyContent = reply;
|
||||
if (!string.IsNullOrEmpty(entity.ReplyContent) && entity.ReplyAdminId == 0)
|
||||
{
|
||||
entity.ReplyAdminId = Core.Admin.GetMyInfo().Id;
|
||||
entity.ReplyIP = Utils.GetIP();
|
||||
entity.ReplyAddTime = DateTime.Now;
|
||||
}
|
||||
entity.Update();
|
||||
Core.Admin.WriteLogActions("编辑审核留言(id:" + entity.Id + ");");
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑/审核留言详情成功";
|
||||
tip.ReturnUrl = "close";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除留言
|
||||
//删除文章
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "guestbook", "JSON")]
|
||||
public JsonResult DelGuestbook(int id)
|
||||
{
|
||||
Guestbook entity = Guestbook.Find(Guestbook._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本留言!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("删除留言(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除留言成功";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,333 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using XCode;
|
||||
using Newtonsoft.Json;
|
||||
using COMCMS.Web.Common;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
public class OrderController : AdminBaseController
|
||||
{
|
||||
#region 订单列表
|
||||
[MyAuthorize("viewlist", "order")]
|
||||
public IActionResult OrderList()
|
||||
{
|
||||
Core.Admin.WriteLogActions("查看订单列表;");
|
||||
return View();
|
||||
}
|
||||
|
||||
[MyAuthorize("viewlist", "order", "JSON")]
|
||||
public IActionResult GetOrderList(string keyword, int page = 1, int limit = 20, int kid = 0)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Order._.Id > 0 & Order._.MyType == (int)Utils.MyType.商品;
|
||||
string status = Request.Query["status"];
|
||||
if (!string.IsNullOrEmpty(status))
|
||||
ex &= Order._.OrderStatus == status;
|
||||
|
||||
string paystatus = Request.Query["paystatus"];
|
||||
if (!string.IsNullOrEmpty(paystatus))
|
||||
ex &= Order._.PaymentStatus == paystatus;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
ex &= (Order._.Title.Contains(keyword) | Order._.OrderNum.Contains(keyword) | Order._.RealName.Contains(keyword) | Order._.Address.Contains(keyword));
|
||||
|
||||
IList<Order> list = Order.FindAll(ex, null, null, startRowIndex, numPerPage);
|
||||
long totalCount = Order.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看/编辑订单详情
|
||||
[MyAuthorize("edit", "order")]
|
||||
public IActionResult EditOrder(int id)
|
||||
{
|
||||
Order entity = Order.Find(Order._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
//获取订单详情
|
||||
IList<OrderDetail> list = OrderDetail.FindAll(OrderDetail._.OrderId == entity.Id, null, null, 0, 0);
|
||||
ViewBag.list = list;
|
||||
//日志
|
||||
IList<OrderLog> OrderLogList = OrderLog.FindAll(OrderLog._.OrderId == entity.Id, null, null, 0, 0);
|
||||
ViewBag.OrderLogList = OrderLogList;
|
||||
Core.Admin.WriteLogActions($"查看订单详情(id:{entity.Id});");
|
||||
return View(entity);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除订单
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "order", "JSON")]
|
||||
public IActionResult DelOrder(int id)
|
||||
{
|
||||
Order entity = Order.Find(Order._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本订单";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.PaymentStatus == Utils.PaymentState[1])
|
||||
{
|
||||
tip.Message = "已经支付订单,不能删除!";
|
||||
return Json(tip);
|
||||
}
|
||||
IList<OrderDetail> list = OrderDetail.FindAll(OrderDetail._.OrderId == entity.Id, null, null, 0, 0);
|
||||
IList<OrderLog> OrderLogList = OrderLog.FindAll(OrderLog._.OrderId == entity.Id, null, null, 0, 0);
|
||||
OrderLogList.Delete();
|
||||
list.Delete();
|
||||
Admin.WriteLogActions($"删除订单(id:{id},订单号:{entity.OrderNum},{JsonConvert.SerializeObject(entity)});");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除成功!";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 确认订单
|
||||
[HttpPost]
|
||||
[MyAuthorize("confirm", "order")]
|
||||
public IActionResult ConfirmOrder(int id)
|
||||
{
|
||||
Order entity = Order.Find(Order._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.OrderStatus != Utils.OrdersState[0])
|
||||
{
|
||||
tip.Message = "非未确认订单,无法确认订单!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.OrderStatus = Utils.OrdersState[1];
|
||||
entity.LastModTime = DateTime.Now;
|
||||
entity.Update();
|
||||
Admin admin = Admin.GetMyInfo();
|
||||
|
||||
//写入记录
|
||||
OrderLog log = new OrderLog()
|
||||
{
|
||||
AddTime = DateTime.Now,
|
||||
Actions = "管理员确认订单",
|
||||
OrderId = entity.Id,
|
||||
OrderNum = entity.OrderNum,
|
||||
UId = -admin.Id
|
||||
};
|
||||
log.Insert();
|
||||
Admin.WriteLogActions($"确认订单(id:{entity.Id});");
|
||||
tip.Message = "确认订单成功!";
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.ReturnUrl = "/AdminCP/Order/EditOrder/" + entity.Id;
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 完成订单
|
||||
[HttpPost]
|
||||
[MyAuthorize("confirm", "order")]
|
||||
public IActionResult CompleteOrder(int id)
|
||||
{
|
||||
Order entity = Order.Find(Order._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.OrderStatus != Utils.OrdersState[1] || entity.PaymentStatus != Utils.PaymentState[1] || string.IsNullOrEmpty(entity.DeliverNO))
|
||||
{
|
||||
tip.Message = "只有已经确认、支付、发货的订单,才能设置成订单已完成!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.OrderStatus = Utils.OrdersState[2];
|
||||
entity.LastModTime = DateTime.Now;
|
||||
entity.Update();
|
||||
|
||||
//执行分销
|
||||
decimal totalRechargePrice = entity.TotalPrice;
|
||||
Member my = Member.FindById(entity.UId);
|
||||
|
||||
//自己返现
|
||||
if (my.Roles.CashBack > 0)
|
||||
{
|
||||
decimal myreward = entity.TotalPrice * my.Roles.CashBack / 100;
|
||||
//totalRechargePrice = totalRechargePrice - myreward;//减去自己的计算
|
||||
Member.ToCashBack(my.Id, myreward, $"我的销售返现,消费:¥{entity.TotalPrice.ToString("N2")};返现比例({my.Roles.CashBack.ToString("N2")}%),共:¥{myreward.ToString("N2")}", entity.Id, entity.OrderNum);
|
||||
}
|
||||
|
||||
if (my.Parent > 0)
|
||||
{
|
||||
Member.SaleCommission(my.Id, totalRechargePrice, my.Parent, entity.OrderNum, 1, entity.Id, entity.TotalPrice);
|
||||
}
|
||||
if (my.Grandfather > 0)
|
||||
{
|
||||
Member.SaleCommission(my.Id, totalRechargePrice, my.Grandfather, entity.OrderNum, 2, entity.Id, entity.TotalPrice);
|
||||
}
|
||||
|
||||
Admin admin = Admin.GetMyInfo();
|
||||
|
||||
//写入记录
|
||||
OrderLog log = new OrderLog()
|
||||
{
|
||||
AddTime = DateTime.Now,
|
||||
Actions = "管理员设置订单【已完成】",
|
||||
OrderId = entity.Id,
|
||||
OrderNum = entity.OrderNum,
|
||||
UId = -admin.Id
|
||||
};
|
||||
log.Insert();
|
||||
Admin.WriteLogActions($"完成订单(id:{entity.Id});");
|
||||
tip.Message = "确认订单已完成成功!";
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.ReturnUrl = "/AdminCP/Order/EditOrder/" + entity.Id;
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改运费
|
||||
[HttpPost]
|
||||
public IActionResult DoChangeOrderFare(int id, decimal fare)
|
||||
{
|
||||
Order entity = Order.Find(Order._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.PaymentStatus != Utils.PaymentState[0])
|
||||
{
|
||||
tip.Message = "非未支付订单,无法修改订单运费!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (fare < 0)
|
||||
{
|
||||
tip.Message = "运费不能小于0!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.Fare = fare;
|
||||
entity.TotalPay = entity.TotalPrice + fare;
|
||||
entity.LastModTime = DateTime.Now;
|
||||
entity.Update();
|
||||
Admin admin = Admin.GetMyInfo();
|
||||
|
||||
//写入记录
|
||||
OrderLog log = new OrderLog()
|
||||
{
|
||||
AddTime = DateTime.Now,
|
||||
Actions = $"管理员修改订单运费为:¥{entity.Fare.ToString("N2")}",
|
||||
OrderId = entity.Id,
|
||||
OrderNum = entity.OrderNum,
|
||||
UId = -admin.Id
|
||||
};
|
||||
log.Insert();
|
||||
Admin.WriteLogActions($"修改订单运费(id:{entity.Id},fare:{entity.Fare});");
|
||||
tip.Message = "修改订单运费成功!";
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.ReturnUrl = "/AdminCP/Order/EditOrder/" + entity.Id;
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改物流信息
|
||||
[HttpPost]
|
||||
public IActionResult DoChangeOrderDeliver(int id, string DeliverType = "", string DeliverNO = "")
|
||||
{
|
||||
Order entity = Order.Find(Order._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.PaymentStatus == Utils.PaymentState[0])
|
||||
{
|
||||
tip.Message = "非已支付订单,无法修改订单配送状态!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.OrderStatus == Utils.OrdersState[2] || entity.OrderStatus == Utils.OrdersState[3])
|
||||
{
|
||||
tip.Message = "订单状态错误,无法修改订单配送状态!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(DeliverNO))
|
||||
{
|
||||
tip.Message = "请输入运单号!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.DeliverType == DeliverType && entity.DeliverNO == DeliverNO)
|
||||
{
|
||||
tip.Message = "物流信息并无修改!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.DeliverType = DeliverType;
|
||||
entity.DeliverNO = DeliverNO;
|
||||
entity.DeliverStatus = Utils.DeliverState[2];
|
||||
entity.LastModTime = DateTime.Now;
|
||||
entity.Update();
|
||||
Admin admin = Admin.GetMyInfo();
|
||||
//写入记录
|
||||
OrderLog log = new OrderLog()
|
||||
{
|
||||
AddTime = DateTime.Now,
|
||||
Actions = $"发货:物流:{entity.DeliverType};订单号:{entity.DeliverNO}",
|
||||
OrderId = entity.Id,
|
||||
OrderNum = entity.OrderNum,
|
||||
UId = -admin.Id
|
||||
};
|
||||
log.Insert();
|
||||
Admin.WriteLogActions($"修改订单发货状态:物流:{entity.DeliverType};订单号:{entity.DeliverNO};");
|
||||
tip.Message = "修改订单物流配送成功!";
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.ReturnUrl = "/AdminCP/Order/EditOrder/" + entity.Id;
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 在线支付成功记录
|
||||
[MyAuthorize("viewlist", "payonline")]
|
||||
public IActionResult PayOnlineList()
|
||||
{
|
||||
Core.Admin.WriteLogActions("查看在线支付订单列表;");
|
||||
return View();
|
||||
}
|
||||
|
||||
[MyAuthorize("viewlist", "payonline", "JSON")]
|
||||
public IActionResult GetPayOnlineList(string keyword, int page = 1, int limit = 20, int kid = 0)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = OnlinePayOrder._.Id > 0 & OnlinePayOrder._.PaymentStatus == Utils.PaymentState[1];
|
||||
|
||||
string mytype = Request.Query["mytype"];
|
||||
if (Utils.IsInt(mytype) && int.Parse(mytype) > 0)
|
||||
{
|
||||
ex &= OnlinePayOrder._.MyType == int.Parse(mytype);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
ex &= OnlinePayOrder._.Title.Contains(keyword);
|
||||
|
||||
IList<OnlinePayOrder> list = OnlinePayOrder.FindAll(ex, null, null, startRowIndex, numPerPage);
|
||||
long totalCount = OnlinePayOrder.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,642 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using XCode;
|
||||
using Newtonsoft.Json;
|
||||
using COMCMS.Web.Common;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using COMCMS.Core.Models;
|
||||
|
||||
namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
public class OtherController : AdminBaseController
|
||||
{
|
||||
#region 广告分类管理
|
||||
//查看&编辑广告分类(同一个页面执行)
|
||||
[MyAuthorize("viewlist", "adskinds")]
|
||||
public IActionResult AdsCategoryList()
|
||||
{
|
||||
IList<AdsKind> list = AdsKind.FindAll(null, AdsKind._.Rank.Asc(), null, 0, 0);
|
||||
Core.Admin.WriteLogActions("查看广告分类列表页面;");
|
||||
return View(list);
|
||||
}
|
||||
|
||||
//执行添加操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "adskinds", "JSON")]
|
||||
public IActionResult AddAdsKind(AdsKind model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.KindName))
|
||||
{
|
||||
tip.Message = "广告分类名称不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Insert();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加广告分类成功";
|
||||
Core.Admin.WriteLogActions("添加广告栏目(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//执行编辑操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "adskinds", "JSON")]
|
||||
public IActionResult EditAdsKind(AdsKind model)
|
||||
{
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
return Json(tip);
|
||||
}
|
||||
AdsKind oldentity = AdsKind.Find(AdsKind._.Id == model.Id);
|
||||
if (oldentity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.KindName))
|
||||
{
|
||||
tip.Message = "广告分类名称不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Update();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑广告分类成功";
|
||||
Core.Admin.WriteLogActions("编辑广告栏目(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
//执行删除操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "adskinds", "JSON")]
|
||||
public JsonResult DelAdsKind(int id)
|
||||
{
|
||||
AdsKind entity = AdsKind.Find(AdsKind._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本广告分类!";
|
||||
return Json(tip);
|
||||
}
|
||||
//删除旗下广告
|
||||
IList<Ads> list = Ads.FindAll(Ads._.KId == entity.Id, null, null, 0, 0);
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
list.Delete();
|
||||
}
|
||||
Core.Admin.WriteLogActions("删除广告分类(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除广告分类成功";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 广告管理
|
||||
[MyAuthorize("viewlist", "ads")]
|
||||
public IActionResult AdsList()
|
||||
{
|
||||
IList<AdsKind> list = AdsKind.FindAll(null, AdsKind._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
Core.Admin.WriteLogActions("查看广告列表;");
|
||||
return View();
|
||||
}
|
||||
//获取分页
|
||||
[MyAuthorize("viewlist", "ads", "JSON")]
|
||||
public IActionResult GetAdsList(string keyword, int page = 1, int limit = 20, int kid = 0)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Ads._.Id > 0;
|
||||
if (kid > 0)
|
||||
ex &= Ads._.KId == kid;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
ex &= Ads._.Title.Contains(keyword);
|
||||
|
||||
IList<Ads> list = Ads.FindAll(ex, Ads._.Sequence.Asc().And(Ads._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
long totalCount = Ads.FindCount(ex, Ads._.Sequence.Asc().And(Ads._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
//添加广告页面
|
||||
[MyAuthorize("add", "ads")]
|
||||
public IActionResult AddAds()
|
||||
{
|
||||
IList<AdsKind> list = AdsKind.FindAll(null, AdsKind._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
Core.Admin.WriteLogActions("查看添加广告页面;");
|
||||
return View();
|
||||
}
|
||||
|
||||
//执行添加广告
|
||||
[HttpPost]
|
||||
|
||||
[MyAuthorize("add", "ads", "JSON")]
|
||||
public IActionResult AddAds(Ads model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.Title))
|
||||
{
|
||||
tip.Message = "广告标题不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
string content = "";
|
||||
DateTime StartTime, EndTime;
|
||||
StartTime = Convert.ToDateTime("2000-01-01");
|
||||
EndTime = Convert.ToDateTime("2999-01-01");
|
||||
GetRequestAdsString(model.TId, ref content);
|
||||
model.StartTime = StartTime;
|
||||
model.EndTime = EndTime;
|
||||
model.Content = content;
|
||||
model.Insert();
|
||||
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加广告成功";
|
||||
tip.ReturnUrl = "close";
|
||||
|
||||
Core.Admin.WriteLogActions("添加广告(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
//编辑广告
|
||||
[MyAuthorize("edit", "ads")]
|
||||
public IActionResult EditAds(int id)
|
||||
{
|
||||
IList<AdsKind> list = AdsKind.FindAll(null, AdsKind._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
|
||||
Ads entity = Ads.Find(Ads._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("查看/编辑广告(" + id + ");");
|
||||
|
||||
return View(entity);
|
||||
}
|
||||
|
||||
//执行编辑广告
|
||||
[HttpPost]
|
||||
|
||||
[MyAuthorize("edit", "ads", "JSON")]
|
||||
public IActionResult EditAds(Ads model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.Title))
|
||||
{
|
||||
tip.Message = "广告标题不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
Json(tip);
|
||||
}
|
||||
Ads entity = Ads.Find(Ads._.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
string content = "";
|
||||
DateTime StartTime, EndTime;
|
||||
StartTime = Convert.ToDateTime("2000-01-01");
|
||||
EndTime = Convert.ToDateTime("2999-01-01");
|
||||
GetRequestAdsString(model.TId, ref content);
|
||||
model.StartTime = StartTime;
|
||||
model.EndTime = EndTime;
|
||||
model.Content = content;
|
||||
model.Update();
|
||||
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑广告成功";
|
||||
tip.ReturnUrl = "close";
|
||||
|
||||
Core.Admin.WriteLogActions("编辑广告(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
//删除广告
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "ads", "JSON")]
|
||||
public JsonResult DelAds(int id)
|
||||
{
|
||||
Ads entity = Ads.Find(Ads._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本广告!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("删除广告(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除广告成功";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
#region 获取广告代码
|
||||
/// <summary>
|
||||
/// 获取
|
||||
/// </summary>
|
||||
/// <param name="tid">ID</param>
|
||||
/// <returns></returns>
|
||||
private void GetRequestAdsString(int tid, ref string adsString)
|
||||
{
|
||||
JsonTip mytip = new JsonTip();
|
||||
mytip.Status = JsonTip.ERROR;
|
||||
|
||||
string str = "";
|
||||
switch (tid)
|
||||
{
|
||||
case 0://代码
|
||||
ScriptAds script = new ScriptAds();
|
||||
script.content = Request.Form["txtScript"];
|
||||
if (string.IsNullOrEmpty(script.content))
|
||||
{
|
||||
mytip.Message = "代码不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
str = JsonConvert.SerializeObject(script);
|
||||
}
|
||||
break;
|
||||
case 1://文字类
|
||||
TextAds text = new TextAds();
|
||||
text.txt = Request.Form["txt_Txt"];
|
||||
text.link = Request.Form["txt_Link"];
|
||||
text.style = Request.Form["txt_Style"];
|
||||
if (string.IsNullOrEmpty(text.txt))
|
||||
{
|
||||
mytip.Message = "文字内容不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(text.link))
|
||||
{
|
||||
mytip.Message = "文字链接不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
str = JsonConvert.SerializeObject(text);
|
||||
break;
|
||||
case 2://图片类
|
||||
ImgAds img = new ImgAds();
|
||||
img.img = Request.Form["img_Img"];
|
||||
img.link = Request.Form["img_Link"];
|
||||
img.alt = Request.Form["img_Alt"];
|
||||
string iw = Request.Form["img_Width"];
|
||||
string ih = Request.Form["img_Height"];
|
||||
if (!string.IsNullOrEmpty(iw) && Utils.IsInt(iw))
|
||||
img.width = int.Parse(iw);
|
||||
if (!string.IsNullOrEmpty(ih) && Utils.IsInt(ih))
|
||||
img.height = int.Parse(ih);
|
||||
if (string.IsNullOrEmpty(img.img))
|
||||
{
|
||||
mytip.Message = "图片地址不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(img.link))
|
||||
{
|
||||
mytip.Message = "图片链接不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
str = JsonConvert.SerializeObject(img);
|
||||
break;
|
||||
case 3://Flash类
|
||||
FlashAds flash = new FlashAds();
|
||||
flash.swf = Request.Form["flash_Swf"];
|
||||
string fw = Request.Form["flash_Width"];
|
||||
string fh = Request.Form["flash_Height"];
|
||||
if (string.IsNullOrEmpty(flash.swf))
|
||||
{
|
||||
mytip.Message = "Flash 地址不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(fw) || !Utils.IsInt(fw))
|
||||
{
|
||||
mytip.Message = "Flash 宽度不能为空或者不是整数!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
flash.width = int.Parse(fw);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(fh) || !Utils.IsInt(fh))
|
||||
{
|
||||
mytip.Message = "Flash 高度不能为空或者不是整数!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
flash.height = int.Parse(fh);
|
||||
}
|
||||
str = JsonConvert.SerializeObject(flash);
|
||||
break;
|
||||
case 4://幻灯片
|
||||
string sw = Request.Form["slide_Width"];
|
||||
string sh = Request.Form["slide_Height"];
|
||||
if (string.IsNullOrEmpty(sw) || !Utils.IsInt(sw))
|
||||
{
|
||||
mytip.Message = "幻灯片宽度不能为空或者不是整数!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(sh) || !Utils.IsInt(sh))
|
||||
{
|
||||
mytip.Message = "幻灯片高度不能为空或者不是整数!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
string SImg = Request.Form["slide_Img"];
|
||||
string SLink = Request.Form["slide_Link"];
|
||||
string SAlt = Request.Form["slide_Alt"];
|
||||
if (string.IsNullOrEmpty(SImg))
|
||||
{
|
||||
mytip.Message = "幻灯片图片不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(SLink))
|
||||
{
|
||||
mytip.Message = "幻灯片图片链接不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
string[] arrsimg = SImg.Split(new string[] { "," }, StringSplitOptions.None);
|
||||
string[] arrslink = SLink.Split(new string[] { "," }, StringSplitOptions.None);
|
||||
string[] arralt = SAlt.Split(new string[] { "," }, StringSplitOptions.None);
|
||||
List<ImgAds> listimg = new List<ImgAds>();
|
||||
for (int i = 0; i < arrsimg.Length; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(arrsimg[i]) && !string.IsNullOrEmpty(arrslink[i]))//图片跟地址都不为空
|
||||
{
|
||||
ImgAds tplimgads = new ImgAds();
|
||||
tplimgads.img = arrsimg[i];
|
||||
tplimgads.link = arrslink[i];
|
||||
tplimgads.height = int.Parse(sh);
|
||||
tplimgads.width = int.Parse(sw);
|
||||
tplimgads.alt = arralt[i];
|
||||
//listimg.Add(new ImgAds { img = arrsimg[i], link = arrslink[i], height = int.Parse(sh), width = int.Parse(sw), alt = arralt[i] });
|
||||
listimg.Add(tplimgads);
|
||||
}
|
||||
}
|
||||
str = JsonConvert.SerializeObject(listimg);
|
||||
break;
|
||||
case 7://视频广告
|
||||
VideoAds video = new VideoAds();
|
||||
video.poster = Request.Form["video_Poster"];
|
||||
video.src = Request.Form["video_Src"];
|
||||
video.title = Request.Form["video_Title"];
|
||||
string vw = Request.Form["video_Width"];
|
||||
string vh = Request.Form["video_Height"];
|
||||
if (!string.IsNullOrEmpty(vw) && Utils.IsInt(vw))
|
||||
video.width = int.Parse(vw);
|
||||
if (!string.IsNullOrEmpty(vh) && Utils.IsInt(vh))
|
||||
video.height = int.Parse(vh);
|
||||
if (string.IsNullOrEmpty(video.src))
|
||||
{
|
||||
mytip.Message = "视频广告地址不能为空!";
|
||||
mytip.EchoTip();
|
||||
return;
|
||||
}
|
||||
str = JsonConvert.SerializeObject(video);
|
||||
break;
|
||||
}
|
||||
adsString = str;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 友情链接分类管理
|
||||
//查看&编辑友情链接分类(同一个页面执行)
|
||||
[MyAuthorize("viewlist", "adskinds")]
|
||||
public IActionResult LinkCategoryList()
|
||||
{
|
||||
IList<LinkKind> list = LinkKind.FindAll(null, LinkKind._.Rank.Asc(), null, 0, 0);
|
||||
Core.Admin.WriteLogActions("查看友情链接分类列表页面;");
|
||||
return View(list);
|
||||
}
|
||||
|
||||
//执行添加操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "adskinds", "JSON")]
|
||||
public IActionResult AddLinkKind(LinkKind model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.KindName))
|
||||
{
|
||||
tip.Message = "广告分类名称不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Insert();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加友情链接分类成功";
|
||||
Core.Admin.WriteLogActions("添加友情链接分类(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//执行编辑操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "adskinds", "JSON")]
|
||||
public IActionResult EditLinkKind(LinkKind model)
|
||||
{
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
return Json(tip);
|
||||
}
|
||||
LinkKind oldentity = LinkKind.Find(LinkKind._.Id == model.Id);
|
||||
if (oldentity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.KindName))
|
||||
{
|
||||
tip.Message = "友情链接分类名称不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Update();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑友情链接分类成功";
|
||||
Core.Admin.WriteLogActions("编辑友情链接分类(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
//执行删除操作
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "adskinds", "JSON")]
|
||||
public JsonResult DelLinkKind(int id)
|
||||
{
|
||||
LinkKind entity = LinkKind.Find(LinkKind._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本友情链接分类!";
|
||||
return Json(tip);
|
||||
}
|
||||
//删除下属友情链接
|
||||
IList<Link> list = Link.FindAll(Link._.KId == entity.Id, null, null, 0, 0);
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
list.Delete();
|
||||
}
|
||||
Core.Admin.WriteLogActions("删除友情链接分类(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除友情链接分类成功";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 友情链接管理
|
||||
//查看友情链接列表
|
||||
[MyAuthorize("viewlist", "link")]
|
||||
public IActionResult LinkList()
|
||||
{
|
||||
IList<LinkKind> list = LinkKind.FindAll(null, LinkKind._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
Core.Admin.WriteLogActions("查看友情链接列表;");
|
||||
return View();
|
||||
}
|
||||
|
||||
[MyAuthorize("viewlist", "link", "JSON")]
|
||||
public IActionResult GetLinkList(string keyword, int page = 1, int limit = 20, int kid = 0)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Link._.Id > 0;
|
||||
if (kid > 0)
|
||||
ex &= Link._.KId == kid;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
ex &= Link._.Title.Contains(keyword);
|
||||
|
||||
IList<Link> list = Link.FindAll(ex, Link._.Sequence.Asc().And(Link._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
long totalCount = Link.FindCount(ex, Link._.Sequence.Asc().And(Link._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
//添加友情链接
|
||||
[MyAuthorize("add", "link")]
|
||||
public IActionResult AddLink()
|
||||
{
|
||||
IList<LinkKind> list = LinkKind.FindAll(null, LinkKind._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
Core.Admin.WriteLogActions("查看添加友情链接页面;");
|
||||
return View();
|
||||
}
|
||||
|
||||
//执行添加友情链接
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "link", "JSON")]
|
||||
public IActionResult AddLink(Link model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.Title))
|
||||
{
|
||||
tip.Message = "网站标题不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.LinkURL))
|
||||
{
|
||||
tip.Message = "网站链接不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
model.Insert();
|
||||
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加友情链接成功";
|
||||
tip.ReturnUrl = "close";
|
||||
|
||||
Core.Admin.WriteLogActions("添加友情链接(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//编辑广告
|
||||
[MyAuthorize("edit", "link")]
|
||||
public IActionResult EditLink(int id)
|
||||
{
|
||||
IList<LinkKind> list = LinkKind.FindAll(null, LinkKind._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.ListKinds = list;
|
||||
|
||||
Link entity = Link.Find(Link._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("查看/编辑友情链接(" + id + ");");
|
||||
|
||||
return View(entity);
|
||||
}
|
||||
|
||||
|
||||
//执行编辑广告
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "link", "JSON")]
|
||||
public IActionResult EditLink(Link model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.Title))
|
||||
{
|
||||
tip.Message = "网站标题不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.LinkURL))
|
||||
{
|
||||
tip.Message = "网站链接不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
Link entity = Link.Find(Link._.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
model.Update();
|
||||
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑友情链接成功";
|
||||
tip.ReturnUrl = "close";
|
||||
|
||||
Core.Admin.WriteLogActions("编辑友情链接(" + model.Id + ");");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//删除友情链接
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "link", "JSON")]
|
||||
public JsonResult DelLink(int id)
|
||||
{
|
||||
Link entity = Link.Find(Link._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本友情链接!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("删除友情链接(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除友情链接成功";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "AddGuestbookCategory";
|
||||
}
|
||||
|
||||
<h2>AddGuestbookCategory</h2>
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
@model COMCMS.Core.Guestbook
|
||||
@{
|
||||
ViewBag.title = "编辑/审核留言详情";
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editGuestbookForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">留言栏目:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control m-b" asp-for="KId">
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">留言标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.Title</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.Nickname</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">留言详情:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.Content</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">留言时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.AddTime.ToString("yyyy-MM-dd HH:mm")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="checkbox-inline i-checks">
|
||||
<input type="checkbox" value="1" name="IsVerify" id="IsVerify" @(Model.IsVerify == 1 ? "checked" : "")> 审核通过
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">回复者:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="ReplyUser" name="ReplyUser" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="如果回复留言,请填写回复者" value="@Model.ReplyNickName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">回复内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="Reply" name="Reply" class="form-control" placeholder="可以输入栏目的详细介绍" required>@Model.ReplyContent</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-3">
|
||||
<input type="hidden" id="Id" name="Id" value="@Model.Id" />
|
||||
<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 提交 </button>
|
||||
<button class="btn btn-default" type="button" onclick="closethisdialog();"><i class="fa fa-close"></i> 取消 </button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
DoPost("editGuestbookForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,96 @@
|
||||
@model IList<COMCMS.Core.GuestbookCategory>
|
||||
@{
|
||||
ViewBag.title = "留言分类管理";
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="toolbar2" class="btn-group pull-right">
|
||||
<button id="btn_refresh" type="button" class="btn btn-outline btn-default" onclick="refresh();">
|
||||
<span class="fa fa-refresh" aria-hidden="true"></span>刷新
|
||||
</button>
|
||||
</div>
|
||||
<form name="listGuestbookKindForm" id="listGuestbookKindForm" method="post" onsubmit="return false">
|
||||
<table class="tree table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>类别名称</th>
|
||||
<th class="text-center">排序</th>
|
||||
<th>简单说明</th>
|
||||
<th style="width:200px">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@if (Model.Count == 0)
|
||||
{
|
||||
<tr><td colspan="5" class="text-center">暂无记录</td></tr>
|
||||
}
|
||||
@foreach (var m in Model)
|
||||
{
|
||||
<tr id="row_@m.Id">
|
||||
<td>
|
||||
<div class="rt-editpanel">@m.Id</div>
|
||||
<div class="rt-savepanel hidden">
|
||||
@m.Id
|
||||
<input type="hidden" name="Id" id="Id_@m.Id" value="@m.Id" class="rt-edit" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="rt-editpanel">@m.KindName</div>
|
||||
<div class="rt-savepanel hidden">
|
||||
<input name="KindName" id="KindName_@m.Id" type="text" class="form-control rt-edit" placeholder="请输入类别名称" maxlength="100" value="@m.KindName" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="rt-editpanel">@m.Rank</div>
|
||||
<div class="rt-savepanel hidden">
|
||||
<input type="number" name="Rank" id="Rank_@m.Id" class="form-control rt-edit" value="@m.Rank" maxlength="3" placeholder="请输入类别排序,只能填写数字" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="rt-editpanel">@m.KindInfo</div>
|
||||
<div class="rt-savepanel hidden">
|
||||
<input type="text" name="KindInfo" id="KindInfo_@m.Id" class="form-control rt-edit" value="@m.KindInfo" placeholder="类别简介,非必填" maxlength="200" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="rt-editpanel">
|
||||
<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="showEdit(@m.Id)"><i class="fa fa-edit"></i> 编辑</a>
|
||||
<a href="javascript:;" class="btn btn-xs btn-danger" title="删除" onclick="doDel('/AdminCP/Guestbook/DelGuestbookKind',@m.Id);"><i class="fa fa-close"></i> 删除</a>
|
||||
</div>
|
||||
<div class="rt-savepanel hidden">
|
||||
<a href="javascript:;" class="btn btn-xs btn-success" title="保存" onclick="doEdit('listGuestbookKindForm', '/AdminCP/Guestbook/EditGuestbookKind',@m.Id)"><i class="fa fa-save"></i> 保存</a>
|
||||
<a href="javascript:;" class="btn btn-xs btn-default" title="取消" onclick="cancelEdit(@m.Id);"><i class="fa fa-mail-reply"></i> 取消</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr id="addnew" class="hidden">
|
||||
<td>
|
||||
<span class="text-primary">新增</span>
|
||||
</td>
|
||||
<td><input name="KindName" id="KindName" type="text" class="form-control addnew" placeholder="请输入类别名称" required maxlength="100" /></td>
|
||||
<td class="text-center"><input type="number" name="Rank" id="Rank" class="form-control addnew" value="0" maxlength="3" placeholder="请输入类别排序,只能填写数字" /></td>
|
||||
<td><input type="text" name="KindInfo" id="KindInfo" class="form-control addnew" placeholder="类别简介,非必填" maxlength="200" /></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-xs btn-success" title="保存" onclick="doAdd('listGuestbookKindForm', '/AdminCP/Guestbook/AddGuestbookKind');"><i class="fa fa-save"></i> 保存</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
|
||||
@{
|
||||
ViewBag.title = "留言管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
||||
<div>
|
||||
<label class="control-label">留言分类:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<option value="0">所有分类</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
//1.初始化Table
|
||||
var oTable = new TableInit();
|
||||
oTable.Init();
|
||||
|
||||
//2.初始化Button的点击事件
|
||||
var oButtonInit = new ButtonInit();
|
||||
oButtonInit.Init();
|
||||
|
||||
});
|
||||
function doSearch() {
|
||||
var params = $('#tb_departments').bootstrapTable('getOptions');
|
||||
//console.log(params);
|
||||
params.queryParams = function (params) {
|
||||
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
kid: $("#kid").val(),
|
||||
keyword: $("#keyword").val()
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
$('#tb_departments').bootstrapTable('refresh', params);
|
||||
}
|
||||
var TableInit = function () {
|
||||
var oTableInit = new Object();
|
||||
//初始化Table
|
||||
oTableInit.Init = function () {
|
||||
$('#tb_departments').bootstrapTable({
|
||||
url: '/AdminCP/Guestbook/GetGuesbookList', //请求后台的URL(*)
|
||||
method: 'get', //请求方式(*)
|
||||
toolbar: '#toolbar', //工具按钮用哪个容器
|
||||
striped: true, //是否显示行间隔色
|
||||
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
||||
pagination: true, //是否显示分页(*)
|
||||
sortable: false, //是否启用排序
|
||||
sortOrder: "asc", //排序方式
|
||||
queryParams: oTableInit.queryParams,//传递参数(*)
|
||||
sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
|
||||
pageNumber: 1, //初始化加载第一页,默认第一页
|
||||
pageSize: 25, //每页的记录行数(*)
|
||||
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
||||
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
||||
strictSearch: true,
|
||||
showColumns: true, //是否显示所有的列
|
||||
showRefresh: true, //是否显示刷新按钮
|
||||
minimumCountColumns: 2, //最少允许的列数
|
||||
clickToSelect: true, //是否启用点击选中行
|
||||
height: 0, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度
|
||||
uniqueId: "Id", //每一行的唯一标识,一般为主键列
|
||||
showToggle: true, //是否显示详细视图和列表视图的切换按钮
|
||||
cardView: false, //是否显示详细视图
|
||||
detailView: false, //是否显示父子表
|
||||
columns: [{
|
||||
checkbox: true
|
||||
}, {
|
||||
field: 'Id',
|
||||
title: 'ID'
|
||||
}, {
|
||||
field: 'GuestbookKind.KindName',
|
||||
title: '所属分类'
|
||||
}, {
|
||||
field: 'Title',
|
||||
title: '留言标题'
|
||||
},
|
||||
{
|
||||
field: 'AddTime',
|
||||
title: '留言时间'
|
||||
},
|
||||
{
|
||||
field: 'IsRead',
|
||||
title: '是否未读',
|
||||
formatter: function (value, row, index) {
|
||||
if (value == 0) {
|
||||
return '未读'
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Id',
|
||||
title: '操作',
|
||||
formatter: 'actionFormatter'
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
//得到查询的参数
|
||||
oTableInit.queryParams = function (params) {
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
kid:$("#kid").val(),
|
||||
departmentname: $("#keyword").val()
|
||||
};
|
||||
return temp;
|
||||
};
|
||||
return oTableInit;
|
||||
};
|
||||
|
||||
function actionFormatter(value, row, index) {
|
||||
return [
|
||||
'<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog(\'eidtguestbook\', \'查看/审核留言详情\', \'/AdminCP/Guestbook/EditGuestbook/' + value + '\', 0, 0)"><i class="fa fa-edit"></i> 查看/审核</a>',
|
||||
'<a href="javascript:;" class="btn btn-xs btn-danger m-l-xs" title="删除" onclick="doDel(\'/AdminCP/Guestbook/DelGuestbook\',' + value + ');"><i class="fa fa-close"></i> 删除</a>',
|
||||
].join('');
|
||||
}
|
||||
|
||||
var ButtonInit = function () {
|
||||
var oInit = new Object();
|
||||
var postdata = {};
|
||||
|
||||
oInit.Init = function () {
|
||||
//初始化页面上面的按钮事件
|
||||
};
|
||||
|
||||
return oInit;
|
||||
};
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,350 @@
|
||||
@model COMCMS.Core.Order
|
||||
@{
|
||||
ViewBag.title = "查看/编辑订单详情";
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editOrderForm", @class = "form-horizontal m-t", onsubmit = "return false;" }))
|
||||
{
|
||||
<div class="tabs-container">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#tab-1" aria-expanded="true"> 订单基本信息</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-2" aria-expanded="false"> 订单日志</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.OrderNum</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.UserName (@Model.UId)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.Title</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.TotalPrice.ToString("N2")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">运费:</label>
|
||||
<div class="col-sm-8 form-inline">
|
||||
<label class="control-label">@Model.Fare.ToString("N2")</label>
|
||||
@if (Model.PaymentStatus == "未支付")
|
||||
{
|
||||
<input type="text" value="@Model.Fare.ToString("N2")" class="form-control" name="Fare" id="Fare" /> <button class="btn btn-primary btn-sm" onclick="doChangeFare();" type="button">修改运费</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">总支付金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.TotalPay.ToString("N2") = @Model.TotalPrice.ToString("N2") + @Model.Fare.ToString("N2") (总支付价格 = 订单总价格 + 运费)</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">收货人:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.RealName</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">电话:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">
|
||||
@Model.Tel
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">详细地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.Address</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">
|
||||
@Model.OrderStatus
|
||||
@if (Model.OrderStatus == Utils.OrdersState[0])
|
||||
{
|
||||
<button class="btn btn-primary btn-sm" onclick="doAction('/AdminCP/Order/ConfirmOrder',@Model.Id,'您确认收到订单?将订单改成已确认?')" type="button">确认订单</button>
|
||||
}
|
||||
@if (Model.OrderStatus == Utils.OrdersState[1] && Model.PaymentStatus == Utils.PaymentState[1] && !string.IsNullOrEmpty(Model.DeliverNO))
|
||||
{
|
||||
<button class="btn btn-primary btn-sm" onclick="doAction('/AdminCP/Order/CompleteOrder',@Model.Id,'您确认订单已经完成?将订单改成【已完成】?')" type="button">订单已完成</button>
|
||||
}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跟单员:</label>
|
||||
<div class="col-sm-8 form-inline">
|
||||
<label class="control-label">
|
||||
姓名:<input type="text" value="@Model.Flag1" class="form-control" name="Flag1" id="Flag1" placeholder="跟单员姓名" />
|
||||
电话:<input type="text" value="@Model.Flag2" class="form-control" name="Flag2" id="Flag2" placeholder="跟单员电话" />
|
||||
<button class="btn btn-primary btn-sm" onclick="doChangeFlowerInfo();" type="button">修改跟单信息</button>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.PaymentStatus</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">配送状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.DeliverStatus</label>
|
||||
</div>
|
||||
</div>
|
||||
@if (Model.PaymentStatus == Utils.PaymentState[1])
|
||||
{
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">物流配送:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">
|
||||
物流:@Model.DeliverType 单号:@Model.DeliverNO
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (Model.PaymentStatus == Utils.PaymentState[1] && Model.OrderStatus == Utils.OrdersState[1])
|
||||
{
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">修改物流配送:</label>
|
||||
<div class="col-sm-8 form-inline">
|
||||
<label class="control-label">
|
||||
物流:<input type="text" value="@Model.DeliverType" class="form-control" name="DeliverType" id="DeliverType" placeholder="物流类型,如顺丰、申通" />
|
||||
单号:<input type="text" value="@Model.DeliverNO" class="form-control" name="DeliverNO" id="DeliverNO" placeholder="快递单号" />
|
||||
<button class="btn btn-primary btn-sm" onclick="doChangeDeliver();" type="button">修改物流信息</button>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">下单时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.AddTime.ToString("yyyy-MM-dd HH:mm")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">下单IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.IP</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否完成:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@(Model.IsEnd == 1 ? "是" : "否")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品列表:</label>
|
||||
<div class="col-sm-8">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<th>产品规格</th>
|
||||
<th>产品单价</th>
|
||||
<th>商品数量</th>
|
||||
<th>金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="loantb">
|
||||
@foreach (OrderDetail item in ViewBag.list)
|
||||
{
|
||||
Product p = Product.FindById(item.PId);
|
||||
<tr>
|
||||
<td>@p.Title</td>
|
||||
<td>@item.Spec</td>
|
||||
<td>¥ @item.Price.ToString("N2")</td>
|
||||
<td>@item.Qty</td>
|
||||
<td>¥ @((item.Price * item.Qty).ToString("N2"))</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab-2" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
订单日志
|
||||
</div>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>用户ID</th>
|
||||
<th>操作日志</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="loantb">
|
||||
@foreach (COMCMS.Core.OrderLog item in ViewBag.OrderLogList)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.Id</td>
|
||||
<td>@item.UId</td>
|
||||
<td>@item.Actions</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row white-bg">
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-3">
|
||||
<input type="hidden" value="@Model.Id" id="Id" name="Id" />
|
||||
<button class="btn btn-default" type="button" onclick="closethisdialog();"><i class="fa fa-close"></i> 关闭页面 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function doChangeFare() {
|
||||
var Fare = $("#Fare").val();
|
||||
if (Fare == "") {
|
||||
alert('请输入一个运费金额!');
|
||||
return false;
|
||||
}
|
||||
var Id = $("#Id").val();
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/AdminCP/Order/DoChangeOrderFare",
|
||||
data: { id: Id, fare: Fare },
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.Status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.Message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.Message, { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function doChangeDeliver() {
|
||||
var DeliverType = $("#DeliverType").val();
|
||||
var DeliverNO = $("#DeliverNO").val();
|
||||
if (DeliverNO == "") {
|
||||
alert('请输入运单号!');
|
||||
return false;
|
||||
}
|
||||
var Id = $("#Id").val();
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/AdminCP/Order/DoChangeOrderDeliver",
|
||||
data: { id: Id, DeliverType: DeliverType, DeliverNO: DeliverNO },
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.Status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.Message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.Message, { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function doChangeFlowerInfo() {
|
||||
var Flag1 = $("#Flag1").val();
|
||||
var Flag2 = $("#Flag2").val();
|
||||
if (Flag1 == "") {
|
||||
alert('请输入跟单员姓名!');
|
||||
return false;
|
||||
}
|
||||
if (Flag2 == "") {
|
||||
alert('请输入跟单员电话!');
|
||||
return false;
|
||||
}
|
||||
var Id = $("#Id").val();
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/AdminCP/Order/DoChangeOrderFlowerInfo",
|
||||
data: { id: Id, Flag1: Flag1, Flag2: Flag2 },
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.Status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.Message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.Message, { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,196 @@
|
||||
|
||||
@{
|
||||
ViewBag.title = "订单管理";
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch();">
|
||||
<div>
|
||||
<label class="control-label">订单状态:</label>
|
||||
<select class="form-control" name="status" id="status">
|
||||
<option value="">不限状态</option>
|
||||
<option value="未确认">未确认</option>
|
||||
<option value="已确认">已确认</option>
|
||||
<option value="已完成">已完成</option>
|
||||
</select>
|
||||
<label class="control-label">支付状态:</label>
|
||||
<select class="form-control" name="paystatus" id="paystatus">
|
||||
<option value="">不限状态</option>
|
||||
<option value="未支付">未支付</option>
|
||||
<option value="已支付">已支付</option>
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
//1.初始化Table
|
||||
var oTable = new TableInit();
|
||||
oTable.Init();
|
||||
|
||||
//2.初始化Button的点击事件
|
||||
var oButtonInit = new ButtonInit();
|
||||
oButtonInit.Init();
|
||||
|
||||
});
|
||||
function doSearch() {
|
||||
var params = $('#tb_departments').bootstrapTable('getOptions');
|
||||
//console.log(params);
|
||||
params.queryParams = function (params) {
|
||||
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
status: $("#status").val(),
|
||||
paystatus: $("#paystatus").val(),
|
||||
keyword: $("#keyword").val()
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
$('#tb_departments').bootstrapTable('refresh', params);
|
||||
return false;
|
||||
}
|
||||
var TableInit = function () {
|
||||
var oTableInit = new Object();
|
||||
//初始化Table
|
||||
oTableInit.Init = function () {
|
||||
$('#tb_departments').bootstrapTable({
|
||||
url: '/AdminCP/Order/GetOrderList', //请求后台的URL(*)
|
||||
method: 'get', //请求方式(*)
|
||||
toolbar: '#toolbar', //工具按钮用哪个容器
|
||||
striped: true, //是否显示行间隔色
|
||||
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
||||
pagination: true, //是否显示分页(*)
|
||||
sortable: false, //是否启用排序
|
||||
sortOrder: "asc", //排序方式
|
||||
queryParams: oTableInit.queryParams,//传递参数(*)
|
||||
sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
|
||||
pageNumber: 1, //初始化加载第一页,默认第一页
|
||||
pageSize: 25, //每页的记录行数(*)
|
||||
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
||||
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
||||
strictSearch: true,
|
||||
showColumns: true, //是否显示所有的列
|
||||
showRefresh: true, //是否显示刷新按钮
|
||||
minimumCountColumns: 2, //最少允许的列数
|
||||
clickToSelect: true, //是否启用点击选中行
|
||||
height: 0, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度
|
||||
uniqueId: "Id", //每一行的唯一标识,一般为主键列
|
||||
showToggle: true, //是否显示详细视图和列表视图的切换按钮
|
||||
cardView: false, //是否显示详细视图
|
||||
detailView: false, //是否显示父子表
|
||||
columns: [{
|
||||
checkbox: true
|
||||
}, {
|
||||
field: 'Id',
|
||||
title: 'ID'
|
||||
}, {
|
||||
field: 'OrderNum',
|
||||
title: '订单号'
|
||||
}, {
|
||||
field: 'Title',
|
||||
title: '商品标题'
|
||||
},
|
||||
{
|
||||
field: 'AddTime',
|
||||
title: '下单时间',
|
||||
formatter: function (value, row, index) {
|
||||
return value.replace("T", " ");
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'RealName',
|
||||
title: '订购人'
|
||||
},
|
||||
{
|
||||
field: 'Tel',
|
||||
title: '联系电话'
|
||||
},
|
||||
{
|
||||
field: 'TotalPrice',
|
||||
title: '商品总价'
|
||||
},
|
||||
{
|
||||
field: 'Fare',
|
||||
title: '运费'
|
||||
},
|
||||
{
|
||||
field: 'TotalPay',
|
||||
title: '支付总价'
|
||||
},
|
||||
{
|
||||
field: 'OrderStatus',
|
||||
title: '订单状态'
|
||||
},
|
||||
{
|
||||
field: 'PaymentStatus',
|
||||
title: '支付状态'
|
||||
},
|
||||
{
|
||||
field: 'DeliverStatus',
|
||||
title: '配送状态'
|
||||
},
|
||||
{
|
||||
field: 'Id',
|
||||
title: '操作',
|
||||
formatter: 'actionFormatter'
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
//得到查询的参数
|
||||
oTableInit.queryParams = function (params) {
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
status: $("#status").val(),
|
||||
paystatus: $("#paystatus").val(),
|
||||
departmentname: $("#keyword").val()
|
||||
};
|
||||
return temp;
|
||||
};
|
||||
return oTableInit;
|
||||
};
|
||||
|
||||
function actionFormatter(value, row, index) {
|
||||
return [
|
||||
'<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog(\'eidtads\', \'查看/编辑订单详情\', \'/AdminCP/Order/EditOrder/' + value + '\', 0, 0)"><i class="fa fa-edit"></i> 查看/编辑</a>',
|
||||
'<a href="javascript:;" class="btn btn-xs btn-danger m-l-xs" title="删除" onclick="doDel(\'/AdminCP/Order/DelOrder\',' + value + ');"><i class="fa fa-close"></i> 删除</a>',
|
||||
].join('');
|
||||
}
|
||||
|
||||
var ButtonInit = function () {
|
||||
var oInit = new Object();
|
||||
var postdata = {};
|
||||
|
||||
oInit.Init = function () {
|
||||
//初始化页面上面的按钮事件
|
||||
};
|
||||
|
||||
return oInit;
|
||||
};
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
|
||||
@{
|
||||
ViewBag.title = "在线支付记录";
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch();">
|
||||
<div>
|
||||
<label class="control-label">支付类型:</label>
|
||||
<select class="form-control" name="mytype" id="mytype">
|
||||
<option value="0">不限状态</option>
|
||||
<option value="1">商品订单</option>
|
||||
<option value="2">快餐订单</option>
|
||||
<option value="3">酒店预定</option>
|
||||
<option value="99" selected>代理商认证费订单</option>
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
//1.初始化Table
|
||||
var oTable = new TableInit();
|
||||
oTable.Init();
|
||||
|
||||
//2.初始化Button的点击事件
|
||||
var oButtonInit = new ButtonInit();
|
||||
oButtonInit.Init();
|
||||
|
||||
});
|
||||
function doSearch() {
|
||||
var params = $('#tb_departments').bootstrapTable('getOptions');
|
||||
//console.log(params);
|
||||
params.queryParams = function (params) {
|
||||
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
mytype: $("#mytype").val(),
|
||||
keyword: $("#keyword").val()
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
$('#tb_departments').bootstrapTable('refresh', params);
|
||||
return false;
|
||||
}
|
||||
var TableInit = function () {
|
||||
var oTableInit = new Object();
|
||||
//初始化Table
|
||||
oTableInit.Init = function () {
|
||||
$('#tb_departments').bootstrapTable({
|
||||
url: '/AdminCP/Order/GetPayOnlineList', //请求后台的URL(*)
|
||||
method: 'get', //请求方式(*)
|
||||
toolbar: '#toolbar', //工具按钮用哪个容器
|
||||
striped: true, //是否显示行间隔色
|
||||
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
||||
pagination: true, //是否显示分页(*)
|
||||
sortable: false, //是否启用排序
|
||||
sortOrder: "asc", //排序方式
|
||||
queryParams: oTableInit.queryParams,//传递参数(*)
|
||||
sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
|
||||
pageNumber: 1, //初始化加载第一页,默认第一页
|
||||
pageSize: 25, //每页的记录行数(*)
|
||||
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
||||
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
||||
strictSearch: true,
|
||||
showColumns: true, //是否显示所有的列
|
||||
showRefresh: true, //是否显示刷新按钮
|
||||
minimumCountColumns: 2, //最少允许的列数
|
||||
clickToSelect: true, //是否启用点击选中行
|
||||
height: 0, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度
|
||||
uniqueId: "Id", //每一行的唯一标识,一般为主键列
|
||||
showToggle: true, //是否显示详细视图和列表视图的切换按钮
|
||||
cardView: false, //是否显示详细视图
|
||||
detailView: false, //是否显示父子表
|
||||
columns: [{
|
||||
checkbox: true
|
||||
}, {
|
||||
field: 'Id',
|
||||
title: 'ID'
|
||||
}, {
|
||||
field: 'PayOrderNum',
|
||||
title: '支付单号'
|
||||
},
|
||||
{
|
||||
field: 'MyType',
|
||||
title: '订单类型',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return "商品订单";
|
||||
case 2:
|
||||
return "快餐订单";
|
||||
case 3:
|
||||
return "酒店预定";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Title',
|
||||
title: '订单标题'
|
||||
},
|
||||
{
|
||||
field: 'OrderNum',
|
||||
title: '订单号'
|
||||
},
|
||||
{
|
||||
field: 'AddTime',
|
||||
title: '支付时间',
|
||||
formatter: function (value, row, index) {
|
||||
return value.replace("T", " ");
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'UserName',
|
||||
title: '支付用户'
|
||||
},
|
||||
{
|
||||
field: 'TotalPrice',
|
||||
title: '商品总价'
|
||||
},
|
||||
{
|
||||
field: 'TotalQty',
|
||||
title: '商品数量'
|
||||
},
|
||||
{
|
||||
field: 'PayType',
|
||||
title: '支付类型'
|
||||
},
|
||||
{
|
||||
field: 'IP',
|
||||
title: '用户IP'
|
||||
},
|
||||
{
|
||||
field: 'ReceiveTime',
|
||||
title: '支付完成时间',
|
||||
formatter: function (value, row, index) {
|
||||
return value.replace("T", " ");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
//得到查询的参数
|
||||
oTableInit.queryParams = function (params) {
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
mytype: $("#mytype").val(),
|
||||
departmentname: $("#keyword").val()
|
||||
};
|
||||
return temp;
|
||||
};
|
||||
return oTableInit;
|
||||
};
|
||||
|
||||
function actionFormatter(value, row, index) {
|
||||
return [
|
||||
'<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog(\'eidtads\', \'查看/编辑订单详情\', \'/AdminCP/Order/EditOrder/' + value + '\', 0, 0)"><i class="fa fa-edit"></i> 查看/编辑</a>',
|
||||
'<a href="javascript:;" class="btn btn-xs btn-danger m-l-xs" title="删除" onclick="doDel(\'/AdminCP/Order/DelOrder\',' + value + ');"><i class="fa fa-close"></i> 删除</a>',
|
||||
].join('');
|
||||
}
|
||||
|
||||
var ButtonInit = function () {
|
||||
var oInit = new Object();
|
||||
var postdata = {};
|
||||
|
||||
oInit.Init = function () {
|
||||
//初始化页面上面的按钮事件
|
||||
};
|
||||
|
||||
return oInit;
|
||||
};
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user