rabin 6 years ago
parent
commit
731616f761
58 changed files with 1031 additions and 0 deletions
  1. 11 0
      web.py
  2. 6 0
      web/__init__.py
  3. 10 0
      web/main.py
  4. 14 0
      web/page/__init__.py
  5. 35 0
      web/page/__load__.py
  6. 30 0
      web/page/article.py
  7. 27 0
      web/page/main.py
  8. 119 0
      web/page/origin.py
  9. 18 0
      web/page/us.py
  10. 1 0
      web/static/css/detail.css
  11. 0 0
      web/static/css/global.css
  12. 0 0
      web/static/css/index.css
  13. 1 0
      web/static/css/list.css
  14. 19 0
      web/static/detail.html
  15. BIN
      web/static/images/18803b77.banner1.jpg
  16. BIN
      web/static/images/1da7fa89.banner.jpg
  17. BIN
      web/static/images/3c5802ee.tmp.jpg
  18. BIN
      web/static/images/4c296708.wechat.png
  19. BIN
      web/static/images/c2e24306.icons.png
  20. BIN
      web/static/images/f67617fd.tmp1.jpg
  21. 19 0
      web/static/index.html
  22. 1 0
      web/static/js/detail.js
  23. 0 0
      web/static/js/echarts.common.min.js
  24. 13 0
      web/static/js/global.js
  25. 1 0
      web/static/js/index.js
  26. 1 0
      web/static/js/list.js
  27. 1 0
      web/static/lib/jquery/jquery-1.8.3.min.js
  28. 19 0
      web/static/list.html
  29. 0 0
      web/static/mobile/css/global.css
  30. 1 0
      web/static/mobile/css/imgs.css
  31. 1 0
      web/static/mobile/css/index.css
  32. 0 0
      web/static/mobile/css/records.css
  33. BIN
      web/static/mobile/images/1fef2694.tmp2.jpg
  34. BIN
      web/static/mobile/images/5b7f2bbc.banner.jpg
  35. BIN
      web/static/mobile/images/e39dcd76.charts.jpg
  36. 41 0
      web/static/mobile/imgs.html
  37. 61 0
      web/static/mobile/index.html
  38. 0 0
      web/static/mobile/js/global.js
  39. 1 0
      web/static/mobile/js/imgs.js
  40. 1 0
      web/static/mobile/js/index.js
  41. 1 0
      web/static/mobile/js/records.js
  42. 95 0
      web/static/mobile/records.html
  43. 5 0
      web/templates/inc/footer.html
  44. 11 0
      web/templates/inc/header.html
  45. 3 0
      web/templates/inc/menu.html
  46. 10 0
      web/templates/inc/script.html
  47. 46 0
      web/templates/index.html
  48. 19 0
      web/templates/list.html
  49. 41 0
      web/templates/mobile/imgs.html
  50. 11 0
      web/templates/mobile/inc/header.html
  51. 10 0
      web/templates/mobile/inc/script.html
  52. 61 0
      web/templates/mobile/index.html
  53. 70 0
      web/templates/mobile/origin/env.html
  54. 43 0
      web/templates/mobile/origin/index.html
  55. 5 0
      web/templates/mobile/origin/menu.html
  56. 35 0
      web/templates/mobile/origin/work.html
  57. 95 0
      web/templates/mobile/records.html
  58. 18 0
      web/templates/view.html

+ 11 - 0
web.py

@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter web
+    name:web.py
+    author:rabin
+"""
+from demeter.core import *
+
+if __name__ == "__main__":
+	Demeter.webstart('web')

+ 6 - 0
web/__init__.py

@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter init
+    author:rabin
+"""

+ 10 - 0
web/main.py

@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+#coding=utf-8
+"""
+    demeter web
+    name:main.py
+    author:rabin
+"""
+from page import *
+from demeter.web import *
+Web.start(url)

+ 14 - 0
web/page/__init__.py

@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter init
+    author:rabin
+    这里写页面逻辑
+"""
+from demeter.web import *
+path = os.path.split(os.path.realpath(__file__))[0] + '/'
+files = Web.file(path)
+url = []
+for key in files:
+	module = __import__(key, globals())
+	url = Web.url(module, key, url)

+ 35 - 0
web/page/__load__.py

@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter load
+    author:rabin
+"""
+from demeter.web import *
+
+class Load(Base):
+	KEYS = ('user', 'farm')
+
+	def setting(self):
+		self.info()
+
+	def info(self):
+		ajax = self.input('ajax')
+		if ajax:
+			self.data['ajax'] = True
+		else:
+			self.data['ajax'] = False
+		self.data['auth'] = True
+		if 'user' in self.data['setting'] and self.data['setting']['user'] > 0:
+			self.data['setting']['userInfo'] = self.service('common').one('farm_user', id=self.data['setting']['user'])
+
+		self.data['setting']['web'] = self.service('common').one('web_set', id=1)
+		self.data['setting']['menu'] = self.service('common').list('web_menu')
+
+		cur = 'main'
+		if '/' in self.request.uri:
+			temp = self.request.uri.split('?')
+			temp = temp[0].split('/')
+			slen = len(temp)
+			if slen > 1 and temp[1]:
+				cur = temp[1]
+		self.data['setting']['cur'] = cur

