rabin 7 éve
szülő
commit
1f425b19c4

+ 31 - 3
admin/page/farm.py

@@ -88,8 +88,8 @@ class user_path(Load):
 			,width = '600'
 			,height = '400'
 			,search = (('label-1','cdate-time-start','cdate-time-end','farm_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间','选择农场',u'用户名称'))
-			,thead = (u'所属农场', u'用户名称', u'微信openid', u'用户手机号', u'更新时间')
-			,tbody = ('farm','username','openid', 'mobile', 'cdate')
+			,thead = (u'所属农场', u'用户名称', u'绑定列表', u'用户手机号', u'更新时间')
+			,tbody = ('farm','username','wechat', 'mobile', 'cdate')
 			,state = True
 		)
 
@@ -100,6 +100,8 @@ class user_path(Load):
 			for key, value in enumerate(self.data['list']):
 				farm = self.service('common').one('farm', id=value['farm_id'])
 				self.data['list'][key]['farm'] = farm['name']
+				param = '?farm=' + id + '&search_uid-input-=' + value['id']
+				self.data['list'][key]['wechat'] = '<a href="/farm/user_wechat'+param+'">点此查看</a>'
 		self.commonView('list')
 
 class user_update_path(Load):
@@ -121,4 +123,30 @@ class user_update_path(Load):
 	@Web.auth
 	@Web.setting
 	def delete(self):
-		self.commonDelete('farm_user')
+		self.commonDelete('farm_user')
+
+class user_wechat_path(Load):
+	@Web.auth
+	@Web.setting
+	def get(self):
+		self.common(
+			name = u'微信绑定列表'
+			,path = '/farm/user_wechat'
+			,width = '600'
+			,height = '400'
+			,add = False,
+			,edit = False,
+			,search = (('label-1','cdate-time-start','cdate-time-end','farm_id-select-','uid-input-'), (u'日期范围',u'开始时间',u'截止时间','选择农场',u'用户id'))
+			,thead = (u'所属农场', u'用户id', u'微信openid', u'更新时间')
+			,tbody = ('farm','uid','openid', 'cdate')
+			,state = True
+		)
+
+		self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
+
+		self.commonList('farm_user_wechat')
+		if self.data['list']:
+			for key, value in enumerate(self.data['list']):
+				farm = self.service('common').one('farm', id=value['farm_id'])
+				self.data['list'][key]['farm'] = farm['name']
+		self.commonView('list')

+ 2 - 1
admin/page/upload.py

@@ -35,7 +35,8 @@ class upload_path(Load):
 			#裁图类型,暂时居中裁图
 			file_path = cropImage(file_path)
 		#self.out('yes', {'src':url + file_path.replace(Demeter.path + 'runtime', '')})
-		self.write({'state':True,'file_path':url + file_path.replace(Demeter.path + 'runtime', '')})
+		file = url + file_path.replace(Demeter.path + 'runtime', '')
+		self.write({'state':True,'file_path':file, 'src':file})
 
 def cropImage(file):
 	img = Image.open(file)

+ 4 - 0
front/api/login.py

@@ -64,4 +64,8 @@ class login_path(Load):
 		update['openid'] = data['openid']
 		update['session_key'] = data['session_key']
 		self.service('common').update('farm_user', uid, update)
+		wechat = self.service('common').one('farm_user_wechat', uid=uid, openid=update['openid'])
+		if not wechat:
+			update['uid'] = uid
+			self.service('common').update('farm_user_wechat', False, update)
 		return True

+ 8 - 0
web/page/main.py

@@ -10,6 +10,14 @@ from __load__ import *
 class index_path(Load):
 	@Web.setting
 	def get(self):
+		# 获取焦点图
+		self.data['focus'] = self.service('common').list('web_article', search={'category_id':5})
+		if self.data['focus']:
+			for key, value in enumerate(self.data['focus']):
+				self.data['focus'][key]['link'] = 'javascript:;'
+				if value['link']:
+					self.data['focus'][key]['link'] = value['link']
+
 		# 获取产品功能
 		self.data['function'] = self.service('common').list('web_article', search={'category_id':3})
 		if self.data['function']:

+ 2 - 1
web/static/css/detail.css

