x1ongzhu 6 anos atrás
pai
commit
b7b85022ef

+ 1 - 1
config.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.izouma.yuanqijjc" ios-CFBundleVersion="1" version="1.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.izouma.yuanqijjc" ios-CFBundleVersion="1" version="1.0.7" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>元气竞技场</name>
     <description>        A sample Apache Cordova application that responds to the deviceready event.    </description>
     <author email="dev@cordova.apache.org" href="http://cordova.io">        Apache Cordova Team    </author>

+ 8 - 8
platforms/android/android.json

@@ -10,35 +10,35 @@
           "/*": [
             {
               "xml": "<uses-permission android:name=\"android.permission.INTERNET\" />",
-              "count": 42
+              "count": 52
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
-              "count": 21
+              "count": 26
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
-              "count": 21
+              "count": 26
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />",
-              "count": 22
+              "count": 27
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" />",
-              "count": 21
+              "count": 26
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />",
-              "count": 22
+              "count": 27
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\" />",
-              "count": 21
+              "count": 26
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />",
-              "count": 21
+              "count": 26
             },
             {
               "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",

+ 1 - 1
platforms/android/app/src/main/AndroidManifest.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<manifest android:hardwareAccelerated="true" android:versionCode="10006" android:versionName="1.0.6" package="com.izouma.yuanqijjc" xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest android:hardwareAccelerated="true" android:versionCode="10007" android:versionName="1.0.7" package="com.izouma.yuanqijjc" xmlns:android="http://schemas.android.com/apk/res/android">
     <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
     <uses-permission android:name="android.permission.INTERNET" />
     <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">

+ 1 - 1
platforms/android/app/src/main/assets/www/css/index.css

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.izouma.yuanqijjc" ios-CFBundleVersion="1" version="1.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.izouma.yuanqijjc" ios-CFBundleVersion="1" version="1.0.7" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <feature name="Camera">
         <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
     </feature>

+ 1 - 1
vue/index.html

@@ -17,7 +17,7 @@
         })();
     </script>
     <script src="./cordova.js"></script>
-    <title>dianjing</title>
+    <title>元气竞技场</title>
 </head>
 
 <body>

+ 1 - 1
vue/index_dev.html

@@ -7,7 +7,7 @@
     <meta name="apple-mobile-web-app-capable" content="yes">
     <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> -->
     <meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover, user-scalable=no">
-    <title>dianjing</title>
+    <title>元气竞技场</title>
     <script>
         var _hmt = _hmt || [];
         (function () {

+ 5 - 0
vue/package-lock.json

@@ -65,6 +65,11 @@
         "repeat-string": "^1.5.2"
       }
     },
