From 65196b72a14b7afaf9414e8ac4fb3345b9a4c0f5 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Thu, 3 Nov 2016 11:45:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9F=BA=E7=A1=80=E6=A8=A1?= =?UTF-8?q?=E7=89=88=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=A8=A1=E7=89=88JS?= =?UTF-8?q?=E5=BC=95=E6=93=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/public/base.html | 4 +- public/static/admin/dist/js/template.js | 64 +++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 public/static/admin/dist/js/template.js diff --git a/application/admin/view/public/base.html b/application/admin/view/public/base.html index f8b4b6d..1cd25ec 100644 --- a/application/admin/view/public/base.html +++ b/application/admin/view/public/base.html @@ -16,7 +16,7 @@ font-family: "Segoe UI","Lucida Grande",Helvetica,Arial,"Microsoft YaHei",FreeSans,Arimo,"Droid Sans","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",FontAwesome,sans-serif; } - + {block name="myStyle"}{/block} + + {block name="myScript"}{/block} diff --git a/public/static/admin/dist/js/template.js b/public/static/admin/dist/js/template.js new file mode 100644 index 0000000..1e1361d --- /dev/null +++ b/public/static/admin/dist/js/template.js @@ -0,0 +1,64 @@ +/** + * 模版引擎 + * ------------------ + * You should not use this file in production. + * This file is for demo purposes only. + */ +(function ($) { + + "use strict"; + + function create( jsonStr ) { + + } + + function emptyList() { + + } + + function easyList( listObj ) { + + } + + function topButton( topObj ) { + + } + + function rightButton( rightObj ) { + + } + + function easyForm() { + + } + + function input( inputObj ) { + + } + + function select( selectObj ) { + + } + + function button( buttonObj ) { + + } + + /** + * 格式化时间戳(为了和PHP的date函数统一,这里的时间戳都是10位,不包含毫秒) + * @param timestamp + * @returns {string} + */ + function formatDate( timestamp ) { + timestamp *= 1000; + var date = new Date(timestamp); + var Y = date.getFullYear() + '-'; + var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; + var D = (date.getDate()+1 < 10 ? '0'+(date.getDate()+1) : date.getDate()+1) + ' '; + var h = date.getHours() + ':'; + var m = date.getMinutes() + ':'; + var s = date.getSeconds(); + return Y+M+D+h+m+s; + } + +})(jQuery);