123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- <script src="jquery.js"></script>
- <script>
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- </script>
- <style>
- *{margin:0;padding:0;color: #333;}
- body{font-family: 'helvetica neue',tahoma,'hiragino sans gb',stheiti,'wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1,\5B8B\4F53,sans-serif; background:#fff;-webkit-text-size-adjust:100%;}
- body,html{width: 100%;height: 100vh; }
- input{outline:none; -webkit-tap-highlight-color: rgba(0,0,0,0);border-radius: 0;font-size: 0.13rem;}
- .alert-info {position: absolute;top: 1.74rem;right: 0;left: 0;bottom: 0;text-align: center;}
- .alert-info p {display: inline-block;color: #fff;font-size: 0.14rem;line-height: 0.36rem;padding: 0 0.10rem;background-color: rgba(0, 0, 0, 0.7);border-radius: 5px;}
- .cont {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- margin: auto;
- height: 90%;
- width: 80%;
- border: 0.005rem #797979 solid;
- }
- .head{
- line-height: 0.6rem;
- font-size: 0.22rem;
- text-align: center;
- }
- .input_con{
- padding-bottom: 1rem;
- margin: auto;
- }
- .input_con span {
- font-size: 0.16rem;
- margin-right: 0.15rem;
- margin-left: 0.2rem;
- }
- #phone{
- width: 1.8rem;
- height:0.27rem;
- text-indent: 1em;
- }
- #upgrade{
- width: 2rem;
- height: 0.4rem;
- background-color: #169bd5;
- color: #fffff3;
- font-size: 0.15rem;
- line-height: 0.4rem;
- text-align: center;
- border-radius: 0.2rem;
- margin: auto;
- }
-
- </style>
- </head>
- <body>
- <div class="cont">
- <p class="head">猎豆优选</p>
- <div class="input_con">
- <span>手机号</span><input type="tel" id="phone">
- </div>
- <p id="upgrade">升级为超级会员</p>
- </div>
- <div class="alert-info" style="display: none;">
- <!-- tip提示,3s后消失 -->
- <p></p>
- </div>
- </body>
- <script>
- $('#upgrade').click(function(){
-
- // if($("#phone").val()==""||$("#phone").val()==null){
- // alert("请输入手机号!");
- // return false;
- // }else{
- // var myreg = /^1[3|4|5|7|8][0-9]\d{4,8}$/; //手机号校验
- // if(!myreg.test($("#phone").val())) {
- // alert("请填写 有效的手机号码!");
- // return;
- // }
- // }
- //发送数据
- $.ajax({
- type: 'GET',
- url: 'http://tbkadmin.726p.com/admin/userlevel/up',
- data: {
- phone:$('input[type="tel"]').val()
- },
- success: function(msg){
- var obj=eval("("+ msg +")")
- // console.log(obj)
- //升级成功
- if(obj.code==200){
- showMsg(obj.message)
- }else if(obj.code==300){
- //已经是超级会员
- showMsg(obj.message)
- }else if(obj.code==400){
- //升级失败
- showMsg(obj.message)
- }
- }
- });
- })
-
- function showMsg(msg) {
- var msgBox = $('.alert-info');
- msgBox.children('p').text(msg);
- msgBox.show();
-
- setTimeout(function() {
- msgBox.hide();
- }, 2000);
- }
- </script>
- </html>
|