panhui 7 лет назад
Родитель
Сommit
6da9858ee4

+ 5 - 0
src/main/java/com/izouma/awesomeadmin/web/MainController.java

@@ -23,4 +23,9 @@ public class MainController {
     public ModelAndView admin(HttpServletRequest request) {
         return new ModelAndView("html/admin.html");
     }
+
+    @RequestMapping("/share")
+    public ModelAndView share(HttpServletRequest request) {
+        return new ModelAndView("html/share.html");
+    }
 }

+ 131 - 0
src/main/webapp/WEB-INF/html/share.html

@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>猿人电竞</title>
+    <link rel="stylesheet" href="static/share/share.css">
+</head>
+
+<body>
+
+<div id="app">
+    <div class="content">
+        <img src="static/share/images/text_yonghuduan.png" alt="" class="top">
+
+        <input class="input" type="number" v-model="inputVal" placeholder="输入你的手机号">
+
+        <div class="btn" @click="submit">确定</div>
+
+        <div style="flex-grow:1"></div>
+        <img src="static/share/images/img_0000000.png" alt="" class="bottomImg">
+    </div>
+
+
+</div>
+
+
+<script src="static/share/vue.js"></script>
+
+<script>
+    var Ajax = {
+        get: function (url, fn) {
+            // XMLHttpRequest对象用于在后台与服务器交换数据
+            var xhr = new XMLHttpRequest();
+            xhr.open('GET', url, true);
+            xhr.onreadystatechange = function () {
+                // readyState == 4说明请求已完成
+                if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
+                    // 从服务器获得数据
+                    fn.call(this, xhr.responseText);
+                }
+            };
+            xhr.send();
+        },
+        // datat应为'a=a1&b=b1'这种字符串格式,在jq里如果data为对象会自动将对象转成这种字符串格式
+        post: function (url, data, fn) {
+            var xhr = new XMLHttpRequest();
+            xhr.open("POST", url, true);
+            // 添加http头,发送信息至服务器时内容编码类型
+            // xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+            xhr.onreadystatechange = function () {
+                if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)) {
+                    fn.call(this, JSON.parse(xhr.responseText));
+                }
+            };
+            xhr.send(data);
+        }
+    }
+
+    function GetUrlParam(paraName) {
+        var url = document.location.toString();
+        var arrObj = url.split("?");
+
+        if (arrObj.length > 1) {
+            var arrPara = arrObj[1].split("&");
+            var arr;
+
+            for (var i = 0; i < arrPara.length; i++) {
+                arr = arrPara[i].split("=");
+
+                if (arr != null && arr[0] == paraName) {
+                    return arr[1];
+                }
+            }
+            return "";
+        }
+        else {
+            return "";
+        }
+    }
+
+
+    var app = new Vue({
+        el: '#app',
+        data: {
+            inputVal: ''
+        },
+        watch: {
+            inputVal: function (val) {
+                this.inputVal = val.substr(0, 11);
+            }
+        },
+        methods: {
+            submit: function () {
+                if (!this.checkPhone(this.inputVal)) {
+                    alert('手机号格式错误!');
+                    return;
+                }
+
+                var data=new FormData()
+                data.append("userId",GetUrlParam('userId'));
+                data.append("telephone",this.inputVal);
+
+                Ajax.post('/recommenderLog/save',data,function (res) {
+                    if(res.success){
+                        alert('提交成功,快去下载猿人电竞吧!');
+                        if(navigator.userAgent.indexOf('iPhone')>-1||navigator.userAgent.indexOf('iPad')>-1){
+                            window.location.href='https://www.pgyer.com/CaE4'
+                        }
+                        else{
+                            window.location.href='https://www.pgyer.com/CaE4'
+                        }
+                    }
+                }.bind(this))
+            },
+            checkPhone: function (phone) {
+                var result = false
+                if ((/^1[3|4|5|8|7|6|9][0-9]\d{8}$/.test(phone))) {
+                    result = true
+                }
+                return result
+            }
+        }
+    })
+
+</script>
+</body>
+
+</html>

BIN
src/main/webapp/static/share/images/img_0000000.png


BIN
src/main/webapp/static/share/images/text_yonghuduan.png


+ 69 - 0
src/main/webapp/static/share/share.css

@@ -0,0 +1,69 @@
+  * {
+      margin: 0;
+      padding: 0;
+  }
+  
+  #app {
+      background-color: #2B2B42;
+      width: 100vw;
+      height: 100vh;
+      overflow: auto;
+      display: flex;
+      flex-direction: column;
+  }
+  
+  .content {
+      flex-grow: 1;
+      margin: 30px;
+      background-color: #363759;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      min-height: 527px;
+  }
+
+  .top{
+      width: 187px;
+      margin-top: 53px;
+  }
+
+  .input{
+      align-self: stretch;
+      margin: 39px 43px 0;
+      display: block;
+
+      outline: none;
+      border: none;
+      height:44px;
+      background:rgba(255,255,255,1);
+      text-align: center;
+      font-size: 16px;
+      font-weight: bold;
+
+  }
+  .input::-webkit-input-placeholder{
+      font-size:12px;
+      font-weight:normal;
+      color:rgba(114,119,133,1);
+  }
+
+  .btn{
+      align-self: stretch;
+      margin: 20px 43px 0;
+      height:44px;
+      background:linear-gradient(180deg,rgba(255,195,15,1) 0%,rgba(255,165,76,1) 100%);
+      text-align: center;
+      color: #fff;
+      font-size:16px;
+      line-height: 44px;
+      font-weight: bold;
+  }
+
+  .btn:active{
+      background: #F29E3C;
+  }
+
+  .bottomImg{
+     width: 75vw;
+      margin: 20px auto;
+  }

Разница между файлами не показана из-за своего большого размера
+ 5 - 0
src/main/webapp/static/share/vue.js


Некоторые файлы не были показаны из-за большого количества измененных файлов