wallet-bind-wechat.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="Cache-Control" content="no-cache,no-store,must-revalidate">
  6. <meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="expires" content="0">
  8. <meta name="author" content="">
  9. <meta name="description" content="">
  10. <meta name="keywords" content="扫码支付,线上投币,运营数据,物联网"/>
  11. <meta name="format-detection" content="telephone=no,email=no">
  12. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
  13. <title>绑定提现微信</title>
  14. <link rel="stylesheet" href="https://cdn.washpayer.com/components/lib/mui.min.css">
  15. <link rel="stylesheet" href="/components/custom/css/common.css">
  16. <link rel="stylesheet" href="/app/css/xyf.common.min.css">
  17. <style>
  18. .attention{
  19. overflow: hidden;
  20. border-radius: 50%;
  21. }
  22. .attention img{
  23. display: none;
  24. }
  25. .bind-panel, #submitBtn {
  26. display: block;
  27. }
  28. .bound .bind-panel, .bound #submitBtn {
  29. display: none;
  30. }
  31. .info-panel, .changeWechatBtn {
  32. display: none !important;
  33. }
  34. .bound .info-panel, .bound .changeWechatBtn {
  35. display: block !important;;
  36. }
  37. </style>
  38. </head>
  39. <body class="bound">
  40. <h5 class=" padding-10 " style="line-height: 1.4;font-size: 14px;">绑定提现微信之后,<span class="c-red">请勿在其它微信号上进行手动提现</span>,如在临时在其它微信号进行了手动提现,请回到此界面重新绑定您的提现微信号!
  41. </h5>
  42. <div class="info-panel">
  43. <div class="attention"><img src="#" /></div>
  44. <h5 class="mui-text-center mui-content-padded font-b-16 "><span class="nickname"></span> <i
  45. class="sex iconfont"></i>
  46. </h5>
  47. </div>
  48. <div class="bind-panel">
  49. <p class="mui-content-padded">请绑定您的微信账号用以提现</p>
  50. <div class="mui-input-group custom-top">
  51. <div class="input-row code input-clear">
  52. <input id="code" type="tel" maxlength="4" placeholder="验证码">
  53. <button id="sendBtn" type="button" onclick="sendCode()">获取验证码</button>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="custom-subt">
  58. <input type="button" class="mui-btn-block btn-red changeWechatBtn" value="更换绑定" onclick="changeWechat()">
  59. <input type="button" class="mui-btn-block " id="submitBtn" value="绑定当前登录的微信" onclick="bindWechat()">
  60. <input type="button" class="mui-btn-block custom-top btn-gray" value="返回" onclick="history.back()">
  61. </div>
  62. <script src="https://cdn.washpayer.com/components/lib/jquery.min.js"></script>
  63. <script src="https://cdn.washpayer.com/components/lib/mui.min.js"></script>
  64. <script src="/components/custom/js/common.js"></script>
  65. <script src="/app/js/xyf.common.js"></script>
  66. <script>
  67. //检测是否绑定
  68. sendRequest("/dealer/getBoundWalletWeiXinId", "GET", {}, function (res) {
  69. if (res.result == 1) {
  70. var obj = res.para;
  71. if (obj.bound) {
  72. if (obj.avatar) {
  73. $(".attention img").attr("src", obj.avatar).show();
  74. }
  75. if (obj.nickname) {
  76. $(".nickname").text(obj.nickname)
  77. }
  78. var genderDom = $(".sex");
  79. if (obj.sex == 1) {
  80. genderDom.addClass("c-primary icon-male");
  81. } else if (obj.sex == 2) {
  82. genderDom.addClass("c-red icon-female");
  83. }
  84. $("body").addClass("bound");
  85. } else {
  86. $("body").removeClass("bound");
  87. }
  88. }
  89. }
  90. );
  91. var sendBtn = document.getElementById('sendBtn');
  92. function sendCode() {
  93. var url = "/dealer/getBindWalletWechatSMSCode";
  94. var t = 60;
  95. sendBtn.innerHTML = t + " s";
  96. sendBtn.disabled = true;
  97. sendRequest(url, "GET", {}, function (res) {
  98. if (res.result == 1) {
  99. mui.toast("发送成功");
  100. var interval = setInterval(function () {
  101. if (t == 0) {
  102. sendBtn.innerHTML = "重新获取";
  103. sendBtn.disabled = false;
  104. clearInterval(interval);
  105. } else {
  106. t -= 1;
  107. sendBtn.innerHTML = t + " s";
  108. sendBtn.disabled = true;
  109. }
  110. }, 1000);
  111. } else {
  112. mui.toast(res.description);
  113. }
  114. });
  115. }
  116. function changeWechat() {
  117. $("body").removeClass("bound");
  118. }
  119. function bindWechat() {
  120. var code = $("#code").val();
  121. //检查验证码
  122. var codeReg = /^\d{4}$/;
  123. if (!codeReg.test(code)) {
  124. mui.toast("请输入正确的验证码");
  125. return;
  126. }
  127. var url = "/dealer/verifyNewWalletWechatBinding";
  128. myAjax({
  129. type: "POST",
  130. url: url,
  131. mask: "请稍候...",
  132. data: { "code": code },
  133. dataType: "json",
  134. success: function(response) {
  135. if (response.result == 1) {
  136. window.location.replace(response.data.redirect_uri)
  137. } else {
  138. mui.alert(response.description, '温馨提示', '我知道了');
  139. }
  140. }
  141. });
  142. }
  143. function goWallet() {
  144. var url = 'wallet-withdraw.html';
  145. goPage(url);
  146. }
  147. var callbackResult = getQueryString('result');
  148. if (callbackResult === 'ok'){
  149. mui.alert('绑定成功', '温馨提示', '我知道了')
  150. } else if(callbackResult === 'error'){
  151. mui.alert('绑定失败,请重新操作','温馨提示', '我知道了')
  152. }
  153. </script>
  154. </body>
  155. </html>