+ 30 - 0
web/page/article.py

@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter web page
+    name:origin.py
+    author:rabin
+"""
+from __load__ import *
+
+class view_path(Load):
+	@Web.setting
+	def get(self):
+		id = self.input('id')
+		if not id:
+			self.out('error')
+			return
+		self.data['info'] = self.service('common').one('web_article', id=id)
+		self.view("view.html")
+
+class index_path(Load):
+	@Web.setting
+	def get(self):
+		search = {}
+		search['category_id'] = 2
+		self.data['list'] = self.service('common').list('web_article', search=search, page={'num':10})
+		if self.data['list']:
+			for key, value in enumerate(self.data['list']):
+				self.data['list'][key]['link'] = '/article/view?id=' + str(value['id'])
+
+		self.view("list.html")

+ 27 - 0
web/page/main.py

@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter web page
+    name:main.py
+    author:rabin
+"""
+from __load__ import *
+
+class index_path(Load):
+	@Web.setting
+	def get(self):
+		# 获取产品功能
+		self.data['function'] = self.service('common').list('web_article', search={'category_id':3})
+		if self.data['function']:
+			for key, value in enumerate(self.data['function']):
+				self.data['function'][key]['link'] = '#'
+				if value['link']:
+					self.data['function'][key]['link'] = value['link']
+		# 获取客户案例
+		self.data['demo'] = self.service('common').list('web_article', search={'category_id':4})
+		if self.data['demo']:
+			for key, value in enumerate(self.data['demo']):
+				self.data['demo'][key]['link'] = '#'
+				if value['link']:
+					self.data['demo'][key]['link'] = value['link']
+		self.view("index.html")

+ 119 - 0
web/page/origin.py

