|
|
@@ -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>
|