category.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1" />
  7. <meta name="format-detection" content="telephone=no" />
  8. <title>潜山市党建引领信用村(社区)建设</title>
  9. <meta name="keywords" content="潜山市党建引领信用村(社区)建设">
  10. <meta name="description" content="潜山市党建引领信用村(社区)建设">
  11. <script src="static/js/vue.js"></script>
  12. <script type="text/javascript" src="static/js/vue-router.js"></script>
  13. <script src="static/js/index.js" type="text/javascript"></script>
  14. <script type="text/javascript" src="./static/js/jquery.min.js"></script>
  15. <script src="static/js/common.js"></script>
  16. <link href="static/css/common.css" rel="stylesheet" />
  17. <link href="static/css/style.css" rel="stylesheet" />
  18. <link rel="stylesheet" href="static/css/theme-chalk/index.css">
  19. <style></style>
  20. </head>
  21. <body class="qdcate qduse">
  22. <div id="appse">
  23. <header>
  24. <div class="quset">
  25. <div class="qusetimg"><img src="static/images/back.png" class="backimg" /></div>
  26. 选择类别
  27. </div>
  28. </header>
  29. </div>
  30. <div id="app">
  31. <main>
  32. <div class="qcate" v-if='catelist.length'>
  33. <div class="qcateli" v-for="(item,index) in catelist" :key='index' @click="getUse(item)">
  34. <div class="qcatelit">
  35. <div class="flexc mb16">
  36. <div class="f26 c0 fw flex1">{{item.oneTitle}}
  37. </div>
  38. <div class="f26 ca flexc flex0">去使用<img src="static/images/ring.png" class="qcatelitr" /></div>
  39. </div>
  40. <div class="f26 c0">{{item.twoTitle}}</div>
  41. </div>
  42. <div class="qcatelif flex">
  43. <div class="flex0">
  44. <div class="mb14 f24 c6">可用次数</div>
  45. <div class="f9 c0"><span class="f26 fw">{{item.total}}</span></div>
  46. </div>
  47. <div class="flex0">
  48. <div class="mb14 f24 c6">剩余次数</div>
  49. <div class="f9 c0"><span class="f26 fw">{{item.remaining}}</span></div>
  50. </div>
  51. <div class="flex1">
  52. <div class="mb14 f24 c6">有效期限</div>
  53. <div class="f9 c0">有效期至<span class="f26 fw">{{item.validTerm}}</span></div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- 暂无记录 -->
  59. <div v-else class="nobox">
  60. <img src="static/images/nico.png" class="noimg"/>
  61. </div>
  62. <!-- 密码弹窗 -->
  63. <div class="bgbox" v-if="pawflag"></div>
  64. <div class="pawfixed" v-if="pawflag">
  65. <div class="f3 c2 tc fw">输入密码</div>
  66. <div class="pawfixedin ">
  67. <input maxlength="1" @keyup="nextFocus($event,0)" v-model="reportinput[0]"/>
  68. <input maxlength="1" @keyup="nextFocus($event,1)" v-model="reportinput[1]"/>
  69. <input maxlength="1" @keyup="nextFocus($event,2)" v-model="reportinput[2]"/>
  70. <input maxlength="1" @keyup="nextFocus($event,3)" v-model="reportinput[3]"/>
  71. <input maxlength="1" @keyup="nextFocus($event,4)" v-model="reportinput[4]"/>
  72. <input maxlength="1" @keyup="nextFocus($event,5)" v-model="reportinput[5]"/>
  73. </div>
  74. <div class="pawfixedtit"><span>*</span>密码默认为身份证后六位</div>
  75. <div class="pawfixedbtns">
  76. <div class="pawfixedbtn btn1" @click="getClose">取消</div>
  77. <div class="pawfixedbtn btn2" @click="getSure">确认</div>
  78. </div>
  79. </div>
  80. </main>
  81. </div>
  82. <script type="text/javascript">
  83. var app = new Vue({
  84. el: '#app',
  85. data: {
  86. catelist: [],
  87. base_url: 'http://118.31.23.65:5007/prod-api',
  88. reportinput:['','','','','','',],//密码展示
  89. pawflag:false,
  90. idCard:'',
  91. pawnum:'',
  92. msg:'',
  93. phone:'',
  94. recordType:'',
  95. recordName:'',
  96. },
  97. created() {
  98. // 获取信息
  99. if(window.localStorage.getItem('userinfo')){
  100. var userinfo=JSON.parse(window.localStorage.getItem('userinfo'))
  101. this.idCard = userinfo.idCard||'';
  102. this.phone = userinfo.phone||'';
  103. // 获取身份证后六位
  104. this.pawnum=this.idCard.substring(this.idCard.length-6)
  105. this.getDataFn()
  106. }
  107. },
  108. mounted() {
  109. },
  110. methods: {
  111. //使input框获得焦点
  112. focus(){
  113. this.$refs.pwd.focus();
  114. },
  115. nextFocus(el,index){
  116. var dom = $(".pawfixedin input"),
  117. currInput = dom[index],
  118. nextInput = dom[index + 1],
  119. lastInput = dom[index - 1];
  120. if (el.keyCode != 8&& el.keyCode != 46) {
  121. if (index < (this.reportinput.length - 1)){
  122. nextInput.focus();
  123. } else {
  124. currInput.blur();
  125. this.getSure()
  126. }
  127. }else{
  128. if (index !=0) {
  129. lastInput.focus();
  130. }
  131. }
  132. },
  133. getClose(){
  134. this.pawflag=false;
  135. },
  136. getSure(){
  137. var that=this;
  138. var newinput=this.reportinput;
  139. for(var i=0;i<newinput.length;i++){
  140. if(!newinput[i]){
  141. that.$message({
  142. message: "请输入完整的密码",
  143. type: 'error',
  144. center: true,
  145. });
  146. return
  147. }
  148. }
  149. that.$nextTick(function(){
  150. var newStr=newinput.join('')
  151. if(newStr==that.pawnum){
  152. that.pawflag=false;
  153. window.location.href="scancode.html?menuId=" + that.menuId
  154. }else{
  155. that.$message({
  156. message: "请输入正确的密码",
  157. type: 'error',
  158. center: true,
  159. });
  160. }
  161. })
  162. },
  163. getUse(e){
  164. // item.menuId,item.remaining
  165. var d=e.remaining;
  166. if(typeof(d)=='number'&&d==0){
  167. this.$message({
  168. message: '暂无使用次数',
  169. type: 'error',
  170. center: true,
  171. });
  172. }else{
  173. window.location.href="scancode.html?menuId=" + e.menuId
  174. }
  175. },
  176. getQueryString(name) {
  177. try {
  178. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  179. var r = window.location.href.split('?')[1].match(reg);
  180. // console.log(reg,r)
  181. if (r != null) {
  182. return r[2];
  183. }
  184. return ""; //如果此处只写return;则返回的是undefined
  185. } catch (e) {
  186. return ""; //如果此处只写return;则返回的是undefined
  187. }
  188. },
  189. getDataFn() {
  190. var that = this;
  191. let params = {
  192. "idCard": that.idCard
  193. }
  194. $.ajax({
  195. url: this.base_url + '/system/policy/listPolicyMenuApp',
  196. type: 'GET',
  197. data: params,
  198. dataType: 'json',
  199. success: function(res) {
  200. if (res.code == 200) {
  201. that.catelist = res.data || {};
  202. } else {
  203. that.$message({
  204. message: res.msg,
  205. type: 'error',
  206. center: true,
  207. });
  208. }
  209. }
  210. })
  211. }
  212. }
  213. })
  214. </script>
  215. <script type="text/javascript">
  216. $(document).ready(function() {
  217. $('.backimg').click(function() {
  218. window.history.go(-1)
  219. })
  220. })
  221. </script>
  222. </body>
  223. </html>