diff --git a/t/css/main.css b/t/css/main.css index c0468c3..de2fd80 100644 --- a/t/css/main.css +++ b/t/css/main.css @@ -5,13 +5,17 @@ body{ font-family:"微软雅黑"; } - input{ -webkit-appearance:none; - outline:none + outline:none; + border-radius:0; } +a{ + color: #525252; +} + header div:nth-child(1){ position: absolute; left:3px; @@ -39,6 +43,7 @@ header div:nth-child(2){ width:50px; height:43px; border:0; + margin-left: 2px; background-color:#0091FF; border-left:0; border:0; @@ -56,22 +61,29 @@ footer{ height:40px; line-height:40px; text-align:center; - color:#2BB2A3; + /*color:#2BB2A3;*/ + color: #FFF; border-top: 1px solid #DDD8CE; - background-color:#F0EFED; + /*background-color:#F0EFED;*/ + background-color: #000; } -footer div:nth-child(1){ +footer a{ + cursor: pointer; + color: #FFF; +} + +footer a:nth-child(1){ width: 33%; float: left; } -footer div:nth-child(2){ +footer a:nth-child(2){ width: 33%; float: left; } -footer div:nth-child(3){ +footer a:nth-child(3){ width: 33%; float: right; } @@ -92,6 +104,10 @@ section{ border-bottom: 1px solid #A8A8A8; } +section .list_item:last-child{ + border-bottom: none; +} + .list_img{ width:104px; height: 144px; @@ -119,18 +135,21 @@ section{ .list_author{ color:#666666; margin-left:10px; - height: 64px; + line-height:17px; + height: 51px; width:120px; } .overflow{ overflow: hidden; + text-overflow: ellipsis; } .fl{float: left;} .fr{float: right;} .list_bookprice{ + margin-top: 20px; margin-left:5px; color:#2BB2A3; } @@ -144,6 +163,10 @@ section{ top:120px; } +.list_bookname_a{ + height:150px;display:block; +} + diff --git a/t/html/index.html b/t/html/index.html index e6c6d28..a3297c1 100644 --- a/t/html/index.html +++ b/t/html/index.html @@ -16,40 +16,12 @@ -
- -
-
- -
-
-
- {{data.origin_title}} -
-
- {{data.author}} {{data.publisher}} -
-
- - {{data.price}} - - -
-
-
- - {{data.pages}}页 - -
-
- -
-
+
diff --git a/t/html/view/detail.html b/t/html/view/detail.html new file mode 100644 index 0000000..b021d8e --- /dev/null +++ b/t/html/view/detail.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/t/html/view/list.html b/t/html/view/list.html new file mode 100644 index 0000000..6619832 --- /dev/null +++ b/t/html/view/list.html @@ -0,0 +1,33 @@ + +
+
+ +
+
+
+ diff --git a/t/lib/index.js b/t/lib/index.js index 02f012b..9af8900 100644 --- a/t/lib/index.js +++ b/t/lib/index.js @@ -1,11 +1,30 @@ +var app = angular.module('app', ['ngRoute']); -var app = angular.module('app', []); +app.config(['$routeProvider', function ($routeProvider) { + $routeProvider + .when('/list', { + templateUrl: 'view/list.html', + controller: 'BookListController' + }) + .when('/list/book', { + templateUrl: 'view/list.html', + controller: 'BookListController' + }) + .when('/list/:id', { + templateUrl: 'view/detail.html', + controller: 'BookListController' + }) + .otherwise({ + redirectTo: '/', + templateUrl: 'view/list.html', + controller: 'BookListController' + }); +}]); app.controller('BookListController', function($http, $scope){ - $http.jsonp('https://api.douban.com/v2/book/search?callback=TEST&q=C%E8%AF%AD%E8%A8%80'); - - window.TEST = function(data){ + $http.jsonp('https://api.douban.com/v2/book/search?callback=showList&q=C%E8%AF%AD%E8%A8%80'); + window.showList = function(data){ var list = []; for(var i = 0; i < data.books.length; i++){ var book = data.books[i];