@@ -1 +1,2 @@
-.article{background:#fff;padding:50px 50px 25px}.article h1{font-size:28px;font-weight:400;margin-bottom:25px}.article .banner{padding-bottom:30px;margin-bottom:25px;border-bottom:1px solid #eee}.article .banner img{display:block}.article p{margin-bottom:25px;text-indent:2em}.article .img{margin-bottom:25px;text-align:center}.article .img img{display:block;margin:0 auto}
+.article{background:#fff;padding:50px 50px 25px}.article h1{font-size:28px;font-weight:400;margin-bottom:25px}.article .banner{padding-bottom:30px;margin-bottom:25px;border-bottom:1px solid #eee}.article .banner img{display:block}.article p{margin-bottom:25px;text-indent:2em}.article .img{margin-bottom:25px;text-align:center}.article .img img{display:block;margin:0 auto}
+/*# sourceMappingURL=detail.css.map*/

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
web/static/css/global.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
web/static/css/index.css


+ 2 - 1
web/static/css/list.css

@@ -1 +1,2 @@
-.card{display:block;padding:30px;margin-bottom:11px;background-color:#fff}.card p{text-align:center;color:#333;font-size:20px;padding-top:10px}
+.card{display:block;padding:30px;margin-bottom:11px;background-color:#fff}.card p{text-align:center;color:#333;font-size:20px;padding-top:10px}
+/*# sourceMappingURL=list.css.map*/

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
web/static/detail.html


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
web/static/index.html


+ 2 - 1
web/static/js/detail.js

@@ -1 +1,2 @@
-webpackJsonp([2],{13:function(n,t,c){n.exports=c(2)},2:function(n,t,c){"use strict";c(0),c(9)},9:function(n,t){}},[13]);
+webpackJsonp([2],{10:function(n,t){},14:function(n,t,c){n.exports=c(2)},2:function(n,t,c){"use strict";c(0),c(10)}},[14]);
+//# sourceMappingURL=detail.js.map

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
web/static/js/global.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
web/static/js/index.js


+ 2 - 1
web/static/js/list.js

@@ -1 +1,2 @@
-webpackJsonp([1],{11:function(n,t){},16:function(n,t,i){n.exports=i(4)},4:function(n,t,i){"use strict";i(0),i(11);var s=i(1);s(".list ul").css("min-height",s(".menu").height()+45)}},[16]);
+webpackJsonp([1],{12:function(n,t){},17:function(n,t,i){n.exports=i(4)},4:function(n,t,i){"use strict";i(0),i(12);var s=i(1);s(".list ul").css("min-height",s(".menu").height()+45)}},[17]);
+//# sourceMappingURL=list.js.map

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
web/static/list.html


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
web/templates/inc/menu.html


+ 5 - 21
web/templates/index.html

@@ -10,14 +10,11 @@
     <div class="wrapper">
         <div class="swiper-container">
             <div class="swiper-wrapper">
-                <div class="swiper-slide">
-                    <video id="player-1" loop="loop" width="1000" height="450" class="player video-js vjs-default-skin vjs-big-play-centered" controls>
-                      <source
-                         src="{{data['setting']['web']['video']}}"
-                         type="video/mp4">
-                    </video>   
-                </div>
+                {% for v in data['focus'] %}
+                <div class="swiper-slide"><a href="{{v['link']}}"><img src="{{v['pic']}}" width="100%"><i class="btn-play"></i></a></div>
+                {% end %}
             </div>
+            <div class="swiper-pagination"></div>
         </div>
         {% if data['function'] %}
         <div class="block product">
@@ -52,19 +49,6 @@
     </div>
     {%include 'inc/footer.html'%}
     {%include 'inc/script.html'%}
-    <script type="text/javascript" src="{{static_url('lib/player/video.min.js')}}"></script>
-    <script type="text/javascript" src="{{static_url('lib/player/videojs-contrib-hls.min.js')}}"></script>
-    <script>
-    $(".player").each(function()
-    {
-        var self = $(this);
-        var id = self.attr('id');
-        var url = self.attr('data-url');
-        var player = videojs(id, { fluid: false }, function()
-        {
-            //this.play();
-        });
-    });
-    </script>
+    <script type="text/javascript" src="{{static_url('js/index.js')}}"></script>
     </body>
 </html>

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott