Edit.cshtml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. @using MySystem.BsModels;
  2. @{AppBottomNavs editData = ViewBag.data as AppBottomNavs;}
  3. @{
  4. string RightInfo = ViewBag.RightInfo as string;
  5. string right = ViewBag.right as string;
  6. }
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta charset="utf-8">
  11. <title>App底部导航(修改)</title>
  12. <meta name="renderer" content="webkit">
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  14. <meta name="viewport"
  15. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  16. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  17. <script src="/admin/js/jquery-1.10.1.min.js"></script>
  18. <script src="/admin/js/LAreaData2.js"></script>
  19. </head>
  20. <body>
  21. <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
  22. <input type="hidden" name="Id" value="@editData.Id" />
  23. <div class="layui-card">
  24. <div class="layui-card-body">
  25. <div class="layui-tab" lay-filter="mytabbar">
  26. <ul class="layui-tab-title">
  27. <li class="layui-this" lay-id="1">基本资料</li>
  28. </ul>
  29. <div class="layui-tab-content mt20">
  30. <div class="layui-tab-item layui-show">
  31. <div class="layui-form-item">
  32. <label class="layui-form-label">角色分类</label>
  33. <div class="layui-input-inline">
  34. <select id="SeoKeyword" name="SeoKeyword" lay-search="">
  35. <option value="">请选择</option>
  36. <option value="consumer">消费者</option>
  37. <option value="cyb">创客</option>
  38. </select>
  39. <script>
  40. $("#SeoKeyword").val("@editData.SeoKeyword");
  41. </script>
  42. </div>
  43. </div>
  44. <div class="layui-form-item">
  45. <label class="layui-form-label">标题</label>
  46. <div class="layui-input-block">
  47. <input class="layui-input" type="text" id="Title" name="Title"
  48. value="@editData.Title" maxlength="10" lay-verify="required," autocomplete="off"
  49. placeholder="请输入标题">
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label">选中图标</label>
  54. <div class="layui-input-block">
  55. <div class="layui-upload">
  56. <input type="hidden" id="SelectIcon" name="SelectIcon"
  57. value="@editData.SelectIcon">
  58. <button class="layui-btn" type="button" id="SelectIconBtn">选择图片</button>
  59. <div class="layui-inline layui-word-aux">图片尺寸88x88,建议大小限制为20K以内</div>
  60. </div>
  61. <div style="margin-top:10px;" id="SelectIconImage">
  62. @if (!string.IsNullOrEmpty(editData.SelectIcon))
  63. {
  64. <img src="@editData.SelectIcon"
  65. class="layui-upload-img" style="max-width:85px; max-height:85px;">
  66. }
  67. </div>
  68. </div>
  69. </div>
  70. <div class="layui-form-item">
  71. <label class="layui-form-label">未选中图标</label>
  72. <div class="layui-input-block">
  73. <div class="layui-upload">
  74. <input type="hidden" id="NormalIcon" name="NormalIcon"
  75. value="@editData.NormalIcon">
  76. <button class="layui-btn" type="button" id="NormalIconBtn">选择图片</button>
  77. <div class="layui-inline layui-word-aux">图片尺寸88x88,建议大小限制为20K以内</div>
  78. </div>
  79. <div style="margin-top:10px;" id="NormalIconImage">
  80. @if (!string.IsNullOrEmpty(editData.NormalIcon))
  81. {
  82. <img src="@editData.NormalIcon"
  83. class="layui-upload-img" style="max-width:85px; max-height:85px;">
  84. }
  85. </div>
  86. </div>
  87. </div>
  88. <div class="layui-form-item">
  89. <label class="layui-form-label">选中文字颜色</label>
  90. <div class="layui-input-block">
  91. <input class="layui-input" type="text" id="SelectTextColor" name="SelectTextColor"
  92. value="@editData.SelectTextColor" maxlength="6" lay-verify="" autocomplete="off"
  93. placeholder="请输入选中文字颜色">
  94. </div>
  95. </div>
  96. <div class="layui-form-item">
  97. <label class="layui-form-label">未选中文字颜色</label>
  98. <div class="layui-input-block">
  99. <input class="layui-input" type="text" id="NormalTextColor" name="NormalTextColor"
  100. value="@editData.NormalTextColor" maxlength="6" lay-verify="" autocomplete="off"
  101. placeholder="请输入未选中文字颜色">
  102. </div>
  103. </div>
  104. <div class="layui-form-item">
  105. <label class="layui-form-label">关联页面文件</label>
  106. <div class="layui-input-block">
  107. <input class="layui-input" type="text" id="PageName" name="PageName"
  108. value="@editData.PageName" maxlength="50" lay-verify="" autocomplete="off"
  109. placeholder="请输入关联页面文件">
  110. </div>
  111. </div>
  112. <div class="layui-form-item">
  113. <label class="layui-form-label">空页面提示信息</label>
  114. <div class="layui-input-block">
  115. <input class="layui-input" type="text" id="NoPageHint" name="NoPageHint"
  116. value="@editData.NoPageHint" maxlength="50" lay-verify="" autocomplete="off"
  117. placeholder="请输入为关联页面提示信息">
  118. </div>
  119. </div>
  120. <div class="layui-form-item">
  121. <label class="layui-form-label">背景色</label>
  122. <div class="layui-input-block">
  123. <input class="layui-input" type="text" id="BgColor" name="BgColor"
  124. value="@editData.BgColor" maxlength="6" lay-verify="" autocomplete="off"
  125. placeholder="请输入背景色">
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="layui-form-item layui-hide">
  132. <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit"
  133. value="确认">
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <script src="/layuiadmin/layui/layui.js"></script>
  139. <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
  140. <script src="/other/mybjq/kindeditor-min.js"></script>
  141. <script src="/other/mybjq/lang/zh_CN.js"></script>
  142. <script>
  143. //编辑器
  144. KindEditor.ready(function (K) {
  145. });
  146. var ids = "";
  147. function getChildren(obj) {
  148. $.each(obj, function (index, value) {
  149. var id = obj[index].id;
  150. ids += id + ",";
  151. var children = obj[index].children;
  152. if (children) {
  153. getChildren(children);
  154. }
  155. });
  156. }
  157. function AreasProvinceInit(tagId, areasVal, form) {
  158. for (var i = 0; i < provs_data.length; i++) {
  159. var sel = "";
  160. if (areasVal.indexOf(provs_data[i].text) > -1) {
  161. sel = " selected=selected";
  162. }
  163. $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' +
  164. provs_data[i].text + '</option>');
  165. }
  166. form.render();
  167. }
  168. function AreasProvinceSelected(tagId, areasVal, form, value) {
  169. $("#" + tagId + "City").html('<option value="">市</option>');
  170. var list = citys_data[value];
  171. for (var i = 0; i < list.length; i++) {
  172. var sel = "";
  173. if (areasVal.indexOf(list[i].text) > -1) {
  174. sel = " selected=selected";
  175. }
  176. $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text +
  177. '</option>');
  178. }
  179. $("#" + tagId + "Area").html('<option value="">县/区</option>');
  180. form.render();
  181. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId +
  182. "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  183. }
  184. function AreasCitySelected(tagId, areasVal, form, value) {
  185. $("#" + tagId + "Area").html('<option value="">县/区</option>');
  186. var list = dists_data[value];
  187. for (var i = 0; i < list.length; i++) {
  188. var sel = "";
  189. if (areasVal.indexOf(list[i].text) > -1) {
  190. sel = " selected=selected";
  191. }
  192. $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text +
  193. '</option>');
  194. }
  195. form.render();
  196. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId +
  197. "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  198. }
  199. function AreasAreaSelected(tagId, form) {
  200. form.render();
  201. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId +
  202. "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  203. }
  204. function movePrev(obj, tagId) {
  205. $(obj).parent().prev().insertAfter($(obj).parent());
  206. checkPics(tagId);
  207. }
  208. function moveNext(obj, tagId) {
  209. $(obj).parent().next().insertBefore($(obj).parent());
  210. checkPics(tagId);
  211. }
  212. function deletePic(obj, tagId) {
  213. $(obj).parent().remove();
  214. checkPics(tagId);
  215. }
  216. function checkPics(tagId) {
  217. var pics = "";
  218. var texts = "";
  219. $("#" + tagId + "Image div img").each(function (i) {
  220. pics += $(this).attr("src").replace(osshost, '') + "|";
  221. });
  222. $("#" + tagId + "Image div input").each(function (i) {
  223. texts += $(this).val() + "|";
  224. });
  225. if (pics == "") {
  226. $("#" + tagId).val("");
  227. } else {
  228. pics = pics.substring(0, pics.length - 1);
  229. texts = texts.substring(0, pics.length - 1);
  230. $("#" + tagId).val(pics + "#cut#" + texts);
  231. }
  232. }
  233. function checkBox(tagId) {
  234. var text = "";
  235. $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
  236. text += $(this).val() + ",";
  237. });
  238. $("#" + tagId).val(text);
  239. }
  240. function showBigPic(picpath) {
  241. parent.layer.open({
  242. type: 1,
  243. title: false,
  244. closeBtn: 0,
  245. shadeClose: true,
  246. area: ['auto', 'auto'],
  247. content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
  248. });
  249. }
  250. var tree;
  251. var element;
  252. var upload;
  253. layui.config({
  254. base: '/layuiadmin/' //静态资源所在路径
  255. }).extend({
  256. index: 'lib/index' //主入口模块
  257. }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'],
  258. function () {
  259. var $ = layui.$,
  260. form = layui.form,
  261. layer = layui.layer,
  262. layedit = layui.layedit,
  263. laydate = layui.laydate,
  264. croppers = layui.croppers,
  265. transfer = layui.transfer,
  266. util = layui.util;
  267. tree = layui.tree;
  268. element = layui.element;
  269. upload = layui.upload;
  270. //Hash地址的定位
  271. var layid = location.hash.replace(/^#test=/, '');
  272. element.tabChange('test', layid);
  273. element.on('tab(test)', function (elem) {
  274. location.hash = 'test=' + $(this).attr('lay-id');
  275. });
  276. //日期
  277. //上传文件
  278. upload.render({
  279. elem: '#SelectIconBtn',
  280. url: '/Admin/AppBottomNavs/UploadPhoto',
  281. multiple: false,
  282. done: function (res) {
  283. $('#SelectIconImage').html('<img src="' + res.data + '" class="layui-upload-img" style="max-width:85px; max-height:85px;" onclick="showBigPic(' + res.data + ')">')
  284. $('#SelectIcon').val(res.data);
  285. }
  286. });
  287. upload.render({
  288. elem: '#NormalIconBtn',
  289. url: '/Admin/AppBottomNavs/UploadPhoto',
  290. multiple: false,
  291. done: function (res) {
  292. $('#NormalIconImage').html('<img src="' + res.data + '" class="layui-upload-img" style="max-width:85px; max-height:85px;" onclick="showBigPic(' + res.data + ')">')
  293. $('#NormalIcon').val(res.data);
  294. }
  295. });
  296. //穿梭框
  297. //TreeView,比如权限管理
  298. //省市区
  299. })
  300. </script>
  301. </body>
  302. </html>