@@ -0,0 +1,119 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter web page
+    name:main.py
+    author:rabin
+"""
+from __load__ import *
+
+class Origin(object):
+	@staticmethod
+	def init(self, search={}):
+		id = self.input('id')
+		if not id:
+			self.redirect('/')
+		if 'work' in self.request.uri:
+			self.data['cur'] = 'work'
+		elif 'env' in self.request.uri:
+			self.data['cur'] = 'env'
+		elif 'farm' in self.request.uri:
+			self.data['cur'] = 'farm'
+		else:
+			self.data['cur'] = 'index'
+
+		self.data['info'] = self.service('common').one('origin_batch', id=id)
+		if not self.data['info']:
+			self.redirect('/')
+		self.data['farm'] = self.service('common').one('farm', id=self.data['info']['farm_id'])
+		if self.data['info']['csdate'] > self.data['info']['zzdate']:
+			self.data['zhou'] = self.data['info']['csdate'] - self.data['info']['zzdate']
+		else:
+			self.data['zhou'] = self.data['info']['zzdate'] - self.data['info']['csdate']
+		self.data['zhou'] = self.data['zhou']/64800
+		self.data['info']['zzdates'] = Demeter.date(self.data['info']['zzdate'], '%Y-%m-%d')
+		self.data['info']['csdates'] = Demeter.date(self.data['info']['csdate'], '%Y-%m-%d')
+		self.data['path'] = 'mobile/'
+		self.data['url'] = Origin.url('id=' + id + '#menu')
+
+	@staticmethod
+	def url(param):
+		config = {}
+		config['index'] = '/origin?' + param;
+		config['work'] = '/origin/work?' + param;
+		config['env'] = '/origin/env?' + param;
+		config['farm'] = '/origin/farm?' + param;
+		return config
+
+class index_path(Load):
+	@Web.setting
+	def get(self):
+		Origin.init(self)
+
+		self.data['list'] = self.service('common').list('farm_work_land_pic', search={'farm_id':self.data['info']['farm_id'], 'land_id':self.data['info']['land_id']})
+		if self.data['list']:
+			for key, value in enumerate(self.data['list']):
+				self.data['list'][key]['cdates'] = Demeter.date(value['cdate'], '%Y-%m-%d')
+		self.view(self.data['path'] + "origin/index.html")
+
+class work_path(Load):
+	@Web.setting
+	def get(self):
+		Origin.init(self)
+		self.data['work'] = self.service('common').list('farm_work', search={'farm_id':self.data['info']['farm_id']}, order='workdate asc,cdate asc')
+
+		self.data['cate'] = {}
+		self.data['list'] = []
+
+		if self.data['work']:
+			for key, value in enumerate(self.data['work']):
+				value['workdates'] = Demeter.date(value['workdate'], '%Y.%m.%d')
+
+				if value['category_id'] not in self.data['list']:
+					self.data['list'].append(value['category_id'])
+					self.data['cate'][value['category_id']] = self.service('common').one('farm_work_category', id=value['category_id'])
+
+				if 'work' not in self.data['cate'][value['category_id']]:
+					self.data['cate'][value['category_id']]['work'] = []
+				self.data['cate'][value['category_id']]['work'].append(value)
+
+		self.view(self.data['path'] + "origin/work.html")
+
+class env_path(Load):
+	@Web.setting
+	def get(self):
+		Origin.init(self)
+		search = {}
+		search['farm_id'] = self.data['info']['farm_id']
+		search['gateway_id'] = self.data['info']['gateway_id']
+		search['hardware_type'] = 2
+		self.data['list'] = self.service('common').list('device_info', search=search)
+
+		if self.data['list']:
+			for key, value in enumerate(self.data['list']):
+				self.data['list'][key] = self.stat(value)
+
+		self.view(self.data['path'] + "origin/env.html")
+
+	def stat(self, value):
+		method = 'maxmin'
+		value['type'] = self.service('common').one('device_type', id=value['type_id'])
+		model = Demeter.model('data', 'tsdb')
+		value['group'] = model.dateConfig()
+
+		search = {}
+		search['device'] = value['id']
+		#search['group'] = '1'
+		search['start'] = Demeter.date(self.data['info']['zzdate'])
+		search['end'] = Demeter.date(self.data['info']['csdate'])
+		value['search'] = search
+		value['stat'] = model.getData(method, search, value)
+		return value
+
+class farm_path(Load):
+	@Web.setting
+	def get(self):
+		Origin.init(self)
+
+
+		self.view(self.data['path'] + "origin/farm.html")

+ 18 - 0
web/page/us.py

@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+    demeter web page
+    name:main.py
+    author:rabin
+"""
+from __load__ import *
+
+class index_path(Load):
+	@Web.setting
+	def get(self):
+		id = 1
+		if not id:
+			self.out('error')
+			return
+		self.data['info'] = self.service('common').one('web_article', id=id)
+		self.view("view.html")

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

@@ -0,0 +1 @@
+.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}

File diff suppressed because it is too large
+ 0 - 0
web/static/css/global.css


File diff suppressed because it is too large
+ 0 - 0
web/static/css/index.css


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

@@ -0,0 +1 @@
+.card{display:block;padding:30px;margin-bottom:11px;background-color:#fff}.card p{text-align:center;color:#333;font-size:20px;padding-top:10px}

File diff suppressed because it is too large
+ 19 - 0
web/static/detail.html


BIN
web/static/images/18803b77.banner1.jpg


BIN
web/static/images/1da7fa89.banner.jpg


BIN
web/static/images/3c5802ee.tmp.jpg


BIN
web/static/images/4c296708.wechat.png


BIN
web/static/images/c2e24306.icons.png


BIN
web/static/images/f67617fd.tmp1.jpg


File diff suppressed because it is too large
+ 19 - 0
web/static/index.html


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

@@ -0,0 +1 @@
+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]);

File diff suppressed because it is too large
+ 0 - 0
web/static/js/echarts.common.min.js


File diff suppressed because it is too large
+ 13 - 0
web/static/js/global.js


+ 1 - 0
web/static/js/index.js

@@ -0,0 +1 @@
+webpackJsonp([0],{10:function(n,t){},15:function(n,t,c){n.exports=c(3)},3:function(n,t,c){"use strict";c(0),c(10),c(7)},7:function(n,t,c){"use strict"}},[15]);

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

@@ -0,0 +1 @@
+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]);

File diff suppressed because it is too large
+ 1 - 0
web/static/lib/jquery/jquery-1.8.3.min.js


File diff suppressed because it is too large
+ 19 - 0
web/static/list.html


File diff suppressed because it is too large
+ 0 - 0
web/static/mobile/css/global.css


+ 1 - 0
web/static/mobile/css/imgs.css

