yinhai.js 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064
  1. if (!window.Base) {
  2. Base = {};
  3. }
  4. Base.check_alive_type = "2";//0:读数刷脸 1:屏幕闪烁刷脸 2:先闪烁不行则读数
  5. Base.faceType = "1";//0 不刷脸1:微信城市生活服务 2:支付宝 3:微信慧眼
  6. pubKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJcTBCPyX3OpLPNmDYLUitf8sZG4Wa1Q/9MNX/t12keSOjT/44OWnGHSo69eEpqxxx1KXkGJyLqvkUBhd8E5PUuADoy6AEyIRR093ceoYY2gNPVgsY61edp7MvB5iz9ej8Aw/ZwIacYZIib7VhFIBas+yG8yRvDU7kZYdmGrAH5QIDAQAB";
  7. Base.setValue = function (key, value) {
  8. if (typeof key == 'string') {
  9. $("#" + key).val(value);
  10. } else if (typeof key == 'object') {
  11. for (var k in key) {
  12. var obj = $("#" + k);
  13. var tag = obj[0] != null ? obj[0].tagName.toLowerCase() : "";
  14. if (tag == 'select' && key[k] instanceof Array) {
  15. $.setSelect(k, key[k]);
  16. } else {
  17. obj.val(key[k]);
  18. }
  19. }
  20. }
  21. };
  22. Base.getValue = function (key) {
  23. return $("#" + key).val();
  24. };
  25. Base.setReadOnly = function (ids) {
  26. ids = "#" + ids.replace(/,/g, ",#");
  27. $(ids).attr("readonly", "readonly");
  28. };
  29. Base.setRequired = function (ids, valid) {
  30. ids = "#" + ids.replace(/,/g, ",#");
  31. if (!valid) {
  32. $(ids).attr("valid", "r");
  33. } else {
  34. $(ids).removeAttr("valid");
  35. }
  36. }
  37. Base.submit = function (id, p, fun, fail) {
  38. $.doSubmit(id, p, function (data) {
  39. //for(var key in data){
  40. // $("#"+key).val(data[key]);
  41. //}
  42. Base.setValue(data);
  43. if (fun) {
  44. fun();
  45. }
  46. }, function (data) {
  47. $.toast(data.resmsg);
  48. if (fail) {
  49. fail(data);
  50. }
  51. });
  52. };
  53. Base.showObj = function (ids) {
  54. ids = "#" + ids.replace(/,/g, ",#");
  55. $(ids).parent().parent().show();
  56. };
  57. Base.hideObj = function (ids) {
  58. ids = "#" + ids.replace(/,/g, ",#");
  59. $(ids).parent().parent().hide();
  60. };
  61. Base.setEnable = function (ids) {
  62. ids = "#" + ids.replace(/,/g, ",#");
  63. $(ids).removeAttr("readonly");
  64. };
  65. Base.alert = function (msg) {
  66. $.toast(msg);
  67. };
  68. Base.focus = function (ids) {
  69. ids = "#" + ids;
  70. $(ids).focus();
  71. };
  72. Base.filterSelectInput = function (id, value) {
  73. var options = document.getElementById(id).options;
  74. for (var i = 0; i < options.length; i++) {
  75. var o = options[i];
  76. if (o.value != value) {
  77. o.disabled = true;
  78. }
  79. }
  80. };
  81. (function ($) {
  82. function list2Row(data, mode) {
  83. var html = "<div class='weui-cells' style='margin-top:0px' >";
  84. var content = [];
  85. var length = data.length;
  86. for (var i = 0; i < length; i++) {
  87. if (!data[i].value) {
  88. continue;
  89. }
  90. content[i] = "<div class='weui-cell ' style='font-size:0.9375em'><div class='weui-cell__bd'>" + (data[i].name != null ? data[i].name : "") + "</div><div class='weui-cell__ft'>" + (data[i].value != null ? data[i].value : "") + "</div></div>";
  91. }
  92. html += content.join("") + "</div>";
  93. return html;
  94. }
  95. function closeToast() {
  96. $(".fund_mask").remove();
  97. //uexWindow.closeToast();
  98. layer.closeAll();
  99. }
  100. function halfScreenDialog(params, callBack,cancel) {
  101. var counters = 15;
  102. if(params.counters==0){
  103. counters = 0
  104. }
  105. if(params.counters){
  106. counters = params.counters
  107. }
  108. var button_text = "我已阅读并同意";
  109. if(params.btn){
  110. button_text = params.btn;
  111. }
  112. var win = '<div id="dialogs">';
  113. win +=" <div class='js_dialog' id='iosDialog2' style='display: none;'>"
  114. win +=" <div class='weui-mask'></div>"
  115. win +=" <div id='js_dialog_2' class='weui-half-screen-dialog'>"
  116. win +=" <div class='weui-half-screen-dialog__hd'>"
  117. win +=" <div class='weui-half-screen-dialog__hd__side'>"
  118. win +=" <button class='weui-icon-btn' id='hideIOSDialog2'>关闭<i class='weui-icon-close-thin'></i></button>"
  119. win +=" </div>"
  120. win +=" <div class='weui-half-screen-dialog__hd__main'>"
  121. if (params.title != null) {
  122. win +=" <strong class='weui-half-screen-dialog__title'>"+ (params.title == null ? "" : params.title) +"</strong>"
  123. }
  124. win +=" </div>"
  125. win +=" </div>"
  126. win +=" <div class='weui-half-screen-dialog__bd' style='max-height: 300px;'>"
  127. win +=" <p class='weui-half-screen-dialog__tips'>"+ (params.content == null ? "" : params.content) + "</p>"
  128. win +=" </div>"
  129. win +=" <div class='weui-half-screen-dialog__ft'>"
  130. win +=" <a href='javascript:' class='weui-btn weui-btn_primary weui-btn_disabled' id='confirm_btn'>"+counters+"s</a>"
  131. win +=" </div>"
  132. win +=" </div>"
  133. win +=" </div>"
  134. win +="</div>";
  135. var mydialog = $(win);
  136. $(document.body).append(mydialog);
  137. $("#confirm_btn").addClass('weui-btn_disabled')
  138. if(counters==0){
  139. $("#confirm_btn").removeClass('weui-btn_disabled')
  140. $("#confirm_btn").text(button_text)
  141. }else{
  142. var j ;
  143. var counter = counters-1;
  144. clearInterval(j);
  145. j = setInterval(function () {
  146. $("#confirm_btn").text(counter+"s")
  147. counter--;
  148. if (counter == -1) {
  149. $("#confirm_btn").removeClass('weui-btn_disabled')
  150. $("#confirm_btn").text(button_text)
  151. clearInterval(j);
  152. }
  153. }, 1000);
  154. }
  155. var $dialog2 = $('#js_dialog_2'),
  156. $iosDialog2 = $('#iosDialog2');
  157. mydialog.find("a").each(function (index) {
  158. $(this).bind('click', function () {
  159. if($("#confirm_btn").hasClass('weui-btn_disabled')){
  160. return
  161. }
  162. if (callBack) {
  163. callBack(index);
  164. $(mydialog).remove();
  165. $iosDialog2.fadeOut(200);
  166. $dialog2.removeClass('weui-half-screen-dialog_show');
  167. }
  168. });
  169. });
  170. $('#dialogs').on('click', '.weui-mask', function(){
  171. // $(mydialog).remove();
  172. // $("#confirm_btn").addClass('weui-btn_disabled')
  173. // $("#confirm_btn").text(counters+"s")
  174. // clearInterval(j);
  175. // $(this).parents('.js_dialog').fadeOut(200);
  176. // $dialog2.removeClass('weui-half-screen-dialog_show');
  177. });
  178. $('#hideIOSDialog2').on('click', function(){
  179. $(mydialog).remove();
  180. $("#confirm_btn").addClass('weui-btn_disabled')
  181. $("#confirm_btn").text(counters+"s")
  182. clearInterval(j);
  183. $iosDialog2.fadeOut(200);
  184. $dialog2.removeClass('weui-half-screen-dialog_show');
  185. if(cancel){
  186. cancel();
  187. }
  188. });
  189. $iosDialog2.fadeIn(200);
  190. $dialog2.addClass('weui-half-screen-dialog_show');
  191. }
  192. function dialog(params, callBack) {
  193. var win = "<div class='fund_dialog_confirm' id='dialog99' style='display: ;max-height:100px'>";
  194. win += " <div class='dialogMask' style='position: fixed;z-index: 1000;width: 100%;height: 100%;top:0;left: 0; background: rgba(0, 0, 0, 0.6);'></div>";
  195. win += " <div class='fund_dialog' " + (params.mode <= -1 ? "style='padding-bottom:.4em'" : "") + " >";
  196. if (params.title != null) {
  197. win += " <div class='fund_dialog_hd'><strong class='fund_dialog_title'>" + (params.title == null ? "" : params.title) + "</strong></div>";
  198. }
  199. win += " <div class='fund_dialog_bd'>" + (params.content == null ? "" : params.content) + "</div>";
  200. if (params.mode != -1) {
  201. win += " <div class='fund_dialog_ft'>";
  202. if (params.mode == 0 || params.mode == null) {
  203. win += " <a id='dialog_cancel' class='fund_btn_dialog default'>取消</a>";
  204. }
  205. if (params.mode == 2) {
  206. win += " <a id='dialog_cancel' class='fund_btn_dialog default'>取消</a>";
  207. win += " <a id='dialog_ok' class='fund_btn_dialog primary'>" + params.btn + "</a>";
  208. } else if (params.mode == 3) {
  209. win += " <a id='dialog_ok' class='fund_btn_dialog primary'>" + params.btn + "</a>";
  210. } else {
  211. win += " <a id='dialog_ok' class='fund_btn_dialog primary'>确定</a>";
  212. }
  213. win += " </div>";
  214. }
  215. win += "</div></div>";
  216. var mydialog = $(win);
  217. mydialog.find("a").each(function (index) {
  218. $(this).bind('click', function () {
  219. if (params.mode == 2 && !$("#s11").is(":checked") && index == 1) {
  220. $.toast("您好!请下滑浏览内容后勾选“我同意该声明”");
  221. return
  222. }
  223. if (callBack) {
  224. callBack(index);
  225. }
  226. $(mydialog).remove();
  227. });
  228. });
  229. $(document.body).append(mydialog);
  230. if (params.duration) {
  231. setTimeout(function () {
  232. $(mydialog).remove();
  233. }, params.duration);
  234. }
  235. }
  236. function val(key, value) {
  237. if (key && value) {
  238. if (typeof value == "object") {
  239. value = JSON.stringify(value);
  240. }
  241. localStorage.setItem(key, value);
  242. }
  243. if (!value) {
  244. return localStorage.getItem(key);
  245. }
  246. };
  247. function val2(list, value) {
  248. if (!list) {
  249. return value;
  250. }
  251. var v = "";
  252. for (var i = 0; i < list.length; i++) {
  253. var item = list[i];
  254. if (item.id == value) {
  255. v = item.value;
  256. }
  257. }
  258. if (v) {
  259. return v;
  260. } else {
  261. return value;
  262. }
  263. };
  264. function remove(key) {
  265. localStorage.removeItem(key);
  266. };
  267. function openWin(url) {
  268. if (url.indexOf("perfetchlist") != -1) {
  269. window.location.href = url + "?type=1";
  270. } else {
  271. window.location.href = url;
  272. }
  273. }
  274. function closeCurrWin() {
  275. window.history.go(-1);
  276. }
  277. function closeWin(winName, duration) {
  278. var winName = winName || "";
  279. var fun = function () {
  280. window.history.go(-1);
  281. };
  282. duration = duration || 2000;
  283. setTimeout(fun, duration);
  284. }
  285. function dataFormat(value) {
  286. if (value === "" || value == undefined || value == "null" || value == null) {
  287. return "";
  288. } else if (isNaN(value)) {
  289. return value;
  290. } else {
  291. var moneyValue = String(Number(value).toFixed(2));
  292. var t_moneyValue;
  293. if (moneyValue.indexOf(".") > 0) {
  294. t_moneyValue = moneyValue.substring(0, moneyValue.indexOf("."));
  295. var t_p = moneyValue.substring(moneyValue.indexOf("."));
  296. var re = /(-?\d+)(\d{3})/;
  297. while (re.test(t_moneyValue)) {
  298. t_moneyValue = t_moneyValue.replace(re, "$1,$2");
  299. }
  300. moneyValue = t_moneyValue + t_p;
  301. } else {
  302. var re = /(-?\d+)(\d{3})/;
  303. while (re.test(moneyValue)) {
  304. moneyValue = moneyValue.replace(re, "$1,$2");
  305. }
  306. }
  307. return moneyValue;
  308. }
  309. }
  310. function setLayOut(ids) {
  311. var h = $(window).height() - $("#header").height();
  312. if (ids) {
  313. ids = ids.split(",");
  314. for (var i = 0; i < ids.length; i++) {
  315. h -= $("#" + ids[0]).height();
  316. }
  317. }
  318. $("#content").height(h);
  319. $("#content").css("overflow-y", "auto");
  320. return h;
  321. }
  322. function activateUrl() {
  323. $(".shortcut").each(function () {
  324. $(this).bind("click", function () {
  325. $.openWin($(this).attr("data-url"));
  326. });
  327. });
  328. }
  329. function setCookie(c_name, value, expiredays) {
  330. var exdate = new Date()
  331. exdate.setDate(exdate.getDate() + expiredays)
  332. document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + exdate.toGMTString());
  333. }
  334. function getCookie(name) {
  335. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  336. if (arr = document.cookie.match(reg))
  337. return unescape(arr[2]);
  338. else
  339. return null;
  340. }
  341. function delCookie(name) {
  342. var exp = new Date();
  343. exp.setTime(exp.getTime() - 1);
  344. var cval = getCookie(name);
  345. if (cval != null)
  346. document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
  347. }
  348. function setSelect(obj, list, id, value) {
  349. var houseno = $("#" + obj);
  350. var defaultValue = houseno.attr("defaultValue");
  351. if (list && list.length < 1) {
  352. return houseno;
  353. }
  354. if (!id) {
  355. id = "id";
  356. }
  357. if (!value) {
  358. value = "value";
  359. }
  360. houseno.empty();
  361. for (var i = 0; i < list.length; i++) {
  362. var item = list[i];
  363. var name = item.name;
  364. if (!name) {
  365. name = item[value];
  366. }
  367. var slected = "";
  368. if (defaultValue == item[id]) {
  369. slected = "selected";
  370. }
  371. houseno.append("<option " + slected + " value='" + item[id] + "'>" + name + "</option>");
  372. }
  373. return houseno;
  374. }
  375. function quit() {
  376. $.doSubmit("", {"method": "user.loginout", "v": "1.0"}, function (data) {
  377. $.remove("sessionId");
  378. $.remove("loginFlag");
  379. $.openWin("login.jsp", "", false, true);
  380. //location.reload();
  381. });
  382. }
  383. function validFace(param, call, fail) {
  384. var p = {"method": "local.user.validFace", "v": "1.0"}
  385. if (param.token) {//城市生活服务刷脸,需要token
  386. p.token = param.token;
  387. }
  388. if (param.qrtoken) {//网厅刷脸
  389. p.qrtoken = param.qrtoken;
  390. }
  391. if (param.ywdjh) {//业务登记号
  392. p.ywdjh = param.ywdjh;
  393. }
  394. $.doSubmit("", p, function (data) {
  395. if (call && data.sign == "1") {
  396. call(data);
  397. } else if (data.sign == "-1") {//刷脸失败
  398. $.toast("没有做刷脸");
  399. if (fail) {
  400. fail(data);
  401. }
  402. } else if (data.sign == "0") {
  403. if (fail) {
  404. fail(data);
  405. }
  406. //if(data.faceFaileCount>=1){//刷脸失败,超过三次切换短信验证
  407. $.setSelect("vtype", [{"id": 1, "name": "短信验证"}, {"id": 3, "name": "刷脸验证"}]);
  408. $("#vtype").change();
  409. $.toast("刷脸认证失败!");
  410. // }
  411. }
  412. }, function (data) {
  413. if (fail) {
  414. fail(data);
  415. }
  416. });
  417. }
  418. /** param:{appId:"",name:"",idcard:"",key:""},callback 回调函数
  419. * callback(param) param->{code:0,key:"=",msg:''}
  420. * code=0 表示刷脸成功
  421. * */
  422. err__msg = {
  423. "10001": "参数错误",
  424. "10002": "人脸特征检测失败",
  425. "10003": "身份证号不匹配",
  426. "10004": "公安比对人脸信息不匹配",
  427. "10005": "正在检测中",
  428. "10006": "appid 没有权限",
  429. "10007": "后台获取图片失败",
  430. "10008": "公安系统失败",
  431. "10009": "公安未查到身份证照片比对源",
  432. "10010": "照片质量不满足公安比对要求",
  433. "10011": "身份证信息未开通公安比对权限",
  434. "10012": "征信验证失败",
  435. "10013": "征信系统错误",
  436. "10014": "公安系统失败,征信系统成功",
  437. "10015": "公安服务暂时不可用",
  438. "10016": "存储用户图片失败",
  439. "10017": "非法 identify_id",
  440. "10018": "用户信息不存在",
  441. "10020": "认证超时",
  442. "10021": "重复的请求,返回上一次的结果",
  443. "10022": "用户信息错误",
  444. "10026": "用户身份证数据不在公安比对数据库中",
  445. "10027": "语音识别失败",
  446. "10028": "唇动检测失败",
  447. "90100": "刷脸取消"
  448. };
  449. function doWxVerifyFace(param, callback) {
  450. wx.invoke("checkIsSupportFaceDetect", {}, function (res) {
  451. if (res.err_code != 0) {
  452. $.toast("当前微信版本不支持刷脸:" + res.err_code);
  453. return;
  454. }
  455. if (param == null) {
  456. $.toast("缺少参数");
  457. return;
  458. }
  459. var p = {appId: appid};
  460. var pre_info = "{\"name\":\"" + param.pername + "\",\"id_card_number\":\"" + param.codeno + "\"";
  461. if (param.key) {
  462. pre_info += ",\"user_id_key\": \"" + param.key + "\"";
  463. }
  464. pre_info += "}";
  465. p.request_verify_pre_info = pre_info;
  466. p.check_alive_type = Base.check_alive_type;
  467. wx.invoke("requestWxFacePictureVerify", p, function (res) {
  468. if (callback) {
  469. var p = {};
  470. p.code = res.err_code;
  471. p.msg = err__msg[p.code];
  472. if (p.msg == null) {
  473. p.msg = "刷脸错误,错误码:" + p.code;
  474. }
  475. p.key = res.verify_result;
  476. if (p.code == 0) {
  477. validFace({token: p.key, qrtoken: param.qrtoken, ywdjh: param.ywdjh}, function () {
  478. callback(p);
  479. });
  480. } else {
  481. //callback(p);
  482. $.toast(p.msg);
  483. }
  484. }
  485. });
  486. });
  487. }
  488. function wxCloundFace(p, call) {
  489. var a = window.location.href;
  490. if (a.indexOf("BizToken") != -1) {//刷脸认证返回
  491. //params.type=type;
  492. validFace({qrtoken: p.qrtoken}, call, function (data) {
  493. $.dialog({title: "", content: data.resmsg, mode: 1}, function (index) {
  494. //$.openWin("login.jsp?ref=no");
  495. window.location.href = Base.gobackurl;
  496. //window.location.href = window.location.href.split("?")[0];
  497. });
  498. });
  499. return;
  500. }
  501. if (p.url) {//跳转刷脸url
  502. window.location.href = p.url;
  503. return;
  504. }
  505. }
  506. function doFace(p, callback) {
  507. var params = {"method": "local.user.initface", "v": "1.0"};
  508. if (p.pername) {
  509. params.pername = p.pername;
  510. }
  511. if (p.codeno) {
  512. params.codeno = p.codeno;
  513. }
  514. if (p.qrtoken) {
  515. params.qrtoken = p.qrtoken;
  516. }
  517. if (p.returnurl) {
  518. params.returnurl = p.returnurl;
  519. } else {
  520. params.returnurl = window.location.href.split("#")[0];
  521. }
  522. if (p.faceType) {
  523. params.facetype = p.faceType;//
  524. } else {
  525. params.facetype = Base.faceType;
  526. }
  527. if (params.facetype == 3) {
  528. var a = window.location.href;
  529. if (a.indexOf("BizToken") != -1) {//刷脸认证返回
  530. wxCloundFace(p, callback);
  531. return;
  532. }
  533. }
  534. $.doSubmit("", params, function (data) {
  535. if (params.facetype == 1) {//城市生活服务
  536. doWxVerifyFace(p, callback);
  537. }
  538. if (params.facetype == 3) {//慧眼
  539. p.url = data.url;
  540. wxCloundFace(p, callback);
  541. }
  542. }, function (data) {
  543. });
  544. }
  545. function wxConfig(isDebug) {//获取微信内置api 调用权限
  546. if (!isDebug) {
  547. isDebug = false;
  548. }
  549. var p = {toast: 0, 'method': 'user.wxconfig', 'v': '1.0'};
  550. p.wxurl = location.href.split('#')[0];
  551. $.doSubmit('', p, function (data) {
  552. appid = data.appid;
  553. if (data.facebug == 0) {
  554. facebug = true;
  555. } else {
  556. facebug = false;
  557. }
  558. wx.config({
  559. beta: true,
  560. debug: isDebug,
  561. appId: data.appid,
  562. timestamp: data.timestamp,
  563. nonceStr: data.noncestr,
  564. signature: data.signature,
  565. jsApiList: ["chooseImage", "scanQRCode", "uploadImage", "startRecord", "previewImage", "requestWxFacePictureVerify", "checkIsSupportFaceDetect"]
  566. });
  567. }, function (data) {
  568. $.toast(data.resmsg);
  569. });
  570. }
  571. function wxscanQRCode(callback, code) {
  572. if (!code) {
  573. code = 1;
  574. }
  575. wx.scanQRCode({
  576. needResult: code, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  577. scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
  578. success: function (res) {
  579. var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
  580. if (callback) {
  581. callback(result);
  582. }
  583. }
  584. });
  585. }
  586. function base64(value) {
  587. var str = CryptoJS.enc.Utf8.parse(value);
  588. return CryptoJS.enc.Base64.stringify(str);
  589. }
  590. function openPicker(callfun, showday) {//depth
  591. weui.datePicker({
  592. start: 2000,
  593. end: 2070,
  594. defaultValue: [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()],
  595. onChange: function (result) {
  596. if (showday) {
  597. $('.weui-picker .weui-picker__bd .weui-picker__group').eq(2).hide();
  598. }
  599. },
  600. onConfirm: function (result) {
  601. console.log(result);
  602. var data = {year: result[0]}
  603. data.month = result[1] < 10 ? ("0" + result[1]) : result[1];
  604. data.day = result[2] < 10 ? ("0" + result[2]) : result[2];
  605. if (callfun) {
  606. callfun(data);
  607. }
  608. }
  609. });
  610. }
  611. function uploadImage(callFun) {
  612. wx.chooseImage({
  613. count: 1, // 默认9
  614. sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  615. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  616. success: function (res) {
  617. var localId = res.localIds[0]; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
  618. wx.uploadImage({
  619. localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
  620. isShowProgressTips: 1, // 默认为1,显示进度提示
  621. success: function (res) {
  622. var serverId = res.serverId; // 返回图片的服务器端ID
  623. $.toast("图片已上传");
  624. if (callFun) {
  625. callFun(serverId);
  626. }
  627. }
  628. });
  629. },
  630. fail: function (res) {
  631. $.toast("图片上传失败");
  632. }
  633. });
  634. }
  635. /* var global= {"newsevent":"http://www.scsjgjj.com/ShowChannel.aspx?id=27"
  636. ,"im":"http://www.scsjgjj.com/know.aspx"
  637. ,"city":"四川省省级"
  638. ,"imcustmsg":"http://www.scsjgjj.com/know.aspx"
  639. ,"workguid":"http://www.scsjgjj.com/ShowChannel.aspx?id=15"
  640. ,"newssurvey":"http://www.scsjgjj.com/ShowLeaveChannel.aspx?id=22"
  641. ,"phone2":"12329"
  642. ,"newslodge":"http://www.scsjgjj.com/ShowLeaveColumn.aspx?id=76&channelId=22"
  643. ,"newspolicy":"http://www.scsjgjj.com/wx/News/List16?listid=0&&page=10&&index=1&&navid=0",
  644. "newshot":"http://www.scsjgjj.com/wx/News/List27?listid=45&&page=10&&index=1&&navid=2"
  645. ,"web":"http://www.scsjgjj.com"
  646. ,"phone":"12329"
  647. ,"sinaWeibo":"https://weibo.com/u/6046993337"
  648. ,"myzixun":""
  649. ,"myadvisory":""}*/
  650. $.extend({
  651. dialog: dialog,
  652. halfScreenDialog: halfScreenDialog,
  653. list2Row: list2Row,
  654. closeToast: closeToast,
  655. val: val,
  656. val2: val2,
  657. remove: remove,
  658. openWin: openWin,
  659. closeCurrWin: closeCurrWin,
  660. closeWin: closeWin,
  661. dataFormat: dataFormat,
  662. setLayOut: setLayOut,
  663. activateUrl: activateUrl,
  664. global: global,
  665. wxVerifyFace: doWxVerifyFace, /** 微信内置刷脸 */
  666. wxConfig: wxConfig, /** 微信内置api权限获取 */
  667. setCookie: setCookie,
  668. getCookie: getCookie,
  669. delCookie: delCookie,
  670. openPicker: openPicker,
  671. uploadImage: uploadImage,
  672. wxConfig: wxConfig,
  673. base64: base64,
  674. doFace: doFace,
  675. quit: quit,
  676. setSelect: setSelect,
  677. wxscanQRCode: wxscanQRCode,
  678. scanQRCode: wxscanQRCode
  679. });
  680. })(jQuery);
  681. __seconds = 60;
  682. function getSMSCode(phone, busType, sign, em, form) {
  683. if (__seconds < 60) {
  684. return;
  685. }
  686. if (!form) {
  687. form = "myform";
  688. }
  689. if (!$.doValid(form, 1)) {
  690. return;
  691. }
  692. if (!em) {
  693. em = "yzmbt";
  694. }
  695. var codetype = $("#codetype").val();
  696. var params = {
  697. "phone": phone,
  698. "codetype": codetype,
  699. "bustype": busType,
  700. "method": "local.user.getCheckCodeNews",
  701. "v": "1.0"
  702. };
  703. if (sign) {
  704. params.unlogin = sign;
  705. }
  706. $.doSubmit("", params, function (data) {
  707. if (busType == "SMS_WXDL") {
  708. var showphone = data.currentPhone;
  709. $("#phonetype").show();
  710. $("#currentPhone").val(showphone);
  711. $(".login_box").css("height", "18rem");
  712. }
  713. $.toast("验证码已发送到手机,请注意查收!");
  714. var embt = document.getElementById(em);
  715. $("#" + em).css("color", "#999999");
  716. time = setInterval(function () {
  717. __seconds = __seconds - 1;
  718. var temp = __seconds <= 9 ? ("0" + __seconds) : __seconds;
  719. $("#" + em).text("(" + temp + "S)后重新获取");
  720. if (__seconds < 0) {
  721. clearInterval(time);
  722. $("#" + em).text("获取验证码");
  723. $("#" + em).css("color", "#49A5E1");
  724. __seconds = 60;
  725. embt.disabled = false;
  726. }
  727. }, 1000);
  728. embt.disabled = true;
  729. }, function (data) {
  730. $.toast(data.resmsg);
  731. });
  732. }
  733. function initResource(relist) {
  734. if (!relist) {
  735. relist = $.val("relist")
  736. }
  737. if (!relist) {
  738. return;
  739. }
  740. var relist = $.parseJSON(relist);//[{number:1,datatype:"1",name:"身份证"},{number:1,datatype:"1",name:"购房合同"}];
  741. var fileList = relist;
  742. if (relist.length <= 0) {
  743. return;
  744. }
  745. $("#fileNum").val(relist.length);
  746. $("#uprestip").show();
  747. if (relist.length == 0) {
  748. $("#uprestip").hide();
  749. }
  750. var c = 0, html = "";
  751. var asst = "";
  752. for (var i = 0; i < fileList.length; i++) {
  753. var obj = fileList[i];
  754. var dataname = obj.name;
  755. var isrquired = obj.isrquired;
  756. var sfymb = obj.sfymb;
  757. if (dataname.indexOf("身份证") != -1) {
  758. dataname = dataname;
  759. if(sfymb == "1"){
  760. html += "<div style='padding:0px;' class='fund_grids ' style='width:100%' onclick='showModel(" + obj.id + ")'>";
  761. html += " <button type='button' style='color: red;background: #ffffff;font-size:1em'>【"+dataname+"】模板</button>";
  762. html += "</div>";
  763. }
  764. html += "<div style='padding:15px' class='fund_grids ' style='width:100%'>" + dataname + asst + "</div>";
  765. html += "<div class='fund_grids ' style='width:100%'>";
  766. html += "<div style='height:7em;padding:0px' class='fund_grid grid-2c'>";
  767. html += " <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
  768. html += " <input type='file' accept='image/*' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' valid='r' label='上传" + dataname + "正面' mainName='" + dataname + "正面'/>";
  769. html += " <input type='hidden' name='dataId' value='" + obj.id + "'/>";
  770. html += " <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
  771. html += " <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
  772. html += " <input type='hidden' name='ocrsbtype' value='face'/>";
  773. html += " <button type='button' style='width:9em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择"+dataname+"正面</button>";
  774. html += " </div>";
  775. html += "</div>";
  776. html += "<div style='height:7em;padding:0px' class='fund_grid grid-2c'>";
  777. html += " <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
  778. html += " <input type='file' accept='image/*' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' valid='r' label='上传" + dataname + "反面' mainName='" + dataname + "反面'/>";
  779. html += " <input type='hidden' name='dataId' value='" + obj.id + "'/>";
  780. html += " <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
  781. html += " <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
  782. html += " <input type='hidden' name='ocrsbtype' value='back'/>";
  783. html += " <button type='button' style='width:9em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择"+dataname+"反面</button>";
  784. html += " </div>";
  785. html += "</div>";
  786. html += "</div>";
  787. } else {
  788. if (isrquired == 1) {
  789. if(sfymb == "1"){
  790. html += "<div style='padding:0px;' class='fund_grids ' style='width:100%' onclick='showModel(" + obj.id + ")'>";
  791. html += " <button type='button' style='color: red;background: #ffffff;font-size:1em'>【"+dataname+"】模板</button>";
  792. html += "</div>";
  793. }
  794. html += "<div style='padding:15px' class='fund_grids ' style='width:100%'>" + dataname + asst + "</div>";
  795. html += "<div class='fund_grids ' style='width:100%'>";
  796. html += "<div style='height:7em;padding:0px' class='fund_grid grid-2c'>";
  797. html += " <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
  798. html += " <input type='file' accept='image/*' class='" + obj.id + "' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' valid='r' label='上传" + dataname + "' mainName='" + dataname + "'/>";
  799. html += " <input type='hidden' name='dataId' value='" + obj.id + "'/>";
  800. html += " <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
  801. html += " <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
  802. html += " <input type='hidden' name='ocrsbtype' value=''/>";
  803. html += " <button type='button' style='width:5.6em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择图片</button>";
  804. html += " </div>";
  805. html += "</div>";
  806. html += "<div style='height:7em;padding:0px;display:none;' class='fund_grid grid-2c' id='" + obj.id + "'>";
  807. html += " <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
  808. html += " <input type='file' accept='image/*' onchange='onChangeFile(this)' sign='1' style='display: none' id='f" + i + "' label='上传" + dataname + "' mainName='" + dataname + "'/>";
  809. html += " <input type='hidden' value='" + obj.id + "'/>";
  810. html += " <input type='hidden' value='" + obj.sfocrsb + "'/>";
  811. html += " <input type='hidden' value='" + obj.ocrsbzd + "'/>";
  812. html += " <input type='hidden' value=''/>";
  813. html += " <button type='button' style='width:25px;height:25px;background:url(css/images/icon-add-act.png);'></button>";
  814. html += " </div>";
  815. html += "</div>";
  816. html += "</div>";
  817. }else{
  818. if(sfymb == "1"){
  819. html += "<div style='padding:0px;' class='fund_grids ' style='width:100%' onclick='showModel(" + obj.id + ")'>";
  820. html += " <button type='button' style='color: red;background: #ffffff;font-size:1em'>【"+dataname+"】模板</button>";
  821. html += "</div>";
  822. }
  823. html += "<div style='padding:15px' class='fund_grids ' style='width:100%'>" + dataname + asst + "</div>";
  824. html += "<div class='fund_grids ' style='width:100%'>";
  825. html += "<div style='height:7em;padding:0px' class='fund_grid grid-2c'>";
  826. html += " <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
  827. html += " <input type='file' accept='image/*' class='" + obj.id + "' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' label='上传" + dataname + "' mainName='" + dataname + "'/>";
  828. html += " <input type='hidden' name='dataId' value='" + obj.id + "'/>";
  829. html += " <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
  830. html += " <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
  831. html += " <input type='hidden' name='ocrsbtype' value=''/>";
  832. html += " <button type='button' style='width:5.6em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择图片</button>";
  833. html += " </div>";
  834. html += "</div>";
  835. html += "<div style='height:7em;padding:0px;display:none;' class='fund_grid grid-2c' id='" + obj.id + "'>";
  836. html += " <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
  837. html += " <input type='file' accept='image/*' onchange='onChangeFile(this)' sign='1' style='display: none' id='f" + i + "' label='上传" + dataname + "' mainName='" + dataname + "'/>";
  838. html += " <input type='hidden' value='" + obj.id + "'/>";
  839. html += " <input type='hidden' value='" + obj.sfocrsb + "'/>";
  840. html += " <input type='hidden' value='" + obj.ocrsbzd + "'/>";
  841. html += " <input type='hidden' value=''/>";
  842. html += " <button type='button' style='width:25px;height:25px;background:url(css/images/icon-add-act.png);'></button>";
  843. html += " </div>";
  844. html += "</div>";
  845. html += "</div>";
  846. }
  847. }
  848. }
  849. $("#file_grids").html(html);
  850. $(".fund_grid").unbind("click");
  851. $(".fund_grid").bind("click", function () {
  852. $(this).find("input")[0].click();
  853. });
  854. }
  855. function getArchive(obj, id) {
  856. return obj;
  857. }
  858. function onChangeFile(that) {
  859. var className = that.className;
  860. $("#" + className).show();
  861. var b = false;
  862. if (!that.value) {
  863. b = true;
  864. }
  865. var a = that.value.substr(that.value.lastIndexOf(".") + 1).toLowerCase();
  866. if (a != "jpg" && a != "png" && a != "gif") {
  867. $.toast("请选择图片格式类型的资料文件");
  868. b = true;
  869. }
  870. var box = $(that).parent();
  871. if (b) {
  872. box.css({"background-image": ""});
  873. that.value = "";
  874. return;
  875. }
  876. var reader = new FileReader();
  877. reader.onload = function (e) {
  878. var imgFile = e.target.result;
  879. var w = box.width();
  880. var h = box.height();
  881. var sign = $(that).attr("sign");
  882. if (sign) {
  883. var archbox = $(that).parent().parent();
  884. var html = archbox.prop("outerHTML");
  885. html = $(html).bind("click", function () {
  886. $(this).find("input")[0].click();
  887. })
  888. archbox.after(html);
  889. $(archbox.find("input")[0]).attr("name", "archive");
  890. $(archbox.find("input")[1]).attr("name", "dataId");
  891. $(archbox.find("input")[2]).attr("name", "sfocrsb");
  892. $(archbox.find("input")[3]).attr("name", "ocrsbzd");
  893. $(archbox.find("input")[4]).attr("name", "ocrsbtype");
  894. archbox.find("button").css({
  895. width: "5.6em",
  896. "padding-left": ".5em",
  897. "color": "rgba(84, 172, 234,0.8)",
  898. "background": "rgba(84, 172, 234, 0.13)"
  899. }).text("选择图片");//$(that).attr("label")
  900. $(that).removeAttr("sign")
  901. }
  902. box.css({
  903. "background-image": "url(" + imgFile + ")",
  904. "background-size": "" + w + "px " + h + "px ",
  905. "background-repeat": "no-repeat"
  906. });
  907. };
  908. reader.readAsDataURL(that.files[0]);
  909. }
  910. var Pie = {
  911. init: function (id, loanMny, payMny) {
  912. this.canvas = document.getElementById(id);
  913. this.ctx = this.canvas.getContext("2d");
  914. this.width = this.canvas.width;
  915. this.height = this.canvas.height;
  916. this.pointX = this.width / 2;
  917. this.pointY = this.height / 2;
  918. this.i = 0;
  919. this.deg = 0;
  920. var w = parseInt($(document).width());
  921. this.PI = Math.PI / 180;
  922. if (w > 414 && w <= 720) {
  923. this.lineWidth = 50;
  924. this.R = this.width / 2 - 25;
  925. this.textH = 20;
  926. this.diff = 55;
  927. this.textH2 = 35;
  928. } else if (w <= 414) {//针对苹果
  929. this.lineWidth = 30;
  930. this.R = this.width / 2 - 25;
  931. this.textH = 16;
  932. this.diff = this.R / 2 - 10;
  933. this.textH2 = 18;
  934. } else {
  935. this.lineWidth = 70;
  936. this.diff = 70;
  937. this.R = this.width / 2 - 35;
  938. this.textH = 20;
  939. this.textH2 = 50;
  940. }
  941. this.per = payMny / loanMny;
  942. this.loanMny = $.dataFormat(loanMny);
  943. this.payMny = $.dataFormat(payMny);
  944. this.payMnyColor = "#53c495";
  945. this.loanMnyColor = "#6eb9f3";
  946. }, drawPie: function (id, loanMny, payMny) {
  947. this.init(id, loanMny, payMny);
  948. this.degCount();
  949. }, doDrawPie: function () {
  950. this.ctx.clearRect(0, 0, this.width, this.height);
  951. this.ctx.lineWidth = this.lineWidth;
  952. this.ctx.beginPath();
  953. this.ctx.strokeStyle = this.loanMnyColor;
  954. this.ctx.arc(this.pointX, this.pointY, this.R, 0, Math.PI * 2);
  955. this.ctx.stroke();
  956. this.ctx.beginPath();
  957. this.ctx.strokeStyle = this.payMnyColor;
  958. this.deg = this.i * this.PI;
  959. this.ctx.arc(this.pointX, this.pointY, this.R, -90 * this.PI, this.deg - 90 * this.PI);
  960. this.ctx.stroke();
  961. this.ctx.fillStyle = this.loanMnyColor;
  962. var text = "贷款金额(元)";
  963. this.ctx.font = "0.875em abc";
  964. var text_w = this.ctx.measureText(text).width;
  965. var text_h = this.ctx.measureText(text).height;
  966. this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY - this.diff);
  967. text = this.loanMny;
  968. text_w = this.ctx.measureText(text).width;
  969. this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY - this.textH);
  970. this.ctx.fillStyle = this.payMnyColor;
  971. text = "偿还本金(元)";
  972. text_w = this.ctx.measureText(text).width;
  973. this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY + this.diff);
  974. var text = this.payMny;
  975. text_w = this.ctx.measureText(text).width;
  976. this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY + this.diff + this.textH2);
  977. }, degCount: function () {
  978. Pie.doDrawPie();
  979. if (((Pie.per * 360) * Pie.PI - Pie.deg) < 0.01) {
  980. return;
  981. }
  982. if (window.webkitRequestAnimationFrame) {
  983. window.webkitRequestAnimationFrame(Pie.degCount);
  984. } else if (window.requestAnimationFrame) {
  985. window.requestAnimationFrame(Pie.degCount);
  986. } else if (window.oRequestAnimationFrame) {
  987. window.oRequestAnimationFrame(Pie.degCount);
  988. }
  989. if (Pie.per < 0.3) {
  990. Pie.i += 1;
  991. } else {
  992. Pie.i += 4;
  993. }
  994. }
  995. }
  996. function autoFullUP() {//自动填充用户名和密码
  997. var _loginacc = $.val("_loginacc");
  998. if (_loginacc) {
  999. $("#loginacc").val(_loginacc);
  1000. }
  1001. }
  1002. function autoLogin() {//自动登录
  1003. var _loginacc = $.val("_loginacc");
  1004. var _loginpwd = $.val("_loginpwd");
  1005. if (!_loginacc) {
  1006. return;
  1007. }
  1008. if (!_loginpwd) {
  1009. return;
  1010. }
  1011. $.doSubmit("", {
  1012. "toast": 0,
  1013. "loginacc": _loginacc,
  1014. "loginpwd": _loginpwd,
  1015. "method": "user.login",
  1016. "v": "1.0"
  1017. }, function (data) {
  1018. $.val("_loginacc", $("#loginacc").val());
  1019. $.val("_loginpwd", $("#loginpwd").val());
  1020. $.val("signflag", data.signflag);
  1021. }, function (data) {
  1022. $.toast(data.resmsg);
  1023. $.openWin("login.jsp");
  1024. });
  1025. }
  1026. function removeUserInfo() {
  1027. var _loginacc = $.val("_loginacc");
  1028. var _loginpwd = $.val("_loginpwd");
  1029. if (_loginacc == null || _loginpwd == null) {
  1030. $.toast("您没有绑定用户信息");
  1031. return;
  1032. }
  1033. $.remove("_loginacc");
  1034. $.remove("_loginpwd");
  1035. $.toast("解绑成功");
  1036. }
  1037. function reportGenerator(parameters) {
  1038. var defaults = {"method": "user.generateReport", "v": "1.0"};
  1039. parameters = $.extend(defaults, parameters);
  1040. $.doSubmit("", parameters, function (data) {
  1041. $.openWin("download.jsp?token=" + data.token + "&type=" + parameters.type + "&r=" + Math.random());
  1042. }, function (data) {
  1043. $.toast(data.resmsg);
  1044. }, function () {
  1045. $.toast(data.resmsg);
  1046. });
  1047. }
  1048. function fetchMenu(list, type) {
  1049. if (list.length == 0) {
  1050. $("#" + type).hide();
  1051. } else {
  1052. $("#" + type).show();
  1053. var box = $("#" + type).find(".weui-flexs");
  1054. box.html("");
  1055. for (var i = 0; i < list.length; i++) {
  1056. var html = "";
  1057. if(list[i].funurl.indexOf("http")!=-1){
  1058. html += '<div class="weui-flex__item shortcut icons" data-url="' + list[i].funurl + '">'
  1059. }else{
  1060. html += '<div class="weui-flex__item shortcut icons" data-url="' + list[i].funurl + '.jsp">'
  1061. }
  1062. html += '<div class="icon_img">'
  1063. html += '<img class="' + list[i].iconskin + '"/>'
  1064. html += '</div>'
  1065. html += '<p class="icon_text">' + list[i].name + '</p>'
  1066. html += '</div>'
  1067. box.append(html)
  1068. }
  1069. }
  1070. }
  1071. function initData() {//提取
  1072. arealist = $.parseJSON($.val("arealist"));//缓存区域,提取页面初始化
  1073. dklxlist = $.parseJSON($.val("dklxlist"));//缓存身份类型提取页面初始化
  1074. idlist = $.parseJSON($.val("idlist"));//缓存贷款类型,提取页面初始化
  1075. $.setSelect("cdxzqydm", arealist);//项目区域
  1076. $.setSelect("spousezjlx", idlist);//配偶证件类型
  1077. $.setSelect("ownzjlx", idlist);//关联人证件类型
  1078. $.setSelect("dklx", dklxlist);//配偶证件类型
  1079. }
  1080. function clearNoNum(obj) {//提取
  1081. obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
  1082. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
  1083. obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  1084. obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
  1085. if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
  1086. obj.value = parseFloat(obj.value);
  1087. }
  1088. var allstandmny = $("#allstandmny").val() - 0;
  1089. var factfetchmny = $("#factfetchmny").val() - 0;
  1090. if (factfetchmny > allstandmny) {
  1091. $.dialog({title: "", content: "提取金额不能大于可提取金额", mode: 1}, function (index) {
  1092. });
  1093. $("#factfetchmny").val("");
  1094. } else if (factfetchmny * 100 % 10000 != 0) {
  1095. $.dialog({title: "", content: "申请提取金额必须以百元为单位", mode: 1}, function (index) {
  1096. });
  1097. $("#factfetchmny").val("");
  1098. } else if (factfetchmny <= 0) {
  1099. $.dialog({title: "", content: "请输入正确的提取金额", mode: 1}, function (index) {
  1100. });
  1101. $("#factfetchmny").val("");
  1102. }
  1103. }
  1104. function clearNoNum1(obj) {//提取
  1105. obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
  1106. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
  1107. obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  1108. obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
  1109. if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
  1110. obj.value = parseFloat(obj.value);
  1111. }
  1112. }
  1113. function openpick(obj, format, fun) {
  1114. $.openPicker(function (data) {
  1115. if (format == "yyyymm") {
  1116. obj.value = data.year + "" + data.month;
  1117. } else if (format == "mm") {
  1118. obj.value = data.month;
  1119. } else {
  1120. obj.value = data.year + "-" + data.month + "-" + data.day;
  1121. }
  1122. if (fun) {
  1123. fun();
  1124. }
  1125. });
  1126. }
  1127. $(document).ready(function () {
  1128. if (window.onViewOpen) {
  1129. onViewOpen();
  1130. }
  1131. if (window.onViewCreate) {
  1132. onViewCreate();
  1133. }
  1134. if (!window.goback) {
  1135. $("#nav-left").bind("click", function () {
  1136. window.history.go(-1);
  1137. });
  1138. var nav = $("<div class='circle box box-c tx-c'><div class='fa fa-angle-left fa-2x' style='color:#00A1EA;display:relative;'></div></div>");
  1139. nav.bind("click", function () {
  1140. $.closeCurrWin()
  1141. });
  1142. $(document.body).append(nav);
  1143. }
  1144. })
  1145. function fnSelSheng(that) { // 710000 810000 820000 台湾 香港 澳门 的没有市县
  1146. $("#shi").find("option").remove();
  1147. $("#xian").find("option").remove();
  1148. $("#shi").html('<option value="">请选择市</option>');
  1149. $("#xian").html('<option value="">请选择区/县</option>');
  1150. var value = that.value;
  1151. if (value == "710000" || value == "810000" || value == "820000") {
  1152. $("#shi1").hide();
  1153. $("#xian1").hide();
  1154. $.val("shi", "");
  1155. $.val("xian", "");
  1156. } else {
  1157. $("#shi1").show();
  1158. $("#xian1").show();
  1159. fnSelectedProvince(value, "2");
  1160. $.val("xian", "");
  1161. }
  1162. }
  1163. function fnSelShi(that) {
  1164. $("#xian").find("option").remove();
  1165. $("#xian").html('<option value="">请选择区/县</option>');
  1166. var value = that.value;
  1167. fnSelectedProvince(value, "3");
  1168. }
  1169. function fnSelXian(that) {
  1170. var shi = $("#shi").val();
  1171. if (!shi) {
  1172. return;
  1173. }
  1174. if (shi != "360100") {
  1175. set_select_checked("fwssqy", "1");
  1176. } else {
  1177. set_select_checked("fwssqy", "0");
  1178. }
  1179. }
  1180. var desheng;
  1181. var deshi;
  1182. /**
  1183. * 获取省/市/县
  1184. */
  1185. function fnSelectedProvince(pidcode, type, data) {
  1186. var params = {
  1187. "method": "user.getDefaultArea",
  1188. "v": "1.0"
  1189. };
  1190. $.doSubmit("", params, function (resData) {
  1191. desheng = resData.desheng;
  1192. deshi = resData.deshi;
  1193. if (desheng && deshi) {
  1194. var param = {"pidcode": pidcode, "type": type, "method": "user.getPcclink", "v": "1.0"};
  1195. if (type == 0) { // 初始化
  1196. var v1 = {"sheng": "000000", "shi": desheng, "xian": deshi};
  1197. param = $.extend(v1, param);
  1198. } else if (type == 2) { // 获取市后处理是否本市
  1199. if ($("#sheng").val() != desheng) {
  1200. set_select_checked("fwssqy", "1");
  1201. }
  1202. } else if (type == 3) { // 获取县后处理是否本市
  1203. if ($("#shi").val() != deshi) {
  1204. set_select_checked("fwssqy", "1");
  1205. } else {
  1206. set_select_checked("fwssqy", "0");
  1207. }
  1208. } else if (type == 4) {
  1209. } else if (type == 5) {
  1210. var v2 = {"sheng": data.sheng, "shi": data.shi, "xian": data.xian};
  1211. param = $.extend(v2, param);
  1212. }
  1213. $.doSubmit("", param, function (resData) {
  1214. var shengList = resData.shengList;
  1215. var shiList = resData.shiList;
  1216. var xianList = resData.xianList;
  1217. if (type == 0) {
  1218. for (var i = 0; i < shengList.length; i++) {
  1219. $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
  1220. }
  1221. for (var i = 0; i < shiList.length; i++) {
  1222. $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
  1223. }
  1224. for (var i = 0; i < xianList.length; i++) {
  1225. $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
  1226. }
  1227. set_select_checked("sheng", desheng);
  1228. set_select_checked("shi", deshi);
  1229. } else if (type == 2) {
  1230. for (var i = 0; i < shiList.length; i++) {
  1231. $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
  1232. }
  1233. } else if (type == 3) {
  1234. for (var i = 0; i < xianList.length; i++) {
  1235. $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
  1236. }
  1237. } else if (type == 5) {
  1238. for (var i = 0; i < shengList.length; i++) {
  1239. $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
  1240. }
  1241. for (var i = 0; i < shiList.length; i++) {
  1242. $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
  1243. }
  1244. for (var i = 0; i < xianList.length; i++) {
  1245. $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
  1246. }
  1247. set_select_checked("sheng", data.sheng);
  1248. set_select_checked("shi", data.shi);
  1249. set_select_checked("xian", data.xian);
  1250. }
  1251. }, function (data) {
  1252. $.toast(data.resmsg, 2000);
  1253. });
  1254. }
  1255. }, function (data) {
  1256. $.toast(data.resmsg, 2000);
  1257. });
  1258. }
  1259. function fnYDDKSelectedProvince(pidcode, type, data) {
  1260. var params = {
  1261. "method": "user.getDefaultArea",
  1262. "v": "1.0"
  1263. };
  1264. $.doSubmit("", params, function (resData) {
  1265. desheng = resData.desheng;
  1266. deshi = resData.deshi;
  1267. if (desheng && deshi) {
  1268. var param = {"pidcode": pidcode, "type": type, "method": "user.getPcclink", "v": "1.0"};
  1269. if (type == 0) { // 初始化
  1270. var v1 = {"sheng": "000000", "shi": desheng, "xian": deshi};
  1271. param = $.extend(v1, param);
  1272. } else if (type == 2) { // 获取市后处理是否本市
  1273. if ($("#sheng").val() != desheng) {
  1274. set_select_checked("fwssqy", "1");
  1275. }
  1276. } else if (type == 3) { // 获取县后处理是否本市
  1277. if ($("#shi").val() != deshi) {
  1278. set_select_checked("fwssqy", "1");
  1279. } else {
  1280. set_select_checked("fwssqy", "0");
  1281. }
  1282. } else if (type == 4) {
  1283. } else if (type == 5) {
  1284. var v2 = {"sheng": data.dssheng, "shi": data.gsshi, "xian": data.gsxian};
  1285. param = $.extend(v2, param);
  1286. }
  1287. $.doSubmit("", param, function (resData) {
  1288. var shengList = resData.shengList;
  1289. var shiList = resData.shiList;
  1290. var xianList = resData.xianList;
  1291. if (type == 0) {
  1292. $("<option></option>").val("").text("可选").appendTo("#sheng");
  1293. $("<option></option>").val("").text("可选").appendTo("#shi");
  1294. $("<option></option>").val("").text("可选").appendTo("#xian");
  1295. for (var i = 0; i < shengList.length; i++) {
  1296. $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
  1297. }
  1298. for (var i = 0; i < shiList.length; i++) {
  1299. $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
  1300. }
  1301. for (var i = 0; i < xianList.length; i++) {
  1302. $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
  1303. }
  1304. // set_select_checked("sheng", desheng);
  1305. // set_select_checked("shi", deshi);
  1306. } else if (type == 2) {
  1307. for (var i = 0; i < shiList.length; i++) {
  1308. $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
  1309. }
  1310. } else if (type == 3) {
  1311. for (var i = 0; i < xianList.length; i++) {
  1312. $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
  1313. }
  1314. } else if (type == 5) {
  1315. for (var i = 0; i < shengList.length; i++) {
  1316. $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
  1317. }
  1318. for (var i = 0; i < shiList.length; i++) {
  1319. $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
  1320. }
  1321. for (var i = 0; i < xianList.length; i++) {
  1322. $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
  1323. }
  1324. set_select_checked("sheng", data.dssheng);
  1325. set_select_checked("shi", data.gsshi);
  1326. set_select_checked("xian", data.gsxian);
  1327. myReadonly("sheng,shi,xian,outfundname");
  1328. }
  1329. }, function (data) {
  1330. $.toast(data.resmsg, 2000);
  1331. });
  1332. }
  1333. }, function (data) {
  1334. $.toast(data.resmsg, 2000);
  1335. });
  1336. }
  1337. function set_select_checked(selectId, checkValue) {
  1338. var select = document.getElementById(selectId);
  1339. for (var i = 0; i < select.options.length; i++) {
  1340. if (select.options[i].value == checkValue) {
  1341. select.options[i].selected = true;
  1342. break;
  1343. }
  1344. }
  1345. }
  1346. function fnTqfs() {
  1347. $("#fetchhander").hide();
  1348. var tqfs = $("#tqfs").val();
  1349. if (tqfs == "02") {
  1350. $('#bkcard').attr("readonly", false);
  1351. $('#bkcardcode').attr("readonly", false);
  1352. $('#skyhmc').attr("readonly", false);
  1353. $("#bkcard").val("");
  1354. $("#bkcardcode").find("option").remove();
  1355. $("#skyhmc").val("");
  1356. $("#lhhbh").val("");
  1357. tqfs02(tqfs);
  1358. } else if (tqfs == "03") {
  1359. $("#bkcardcode").find("option").remove();
  1360. $('#bkcard').attr("readonly", true);
  1361. $('#bkcardcode').attr("readonly", true);
  1362. $('#skyhmc').attr("readonly", true);
  1363. tqfs03(tqfs);
  1364. }
  1365. }
  1366. function tqfs02(key) {
  1367. $("#bkcardcode").html('<option value="">请选择银行名称</option>');
  1368. var params = {
  1369. "method": "user.getGjBank",
  1370. "v": "1.0"
  1371. };
  1372. $.doSubmit("", params, function (data) {
  1373. var yhhblist = data.yhhblist;
  1374. for (var i = 0; i < yhhblist.length; i++) {
  1375. $("<option></option>").val(yhhblist[i].id.toString()).text(yhhblist[i].name.toString()).appendTo("#bkcardcode");
  1376. }
  1377. });
  1378. }
  1379. function tqfs03(key) {
  1380. var params = {
  1381. "method": "user.getBdinfo",
  1382. "tqfs": key,
  1383. "v": "1.0"
  1384. };
  1385. $.doSubmit("", params, function (data) {
  1386. $("#fetchhander").show();
  1387. $('#bkcard').val(data.bkcard);
  1388. $("<option></option>").val(data.bkcardcode).text(data.bkcardcodedesc).appendTo("#bkcardcode");
  1389. $('#skyhmc').val(data.skyhmc);
  1390. $('#lhhbh').val(data.lhhbh);
  1391. }, function (data) {
  1392. $.toast(data.resmsg, 2000);
  1393. $("#tqfs").val("02");
  1394. fnTqfs();
  1395. });
  1396. }
  1397. function fnInitHisSelect(data) {
  1398. if(data) {
  1399. $("#histqlist").show();
  1400. var html = "<option value=''>录入新卡</option>"
  1401. for (var i=0;i< data.length;i++) {
  1402. var yhk = data[i];
  1403. html += "<option value='" + yhk.lhhbh + "|" + yhk.yhhb + "|" + yhk.skzh + "|" + yhk.skyhmc + "'>" + yhk.skzh + "|" + yhk.skyhmc + "</option>"
  1404. }
  1405. $("#hisTqYhkList").html(html);
  1406. }else{
  1407. $("#histqlist").hide();
  1408. }
  1409. }
  1410. function fnSelectHisTqYhk() {
  1411. var hisTqYhkList = $("#hisTqYhkList").val();
  1412. if(hisTqYhkList){
  1413. myhide("bkcardcode1,bkcard_desc");
  1414. var hisTqYhk = hisTqYhkList.split('|');
  1415. $("#bkcard").val(hisTqYhk[2]);
  1416. $("#skyhmc").val(hisTqYhk[3])
  1417. $("#bkcardcode").val(hisTqYhk[1]);
  1418. $("#lhhbh").val(hisTqYhk[0]);
  1419. //tqfs02(tqfs);
  1420. $("#fetchhander").hide();
  1421. if(!$("#bkcardcode").val()){
  1422. $("#bkcardcode").focus();
  1423. return;
  1424. }
  1425. var params = {
  1426. "method": "user.checkBkcardType",
  1427. "v": "1.0",
  1428. "tqfs": $("#tqfs").val(),
  1429. "lhhbh": $("#lhhbh").val(),
  1430. "bkcardcode": $("#bkcardcode").val(),
  1431. "bkcard": $("#bkcard").val()
  1432. };
  1433. $.doSubmit("", params, function(data){
  1434. $("#fetchhander").show();
  1435. }, function (data) {
  1436. $("#bkcard").val("");
  1437. $.toast(data.resmsg, 2000);
  1438. });
  1439. }else{
  1440. $("#bkcard").val("");
  1441. $("#skyhmc").val("")
  1442. $("#bkcardcode").val("");
  1443. $("#lhhbh").val("");
  1444. myshow("bkcardcode1,bkcard_desc");
  1445. }
  1446. }
  1447. function selBank(that) {
  1448. if(!$("#bkcardcode").val()){
  1449. $("#bkcardcode").focus();
  1450. $("#fetchhander").hide();
  1451. return;
  1452. }
  1453. var params = {
  1454. "method": "user.getBankCodeByYhhb",
  1455. "v": "1.0",
  1456. "yhhb": that.value
  1457. };
  1458. $.doSubmit("", params, function (data) {
  1459. $('#skyhmc').val(data.skyhmc);
  1460. myReadonly("skyhmc");
  1461. $('#lhhbh').val(data.lhhbh);
  1462. if($("#bkcard").val()){
  1463. fnCheckBkcardType1();
  1464. }
  1465. //不清除银行卡号
  1466. //$("#bkcard").val("");
  1467. });
  1468. }
  1469. function fnCheckBkcardType1() {
  1470. $("#fetchhander").hide();
  1471. if(!$("#bkcardcode").val()){
  1472. $("#bkcardcode").focus();
  1473. return;
  1474. }
  1475. var params = {
  1476. "method": "user.checkBkcardType",
  1477. "v": "1.0",
  1478. "tqfs": $("#tqfs").val(),
  1479. "lhhbh": $("#lhhbh").val(),
  1480. "bkcardcode": $("#bkcardcode").val(),
  1481. "bkcard": $("#bkcard").val()
  1482. };
  1483. $.doSubmit("", params, function(data){
  1484. $("#fetchhander").show();
  1485. }, function (data) {
  1486. $("#bkcard").val("");
  1487. $.toast(data.resmsg, 2000);
  1488. });
  1489. }
  1490. function fnCheckBkcardType(that) {
  1491. $("#fetchhander").hide();
  1492. if(!$("#bkcardcode").val()){
  1493. $("#bkcardcode").focus();
  1494. return;
  1495. }
  1496. var params = {
  1497. "method": "user.checkBkcardType",
  1498. "v": "1.0",
  1499. "tqfs": $("#tqfs").val(),
  1500. "lhhbh": $("#lhhbh").val(),
  1501. "bkcardcode": $("#bkcardcode").val(),
  1502. "bkcard": that.value
  1503. };
  1504. $.doSubmit("", params, function(data){
  1505. $("#fetchhander").show();
  1506. }, function (data) {
  1507. $("#bkcard").val("");
  1508. $.toast(data.resmsg, 2000);
  1509. });
  1510. }
  1511. function checkSpouseInfo() {
  1512. $("#btnValid").hide();
  1513. myReadonly("gfhth,bdcqzh");
  1514. $("#bdcqzh").attr("disabled",true);
  1515. var hyzk = $("#hyzk").val();
  1516. var poxm = $("#spousename").val();
  1517. var pozjlx = $("#spousezjlx").val();
  1518. var pozjhm = $("#spousezjhm").val();
  1519. var bustype = $.val("bustype");
  1520. var buscode = $.val("buscode");
  1521. var tqyy = $.val("tqyy");
  1522. var tqlx = $("#tqlx").val();
  1523. var params = {
  1524. "method": "user.checkSpouseInfo",
  1525. "v": "1.0",
  1526. "hyzk": hyzk,
  1527. "poxm": poxm,
  1528. "pozjlx": pozjlx,
  1529. "pozjhm": pozjhm,
  1530. "bustype": bustype,
  1531. "buscode": buscode,
  1532. "tqyy": tqyy,
  1533. "tqlx": tqlx
  1534. };
  1535. if(tqyy == "07"){
  1536. var ownerList = packageGlr();
  1537. var sctq = $("#sctq").val();
  1538. var v1;
  1539. if(sctq == "0"){
  1540. v1 = {"ownerList": ownerList,"sctq": sctq};
  1541. params = $.extend(v1,params);
  1542. }else if(sctq == "1"){
  1543. v1 = {"sctq": sctq};
  1544. params = $.extend(v1,params);
  1545. }
  1546. }
  1547. if (hyzk == "10" || hyzk == "40") {
  1548. //未婚和离婚不判断配偶信息
  1549. } else {
  1550. if(!hyzk){
  1551. $("#hyzk").focus();
  1552. return;
  1553. }
  1554. if(!poxm){
  1555. $("#spousename").focus();
  1556. return;
  1557. }
  1558. if(!pozjlx){
  1559. $("#spousezjlx").focus();
  1560. return;
  1561. }
  1562. if(!pozjhm){
  1563. $("#spousezjhm").focus();
  1564. return;
  1565. }
  1566. }
  1567. $.doSubmit("", params, function (data) {
  1568. if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
  1569. removeReadonly("gfhth,bdcqzh");
  1570. $("#bdcqzh").removeAttr("disabled");
  1571. }
  1572. if (tqyy == "01") {
  1573. if(data.flag == "1"){
  1574. $("#checkSpouse").val("1");
  1575. }
  1576. // initPage2();
  1577. }else{
  1578. $("#btnValid").show();
  1579. }
  1580. myReadonly("hyzk,spousename,spousezjlx,spousezjhm");
  1581. //已婚婚姻协查成功会马上协查配偶,不用重新调一次接口
  1582. /*var whjxbl = data.whjxbl;
  1583. if (whjxbl && whjxbl == "1") {
  1584. var param = {
  1585. "method": "user.checkSpouseHouseInfo",
  1586. "v": "1.0",
  1587. "hyzk": hyzk,
  1588. "poxm": poxm,
  1589. "pozjlx": pozjlx,
  1590. "pozjhm": pozjhm,
  1591. "bustype": bustype,
  1592. "buscode": buscode,
  1593. "tqyy": tqyy,
  1594. "tqlx": tqlx
  1595. };
  1596. $.doSubmit("", param, function (data) {
  1597. }, function (data) {
  1598. $("#hyzk").removeAttr("disabled");
  1599. $("#hyzk").removeAttr("readOnly");
  1600. $("#spousename").removeAttr("disabled");
  1601. $("#spousename").removeAttr("readOnly");
  1602. $("#spousezjhm").removeAttr("disabled");
  1603. $("#spousezjhm").removeAttr("readOnly");
  1604. var resmsg;
  1605. if (isJSON(data.resmsg)) {
  1606. resmsg = $.parseJSON(data.resmsg).msg;
  1607. } else {
  1608. resmsg = data.resmsg;
  1609. }
  1610. $("#hyzk").val("");
  1611. $("#spousename").val("");
  1612. $("#spousezjhm").val("");
  1613. $.dialog({title: "", content: resmsg, mode: 1}, function (index) {
  1614. });
  1615. });
  1616. }*/
  1617. /*if (hyzk == "10" || hyzk == "40") {//选择未婚和离婚接口调用完再显示后续页面
  1618. getHyzkInfo(hyzk);
  1619. }*/
  1620. if (tqyy == "01") {
  1621. if (hyzk == "40") {
  1622. $("#lhsj").val(data.lhsj);
  1623. $("#lhqd").val("民政");
  1624. myReadonly("lhsj");
  1625. }
  1626. }
  1627. if (tqyy == "07") {
  1628. var sctq = $("#sctq").val();
  1629. if(sctq == "1"){
  1630. $("#baje").val(data.rentMaxMoney);
  1631. $("#bcktqed").val(data.rentMaxMoney);
  1632. }
  1633. $("#isAddPo").val(data.isAddPo);
  1634. $("#hzzxzfytje").val(data.hzzxzfytje);
  1635. addZfGlr();
  1636. }
  1637. if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
  1638. if($("#gfhth").val() || $("#bdcqzh").val()){
  1639. checkFetchHouseInfo();
  1640. }
  1641. }
  1642. }, function (data) {
  1643. if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
  1644. myReadonly("gfhth,bdcqzh");
  1645. $("#bdcqzh").attr("disabled",true);
  1646. }
  1647. if (tqyy == "01") {
  1648. $("#spousezjhm").val("");
  1649. if (hyzk != "20") {
  1650. $("#hyzk").val("");
  1651. }
  1652. }
  1653. var resmsg;
  1654. if (isJSON(data.resmsg)) {
  1655. resmsg = $.parseJSON(data.resmsg).msg;
  1656. } else {
  1657. resmsg = data.resmsg;
  1658. }
  1659. $.dialog({title: "", content: resmsg, mode: 1}, function (index) {
  1660. });
  1661. });
  1662. }
  1663. function isJSON(str) {
  1664. if (typeof str == 'string') {
  1665. try {
  1666. var obj = JSON.parse(str);
  1667. if (typeof obj == 'object' && obj) {
  1668. return true;
  1669. } else {
  1670. return false;
  1671. }
  1672. } catch (e) {
  1673. console.log('error:' + str + '!!!' + e);
  1674. return false;
  1675. }
  1676. }
  1677. }
  1678. function jump() {
  1679. $.closeCurrWin();
  1680. }
  1681. //设置显示输入框
  1682. function myshow(ids) {
  1683. var all = ids.split(",");
  1684. for (var i = 0; i < all.length; i++) {
  1685. $("#" + all[i]).show();
  1686. }
  1687. }
  1688. //设置隐藏输入框
  1689. function myhide(ids) {
  1690. var all = ids.split(",");
  1691. for (var i = 0; i < all.length; i++) {
  1692. $("#" + all[i]).hide();
  1693. }
  1694. }
  1695. //设置必填
  1696. function myaddValid(ids) {
  1697. var all = ids.split(",");
  1698. for (var i = 0; i < all.length; i++) {
  1699. var item = $("#" + all[i]);
  1700. $("#" + all[i]).attr("valid", "r");
  1701. }
  1702. }
  1703. //移除必填
  1704. function removeValid(ids) {
  1705. var all = ids.split(",");
  1706. for (var i = 0; i < all.length; i++) {
  1707. var item = $("#" + all[i]);
  1708. $("#" + all[i]).attr("valid", "");
  1709. }
  1710. }
  1711. //设置只读
  1712. function myReadonly(ids) {
  1713. var all = ids.split(",");
  1714. for (var i = 0; i < all.length; i++) {
  1715. var item = $("#" + all[i]);
  1716. if (item.is('select')) {
  1717. $("#" + all[i]).attr("readOnly", true);
  1718. $("#" + all[i]).attr("disabled", true);
  1719. } else {
  1720. $("#" + all[i]).attr("readOnly", true);
  1721. }
  1722. }
  1723. }
  1724. //取消只读
  1725. function removeReadonly(ids) {
  1726. var all = ids.split(",");
  1727. for (var i = 0; i < all.length; i++) {
  1728. var item = $("#" + all[i]);
  1729. if (item.is('select')) {
  1730. $("#" + all[i]).attr("disabled", false);
  1731. $("#" + all[i]).attr("readOnly", false);
  1732. } else {
  1733. $("#" + all[i]).attr("readOnly", false);
  1734. }
  1735. }
  1736. }
  1737. /**
  1738. ** 减法函数,用来得到精确的减法结果
  1739. ** 说明:javascript的减法结果会有误差,在两个浮点数相减的时候会比较明显。这个函数返回较为精确的减法结果。
  1740. ** 调用:accSub(arg1,arg2)
  1741. ** 返回值:arg1加上arg2的精确结果
  1742. **/
  1743. function accSub(arg1, arg2) {
  1744. var r1, r2, m, n;
  1745. try {
  1746. r1 = arg1.toString().split(".")[1].length;
  1747. } catch (e) {
  1748. r1 = 0;
  1749. }
  1750. try {
  1751. r2 = arg2.toString().split(".")[1].length;
  1752. } catch (e) {
  1753. r2 = 0;
  1754. }
  1755. m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
  1756. n = (r1 >= r2) ? r1 : r2;
  1757. return ((arg1 * m - arg2 * m) / m).toFixed(n);
  1758. }
  1759. function initPage2() {
  1760. var tqlx = $("#tqlx").val();
  1761. var hyzk = $("#hyzk").val();
  1762. var tqrglgx = $("#tqrglgx").val();
  1763. if (tqlx && hyzk && tqrglgx) {
  1764. if (hyzk == "20") {
  1765. var spousename = $("#spousename").val();
  1766. var spousezjhm = $("#spousezjhm").val();
  1767. if (spousename && spousezjhm) {
  1768. myshow("xian1,fkfs1,htqdrq2,fwzlFormater2,fwzj2,btnLast,btnValid,btnBox2");
  1769. myhide("tqlx2,hyzk2,zgspousename,zgspousezjhm,tqrglgx1,btnClose,btnNext,btnBox1");
  1770. }
  1771. }else{
  1772. myshow("xian1,fkfs1,htqdrq2,fwzlFormater2,fwzj2,btnLast,btnValid,btnBox2");
  1773. myhide("tqlx2,hyzk2,zgspousename,zgspousezjhm,tqrglgx1,btnClose,btnNext,btnBox1");
  1774. }
  1775. if (tqlx == "55") {
  1776. myshow("gfhth2,zxzje2");
  1777. myhide("bdcqzh2,sfdy1");
  1778. }else{
  1779. myshow("bdcqzh2,sfdy1");
  1780. myhide("gfhth2,zxzje2");
  1781. }
  1782. }
  1783. }
  1784. function fnTqrglgx(){
  1785. var tqrglgx = $("#tqrglgx").val();
  1786. var validflag = $("#validflag").val();
  1787. var tqyy = $.val("tqyy");
  1788. var tqlx = $("#tqlx").val();
  1789. var hyzk = $("#hyzk").val();
  1790. var poxm = $("#spousename").val();
  1791. var pozjlx = $("#spousezjlx").val();
  1792. var pozjhm = $("#spousezjhm").val();
  1793. if(!tqrglgx){
  1794. $.dialog({title: "", content: "请选择您与产权人的关系", mode: 1}, function (index) {
  1795. });
  1796. return;
  1797. }
  1798. if(tqrglgx == "04"){
  1799. $.dialog({title: "", content: "您与产权人的关系为其他,不允许办理", mode: 1}, function (index) {
  1800. });
  1801. $("#tqrglgx").val("");
  1802. $("#zjkrxm").val("");
  1803. $("#zjkrzjhm").val("");
  1804. return;
  1805. }
  1806. if(tqrglgx == "02"){
  1807. $.dialog({title: "", content: "您与产权人的关系为直系亲属,请前往柜台办理", mode: 1}, function (index) {
  1808. });
  1809. $("#tqrglgx").val("");
  1810. $("#zjkrxm").val("");
  1811. $("#zjkrzjhm").val("");
  1812. return;
  1813. }
  1814. if(tqrglgx == "01"){
  1815. if(hyzk != "20"){
  1816. $.dialog({title: "", content: "您的婚姻状况不是已婚,您与产权人的关系不能为夫妻", mode: 1}, function (index) {
  1817. });
  1818. $("#tqrglgx").val("");
  1819. $("#zjkrxm").val("");
  1820. $("#zjkrzjhm").val("");
  1821. return;
  1822. }
  1823. if(hyzk == "20"){
  1824. if(!poxm || !pozjlx || !pozjhm){
  1825. $.dialog({title: "", content: "配偶信息不能为空", mode: 1}, function (index) {
  1826. });
  1827. $("#tqrglgx").val("");
  1828. return;
  1829. }
  1830. }
  1831. }
  1832. if (tqyy == "01") {
  1833. if($("#checkSpouse").val() == "0"){//防止正在请求协查时 选择产权人关系,导致跳过协查结果
  1834. $("#tqrglgx").val("");
  1835. return;
  1836. }
  1837. // initPage2();
  1838. fetchNext();
  1839. }
  1840. if(tqyy == "01" && tqlx == "55"){
  1841. if(tqrglgx == "05" && validflag == "0"){
  1842. $("#zjkrxm").val($.val("zjkrxm"));
  1843. $("#zjkrzjlx").val("01");
  1844. $("#zjkrzjhm").val($.val("codeno"));
  1845. }
  1846. if(tqrglgx == "01" && validflag == "0"){
  1847. $("#zjkrxm").val(poxm);
  1848. $("#zjkrzjlx").val(pozjlx);
  1849. $("#zjkrzjhm").val(pozjhm);
  1850. }
  1851. }else if(tqyy == "01" && tqlx == "61"){
  1852. if(tqrglgx == "05" && validflag == "0"){
  1853. $("#zjkrxm").val($.val("zjkrxm"));
  1854. $("#zjkrzjlx").val("01");
  1855. $("#zjkrzjhm").val($.val("codeno"));
  1856. }
  1857. if(tqrglgx == "01" && validflag == "0"){
  1858. $("#zjkrxm").val(poxm);
  1859. $("#zjkrzjlx").val(pozjlx);
  1860. $("#zjkrzjhm").val(pozjhm);
  1861. }
  1862. }else if(tqyy == "02" || tqyy == "82"){
  1863. if(tqrglgx == "05" && validflag == "0"){
  1864. $("#zjkrxm").val($.val("zjkrxm"));
  1865. $("#zjkrzjlx").val("01");
  1866. $("#zjkrzjhm").val($.val("codeno"));
  1867. }
  1868. if(tqrglgx == "01" && validflag == "0"){
  1869. $("#zjkrxm").val(poxm);
  1870. $("#zjkrzjlx").val(pozjlx);
  1871. $("#zjkrzjhm").val(pozjhm);
  1872. }
  1873. }
  1874. }
  1875. function fnChgFwyt() {
  1876. var fwyt = $("#fwyt").val();
  1877. if(fwyt != "01"){
  1878. $.dialog({title: "", content: "非住宅不允许提取", mode: 1}, function (index) {
  1879. $.closeCurrWin();
  1880. });
  1881. $("#fwyt").val("");
  1882. }
  1883. return;
  1884. }
  1885. function fnhyzk(that){
  1886. if ($.val("tqyy") == "01" && !$("#tqlx").val()) {
  1887. $.dialog({title: "", content: "请先选择提取类型后,在选择婚姻状况!", mode: 1}, function (index) {
  1888. });
  1889. $("#hyzk").val("")
  1890. $("#spousename").val("");
  1891. $("#spousezjhm").val("");
  1892. return
  1893. }
  1894. if(that.value == "10" || that.value == "40"){
  1895. removeValid("spousename,spousezjhm");
  1896. $("#zgspousename").hide();
  1897. $("#zgspousezjhm").hide();
  1898. $("#zgspousezjlx").hide();
  1899. $("#spousename").val("");
  1900. $("#spousezjhm").val("");
  1901. checkSpouseInfo();
  1902. }else if(that.value == "20"){
  1903. myaddValid("spousename,spousezjhm");
  1904. $("#zgspousename").show();
  1905. $("#zgspousezjhm").show();
  1906. $("#spousename").val("");
  1907. $("#spousezjhm").val("");
  1908. }
  1909. }
  1910. //提交页面返回上一页面反显之前录入的配偶信息
  1911. function fnhyzk1(){
  1912. var hyzk = $("#hyzk").val();
  1913. var tqyy = $.val("tqyy");
  1914. if(hyzk == "10" || hyzk == "40"){
  1915. removeValid("spousename,spousezjhm");
  1916. $("#zgspousename").hide();
  1917. $("#zgspousezjhm").hide();
  1918. $("#zgspousezjlx").hide();
  1919. $("#spousename").val("");
  1920. $("#spousezjhm").val("");
  1921. }else if(hyzk == "20"){
  1922. myaddValid("spousename,spousezjhm");
  1923. $("#zgspousename").show();
  1924. $("#zgspousezjhm").show();
  1925. }
  1926. if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
  1927. //初始化页面时会重置产权人关系和区县下拉选,不能去校验配偶,会报错
  1928. }else{
  1929. checkSpouseInfo();
  1930. }
  1931. }
  1932. var mzsm = "";
  1933. mzsm+= "尊敬的用户:</br>";
  1934. mzsm+= "&emsp;&emsp;为维护您的权益,请在签署本条款前,仔细阅读各条款内容。您通过南昌住房公积金互联网渠道办理业务即表示您已阅读并同意本声明条款,如您不接受本声明条款,请勿使用南昌住房公积金互联网渠道服务。</br>";
  1935. mzsm+= "一、用户在使用南昌住房公积金互联网渠道服务时,应按照南昌住房公积金互联网渠道的规定正确操作。因操作不当而造成的损失,南昌住房公积金管理中心不承担任何责任。</br>";
  1936. mzsm+= "二、用户必须妥善保管本人账号和密码,因网站执行指令均是通过计算机程序自动完成,无法核实账户操作者是否是用户本人,因此所有使用密码进行的操作均视为用户本人所为,对用户本人具有法律效力。依据密码办理的各类公积金业务所发生的电子信息记录均为办理该项业务的有效凭证。</br>";
  1937. mzsm+= "三、因黑客行为或用户的保管疏忽导致账号、密码遭他人非法使用,而造成用户损失,南昌住房公积金管理中心不承担任何责任。用户应当为自身注册账户下的一切行为负责,因用户行为而导致的用户自身或其他第三方的任何损失,南昌住房公积金管理中心不承担责任。</br>";
  1938. mzsm+= " 四、南昌住房公积金互联网渠道因以下情况没有执行用户指令的,南昌住房公积金管理中心不承担责任:</br>";
  1939. mzsm+= "(一)南昌住房公积金互联网渠道网络系统出现故障;</br>";
  1940. mzsm+= "(二)南昌住房公积金互联网渠道接收到的用户指令信息不明、存在乱码、不完整等;</br>";
  1941. mzsm+= "(三)用户自有资金账户或公积金账户余额不足;</br>";
  1942. mzsm+= "(四)用户自有资金账户或公积金账户内资金被司法冻结或划扣;</br>";
  1943. mzsm+= "(五)不可抗力或其他不可归因于公积金中心的情况。</br>";