|
92
|
+ verbose_name_plural = _(u'会员权益信息')
|
|
|
93
|
+
|
|
|
94
|
+ def __unicode__(self):
|
|
|
95
|
+ return unicode(self.pk)
|
|
|
96
|
+
|
|
|
97
|
+ @property
|
|
|
98
|
+ def icon_path(self):
|
|
|
99
|
+ return upload_file_path(self.icon)
|
|
|
100
|
+
|
|
|
101
|
+ @property
|
|
|
102
|
+ def icon_url(self):
|
|
|
103
|
+ return upload_file_url(self.icon)
|
|
|
104
|
+
|
|
|
105
|
+ @property
|
|
|
106
|
+ def data(self):
|
|
|
107
|
+ return {
|
|
|
108
|
+ 'right_id': self.right_id,
|
|
|
109
|
+ 'icon': self.icon_url,
|
|
|
110
|
+ 'title': self.title,
|
|
|
111
|
+ 'subtitle': self.subtitle,
|
|
|
112
|
+ 'detail': self.detail,
|
|
|
113
|
+ 'minlevel': self.minlevel,
|
|
|
114
|
+ "able": True,
|
|
|
115
|
+ "left_num": 3,
|
|
|
116
|
+ "left_tip": 3,
|
|
|
117
|
+ }
|
|
|
118
|
+
|
|
|
119
|
+
|
|
|
120
|
+class ShotTypeInfo(BaseModelMixin):
|
|
|
121
|
+ shot_type_id = ShortUUIDField(_(u'shot_type_id'), max_length=32, blank=True, null=True, help_text=u'镜头类型唯一标识', db_index=True, unique=True)
|
|
|
122
|
+ shot_type_name = models.CharField(_(u'shot_type_name'), max_length=255, blank=True, null=True, help_text=u'镜头类型名称')
|
|
|
123
|
+
|
|
|
124
|
+ position = models.IntegerField(_(u'position'), default=1, help_text=u'排序', db_index=True)
|
|
|
125
|
+
|
|
|
126
|
+ class Meta:
|
|
|
127
|
+ verbose_name = _(u'镜头类型信息')
|
|
|
128
|
+ verbose_name_plural = _(u'镜头类型信息')
|
|
|
129
|
+
|
|
|
130
|
+ def __unicode__(self):
|
|
|
131
|
+ return unicode(self.pk)
|
|
|
132
|
+
|
|
|
133
|
+ @property
|
|
|
134
|
+ def shots(self):
|
|
|
135
|
+ models = ModelInfo.objects.filter(shot_type_id=self.shot_type_id, status=True)
|
|
|
136
|
+ return [model.shot_data for model in models]
|
|
|
137
|
+
|
|
|
138
|
+ @property
|
|
|
139
|
+ def data(self):
|
|
|
140
|
+ return {
|
|
|
141
|
+ 'type_id': self.shot_type_id,
|
|
|
142
|
+ 'type_name': self.shot_type_name,
|
|
|
143
|
+ 'shots': self.shots,
|
|
|
144
|
+ }
|
|
|
145
|
+
|
|
|
146
|
+
|
|
|
147
|
+class MemberActivityInfo(BaseModelMixin):
|
|
|
148
|
+ title = models.CharField(_(u'title'), max_length=255, blank=True, null=True, help_text=u'活动名称')
|
|
|
149
|
+ subtitle = models.CharField(_(u'subtitle'), max_length=255, blank=True, null=True, help_text=u'活动二级名称')
|
|
|
150
|
+
|
|
|
151
|
+ date = models.DateField(_(u'date'), blank=True, null=True, help_text=u'活动时间')
|
|
|
152
|
+ location = models.CharField(_(u'location'), max_length=255, blank=True, null=True, help_text=u'活动地点')
|
|
|
153
|
+
|
|
|
154
|
+ image = models.ImageField(_(u'image'), upload_to=upload_path, blank=True, null=True, help_text=u'活动内容图片')
|
|
|
155
|
+
|
|
|
156
|
+ cover = models.ImageField(_(u'cover'), upload_to=upload_path, blank=True, null=True, help_text=u'活动列表图片')
|
|
|
157
|
+
|
|
|
158
|
+ is_slider = models.BooleanField(_(u'is_slider'), default=True, help_text=_(u'是否为轮播活动'), db_index=True)
|
|
|
159
|
+ slider_image = models.ImageField(_(u'slider_image'), upload_to=upload_path, blank=True, null=True, help_text=u'活动轮播图片')
|
|
|
160
|
+
|
|
|
161
|
+ content_rich_text = RichTextField(_(u'content_rich_text'), blank=True, null=True, help_text=u'活动描述')
|
|
|
162
|
+
|
|
|
163
|
+ share_img_link = models.CharField(_(u'share_img_link'), max_length=255, blank=True, null=True, help_text=u'活动图片分享')
|
|
|
164
|
+ share_h5_link = models.CharField(_(u'share_h5_link'), max_length=255, blank=True, null=True, help_text=u'活动H5分享')
|
|
|
165
|
+
|
|
|
166
|
+ position = models.IntegerField(_(u'position'), default=1, help_text=u'排序', db_index=True)
|
|
|
167
|
+
|
|
|
168
|
+ class Meta:
|
|
|
169
|
+ verbose_name = _(u'会员活动信息')
|
|
|
170
|
+ verbose_name_plural = _(u'会员活动信息')
|
|
|
171
|
+
|
|
|
172
|
+ def __unicode__(self):
|
|
|
173
|
+ return unicode(self.pk)
|
|
|
174
|
+
|
|
|
175
|
+ @property
|
|
|
176
|
+ def image_path(self):
|
|
|
177
|
+ return upload_file_path(self.image)
|
|
|
178
|
+
|
|
|
179
|
+ @property
|
|
|
180
|
+ def image_url(self):
|
|
|
181
|
+ return upload_file_url(self.image)
|
|
|
182
|
+
|
|
|
183
|
+ @property
|
|
|
184
|
+ def cover_path(self):
|
|
|
185
|
+ return upload_file_path(self.cover)
|
|
|
186
|
+
|
|
|
187
|
+ @property
|
|
|
188
|
+ def cover_url(self):
|
|
|
189
|
+ return upload_file_url(self.cover)
|
|
|
190
|
+
|
|
|
191
|
+ @property
|
|
|
192
|
+ def slider_image_path(self):
|
|
|
193
|
+ return upload_file_path(self.slider_image)
|
|
|
194
|
+
|
|
|
195
|
+ @property
|
|
|
196
|
+ def slider_image_url(self):
|
|
|
197
|
+ return upload_file_url(self.slider_image)
|
|
|
198
|
+
|
|
|
199
|
+ @property
|
|
|
200
|
+ def data(self):
|
|
|
201
|
+ return {
|
|
|
202
|
+ 'id': self.pk,
|
|
|
203
|
+ 'title': self.title,
|
|
|
204
|
+ 'subtitle': self.subtitle,
|
|
|
205
|
+ 'date': self.date,
|
|
|
206
|
+ 'location': self.location,
|
|
|
207
|
+ 'cover_url': self.cover_url,
|
|
|
208
|
+ 'content_rich_text': self.content_rich_text,
|
|
|
209
|
+ 'state': 0,
|
|
|
210
|
+ 'is_signed': 0,
|
|
|
211
|
+ }
|
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+# -*- coding: utf-8 -*-
|
|
|
2
|
+from __future__ import unicode_literals
|
|
|
3
|
+
|
|
|
4
|
+from django.test import TestCase
|
|
|
5
|
+
|
|
|
6
|
+
|
|
|
7
|
+# Create your tests here.
|
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+# -*- coding: utf-8 -*-
|
|
|
2
|
+from __future__ import unicode_literals
|
|
|
3
|
+
|
|
|
4
|
+from django.shortcuts import render
|
|
|
5
|
+
|
|
|
6
|
+
|
|
|
7
|
+# Create your views here.
|
|
|
|
@@ -2,11 +2,11 @@
|
|
2
|
2
|
|
|
3
|
3
|
from __future__ import division
|
|
4
|
4
|
|
|
|
5
|
+import xlrd
|
|
5
|
6
|
from django.conf import settings
|
|
6
|
7
|
from pysnippets.strsnippets import strip
|
|
7
|
8
|
from TimeConvert import TimeConvert as tc
|
|
8
|
9
|
|
|
9
|
|
-import xlrd
|
|
10
|
10
|
from mch.models import BrandInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, ModelInfo
|
|
11
|
11
|
from statistic.models import (ConsumeDistributorSaleStatisticInfo, ConsumeModelSaleStatisticInfo,
|
|
12
|
12
|
ConsumeProvinceSaleStatisticInfo, ConsumeSaleStatisticInfo, ConsumeUserStatisticInfo,
|
|
|
|
@@ -1,15 +1,15 @@
|
|
1
|
1
|
CodeConvert==2.0.5
|
|
2
|
|
-MySQL-python==1.2.5
|
|
3
|
2
|
Pillow==5.0.0
|
|
4
|
3
|
StatusCode==1.0.0
|
|
5
|
4
|
TimeConvert==1.5.0
|
|
6
|
|
-furl==2.0.0
|
|
|
5
|
+furl==2.1.0
|
|
7
|
6
|
isoweek==1.3.3
|
|
8
|
7
|
jsonfield==2.0.2
|
|
9
|
8
|
mock==2.0.0
|
|
10
|
9
|
monetary==1.0.3
|
|
11
|
|
-pysnippets==1.0.8
|
|
12
|
|
-qiniu==7.2.2
|
|
|
10
|
+mysqlclient==1.4.5
|
|
|
11
|
+pysnippets==1.1.2
|
|
|
12
|
+qiniu==7.2.6
|
|
13
|
13
|
requests==2.21.0
|
|
14
|
14
|
rlog==0.3
|
|
15
|
15
|
rsa==3.4.2
|
|
|
|
@@ -1,20 +1,20 @@
|
|
1
|
|
-Django==1.11.25
|
|
|
1
|
+Django==1.11.26
|
|
2
|
2
|
django-admin==2.0.0
|
|
3
|
|
-django-cors-headers==2.4.0
|
|
|
3
|
+django-cors-headers==3.0.2
|
|
4
|
4
|
django-curtail-uuid==1.0.4
|
|
5
|
|
-django-detect==1.0.8
|
|
|
5
|
+django-detect==1.0.16
|
|
6
|
6
|
django-file-md5==1.0.3
|
|
7
|
7
|
django-file-upload==1.1.1
|
|
8
|
8
|
django-ip==1.0.2
|
|
9
|
|
-django-json-render==1.0.2
|
|
|
9
|
+django-json-render==1.0.3
|
|
10
|
10
|
django-json-response==1.1.5
|
|
11
|
11
|
django-logit==1.1.3
|
|
12
|
12
|
django-mobi==0.1.7
|
|
13
|
13
|
django-models-ext==1.1.9
|
|
14
|
14
|
django-multidomain==1.1.4
|
|
15
|
15
|
django-paginator2==1.1.3
|
|
16
|
|
-django-query==1.0.3
|
|
17
|
|
-django-redis-connector==1.0.1
|
|
|
16
|
+django-query==1.0.6
|
|
|
17
|
+django-redis-connector==1.0.3
|
|
18
|
18
|
django-response==1.1.1
|
|
19
|
19
|
django-rlog==1.0.7
|
|
20
|
20
|
django-shortuuidfield==0.1.3
|
|
|
|
@@ -4,7 +4,7 @@ pywe-jssdk==1.1.0
|
|
4
|
4
|
pywe-membercard==1.0.1
|
|
5
|
5
|
pywe-miniapp==1.1.5
|
|
6
|
6
|
pywe-oauth==1.0.7
|
|
7
|
|
-pywe-pay==1.0.12
|
|
|
7
|
+pywe-pay==1.0.13
|
|
8
|
8
|
pywe-pay-notify==1.0.4
|
|
9
|
9
|
pywe-response==1.0.1
|
|
10
|
10
|
pywe-sign==1.1.0
|
|
|
|
@@ -1,3 +1,3 @@
|
|
1
|
|
-hiredis==1.0.0
|
|
|
1
|
+hiredis==1.0.1
|
|
2
|
2
|
redis==2.10.6
|
|
3
|
3
|
redis-extensions==1.2.5
|
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+# -- coding: utf-8 --
|
|
|
2
|
+"""simditor fields."""
|
|
|
3
|
+from django import forms
|
|
|
4
|
+from django.db import models
|
|
|
5
|
+
|
|
|
6
|
+from .widgets import SimditorWidget
|
|
|
7
|
+
|
|
|
8
|
+
|
|
|
9
|
+class RichTextFormField(forms.fields.CharField):
|
|
|
10
|
+ """RichTextFormField."""
|
|
|
11
|
+
|
|
|
12
|
+ def __init__(self, *args, **kwargs):
|
|
|
13
|
+ kwargs.update(
|
|
|
14
|
+ {
|
|
|
15
|
+ 'widget': SimditorWidget()
|
|
|
16
|
+ }
|
|
|
17
|
+ )
|
|
|
18
|
+ super(RichTextFormField, self).__init__(*args, **kwargs)
|
|
|
19
|
+
|
|
|
20
|
+
|
|
|
21
|
+class RichTextField(models.TextField):
|
|
|
22
|
+ """RichTextField."""
|
|
|
23
|
+
|
|
|
24
|
+ def __init__(self, *args, **kwargs):
|
|
|
25
|
+ super(RichTextField, self).__init__(*args, **kwargs)
|
|
|
26
|
+
|
|
|
27
|
+ def formfield(self, **kwargs):
|
|
|
28
|
+ defaults = {
|
|
|
29
|
+ 'form_class': self._get_form_class()
|
|
|
30
|
+ }
|
|
|
31
|
+ defaults.update(kwargs)
|
|
|
32
|
+ return super(RichTextField, self).formfield(**defaults)
|
|
|
33
|
+
|
|
|
34
|
+ @staticmethod
|
|
|
35
|
+ def _get_form_class():
|
|
|
36
|
+ return RichTextFormField
|
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+# -- coding: utf-8 --
|
|
|
2
|
+"""simditor image pillow_backend."""
|
|
|
3
|
+from __future__ import absolute_import
|
|
|
4
|
+
|
|
|
5
|
+from simditor import utils
|
|
|
6
|
+
|
|
|
7
|
+
|
|
|
8
|
+def image_verify(file_object):
|
|
|
9
|
+ """image_verify."""
|
|
|
10
|
+ if not utils.is_valid_image_extension(file_object.name):
|
|
|
11
|
+ raise utils.NotAnImageException
|
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+# -- coding: utf-8 --
|
|
|
2
|
+"""simditor image pillow_backend."""
|
|
|
3
|
+from __future__ import absolute_import
|
|
|
4
|
+
|
|
|
5
|
+import os
|
|
|
6
|
+from io import BytesIO
|
|
|
7
|
+
|
|
|
8
|
+from django.core.files.storage import default_storage
|
|
|
9
|
+from django.core.files.uploadedfile import InMemoryUploadedFile
|
|
|
10
|
+
|
|
|
11
|
+from simditor import utils
|
|
|
12
|
+
|
|
|
13
|
+
|
|
|
14
|
+try:
|
|
|
15
|
+ from PIL import Image, ImageOps
|
|
|
16
|
+except ImportError:
|
|
|
17
|
+ import Image
|
|
|
18
|
+ import ImageOps
|
|
|
19
|
+
|
|
|
20
|
+
|
|
|
21
|
+THUMBNAIL_SIZE = (75, 75)
|
|
|
22
|
+
|
|
|
23
|
+
|
|
|
24
|
+def image_verify(f):
|
|
|
25
|
+ try:
|
|
|
26
|
+ Image.open(f).verify()
|
|
|
27
|
+ except IOError:
|
|
|
28
|
+ raise utils.NotAnImageException
|
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+# -- coding: utf-8 --
|
|
|
2
|
+"""simditor image_processing."""
|
|
|
3
|
+from __future__ import absolute_import
|
|
|
4
|
+
|
|
|
5
|
+from django.conf import settings
|
|
|
6
|
+
|
|
|
7
|
+
|
|
|
8
|
+def get_backend():
|
|
|
9
|
+ """Get backend."""
|
|
|
10
|
+ backend = getattr(settings, 'SIMDITOR_IMAGE_BACKEND', None)
|
|
|
11
|
+
|
|
|
12
|
+ if backend == 'pillow':
|
|
|
13
|
+ from simditor.image import pillow_backend as backend
|
|
|
14
|
+ else:
|
|
|
15
|
+ from simditor.image import dummy_backend as backend
|
|
|
16
|
+ return backend
|
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+<?xml version="1.0" standalone="no"?>
|
|
|
2
|
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
|
|
3
|
+<svg xmlns="http://www.w3.org/2000/svg">
|
|
|
4
|
+<metadata>Generated by IcoMoon</metadata>
|
|
|
5
|
+<defs>
|
|
|
6
|
+<font id="icomoon" horiz-adv-x="512">
|
|
|
7
|
+<font-face units-per-em="512" ascent="480" descent="-32" />
|
|
|
8
|
+<missing-glyph horiz-adv-x="512" />
|
|
|
9
|
+<glyph unicode=" " d="" horiz-adv-x="256" />
|
|
|
10
|
+<glyph unicode="" d="M438.624 86.624l-73.376 73.376-45.248-45.248 73.376-73.376-73.376-73.376h192v192zM192 480h-192v-192l73.376 73.376 72.688-72.624 45.248 45.248-72.688 72.624zM192 114.752l-45.248 45.248-73.376-73.376-73.376 73.376v-192h192l-73.376 73.376zM512 480h-192l73.376-73.376-72.688-72.624 45.248-45.248 72.688 72.624 73.376-73.376z" />
|
|
|
11
|
+</font></defs></svg>
|
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+{
|
|
|
2
|
+ "IcoMoonType": "selection",
|
|
|
3
|
+ "icons": [
|
|
|
4
|
+ {
|
|
|
5
|
+ "icon": {
|
|
|
6
|
+ "paths": [
|
|
|
7
|
+ "M877.248 786.752l-146.752-146.752-90.496 90.496 146.752 146.752-146.752 146.752h384v-384zM384 0h-384v384l146.752-146.752 145.376 145.248 90.496-90.496-145.376-145.248zM384 730.496l-90.496-90.496-146.752 146.752-146.752-146.752v384h384l-146.752-146.752zM1024 0h-384l146.752 146.752-145.376 145.248 90.496 90.496 145.376-145.248 146.752 146.752z"
|
|
|
8
|
+ ],
|
|
|
9
|
+ "tags": [
|
|
|
10
|
+ "fullscreen",
|
|
|
11
|
+ "expand"
|
|
|
12
|
+ ],
|
|
|
13
|
+ "grid": 16,
|
|
|
14
|
+ "attrs": []
|
|
|
15
|
+ },
|
|
|
16
|
+ "attrs": [],
|
|
|
17
|
+ "properties": {
|
|
|
18
|
+ "id": 99,
|
|
|
19
|
+ "order": 2,
|
|
|
20
|
+ "prevSize": 16,
|
|
|
21
|
+ "code": 58880,
|
|
|
22
|
+ "name": "fullscreen"
|
|
|
23
|
+ },
|
|
|
24
|
+ "setIdx": 1,
|
|
|
25
|
+ "setId": 6,
|
|
|
26
|
+ "iconIdx": 99
|
|
|
27
|
+ }
|
|
|
28
|
+ ],
|
|
|
29
|
+ "height": 1024,
|
|
|
30
|
+ "metadata": {
|
|
|
31
|
+ "name": "icomoon"
|
|
|
32
|
+ },
|
|
|
33
|
+ "preferences": {
|
|
|
34
|
+ "fontPref": {
|
|
|
35
|
+ "prefix": "icon-",
|
|
|
36
|
+ "metadata": {
|
|
|
37
|
+ "fontFamily": "icomoon",
|
|
|
38
|
+ "majorVersion": 1,
|
|
|
39
|
+ "minorVersion": 0
|
|
|
40
|
+ },
|
|
|
41
|
+ "showGlyphs": true,
|
|
|
42
|
+ "metrics": {
|
|
|
43
|
+ "emSize": 512,
|
|
|
44
|
+ "baseline": 6.25,
|
|
|
45
|
+ "whitespace": 50
|
|
|
46
|
+ },
|
|
|
47
|
+ "resetPoint": 58880,
|
|
|
48
|
+ "showQuickUse": true,
|
|
|
49
|
+ "quickUsageToken": false,
|
|
|
50
|
+ "showMetrics": false,
|
|
|
51
|
+ "showMetadata": false,
|
|
|
52
|
+ "autoHost": true,
|
|
|
53
|
+ "embed": false,
|
|
|
54
|
+ "ie7": false,
|
|
|
55
|
+ "showSelector": false,
|
|
|
56
|
+ "showVersion": true
|
|
|
57
|
+ },
|
|
|
58
|
+ "imagePref": {
|
|
|
59
|
+ "color": 0,
|
|
|
60
|
+ "height": 32,
|
|
|
61
|
+ "columns": 16,
|
|
|
62
|
+ "margin": 16,
|
|
|
63
|
+ "png": false,
|
|
|
64
|
+ "sprites": true,
|
|
|
65
|
+ "prefix": "icon-"
|
|
|
66
|
+ },
|
|
|
67
|
+ "historySize": 100,
|
|
|
68
|
+ "showCodes": true,
|
|
|
69
|
+ "gridSize": 16,
|
|
|
70
|
+ "showLiga": false,
|
|
|
71
|
+ "showGrid": true,
|
|
|
72
|
+ "showGlyphs": true,
|
|
|
73
|
+ "showQuickUse": true,
|
|
|
74
|
+ "search": "",
|
|
|
75
|
+ "quickUsageToken": {
|
|
|
76
|
+ "UntitledProject1": "ZWEwOTk2NTRmNjMyOGQ1MzAwZWFiYmJlODViMWMzZDcjMiMxNDA3NzM0MTA2IyMj"
|
|
|
77
|
+ },
|
|
|
78
|
+ "showQuickUse2": true,
|
|
|
79
|
+ "showSVGs": true,
|
|
|
80
|
+ "fontHostingName": false
|
|
|
81
|
+ }
|
|
|
82
|
+}
|