1001410056_edit.jsp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <html>
  2. <head>
  3. <style>
  4. #qrcode {
  5. width: 200px;
  6. height: 200px;
  7. margin: 80px auto 30px;
  8. display: none;
  9. }
  10. #icon {
  11. font-size: 120px;
  12. width: 120px;
  13. height: 120px;
  14. margin: 80px auto 30px;
  15. text-align: center;
  16. color: #409EFF;
  17. display: none;
  18. }
  19. .desc {
  20. text-align: center;
  21. font-size: 16px;
  22. color: #999;
  23. }
  24. .btns {
  25. margin: 30px auto 0px auto;
  26. text-align: center;
  27. display: none;
  28. }
  29. #headimgurl {
  30. text-align: center;
  31. display: none;
  32. }
  33. #headimgurl img {
  34. width: 160px;
  35. height: 160px;
  36. border-radius: 3px;
  37. margin-top: 30px;
  38. border: 1px solid #efefef;
  39. }
  40. #headimgurl p {
  41. margin: 25px 0 66px 0px;
  42. color: #333;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div id="space-content">
  48. <el-form action='@service{name:`wechat_binding_cancel`, page:`toTips` }@' method="post" :model="obj"
  49. label-width="100px"></el-form>
  50. <div id="icon">
  51. <i id="i" class="el-icon-success"></i>
  52. </div>
  53. <div id="headimgurl">
  54. <img :src="headimgurlMax">
  55. <p>
  56. ${userInfo.nickname}
  57. </p>
  58. </div>
  59. <div id="qrcode"></div>
  60. <div class="desc">
  61. </div>
  62. <div id="btns" class="btns">
  63. <el-button type="danger" plain @click="confirm()">解除绑定</el-button>
  64. </div>
  65. </el-form>
  66. </div>
  67. </body>
  68. <script src="/apps/space/plug-in/jquery-qrcode/jquery.qrcode.min.js"></script>
  69. <script type="text/javascript">
  70. space.vue = new Vue({
  71. el: space.appContent,
  72. data() {
  73. return {
  74. obj: {},
  75. result: space.utils.parseBoolean('${res}'),
  76. headimgurl: '${userInfo.headimgurl}'
  77. };
  78. },
  79. computed: {
  80. headimgurlMax: function () {
  81. var indexNum = this.headimgurl.lastIndexOf('/');
  82. return this.headimgurl.slice(0, indexNum + 1) + "0";
  83. }
  84. },
  85. mounted: function () {
  86. if (!this.result) {
  87. var URL = "${url}";
  88. $('#qrcode').qrcode({ text: URL, width: 200, height: 200 });
  89. $("#qrcode").show();
  90. $("div.desc").html("请打开微信扫一扫");
  91. var _this = this;
  92. var statusInterval = setInterval(function () {
  93. space.utils.ajax({
  94. url: "@service{ name:`wechat_binding_status` }@",
  95. dataType: 'json',
  96. loadLayer: false,
  97. callback: function (data) {
  98. if (data.code == "success" && data.msg == "ok") {
  99. $("#qrcode").hide();
  100. $("#icon").show();
  101. $("#i").addClass("el-icon-success");
  102. $(".desc").html("绑定成功");
  103. window.clearInterval(statusInterval);
  104. }
  105. }
  106. });
  107. }, 2000);
  108. }
  109. else {
  110. $("#headimgurl").show();
  111. $("#btns").show();
  112. $(".desc").html("你已经绑定了微信");
  113. }
  114. },
  115. methods: {
  116. confirm() {
  117. if (this.result) {
  118. this.$confirm('此操作将解除和微信账号的绑定, 是否继续?', '提示', {
  119. confirmButtonText: '确定',
  120. cancelButtonText: '取消',
  121. type: 'warning'
  122. }).then(() => {
  123. space.forms.submit();
  124. }).catch(() => {
  125. });
  126. }
  127. }
  128. }
  129. })
  130. </script>
  131. </html>