Add page tgu_group_user_detail

Brightcells 8 anni fa
parent
commit
2b612334ac
5 ha cambiato i file con 42 aggiunte e 25 eliminazioni
  1. 25 0
      group/grouppage_views.py
  2. 0 12
      group/views.py
  3. 3 3
      page/templates/page/download.tmpl.html
  4. 7 7
      pai2/settings.py
  5. 7 3
      pai2/urls.py

+ 25 - 0
group/grouppage_views.py

@@ -0,0 +1,25 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from __future__ import division
4
+
5
+from django.conf import settings
6
+from django.shortcuts import render
7
+from logit import logit
8
+
9
+from group.models import GroupPhotoInfo
10
+
11
+
12
+@logit
13
+def group_photo_detail(request, photo_id):
14
+    photo = GroupPhotoInfo.objects.get(pk=photo_id)
15
+    return render(request, 'photo/photo_detail.html', {'photo_url': photo.photo_url, 'api_domain': settings.API_DOMAIN})
16
+
17
+
18
+@logit
19
+def group_detail(request, group_id):
20
+    return render(request, 'page/{}_download.html'.format('ios' if request.iOS else 'adr'), {})
21
+
22
+
23
+@logit
24
+def tgu_group_user_detail(request, admin_id):
25
+    return render(request, 'page/{}_download.html'.format('ios' if request.iOS else 'adr'), {})

+ 0 - 12
group/views.py

@@ -10,7 +10,6 @@ from curtail_uuid import CurtailUUID
10 10
 from django.conf import settings
11 11
 from django.core.files.storage import default_storage
12 12
 from django.db import connection, transaction
13
-from django.shortcuts import render
14 13
 from logit import logit
15 14
 from rest_framework import viewsets
16 15
 from TimeConvert import TimeConvert as tc
@@ -685,17 +684,6 @@ def lensman_photo_bought(request):
685 684
     })
686 685
 
687 686
 
688
-@logit
689
-def group_photo_detail(request, photo_id):
690
-    photo = GroupPhotoInfo.objects.get(pk=photo_id)
691
-    return render(request, 'photo/photo_detail.html', {'photo_url': photo.photo_url, 'api_domain': settings.API_DOMAIN})
692
-
693
-
694
-@logit
695
-def group_detail(request, group_id):
696
-    return render(request, 'page/{}_download.html'.format('ios' if request.iOS else 'adr'), {})
697
-
698
-
699 687
 class GroupInfoViewSet(viewsets.ModelViewSet):
700 688
     queryset = GroupInfo.objects.all().order_by('-pk')
701 689
     serializer_class = GroupInfoSerializer

+ 3 - 3
page/templates/page/download.tmpl.html

@@ -148,15 +148,15 @@
148 148
     <body>
149 149
         <div class="container">
150 150
             <article class="text-center">
151
-                <a href="http://pai.ai">
151
+                <a href="https://pai.ai">
152 152
                     <img src="{% static 'pai2/img/paiai_96_96.png' %}" class="logo">
153 153
                 </a>
154 154
                 <div class="title">
155
-                    <a href="http://pai.ai" class="text-blue">拍爱</a>
155
+                    <a href="https://pai.ai" class="text-blue">拍爱</a>
156 156
                 </div>
157 157
                 <div class="description text-muted">即拍即分享</div>
158 158
                 <div class="download">
159
-                    <a href="">
159
+                    <a href="https://api.pai.ai/op/download">
160 160
                         <button class="hero-button">下载<strong>v{{ version }}</strong></button>
161 161
                     </a>
162 162
                 </div>

+ 7 - 7
pai2/settings.py

@@ -243,8 +243,8 @@ WECHAT = {
243 243
     },
244 244
 }
245 245
 
246
-WECHAT_BASE_REDIRECT_URI = 'http://api.pai.ai/base_redirect'
247
-WECHAT_USERINFO_REDIRECT_URI = 'http://api.pai.ai/userinfo_redirect'
246
+WECHAT_BASE_REDIRECT_URI = 'https://api.pai.ai/base_redirect'
247
+WECHAT_USERINFO_REDIRECT_URI = 'https://api.pai.ai/userinfo_redirect'
248 248
 
249 249
 WECHAT_OAUTH2_AUTHORIZE = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid={appid}&redirect_uri={redirect_uri}&response_type=code&scope={scope}&state={state}#wechat_redirect'
250 250
 WECHAT_OAUTH2_ACCESS_TOKEN = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid={appid}&secret={secret}&code={code}&grant_type=authorization_code'
@@ -283,8 +283,8 @@ DOWNLOAD_ADR_PAGE_PATH = os.path.join(BASE_DIR, 'page/templates/page/adr_downloa
283 283
 DOWNLOAD_IOS_PAGE_PATH = os.path.join(BASE_DIR, 'page/templates/page/ios_download.html').replace('\\', '/')
284 284
 
285 285
 # 下载设置
286
-DOWNLOAD_WX_URL = ''
287
-DOWNLOAD_IOS_URL = ''
286
+DOWNLOAD_WX_URL = 'https://pai.ai'
287
+DOWNLOAD_IOS_URL = 'https://pai.ai'
288 288
 
289 289
 # 群组设置
290 290
 GROUP_PER_PAGE = 20  # 群组每页数量
@@ -304,9 +304,9 @@ LENSMAN_PHOTO_HAGGLE_MAX_TIMES = 3  # 摄影师照片最大砍价次数
304 304
 ORDER_NUM_PER_PAGE = 10  # 订单每页数量
305 305
 
306 306
 # 域名设置
307
-DOMAIN = 'http://pai.ai'
308
-IMG_DOMAIN = 'http://img.pai.ai'
309
-API_DOMAIN = 'http://api.pai.ai'
307
+DOMAIN = 'https://pai.ai'
308
+IMG_DOMAIN = 'https://img.pai.ai'
309
+API_DOMAIN = 'https://api.pai.ai'
310 310
 
311 311
 # 消息图片设置
312 312
 PAI2_LOGO_URL = DOMAIN + '/static/pai2/img/paiai_96_96.png'

+ 7 - 3
pai2/urls.py

@@ -24,7 +24,7 @@ from rest_framework import routers
24 24
 from account import views as account_views
25 25
 from account import tourguide_views
26 26
 from group import views as group_views
27
-from group import lensman_views
27
+from group import grouppage_views, lensman_views
28 28
 from page import views as page_views
29 29
 from photo import views as photo_views
30 30
 from website import views as website_views
@@ -57,11 +57,15 @@ urlpatterns += [
57 57
 ]
58 58
 
59 59
 urlpatterns += [
60
-    url(r'^gp/(?P<photo_id>\w+)$', group_views.group_photo_detail, name='group_photo_detail'),  # 群组照片详情
60
+    url(r'^gp/(?P<photo_id>\w+)$', grouppage_views.group_photo_detail, name='group_photo_detail'),  # 群组照片详情
61 61
 ]
62 62
 
63 63
 urlpatterns += [
64
-    url(r'^g/(?P<group_id>\w+)$', group_views.group_detail, name='group_detail'),  # 群组详情(APP下载页)
64
+    url(r'^g/(?P<group_id>\w+)$', grouppage_views.group_detail, name='group_detail'),  # 群组详情(APP下载页)
65
+]
66
+
67
+urlpatterns += [
68
+    url(r'^tgu/(?P<admin_id>\w+)$', grouppage_views.tgu_group_user_detail, name='tgu_group_user_detail'),  # 旅行团详情(APP下载页)
65 69
 ]
66 70
 
67 71
 urlpatterns += [