22 23
 from utils.storage_utils import file_save
23 24
 
24 25
 
25
-r = settings.REDIS_CACHE
26
-
27
-
28 26
 @logit
29 27
 def tg_group_create_api(request):
30 28
     """ 旅行团创建 """
@@ -276,12 +274,16 @@ def tg_group_gather_start_api(request):
276 274
     set_group_info(group)
277 275
 
278 276
     # 更新Session
279
-    r.pipeline().set(TOUR_GUIDE_GROUP_CUR_SESSION % group_id, shortuuid.uuid()).set(TOUR_GUIDE_GROUP_CUR_GATHER_INFO % group_id, json.dumps({
280
-        'gather_at': gather_at,
281
-        'gather_lon': gather_lon,
282
-        'gather_lat': gather_lat,
283
-        'gather_location': gather_location,
284
-    }, cls=DjangoJSONEncoder)).execute()
277
+    r.pipeline().set(
278
+        TOUR_GUIDE_GROUP_CUR_SESSION % group_id, shortuuid.uuid()
279
+    ).set(
280
+        TOUR_GUIDE_GROUP_CUR_GATHER_INFO % group_id, json.dumps({
281
+            'gather_at': gather_at,
282
+            'gather_lon': gather_lon,
283
+            'gather_lat': gather_lat,
284
+            'gather_location': gather_location,
285
+        }, cls=DjangoJSONEncoder)
286
+    ).execute()
285 287
 
286 288
     return response(200, 'Set Tour Guide Group Gather Info Success', u'设置旅行团集合信息成功')
287 289
 

+ 1 - 3
group/tourguidegroupuser_views.py

@@ -14,6 +14,7 @@ from group.models import GroupInfo, GroupUserInfo
14 14
 from utils.error.errno_utils import GroupStatusCode, GroupUserStatusCode, UserStatusCode
15 15
 from utils.error.response_utils import response
16 16
 from utils.group_photo_utils import get_current_photos
17
+from utils.redis.connect import r
17 18
 from utils.redis.rgroup import get_group_info, get_group_users_info, get_group_users_kv_info, set_group_users_info
