real-name-authentication.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. (function() {
  2. var dd = dialog({
  3. contentType: 'load',
  4. skin: 'bk-popup',
  5. content: '保存中...'
  6. });
  7. var d = dialog({
  8. contentType: 'load',
  9. skin: 'bk-popup'
  10. });
  11. new Vue({
  12. el: "#app",
  13. data: {
  14. baseInfo:{}
  15. },
  16. mounted:function(){
  17. this.initData();
  18. },
  19. methods: {
  20. initData:function(){
  21. var vm = this;
  22. d.show();
  23. sendPost("/patient/baseinfo", {}, 'JSON', 'post', this.queryFailed, function(res) {
  24. vm.baseInfo = res.data;
  25. d.close();
  26. })
  27. },
  28. queryFailed:function(res){
  29. d.close();
  30. if(res && res.msg) {
  31. dialog({
  32. contentType: 'tipsbox',
  33. bottom: true,
  34. skin: 'bk-popup',
  35. content: res.msg
  36. }).show();
  37. } else {
  38. dialog({
  39. contentType: 'tipsbox',
  40. bottom: true,
  41. skin: 'bk-popup',
  42. content: '加载失败'
  43. }).show();
  44. }
  45. },
  46. updateSsc:function(){
  47. var ssc = this.baseInfo.ssc;
  48. var userAgent = window.localStorage.getItem(agentName);
  49. var jsonstr = $.parseJSON(userAgent);
  50. var openid = jsonstr.openid;
  51. window.location.href = "update-ssc.html?openid=" + openid + "&ssc="+ ssc + "&1=1";
  52. }
  53. },
  54. })
  55. })()