增加商品分类、商品、用户组、用户管理
This commit is contained in:
@@ -584,5 +584,430 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 用户组管理
|
||||
[MyAuthorize( "viewlist", "memberrole")]
|
||||
public IActionResult MemberRole()
|
||||
{
|
||||
IList<MemberRoles> list = MemberRoles.FindAll(MemberRoles._.Id > 0, MemberRoles._.Rank.Asc(), null, 0, 0);
|
||||
Core.Admin.WriteLogActions("查看用户组列表;");
|
||||
return View(list);
|
||||
}
|
||||
|
||||
//添加管理组
|
||||
[MyAuthorize("add", "memberrole")]
|
||||
public IActionResult AddMemberRole()
|
||||
{
|
||||
//获取所有的菜单列表
|
||||
IList<AdminMenu> list = AdminMenu.GetListTree(0, -1, false, false);
|
||||
ViewBag.MenuList = list;
|
||||
Core.Admin.WriteLogActions("查看添加用户组;");
|
||||
return View();
|
||||
}
|
||||
//执行添加用户组
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "memberrole", "JSON")]
|
||||
public IActionResult AddMemberRole(FormCollection fc)
|
||||
{
|
||||
string RoleName = fc["RoleName"];
|
||||
string RoleDescription = fc["RoleDescription"];
|
||||
string NotAllowDel = fc["NotAllowDel"];
|
||||
string Rank = fc["Rank"];
|
||||
string CashBack = fc["CashBack"];
|
||||
string ParentCashBack = fc["ParentCashBack"];
|
||||
string GrandfatherCashBack = fc["GrandfatherCashBack"];
|
||||
string IsHalved = fc["IsHalved"];
|
||||
string YearsPerformance = fc["YearsPerformance"];
|
||||
string JoinPrice = fc["JoinPrice"];
|
||||
|
||||
if (string.IsNullOrEmpty(RoleName))
|
||||
{
|
||||
tip.Message = "用户组名称不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsInt(Rank))
|
||||
{
|
||||
tip.Message = "排序只能是数字!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsDecimal(CashBack))
|
||||
{
|
||||
tip.Message = "返现金额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsDecimal(ParentCashBack))
|
||||
{
|
||||
tip.Message = "父级返现金额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsDecimal(ParentCashBack))
|
||||
{
|
||||
tip.Message = "爷级返现金额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsDecimal(YearsPerformance))
|
||||
{
|
||||
tip.Message = "年销售额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsDecimal(JoinPrice))
|
||||
{
|
||||
tip.Message = "入驻费用格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
MemberRoles entity = new MemberRoles();
|
||||
entity.RoleName = RoleName;
|
||||
entity.RoleDescription = RoleDescription;
|
||||
entity.NotAllowDel = !string.IsNullOrEmpty(NotAllowDel) && NotAllowDel == "1" ? 1 : 0;
|
||||
entity.IsHalved = !string.IsNullOrEmpty(IsHalved) && IsHalved == "1" ? 1 : 0;
|
||||
entity.Rank = int.Parse(Rank);
|
||||
entity.CashBack = decimal.Parse(CashBack);
|
||||
entity.ParentCashBack = decimal.Parse(ParentCashBack);
|
||||
entity.GrandfatherCashBack = decimal.Parse(GrandfatherCashBack);
|
||||
entity.YearsPerformance = decimal.Parse(YearsPerformance);
|
||||
entity.JoinPrice = decimal.Parse(JoinPrice);
|
||||
entity.Insert();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加用户组成功";
|
||||
tip.ReturnUrl = "close";
|
||||
Core.Admin.WriteLogActions($"添加新用户组({entity.Id});");
|
||||
return Json(tip);
|
||||
}
|
||||
//编辑用户组
|
||||
[MyAuthorize("edit", "memberrole")]
|
||||
public IActionResult EditMemberRole(int id)
|
||||
{
|
||||
MemberRoles entity = MemberRoles.Find(MemberRoles._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!", 0, true, "");
|
||||
}
|
||||
Core.Admin.WriteLogActions($"查看/编辑用户组({id})详情;");
|
||||
return View(entity);
|
||||
}
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "memberrole", "JSON")]
|
||||
public IActionResult EditMemberRole(MemberRoles model)
|
||||
{
|
||||
if (model.Id <=0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(model.RoleName))
|
||||
{
|
||||
tip.Message = "用户组名称不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if (model.CashBack <0)
|
||||
{
|
||||
tip.Message = "返现金额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.ParentCashBack <0)
|
||||
{
|
||||
tip.Message = "父级返现金额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.GrandfatherCashBack<0)
|
||||
{
|
||||
tip.Message = "爷级返现金额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.YearsPerformance <0)
|
||||
{
|
||||
tip.Message = "年销售额格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.JoinPrice <0)
|
||||
{
|
||||
tip.Message = "入驻费用格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
MemberRoles entity = MemberRoles.Find(MemberRoles._.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.RoleName = model.RoleName;
|
||||
entity.RoleDescription = model.RoleDescription;
|
||||
entity.NotAllowDel = model.NotAllowDel;
|
||||
entity.IsHalved = model.IsHalved;
|
||||
entity.Rank = model.Rank;
|
||||
entity.CashBack = model.CashBack;
|
||||
entity.ParentCashBack = model.ParentCashBack;
|
||||
entity.GrandfatherCashBack = model.GrandfatherCashBack;
|
||||
entity.YearsPerformance = model.YearsPerformance;
|
||||
entity.JoinPrice = model.JoinPrice;
|
||||
entity.Update();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑用户组成功";
|
||||
tip.ReturnUrl = "close";
|
||||
Core.Admin.WriteLogActions($"编辑用户组({entity.Id});");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//删除用户组
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "memberrole", "JSON")]
|
||||
public IActionResult DelMemberRole(int id)
|
||||
{
|
||||
MemberRoles entity = MemberRoles.Find(MemberRoles._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本用户组详情!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (entity.NotAllowDel == 1)
|
||||
{
|
||||
tip.Message = "本管理组设定不允许删除,如果需要删除,请先解除限制!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//删除管理组,并删除旗下所有管理员
|
||||
Core.Admin.WriteLogActions($"执行删除用户组({entity.Id}:{entity.RoleName})详情;");
|
||||
entity.Delete();
|
||||
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除用户组成功";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 用户管理
|
||||
[MyAuthorize("viewlist", "members")]
|
||||
public IActionResult Members()
|
||||
{
|
||||
//加载用户组
|
||||
IList<MemberRoles> list = MemberRoles.FindAll(MemberRoles._.Id > 0, MemberRoles._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.RoleList = list;
|
||||
Core.Admin.WriteLogActions("查看用户列表;");
|
||||
return View();
|
||||
}
|
||||
[MyAuthorize("viewlist", "members", "JSON")]
|
||||
public IActionResult GetMembers(string keyword, int page = 1, int limit = 20, int roleid = 0, int groupid = 0)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
long totalCount = 0;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Member._.Id > 0;
|
||||
|
||||
if (roleid > 0)
|
||||
ex &= Member._.RoleId == roleid;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
ex &= (Member._.RealName.Contains(keyword) | Member._.Tel.Contains(keyword));
|
||||
|
||||
IList<Member> list = Member.FindAll(ex, null, null, startRowIndex, numPerPage);
|
||||
totalCount = Member.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||
}
|
||||
//查看,编辑用户信息
|
||||
[MyAuthorize("add", "members")]
|
||||
public IActionResult AddMember()
|
||||
{
|
||||
IList<MemberRoles> list = MemberRoles.FindAll(MemberRoles._.Id > 0, MemberRoles._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.RoleList = list;
|
||||
ViewBag.allmember = Member.FindAll(Member._.Id > 0 & Member._.IsLock != 1, null, null, 0, 0);
|
||||
|
||||
Core.Admin.WriteLogActions($"查看添加用户页面;");
|
||||
Member model = new Member();
|
||||
return View(model);
|
||||
}
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "members", "JSON")]
|
||||
public IActionResult AddMember(Member model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.UserName))
|
||||
{
|
||||
tip.Message = "用户名必须是一个手机号码!";
|
||||
return Json(tip);
|
||||
}
|
||||
//判断用户是否存在
|
||||
if (Member.FindCount(Member._.UserName == model.UserName, null, null, 0, 0) > 0)
|
||||
{
|
||||
tip.Message = "用户名已经存在!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(model.PassWord) || model.PassWord.Length < 6)
|
||||
{
|
||||
tip.Message = "密码必须不小于6个字符";
|
||||
return Json(tip);
|
||||
}
|
||||
string PassWord2 = Request.Form["PassWord2"];
|
||||
if (model.PassWord != PassWord2)
|
||||
{
|
||||
tip.Message = "两次输入密码不一致,请重新输入!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.Email) && !Utils.IsValidEmail(model.Email))
|
||||
{
|
||||
tip.Message = "邮箱格式错误!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.RoleId <= 0)
|
||||
{
|
||||
tip.Message = "请选择一个用户组!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.Parent == 0 && model.Grandfather != 0)
|
||||
model.Grandfather = 0;
|
||||
//执行添加
|
||||
Member entity = new Member();
|
||||
entity.UserName = model.UserName;
|
||||
entity.Salt = Utils.GetRandomChar(20);
|
||||
entity.PassWord = Utils.MD5(entity.Salt + model.PassWord);
|
||||
entity.Email = model.Email;
|
||||
entity.Tel = model.Tel;
|
||||
entity.Parent = model.Parent;
|
||||
entity.Grandfather = model.Grandfather;
|
||||
entity.IsLock = 0;
|
||||
entity.RoleId = model.RoleId;
|
||||
entity.RealName = model.RealName;
|
||||
entity.RegIP = "127.0.0.1";
|
||||
entity.RegTime = DateTime.Now;
|
||||
entity.Balance = 0;
|
||||
entity.GiftBalance = 0;
|
||||
entity.ExtCredits1 = 0;
|
||||
entity.ExtCredits2 = 0;
|
||||
entity.ExtCredits3 = 0;
|
||||
entity.ExtCredits4 = 0;
|
||||
entity.ExtCredits5 = 0;
|
||||
entity.TotalCredits = 0;
|
||||
entity.YearsPerformance = 0;
|
||||
entity.Insert();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加用户成功";
|
||||
tip.ReturnUrl = "close";
|
||||
Core.Admin.WriteLogActions($"添加用户({entity.Id}/{entity.UserName});");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
|
||||
//查看,编辑用户信息
|
||||
[MyAuthorize("edit", "members")]
|
||||
public IActionResult EditMember(int id)
|
||||
{
|
||||
IList<MemberRoles> list = MemberRoles.FindAll(MemberRoles._.Id > 0, MemberRoles._.Rank.Asc(), null, 0, 0);
|
||||
ViewBag.RoleList = list;
|
||||
|
||||
Member entity = Member.Find(Core.Member._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
ViewBag.allmember = Member.FindAll(Member._.Id > 0 & Member._.IsLock != 1 & Member._.Id != entity.Id, null, null, 0, 0);
|
||||
//获取用户余额变化记录
|
||||
IList<BalanceChangeLog> listbalancelogs = BalanceChangeLog.FindAll(BalanceChangeLog._.UId == entity.Id, null, null, 0, 0);
|
||||
ViewBag.listbalancelogs = listbalancelogs;
|
||||
|
||||
IList<RebateChangeLog> listrechargebalancelogs = RebateChangeLog.FindAll(RebateChangeLog._.UId == entity.Id, null, null, 0, 0);
|
||||
ViewBag.listrechargebalancelogs = listrechargebalancelogs;
|
||||
|
||||
|
||||
|
||||
Core.Admin.WriteLogActions($"查看/编辑用户({entity.UserName});");
|
||||
return View(entity);
|
||||
}
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "members", "JSON")]
|
||||
public IActionResult EditMember(Member model)
|
||||
{
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误请求";
|
||||
return Json(tip);
|
||||
}
|
||||
Member entity = Member.FindById(model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.PassWord))
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.PassWord) || model.PassWord.Length < 6)
|
||||
{
|
||||
tip.Message = "密码必须不小于6个字符";
|
||||
return Json(tip);
|
||||
}
|
||||
string PassWord2 = Request.Form["PassWord2"];
|
||||
if (model.PassWord != PassWord2)
|
||||
{
|
||||
tip.Message = "两次输入密码不一致,请重新输入!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.PassWord = Utils.MD5(entity.Salt + model.PassWord);
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.UserName))
|
||||
{
|
||||
tip.Message = "用户名必须是一个手机号码!";
|
||||
return Json(tip);
|
||||
}
|
||||
//判断用户是否存在
|
||||
if (Member.FindCount(Member._.UserName == model.UserName & Member._.Id != entity.Id, null, null, 0, 0) > 0)
|
||||
{
|
||||
tip.Message = "用户名已经存在,请重新填写一个!";
|
||||
return Json(tip);
|
||||
}
|
||||
string IsVerifySellers = Request.Form["IsVerifySellers"];
|
||||
entity.UserName = model.UserName;
|
||||
entity.Email = model.Email;
|
||||
entity.Tel = model.UserName;
|
||||
entity.Parent = model.Parent;
|
||||
entity.Grandfather = model.Grandfather;
|
||||
entity.RoleId = model.RoleId;
|
||||
entity.RealName = model.RealName;
|
||||
entity.Phone = model.Phone;
|
||||
entity.Alipay = model.Alipay;
|
||||
entity.Bank = model.Bank;
|
||||
entity.BankCardNO = model.BankCardNO;
|
||||
entity.Skype = model.Skype;
|
||||
if (IsVerifySellers == "")
|
||||
{
|
||||
entity.IsVerifySellers = 1;
|
||||
}
|
||||
else
|
||||
entity.IsVerifySellers = 0;
|
||||
|
||||
entity.Update();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑用户成功";
|
||||
tip.ReturnUrl = "close";
|
||||
Core.Admin.WriteLogActions($"编辑用户({entity.Id}/{entity.UserName});");
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除用户
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "members", "JSON")]
|
||||
public IActionResult DelMember(int id)
|
||||
{
|
||||
Member he = Member.Find(Member._.Id == id);
|
||||
if (he == null)
|
||||
{
|
||||
tip.Message = "系统找不到本用户!";
|
||||
return Json(tip);
|
||||
}
|
||||
he.Delete();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除用户成功!";
|
||||
Core.Admin.WriteLogActions($"删除用户({he.Id}|{he.UserName});");
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
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 ProductController : AdminBaseController
|
||||
{
|
||||
#region 商品栏目
|
||||
/// <summary>
|
||||
/// 商品栏目列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MyAuthorize("viewlist", "category")]
|
||||
public IActionResult CategoryList()
|
||||
{
|
||||
IList<Category> list = Category.GetListTree(0, -1, false, true);
|
||||
Core.Admin.WriteLogActions("查看商品栏目列表页面;");
|
||||
return View(list);
|
||||
}
|
||||
|
||||
[MyAuthorize("add", "category")]
|
||||
public IActionResult AddCategory()
|
||||
{
|
||||
//获取上级栏目
|
||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListTree = list;
|
||||
//获取模板
|
||||
//List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
|
||||
//ViewBag.ListTpl = listtpl;
|
||||
Core.Admin.WriteLogActions("查看添加商品栏目页面;");
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "category", "JSON")]
|
||||
public IActionResult AddCategory(Category model)
|
||||
{
|
||||
//获取上级栏目
|
||||
if (string.IsNullOrWhiteSpace(model.KindName))
|
||||
{
|
||||
tip.Message = "商品栏目标题不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
model.Insert();
|
||||
Core.Admin.WriteLogActions("添加商品栏目(id:" + model.Id + ");");
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加商品栏目成功";
|
||||
tip.ReturnUrl = "close";
|
||||
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//编辑栏目
|
||||
[MyAuthorize("edit", "category")]
|
||||
public IActionResult EditCategory(int id)
|
||||
{
|
||||
Category entity = Category.Find(Category._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
//获取上级栏目
|
||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListTree = list;
|
||||
//获取模板
|
||||
//List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
|
||||
//ViewBag.ListTpl = listtpl;
|
||||
Core.Admin.WriteLogActions("查看/编辑商品栏目(id:" + id + ")页面;");
|
||||
return View(entity);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "category", "JSON")]
|
||||
public IActionResult EditCategory(Category model)
|
||||
{
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.KindName))
|
||||
{
|
||||
tip.Message = "商品栏目标题不能为空!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Category entity = Category.Find(Category._.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
Json(tip);
|
||||
}
|
||||
|
||||
if (entity.PId != model.PId)
|
||||
{
|
||||
if (entity.Id == model.PId)
|
||||
{
|
||||
tip.Message = "上级栏目不能选择本身!";
|
||||
return Json(tip);
|
||||
}
|
||||
entity.PId = model.PId;
|
||||
entity.Location = Category.GetNewLocation(model.PId);
|
||||
entity.Level = Category.GetNewLevel(model.PId);
|
||||
//修改商品的location
|
||||
IList<Product> alist = Product.FindAll(Product._.KId == model.Id, null, null, 0, 0);
|
||||
if (alist != null && alist.Count > 0)
|
||||
{
|
||||
foreach (var a in alist)
|
||||
{
|
||||
a.Location = entity.Location + "," + entity.Id;
|
||||
//a.FilePath = entity.FilePath;
|
||||
}
|
||||
alist.Save();
|
||||
}
|
||||
}
|
||||
//赋值
|
||||
entity.PId = model.PId;
|
||||
entity.KindName = model.KindName;
|
||||
entity.SubTitle = model.SubTitle;
|
||||
entity.KindTitle = model.KindTitle;
|
||||
entity.Keyword = model.Keyword;
|
||||
entity.Description = model.Description;
|
||||
entity.LinkURL = model.LinkURL;
|
||||
entity.TitleColor = model.TitleColor;
|
||||
entity.TemplateFile = model.TemplateFile;
|
||||
entity.DetailTemplateFile = model.DetailTemplateFile;
|
||||
entity.IsList = model.IsList;
|
||||
entity.PageSize = model.PageSize <= 0 ? 15 : model.PageSize;
|
||||
entity.IsLock = model.IsLock;
|
||||
entity.IsHide = model.IsHide;
|
||||
entity.IsShowSubDetail = model.IsShowSubDetail;
|
||||
entity.BannerImg = model.BannerImg;
|
||||
entity.Pic = model.Pic;
|
||||
entity.KindInfo = model.KindInfo;
|
||||
entity.KindDomain = model.KindDomain;
|
||||
entity.Rank = model.Rank;
|
||||
entity.Pic = model.Pic;
|
||||
|
||||
|
||||
entity.Save();
|
||||
Core.Admin.WriteLogActions("修改商品栏目(id:" + entity.Id + ");");
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "修改商品栏目成功";
|
||||
tip.ReturnUrl = "close";
|
||||
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
//删除栏目
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "category", "JSON")]
|
||||
public JsonResult DelCategory(int id)
|
||||
{
|
||||
Category entity = Category.Find(Category._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本商品栏目!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (Category.FindCount(Category._.PId == entity.Id, null, null, 0, 0) > 0)
|
||||
{
|
||||
tip.Message = "本栏目有下级栏目,不允许删除!";
|
||||
return Json(tip);
|
||||
}
|
||||
//删除商品
|
||||
IList<Product> list = Product.FindAll(Product._.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", "product")]
|
||||
public IActionResult ProductList()
|
||||
{
|
||||
//获取上级栏目
|
||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListKinds = list;
|
||||
Core.Admin.WriteLogActions("查看商品列表;");
|
||||
return View();
|
||||
}
|
||||
|
||||
[MyAuthorize("viewlist", "product", "JSON")]
|
||||
public IActionResult GetProductList(string keyword, int page = 1, int limit = 20)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Product._.Id > 0;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
{
|
||||
if (Utils.IsInt(keyword))
|
||||
{
|
||||
ex &= (Product._.Id == int.Parse(keyword) | Product._.Title.Contains(keyword));
|
||||
}
|
||||
else
|
||||
{
|
||||
ex &= Product._.Title.Contains(keyword);
|
||||
}
|
||||
}
|
||||
string kid = Request.Query["kid"];
|
||||
string isshowsub = Request.Query["isshowsub"];
|
||||
if (Utils.IsInt(kid) && int.Parse(kid) > 0)
|
||||
{
|
||||
//获取栏目
|
||||
if (isshowsub == "1")
|
||||
{
|
||||
List<int> kids = new List<int>();
|
||||
kids.Add(int.Parse(kid));
|
||||
IList<Category> subkinds = Category.FindByParentID(int.Parse(kid));
|
||||
if (subkinds != null && subkinds.Count > 0)
|
||||
{
|
||||
foreach (var item in subkinds)
|
||||
{
|
||||
kids.Add(item.Id);
|
||||
}
|
||||
ex &= Product._.KId.In(kids);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ex &= Product._.KId == int.Parse(kid);
|
||||
}
|
||||
}
|
||||
|
||||
IList<Product> list = Product.FindAll(ex, Product._.Sequence.Asc().And(Product._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
long totalCount = Product.FindCount(ex, Product._.Sequence.Asc().And(Product._.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);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加商品
|
||||
[HttpGet]
|
||||
[MyAuthorize("add", "product")]
|
||||
public IActionResult AddProduct()
|
||||
{
|
||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListKinds = list;
|
||||
Core.Admin.WriteLogActions("查看添加商品页面;");
|
||||
Product entity = new Product();
|
||||
entity.AddTime = DateTime.Now;
|
||||
entity.Sequence = 999;
|
||||
return View(entity);
|
||||
}
|
||||
|
||||
//执行添加商品
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "product", "JSON")]
|
||||
public IActionResult AddProduct(Product model)
|
||||
{
|
||||
if (model.KId <= 0)
|
||||
{
|
||||
tip.Message = "请选择一个商品分类";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.Title))
|
||||
{
|
||||
tip.Message = "请填写商品标题";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.Content))
|
||||
{
|
||||
tip.Message = "请填写商品介绍";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.Pic) && !Utils.IsImgFilename(model.Pic))
|
||||
{
|
||||
tip.Message = "商品图片填写的不是图片格式!";
|
||||
return Json(tip);
|
||||
}
|
||||
//处理商品更多图片
|
||||
string[] moreImgSrc = Request.Form["nImgUrl"];
|
||||
string morIMG = string.Empty;//更多图片的时候用到
|
||||
if (moreImgSrc != null && moreImgSrc.Length > 0)
|
||||
{
|
||||
foreach (string s in moreImgSrc)
|
||||
{
|
||||
if (Utils.IsImgFilename(s))
|
||||
{
|
||||
morIMG += s + "|||";//使用“|||”分隔图片
|
||||
}
|
||||
}
|
||||
}
|
||||
model.ItemImg = morIMG;
|
||||
model.AuthorId = Core.Admin.GetMyInfo().Id;
|
||||
model.Insert();
|
||||
Category.UpdateDetailCount(model.KId);
|
||||
//添加TAG
|
||||
//Tag.InsertTags(model.Tags, RTType.RatuoModule.Product, model.Id, model.Title);
|
||||
Core.Admin.WriteLogActions("添加商品(id:" + model.Id + ");");
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加商品成功";
|
||||
tip.ReturnUrl = "close";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改商品详情
|
||||
//编辑文章
|
||||
[HttpGet]
|
||||
[MyAuthorize("edit", "product")]
|
||||
public IActionResult EditProduct(int id)
|
||||
{
|
||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListKinds = list;
|
||||
|
||||
Product entity = Product.Find(Product._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTipPage("系统找不到本记录!");
|
||||
}
|
||||
|
||||
Core.Admin.WriteLogActions("查看/编辑商品详情(" + id + ");");
|
||||
|
||||
return View(entity);
|
||||
}
|
||||
|
||||
//执行添加商品
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "product", "JSON")]
|
||||
public IActionResult EditProduct(Product model)
|
||||
{
|
||||
if (model.Id <= 0)
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
Json(tip);
|
||||
}
|
||||
Product entity = Product.Find(Product._.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本记录!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (model.KId <= 0)
|
||||
{
|
||||
tip.Message = "请选择一个商品分类";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.Title))
|
||||
{
|
||||
tip.Message = "请填写商品标题";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.Content))
|
||||
{
|
||||
tip.Message = "请填写商品介绍";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.Pic) && !Utils.IsImgFilename(model.Pic))
|
||||
{
|
||||
tip.Message = "商品图片填写的不是图片格式!";
|
||||
return Json(tip);
|
||||
}
|
||||
//处理商品更多图片
|
||||
string[] moreImgSrc = Request.Form["nImgUrl"];
|
||||
string morIMG = string.Empty;//更多图片的时候用到
|
||||
if (moreImgSrc != null && moreImgSrc.Length > 0)
|
||||
{
|
||||
foreach (string s in moreImgSrc)
|
||||
{
|
||||
if (Utils.IsImgFilename(s))
|
||||
{
|
||||
morIMG += s + "|||";//使用“|||”分隔图片
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理三个勾选属性的
|
||||
string isnew = Request.Form["IsNew"];
|
||||
model.IsNew = isnew == "1" ? 1 : 0;
|
||||
|
||||
|
||||
string IsRecommend = Request.Form["IsRecommend"];
|
||||
model.IsRecommend = IsRecommend == "1" ? 1 : 0;
|
||||
|
||||
string IsHide = Request.Form["IsHide"];
|
||||
model.IsHide = IsHide == "1" ? 1 : 0;
|
||||
model.IsHotSales = Request.Form["IsHotSales"] == "1" ? 1 : 0;
|
||||
model.Hits = entity.Hits;
|
||||
model.UpdateTime = DateTime.Now;
|
||||
|
||||
model.ItemImg = morIMG;
|
||||
//model.AuthorId = Core.Admin.GetMyInfo().Id;
|
||||
model.Save();
|
||||
//添加TAG
|
||||
//Tag.InsertTags(model.Tags, RTType.RatuoModule.Product, model.Id, model.Title);
|
||||
Core.Admin.WriteLogActions("编辑商品(id:" + model.Id + ");");
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑商品成功";
|
||||
tip.ReturnUrl = "close";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除商品
|
||||
//删除文章
|
||||
[HttpPost]
|
||||
[MyAuthorize("del", "product", "JSON")]
|
||||
public JsonResult DelProduct(int id)
|
||||
{
|
||||
Product entity = Product.Find(Product._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
tip.Message = "系统找不到本商品!";
|
||||
return Json(tip);
|
||||
}
|
||||
int kid = entity.KId;
|
||||
//删除TAG
|
||||
//Tag.DeleteTag(RTType.RatuoModule.Article, entity.Id);
|
||||
Core.Admin.WriteLogActions("删除商品(id:" + entity.Id + ");");
|
||||
entity.Delete();
|
||||
//更新栏目商品数量
|
||||
Category.UpdateDetailCount(kid);
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "删除商品成功";
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -137,9 +137,7 @@
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="ImgUrlnImgRow@(i)" name="nImgUrl" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="@s">
|
||||
<span class="input-group-btn">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
@model COMCMS.Core.Member
|
||||
@{
|
||||
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 = "addMemberForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
<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">
|
||||
<select class="form-control m-b" name="RoleId" id="RoleId">
|
||||
@foreach (var m in ViewBag.RoleList)
|
||||
{
|
||||
<option value="@m.Id">@m.RoleName</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户名/手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="UserName" name="UserName" maxlength="20" type="text" class="form-control" value="@Model.UserName" required aria-required="true" placeholder="登录用户名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="PassWord" name="PassWord" maxlength="20" type="password" class="form-control" value="" required aria-required="true" placeholder="请填写一个用户密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">重复密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="PassWord2" name="PassWord2" maxlength="20" type="password" class="form-control" value="" required aria-required="true" placeholder="请再次填写用户密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">真实姓名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Realname" name="Realname" maxlength="20" type="text" class="form-control" value="@Model.RealName" aria-required="true" placeholder="真实姓名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">电子邮件:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Email" name="Email" maxlength="100" type="text" class="form-control" value="@Model.Email" aria-required="true" placeholder="电子邮件">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">父级用户:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control m-b" name="Parent" id="Parent">
|
||||
<option value="0">顶层用户,无父级用户</option>
|
||||
@foreach (COMCMS.Core.Member m in ViewBag.allmember)
|
||||
{
|
||||
<option value="@m.Id" >@m.UserName(@m.RealName)</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">爷级用户:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control m-b" name="Grandfather" id="Grandfather">
|
||||
<option value="0">顶层用户,无爷级用户</option>
|
||||
@foreach (COMCMS.Core.Member m in ViewBag.allmember)
|
||||
{
|
||||
<option value="@m.Id" >@m.UserName(@m.RealName)</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:none">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QQ:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="QQ" name="QQ" maxlength="20" type="text" class="form-control" value="@Model.QQ
|
||||
" required aria-required="true" placeholder="QQ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Weixin" name="Weixin" maxlength="20" type="text" class="form-control" value="@Model.Weixin
|
||||
" required aria-required="true" placeholder="微信" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">省份:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Province" name="Province" maxlength="20" type="text" class="form-control" value="@Model.Province
|
||||
" required aria-required="true" placeholder="省份">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">城市:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="City" name="City" maxlength="20" type="text" class="form-control" value="@Model.City
|
||||
" required aria-required="true" placeholder="城市">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">区域:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="District" name="District" maxlength="20" type="text" class="form-control" value="@Model.District
|
||||
" required aria-required="true" placeholder="区域">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">详细地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Address" name="Address" maxlength="20" type="text" class="form-control" value="@Model.Address
|
||||
" required aria-required="true" placeholder="详细地址">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">银行卡号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="BankCardNO" name="BankCardNO" maxlength="20" type="text" class="form-control" value="@Model.BankCardNO" required aria-required="true" placeholder="银行卡号码" readonly>
|
||||
</div>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab-2" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
温馨提示:此部分信息只读。
|
||||
</div>
|
||||
</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">
|
||||
<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>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
DoPost("addMemberForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,100 @@
|
||||
|
||||
@{
|
||||
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="alert alert-info">
|
||||
说明:“父级返现百分比”和“爷级返现百分比”为本代理级别的下级业绩的抽点。比如说,下级消费1000,那如果“父级返现百分比”为10%。则他有团队业绩提成100。0则没有任何提成。
|
||||
</div>
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "addmemberroleForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户组名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="RoleName" name="RoleName" maxlength="200" type="text" class="form-control" value="" required aria-required="true" placeholder="填写用户组名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户组简介:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="RoleDescription" type="text" class="form-control" name="RoleDescription" placeholder="用户组简介,非必填" value="" maxlength="200">
|
||||
</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="NotAllowDel" id="NotAllowDel"> 不允许删除(勾选则该管理组不允许直接删除)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Rank" type="number" class="form-control" name="Rank" placeholder="排序" value="" maxlength="3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">返现百分比:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="CashBack" type="text" class="form-control" name="CashBack" placeholder="30为30%,消费后返现百分比到自己账号" value="" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">父级返现百分比:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="ParentCashBack" type="text" class="form-control" name="ParentCashBack" placeholder="15为15%,消费后返现百分比到父级账号" value="" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">爷级返现百分比:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="GrandfatherCashBack" type="text" class="form-control" name="GrandfatherCashBack" placeholder="15为15%,消费后返现百分比到爷级账号" value="" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<label class="col-sm-3 control-label">入驻费用:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="JoinPrice" type="text" class="form-control" name="JoinPrice" placeholder="入驻成为本用户组费用" value="" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<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="IsHalved" id="IsHalved"> 超过父级级别是否减半(勾选,则如果自己超过父级级别,提成减半)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<label class="col-sm-3 control-label">年业务量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="YearsPerformance" type="text" class="form-control" name="YearsPerformance" placeholder="年业务量,不达标自动降级" value="" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-3">
|
||||
<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("addmemberroleForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,396 @@
|
||||
@model COMCMS.Core.Member
|
||||
@{
|
||||
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">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editMemberForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
<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>
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-3" aria-expanded="false"> 余额变化记录</a>
|
||||
</li>
|
||||
<li class="hide">
|
||||
<a data-toggle="tab" href="#tab-5" aria-expanded="false"> 赠送余额变化记录</a>
|
||||
</li>
|
||||
<li class="hide">
|
||||
<a data-toggle="tab" href="#tab-6" aria-expanded="false"> 销售返现变化记录</a>
|
||||
</li>
|
||||
<li class="hide">
|
||||
<a data-toggle="tab" href="#tab-4" aria-expanded="false"> 手动充值</a>
|
||||
</li>
|
||||
<li class="hide">
|
||||
<a data-toggle="tab" href="#tab-7" 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">
|
||||
<select class="form-control m-b" asp-for="RoleId">
|
||||
@foreach (var m in ViewBag.RoleList)
|
||||
{
|
||||
<option value="@m.Id">@m.RoleName</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">昵称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Nickname" name="Nickname" maxlength="20" type="text" class="form-control" value="@Model.Nickname" aria-required="true" placeholder="昵称" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hidden">
|
||||
<label class="col-sm-3 control-label">用户名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="UserName" name="UserName" maxlength="20" type="text" class="form-control" value="@Model.UserName" required aria-required="true" placeholder="登录用户名">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Tel" name="Tel" maxlength="20" type="text" class="form-control" value="@Model.Tel" aria-required="true" placeholder="用户手机号码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">修改密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="PassWord" name="PassWord" maxlength="20" type="password" class="form-control" value="" aria-required="true" placeholder="如果修改密码,请填写,不修改,留空">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">重复密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="PassWord2" name="PassWord2" maxlength="20" type="password" class="form-control" value="" aria-required="true" placeholder="请再次填写用户密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">真实姓名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Realname" name="Realname" maxlength="20" type="text" class="form-control" value="@Model.RealName" aria-required="true" placeholder="真实姓名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">电子邮件:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Email" name="Email" maxlength="100" type="text" class="form-control" value="@Model.Email" aria-required="true" placeholder="电子邮件">
|
||||
</div>
|
||||
</div>
|
||||
<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="Parent">
|
||||
<option value="0">顶层用户,无父级用户</option>
|
||||
@foreach (COMCMS.Core.Member m in ViewBag.allmember)
|
||||
{
|
||||
<option value="@m.Id">@System.Web.HttpUtility.UrlDecode(m.RealName)</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">爷级用户:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control m-b" name="Grandfather" id="Grandfather" asp-for="Grandfather">
|
||||
<option value="0">顶层用户,无爷级用户</option>
|
||||
@foreach (COMCMS.Core.Member m in ViewBag.allmember)
|
||||
{
|
||||
<option value="@m.Id">@System.Web.HttpUtility.UrlDecode(m.RealName)</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:none">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QQ:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="QQ" name="QQ" maxlength="20" type="text" class="form-control" value="@Model.QQ
|
||||
" required aria-required="true" placeholder="QQ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Weixin" name="Weixin" maxlength="20" type="text" class="form-control" value="@Model.Weixin
|
||||
" required aria-required="true" placeholder="微信" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">省份:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Province" name="Province" maxlength="20" type="text" class="form-control" value="@Model.Province
|
||||
" required aria-required="true" placeholder="省份">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">城市:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="City" name="City" maxlength="20" type="text" class="form-control" value="@Model.City
|
||||
" required aria-required="true" placeholder="城市">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">区域:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="District" name="District" maxlength="20" type="text" class="form-control" value="@Model.District
|
||||
" required aria-required="true" placeholder="区域">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">详细地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Address" name="Address" maxlength="20" type="text" class="form-control" value="@Model.Address
|
||||
" required aria-required="true" placeholder="详细地址">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">可用余额:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.Balance.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.GiftBalance.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.ExtCredits1.ToString("N2")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系电话:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Phone" name="Phone" type="text" maxlength="20" class="form-control" placeholder="可以设置一个其他的联系电话" value="@Model.Phone">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Alipay" name="Alipay" type="text" maxlength="50" class="form-control" placeholder="请填写您的支付宝账号" value="@Model.Alipay">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">PayPal账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Skype" name="Skype" type="text" maxlength="100" class="form-control" placeholder="请填写您的PayPal账号" value="@Model.Skype">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">银行卡号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="BankCardNO" name="BankCardNO" maxlength="20" type="text" class="form-control" value="@Model.BankCardNO" aria-required="true" placeholder="银行卡号码" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">开户行:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Bank" name="Bank" maxlength="20" type="text" class="form-control" value="@Model.Bank" aria-required="true" placeholder="开户银行" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hidden">
|
||||
<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="IsVerifySellers" id="IsVerifySellers" @(Model.IsVerifySellers == 1 ? "checked" : "")> 已经缴费(注意,如果手动勾选,该用户会变成已经缴费的代理商,请慎重使用本功能)
|
||||
</label>
|
||||
</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" name="Id" value="@Model.Id" id="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>
|
||||
|
||||
<div id="tab-2" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
温馨提示:此部分信息只读。
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">注册时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.RegTime.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.RegIP</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.LastLoginTime.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.LastLoginIP</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.LoginCount</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户推广二维码:<br />仅限有生成过</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label"><img src="/userfiles/qrcode/invite/@(Model.Id).png" /></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="tab-3" class="tab-pane">
|
||||
|
||||
<table class="table table-bordered" style="margin-top:15px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>变化值</th>
|
||||
<th>变化前</th>
|
||||
<th>变化后</th>
|
||||
<th>时间</th>
|
||||
<th>理由</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (COMCMS.Core.BalanceChangeLog b in ViewBag.listbalancelogs)
|
||||
{
|
||||
<tr>
|
||||
<td>@COMCMS.Core.Member.GetBalanceTypeName(b.TypeId)</td>
|
||||
<td>@b.Reward.ToString("N2")</td>
|
||||
<td>@b.BeforChange.ToString("N2")</td>
|
||||
<td>@b.AfterChange.ToString("N2")</td>
|
||||
<td>@b.AddTime.ToString("yyyy-MM-dd HH:mm")</td>
|
||||
<td>@b.Actions</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-5" class="tab-pane">
|
||||
</div>
|
||||
<div id="tab-6" class="tab-pane">
|
||||
|
||||
<table class="table table-bordered" style="margin-top:15px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>变化值</th>
|
||||
<th>变化前</th>
|
||||
<th>变化后</th>
|
||||
<th>时间</th>
|
||||
<th>理由</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (COMCMS.Core.RebateChangeLog b in ViewBag.listrechargebalancelogs)
|
||||
{
|
||||
<tr>
|
||||
<td>@COMCMS.Core.Member.GetBalanceTypeName(b.TypeId)</td>
|
||||
<td>@b.Reward.ToString("N2")</td>
|
||||
<td>@b.BeforChange.ToString("N2")</td>
|
||||
<td>@b.AfterChange.ToString("N2")</td>
|
||||
<td>@b.AddTime.ToString("yyyy-MM-dd HH:mm")</td>
|
||||
<td>@b.Actions</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-4" class="tab-pane">
|
||||
<div style="height:20px"></div>
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">充值金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="price" name="price" maxlength="20" type="text" class="form-control" value="" aria-required="true" placeholder="请输入充值金额,大于0为充值,小于0为扣款">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">理由:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="reason" name="reason" maxlength="30" type="text" class="form-control" value="" aria-required="true" placeholder="记录充值或者扣款原因,30个字符以内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">充值金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-warning" type="button" onclick="doRecharge(@Model.Id)"><i class="fa fa-save"></i> 确认充值 </button> 说明:充值后,无法撤回,请确认金额
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-7" class="tab-pane">
|
||||
<div style="height:20px"></div>
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户返现余额:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="control-label">@Model.ExtCredits1.ToString("N2")</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">清除返现金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="pricex" name="pricex" maxlength="20" type="text" class="form-control" value="" aria-required="true" placeholder="请输入扣除返现金额,小于0为扣款,必须小于0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">理由:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="reasonx" name="reasonx" maxlength="30" type="text" class="form-control" value="" aria-required="true" placeholder="记录充值或者扣款原因,30个字符以内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">确认扣款:</label>
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-warning" type="button" onclick="doDeduction(@Model.Id)"><i class="fa fa-save"></i> 确认扣除 </button> 说明:扣除后,无法撤销
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
DoPost("editMemberForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,100 @@
|
||||
@model COMCMS.Core.MemberRoles
|
||||
@{
|
||||
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="alert alert-info">
|
||||
说明:“父级返现百分比”和“爷级返现百分比”为本代理级别的下级业绩的抽点。比如说,下级消费1000,那如果“父级返现百分比”为10%。则他有团队业绩提成100。0则没有任何提成。
|
||||
</div>
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editmemberroleForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户组名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="RoleName" name="RoleName" maxlength="200" type="text" class="form-control" value="@Model.RoleName" required aria-required="true" placeholder="填写用户组名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户组简介:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="RoleDescription" type="text" class="form-control" name="RoleDescription" placeholder="用户组简介,非必填" value="@Model.RoleDescription" maxlength="200">
|
||||
</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="NotAllowDel" id="NotAllowDel" @(Model.NotAllowDel == 1 ? "checked" : "")> 不允许删除(勾选则该管理组不允许直接删除)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Rank" type="number" class="form-control" name="Rank" placeholder="排序" value="@Model.Rank" maxlength="3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<label class="col-sm-3 control-label">返现百分比:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="CashBack" type="text" class="form-control" name="CashBack" placeholder="30为30%,消费后返现百分比到自己账号" value="@Model.CashBack.ToString("N2")" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<label class="col-sm-3 control-label">父级返现百分比:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="ParentCashBack" type="text" class="form-control" name="ParentCashBack" placeholder="15为15%,消费后返现百分比到父级账号" value="@Model.ParentCashBack.ToString("N2")" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<label class="col-sm-3 control-label">爷级返现百分比:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="GrandfatherCashBack" type="text" class="form-control" name="GrandfatherCashBack" placeholder="15为15%,消费后返现百分比到爷级账号" value="@Model.GrandfatherCashBack.ToString("N2")" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">入驻费用:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="JoinPrice" type="text" class="form-control" name="JoinPrice" placeholder="入驻成为本用户组费用" value="@Model.JoinPrice.ToString("N2").Replace(",","")" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<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="IsHalved" id="IsHalved"> 超过父级级别是否减半(勾选,则如果自己超过父级级别,提成减半)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide">
|
||||
<label class="col-sm-3 control-label">年业务量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="YearsPerformance" type="text" class="form-control" name="YearsPerformance" placeholder="年业务量,不达标自动降级" value="@Model.YearsPerformance.ToString("N2").Replace(",","")" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<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-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("editmemberroleForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,66 @@
|
||||
@model IList<MemberRoles>
|
||||
@{
|
||||
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="top.showDialog('addmemberrole', '添加用户组', '/Admin/Member/AddMemberRole', 0, 0)">
|
||||
<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>
|
||||
<table class="tree table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>用户组名称</th>
|
||||
<th class="text-center">是否不许删除</th>
|
||||
<th class="text-center">排序</th>
|
||||
<th class="hide">我的提成</th>
|
||||
<th>用户组介绍</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@if (Model.Count == 0)
|
||||
{
|
||||
<tr><td colspan="6" class="text-center">暂无记录...</td></tr>
|
||||
}
|
||||
@foreach (var m in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@m.Id</td>
|
||||
<td>
|
||||
@m.RoleName
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (m.NotAllowDel == 1)
|
||||
{
|
||||
<i class="fa fa-check"></i>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">@m.Rank</td>
|
||||
<td class="hide">@m.CashBack.ToString("N2")%</td>
|
||||
<td>@m.RoleDescription</td>
|
||||
<td>
|
||||
<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog('eidtrole', '编辑用户组详情', '/AdminCP/Member/EditMemberRole/@m.Id', 0, 0)"><i class="fa fa-edit"></i> 编辑</a>
|
||||
@*<a href="javascript:;" class="btn btn-xs btn-danger" title="删除" onclick="doDel('/Admin/Member/DelMemberRole',@m.Id);"><i class="fa fa-close"></i> 删除</a>*@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
<div>
|
||||
<label class="control-label">用户组:</label>
|
||||
|
||||
<select class="form-control" name="roleid" id="roleid">
|
||||
<option value="0">所有用户组</option>
|
||||
@foreach (var m in ViewBag.RoleList)
|
||||
{
|
||||
<option value="@m.Id">@m.RoleName</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>
|
||||
@*<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加用户', '/AdminCP/Member/AddMember', 0, 0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
</button>
|
||||
</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, //页码
|
||||
roleid: $("#roleid").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/Member/GetMembers', //请求后台的URL(*)
|
||||
method: 'get', //请求方式(*)
|
||||
toolbar: '#toolbar', //工具按钮用哪个容器
|
||||
striped: true, //是否显示行间隔色
|
||||
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
||||
pagination: true, //是否显示分页(*)
|
||||
sortable: true, //是否启用排序
|
||||
sortOrder: "asc", //排序方式
|
||||
queryParams: oTableInit.queryParams,//传递参数(*)
|
||||
sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
|
||||
pageNumber: 1, //初始化加载第一页,默认第一页
|
||||
pageSize: 25, //每页的记录行数(*)
|
||||
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
||||
search: true, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
||||
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: 'Nickname',
|
||||
title: '昵称',
|
||||
formatter: function (value, row, index) {
|
||||
if (value)
|
||||
return decodeURI(value);
|
||||
}
|
||||
}, {
|
||||
field: 'Roles',
|
||||
title: '用户组',
|
||||
formatter: function (value, row, index) {
|
||||
if (value)
|
||||
return value.RoleName;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'RealName',
|
||||
title: '姓名'
|
||||
},
|
||||
|
||||
{
|
||||
field: 'Balance',
|
||||
title: '余额'
|
||||
},
|
||||
{
|
||||
field: 'Rebate',
|
||||
title: '返现分销'
|
||||
},
|
||||
{
|
||||
field: 'LoginCount',
|
||||
title: '登录次数'
|
||||
},
|
||||
{
|
||||
field: 'RegTime',
|
||||
title: '注册时间'
|
||||
},
|
||||
{
|
||||
field: 'ThisLoginTime',
|
||||
title: '最后登录时间'
|
||||
},
|
||||
//{
|
||||
// field: 'IsVerifySellers',
|
||||
// title: '已缴费分销商',
|
||||
// formatter: function (value, row, index) {
|
||||
// if (value == 1)
|
||||
// return "是";
|
||||
// else
|
||||
// return "否";
|
||||
// }
|
||||
//},
|
||||
{
|
||||
field: 'Id',
|
||||
title: '操作',
|
||||
formatter: 'actionFormatter'
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
//得到查询的参数
|
||||
oTableInit.queryParams = function (params) {
|
||||
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
roleid: $("#roleid").val(),
|
||||
keyword: $("#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/Member/EditMember/' + 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/Member/DelMember\',' + 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,148 @@
|
||||
|
||||
@{
|
||||
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">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "addArticleKindForm", @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" name="PId" id="PId">
|
||||
<option value="0">一级栏目</option>
|
||||
@foreach (var m in ViewBag.ListTree)
|
||||
{
|
||||
<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">
|
||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写栏目名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">副标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="SubTitle" type="text" class="form-control" name="SubTitle" placeholder="栏目副标题,非必填" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Banner图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="BannerImg" name="BannerImg" maxlength="250" type="text" class="form-control" placeholder="请选择或上传一个Banner图片" value="">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-primary" onclick="BrowseServer('BannerImg')">
|
||||
选择图片
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Rank" type="number" class="form-control" name="Rank" value="0" maxlength="20" placeholder="越小排得越前" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">列表商品数量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="PageSize" type="number" class="form-control" name="PageSize" value="15" maxlength="20" placeholder="商品列表页面每页商品显示条数,仅对商品列表页面有效" aria-required="true">
|
||||
</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="IsShowSubDetail" id="IsShowSubDetail" checked> 显示下级栏目商品(勾选则该栏目列表,显示下级栏目商品。)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
<option value="@s" >@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</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="IsHide" id="IsHide"> 隐藏栏目(栏目在前台不显示)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目关键字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Keyword" type="text" class="form-control" name="Keyword" value="" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Description" type="text" class="form-control" name="Description" value="" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="LinkURL" type="text" class="form-control" name="LinkURL" value="" maxlength="200" placeholder="填写则点击该类别自动跳转到该地址" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目介绍:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="KindInfo" name="KindInfo" class="form-control" placeholder="可以输入栏目的详细介绍"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-3">
|
||||
<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("addArticleKindForm");
|
||||
CKEDITOR.replace('KindInfo');
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
@model COMCMS.Core.Product
|
||||
@{
|
||||
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 = "addProductForm", @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" name="KId" id="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">
|
||||
<input id="Title" name="Title" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写商品标题" value="@Model.Title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">副标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="SubTitle" type="text" class="form-control" name="SubTitle" placeholder="栏目副标题,非必填" maxlength="200" value="@Model.SubTitle">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题颜色:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="TitleColor" type="text" class="form-control" name="TitleColor" placeholder="标题颜色,可以填写一个如:#FF0000等" maxlength="20" value="@Model.TitleColor">
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品价格:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Price" type="text" class="form-control" name="Price" placeholder="商品销售价格" maxlength="50" value="@Model.Price.ToString("N2")">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品市场价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="MarketPrice" type="text" class="form-control" name="MarketPrice" placeholder="商品市场价,仅供对比" maxlength="50" value="@Model.MarketPrice.ToString("N2")">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品运费:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Fare" type="text" class="form-control" name="Fare" placeholder="运费,0为免运费" maxlength="50" value="@Model.Fare.ToString("N2")">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">添加时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="AddTime" type="text" class="form-control" name="AddTime" placeholder="商品来源,不填前台显示:网络" required onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" value="@Model.AddTime.ToString("yyyy-MM-dd HH:mm:ss")">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Sequence" type="number" class="form-control" name="Sequence" value="@Model.Sequence" maxlength="20" placeholder="越小排得越前" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">TAG:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Tags" type="text" class="form-control" name="Tags" value="@Model.Tags" maxlength="250" placeholder="TAG关键字,不同关键字请用“,”(英文逗号)隔开" aria-required="true">
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品点击数量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Hits" type="number" class="form-control" name="Hits" value="@Model.Hits" maxlength="20" placeholder="商品点击数量,仅对商品列表页面有效" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="LinkURL" type="text" class="form-control" name="LinkURL" value="@Model.LinkURL" maxlength="200" placeholder="填写则点击该类别自动跳转到该地址" aria-required="true">
|
||||
</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="IsNew" id="IsNew" @(Model.IsNew == 1 ? "checked" : "")> 最新商品
|
||||
</label>
|
||||
<label class="checkbox-inline i-checks hide">
|
||||
<input type="checkbox" value="1" name="IsRecommend" id="IsRecommend" @(Model.IsRecommend == 1 ? "checked" : "")> 推荐商品
|
||||
</label>
|
||||
<label class="checkbox-inline i-checks">
|
||||
<input type="checkbox" value="1" name="IsHotSales" id="IsHotSales" @(Model.IsHotSales == 1 ? "checked" : "")> 热销商品
|
||||
</label>
|
||||
<label class="checkbox-inline i-checks hide">
|
||||
<input type="checkbox" value="1" name="IsHide" id="IsHide" @(Model.IsHide == 1 ? "checked" : "")> 隐藏商品
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="Pic" name="Pic" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="@Model.Pic">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品介绍:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="Content" name="Content" class="form-control" placeholder="可以输入栏目的详细介绍" required>@Model.Content</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="MoreImages">
|
||||
@if (!string.IsNullOrEmpty(Model.ItemImg))
|
||||
{
|
||||
string[] arrimg = Model.ItemImg.Split(new string[] { "|||" }, StringSplitOptions.None);
|
||||
int i = 1;
|
||||
foreach (string s in arrimg)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s) && COMCMS.Common.Utils.IsImgFilename(s))
|
||||
{
|
||||
|
||||
|
||||
<div class="form-group" id="ImgRow@(i)">
|
||||
<label class="col-sm-3 control-label"><button type="button" class="btn btn-danger btn-sm" onclick="delmyImgRow('ImgRow@(i)')"> <i class="fa fa-close"></i> 删除</button></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="ImgUrlnImgRow@(i)" name="nImgUrl" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="@s">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">更多图片(相册):</label>
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-info" type="button" onclick="addImagesrow();"><i class="fa fa-plus"></i> 添加图片 </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">关键字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Keyword" type="text" class="form-control" name="Keyword" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true" value="@Model.Keyword">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Description" type="text" class="form-control" name="Description" value="@Model.Description" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">规格尺寸:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Spec" type="text" class="form-control" name="Spec" value="@Model.Spec" maxlength="250" placeholder="商品规格" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-3">
|
||||
<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>
|
||||
var htmlText = '<div class="form-group" id="nImgRow{0}">';
|
||||
htmlText += '<label class="col-sm-3 control-label"><button type="button" class="btn btn-danger btn-sm" onclick="delmyImgRow(\'nImgRow{0}\')"> <i class="fa fa-close"></i> 删除</button></label>';
|
||||
htmlText += '<div class="col-sm-8">';
|
||||
htmlText += '<div class="input-group">';
|
||||
htmlText += '<input id="nImgUrlnImgRow{0}" name="nImgUrl" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="">';
|
||||
htmlText += '<span class="input-group-addon my-upload-span upload-img" id="newimg_{0}"></span>';
|
||||
htmlText += '</div></div></div>';
|
||||
|
||||
var items = 1;
|
||||
|
||||
function addImagesrow() {
|
||||
var newHtmlTr = htmlText.replace(/\{0\}/g, "new" + items);
|
||||
$('#MoreImages').append(newHtmlTr);
|
||||
$("#newimg_new" + items).InitUploader({ filesize: "10240", sendurl: "/AdminCP/Upload/DoWebuploaderImage", swf: "/js/webuploader/uploader.swf", filetypes: "gif,jpg,png,bmp,jpeg", notwater: true });
|
||||
items += 1;
|
||||
|
||||
|
||||
}
|
||||
function delmyImgRow(id) {
|
||||
$("#" + id).remove();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//初始化上传控件
|
||||
$(".upload-img").InitUploader({ filesize: "10240", sendurl: "/AdminCP/Upload/DoWebuploaderImage", swf: "/js/webuploader/uploader.swf", filetypes: "gif,jpg,png,bmp,jpeg", notwater: true });
|
||||
$("#TitleColor").colorpicker();
|
||||
CKEDITOR.replace('Content');
|
||||
DoPost("addProductForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,68 @@
|
||||
@model IList<Category>
|
||||
@{
|
||||
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="showDialog('addarticlekind','添加商品栏目','/AdminCP/Product/AddCategory',0,0);">
|
||||
<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>
|
||||
<table class="tree table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>栏目名称</th>
|
||||
<th>ID</th>
|
||||
<th class="text-center">排序</th>
|
||||
<th class="text-center">商品数量</th>
|
||||
<th class="text-center">隐藏</th>
|
||||
<th width="200">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@if (Model.Count == 0)
|
||||
{
|
||||
<tr><td colspan="6" class="text-center">暂无记录...</td></tr>
|
||||
}
|
||||
@foreach (var m in Model)
|
||||
{
|
||||
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
||||
<td>@m.KindName</td>
|
||||
<td>
|
||||
@m.Id
|
||||
</td>
|
||||
<td class="text-center">@m.Rank</td>
|
||||
<td class="text-center">@m.Counts</td>
|
||||
<td class="text-center">
|
||||
@if (m.IsHide == 1)
|
||||
{
|
||||
<i class="fa fa-eye-slash"></i>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog('eidtarticlekind', '编辑商品栏目详情', '/AdminCP/Product/EditCategory/@m.Id', 0, 0)"><i class="fa fa-edit"></i> 编辑</a>
|
||||
<a href="javascript:;" class="btn btn-xs btn-danger" title="删除" onclick="doDel('/AdminCP/Product/DelCategory',@m.Id);"><i class="fa fa-close"></i> 删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.tree').treegrid();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,157 @@
|
||||
@model COMCMS.Core.Category
|
||||
@{
|
||||
|
||||
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">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editCategoryForm", @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="PId">
|
||||
<option value="0">一级栏目</option>
|
||||
@foreach (var m in ViewBag.ListTree)
|
||||
{
|
||||
<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">
|
||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" value="@Model.KindName" required aria-required="true" placeholder="填写栏目名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">副标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="SubTitle" type="text" class="form-control" name="SubTitle" placeholder="栏目副标题,非必填" value="@Model.SubTitle" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Banner图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="BannerImg" name="BannerImg" maxlength="250" type="text" class="form-control" placeholder="请选择或上传一个Banner图片" value="@Model.BannerImg">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-primary" onclick="BrowseServer('BannerImg')">
|
||||
选择图片
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Rank" type="number" class="form-control" name="Rank" value="@Model.Rank" maxlength="20" placeholder="越小排得越前" aria-required="true">
|
||||
</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="IsList" id="IsList" @(Model.IsList == 1 ? "checked" : "")> 商品列表页(勾上则该栏目为商品列表页面。)
|
||||
</label>
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">列表商品数量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="PageSize" type="number" class="form-control" name="PageSize" value="@Model.PageSize" maxlength="20" placeholder="商品列表页面每页商品显示条数,仅对商品列表页面有效" aria-required="true">
|
||||
</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="IsShowSubDetail" id="IsShowSubDetail" @(Model.IsShowSubDetail == 1 ? "checked" : "")> 显示下级栏目商品(勾选则该栏目列表,显示下级栏目商品。)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
<option value="@s" @(Model.TemplateFile == s?"selected":"")>@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
<option value="@s" @(Model.DetailTemplateFile == s?"selected":"")>@s</option>
|
||||
}
|
||||
</select>
|
||||
</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="IsHide" id="IsHide" @(Model.IsHide == 1 ? "checked" : "")> 隐藏栏目(栏目在前台不显示)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目关键字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Keyword" type="text" class="form-control" name="Keyword" value="@Model.Keyword" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Description" type="text" class="form-control" name="Description" value="@Model.Description" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="LinkURL" type="text" class="form-control" name="LinkURL" value="@Model.LinkURL" maxlength="200" placeholder="填写则点击该类别自动跳转到该地址" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目介绍:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="KindInfo" name="KindInfo" class="form-control" placeholder="可以输入栏目的详细介绍">@Model.KindInfo</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" value="@Model.Id" id="Id" name="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("editCategoryForm");
|
||||
CKEDITOR.replace('KindInfo');
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,219 @@
|
||||
@model COMCMS.Core.Product
|
||||
@{
|
||||
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 = "editProductForm", @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">
|
||||
<input id="Title" name="Title" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写商品标题" value="@Model.Title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">副标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="SubTitle" type="text" class="form-control" name="SubTitle" placeholder="栏目副标题,非必填" maxlength="200" value="@Model.SubTitle">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题颜色:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="TitleColor" type="text" class="form-control" name="TitleColor" placeholder="标题颜色,可以填写一个如:#FF0000等" maxlength="20" value="@Model.TitleColor">
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品价格:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Price" type="text" class="form-control" name="Price" placeholder="商品销售价格" maxlength="50" value="@Model.Price.ToString("N2").Replace(",","")">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品市场价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="MarketPrice" type="text" class="form-control" name="MarketPrice" placeholder="商品市场价,仅供对比" maxlength="50" value="@Model.MarketPrice.ToString("N2").Replace(",","")">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品运费:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Fare" type="text" class="form-control" name="Fare" placeholder="运费,0为免运费" maxlength="50" value="@Model.Fare.ToString("N2")">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">添加时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="AddTime" type="text" class="form-control" name="AddTime" placeholder="商品来源,不填前台显示:网络" required onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" value="@Model.AddTime.ToString("yyyy-MM-dd HH:mm:ss")">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Sequence" type="number" class="form-control" name="Sequence" value="@Model.Sequence" maxlength="20" placeholder="越小排得越前" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">TAG:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Tags" type="text" class="form-control" name="Tags" value="@Model.Tags" maxlength="250" placeholder="TAG关键字,不同关键字请用“,”(英文逗号)隔开" aria-required="true">
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品点击数量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Hits" type="number" class="form-control" name="Hits" value="@Model.Hits" maxlength="20" placeholder="商品点击数量,仅对商品列表页面有效" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="LinkURL" type="text" class="form-control" name="LinkURL" value="@Model.LinkURL" maxlength="200" placeholder="填写则点击该类别自动跳转到该地址" aria-required="true">
|
||||
</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="IsNew" id="IsNew" @(Model.IsNew == 1 ? "checked" : "")> 最新商品
|
||||
</label>
|
||||
<label class="checkbox-inline i-checks hide">
|
||||
<input type="checkbox" value="1" name="IsRecommend" id="IsRecommend" @(Model.IsRecommend == 1 ? "checked" : "")> 推荐商品
|
||||
</label>
|
||||
<label class="checkbox-inline i-checks">
|
||||
<input type="checkbox" value="1" name="IsHotSales" id="IsHotSales" @(Model.IsHotSales == 1 ? "checked" : "")> 热销商品
|
||||
</label>
|
||||
<label class="checkbox-inline i-checks hide">
|
||||
<input type="checkbox" value="1" name="IsHide" id="IsHide" @(Model.IsHide == 1 ? "checked" : "")> 隐藏商品
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="Pic" name="Pic" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="@Model.Pic">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品介绍:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="Content" name="Content" class="form-control" placeholder="可以输入栏目的详细介绍" required>@Model.Content</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="MoreImages">
|
||||
@if (!string.IsNullOrEmpty(Model.ItemImg))
|
||||
{
|
||||
string[] arrimg = Model.ItemImg.Split(new string[] { "|||" }, StringSplitOptions.None);
|
||||
int i = 1;
|
||||
foreach (string s in arrimg)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s) && COMCMS.Common.Utils.IsImgFilename(s))
|
||||
{
|
||||
|
||||
|
||||
<div class="form-group" id="ImgRow@(i)">
|
||||
<label class="col-sm-3 control-label"><button type="button" class="btn btn-danger btn-sm" onclick="delmyImgRow('ImgRow@(i)')"> <i class="fa fa-close"></i> 删除</button></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="ImgUrlnImgRow@(i)" name="nImgUrl" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="@s">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">更多图片(相册):</label>
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-info" type="button" onclick="addImagesrow();"><i class="fa fa-plus"></i> 添加图片 </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">关键字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Keyword" type="text" class="form-control" name="Keyword" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true" value="@Model.Keyword">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Description" type="text" class="form-control" name="Description" value="@Model.Description" maxlength="250" placeholder="优化搜索引擎搜录" aria-required="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">规格尺寸:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="Spec" type="text" class="form-control" name="Spec" value="@Model.Spec" maxlength="250" placeholder="商品规格" aria-required="true">
|
||||
</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>
|
||||
var htmlText = '<div class="form-group" id="nImgRow{0}">';
|
||||
htmlText += '<label class="col-sm-3 control-label"><button type="button" class="btn btn-danger btn-sm" onclick="delmyImgRow(\'nImgRow{0}\')"> <i class="fa fa-close"></i> 删除</button></label>';
|
||||
htmlText += '<div class="col-sm-8">';
|
||||
htmlText += '<div class="input-group">';
|
||||
htmlText += '<input id="nImgUrlnImgRow{0}" name="nImgUrl" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="">';
|
||||
htmlText += '<span class="input-group-addon my-upload-span upload-img" id="newimg_{0}"></span>';
|
||||
htmlText += '</div></div></div>';
|
||||
|
||||
var items = 1;
|
||||
|
||||
function addImagesrow() {
|
||||
var newHtmlTr = htmlText.replace(/\{0\}/g, "new" + items);
|
||||
$('#MoreImages').append(newHtmlTr);
|
||||
$("#newimg_new" + items).InitUploader({ filesize: "10240", sendurl: "/AdminCP/Upload/DoWebuploaderImage", swf: "/js/webuploader/uploader.swf", filetypes: "gif,jpg,png,bmp,jpeg", notwater: true });
|
||||
items += 1;
|
||||
}
|
||||
function delmyImgRow(id) {
|
||||
$("#" + id).remove();
|
||||
}
|
||||
$(function () {
|
||||
//初始化上传控件
|
||||
$(".upload-img").InitUploader({ filesize: "10240", sendurl: "/AdminCP/Upload/DoWebuploaderImage", swf: "/js/webuploader/uploader.swf", filetypes: "gif,jpg,png,bmp,jpeg", notwater: true });
|
||||
$("#TitleColor").colorpicker();
|
||||
CKEDITOR.replace('Content');
|
||||
DoPost("editProductForm");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,214 @@
|
||||
|
||||
@{
|
||||
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(); 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="checkbox-inline i-checks">
|
||||
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目商品
|
||||
</label>
|
||||
<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>
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addarticle','添加商品','/AdminCP/Product/AddProduct',0,0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
</button>
|
||||
@*<button id="btn_edit" type="button" class="btn btn-outline btn-default">
|
||||
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
|
||||
</button>
|
||||
<button id="btn_delete" type="button" class="btn btn-outline btn-default">
|
||||
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
|
||||
</button>*@
|
||||
</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(),
|
||||
isshowsub: $("#isshowsub").prop("checked") ? 1:0
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
$('#tb_departments').bootstrapTable('refresh', params);
|
||||
}
|
||||
|
||||
var TableInit = function () {
|
||||
var oTableInit = new Object();
|
||||
//初始化Table
|
||||
oTableInit.Init = function () {
|
||||
$('#tb_departments').bootstrapTable({
|
||||
url: '/AdminCP/Product/GetProductList', //请求后台的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: true, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
||||
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: 'Category.KindName',
|
||||
title: '所属分类'
|
||||
}, {
|
||||
field: 'Title',
|
||||
title: '商品标题'
|
||||
}, {
|
||||
field: 'Price',
|
||||
title: '商品价格'
|
||||
},
|
||||
{
|
||||
field: 'Sequence',
|
||||
title: '排序'
|
||||
}, {
|
||||
field: 'AddTime',
|
||||
title: '添加时间'
|
||||
}, {
|
||||
field: 'IsNew',
|
||||
title: '最新',
|
||||
align: 'center',
|
||||
formatter: 'newFormatter'
|
||||
}, {
|
||||
field: 'IsRecommend',
|
||||
title: '推荐',
|
||||
align: 'center',
|
||||
formatter: 'recommendFormatter'
|
||||
}, {
|
||||
field: 'IsHide',
|
||||
title: '隐藏',
|
||||
align: 'center',
|
||||
formatter: 'hideFormatter'
|
||||
},
|
||||
{
|
||||
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-success" title="获取二维码" onclick="getQRCode(' + value + ')"><i class="fa fa-qrcode"></i> 二维码</a> ',
|
||||
'<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog(\'eidtproduct\', \'编辑商品详情\', \'/AdminCP/Product/EditProduct/' + 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/Product/DelProduct\',' + value + ');"><i class="fa fa-close"></i> 删除</a>',
|
||||
].join('');
|
||||
}
|
||||
|
||||
function newFormatter(value, row, index) {
|
||||
if (value == 1) {
|
||||
return '<i class="fa fa-circle-o"></i>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function recommendFormatter(value, row, index) {
|
||||
if (value == 1) {
|
||||
return '<i class="fa fa-star"></i>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
function hideFormatter(value, row, index) {
|
||||
if (value == 1) {
|
||||
return '<i class="fa fa-eye-slash"></i>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var ButtonInit = function () {
|
||||
var oInit = new Object();
|
||||
var postdata = {};
|
||||
|
||||
oInit.Init = function () {
|
||||
//初始化页面上面的按钮事件
|
||||
};
|
||||
|
||||
return oInit;
|
||||
};
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 218 KiB |
Reference in New Issue
Block a user