activate_agent_id.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>激活代理商身份</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/mui.min.css?v=2017101701" />
  10. <link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/iconfont.css?v=2017101701" />
  11. <link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/style.css?v=2017101701" />
  12. <style>
  13. .vip-tt {position: relative;width:100%;height:120px;background:#36a4c6;text-align: center;}
  14. .vip-tt>img {width: 100%;}
  15. .tx {position: absolute;left:50%;top:10%;width: 4.5em;height: 4.5em;display: inline-block;-webkit-transform: translateX(-50%);transform: translateX(-50%);border-radius: 50%;background-color: #73b7d8;}
  16. .tx>img {width: 100%;border-radius: 50%;}
  17. .nikname {position: absolute;left:0;width:100%;top: 80%;color: #fff;line-height: 1.5;text-align: center;}
  18. .nikname>div{padding:3px 0;}
  19. .nikname>div:first-child{position: relative;width: 100%;overflow: hidden;text-overflow: ellipsis;}
  20. .mui-table-view-chevron .mui-badge{display:none;}
  21. .btn_share{background: #fff;border-radius:6px;padding:3px 10px;float: right;margin-right: 10px;color: #e9004c;font-size: 13px;}
  22. .head {height: 60px;}
  23. #head {line-height: 60px;}
  24. h3{margin-top:5px;margin-bottom: 0;}
  25. .btn-pull-code{position: absolute;right: 10px;top:7px;height:34px;padding:0 6px;border-radius: 5px; line-height: 34px;font-size: 12px; color: #fff; background: #24cae9;}
  26. .btn-pull-code .active{background: #c8c8c8;}
  27. .icon-fuxuankuang a{color: #24cae9;}
  28. .icon-yanse,.icon-youhui,.icon-fuxuankuang,.icon-jiage,.icon-songhuo{font-size: 15px;padding-left: 22px;}
  29. .icon-yanse:before,.icon-fuxuankuang:before,.icon-youhui:before,.icon-jiage:before,.icon-songhuo:before{font-size: 18px;color: #24cae9;position: absolute;left: 0;width: 20px;height: 18px;}
  30. .try_price{color: #f1436c;}
  31. .head-img {position: absolute;bottom: 15px;right: 13px;width: 60px;height: 60px;border-radius: 30px;border: 3px solid #E5E5E5;}
  32. .mui-table-view .mui-media .mui-media-body{height: 41px;line-height: 41px;color: #333;}
  33. .mui-table-view .mui-media .mui-media-body>span{color: #f1436c;}
  34. .my-table-view-try{border-top: .6em solid #f0f0f0;border-bottom: .6em solid #f0f0f0;padding-bottom: 10px;}
  35. .my-table-view-try .mui-table-view-cell{padding:10px 13px 10px 30px !important;font-size: 12px;}
  36. .mui-table-view-cell:after,.mui-table-view:before,.mui-table-view:after,.mui-input-group .mui-input-row:after,.mui-input-group:before,.mui-input-group:after{display: none;}
  37. .mui-table-view-cell>a:not(.mui-btn){color: #666;margin: -15px -15px;}
  38. .mui-table-view-cell>a .mui-pull-right{color: #999;font-size: 14px;}
  39. #btn_submit { color: #fff; padding: 10px 20px; font-size: 18px; background: #24cae9; width: 60%; margin: 0 auto; display: block;border:0; }
  40. .mui-btn-block.mui-active,.btn-pull-code.mui-active{background-color: #c8c8c8 !important;}
  41. .icon-fuxuankuang.mui-active:before{color: #c8c8c8;}
  42. .mui-content-padded{margin: 10px 13px;}
  43. .tips{padding: 20px 10px;background: #24cae9;text-align: center;color: #fff;}
  44. .mui-input-group .mui-input-row {height: 50px;padding: 5px 0;border: 1px solid rgba(0,0,0,.1); margin:10px 0;}
  45. .mui-input-row label{color: #666;width:27%;font-size: 15px;}
  46. .mui-input-row label~input{width:73%;}
  47. .mui-input-row label~input::-webkit-input-placeholder{font-size: 15px;}
  48. .triangle-down {width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;}
  49. .my-arrowright{position: absolute;right: 18px;top: 28px;color: #666;pointer-events:none;}
  50. .mui-btn-red{background-color: #e9004c;}
  51. .mui-input-group{padding:0 10px;}
  52. </style>
  53. <script type="text/javascript">
  54. // 屏蔽分享
  55. window.hiddenAllWechatMenu = true;
  56. </script>
  57. </head>
  58. <body style="background: #fff;">
  59. <div class="loading-bg">
  60. <div class="mui-loading">
  61. <div class="mui-spinner">
  62. </div>
  63. &nbsp;&nbsp;加载中...
  64. </div>
  65. </div>
  66. <div class="mui-content" style="background: #fff;">
  67. <div class="vip-tt">
  68. <div class="tx bg-orange" id="headDiv">
  69. <!--<img src="images/image-12.jpg" id="userHead">-->
  70. </div>
  71. <div class="nikname">
  72. <span id="userNickname">微信昵称</span>
  73. </div>
  74. </div>
  75. <form class="mui-input-group">
  76. <div class="mui-input-row">
  77. <label>手机号码</label>
  78. <input type="tel" maxlength="11" class="mui-input-clear" placeholder="请填写您提交给上朵商务的号码" id="ipt-phone">
  79. </div>
  80. <div class="mui-input-row">
  81. <label>验&nbsp;证&nbsp;码</label>
  82. <input type="text" maxlength="4" placeholder="请填写收到的验证码" id="ipt-code">
  83. <span class="btn-pull-code" id="pull-code">获取验证码</span>
  84. </div>
  85. </form>
  86. <div style="color: #f00;font-size: 12px;padding: 0 10px;">提示:如有疑问请联系微信客服或拨打电话400-8006692</div>
  87. <div class="mui-content-padded">
  88. <button type="button" data-loading-icon="mui-spinner mui-spinner-custom" data-loading-text="提交中" class="mui-btn mui-btn-block mui-btn-outlined mui-active" id="btn_submit" disabled="disabled">提交</button>
  89. </div>
  90. </div>
  91. <script src="//s.iamberry.com/tooth/js/mui.min.js?v=2017101701"></script>
  92. <script src="//s.iamberry.com/tooth/js/jquery-2.1.1.min.js"></script>
  93. <script src="//s.iamberry.com/tooth/js/shop/main.js?v=2017101701"></script>
  94. <script src="//s.iamberry.com/tooth/js/shop/wechat-utils-1.0.js"></script>
  95. <script type="text/javascript">
  96. var check = false,alert_msg='';
  97. var mobile=/^(13|14|15|18)[0-9]{9}$/; //手机号码
  98. var uname = /^[\u4e00-\u9fa5]{1,12}$/; //中文英文
  99. var code = /^[0-9]{4}$/; //数字
  100. mui.ready(function(){
  101. mui.ajax(base_path + '/agentTooth/select_agent_info?dates=' + new Date().getTime(), {
  102. data: {},
  103. dataType: 'json',
  104. type: 'post',
  105. timeout: 15000,
  106. success: function(dt) {
  107. console.log(dt)
  108. if(dt.isRedirect) {
  109. location.href = dt.redirectURL;
  110. }else{
  111. if(dt.resultCode=="200"){
  112. console.log("获取代理商信息成功!");
  113. $("#headDiv").html('<img src="'+dt.data.userHead+'">');
  114. $("#userNickname").text(decodeURI(dt.data.userNickname));
  115. }else{
  116. mui.alert("短信发送失败!")
  117. }
  118. }
  119. },
  120. error: function(xhr, type, errorThrown) {
  121. console.log(xhr);
  122. }
  123. });
  124. document.querySelector('.loading-bg').style.display='none';
  125. });
  126. $(document).on('tap', '#pull-code', function() {
  127. if($("#ipt-phone").val().trim()=="" &&(!$("#pull-code").hasClass("mui-active"))){
  128. mui.alert("请填写手机号码");
  129. return;
  130. }else{
  131. if(!mobile.test($("#ipt-phone").val().trim())){
  132. mui.alert("手机号码不正确,请重新填写");
  133. return;
  134. }else{
  135. if($(this).hasClass("mui-active")){
  136. mui.alert();
  137. return;
  138. }else{
  139. $(this).addClass("mui-active");
  140. settime("pull-code");
  141. mui.ajax(base_path + '/qrcode/send_phone_code?dates=' + new Date().getTime(), {
  142. data: {
  143. phone: $("#ipt-phone").val()
  144. },
  145. dataType: 'json',
  146. type: 'post',
  147. timeout: 15000,
  148. success: function(dt) {
  149. console.log(dt)
  150. if(dt.isRedirect) {
  151. /*location.href = dt.redirectURL;*/
  152. }else{
  153. if(dt.resultCode=="200"){
  154. console.log("获取短信成功!");
  155. $("#btn-submit").removeAttr("disabled").addClass("active");
  156. }else{
  157. mui.alert("短信发送失败!")
  158. }
  159. }
  160. },
  161. error: function(xhr, type, errorThrown) {
  162. console.log(xhr);
  163. }
  164. });
  165. }
  166. }
  167. }
  168. });
  169. var countdown=60;
  170. function settime(val) {
  171. pullid=dc(val);
  172. if (countdown == 0) {
  173. pullid.removeAttribute("disabled");
  174. pullid.className='btn-pull-code';
  175. pullid.innerText="获取验证码";
  176. countdown = 60;
  177. return false;
  178. } else {
  179. pullid.setAttribute("disabled", true);
  180. pullid.className='btn-pull-code mui-active';
  181. pullid.innerText="重新发送(" + countdown + ")";
  182. countdown--;
  183. }
  184. setTimeout(function() {
  185. settime(val)
  186. },1000)
  187. }
  188. //实时监听文本框字数
  189. document.getElementById("ipt-phone").addEventListener("input", function() {
  190. var phone = this.value;
  191. var mobile = /^(13|14|15|17|18)[0-9]{9}$/; //手机号码
  192. if(phone.length == 11) {
  193. if(mobile.test(phone)) {
  194. $(".pull-code").removeAttr("disabled").addClass("active");
  195. } else {
  196. $(".pull-code").attr("disabled", "disabled").removeClass("active");
  197. }
  198. } else {
  199. $(".pull-code").attr("disabled", "disabled").removeClass("active");
  200. }
  201. });
  202. function change_input() {
  203. $(".mui-input-group input").each(function(index) {
  204. switch ($(this).attr("id")){
  205. case "ipt-phone":
  206. if($(this).val().trim()==""){
  207. alert_msg="请填写手机号";
  208. check=false;
  209. return false;
  210. }else{
  211. if(mobile.test($(this).val().trim())) {
  212. check=true;
  213. }else{
  214. alert_msg="手机号码不正确,请重新填写";
  215. check=false;
  216. return false;
  217. }
  218. }
  219. break;
  220. case "ipt-code":
  221. if($(this).val().trim()==""){
  222. alert_msg="请填写验证码";
  223. check=false;
  224. return false;
  225. }else{
  226. if(code.test($(this).val().trim())) {
  227. check=true;
  228. }else{
  229. alert_msg="验证码格式不正确,请重新填写";
  230. check=false;
  231. return false;
  232. }
  233. }
  234. break;
  235. default:
  236. break;
  237. }
  238. });
  239. }
  240. //提交
  241. mui('body').on('tap', '#btn_submit', function() {
  242. var positive_int = /^[0-9]\d*$/; //正整数0-9
  243. var code = $("#ipt-code").val();
  244. var phone = $("#ipt-phone").val();;
  245. if(code != '') {
  246. if(positive_int.test(code)) {
  247. change_input();
  248. if(check) {
  249. $.ajax(base_path + '/agentTooth/agent_activate?dates=' + new Date().getTime(), {
  250. data: {
  251. "agentTel": phone,
  252. "phoneCode":code
  253. },
  254. dataType: 'json',
  255. xhrFields: {
  256. withCredentials: true
  257. },
  258. crossDomain: true,
  259. type: 'post',
  260. timeout: 15000,
  261. success: function(dt) {
  262. console.log(dt);
  263. if(dt.isRedirect) {
  264. location.href = dt.redirectURL;
  265. } else {
  266. if(dt.resultCode == "200") {
  267. mui.alert("提交成功!",function(){
  268. location.href="agent_center.html";
  269. });
  270. } else {
  271. console.log("提交失败!请重试");
  272. mui.alert("提交失败!", function() {
  273. });
  274. }
  275. $("#btn-submit").removeAttr("disabled").addClass("active");
  276. }
  277. },
  278. error: function(xhr, type, errorThrown) {
  279. console.log(xhr);
  280. new Image().src = base_path + "/html_error?error=" + encodeURI(xhr.statusText);
  281. }
  282. });
  283. } else {
  284. mui.alert(show_msg);
  285. }
  286. } else {
  287. mui.alert("短信验证码格式不正确", function() {
  288. $("#ipt-code").val("");
  289. })
  290. }
  291. } else {
  292. mui.alert("请输入短信验证码");
  293. }
  294. });
  295. </script>
  296. </body>
  297. </html>