@@ -0,0 +1 @@
+section>*{background-color:#fff}.h1{font-size:.453333rem;line-height:1.333333rem;background-color:#efeff4}.banner,.h1{text-align:center}.banner{background-color:#fff}.banner img{display:block}.m-wrapper h2{font-size:.426667rem;text-align:center;line-height:1.52rem;color:#666}.m-wrapper h2.tleft{text-align:left;text-indent:.32rem}.m-wrapper.charts{width:9.2rem;margin:.426667rem auto 0}.m-wrapper.charts .img-wrap{margin:0 auto .32rem}.m-wrapper.charts .img-wrap img{display:block}.m-wrapper.charts .img-wrap p{text-align:center;font-size:.373333rem;color:#666;margin-top:.32rem}

+ 1 - 0
web/static/mobile/css/index.css

@@ -0,0 +1 @@
+.banner,section>*{background-color:#fff}.banner{text-align:center}.banner img{display:block}.li-1{padding-bottom:.533333rem}.li-1,.li-1 dl{overflow:hidden}.li-1 dl{width:8.666667rem;margin:0 auto;padding:.4rem 0 .2rem;border-bottom:1px solid #ddd}.li-1 dl dt{float:left}.li-1 dl dt .ico{vertical-align:top;display:block}.li-1 dl dd{font-size:.346667rem;color:#666;margin-left:1.2rem;line-height:.64rem}.li-1 dl dd.tit{font-size:.453333rem;line-height:.506667rem;color:#222;margin-bottom:.2rem}.m-wrapper .img-wrap{width:8.666667rem;margin:0 auto .506667rem}.m-wrapper .img-wrap img{display:block}.m-wrapper .img-wrap p{text-align:center;font-size:.346667rem;color:#666;margin-top:.32rem}

File diff suppressed because it is too large
+ 0 - 0
web/static/mobile/css/records.css


BIN
web/static/mobile/images/1fef2694.tmp2.jpg


BIN
web/static/mobile/images/5b7f2bbc.banner.jpg


BIN
web/static/mobile/images/e39dcd76.charts.jpg


+ 41 - 0
web/static/mobile/imgs.html

@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="black" name="apple-mobile-web-app-status-bar-style">
+    <meta content="telephone=no" name="format-detection">
+    <title>首页</title>
+    <meta name="Keywords" content="" />
+    <meta name="Description" content="" />
+<link href="css/global.css" rel="stylesheet"><link href="css/imgs.css" rel="stylesheet"></head>
+
+<body>
+    
+    <section class="m-wrapper">
+        <ul class="tabs">
+            <li><a href="#">产品介绍</a></li>
+            <li class="cur"><a href="#">生长环境</a></li>
+            <li><a href="#">农事记录</a></li>
+        </ul>
+    </section>
+
+    <section class="m-wrapper charts">
+        <section class="img-wrap">
+            <img src="images/e39dcd76.charts.jpg" width="100%">
+            <p>环境温度</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/e39dcd76.charts.jpg" width="100%">
+            <p>环境温度</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/e39dcd76.charts.jpg" width="100%">
+            <p>环境温度</p>
+        </section>
+    </section>
+<script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/imgs.js"></script></body>
+
+</html>

+ 61 - 0
web/static/mobile/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="black" name="apple-mobile-web-app-status-bar-style">
+    <meta content="telephone=no" name="format-detection">
+    <title>首页</title>
+    <meta name="Keywords" content="" />
+    <meta name="Description" content="" />
+<link href="css/global.css" rel="stylesheet"><link href="css/index.css" rel="stylesheet"></head>
+
+<body>
+    
+    <section class="m-wrapper">
+        <ul class="tabs">
+            <li class="cur"><a href="#">产品介绍</a></li>
+            <li><a href="#">生长环境</a></li>
+            <li><a href="#">农事记录</a></li>
+        </ul>
+        <section class="banner">
+            <img src="images/5b7f2bbc.banner.jpg" width="100%">
+        </section>
+        <section class="li-1">
+            <dl>
+                <dt><i class="ico ico1"></i></dt>
+                <dd class="tit">多肉的植物</dd>
+                <dd>批次:2017451235622号</dd>
+            </dl>
+            <dl>
+                <dt><i class="ico ico2"></i></dt>
+                <dd class="tit">农小盒食品一号工厂</dd>
+                <dd>北京市海淀区花园路14号环星大厦一号楼<br>400-123-1234</dd>
+            </dl>
+            <dl>
+                <dt><i class="ico ico3"></i></dt>
+                <dd class="tit green">60天</dd>
+                <dd>2017-7-20种植 ~ 2017-9-20采收</dd>
+            </dl>
+        </section>
+    </section>
+    <section class="m-wrapper">
+        <section class="img-wrap">
+            <img src="images/1fef2694.tmp2.jpg" width="100%" />
+            <p>2017-7-20种植</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/1fef2694.tmp2.jpg" width="100%" />
+            <p>2017-7-20种植</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/1fef2694.tmp2.jpg" width="100%" />
+            <p>2017-7-20种植</p>
+        </section>
+        <section class="loading-more"><i></i>加载中...</section>
+    </section>
+<script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/index.js"></script></body>
+
+</html>

File diff suppressed because it is too large
+ 0 - 0
web/static/mobile/js/global.js


+ 1 - 0
web/static/mobile/js/imgs.js

@@ -0,0 +1 @@
+webpackJsonp([2],{1:function(n,t,c){"use strict";c(0),c(6)},11:function(n,t,c){n.exports=c(1)},6:function(n,t){}},[11]);

+ 1 - 0
web/static/mobile/js/index.js

@@ -0,0 +1 @@
+webpackJsonp([1],{12:function(n,t,c){n.exports=c(2)},2:function(n,t,c){"use strict";c(0),c(7)},7:function(n,t){}},[12]);

+ 1 - 0
web/static/mobile/js/records.js

@@ -0,0 +1 @@
+webpackJsonp([0],{13:function(n,t,c){n.exports=c(3)},3:function(n,t,c){"use strict";c(0),c(8)},8:function(n,t){}},[13]);

+ 95 - 0
web/static/mobile/records.html

@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="black" name="apple-mobile-web-app-status-bar-style">
+    <meta content="telephone=no" name="format-detection">
+    <title>首页</title>
+    <meta name="Keywords" content="" />
+    <meta name="Description" content="" />
+<link href="css/global.css" rel="stylesheet"><link href="css/records.css" rel="stylesheet"></head>
+
+<body>
+    
+    <section class="m-wrapper">
+        <ul class="tabs">
+            <li><a href="#">产品介绍</a></li>
+            <li><a href="#">生长环境</a></li>
+            <li class="cur"><a href="#">农事记录</a></li>
+        </ul>
+    </section>
+
+    <section class="m-wrapper">
+        <h2>施肥记录</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>肥料名称</p>
+                    <p>用量</p>
+                </dt>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+            </dl>
+        </section>
+        <h2>劳作记录</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>肥料名称</p>
+                    <p>用量</p>
+                </dt>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+            </dl>
+        </section>
+        <h2>用药记录</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>药品名称</p>
+                    <p>用量</p>
+                </dt>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+            </dl>
+        </section>
+    </section>
+<script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/records.js"></script></body>
+
+</html>

+ 5 - 0
web/templates/inc/footer.html

@@ -0,0 +1,5 @@
+<div class="footer">
+	<div class="wrapper">
+		<p><a href="">{{data['setting']['web']['icp']}}</a></p>
+	</div>
+</div>

+ 11 - 0
web/templates/inc/header.html

@@ -0,0 +1,11 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+<meta content="yes" name="apple-mobile-web-app-capable">
+<meta content="black" name="apple-mobile-web-app-status-bar-style">
+<meta content="telephone=no" name="format-detection">
+    
+<title>{% if 'info' in data and data['info'] %}{{data['info']['name']}} - {% end %}{{data['setting']['web']['name']}}</title>
+
+<meta name="Keywords" content="{{data['setting']['web']['keywords']}}" />
+<meta name="Description" content="{{data['setting']['web']['description']}}" />
+<link href="{{static_url('css/global.css')}}" rel="stylesheet">

File diff suppressed because it is too large
+ 3 - 0
web/templates/inc/menu.html


+ 10 - 0
web/templates/inc/script.html

@@ -0,0 +1,10 @@
+<script>
+function getCookie(name) {
+    var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
+    return r ? r[1] : undefined;
+}
+var config = {};
+config.name = '{{data['setting']['web']['name']}}';
+</script>
+<script type="text/javascript" src="{{static_url('lib/jquery/jquery-1.8.3.min.js')}}"></script>
+<script type="text/javascript" src="{{static_url('js/global.js')}}"></script>

+ 46 - 0
web/templates/index.html

@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+    {%include 'inc/header.html'%}
+    <link href="{{static_url('css/index.css')}}" rel="stylesheet"></head>
+<body>
+    {%include 'inc/menu.html'%}
+    <div class="wrapper">
+        <div class="swiper-container">
+	        <div class="swiper-wrapper">
+	            <div class="swiper-slide"><a href="#"><img src="{{static_url('images/1da7fa89.banner.jpg')}}" width="100%"><i class="btn-play"></i></a></div>
+	        </div>
+	    </div>
+        {% if data['function'] %}
+	    <div class="block product">
+	    	<h2 class="block-title">产品功能</h2>
+	    	<ul>
+                {% for v in data['function'] %}
+	    		<li><a href="{{v['link']}}"><i class="icon icon1"></i><p>{{v['name']}}</p></a></li>
+	    		{% end %}
+	    	</ul>
+	    </div>
+        {% end %}
+	    <div class="block wechat">
+	    	<h2 class="block-title">微信管理</h2>
+	    	<img src="{{data['setting']['web']['wx_pic']}}" width="559" height="220">
+            <div class="msg">
+                {% raw data['setting']['web']['wx_text'] %}
+                <a href="{{data['setting']['web']['wx_link']}}" target="_blank">查看详细操作说明</a>
+            </div>
+	    </div>
+        {% if data['demo'] %}
+	    <div class="block custom">
+	    	<h2 class="block-title">客户案例</h2>
+	    	<ul>
+                {% for v in data['demo'] %}
+                <li><a href="{{v['link']}}"><img src="{{v['pic']}}" width="100%"><p>{{v['name']}}</p></a></li>
+                {% end %}
+            </ul>
+	    </div>
+        {% end %}
+    </div>
+    {%include 'inc/footer.html'%}
+    {%include 'inc/script.html'%}
+    </body>
+</html>

+ 19 - 0
web/templates/list.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+    {%include 'inc/header.html'%}
+    <link href="{{static_url('css/list.css')}}" rel="stylesheet"></head>
+<body>
+    {%include 'inc/menu.html'%}
+    <div class="wrapper">
+        {% for v in data['list'] %}
+        <a href="{{v['link']}}" class="card">
+            <img src="{{v['pic']}}" width="940" height="230">
+            <p>{{v['name']}}</p>
+        </a>
+        {% end %}
+    </div>
+    {%include 'inc/footer.html'%}
+    {%include 'inc/script.html'%}
+    </body>
+</html>

+ 41 - 0
web/templates/mobile/imgs.html

@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="black" name="apple-mobile-web-app-status-bar-style">
+    <meta content="telephone=no" name="format-detection">
+    <title>首页</title>
+    <meta name="Keywords" content="" />
+    <meta name="Description" content="" />
+<link href="css/global.css" rel="stylesheet"><link href="css/imgs.css" rel="stylesheet"></head>
+
+<body>
+    
+    <section class="m-wrapper">
+        <ul class="tabs">
+            <li><a href="#">产品介绍</a></li>
+            <li class="cur"><a href="#">生长环境</a></li>
+            <li><a href="#">农事记录</a></li>
+        </ul>
+    </section>
+
+    <section class="m-wrapper charts">
+        <section class="img-wrap">
+            <img src="images/e39dcd76.charts.jpg" width="100%">
+            <p>环境温度</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/e39dcd76.charts.jpg" width="100%">
+            <p>环境温度</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/e39dcd76.charts.jpg" width="100%">
+            <p>环境温度</p>
+        </section>
+    </section>
+<script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/imgs.js"></script></body>
+
+</html>

+ 11 - 0
web/templates/mobile/inc/header.html

@@ -0,0 +1,11 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+<meta content="yes" name="apple-mobile-web-app-capable">
+<meta content="black" name="apple-mobile-web-app-status-bar-style">
+<meta content="telephone=no" name="format-detection">
+    
+<title>{% if 'info' in data and data['info'] %}{{data['info']['name']}} - {% end %}{{data['setting']['web']['name']}}</title>
+
+<meta name="Keywords" content="{{data['setting']['web']['keywords']}}" />
+<meta name="Description" content="{{data['setting']['web']['description']}}" />
+<link href="{{static_url('mobile/css/global.css')}}" rel="stylesheet">

+ 10 - 0
web/templates/mobile/inc/script.html

@@ -0,0 +1,10 @@
+<script>
+function getCookie(name) {
+    var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
+    return r ? r[1] : undefined;
+}
+var config = {};
+config.name = '{{data['setting']['web']['name']}}';
+</script>
+<script type="text/javascript" src="{{static_url('lib/jquery/jquery-1.8.3.min.js')}}"></script>
+<script type="text/javascript" src="{{static_url('mobile/js/global.js')}}"></script>

+ 61 - 0
web/templates/mobile/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="black" name="apple-mobile-web-app-status-bar-style">
+    <meta content="telephone=no" name="format-detection">
+    <title>首页</title>
+    <meta name="Keywords" content="" />
+    <meta name="Description" content="" />
+<link href="css/global.css" rel="stylesheet"><link href="css/index.css" rel="stylesheet"></head>
+
+<body>
+    
+    <section class="m-wrapper">
+        <ul class="tabs">
+            <li class="cur"><a href="#">产品介绍</a></li>
+            <li><a href="#">生长环境</a></li>
+            <li><a href="#">农事记录</a></li>
+        </ul>
+        <section class="banner">
+            <img src="images/5b7f2bbc.banner.jpg" width="100%">
+        </section>
+        <section class="li-1">
+            <dl>
+                <dt><i class="ico ico1"></i></dt>
+                <dd class="tit">多肉的植物</dd>
+                <dd>批次:2017451235622号</dd>
+            </dl>
+            <dl>
+                <dt><i class="ico ico2"></i></dt>
+                <dd class="tit">农小盒食品一号工厂</dd>
+                <dd>北京市海淀区花园路14号环星大厦一号楼<br>400-123-1234</dd>
+            </dl>
+            <dl>
+                <dt><i class="ico ico3"></i></dt>
+                <dd class="tit green">60天</dd>
+                <dd>2017-7-20种植 ~ 2017-9-20采收</dd>
+            </dl>
+        </section>
+    </section>
+    <section class="m-wrapper">
+        <section class="img-wrap">
+            <img src="images/1fef2694.tmp2.jpg" width="100%" />
+            <p>2017-7-20种植</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/1fef2694.tmp2.jpg" width="100%" />
+            <p>2017-7-20种植</p>
+        </section>
+        <section class="img-wrap">
+            <img src="images/1fef2694.tmp2.jpg" width="100%" />
+            <p>2017-7-20种植</p>
+        </section>
+        <section class="loading-more"><i></i>加载中...</section>
+    </section>
+<script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/index.js"></script></body>
+
+</html>

+ 70 - 0
web/templates/mobile/origin/env.html

@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+    {%include '../inc/header.html'%}
+	<link href="{{static_url('mobile/css/imgs.css')}}" rel="stylesheet">
+</head>
+<body>
+    <section class="m-wrapper">
+        {%include 'menu.html'%}
+    </section>
+
+    <section class="m-wrapper charts">
+        {% for v in data['list'] %}
+        <section class="img-wrap">
+            <div class="box" id="main_{{v['id']}}" style="width: 100%;height:400px;"></div>
+            <p>{{v['name']}}</p>
+        </section>
+        {% end %}
+    </section>
+
+{%include '../inc/script.html'%}
+<script type="text/javascript" src="{{static_url('js/echarts.common.min.js')}}"></script>
+<script>
+{% for v in data['list'] %}
+var myChart = echarts.init(document.getElementById('main_{{v['id']}}'));
+var date = {% for key,value in enumerate(v['stat']) %}{% if key == 0 %}{% raw value['data']['time'] %}{% end %}{% end %};
+var series = [
+        {% for key,value in enumerate(v['stat']) %}
+        {% if key > 0 %},{% end %}
+        {
+            name:'{{value['name']}}',
+            type:'line',
+            data:{% raw value['data']['value'] %},
+            markPoint: {
+                data: [
+                    {type: 'max', name: '最大值'},
+                    {type: 'min', name: '最小值'}
+                ]
+            },
+            markLine: {
+                data: [
+                    {type: 'average', name: '平均值'}
+                ]
+            }
+        }
+        {% end %}
+        ];
+
+// 指定图表的配置项和数据
+var option = {
+    tooltip: {
+        trigger: 'axis'
+    },
+    xAxis: {
+        type: 'category',
+        data: date
+    },
+    yAxis: {
+        type: 'value',
+        axisLabel: {
+            formatter: '{value} {{v['type']['unit']}}'
+        }
+    },
+    series: series
+};
+myChart.setOption(option, true);
+{% end %}
+</script>
+</body>
+</html>

+ 43 - 0
web/templates/mobile/origin/index.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+    {%include '../inc/header.html'%}
+	<link href="{{static_url('mobile/css/index.css')}}" rel="stylesheet">
+</head>
+<body>
+    <section class="m-wrapper">
+        {%include 'menu.html'%}
+        <section class="banner">
+            <img src="{{data['info']['pic']}}" width="100%">
+        </section>
+        <section class="li-1">
+            <dl>
+                <dt><i class="ico ico1"></i></dt>
+                <dd class="tit">{{data['info']['name']}}</dd>
+                <dd>批次:{{data['info']['number']}}号</dd>
+            </dl>
+            <dl>
+                <dt><i class="ico ico2"></i></dt>
+                <dd class="tit">{{data['farm']['name']}}</dd>
+                <dd>{{data['farm']['address']}}<br>{{data['farm']['tel']}}</dd>
+            </dl>
+            <dl>
+                <dt><i class="ico ico3"></i></dt>
+                <dd class="tit green">{{data['zhou']}}天</dd>
+                <dd>{{data['info']['zzdates']}}种植 ~ {{data['info']['csdates']}}采收</dd>
+            </dl>
+        </section>
+    </section>
+    <section class="m-wrapper">
+        {% for v in data['list'] %}
+        <section class="img-wrap">
+            <img src="{{v['pic']}}" width="100%" />
+            <p>{{v['cdates']}}</p>
+        </section>
+        {% end %}
+        <section class="loading-more"><i></i>加载中...</section>
+    </section>
+
+{%include '../inc/script.html'%}
+</body>
+</html>

+ 5 - 0
web/templates/mobile/origin/menu.html

@@ -0,0 +1,5 @@
+<ul class="tabs">
+    <li {% if data['cur'] == 'index' %}class="cur"{% end %}><a href="{{data['url']['index']}}">产品介绍</a></li>
+    <li {% if data['cur'] == 'env' %}class="cur"{% end %}><a href="{{data['url']['env']}}">生长环境</a></li>
+    <li {% if data['cur'] == 'work' %}class="cur"{% end %}><a href="{{data['url']['work']}}">农事记录</a></li>
+</ul>

+ 35 - 0
web/templates/mobile/origin/work.html

@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+    {%include '../inc/header.html'%}
+    <link href="{{static_url('mobile/css/records.css')}}" rel="stylesheet">
+</head>
+<body>
+    <section class="m-wrapper">
+        {%include 'menu.html'%}
+    </section>
+
+    <section class="m-wrapper">
+        {% for v in data['list'] %}
+        {%set v = data['cate'][v] %}
+        <h2>{{v['name']}}</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>{{v['name']}}</p>
+                    <p>用量</p>
+                </dt>
+                {% for v1 in v['work'] %}
+                <dd>
+                    <p><span>{{v1['workdates']}}</span></p><p><span>{{v1['content']}}</span></p><p><span>{{v1['amount']}}</span></p>
+                </dd>
+                {% end %}
+            </dl>
+        </section>
+        {% end %}
+    </section>
+
+{%include '../inc/script.html'%}
+</body>
+</html>

+ 95 - 0
web/templates/mobile/records.html

@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="black" name="apple-mobile-web-app-status-bar-style">
+    <meta content="telephone=no" name="format-detection">
+    <title>首页</title>
+    <meta name="Keywords" content="" />
+    <meta name="Description" content="" />
+<link href="css/global.css" rel="stylesheet"><link href="css/records.css" rel="stylesheet"></head>
+
+<body>
+    
+    <section class="m-wrapper">
+        <ul class="tabs">
+            <li><a href="#">产品介绍</a></li>
+            <li><a href="#">生长环境</a></li>
+            <li class="cur"><a href="#">农事记录</a></li>
+        </ul>
+    </section>
+
+    <section class="m-wrapper">
+        <h2>施肥记录</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>肥料名称</p>
+                    <p>用量</p>
+                </dt>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+            </dl>
+        </section>
+        <h2>劳作记录</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>肥料名称</p>
+                    <p>用量</p>
+                </dt>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>水润钾肥磷肥</span></p><p><span>500g/亩</span></p>
+                </dd>
+            </dl>
+        </section>
+        <h2>用药记录</h2>
+        <section class="grid">
+            <dl>
+                <dt>
+                    <p>日期</p>
+                    <p>药品名称</p>
+                    <p>用量</p>
+                </dt>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+                <dd>
+                    <p><span>2017-05-01</span></p><p><span>虫草混合喷雾</span></p><p><span>300ml/m</span></p>
+                </dd>
+            </dl>
+        </section>
+    </section>
+<script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/records.js"></script></body>
+
+</html>

+ 18 - 0
web/templates/view.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+    {%include 'inc/header.html'%}
+    <link href="{{static_url('css/detail.css')}}" rel="stylesheet">
+</head>
+<body>
+    {%include 'inc/menu.html'%}
+    <div class="wrapper">
+        <div class="article">
+            <h1>{{data['info']['name']}}</h1>
+            {% raw data['info']['content'] %}
+        </div>
+    </div>
+    {%include 'inc/footer.html'%}
+    {%include 'inc/script.html'%}
+    </body>
+</html>

Some files were not shown because too many files changed in this diff