Skip to content

Commit

Permalink
模板完成
Browse files Browse the repository at this point in the history
  • Loading branch information
Rempage committed Jan 18, 2019
1 parent f097b0d commit 001de74
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 75 deletions.
201 changes: 127 additions & 74 deletions .idea/workspace.xml

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions app/static/css/wap.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*初始化样式*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header,
menu, nav, output, ruby, section, summary,
time, mark, audio, video, input {
margin: 0;
padding: 0;
border: 0;
font-weight: normal;
vertical-align: middle;
}
html, body {
width: 100%;
height:100%;
font-family:"微软雅黑", arial, sans-serif, helvetica ,'Helvetica Neue';
box-sizing: border-box;
-webkit-box-sizing:border-box;
}
html {/*解决chrome浏览器下字体不能小于12px*/
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
text-size-adjust: none;
}
body {
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
line-height: 1;
}
em{
font-style: normal;
}
em,i,span{
display:inline-block;
}
article, aside, details, figcaption, figure,
footer, header, menu, nav, section {
display: block;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
a {
color: #7e8c8d;
text-decoration: none;
-webkit-backface-visibility: hidden;
}
li {
list-style: none;
}
/*消除iphone手机input自带的样式和点击高亮*/
input[type="submit"], input[type="reset"], input[type="button"], input[type=date], button, select, input[type=text] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
cursor: pointer;
tap-highlight-color: transparent !important;
}

input[type="text"], textarea {
outline: none;
}
button, textarea {
border: none;
}

a, input[type=text], select, input[type=password], textarea {
tap-highlight-color: transparent !important;
}
hr {
border: none;
background-color: #edebeb;
height: 0.02rem;
}
.clearfix::after {
content: '';
clear: both;
display: block;
line-height: 0;
visibility: hidden;
height: 0;
}
.clearfix {
zoom: 1;
}

.f_r {float: right}
.f_l {float: left}
.d_in_b {display: inline-block}
.d_b {display: block}
.d_in {display: inline}
.d_hide {display: none}

.font_bold {font-weight: bold}
.text_c {text-align: center}

.line_1 {
width:100%;
overflow:hidden;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
-webkit-text-overflow:ellipsis;
-moz-text-overflow:ellipsis;
white-space:nowrap;
}
.line_2 {
width:100%;
word-break:break-all;
display:-webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient:vertical;
overflow:hidden;
}
.line_3 {
width:100%;
word-break:break-all;
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
overflow:hidden;
}

.pos_r {position: relative}
.pos_a {position: absolute}
.pos_f {position: fixed}


/**/
/**/
body {
background: #f7f5f5;
}
Binary file added app/static/img/favicon.ico
Binary file not shown.
7 changes: 7 additions & 0 deletions app/static/third/moment/moment.min.js

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions app/templates/wap/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="keywords" content="Farsee,Blog,Eric,Eric-Blog"/>
<meta name="description" content="豌豆智能家居"/>
<meta name="author" content="Eric"/>
<meta name="copyright" content="www.farsee.online"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="address=no;">
<meta name="msapplication-tap-highlight" content="no"/>
<title>豌豆智能</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}">
<link href="{{ url_for('static', filename='css/wap.css') }}" rel="stylesheet">
{% block link %}{% endblock %}
{% block head_script %}{% endblock %}
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement,
isIOS = navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
dpr = isIOS ? Math.min(win.devicePixelRatio, 3) : 1,
dpr = window.top === window.self ? dpr : 1, //被iframe引用时,禁止缩放
dpr = 1,
scale = 1 / dpr,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
docEl.dataset.dpr = dpr;
var metaEl = doc.createElement('meta');
metaEl.name = 'viewport';
metaEl.content = 'initial-scale=' + scale + ',maximum-scale=' + scale + ', minimum-scale=' + scale;
docEl.firstElementChild.appendChild(metaEl);
var recalc = function() {
var width = docEl.clientWidth;
docEl.style.fontSize = 100 * (width / 750) + 'px';
};
recalc()
if (!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
})(document, window);
</script>
</head>
<body>
<div class="header">
{% block header %}{% endblock %}
</div>
<div class="content">
{% block content %}{% endblock %}
</div>
<div class="footer">
{% block footer %}{% endblock %}
</div>

<script src="{{ url_for('static', filename='third/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/wap.js') }}"></script>
<script src="{{ url_for('static', filename='third/moment/moment.min.js') }}"></script>
<script>
var csrftoken = $('meta[name=csrf-token]').attr('content')
{#验证成功, post请求全局 附加X-CSRFToken#}
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrftoken)
}
}
});
$(document).ajaxStart(function () {
})
</script>
{% block script %}{% endblock %}
</body>
</html>
17 changes: 17 additions & 0 deletions app/templates/wap/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "wap/base.html" %}

{% block title %}豌豆智能{% endblock %}

{% block header %}
{% endblock %}


{% block content %}
<div>
1
</div>
{% endblock %}


{% block footer %}
{% endblock %}
3 changes: 2 additions & 1 deletion app/wap/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from . import wap
from flask import render_template

@wap.route('/')
def index():
return '1'
return render_template('wap/index.html')

0 comments on commit 001de74

Please sign in to comment.