Home.cshtml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. 
  2. @{
  3. ViewBag.Title = "Home";
  4. Layout = "~/Views/MobileProblem/_APPMain.cshtml";
  5. var url = HttpContext.Current.Request.Url;
  6. var webSite = String.Concat(url.Scheme, "://", url.Authority);
  7. }
  8. <link href="~/Content/Style/MobileProductRegist/iconfont.css?v=1.0" rel="stylesheet" />
  9. <link href="~/Content/Style/MobileProductRegist/HomeIcon.css" rel="stylesheet" />
  10. <script src="~/Content/Scripts/babel.min.js"></script>
  11. <script src="~/Content/Scripts/polyfill.min.js"></script>
  12. <link href="~/Content/Scripts/plugins/mui/css/icons-extra.css" rel="stylesheet" />
  13. <style>
  14. .mui-active {
  15. color: #2ab8ff !important;
  16. }
  17. #center {
  18. position: fixed;
  19. bottom: 10px;
  20. z-index: 12;
  21. left: 50%;
  22. margin-left: -27px;
  23. }
  24. #center2 {
  25. position: fixed;
  26. bottom: 3px;
  27. left: 50%;
  28. z-index: 11;
  29. width: 80px;
  30. height: 80px;
  31. margin-left: -40px;
  32. background-color: #f7f7f7;
  33. border-radius: 3em;
  34. border-bottom-color: transparent !important;
  35. border-right-color: transparent !important;
  36. box-shadow: 0 -5px 7px rgb(183,210,422);
  37. }
  38. /*.mui-icon.iconfont.icon-wentifankui {
  39. font-size: 35px;
  40. }*/
  41. .icon-soushuo {
  42. color: white;
  43. }
  44. .mui-icon-extra{
  45. font-size:15px
  46. }
  47. #Notice{
  48. top:5px
  49. }
  50. h4{
  51. font-size:16px
  52. }
  53. </style>
  54. <style>
  55. .mui-grid-view.mui-grid-9 .mui-table-view-cell {
  56. border-right: transparent;
  57. }
  58. .mui-grid-view.mui-grid-9 .mui-table-view-cell {
  59. padding: 0;
  60. }
  61. .mui-grid-view.mui-grid-9 .mui-media .mui-icon {
  62. color: white;
  63. }
  64. .table-icon {
  65. background-color: #00aaff;
  66. border-radius: 30px;
  67. width: 40px;
  68. height: 40px;
  69. }
  70. .table-text {
  71. font-size: 13px;
  72. margin-top: 8px;
  73. text-overflow: ellipsis;
  74. color: #333;
  75. }
  76. .mui-table-view-cell .mui-media {
  77. display: flex;
  78. }
  79. .iconflex {
  80. display: flex !important;
  81. flex-direction: column;
  82. justify-content: center;
  83. align-items: center;
  84. }
  85. .mui-col-xs-2 {
  86. width: 20%;
  87. }
  88. [v-cloak] {
  89. display: none;
  90. }
  91. .mui-grid-view.mui-grid-9 .mui-media .mui-icon {
  92. font-size: 1.9rem;
  93. }
  94. .mui-slider .mui-slider-group .mui-slider-item img {
  95. height: 11rem;
  96. width: auto;
  97. overflow: hidden;
  98. }
  99. .ZlProblem {
  100. background-color: white;
  101. border-radius: 13px 13px 0px 0px;
  102. }
  103. .mui-slider-item p {
  104. display: -webkit-box;
  105. -webkit-box-orient: vertical;
  106. -webkit-line-clamp: 1;
  107. overflow: hidden;
  108. font-size: 13px;
  109. }
  110. .Gongg {
  111. display: flex;
  112. flex-direction: row;
  113. justify-content: flex-start;
  114. border-radius: 0px 0px 13px 13px;
  115. background-color: white;
  116. padding: 5px;
  117. border-top: solid 1px #efeff4;
  118. align-items:center
  119. }
  120. .HomeTitle {
  121. margin: 10px;
  122. border-left: solid 2px #2ab8ff;
  123. padding: 0 17px;
  124. font-weight: 600;
  125. }
  126. .mui-grid-view.mui-grid-9 {
  127. background-color: white;
  128. }
  129. .AboutMyProblem {
  130. background-color: white;
  131. border-radius: 5px;
  132. }
  133. .MyList {
  134. padding: 5px 10px;
  135. border-bottom: solid 1px #efeff4;
  136. }
  137. .MyListFlex div {
  138. font-size: 12px !important;
  139. color: #61a3ff;
  140. }
  141. .MyList div {
  142. font-size: 13px;
  143. }
  144. .MyListFlex {
  145. display: flex;
  146. flex-direction: row;
  147. justify-content: flex-start;
  148. }
  149. .MyListFlex p {
  150. font-size: 12px !important;
  151. padding: 0 10px;
  152. }
  153. .MyListFlex img {
  154. max-height: 17px;
  155. border-radius: 10px;
  156. margin-right: 5px;
  157. }
  158. .OverHiden {
  159. display: -webkit-box;
  160. -webkit-box-orient: vertical;
  161. -webkit-line-clamp: 1;
  162. overflow: hidden;
  163. }
  164. .mui-grid-view.mui-grid-9 .mui-table-view-cell{
  165. border-bottom:none;
  166. }
  167. .version-problem{
  168. width: 100%;
  169. height: 50px;
  170. background-color: white;
  171. border-radius: 7px 7px 7px 7px;
  172. margin: 10px 0;
  173. display:flex;
  174. align-items:center;
  175. justify-content:flex-start
  176. }
  177. .version-problem img{
  178. height:30px;
  179. margin:0 10px;
  180. }
  181. .vp-search{
  182. font-size: 13px;
  183. font-weight: 600;
  184. flex: 1;
  185. color: #6e6e6e;
  186. padding: 0 10px;
  187. }
  188. .vp-icon{
  189. color: #acacaa;
  190. }
  191. </style>
  192. <header class="mui-bar mui-bar-nav">
  193. <h1 class="mui-title" style="color:white">中联区卫问题登记</h1>
  194. <a href="/MobileProblem/ProblemQuickSearch" class="mui-icon iconfont icon-soushuo mui-pull-right" id="title-right"></a>
  195. </header>
  196. <nav class="mui-bar mui-bar-tab">
  197. <a class="mui-tab-item " id="Home">
  198. <span class="mui-icon iconfont icon-shouye"></span>
  199. <span class="mui-tab-label">首页</span>
  200. </a>
  201. <a class="mui-tab-item" id="NewProblem">
  202. <span class="mui-icon iconfont icon-wentifankui"></span>
  203. <span class="mui-tab-label">问题查询</span>
  204. </a>
  205. <a class="mui-tab-item" id="my">
  206. <span class="mui-icon iconfont icon-wode"></span>
  207. <span class="mui-tab-label">我的</span>
  208. </a>
  209. </nav>
  210. <div class="mui-content mui-scroll-wrapper" id="scr1">
  211. <div class="mui-scroll">
  212. <div id="vue" v-cloak>
  213. <div class="mui-slider" style="height:11rem">
  214. <div v-if="PicNotice.length>0" class="mui-slider-group mui-slider-loop">
  215. <!--支持循环,需要重复图片节点-->
  216. <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img v-bind:src="PicNotice[PicNotice.length-1].图片ID" /></a></div>
  217. <div v-for="item in PicNotice" class="mui-slider-item"><a href="#"><img v-bind:src="item.图片ID" /></a></div>
  218. <!--支持循环,需要重复图片节点-->
  219. <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img v-bind:src="PicNotice[0].图片ID" /></a></div>
  220. </div>
  221. <div class="mui-slider-indicator ">
  222. <div v-for="(x,y) in PicNotice" class="mui-indicator" v-bind:class="y==0?'mui-active':''"></div>
  223. </div>
  224. </div>
  225. <h4 class="HomeTitle">问题登记</h4>
  226. <div class="ZlProblem">
  227. <ul class="mui-table-view mui-grid-view mui-grid-9">
  228. <li v-on:tap="CodeHref(pc.编码)" v-for="pc in ProductCode" class="mui-table-view-cell mui-media mui-col-xs-2 mui-col-sm-2">
  229. <a class="iconflex">
  230. <div class="table-icon">
  231. <span v-bind:class="pc.图标" class="mui-icon HomeIcon " style="height: 40px;line-height: 40px;"></span>
  232. </div>
  233. <div class="table-text">{{pc.名称}}</div>
  234. </a>
  235. </li>
  236. </ul>
  237. </div>
  238. <div class="Gongg">
  239. <span class="mui-icon-extra mui-icon-extra-notice" style="color:#aad061"></span>
  240. <h4 style="font-size: 12px;margin:2px;color:#aad061">公告</h4>
  241. <div class="mui-slider" style="flex:1;margin-left:5px">
  242. <div class="mui-slider-group mui-slider-loop" id="Notice">
  243. <!--支持循环,需要重复图片节点-->
  244. <div class="mui-slider-item mui-slider-item-duplicate"></div>
  245. <div v-for="item in Noty" v-on:click="NoticeDeatil(item.ID)" class="mui-slider-item"> <p>{{item.标题}}-{{item.发布时间}}</p></div>
  246. <!--支持循环,需要重复图片节点-->
  247. <div class="mui-slider-item mui-slider-item-duplicate"><p v-if="Noty.length>0">{{Noty[0].标题}}-{{Noty[0].发布时间}}</p></div>
  248. </div>
  249. </div>
  250. <h6 class="mores" style="margin-left:5px">| 更多</h6>
  251. </div>
  252. <div class="version-problem">
  253. <img src="~/Content/Images/zllogo.png" />
  254. <div class="vp-search">版本问题查询入口</div>
  255. <a class="vp-icon"><span class="mui-icon mui-icon-arrowright"></span></a>
  256. </div>
  257. <h4 class="HomeTitle">更多服务</h4>
  258. <div class="ZlProblem">
  259. <ul class="mui-table-view mui-grid-view mui-grid-9">
  260. <li v-on:tap="FormMakingHref(pc.编码)" v-for="pc in MoreServices" class="mui-table-view-cell mui-media mui-col-xs-2 mui-col-sm-2">
  261. <a class="iconflex">
  262. <div class="table-icon">
  263. <span v-bind:class="pc.图标" class="mui-icon HomeIcon " style="height: 40px;line-height: 40px;"></span>
  264. </div>
  265. <div class="table-text">{{pc.名称}}</div>
  266. </a>
  267. </li>
  268. </ul>
  269. </div>
  270. <h4 class="HomeTitle">与我相关问题</h4>
  271. <div class="AboutMyProblem">
  272. <div class="MyList" v-for="ml in MyProblemList" v-on:click="Deatil(ml.ID)">
  273. <div class="OverHiden" style="-webkit-line-clamp: 2">
  274. {{ml.问题标题}}
  275. </div>
  276. <p style="font-size:12px" class="OverHiden">
  277. {{ml.问题描述}}
  278. </p>
  279. <div class="MyListFlex">
  280. <img src="~/Content/Images/Account/wtx.jpg" />
  281. <div>{{ml.登记人}} </div>
  282. <p>{{ml.登记日期}} </p>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. <script >type = "text/babel"
  290. mui.init({
  291. swipeBack: true,//启用右滑关闭功能
  292. keyEventBind: {
  293. backbutton: true //开启back按键监听
  294. }
  295. });
  296. mui('.mui-scroll-wrapper').scroll();
  297. document.getElementById('Home').addEventListener('tap', function () {
  298. //mui.openWindow({
  299. // url: '/MobileProblem/Home'
  300. //});
  301. // window.location.href = '/MobileProblem/Home';
  302. });
  303. document.getElementById('my').addEventListener('tap', function () {
  304. //mui.openWindow({
  305. // url: '/MobileProblem/My'
  306. //});
  307. window.location.href = '/MobileProblem/My'
  308. });
  309. document.getElementById('NewProblem').addEventListener('tap', function () {
  310. //mui.openWindow({
  311. // url: '/MobileProblem/QueryProblem'
  312. //});
  313. window.location.href = '/MobileProblem/QueryProblem'
  314. });
  315. var clickNum = 0;
  316. mui.back = function (event) {
  317. clickNum++; if (clickNum > 1) { plus.runtime.quit(); }
  318. else {
  319. mui.toast("再按一次退出应用");
  320. } setTimeout(function () { clickNum = 0 }, 2000); return false;
  321. }
  322. </script>
  323. <script >
  324. "use strict";
  325. var vm = new Vue({
  326. el: '#vue',
  327. data: {
  328. /// 产品编码
  329. ProductCode: [],
  330. MyProblemList: [],
  331. Noty: [],
  332. PicNotice: [],
  333. //更多服务
  334. MoreServices: [{ 编码: "01", 名称: "项目管理", 图标: "icon-yunweiguanli" }, { 编码: "02", 名称: "我的填写", 图标: "icon-yiliaodui" }]
  335. },
  336. computed: {},
  337. methods: {
  338. ///获取产品编码
  339. GetCode: function GetCode() {
  340. var that = this; //查询用户设置的默认项目
  341. var DeafualtProjectId = '';
  342. var UserSetProject = getCookie("UserSetProject");
  343. if (UserSetProject && UserSetProject.split('|')[0]) {
  344. DeafualtProjectId = UserSetProject.split('|')[0];
  345. }
  346. $.post("/MobileProblem/GetProductCode", {
  347. "DeafualtProjectId": DeafualtProjectId
  348. }, function (data) {
  349. for (var _iterator = data, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]() ; ;) {
  350. var _ref;
  351. if (_isArray) {
  352. if (_i >= _iterator.length) break;
  353. _ref = _iterator[_i++];
  354. } else {
  355. _i = _iterator.next();
  356. if (_i.done) break;
  357. _ref = _i.value;
  358. }
  359. var dd = _ref;
  360. if (dd.编码 == '01') {
  361. dd.图标 = 'icon-yiliao2';
  362. } else if (dd.编码 == '02') {
  363. dd.图标 = 'icon-yiliaojigou';
  364. } else if (dd.编码 == '03') {
  365. dd.图标 = 'icon-yiliaodian';
  366. } else if (dd.编码 == '04' || dd.编码 == '05') {
  367. dd.图标 = 'icon-yiliaodui';
  368. } else if (dd.编码 == '06') {
  369. dd.图标 = 'icon-fuyoubaojian';
  370. } else if (dd.编码 == '07') {
  371. dd.图标 = 'icon-fuyoubaojianfc';
  372. } else if (dd.编码 == '08') {
  373. dd.图标 = 'icon-yunweiguanli';
  374. } else {
  375. dd.图标 = 'icon-fuyoubaojian';
  376. }
  377. }
  378. that.ProductCode = data;
  379. });
  380. },
  381. CodeHref: function CodeHref(code) {
  382. window.location.href= '/MobileProblem/NewProblems/' + code;
  383. },
  384. //查询我的问题
  385. QueryMyProblemList: function QueryMyProblemList() {
  386. var that = this;
  387. $.post("/Home/QueryMyProblemList", {}, function (data) {
  388. var t = data.length > 5 ? 5 : data.length;
  389. for (var i = 0; i < t; i++) {
  390. var arrEntities = {
  391. 'lt': '<',
  392. 'gt': '>',
  393. 'nbsp': ' ',
  394. 'amp': '&',
  395. 'quot': '"'
  396. };
  397. data[i].问题描述 = data[i].问题描述.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
  398. return arrEntities[t];
  399. });
  400. that.MyProblemList.push(data[i]);
  401. }
  402. });
  403. },
  404. ///我的问题详细
  405. Deatil: function Deatil(id) {
  406. window.location.href = '/MobileProblem/ProblemDetail/' + id;
  407. },
  408. //公告
  409. GetNoty: function () {
  410. var that = this;
  411. //加载公告
  412. $.post("/Notice/GetHome", function (data) {
  413. for (var i in data) {
  414. var val = data[i].发布时间;
  415. if (val < 1) {
  416. data[i].发布时间 = parseInt(val * 60) + "分钟前";
  417. } else if (val < 24) {
  418. data[i].发布时间 = val + "小时前";
  419. } else if (48 > val > 24) {
  420. data[i].发布时间 = "昨天";
  421. } else {
  422. data[i].发布时间 = parseInt(val / 24) + '天' + '前';
  423. }
  424. }
  425. that.Noty = data || [];
  426. })
  427. },
  428. NoticeDeatil: function (id) {
  429. window.location.href = '/MobileProblem/NoticesDetail/' + id
  430. },
  431. // 获取图片公告
  432. getPicNotice: function () {
  433. var that = this;
  434. $.post("/Notice/GetWorkNotice", function (data) {
  435. for (var i in data) {
  436. var item = data[i];
  437. item.图片ID = '/MobileProblem/ViewProblemImage/' + item.图片ID + '?type=o';
  438. }
  439. that.PicNotice = data;
  440. })
  441. },
  442. //更多服务
  443. FormMakingHref: function FormMakingHref(code) {
  444. if (code == "01") {//智能表单
  445. /* window.location.href = '/SmartForm/MobileSmart';*/
  446. window.location.href = '/MobileProblem/SelectProblemItem';
  447. } else if (code == "02") {//我的智能表单
  448. /* window.location.href = '/SmartForm/MobileSmart';*/
  449. window.location.href = '/SmartForm/MobileMySmart';
  450. }
  451. },
  452. },
  453. watch: {
  454. PicNotice: function (newValue, oldValue) {
  455. this.$nextTick(function () {
  456. var gallery = mui('.mui-slider');
  457. gallery.slider({
  458. interval: 5000 //自动轮播周期,若为0则不自动播放,默认为0;
  459. });
  460. })
  461. }
  462. },
  463. mounted: function mounted() {
  464. this.GetCode();
  465. this.GetNoty();
  466. this.getPicNotice();
  467. this.QueryMyProblemList();
  468. $("#Home").addClass('mui-active');
  469. mui(".AboutMyProblem").on('tap', '.MyList', function (event) {
  470. this.click();
  471. });
  472. mui(".Gongg").on('tap', '.mores', function (event) {
  473. window.location.href = '/MobileProblem/NoticeList';
  474. });
  475. mui("#vue").on('tap', '.version-problem', function (event) {
  476. window.location.href = '/MobileProblem/VersionProblem';
  477. });
  478. }
  479. });
  480. </script>