18 19
 from utils.redis.rkeys import (GROUP_LAST_PHOTO_PK, GROUP_USERS_DELETED_SET, GROUP_USERS_PASSED_SET,
19 20
                                GROUP_USERS_QUIT_SET, GROUP_USERS_REFUSED_SET, TOUR_GUIDE_GROUP_CUR_GATHER_INFO,
@@ -23,9 +24,6 @@ from utils.redis.rtourguide import get_tour_guide_own_group
23 24
 from utils.redis.rtouruser import set_tour_user_belong_group
24 25
 
25 26
 
26
-r = settings.REDIS_CACHE
27
-
28
-
29 27
 @logit(res=settings.LOGIT_RES_FLAG)
30 28
 def tgu_group_user_join_api(request):
31 29
     """ 旅行团成员加团 """

+ 1 - 1
group/views.py

@@ -20,6 +20,7 @@ from utils.error.errno_utils import GroupPhotoStatusCode, GroupStatusCode, Group
20 20
 from utils.error.response_utils import response
21 21
 from utils.group_photo_utils import get_current_photos
22 22
 from utils.page_utils import pagination
23
+from utils.redis.connect import r
23 24
 from utils.redis.rgroup import (del_group_photo_thumbup_flag, get_group_info, get_group_photo_comment_list,
24 25
                                 get_group_photo_data, get_group_photo_thumbup_flag, get_group_photo_thumbup_list,
25 26
                                 get_group_photo_watchers, get_group_users_info, set_group_info,
@@ -37,7 +38,6 @@ from utils.url_utils import img_url, share_url
37 38
 
38 39
 
39 40
 # db = records.Database(settings.DATABASE_URL['default'])
40
-r = settings.REDIS_CACHE
41 41
 
42 42
 
43 43
 @logit

+ 0 - 1
pay/views.py

@@ -20,7 +20,6 @@ from utils.redis.rbrief import set_brief_info
20 20
 from utils.redis.rorder import set_lensman_order_record
21 21
 
22 22
 
23
-r = settings.REDIS_CACHE
24 23
 WECHAT = settings.WECHAT
25 24
 
26 25
 

+ 1 - 3
photo/views.py

@@ -19,6 +19,7 @@ from photo.serializers import PhotosInfoSerializer
19 19
 from utils.error.errno_utils import LensmanStatusCode, PhotoStatusCode
20 20
 from utils.error.response_utils import response
21 21
 from utils.ip_utils import get_client_ip
22
+from utils.redis.connect import r
22 23
 from utils.redis.rgroup import get_group_info, set_group_info, set_group_users_info
23 24
 from utils.redis.rkeys import (GROUP_LAST_PHOTO_PK, GROUP_USERS_DELETED_SET, GROUP_USERS_PASSED_SET,
24 25
                                GROUP_USERS_QUIT_SET, GROUP_USERS_REFUSED_SET, UUID_LIST)
@@ -28,9 +29,6 @@ from utils.thumbnail_utils import make_thumbnail
28 29
 from utils.watermark_utils import watermark_wrap
29 30
 
30 31
 
31
-r = settings.REDIS_CACHE
32
-
33
-
34 32
 @logit
35 33
 def uuid_init(request):
36 34
     """ 生成唯一标识 """

+ 6 - 0
utils/redis/connect.py

@@ -0,0 +1,6 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from django.conf import settings
4
+
5
+
6
+r = settings.REDIS_CACHE

+ 1 - 5
utils/redis/rapp.py

@@ -2,15 +2,11 @@
2 2
 
3 3
 import json
4 4
 
5
-from django.conf import settings
6
-
7 5
 from operation.models import LatestAppInfo
6
+from utils.redis.connect import r
8 7
 from utils.redis.rkeys import LATEST_APP_INFO
9 8
 
10 9
 
11
-r = settings.REDIS_CACHE
12
-
13
-
14 10
 # 最新 APP 相关
15 11
 
16 12
 

+ 1 - 4
utils/redis/rbrief.py

@@ -1,15 +1,12 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-from django.conf import settings
4 3
 from isoweek import Week
5 4
 from TimeConvert import TimeConvert as tc
6 5
 
6
+from utils.redis.connect import r
7 7
 from utils.redis.rkeys import TODAY_INCOME, TOTAL_INCOME, WEEK_INCOME, WEEK_SOLD
8 8
 
9 9
 
10
-r = settings.REDIS_CACHE
11
-
12
-
13 10
 # 简报相关
14 11
 
15 12
 

+ 1 - 7
utils/redis/retrieve.py

@@ -1,18 +1,12 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-import json
4
-
5
-from django.conf import settings
6
-
7 3
 from group.models import GroupInfo, GroupPhotoInfo, GroupUserInfo, PhotoCommentInfo, PhotoThumbUpInfo
4
+from utils.redis.connect import r
8 5
 from utils.redis.rgroup import set_group_photo_data, set_group_users_info
9 6
 from utils.redis.rkeys import (GROUP_LAST_PHOTO_PK, GROUP_PHOTO_WATCHER_SET, GROUP_USERS_APPLYING_SET,
10 7
                                GROUP_USERS_DELETED_SET, GROUP_USERS_PASSED_SET, GROUP_USERS_REFUSED_SET)
11 8
 
12 9
 
13
-r = settings.REDIS_CACHE
14
-
15
-
16 10
 def retrieve_group_data():
17 11
     """ 群组数据 """
18 12
     groups = GroupInfo.objects.filter(status=True)

+ 1 - 3
utils/redis/rgroup.py

@@ -5,14 +5,12 @@ import json
5 5
 from django.conf import settings
6 6
 from django.core.serializers.json import DjangoJSONEncoder
7 7
 
8
+from utils.redis.connect import r
8 9
 from utils.redis.rkeys import (GROUP_INFO, GROUP_PHOTO_COMMENT_LIST, GROUP_PHOTO_DATA, GROUP_PHOTO_THUMB_UP,
9 10
                                GROUP_PHOTO_THUMB_UP_LIST, GROUP_PHOTO_WATCHER_SET, GROUP_USERS_INFO,
10 11
                                GROUP_USERS_KV_INFO)
11 12
 
12 13
 
13
-r = settings.REDIS_CACHE
14
-
15
-
16 14
 # 群组信息相关
17 15
 
18 16
 

+ 1 - 5
utils/redis/rguest.py

@@ -2,14 +2,10 @@
2 2
 
3 3
 import json
4 4
 
5
-from django.conf import settings
6
-
5
+from utils.redis.connect import r
7 6
 from utils.redis.rkeys import GUEST_ENTRANCE_CONTROL_INFO
8 7
 
9 8
 
10
-r = settings.REDIS_CACHE
11
-
12
-
13 9
 # 游客入口控制相关
14 10
 
15 11
 

+ 1 - 3
utils/redis/rmessage.py

@@ -5,12 +5,10 @@ import json
5 5
 from django.conf import settings
6 6
 
7 7
 from message.models import SystemMessageDeleteInfo, SystemMessageReadInfo
8
+from utils.redis.connect import r
8 9
 from utils.redis.rkeys import SYSTEM_MESSAGE_DELETED_INFO, SYSTEM_MESSAGE_READ_INFO
9 10
 
10 11
 
11
-r = settings.REDIS_CACHE
12
-
13
-
14 12
 # 系统消息相关
15 13
 
16 14
 

+ 1 - 3
utils/redis/rorder.py

@@ -5,12 +5,10 @@ import json
5 5
 from django.conf import settings
6 6
 from django.core.serializers.json import DjangoJSONEncoder
7 7
 
8
+from utils.redis.connect import r
8 9
 from utils.redis.rkeys import LENSMAN_PHOTO_ORDER_RECORD
9 10
 
10 11
 
11
-r = settings.REDIS_CACHE
12
-
13
-
14 12
 # 摄影师照片购买记录相关
15 13
 
16 14
 

+ 1 - 5
utils/redis/rprice.py

@@ -2,15 +2,11 @@
2 2
 
3 3
 import json
4 4
 
5
-from django.conf import settings
6
-
7 5
 from account.models import LensmanInfo
6
+from utils.redis.connect import r
8 7
 from utils.redis.rkeys import LENSMAN_PHOTO_PRICE_FIXED
9 8
 
10 9
 
11
-r = settings.REDIS_CACHE
12
-
13
-
14 10
 # 最新 APP 相关
15 11
 
16 12
 

+ 1 - 5
utils/redis/rprofile.py

@@ -2,14 +2,10 @@
2 2
 
3 3
 import json
4 4
 
5
-from django.conf import settings
6
-
5
+from utils.redis.connect import r
7 6
 from utils.redis.rkeys import PROFILE_INFO
8 7
 
9 8
 
10
-r = settings.REDIS_CACHE
11
-
12
-
13 9
 # 用户相关
14 10
 
15 11
 

+ 1 - 5
utils/redis/rsettings.py

@@ -2,15 +2,11 @@
2 2
 
3 3
 import json
4 4
 
5
-from django.conf import settings
6
-
7 5
 from pai2.basemodels import PlatformMixin
6
+from utils.redis.connect import r
8 7
 from utils.redis.rkeys import APP_SETTINGS_INFO
9 8
 
10 9
 
11
-r = settings.REDIS_CACHE
12
-
13
-
14 10
 def set_app_settings_info(appset):
15 11
     """ 设置 APP 设置信息 """
16 12
     r.set(APP_SETTINGS_INFO % (appset.platform, appset.channel, appset.version), json.dumps(appset.data))

+ 1 - 5
utils/redis/rtourguide.py

@@ -1,13 +1,9 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-from django.conf import settings
4
-
3
+from utils.redis.connect import r
5 4
 from utils.redis.rkeys import TOUR_GUIDE_GROUP_USER_OWN
6 5
 
7 6
 
8
-r = settings.REDIS_CACHE
9
-
10
-
11 7
 # 导游相关
12 8
 
13 9
 

+ 1 - 5
utils/redis/rtouruser.py

@@ -1,13 +1,9 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-from django.conf import settings
4
-
3
+from utils.redis.connect import r
5 4
 from utils.redis.rkeys import TOUR_GUIDE_GROUP_USER_BELONG
6 5
 
7 6
 
8
-r = settings.REDIS_CACHE
9
-
10
-
11 7
 # 旅行团成员相关
12 8
 
13 9
 

+ 1 - 4
utils/redis/ruuid.py

@@ -1,15 +1,12 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3 3
 from curtail_uuid import CurtailUUID
4
-from django.conf import settings
5 4
 
6 5
 from photo.models import UUIDInfo
6
+from utils.redis.connect import r
7 7
 from utils.redis.rkeys import UUID_LIST
8 8
 
9 9
 
10
-r = settings.REDIS_CACHE
11
-
12
-
13 10
 def generate_uuid():
14 11
     uuid = CurtailUUID.uuid(UUIDInfo)
15 12
     UUIDInfo.objects.create(uuid=uuid)

kodo - Gogs: Go Git Service

No Description

basic.html 8.8KB

    {% load staticfiles %} <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="format-detection" content="telephone=no,email=no,address=no"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <title>{% block title %}{% endblock %}</title> <link href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.2/pure-min.css" rel="stylesheet"> <link href="//cdnjs.cloudflare.com/ajax/libs/flexslider/2.6.3/flexslider.min.css" rel="stylesheet"> <link href="//res.wx.qq.com/open/libs/weui/0.4.3/weui.min.css" rel="stylesheet" type="text/css" /> <link href="{% static 'page/css/flexslider.ext.css' %}" rel="stylesheet" type="text/css" /> <link href="{% static 'page/css/weui.ext.css' %}" rel="stylesheet" type="text/css" /> {% block link %}{% endblock %} <style> body { font-family: Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif !important; background: #fff; } img { pointer-events: none; } .clickable { pointer-events: auto; } /* Input 自动填充后,移除 Chrome 默认黄色 */ input:-webkit-autofill { box-shadow: 0 0 0 1000px white inset !important; } .container { padding-bottom: 45px; } .text-center { text-align: center; } .empty { color: #999; padding: .9375rem 0; font-size: .625rem; } .text_ellipsis { overflow:hidden; white-space:nowrap; text-overflow: ellipsis; } .fl { float: left; } .fr { float: right; } .clearfix { zoom: 1; } .clearfix:after { content: "\200B"; display: block; height: 0; clear: both; } </style> {% block tohomecss %} <style> .tohome { width: 40px; height: 40px; background-color: rgba(139, 139, 139, 0.7); position: fixed; right: 10px; bottom: 20px; border-radius: 9999px; border-top-left-radius: 9999px; border-top-right-radius: 9999px; border-bottom-left-radius: 9999px; border-bottom-right-radius: 9999px; z-index: 99999999; } .tohome img { display: block; width: 18px; height: 13px; margin: 6px auto 2px; } .tohome p { color: #ffffff; } </style> {% endblock %} {% block css %}{% endblock %} <script> {% block rem %} //这段js的最后面有两个参数记得要设置,一个为设计稿实际宽度,一个为制作稿最大宽度,例如设计稿为750,最大宽度为750,则为(750,750) !function(e,t){function n(){var n=l.getBoundingClientRect().width;t=t||540,n>t&&(n=t);var i=100*n/e;r.innerHTML="html{font-size:"+i+"px;}"}var i,d=document,o=window,l=d.documentElement,r=document.createElement("style");if(l.firstElementChild)l.firstElementChild.appendChild(r);else{var a=d.createElement("div");a.appendChild(r),d.write(a.innerHTML),a=null}n(),o.addEventListener("resize",function(){clearTimeout(i),i=setTimeout(n,300)},!1),o.addEventListener("pageshow",function(e){e.persisted&&(clearTimeout(i),i=setTimeout(n,300))},!1),"complete"===d.readyState?d.body.style.fontSize="16px":d.addEventListener("DOMContentLoaded",function(e){d.body.style.fontSize="16px"},!1)}(750,750); {% endblock %} </script> </head> <body> {% block somehtml %}{% endblock %} <div class="container"> {% block container %}{% endblock %} {% block tohomehtml %} <div class="tohome"> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAMAAABzP0xhAAAAS1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////+DmQsHAAAAGHRSTlMAoHDw+q0VCufg187DuI+OgGJUSDwyKCBlxSbJAAAAi0lEQVQ4y+3SuRKEIBBFUaQbcd+X9/9fOpRDjaXQGJnNiW/SiwpkmXpiW6C16Sav4dR5qtlKHMpNbhaCR4vUTIwfnuKNxoWONR1uunB0g4Cxt9EbRDSXVewVoqr9bNYCgmJV3kwQ0fxtRkYCj8oZ8GBQqieHIWByev9DEPjfeisy+mDk6Dy9/kevRR9/MjHbEpIcQAAAAABJRU5ErkJggg=="> <p style="text-align:center;font-size:8px">回首页</p> </div> {% endblock %} </div> {% block somehtml2 %}{% endblock %} <script> window.onerror = function(errorMessage, scriptURI, lineNo, columnNo, error) { // 构建错误对象 var errorObj = { lineNo: lineNo || null, columnNo: columnNo || null, scriptURI: scriptURI || null, errorMessage: errorMessage || null, stack: error && error.stack ? error.stack : null }; // 构建Http请求 if (XMLHttpRequest) { var xhr = new XMLHttpRequest(); xhr.open('post', '/e/report', true); xhr.setRequestHeader('Content-Type', 'application/json'); // 设置请求头 xhr.send(JSON.stringify(errorObj)); // 发送参数 } } </script> {# <script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.1.6/zepto.min.js"></script>#} <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/flexslider/2.6.3/jquery.flexslider-min.js"></script> {% block script %}{% endblock %} <script> // History 压入本地连接 function pushHistory() { var state = { title: "title", url: "#" }; window.history.pushState(state, "title", "#"); } pushHistory(); // 延时监听 setTimeout(function () { // 监听``返回``、``后退``、``上一页`` window.addEventListener("popstate", function (e) { if (confirm("确认退出") == true) { window.history.back(-1); } else { pushHistory(); } }, false); }, 300); </script> <script> {% block glbjs %}{% endblock %} $(function() { /** 格式化输入字符串**/ //用法: "hello{0}".format('world');返回'hello world' String.prototype.format= function(){ var args = arguments; return this.replace(/\{(\d+)\}/g,function(s,i){ return args[i]; }); } {% block flexsliderjs %} // 轮播图 $('.flexslider').flexslider({ slideshowSpeed: 2000, pauseOnHover: true, controlNav: false, directionNav: false, }); {% endblock %} {% block tohomejs %} // 返回首页 $('.tohome').click(function () { window.location.href = '{{ domain }}/page/nav?{{ params|safe }}' }) {% endblock %} {% block js %}{% endblock %} }); </script> <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script type="text/javascript" src="{% static 'machine/js/jswe-1.0.0.js' %}"></script> <script> {# V.initWxData({#} {# imgUrl: '{{ domain }}{% static 'page/img/logo.jpg' %}',#} {# link: 'http://hpsgift.hphcclub.com/we/ws',#} {# desc: '惠普销售红包系统',#} {# title: '惠普销售红包系统',#} {# timeLine: ''#} {# }, true);#} V.hideOptionMenu(); {% block jswe %}{% endblock %} </script> {% block scriptag %}{% endblock %} </body> </html>