index.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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="qbox">
  22. <div class="qsback">
  23. <img src="static/images/back_white.png" class="backimg" />
  24. </div>
  25. <div id="appse">
  26. <header>
  27. <div>
  28. <img src="static/images/pic_up.png" class="qup" />
  29. </div>
  30. </header>
  31. </div>
  32. <div id="app">
  33. <main>
  34. <img src="static/images/pic_tit.png" class="qtitimg" />
  35. <div class="qd_txtbox">
  36. <div class="qd_txtt">基本信息</div>
  37. <div class="qd_txtb">
  38. <div class="qd_txtbt">尊敬的用户您好!</div>
  39. <div class="flex" >
  40. <div class="qd_txtbxa">
  41. <div class="flexcj qd_txtbxal">
  42. <img src="static/images/texa.png" />
  43. </div>
  44. <div class="ovh">
  45. <div class="f26 c34 fw mb1 ovone">{{userName||'暂无信息'}}</div>
  46. <div class="f16 c6 ovone">姓名</div>
  47. </div>
  48. </div>
  49. <div class="qd_txtbxa">
  50. <div class="flexcj qd_txtbxal">
  51. <img src="static/images/texc.png" />
  52. </div>
  53. <div class="ovh">
  54. <div class="f26 c34 fw mb1 ovone" v-if="creditLevel"><span
  55. class="cd3 fsi">{{creditLevel}}</span>级</div>
  56. <div class="f26 c34 fw mb1 ovone" v-else>暂无评级</div>
  57. <div class="f16 c6 ovone">信用等级</div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="flex qd_fun">
  64. <a href="javascript:void(0);" @click="getCode">
  65. <img src="static/images/icon_hpa.png" class="qd_funimg" />
  66. <div class="ovone tc c0 f24">扫码出示</div>
  67. </a>
  68. <a href="javascript:void(0);" @click="getTip">
  69. <img src="static/images/icon_hpb.png" class="qd_funimg" />
  70. <div class="ovone tc c0 f24">水费申报</div>
  71. </a>
  72. <a href="policy.html">
  73. <img src="static/images/icon_hpc.png" class="qd_funimg" />
  74. <div class="ovone tc c0 f24">政策指南</div>
  75. </a>
  76. <a :href="'use.html?creditId='+creditId">
  77. <img src="static/images/icon_hpd.png" class="qd_funimg" />
  78. <div class="ovone tc c0 f24">使用记录</div>
  79. </a>
  80. </div>
  81. <a href="" class="mb66">
  82. <img src="static/images/hp_banner.png" class="qd_funa" />
  83. </a>
  84. <div class="qd_wel">
  85. <div class="qd_weltit ">
  86. <img src="static/images/tet_flbg.png" />
  87. <div class="qd_weltita">福利清单</div>
  88. </div>
  89. <div class="qd_weltxt flexcj mb3" v-if="stalist.length"><span></span>{{numterm}}<span></span></div>
  90. <div class="qd_welb">
  91. <a v-for="(item,idx) in stalist"
  92. :href="'tktbdetail.html?id=' + item.menuId+ '&tit=' + (item.menuName||'')">
  93. <div class="flexend">
  94. <div class="qd_welbox">
  95. <div class="qd_welbt ovone">{{item.menuName}}</div>
  96. <div class="qd_welbtx overtwo">{{item.menuIntroduce}} </div>
  97. </div>
  98. <img :src="'http://118.31.23.65:5007/prod-api'+item.photo" class="qd_welimg" />
  99. </div>
  100. <div class="qd_welbm">查看详情<img src="static/images/welr.png" /></div>
  101. </a>
  102. </div>
  103. </div>
  104. </main>
  105. </div>
  106. </div>
  107. <script type="text/javascript">
  108. var app = new Vue({
  109. el: '#app',
  110. data: {
  111. // base_url: 'https://qsdj.qs163.cn/prod-api',
  112. base_url: 'http://118.31.23.65:5007/prod-api',
  113. // base_url: 'http://192.168.101.168:9000',
  114. // base_url: 'http://192.168.101.11:9000/dev-api',
  115. stalist: [],
  116. useinfo: '',
  117. numterm: '0大项福利',
  118. creditId:'',
  119. phone:'',
  120. userName:'',
  121. creditScore:'',
  122. creditLevel:'',
  123. idCard:'',
  124. scoreflag:false
  125. },
  126. created() {
  127. this.userName = decodeURI(this.getQueryString("userName"))||''
  128. this.phone = decodeURI(this.getQueryString("phone"))||'';
  129. this.creditLevel = decodeURI(this.getQueryString("pjjg"))||''
  130. this.idCard = decodeURI(this.getQueryString("cardNumber"))||''
  131. this.getDataFn()
  132. // 获取信息
  133. if(window.localStorage.getItem('userinfo')){
  134. var newobj=JSON.parse(window.localStorage.getItem('userinfo'))
  135. if(newobj.phone==this.phone&&newobj.userName==this.userName&&newobj.creditLevel==this.creditLevel&&newobj.idCard==this.idCard){
  136. this.getUseFn()
  137. }else{
  138. var obj={
  139. phone:this.phone,
  140. userName:this.userName,
  141. creditLevel:this.creditLevel,
  142. idCard:this.idCard,
  143. }
  144. window.localStorage.setItem('userinfo',JSON.stringify(obj))
  145. this.getsetUseFn()
  146. }
  147. }else{
  148. var obj={
  149. phone:this.phone,
  150. userName:this.userName,
  151. creditLevel:this.creditLevel,
  152. idCard:this.idCard,
  153. }
  154. window.localStorage.setItem('userinfo',JSON.stringify(obj))
  155. this.getsetUseFn()
  156. }
  157. },
  158. mounted() {
  159. },
  160. methods: {
  161. getQueryString(name) {
  162. try {
  163. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  164. var r = window.location.href.split('?')[1].match(reg);
  165. // console.log(reg,r)
  166. if(r != null) {
  167. return r[2];
  168. }
  169. return "";//如果此处只写return;则返回的是undefined
  170. } catch(e) {
  171. return "";//如果此处只写return;则返回的是undefined
  172. }
  173. },
  174. getTip(){
  175. this.$message({
  176. message: "功能暂未开放",
  177. center: true,
  178. showClose:true
  179. });
  180. },
  181. getCode(){
  182. // 扫码出示
  183. if(!this.creditLevel){
  184. this.$message({
  185. message: "暂无信用评级",
  186. center: true,
  187. showClose:true
  188. });
  189. }else{
  190. window.location.href="category.html"
  191. }
  192. },
  193. // 数字格式转换
  194. numberfilter(num) {
  195. const changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'] // changeNum[0] = "零"
  196. const unit = ['', '十', '百']
  197. num = parseInt(num)
  198. const getWan = (temp) => {
  199. const strArr = temp.toString().split('').reverse()
  200. let newNum = ''
  201. for (var i = 0; i < strArr.length; i++) {
  202. newNum = (i == 0 && strArr[i] == 0 ? '' : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? '' : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum
  203. }
  204. return newNum
  205. }
  206. const overWan = Math.floor(num / 100)
  207. let noWan = num % 100
  208. if (noWan.toString().length < 2) noWan = '0' + noWan
  209. let strr = (overWan ? getWan(overWan) + '百' + getWan(noWan) : getWan(num))
  210. if(strr.split('')[0] == '一'){
  211. let showNum = "";
  212. if(strr == '一'){
  213. showNum = strr.substring(0);
  214. }else{
  215. showNum = strr.substring(1);
  216. }
  217. return showNum+"大项福利"
  218. }else{
  219. let showNum = overWan ? getWan(overWan) + '百' + getWan(noWan) : getWan(num);
  220. return showNum+"大项福利"
  221. }
  222. },
  223. getDataFn() {
  224. var that = this;
  225. $.ajax({
  226. url: this.base_url + '/system/h5/policy/list',
  227. type: 'GET',
  228. data: '',
  229. dataType: 'json',
  230. success: function(res) {
  231. if (res.code == 200) {
  232. that.stalist = res.data;
  233. var len = res.data.length;
  234. that.numterm = that.numberfilter(len);
  235. } else {
  236. that.$message({
  237. message: res.msg,
  238. type: 'error',
  239. center: true,
  240. });
  241. }
  242. }
  243. })
  244. },
  245. getUseFn() {
  246. var that = this;
  247. let params = {
  248. "idCard": that.idCard
  249. }
  250. $.ajax({
  251. url: this.base_url + '/system/h5/user/info',
  252. type: 'POST',
  253. data: JSON.stringify(params),
  254. dataType: 'json',
  255. success: function(res) {
  256. if (res.code == 200) {
  257. if(res.data){
  258. that.creditId=res.data.id;
  259. }else{
  260. }
  261. } else {
  262. that.$message({
  263. message: res.msg,
  264. type: 'error',
  265. center: true,
  266. });
  267. }
  268. }
  269. })
  270. },
  271. getsetUseFn() {
  272. var that = this;
  273. let params = {
  274. "idCard":that.idCard,
  275. "phoneNum":that.phone,
  276. "userName":that.userName,
  277. "creditLevel":that.creditLevel,
  278. }
  279. $.ajax({
  280. url: this.base_url + '/system/h5/insert/creditUser',
  281. type: 'POST',
  282. data: JSON.stringify(params),
  283. dataType: 'json',
  284. success: function(res) {
  285. that.getUseFn()
  286. }
  287. })
  288. },
  289. getDetail(e) {
  290. var id = e.menuId;
  291. var tit = e.menuName || ''
  292. window.location.href = "tktbdetail.html?id=" + id + '&tit=' + tit
  293. }
  294. }
  295. })
  296. </script>
  297. <script type="text/javascript">
  298. $(document).ready(function() {
  299. $('.backimg').click(function() {
  300. window.history.go(-1)
  301. })
  302. })
  303. </script>
  304. <script src="static/js/footer.js" type="text/javascript" charset="utf-8"></script>
  305. </body>
  306. </html>