+    coupon_limit_model_ids = JSONField(_(u'coupon_limit_model_ids'), blank=True, null=True, help_text=u'券限制使用 model_ids')
64 64
 
65 65
     has_used = models.BooleanField(_(u'has_used'), default=False, help_text=u'是否已核销', db_index=True)
66 66
     admin_id = models.CharField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'核销员唯一标识', db_index=True)
@@ -82,6 +82,18 @@ class UserCouponInfo(BaseModelMixin):
82 82
         return upload_file_url(self.coupon_image)
83 83
 
84 84
     @property
85
+    def has_actived(self):
86
+        if not self.active_at:
87
+            return True
88
+        return tc.utc_datetime() > self.active_at
89
+
90
+    @property
91
+    def has_expired(self):
92
+        if not self.expire_at:
93
+            return False
94
+        return tc.utc_datetime() > self.expire_at
95
+
96
+    @property
85 97
     def data(self):
86 98
         return {
87 99
             'user_coupon_id': self.user_coupon_id,
@@ -94,7 +106,9 @@ class UserCouponInfo(BaseModelMixin):
94 106
             'active_at': tc.local_string(self.active_at, format='%Y%m%d'),
95 107
             'expire_at': tc.local_string(self.expire_at, format='%Y-%m-%d'),
96 108
             'coupon_valid_period': self.coupon_valid_period,
97
-            'coupon_limit_brand_ids': self.coupon_limit_brand_ids,
109
+            'coupon_limit_model_ids': self.coupon_limit_model_ids,
110
+            'has_actived': self.has_actived,
111
+            'has_expired': self.has_expired,
98 112
             'has_used': self.has_used,
99 113
             'admin_id': self.admin_id,
100 114
             'used_at': self.used_at,

+ 9 - 0
utils/error/errno_utils.py

@@ -81,6 +81,15 @@ class MemberActivityStatusCode(BaseStatusCode):
81 81
     ACTIVITY_NOT_FOUND = StatusCodeField(503701, 'Activity Not Found', description=u'活动不存在')
82 82
 
83 83
 
84
+class MemberCouponStatusCode(BaseStatusCode):
85
+    """ 会员优惠券相关错误码 5040xx """
86
+    USER_COUPON_NOT_FOUND = StatusCodeField(504001, 'User Coupon Not Found', description=u'用户优惠券不存在')
87
+
88
+    USER_COUPON_HAS_USED = StatusCodeField(504010, 'User Coupon Has Used', description=u'用户优惠券已使用')
89
+    USER_COUPON_NOT_ACTIVED = StatusCodeField(504011, 'User Coupon Not Actived', description=u'用户优惠券未生效')
90
+    USER_COUPON_HAS_EXPIRED = StatusCodeField(504012, 'User Coupon Has Expired', description=u'用户优惠券已过期')
91
+
92
+
84 93
 class LensmanStatusCode(BaseStatusCode):
85 94
     """ 摄影师相关错误码 4000xx """
86 95
     LENSMAN_NOT_FOUND = StatusCodeField(400001, 'Lensman Not Found', description=u'摄影师不存在')

+ 1 - 1
utils/redis/rshot.py

@@ -6,7 +6,7 @@ from utils.redis.rkeys import MEMBER_SHOT_DATA
6 6
 
7 7
 def update_member_shot_data():
8 8
     from member.models import ShotTypeInfo
9
-    shots_types = ShotTypeInfo.objects.filter(status=True).order_by('position')
9
+    shots_types = ShotTypeInfo.objects.filter(status=True).order_by('position', '-pk')
10 10
     shots_types = [st.data for st in shots_types]
11 11
     r.setjson(MEMBER_SHOT_DATA, shots_types)
12 12
     return shots_types

kodo - Gogs: Go Git Service

Nessuna descrizione

basic_pc.html 6.2KB

    {% 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="{% static 'page/css/flexslider.ext.css' %}" rel="stylesheet" type="text/css" /> {% block link %}{% endblock %} <style> img { pointer-events: none; } body { font-family: Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif !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; } </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)}(1920,1920); {% 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 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> {% 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> </body> </html>