diff --git a/docs/data-structure.md b/docs/data-structure.md index 6c05c4b..cd7850e 100644 --- a/docs/data-structure.md +++ b/docs/data-structure.md @@ -70,25 +70,28 @@ //header { - header: { - back: true/false, - title: '', - home: '' //对应页面有就传,没有就不传 + pageHeader: { + //对应页面有就传,没有就不传 + navBack: '', + navTitle: '', + navHome: '' } } //footer已登录 { - footer: { - name: '', - url: '', - signoutUrl: '' + pageFooter: { + user: { + name: '', + url: '', + signoutUrl: '' + } } } //footer未登录 { - footer: { + pageFooter: { loginUrl: '', signupUrl: '' } diff --git a/static/img/layout/back.png b/static/img/layout/back.png new file mode 100644 index 0000000..12547a5 Binary files /dev/null and b/static/img/layout/back.png differ diff --git a/static/img/layout/home.png b/static/img/layout/home.png new file mode 100644 index 0000000..b4af6d5 Binary files /dev/null and b/static/img/layout/home.png differ diff --git a/static/sass/index.scss b/static/sass/index.scss index 8561295..8393c53 100644 --- a/static/sass/index.scss +++ b/static/sass/index.scss @@ -3,6 +3,8 @@ $pxConvertRem: 40; * { -webkit-tap-highlight-color: rgba(0,0,0,0); + -moz-tap-highlight-color: rgba(0,0,0,0); + tap-highlight-color: rgba(0,0,0,0); } html, body { @@ -45,4 +47,4 @@ a { color: #000; } -@import "passport/index"; \ No newline at end of file +@import "layout/header", "layout/footer", "passport/index"; \ No newline at end of file diff --git a/static/sass/layout/_footer.scss b/static/sass/layout/_footer.scss new file mode 100644 index 0000000..96ccbef --- /dev/null +++ b/static/sass/layout/_footer.scss @@ -0,0 +1,29 @@ +.yoho-footer { + font-size: 12px; + background-color: #fff; + + .op-row { + position: relative; + padding: 0 30px; + height: 60px; + line-height: 60px; + + .user-name { + text-decoration: underline; + } + + .back-to-top { + position: absolute; + right: 20px; + } + } + + .copyright { + height: 60px; + line-height: 60px; + border-top: 1px solid #ccc; + text-align: center; + color: #666; + background-color: #eee; + } +} \ No newline at end of file diff --git a/static/sass/layout/_header.scss b/static/sass/layout/_header.scss new file mode 100644 index 0000000..efa51fc --- /dev/null +++ b/static/sass/layout/_header.scss @@ -0,0 +1,48 @@ +.yoho-header { + position: relative; + background-color: #000; + color: #fff; + width: 100%; + overflow: hidden; + height: 44px; + line-height: 44px; + + .nav-back { + position: absolute; + left: 17px; + top: 14px; + width: 9px; + height: 16px; + background: image-url('layout/back.png') no-repeat; + background-size: 100% 100%; + outline: none; + } + + .nav-home { + position: absolute; + top: 14px; + right: 17px; + width: 20px; + height: 20px; + background: image-url('layout/home.png') no-repeat; + background-size: 100% 100%; + outline: none; + } + + .nav-title { + position: absolute; + margin-left: 26px; + margin-right: 32px; + height: 100%; + font-size: 18px; + color: #fff; + font-weight: bold; + top: 0; + right: 0; + left: 0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + text-align: center; + } +} \ No newline at end of file diff --git a/template/m.yohobuy.com/partials/layout/footer.phtml b/template/m.yohobuy.com/partials/layout/footer.phtml index b8b0461..86286ae 100644 --- a/template/m.yohobuy.com/partials/layout/footer.phtml +++ b/template/m.yohobuy.com/partials/layout/footer.phtml @@ -1,3 +1,4 @@ +{{> layout/page_footer}} <script src="http://172.16.6.248:8000/static/js/sea.js?nowrap"></script> <script> seajs.config({ diff --git a/template/m.yohobuy.com/partials/layout/header.phtml b/template/m.yohobuy.com/partials/layout/header.phtml index 6262b1d..7252484 100644 --- a/template/m.yohobuy.com/partials/layout/header.phtml +++ b/template/m.yohobuy.com/partials/layout/header.phtml @@ -25,4 +25,5 @@ </script> <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css"> </head> -<body {{#if isPassportPage}}class=passport-body{{/if}}> \ No newline at end of file +<body {{#if isPassportPage}}class=passport-body{{/if}}> +{{> layout/page_header}} \ No newline at end of file diff --git a/template/m.yohobuy.com/partials/layout/page_footer.phtml b/template/m.yohobuy.com/partials/layout/page_footer.phtml new file mode 100644 index 0000000..82f5050 --- /dev/null +++ b/template/m.yohobuy.com/partials/layout/page_footer.phtml @@ -0,0 +1,22 @@ +{{#pageFooter}} + <footer class="yoho-footer"> + <p class="op-row"> + {{# user}} + Hi, + <a class="user-name" href="{{url}}">{{name}}</a> + <a href="{{signoutUrl}}">退出</a> + {{^}} + <a href="{{loginUrl}}">登录</a> + <span class="sep-line">|</span> + <a href="{{signupUrl}}">注册</a> + {{/ user}} + <span class="back-to-top"> + Back to top + <i class="iconfont"></i> + </span> + </p> + <address class="copyright"> + CopyRight©2007-2016 南京新与力文化传播有限公司 + </address> + </footer> +{{/pageFooter}} \ No newline at end of file diff --git a/template/m.yohobuy.com/partials/layout/page_header.phtml b/template/m.yohobuy.com/partials/layout/page_header.phtml new file mode 100644 index 0000000..d5f1580 --- /dev/null +++ b/template/m.yohobuy.com/partials/layout/page_header.phtml @@ -0,0 +1,13 @@ +{{#pageHeader}} + <header class="yoho-header"> + {{#navBack}} + <a href={{.}} class="nav-back"></a> + {{/navBack}} + {{#navHome}} + <a href={{.}} class="nav-home"></a> + {{/navHome}} + {{#navTitle}} + <p class="nav-title">{{.}}</p> + {{/navTitle}} + </header> +{{/pageHeader}} \ No newline at end of file diff --git a/yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Back.php b/yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Back.php index 324b320..c693238 100644 --- a/yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Back.php +++ b/yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Back.php @@ -94,7 +94,16 @@ class BackController extends AbstractAction 'showHeaderText' => true, 'headerText' => '找回密码', 'isPassportPage' => true, - 'modulePath' => 'passport/back/new-password' + 'modulePath' => 'passport/back/new-password', + 'pageHeader' => array( + 'navBack' => 'm.yohobuy.com', + 'navHome' => 'm.yohobuy.com', + 'navTitle' => '上衣' + ), + 'pageFooter' => array( + 'loginUrl' => 'm.yohobuy.com/login.html', + 'signupUrl' => 'm.yohobuy.com/signup.html' + ) ); $this->_view->assign('title', 'YOHO!有货');