xjc il y a 2 ans
Parent
commit
2ed5aad0b0
4 fichiers modifiés avec 155 ajouts et 2 suppressions
  1. 4 1
      src/weixin/controls.py
  2. 1 1
      src/weixin/views.py
  3. 75 0
      templates/topic/xsSignup.html
  4. 75 0
      templates/topic/ykSignup.html

+ 4 - 1
src/weixin/controls.py

@@ -1970,7 +1970,10 @@ def get_signup_info(request):
     """
     """
     qdata = request.json
-    user_id = request.user.get("id",0)
+    try:
+        user_id = request.user.get("id",0)
+    except:
+        user_id = 0
     try:
         match_id = ccc.get_signup_match().id
         match = cm.Match.objects.filter(id=match_id).values().first()

+ 1 - 1
src/weixin/views.py

@@ -829,7 +829,7 @@ class V3PhoneBindView(cv.AuthView):
             return cv.to_fail(e)
 
 
-class V3SignupInfoView(cv.AuthView):
+class V3SignupInfoView(cv.BaseView):
     def get(self, request):
         """#报名信息v3(3.0小程序)
         """

+ 75 - 0
templates/topic/xsSignup.html

@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title></title>
+    <!-- 引入样式 -->
+    <link rel="stylesheet" href="https://api.hunanwanzhu.com/topic/elementui-index.css">
+    <!-- 引入组件库 -->
+    <script src="https://code.jquery.com/jquery-3.6.0.js"  integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
+    <script src="https://api.hunanwanzhu.com/topic/vue.js"></script>
+    <script src="https://api.hunanwanzhu.com/topic/elementui-index.js"></script>
+</head>
+<style>
+    .container{
+       padding:20px; 
+    }
+    .footer{
+        position:fixed;
+        width:100%;
+        bottom:0px;
+        
+    }
+    .footer .signupBtn{
+       background:red; 
+       width:90%;
+       height:45px;
+       color:white;
+       border:0px;
+       margin:auto;
+       display:block;
+       font-weight:bold;
+    }
+</style>
+<body>
+    <div id="container">
+        <div class="content">
+            <h3>顽主杯比赛系统-{{matchinfo.name}}-选手使用须知</h3>
+        
+        </div>
+        <div class="footer">
+            <button class="signupBtn">立即报名</button> 
+        </div>
+    </div>
+    <script>
+        var app = new Vue({
+            el: '#container',
+            data: {
+                matchinfo:{}
+            },
+            methods:{
+                getData(){
+                    $.ajax({
+                                type: 'GET',
+                                url: '/api/wx/v3/signup/info',
+                                data: {},
+                                contentType: "application/json", 
+                                dataType: 'json',
+                                success:res=>{
+                                    console.log(res)
+                                    this.matchinfo = res.data;
+                                },
+                                
+                            });
+                }
+            },
+            created(){
+                this.getData();
+            }
+        })        
+    </script>
+</body>
+</html>

+ 75 - 0
templates/topic/ykSignup.html

@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title></title>
+    <!-- 引入样式 -->
+    <link rel="stylesheet" href="https://api.hunanwanzhu.com/topic/elementui-index.css">
+    <!-- 引入组件库 -->
+    <script src="https://code.jquery.com/jquery-3.6.0.js"  integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
+    <script src="https://api.hunanwanzhu.com/topic/vue.js"></script>
+    <script src="https://api.hunanwanzhu.com/topic/elementui-index.js"></script>
+</head>
+<style>
+    .container{
+       padding:20px; 
+    }
+    .footer{
+        position:fixed;
+        width:100%;
+        bottom:0px;
+        
+    }
+    .footer .signupBtn{
+       background:red; 
+       width:90%;
+       height:45px;
+       color:white;
+       border:0px;
+       margin:auto;
+       display:block;
+       font-weight:bold;
+    }
+</style>
+<body>
+    <div id="container">
+        <div class="content">
+            <h3>顽主杯比赛系统-{{matchinfo.name}}-游客使用须知</h3>
+        
+        </div>
+        <div class="footer">
+            <button class="signupBtn">立即报名</button> 
+        </div>
+    </div>
+    <script>
+        var app = new Vue({
+            el: '#container',
+            data: {
+                matchinfo:{}
+            },
+            methods:{
+                getData(){
+                    $.ajax({
+                                type: 'GET',
+                                url: '/api/wx/v3/signup/info',
+                                data: {},
+                                contentType: "application/json", 
+                                dataType: 'json',
+                                success:res=>{
+                                    console.log(res)
+                                    this.matchinfo = res.data;
+                                },
+                                
+                            });
+                }
+            },
+            created(){
+                this.getData();
+            }
+        })        
+    </script>
+</body>
+</html>