real-name-authentication.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. function queryInit() {
  2. // 验证居民信息是否完善
  3. checkBaseInfo()
  4. }
  5. ;(function() {
  6. checkUserAgent()
  7. var dd = dialog({
  8. contentType: 'load',
  9. skin: 'bk-popup',
  10. content: '保存中...'
  11. });
  12. var d = dialog({
  13. contentType: 'load',
  14. skin: 'bk-popup'
  15. });
  16. new Vue({
  17. el: "#app",
  18. data: {
  19. baseInfo:{}
  20. },
  21. mounted:function(){
  22. this.initData();
  23. },
  24. methods: {
  25. initData:function(){
  26. var vm = this;
  27. d.show();
  28. sendPost("/patient/baseinfo", {}, 'JSON', 'post', this.queryFailed, function(res) {
  29. vm.baseInfo = res.data;
  30. if(vm.baseInfo.idcard && vm.baseInfo.idcard.indexOf("WLYY")>-1) {
  31. vm.baseInfo.idcard = ""
  32. }
  33. d.close();
  34. })
  35. },
  36. queryFailed:function(res){
  37. d.close();
  38. if(res && res.msg) {
  39. dialog({
  40. contentType: 'tipsbox',
  41. bottom: true,
  42. skin: 'bk-popup',
  43. content: res.msg
  44. }).show();
  45. } else {
  46. dialog({
  47. contentType: 'tipsbox',
  48. bottom: true,
  49. skin: 'bk-popup',
  50. content: '加载失败'
  51. }).show();
  52. }
  53. },
  54. updateSsc:function(){
  55. var ssc = this.baseInfo.ssc || "";
  56. var userAgent = window.localStorage.getItem(agentName);
  57. var jsonstr = $.parseJSON(userAgent);
  58. var openid = jsonstr.openid;
  59. window.location.href = "update-ssc.html?openid=" + openid + "&ssc="+ ssc + "&1=1";
  60. },
  61. updateIdcard:function() {
  62. var vm = this;
  63. window.location.href = "update-idcard.html?idcard="+(vm.baseInfo.idcard || "");
  64. }
  65. },
  66. })
  67. })()