前台最终呈现的代码
Hello MUI
上面是可以直接运行的。
截屏效果
使用Asp.Net MVC 实现
前台代码
@using DotNet.Hotel.Model;@{ ViewBag.Title = "Index"; Layout = null; ListlistHaoPing = ViewBag.listHaoPing; List listChaPing = ViewBag.listChaPing; List listAll = ViewBag.listAll; int pageSize = ViewBag.pageSize; int xuHao = 1;} Hello MUI @**@ 选项卡切换+下拉刷新
后台代码实现
////// 评论列表主界面 /// ///public ActionResult Index() { int pageSize = 10; BanlanRoomCommentManager manager = new BanlanRoomCommentManager(); List listHaoPing = manager.GetList2 (BanlanRoomCommentEntity.FieldRoomLevel + " >= 3 ", pageSize); List listChaPing = manager.GetList2 (BanlanRoomCommentEntity.FieldRoomLevel + " < 3 ", pageSize); List listAll= manager.GetList (pageSize); ViewBag.pageSize = pageSize; ViewBag.listHaoPing = listHaoPing; ViewBag.listChaPing = listChaPing; ViewBag.listAll = listAll; return View(); } /// /// 获取向上或向下拉取的数据列表 /// ///public ActionResult GetPullList(int? levelType, int pageIndex = 1, int pageSize = 5, string order = null, string direction = null) { DotNet.Utilities.JsonResult
> result = new DotNet.Utilities.JsonResult
>(); try { BanlanRoomCommentManager manager = new BanlanRoomCommentManager(); List list = null; DataTable dt = null; int recordCount = 0; string whereCause = string.Empty; if (levelType == -1) { // 差评 whereCause = BanlanRoomCommentEntity.FieldRoomLevel + " < 3 "; } else if (levelType == 1) { // 好评 whereCause = BanlanRoomCommentEntity.FieldRoomLevel + " >= 3 "; } if (string.IsNullOrWhiteSpace(order)) { order = BanlanRoomCommentEntity.FieldCreateOn; } if (!string.Equals("direction", "asc", StringComparison.OrdinalIgnoreCase)) { direction = " desc "; } string orderby = order + " " + direction; //dt = manager.GetDataTableByPage(out recordCount, pageIndex, pageSize, whereCause, null, orderby); //IDbHelper dbHelper, out int recordCount, string tableName, string selectField, int pageIndex, int pageSize, string conditions, IDbDataParameter[] dbParameters, string orderBy, bool filter = false dt = DbLogic.GetDataTableByPage(manager.DbHelper, out recordCount, BanlanRoomCommentEntity.TableName, "*", pageIndex, pageSize, whereCause, null, orderby); if (dt != null && dt.Rows.Count > 0) { list = BanlanRoomRecommendEntity.GetList (dt); } if (list != null && list.Any()) { result.Status = true; result.Data = list; result.StatusMessage = "成功获取"; } else { result.Status = false; result.StatusMessage = "没有数据了"; } } catch (Exception ex) { result.Status = false; result.StatusMessage = "系统故障:" + ex.Message; } return Json(result, JsonRequestBehavior.AllowGet); }