+    "alloyfinger": {
+      "version": "0.1.16",
+      "resolved": "https://registry.npm.taobao.org/alloyfinger/download/alloyfinger-0.1.16.tgz",
+      "integrity": "sha1-jV1GBzzx/tul9EbmZrxLOSW4uLU="
+    },
     "alphanum-sort": {
       "version": "1.0.2",
       "resolved": "http://registry.npm.taobao.org/alphanum-sort/download/alphanum-sort-1.0.2.tgz",

+ 1 - 0
vue/package.json

@@ -10,6 +10,7 @@
     "build": "node build/build.js"
   },
   "dependencies": {
+    "alloyfinger": "^0.1.16",
     "axios": "^0.18.0",
     "clipboard": "^2.0.1",
     "date-fns": "^1.29.0",

+ 1 - 0
vue/src/App.vue

@@ -93,6 +93,7 @@ export default {
     position: relative;
 }
 .router-view {
+    flex-basis: 0;
     flex-grow: 1;
     overflow-x: hidden;
     overflow-y: scroll;

+ 131 - 94
vue/src/pages/Apply.vue

@@ -1,59 +1,68 @@
 <template>
     <div>
         <div class="match-name">{{matchInfo.name}}</div>
-        <div class="game-name">{{matchInfo.gameInfo?matchInfo.gameInfo.name:''}}</div>
+        <div class="game-name">{{matchInfo.gameInfo?matchInfo.gameInfo.name:''}}
+        </div>
         <div class="title">报名信息</div>
         <div class="cell">
             <div class="row">
                 <span class="label">注册手机号</span>
-                <span class="input" style="background: none">{{userInfo.phone}}</span>
+                <span class="input"
+                    style="background: none">{{userInfo.phone}}</span>
             </div>
             <div class="row" v-if="matchInfo.teamMode">
                 <span class="label">战队名称</span>
                 <input class="input" v-model="teamName" placeholder="请填写战队名称">
                 <img v-if="teamName" @click="teamName=''"
-                     src="../assets/icon_clear_pre.png"
-                     class="icon-clear">
+                    src="../assets/icon_clear_pre.png" class="icon-clear">
             </div>
             <div class="row" v-else>
                 <span class="label">游戏ID</span>
-                <input @click="$event.target.focus()" class="input" v-model="gameId" placeholder="请填写游戏ID">
-                <img v-if="gameId" @click="gameId=''" src="../assets/icon_clear_pre.png" class="icon-clear">
+                <input @click="$event.target.focus()" class="input"
+                    v-model="gameId" placeholder="请填写游戏ID">
+                <img v-if="gameId" @click="gameId=''"
+                    src="../assets/icon_clear_pre.png" class="icon-clear">
             </div>
             <div class="row" v-if="!matchInfo.isPublic">
                 <span class="label">报名密码</span>
-                <input @click="$event.target.focus()" class="input" v-model="password" placeholder="请填写报名密码">
+                <input @click="$event.target.focus()" class="input"
+                    v-model="password" placeholder="请填写报名密码">
             </div>
             <div class="row" v-if="matchInfo.requireRealName">
                 <span class="label">真实姓名</span>
-                <input @click="$event.target.focus()"
-                       class="input" v-model="realName" placeholder="请填写真实姓名">
+                <input @click="$event.target.focus()" class="input"
+                    v-model="realName" placeholder="请填写真实姓名">
             </div>
             <div class="row" v-if="matchInfo.requireId">
                 <span class="label">身份证</span>
-                <input @click="$event.target.focus()" class="input" v-model="idNo" placeholder="请填写身份证号">
+                <input @click="$event.target.focus()" class="input"
+                    v-model="idNo" placeholder="请填写身份证号">
             </div>
         </div>
         <div class="title">联系方式</div>
         <div class="cell">
             <div class="row">
                 <span class="label">手机号</span>
-                <input @click="$event.target.focus()" class="input" v-model="phone" placeholder="请填写手机号">
+                <input @click="$event.target.focus()" class="input"
+                    v-model="phone" placeholder="请填写手机号">
             </div>
             <div class="row">
                 <span class="label">QQ</span>
-                <input @click="$event.target.focus()" class="input" v-model="qq" placeholder="请填写QQ号">
+                <input @click="$event.target.focus()" class="input" v-model="qq"
+                    placeholder="请填写QQ号">
             </div>
             <div class="row">
                 <span class="label">微信</span>
-                <input @click="$event.target.focus()" class="input" v-model="wx" placeholder="请填写微信号">
+                <input @click="$event.target.focus()" class="input" v-model="wx"
+                    placeholder="请填写微信号">
             </div>
         </div>
         <div class="title" v-if="matchInfo.teamMode">战队信息</div>
         <div class="cell" v-if="matchInfo.teamMode">
             <div class="row" v-for="item in teamInfo" :key="item.name">
                 <span class="label">{{item.name}}</span>
-                <input class="input" v-model="item.gameId" placeholder="请填写游戏ID">
+                <input class="input" v-model="item.gameId"
+                    placeholder="请填写游戏ID">
             </div>
         </div>
         <div class="btn-wrapper">
@@ -62,127 +71,155 @@
     </div>
 </template>
 <script>
-import { mapState } from 'vuex'
+import { mapState } from "vuex";
 export default {
     created() {
         if (this.$route.params.matchInfo && this.$route.params.matchInfo.id) {
-            this.matchInfo = this.$route.params.matchInfo
-        } else {
-            this.$http.get({
-                url: 'matchInfo/getMatchInfo',
-                data: {
-                    id: this.$route.query.id
+            this.matchInfo = this.$route.params.matchInfo;
+            if (this.matchInfo.teamMode) {
+                let arr = [];
+                for (let i = 0; i < this.matchInfo.teamSize; i++) {
+                    arr[i] = {
+                        name: i === 0 ? "队长" : `队员${i}`,
+                        gameId: "",
+                        leader: i === 0
+                    };
+                    console.log(111);
                 }
-            }).then(res => {
-                if (res.success) {
-                    this.matchInfo = res.data;
-                    if (this.matchInfo.teamMode) {
-                        let arr = [];
-                        for (let i = 0; i < this.matchInfo.teamSize; i++) {
-                            arr[i] = {
-                                name: i === 0 ? '队长' : `队员${i}`,
-                                gameId: '',
-                                leader: i === 0
+                this.teamInfo = arr;
+            }
+        } else {
+            this.$http
+                .get({
+                    url: "matchInfo/getMatchInfo",
+                    data: {
+                        id: this.$route.query.id
+                    }
+                })
+                .then(res => {
+                    if (res.success) {
+                        this.matchInfo = res.data;
+                        console.log(111);
+                        if (this.matchInfo.teamMode) {
+                            let arr = [];
+                            for (let i = 0; i < this.matchInfo.teamSize; i++) {
+                                arr[i] = {
+                                    name: i === 0 ? "队长" : `队员${i}`,
+                                    gameId: "",
+                                    leader: i === 0
+                                };
+                                console.log(111);
                             }
+                            this.teamInfo = arr;
                         }
-                        this.teamInfo = arr;
                     }
-                }
-            })
+                });
         }
     },
     data() {
         return {
             matchInfo: {},
-            realName: '',
-            idNo: '',
-            gameId: '',
-            phone: '',
-            qq: '',
-            wx: '',
-            remark: '',
-            password: '',
-            teamName: '',
+            realName: "",
+            idNo: "",
+            gameId: "",
+            phone: "",
+            qq: "",
+            wx: "",
+            remark: "",
+            password: "",
+            teamName: "",
             teamInfo: []
-        }
+        };
     },
     computed: {
-        ...mapState(['userInfo'])
+        ...mapState(["userInfo"])
     },
     methods: {
         setupNavbar() {
-            this.$navbar.style = 'dark'
-            this.$navbar.title = '报名'
-            this.$navbar.background = '#0E1822'
-            this.$navbar.showBack = true
-            this.$navbar.showRightItem = false
-            this.$navbar.hidden = false
+            this.$navbar.style = "dark";
+            this.$navbar.title = "报名";
+            this.$navbar.background = "#0E1822";
+            this.$navbar.showBack = true;
+            this.$navbar.showRightItem = false;
+            this.$navbar.hidden = false;
         },
         apply() {
             if (this.matchInfo.teamMode) {
                 if (!this.teamName) {
-                    this.$modal.info('请填写战队名称');
+                    this.$modal.info("请填写战队名称");
                     return;
                 }
                 for (let i = 0; i < this.teamInfo.length; i++) {
                     if (!this.teamInfo[i].gameId) {
-                        this.$modal.info(`请填写${this.teamInfo[i].name}游戏ID`);
+                        this.$modal.info(
+                            `请填写${this.teamInfo[i].name}游戏ID`
+                        );
                         return;
                     }
                 }
                 this.gameId = this.teamName;
             }
             if (!this.gameId) {
-                this.$modal.info('请填写游戏ID');
+                this.$modal.info("请填写游戏ID");
             } else if (!this.phone && !this.qq && !this.wx) {
-                this.$modal.info('请至少填写一种联系方式');
+                this.$modal.info("请至少填写一种联系方式");
             } else if (this.matchInfo.requireRealName && !this.realName) {
-                this.$modal.info('请填写真实姓名');
+                this.$modal.info("请填写真实姓名");
             } else if (this.matchInfo.requireId && !this.idNo) {
-                this.$modal.info('请填写身份证');
-            } else if (this.matchInfo.requirePhone && !/^1[3-9]\d{9}$/.test(this.phone)) {
-                this.$modal.info('请填写正确的手机号');
-            } else if (this.matchInfo.requireQq && !/^\d{5,11}$/.test(this.qq)) {
-                this.$modal.info('请填写正确的QQ号');
+                this.$modal.info("请填写身份证");
+            } else if (
+                this.matchInfo.requirePhone &&
+                !/^1[3-9]\d{9}$/.test(this.phone)
+            ) {
+                this.$modal.info("请填写正确的手机号");
+            } else if (
+                this.matchInfo.requireQq &&
+                !/^\d{5,11}$/.test(this.qq)
+            ) {
+                this.$modal.info("请填写正确的QQ号");
             } else if (this.matchInfo.requireWx && !this.wx) {
-                this.$modal.info('请填写微信号');
+                this.$modal.info("请填写微信号");
             } else if (!this.matchInfo.isPublic && !this.password) {
-                this.$modal.info('请填写报名密码');
+                this.$modal.info("请填写报名密码");
             } else {
-                this.$http.post({
-                    url: 'applyInfo/apply',
-                    data: {
-                        matchId: this.matchInfo.id,
-                        userId: this.userInfo.id,
-                        nickname: this.userInfo.nickname,
-                        gameId: this.gameId,
-                        realName: this.realName,
-                        idNo: this.idNo,
-                        phone: this.phone || this.userInfo.phone,
-                        qq: this.qq,
-                        wx: this.wx,
-                        remark: this.remark,
-                        password: this.matchInfo.isPublic ? '' : this.password,
-                        teamName: this.teamName,
-                        teamInfo: JSON.stringify(this.teamInfo)
-                    }
-                }).then(res => {
-                    if (res.success) {
-                        this.$modal.success('报名成功');
-                        this.$router.replace({
-                            path: '/matchInfo',
-                            query: {
-                                id: this.matchInfo.id
-                            }
-                        })
-                    } else {
-                        this.$modal.info(res.error);
-                    }
-                })
+                this.$http
+                    .post({
+                        url: "applyInfo/apply",
+                        data: {
+                            matchId: this.matchInfo.id,
+                            userId: this.userInfo.id,
+                            nickname: this.userInfo.nickname,
+                            gameId: this.gameId,
+                            realName: this.realName,
+                            idNo: this.idNo,
+                            phone: this.phone || this.userInfo.phone,
+                            qq: this.qq,
+                            wx: this.wx,
+                            remark: this.remark,
+                            password: this.matchInfo.isPublic
+                                ? ""
+                                : this.password,
+                            teamName: this.teamName,
+                            teamInfo: JSON.stringify(this.teamInfo)
+                        }
+                    })
+                    .then(res => {
+                        if (res.success) {
+                            this.$modal.success("报名成功");
+                            this.$router.replace({
+                                path: "/matchInfo",
+                                query: {
+                                    id: this.matchInfo.id
+                                }
+                            });
+                        } else {
+                            this.$modal.info(res.error);
+                        }
+                    });
             }
         }
     }
-}
+};
 </script>
 <style lang="less" scoped>
 @import "../base.less";

+ 63 - 71
vue/src/pages/Home.vue

@@ -1,65 +1,66 @@
 <template>
     <div class="container">
         <div class="router-container">
-            <transition :name="'vux-pop-' + (direction === 'forward' ? 'in' : 'out')">
+            <transition
+                :name="'vux-pop-' + (direction === 'forward' ? 'in' : 'out')">
                 <keep-alive>
                     <router-view class="tab-page"></router-view>
                 </keep-alive>
             </transition>
         </div>
-        <div class="tab-wrapper">
-            <div class="tab-bar">
-                <div class="tab-item" @click="tabClick(0)">
-                    <img :src="require(tab === 0 ? '../assets/icon_match_pre.png' : '../assets/icon_match.png')">
-                    <span :class="tab === 0 ? 'active' : ''">比赛</span>
-                </div>
-                <div class="tab-item" @click="tabClick(1)">
-                    <img :src="require(tab === 1 ? '../assets/icon_mine_pre.png' : '../assets/icon_mine.png')">
-                    <span :class="tab === 1 ? 'active' : ''">我的</span>
-                </div>
+        <div class="tab-bar">
+            <div class="tab-item" @click="tabClick(0)">
+                <img
+                    :src="require(tab === 0 ? '../assets/icon_match_pre.png' : '../assets/icon_match.png')">
+                <span :class="tab === 0 ? 'active' : ''">比赛</span>
+            </div>
+            <div class="tab-item" @click="tabClick(1)">
+                <img
+                    :src="require(tab === 1 ? '../assets/icon_mine_pre.png' : '../assets/icon_mine.png')">
+                <span :class="tab === 1 ? 'active' : ''">我的</span>
             </div>
         </div>
     </div>
 </template>
 <script>
-import { mapState } from 'vuex'
+import { mapState } from "vuex";
 export default {
-    name: 'home',
+    name: "home",
     created() {
-        if (this.$route.name === 'MatchList') {
-            this.tab = 0
-        } else if (this.$route.name === 'Mine') {
-            this.tab = 1
+        if (this.$route.name === "MatchList") {
+            this.tab = 0;
+        } else if (this.$route.name === "Mine") {
+            this.tab = 1;
         }
     },
     data() {
         return {
             tab: 0
-        }
+        };
     },
     computed: {
-        ...mapState(['direction', 'userInfo'])
+        ...mapState(["direction", "userInfo"])
     },
     methods: {
         tabClick(i) {
             if (i === 0) {
-                this.$router.replace({ name: 'MatchList' })
+                this.$router.replace({ name: "MatchList" });
             } else if (i === 1) {
-                this.$router.replace({ name: 'Mine' })
+                this.$router.replace({ name: "Mine" });
             }
-            this.tab = i
+            this.tab = i;
         }
     },
     watch: {
         $route() {
-            if (this.$route.name === 'MatchList') {
-                this.tab = 0
-            } else if (this.$route.name === 'Mine') {
-                this.tab = 1
+            if (this.$route.name === "MatchList") {
+                this.tab = 0;
+            } else if (this.$route.name === "Mine") {
+                this.tab = 1;
             }
         }
     }
-}
+};
 </script>
 <style lang="less" scoped>
 @import "../base.less";
@@ -73,6 +74,7 @@ export default {
     display: flex;
     flex-direction: column;
     .tab-page {
+        flex-basis: 0;
         flex-grow: 1;
         overflow-x: hidden;
         overflow-y: scroll;
@@ -82,54 +84,44 @@ export default {
         backface-visibility: hidden;
         transform: translate3d(0, 0, 0);
     }
-    .tab-wrapper {
+    .tab-bar {
         height: 49px;
-        min-height: 49px;
-        padding-bottom: calc(max(env(safe-area-inset-bottom), 10px) - 10px);
-        box-shadow: 0 0px 8px 0px rgba(0, 0, 0, 0.06);
+        // min-height: 49px;
+        padding-bottom: env(safe-area-inset-bottom);
+        background: #1a2b39;
+        display: flex;
+        align-items: center;
         z-index: 1;
-        .tab-bar {
-            height: 49px;
-            min-height: 49px;
-            background: #1a2b39;
-            position: absolute;
-            bottom: 0;
-            bottom: calc(max(env(safe-area-inset-bottom), 10px) - 10px);
-            left: 0;
-            right: 0;
+        .tab-item {
+            height: 100%;
+            flex-basis: 0;
+            flex-grow: 1;
             display: flex;
             align-items: center;
-            .tab-item {
-                height: 100%;
-                flex-basis: 0;
-                flex-grow: 1;
-                display: flex;
-                align-items: center;
-                justify-content: center;
-                flex-direction: column;
-                // overflow-y: hidden;
-                position: relative;
-                img {
-                    width: 27px;
-                    height: 27px;
-                }
-                span {
-                    font-size: 10px;
-                    margin-top: 3px;
-                    color: @text3;
-                }
-                span.active {
-                    color: @main;
-                }
-                .icon-talk {
-                    width: 64px;
-                    height: 67px;
-                    position: absolute;
-                    bottom: 0;
-                    left: 0;
-                    right: 0;
-                    margin: auto;
-                }
+            justify-content: center;
+            flex-direction: column;
+            // overflow-y: hidden;
+            position: relative;
+            img {
+                width: 27px;
+                height: 27px;
+            }
+            span {
+                font-size: 10px;
+                margin-top: 3px;
+                color: @text3;
+            }
+            span.active {
+                color: @main;
+            }
+            .icon-talk {
+                width: 64px;
+                height: 67px;
+                position: absolute;
+                bottom: 0;
+                left: 0;
+                right: 0;
+                margin: auto;
             }
         }
     }