ProblemQuickSearch.cshtml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. 
  2. @{
  3. ViewBag.Title = "ProblemQuickSearch";
  4. Layout = "~/Views/MobileProblem/_APPMain.cshtml";
  5. }
  6. <link href="~/Content/Style/MobileProductRegist/QueryProblemCustom.css" rel="stylesheet" />
  7. <script src="~/Content/Style/MobileProductRegist/ProblemIcon.js"></script>
  8. <script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
  9. <style>
  10. .mui-btn-primary {
  11. border: 1px solid #00aaff;
  12. background-color: #00aaff;
  13. }
  14. </style>
  15. <div id="vue" v-cloak>
  16. <header class="mui-bar mui-bar-nav">
  17. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#ffffff"></a>
  18. <h1 class="mui-title" style="color:white">问题快速查找</h1>
  19. </header>
  20. <div class="mui-content mui-scroll-wrapper" id="pullrefresh">
  21. <div class="mui-scroll">
  22. <div style="margin-top:10px">
  23. <input style="font-size:15px; margin:auto;width:75%" v-model="searchText" type="search" class="mui-input-clear" placeholder="问题标题/内容/编号/反馈人">
  24. <button v-on:click="DoSearch" type="button" class="mui-btn mui-btn-primary mui-icon mui-icon-search">
  25. 搜索
  26. </button>
  27. <div v-on:click="Deatil(p2.ID)" v-for="p2 in ProblemData" class='mui-card' style='margin: 0px;margin-top: 5px;'><div class='mui-card-content my'><div class="imgstyle"><img v-bind:src="p2.附件路径" class="imgcover"></div><div style='flex:1'><div class='ncs'><div class='we'><div class='overf' style='-webkit-line-clamp: 1;width:150px;margin-top:10px'>{{p2.性质}}-{{p2.登记人}}</div><div style='margin-right:5px'><svg class='icon' aria-hidden='true'><use v-bind:xlink:href='p2.icon'></use></svg></div></div><div class='boxx'><p class='overf' style='-webkit-line-clamp: 1;'>{{p2.问题标题}}</p></div><div class='we'><div><p></p></div><div><p style='margin-right:5px'>{{p2.登记日期}}</p></div></div></div></div></div></div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <script>
  33. var vm = new Vue({
  34. el: '#vue',
  35. data: {
  36. searchText: '',
  37. ProblemData: [],
  38. Pages: 0
  39. },
  40. watch:{
  41. },
  42. methods: {
  43. ///进入详细页面
  44. Deatil: function (id) {
  45. //mui.openWindow({
  46. // url: '/MobileProblem/ProblemDetail/' + id
  47. //});
  48. window.location.href = '/MobileProblem/ProblemDetail/' + id
  49. },
  50. DoSearch:function(){
  51. this.Pages = 0;
  52. this.ProblemData = [];
  53. mui('#pullrefresh').pullRefresh().refresh(true);
  54. mui('#pullrefresh').pullRefresh().pullupLoading(false);
  55. },
  56. pullupRefresh: function () {
  57. var that = this;
  58. that.Pages++;
  59. setTimeout(function () {
  60. var self= mui('#pullrefresh').pullRefresh(); //参数为true代表没有更多数据了。
  61. mui.get('/MobileProblem/QuerckSearch',
  62. {
  63. SelectConditon: that.searchText,
  64. Pages: that.Pages,
  65. rows:6
  66. }, function (data) {
  67. //获得服务器响应
  68. var info = data;
  69. if (info.length == 0) {//当datas.length为0时,表示没有数据了
  70. self.endPullupToRefresh(true);//当为true时,底部出现没有更多数据,并且不能滑动
  71. } else {
  72. for (var di in info) {
  73. var dd = info[di];
  74. if (!dd.附件路径) {
  75. dd.附件路径 = "/Content/Images/zlpng.png";
  76. } else {
  77. dd.附件路径 = "/MobileProblem/ViewProblemImage/" + dd.附件路径 + "?type=s"
  78. }
  79. if (dd.是否终止 == '1') {
  80. dd.icon = "#icon-yizhongzhi1";
  81. } else if (dd.是否解决 == '1') {
  82. dd.icon = "#icon-yijiejue3";
  83. }
  84. else {
  85. dd.icon = "#icon-weijiejue";
  86. }
  87. that.ProblemData.push(dd);
  88. }
  89. self.endPullupToRefresh(false);//当为false或空时,底部出现正在加载,滑动到下一页
  90. }
  91. },'json');
  92. }, 1500);
  93. }
  94. },
  95. mounted: function () {
  96. var that = this;
  97. mui.init({
  98. pullRefresh: {
  99. container: '#pullrefresh',
  100. up: {
  101. auto: false,
  102. contentrefresh: '正在加载...',
  103. callback: that.pullupRefresh,
  104. }
  105. }
  106. });
  107. mui(".mui-scroll").on('tap', '.mui-card', function (event) {
  108. this.click();
  109. });
  110. }
  111. })
  112. </script>