├── old ├── control │ └── Acore.js ├── image │ ├── 1.jpg │ └── loading_img_56@2x.png ├── dist │ ├── fonts │ │ ├── ionicons.eot │ │ ├── ionicons.ttf │ │ └── ionicons.woff │ ├── css │ │ └── base.css │ └── js │ │ └── angular-animate.js ├── register.php ├── view │ ├── map.html │ ├── preview.html │ ├── setting.html │ ├── gameDetail.html │ ├── login.html │ ├── register.html │ ├── game.html │ ├── hot.html │ └── index.html ├── baiduApi.php ├── baiduApi2.php ├── login.php ├── baiduApi3.php ├── ghpage │ ├── tab.html │ └── touch.html ├── README.md └── index.html ├── vue-news ├── .babelrc ├── public │ ├── wscats.jpg │ ├── images │ │ └── wscats.jpg │ ├── b30684b1cb89e7e4851903728c77296f.jpg │ ├── index.html │ └── api │ │ ├── detail.json │ │ └── list.json ├── app │ ├── channel │ │ ├── hot.vue │ │ ├── recommend.vue │ │ └── entertainment.vue │ ├── index.vue │ ├── wheader.vue │ ├── wdetail.vue │ ├── wsearch.vue │ ├── wswiper.vue │ └── wpannel.vue ├── package.json ├── webpack.config.js └── main.js ├── webroot ├── index.css ├── news │ ├── README.md │ ├── dist │ │ ├── html │ │ │ ├── template │ │ │ │ ├── setting.html │ │ │ │ ├── login.html │ │ │ │ ├── newsList.html │ │ │ │ ├── secondList.html │ │ │ │ ├── thirdList.html │ │ │ │ ├── index.html │ │ │ │ ├── register.html │ │ │ │ ├── logins.html │ │ │ │ └── detail.html │ │ │ └── directive │ │ │ │ ├── loading.html │ │ │ │ ├── searchBar.html │ │ │ │ ├── swiper.html │ │ │ │ └── newsList.html │ │ ├── image │ │ │ ├── psb.webp.jpg │ │ │ ├── psb.webp2.jpg │ │ │ ├── windiest.jpg │ │ │ └── loading_img_56@2x.png │ │ └── js │ │ │ └── main.windiest.js │ ├── template │ │ ├── setting.html │ │ ├── newsList.html │ │ ├── secondList.html │ │ ├── thirdList.html │ │ ├── index.html │ │ ├── register.html │ │ ├── logins.html │ │ └── detail.html │ ├── image │ │ ├── psb.webp.jpg │ │ ├── psb.webp2.jpg │ │ ├── windiest.jpg │ │ ├── windiest.png │ │ ├── loading_img_56@2x.png │ │ └── b5fd500a56552f4687a0.jpg │ ├── directive │ │ ├── loading.html │ │ ├── searchBar.html │ │ ├── swiper.html │ │ └── newsList.html │ ├── index.html │ ├── package.json │ ├── news.php │ ├── test.html │ ├── indexTest.html │ ├── js │ │ ├── directive │ │ │ └── directive.js │ │ ├── service │ │ │ └── service.js │ │ ├── ngPost.js │ │ ├── base.js │ │ └── controller │ │ │ └── controller.js │ ├── gulpfile.js │ └── css │ │ └── swiper.css ├── favicon.ico ├── cms │ ├── sqll.js │ ├── test.html │ ├── cms.js │ ├── sql.js │ └── news.js ├── index.js └── index.html ├── .gitignore ├── index.js ├── mime.js ├── .project ├── turingApi.js ├── newsApi.js ├── package.json ├── README.md ├── gulpfile.js └── http.js /old/control/Acore.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue-news/.babelrc: -------------------------------------------------------------------------------- 1 | { "presets": [ "es2015" ] } 2 | -------------------------------------------------------------------------------- /webroot/index.css: -------------------------------------------------------------------------------- 1 | p { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /webroot/news/README.md: -------------------------------------------------------------------------------- 1 | ###Hello I'm wscat, nice to meet u~ 2 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/setting.html: -------------------------------------------------------------------------------- 1 |
setting
-------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/.gitignore -------------------------------------------------------------------------------- /old/image/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/old/image/1.jpg -------------------------------------------------------------------------------- /webroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/favicon.ico -------------------------------------------------------------------------------- /webroot/news/template/setting.html: -------------------------------------------------------------------------------- 1 | 2 |
setting
3 | -------------------------------------------------------------------------------- /old/dist/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/old/dist/fonts/ionicons.eot -------------------------------------------------------------------------------- /old/dist/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/old/dist/fonts/ionicons.ttf -------------------------------------------------------------------------------- /old/dist/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/old/dist/fonts/ionicons.woff -------------------------------------------------------------------------------- /vue-news/public/wscats.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/vue-news/public/wscats.jpg -------------------------------------------------------------------------------- /old/image/loading_img_56@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/old/image/loading_img_56@2x.png -------------------------------------------------------------------------------- /vue-news/public/images/wscats.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/vue-news/public/images/wscats.jpg -------------------------------------------------------------------------------- /webroot/news/image/psb.webp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/image/psb.webp.jpg -------------------------------------------------------------------------------- /webroot/news/image/psb.webp2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/image/psb.webp2.jpg -------------------------------------------------------------------------------- /webroot/news/image/windiest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/image/windiest.jpg -------------------------------------------------------------------------------- /webroot/news/image/windiest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/image/windiest.png -------------------------------------------------------------------------------- /webroot/news/dist/image/psb.webp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/dist/image/psb.webp.jpg -------------------------------------------------------------------------------- /webroot/news/dist/image/psb.webp2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/dist/image/psb.webp2.jpg -------------------------------------------------------------------------------- /webroot/news/dist/image/windiest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/dist/image/windiest.jpg -------------------------------------------------------------------------------- /webroot/news/dist/html/template/login.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webroot/news/image/loading_img_56@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/image/loading_img_56@2x.png -------------------------------------------------------------------------------- /webroot/news/dist/html/template/newsList.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/secondList.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/thirdList.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webroot/news/image/b5fd500a56552f4687a0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/image/b5fd500a56552f4687a0.jpg -------------------------------------------------------------------------------- /webroot/news/dist/image/loading_img_56@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/webroot/news/dist/image/loading_img_56@2x.png -------------------------------------------------------------------------------- /webroot/news/template/newsList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /webroot/news/template/secondList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /webroot/news/template/thirdList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /vue-news/public/b30684b1cb89e7e4851903728c77296f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wscats/news/HEAD/vue-news/public/b30684b1cb89e7e4851903728c77296f.jpg -------------------------------------------------------------------------------- /webroot/news/dist/html/directive/loading.html: -------------------------------------------------------------------------------- 1 |

数据加载中

-------------------------------------------------------------------------------- /old/register.php: -------------------------------------------------------------------------------- 1 | 'abcdefghijk','userId'=>'1',"xss"=>"/> -------------------------------------------------------------------------------- /webroot/news/directive/loading.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 |

数据加载中

7 |
8 |
-------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var wsscats = require('wsscats') 2 | //获取的是一个装有newsApi和turingApi的函数 3 | //console.log(wsscats) 4 | //执行函数请求接口,获取 5 | var newsData = wsscats.newsApi({ 6 | callback: 'JSON_CALLBACK', 7 | page: 1 8 | }, function(data) { 9 | console.log(data) 10 | }); 11 | var turingData = wsscats.turingApi({ 12 | callback: 'JSON_CALLBACK', 13 | message: '你好' 14 | }, function(data) { 15 | console.log(data) 16 | }); -------------------------------------------------------------------------------- /old/view/map.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | -------------------------------------------------------------------------------- /old/view/preview.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 | SinaAppEngine(SAE)是中国最早的公有云服务商、最大的PaaS服务厂商,也是国家工信部首批认证通过的“可信云”,提供网站、存储、数据库、缓存、队列、安全等服务 5 |

6 | 7 |
8 | -------------------------------------------------------------------------------- /vue-news/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vue Webpack Example 8 | 9 | 10 | 11 |
12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/index.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /webroot/news/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | -------------------------------------------------------------------------------- /mime.js: -------------------------------------------------------------------------------- 1 | exports.types = { 2 | "css": "text/css", 3 | "gif": "image/gif", 4 | "html": "text/html", 5 | "ico": "image/x-icon", 6 | "jpeg": "image/jpeg", 7 | "jpg": "image/jpeg", 8 | "js": "text/javascript", 9 | "json": "application/json", 10 | "pdf": "application/pdf", 11 | "png": "image/png", 12 | "svg": "image/svg+xml", 13 | "swf": "application/x-shockwave-flash", 14 | "tiff": "image/tiff", 15 | "txt": "text/plain", 16 | "wav": "audio/x-wav", 17 | "wma": "audio/x-ms-wma", 18 | "wmv": "video/x-ms-wmv", 19 | "xml": "text/xml" 20 | } -------------------------------------------------------------------------------- /vue-news/app/channel/hot.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /vue-news/app/channel/recommend.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /old/baiduApi.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue-news/app/channel/entertainment.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /webroot/news/template/index.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 8 |
9 |
10 | 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /webroot/news/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "autumnswinds", 3 | "version": "1.0.2", 4 | "description": "A use of angular framework to write the news system", 5 | "main": "gulpfile.js", 6 | "scripts": { 7 | "test": "gulp" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/Wscats" 12 | }, 13 | "dependencies": { 14 | "gulp": "*" 15 | }, 16 | "keywords": [ 17 | "angular", 18 | "weui", 19 | "swiper" 20 | ], 21 | "bugs": { 22 | "url": "https://github.com/Wscats/news/issues" 23 | }, 24 | "author": "wscats", 25 | "license": "ISC" 26 | } 27 | -------------------------------------------------------------------------------- /old/view/setting.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
我的信息
4 |
我的登記
5 |
6 |
wsscat
7 |
456
8 |
9 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/register.html: -------------------------------------------------------------------------------- 1 |
注册
-------------------------------------------------------------------------------- /webroot/news/dist/html/directive/searchBar.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webroot/news/news.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue-news/app/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 32 | -------------------------------------------------------------------------------- /webroot/news/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

{{name}}

13 | 14 | 25 | 26 | -------------------------------------------------------------------------------- /old/baiduApi2.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /old/login.php: -------------------------------------------------------------------------------- 1 | 'abcdefghijk','userId'=>'1',"xss"=>"".""/>'abcdefghijk','userId'=>'1','infomation'=>array())); 17 | //var_dump(json_decode(array('token'=>'abcdefghijk'))); 18 | }else{ 19 | echo "登陸失敗"; 20 | }*/ 21 | ?> -------------------------------------------------------------------------------- /vue-news/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "main.js", 6 | "dependencies": { 7 | "vue": "^2.1.10" 8 | }, 9 | "devDependencies": { 10 | "babel-cli": "^6.23.0", 11 | "babel-core": "^6.23.1", 12 | "babel-loader": "^6.3.2", 13 | "babel-preset-es2015": "^6.22.0", 14 | "css-loader": "^0.26.1", 15 | "less": "^2.7.2", 16 | "less-loader": "^2.2.3", 17 | "vue": "^2.1.6", 18 | "vue-loader": "^10.0.2", 19 | "vue-template-compiler": "^2.1.6", 20 | "vuex": "^2.2.1", 21 | "webpack": "^1.14.0" 22 | }, 23 | "scripts": { 24 | "test": "echo \"Error: no test specified\" && exit 1" 25 | }, 26 | "author": "wscats", 27 | "license": "ISC" 28 | } 29 | -------------------------------------------------------------------------------- /webroot/news/template/register.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 |
7 |
8 |
9 |
10 |
11 | 12 |
13 |
14 |
15 |
16 | 注册 17 |
18 | -------------------------------------------------------------------------------- /webroot/news/directive/searchBar.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /vue-news/public/api/detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "news_list": [ 3 | { 4 | "id": "15", 5 | "title": "\u4e3a\u4ec0\u4e48\u9152\u5e97\u5395\u6240\uff08\u6d74\u5ba4\uff09\u73bb\u7483\u90fd\u662f\u900f\u660e\uff0c\u6216\u8005\u534a\u900f\u660e\u7684\uff1f", 6 | "text": "\u6211\u6df1\u4fe1\u8fd9\u6837\u7684\u8bbe\u8ba1\u4e0d\u662f\u4e3a\u4e86\u770b\u91cc\u9762\u7684\u4eba\u6d17\u6fa1\uff08\u624d\u602a\uff01\uff1f\uff09\uff0c\u73bb\u7483\u7684\u80cc\u540e\u80af\u5b9a\u9690\u85cf\u4e86\u5f88\u6df1\u7684\u8bbe\u8ba1\u7528\u610f\uff0c\u55ef\uff0c\u4eca\u5929\u5c31\u4e3a\u4f60\u5448\u4e0a\u4f7f\u7528\u6d74\u5ba4\u900f\u660e\u73bb\u7483\u768410\u5927\u539f\u56e0\u2026\u2026", 7 | "channel_id": "6", 8 | "channel_name": "\u63a8\u8350", 9 | "image": "http:\/\/localhost:81\/news\/php\/uploads\/aaa_15.png" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /old/view/gameDetail.html: -------------------------------------------------------------------------------- 1 |
2 |

{{new.title}}

3 |

{{new.source}} {{new.pubDate}} 查看原文

4 | 5 |
6 |

7 | {{new.desc}} 8 |

9 |
10 |
11 | -------------------------------------------------------------------------------- /webroot/news/indexTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /webroot/news/js/directive/directive.js: -------------------------------------------------------------------------------- 1 | ; 2 | (function() { 3 | //组件组件 4 | var app = angular.module('news.directive', []) 5 | //新闻列表 6 | app.directive('newsList', [function() { 7 | return { 8 | templateUrl: 'directive/newsList.html' 9 | } 10 | }]) 11 | //搜索框 12 | app.directive('searchBar', [function() { 13 | return { 14 | templateUrl: 'directive/searchBar.html' 15 | } 16 | }]) 17 | //轮播图 18 | app.directive('swiper', [function() { 19 | return { 20 | templateUrl: 'directive/swiper.html', 21 | link: function(scope, ele, attr) { 22 | var swiper = new Swiper('.swiper-container', { 23 | pagination: '.swiper-pagination', 24 | paginationClickable: true 25 | }); 26 | } 27 | } 28 | }]) 29 | //loading 30 | app.directive('loading',[function() { 31 | return { 32 | templateUrl: 'directive/loading.html' 33 | } 34 | }]) 35 | })() -------------------------------------------------------------------------------- /vue-news/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devtool: 'eval-source-map', //用于调试代码 3 | entry: __dirname + "/main.js", //入口文件 4 | output: { 5 | path: __dirname + "/public", //打包后的文件存放的地方 6 | filename: "bundle.js" //打包后输出文件的文件名 7 | }, 8 | module: { 9 | loaders: [{ 10 | test: /\.css$/, 11 | loader: 'style-loader!css-loader' 12 | }, { 13 | test: /\.(png|jpg)$/, 14 | loader: 'url-loader?limit=8192' 15 | }, { 16 | test: /\.js$/, 17 | exclude: /node_modules/, 18 | loader: "babel-loader", 19 | }, { 20 | test: /\.vue$/, 21 | loader: 'vue-loader' 22 | }] 23 | }, 24 | //ES6转ES5 25 | //执行webpack记得注释一下 26 | /*babel: { 27 | presets: ['es2015'] 28 | },*/ 29 | devServer: { 30 | contentBase: "./public", //本地服务器所加载的页面所在的目录 31 | historyApiFallback: true, //不跳转 32 | inline: true //实时刷新 33 | }, 34 | resolve: { 35 | alias: { 36 | vue: 'vue/dist/vue.js' 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | news 4 | 5 | 6 | 7 | 8 | 9 | com.aptana.editor.php.aptanaPhpBuilder 10 | 11 | 12 | 13 | 14 | com.aptana.ide.core.unifiedBuilder 15 | 16 | 17 | 18 | 19 | 20 | com.aptana.projects.webnature 21 | com.aptana.editor.php.phpNature 22 | 23 | 24 | 25 | 1469149726489 26 | 27 | 26 28 | 29 | org.eclipse.ui.ide.multiFilter 30 | 1.0-name-matches-false-false-node_modules 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /old/view/login.html: -------------------------------------------------------------------------------- 1 |
2 |

信息登錄系統

3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /old/view/register.html: -------------------------------------------------------------------------------- 1 |
2 |

信息註冊系統

3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /vue-news/app/wheader.vue: -------------------------------------------------------------------------------- 1 | 20 | 41 | -------------------------------------------------------------------------------- /old/baiduApi3.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /old/dist/css/base.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | header { 7 | background-color: #d43d3d; 8 | position: fixed; 9 | z-index: 10; 10 | width: 100%; 11 | text-align: center; 12 | color: white; 13 | height: 50px; 14 | line-height: 50px; 15 | top: 0px; 16 | } 17 | 18 | aside { 19 | position: fixed; 20 | top: 50px; 21 | width: 100%; 22 | z-index: 9; 23 | padding: 10px; 24 | background: #f4f5f6; 25 | } 26 | 27 | aside p { 28 | /*padding: 10px;*/ 29 | } 30 | 31 | aside p a { 32 | text-decoration: none; 33 | color: black; 34 | } 35 | 36 | .isNavRed { 37 | color: red; 38 | } 39 | /*底部的切换菜单*/ 40 | footer { 41 | height: 50px; 42 | position: fixed; 43 | bottom: 0; 44 | left: 0; 45 | background: #fff; 46 | opacity: 0.9; 47 | width: 100%; 48 | z-index: 100; 49 | border-top: 1px solid #f2f2f2; 50 | } 51 | 52 | a { 53 | text-decoration: none; 54 | color: #000; 55 | } 56 | 57 | footer .current { 58 | color: red; 59 | } 60 | 61 | .ft-part { 62 | width: 50%; 63 | height: 50px; 64 | line-height: 50px; 65 | text-align: center; 66 | font-size: 12px; 67 | float: left; 68 | cursor: pointer; 69 | } 70 | 71 | .ft-part em { 72 | font-style: normal; 73 | } -------------------------------------------------------------------------------- /webroot/news/js/service/service.js: -------------------------------------------------------------------------------- 1 | ; 2 | (function() { 3 | var app = angular.module('news.service', []); 4 | app.service("cookie", ['$document', function($document) { 5 | return { 6 | setCookie: function(name, value) { 7 | var days = 10; 8 | var ex = new Date(); 9 | ex.setTime(ex.getTime() + days * 24 * 60 * 60 * 1000); 10 | $document[0].cookie = name + "=" + value + ";expires=" + ex; 11 | }, 12 | getCookie: function(name) { 13 | var a; 14 | var reg = new RegExp("(^|)" + name + "=([^;]*)(;|$)"); 15 | if(a = $document[0].cookie.match(reg)) { 16 | return a[2]; 17 | } 18 | } 19 | } 20 | }]); 21 | 22 | //选区几张照片显示在轮播图上,默认三张 23 | app.service("swiperImg", [function(){ 24 | return { 25 | get: function(data, num){ 26 | if(num){ 27 | 28 | }else{ 29 | //如果没传参数进来则设置取图数量为2 30 | num = 2; 31 | } 32 | var imgs = []; 33 | angular.forEach(data,function(data, index){ 34 | if(data.havePic&&imgs.length<=num){ 35 | //记录有图片是出现在第几条 36 | data.id = index 37 | imgs.push(data) 38 | } 39 | }) 40 | return imgs; 41 | } 42 | } 43 | }]); 44 | })(); -------------------------------------------------------------------------------- /vue-news/app/wdetail.vue: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /turingApi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author wsscat 3 | */ 4 | var http = require('http'); 5 | var querystring = require('querystring'); 6 | function turingApi(param, callback, response) { 7 | console.log(param) 8 | var data = { 9 | //图灵机器人需要的API KEY 10 | key: 'c75ba576f50ddaa5fd2a87615d144ecf', 11 | //向图灵机器人发送的问题 12 | info: param.message 13 | }; 14 | http.request({ 15 | //域名 16 | hostname: 'www.tuling123.com', 17 | //端口号 18 | port: '80', 19 | //路由和参数 后面是需要提交的数据 20 | path: '/openapi/api?' + querystring.stringify(data), 21 | //请求方法 可以为post 22 | method: 'GET' 23 | }, function(resquest) { 24 | //console.log('STATUS: ' + resquest.statusCode); 25 | //console.log('HEADERS: ' + JSON.stringify(resquest.headers)); 26 | resquest.setEncoding('utf8'); 27 | //这里用str来不间断监听数据 28 | var str = ''; 29 | resquest.on('data', function(data) { 30 | console.log('相应的内容为: ' + data); 31 | str += data; 32 | //如果在这里直接打印数据,会有可能丢失数据 33 | //response.end(param.callback + "(" + data + ")"); 34 | }); 35 | //监听数据成功后才去拼jsonp的数据 36 | resquest.on('end', function() { 37 | if(response){ 38 | response.end(param['callback'] + "(" + str + ")"); 39 | }else{ 40 | callback(str) 41 | } 42 | //response.end(str); 43 | }) 44 | }).on('error', function(e) { 45 | console.log('problem with request: ' + e.message); 46 | }).end(); 47 | } 48 | exports.turingApi = turingApi; -------------------------------------------------------------------------------- /newsApi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author wsscat 3 | */ 4 | //引入http的nodejs原生模块 5 | var http = require('http'); 6 | //param来自于http.js从url上获取的参数 格式是一个对象 7 | //response来自于http.js的http.createServer的response对象 8 | function newsApi(param,callback,response) { 9 | http.request({ 10 | //域名 11 | hostname: 'apis.baidu.com', 12 | //端口 13 | port: '80', 14 | path: '/showapi_open_bus/channel_news/search_news?channelId='+param.channelId+'&title=%E4%B8%8A%E5%B8%82&page='+param.page+'&needContent=0&needHtml=0', 15 | //用get请求 16 | method: 'GET', 17 | headers: { 18 | //设置百度的apiKey 19 | 'apikey': '0aea38d1a7c4443f2f00adc86c4c3e72', 20 | //'Access-Control-Allow-Origin':'*' 21 | } 22 | }, function(request) { 23 | //设置请求结果解析为utf-8编码 24 | request.setEncoding('utf-8'); 25 | //刚开始还没拿数据的时候是为空 26 | var str = ''; 27 | //遍历监听数据源,并存放到str里面 28 | request.on('data', function(data) { 29 | str += data; 30 | }) 31 | //当确定数据已经完全获取回来后我们再把他组装成jsonp 32 | request.on('end', function(data) { 33 | if(response){ 34 | //console.log('have response'); 35 | //如果有response,即有传服务器的response进来,则把结果打印, 36 | response.end(param.callback + '(' + str + ')'); 37 | }else{ 38 | //console.log('have not response'); 39 | //回调函数,把结果传出去 40 | callback(str) 41 | } 42 | }) 43 | }).end() 44 | } 45 | //导出newsApi模块给http.js模块使用 46 | exports.newsApi = newsApi; -------------------------------------------------------------------------------- /old/ghpage/tab.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Angular选项卡 8 | 9 | 10 | 11 | 12 |
13 |
14 |
我的信息
15 |
我的登記
16 |
17 |
wsscat
18 |
456
19 |
20 | 21 | 37 | 53 | 54 | -------------------------------------------------------------------------------- /vue-news/app/wsearch.vue: -------------------------------------------------------------------------------- 1 | 17 | 47 | -------------------------------------------------------------------------------- /webroot/news/dist/html/directive/swiper.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /vue-news/app/wswiper.vue: -------------------------------------------------------------------------------- 1 | 12 | 31 | -------------------------------------------------------------------------------- /webroot/news/js/ngPost.js: -------------------------------------------------------------------------------- 1 | angular.module('ng.post', [], function($httpProvider) { 2 | // Use x-www-form-urlencoded Content-Type 3 | $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; 4 | 5 | /** 6 | * The workhorse; converts an object to x-www-form-urlencoded serialization. 7 | * @param {Object} obj 8 | * @return {String} 9 | */ 10 | var param = function(obj) { 11 | var query = '', 12 | name, value, fullSubName, subName, subValue, innerObj, i; 13 | 14 | for(name in obj) { 15 | value = obj[name]; 16 | 17 | if(value instanceof Array) { 18 | for(i = 0; i < value.length; ++i) { 19 | subValue = value[i]; 20 | fullSubName = name + '[' + i + ']'; 21 | innerObj = {}; 22 | innerObj[fullSubName] = subValue; 23 | query += param(innerObj) + '&'; 24 | } 25 | } else if(value instanceof Object) { 26 | for(subName in value) { 27 | subValue = value[subName]; 28 | fullSubName = name + '[' + subName + ']'; 29 | innerObj = {}; 30 | innerObj[fullSubName] = subValue; 31 | query += param(innerObj) + '&'; 32 | } 33 | } else if(value !== undefined && value !== null) 34 | query += encodeURIComponent(name) + '=' + encodeURIComponent(value) + '&'; 35 | } 36 | 37 | return query.length ? query.substr(0, query.length - 1) : query; 38 | }; 39 | 40 | // Override $http service's default transformRequest 41 | $httpProvider.defaults.transformRequest = [function(data) { 42 | return angular.isObject(data) && String(data) !== '[object File]' ? param(data) : data; 43 | }]; 44 | }); -------------------------------------------------------------------------------- /webroot/cms/sqll.js: -------------------------------------------------------------------------------- 1 | var mysql = require('mysql'); 2 | 3 | function curd() { 4 | this.connection = mysql.createConnection({ 5 | //域名 6 | host: 'localhost', 7 | //数据库的用户名 8 | user: 'winds', 9 | //数据库的密码 10 | password: '123456789', 11 | database: 'ws' 12 | }) 13 | //数据库进行连接 14 | this.connection.connect(); 15 | } 16 | //取user表所有数据 17 | //进行查询数据 18 | //select 选择所在的列 from 数据库的表 where 选择条件 19 | curd.prototype.find = function(table, col, callback) { 20 | this.connection.query('select ' + col + ' from ' + table, function(err, rows, filed) { 21 | callback(err, rows); 22 | }) 23 | } 24 | //根据主键获取数据 25 | curd.prototype.findByPk = function(table, col, statement, callback) { 26 | console.log('select ' + col + ' from ' + table + ' where ' + statement); 27 | this.connection.query('select ' + col + ' from ' + table + ' where ' + statement, function(err, rows) { 28 | callback(err, rows); 29 | }) 30 | } 31 | //INSERT INTO 数据库的表 (列名, 列名, 列名) VALUES (值, 值, 值); 32 | curd.prototype.add = function(table, value, statement, callback) { 33 | //进行增加数据 34 | this.connection.query('INSERT INTO ' + table + ' (' + value + ') VALUES (' + statement + ')', function(err) { 35 | callback(err); 36 | }) 37 | } 38 | //DELETE FROM 数据库的表 WHERE 选择条件 39 | curd.prototype.delete = function(table, statement, callback) { 40 | //进行删除数据 41 | this.connection.query('DELETE FROM ' + table + ' WHERE ' + statement, function(err) { 42 | callback(err) 43 | }); 44 | } 45 | //UPDATE 数据库的表 SET 列=值,列=值 WHERE 选所在行的条件 46 | curd.prototype.update = function(table, value, statement, callback) { 47 | //进行改数据 48 | this.connection.query('UPDATE ' + table + ' SET ' + value + ' WHERE ' + statement, function(err) { 49 | callback(err); 50 | }) 51 | } 52 | //导出对象,外部引用 53 | exports.curd = new curd(); -------------------------------------------------------------------------------- /webroot/news/js/base.js: -------------------------------------------------------------------------------- 1 | var app = angular.module('newsApp', ['ui.router', 'ng.post', 'news.controller', 'news.service', 'news.directive']); 2 | //配置路由, 3 | app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { 4 | $stateProvider.state('index', { 5 | //url+#/index 6 | url: '/index', 7 | templateUrl: 'template/index.html', 8 | controller: 'indexCtrl' 9 | }).state('index.list', { 10 | //国内最新 11 | url: '/list', 12 | templateUrl: 'template/newsList.html', 13 | controller: 'listCtrl' 14 | }).state('index.secondlist', { 15 | //游戏焦点 16 | url: '/secondlist', 17 | templateUrl: 'template/secondList.html', 18 | controller: 'secondListCtrl' 19 | }).state('index.thirdlist', { 20 | //国际焦点 21 | url: '/thirdlist', 22 | templateUrl: 'template/thirdList.html', 23 | controller: 'thirdListCtrl' 24 | }).state('detail', { 25 | //新闻的详细内容 26 | url: '/detail/:channelId/:id', 27 | templateUrl: 'template/detail.html', 28 | controller: 'detailCtrl' 29 | }).state('login', { 30 | url: '/login', 31 | templateUrl: 'template/logins.html', 32 | controller: 'loginsCtrl' 33 | }).state('register', { 34 | url: '/register', 35 | templateUrl: 'template/register.html', 36 | controller: 'registerCtrl' 37 | }).state('setting', { 38 | url: '/setting', 39 | templateUrl: 'template/setting.html', 40 | controller: 'settingCtrl' 41 | }) 42 | $urlRouterProvider.when('', '/index/list'); 43 | }]) 44 | //设置api的路径 45 | app.value('apiUrl','http://localhost:12345/newsApi'); 46 | //app.value('apiUrl','http://localhost:12345/news/dist/js/test.json'); 47 | //设置api请求的方法,发布时候用jsonp,get只是请求用来请求测试的json文件~ 48 | app.value('apiMethod','get'); 49 | //测试数据 50 | var news = json; 51 | console.log(news); 52 | -------------------------------------------------------------------------------- /webroot/news/directive/swiper.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 |
8 | 11 |
12 | 13 |
14 |
15 | -------------------------------------------------------------------------------- /vue-news/app/wpannel.vue: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /vue-news/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | //var Vue = require('vue') 3 | import VueRouter from 'vue-router' 4 | //var VueRouter = require('vue-router'); 5 | import 'weui' 6 | //require('weui') 7 | import Vuex from 'vuex'; 8 | //var Vuex = require('vuex') 9 | import $ from 'jquery' 10 | //var $ = require('jquery') 11 | window.$ = $ 12 | window.jQuery = $ 13 | 14 | var index = require('./app/index.vue') 15 | var wdetail = require('./app/wdetail.vue') 16 | var recommend = require('./app/channel/recommend.vue') 17 | var hot = require('./app/channel/hot.vue') 18 | var entertainment = require('./app/channel/entertainment.vue') 19 | 20 | Vue.use(VueRouter) 21 | const routes = [{ 22 | path: '/index', 23 | component: index, 24 | children: [{ 25 | path: 'recommend/:id', 26 | component: recommend 27 | }, { 28 | path: 'hot/:id', 29 | component: hot 30 | }, { 31 | path: 'entertainment/:id', 32 | component: entertainment 33 | }] 34 | }, { 35 | path: '/detail/:id', 36 | component: wdetail 37 | }, { 38 | //默认重定向 redirect 39 | path: '/', 40 | redirect: '/index/recommend/6' 41 | }] 42 | 43 | const router = new VueRouter({ 44 | routes //(缩写)相当于 routes: routes 45 | }) 46 | 47 | Vue.use(Vuex); 48 | 49 | const store = new Vuex.Store({ 50 | state: { 51 | searchName: 'hello vuex, I am wscats', 52 | }, 53 | //接受组件commit传过来的数据并保存到state中,this.$store.commit('changeSearchName', this.searchName); 54 | mutations: { 55 | changeSearchName: function(state, a) { 56 | state.searchName = a; 57 | }, 58 | }, 59 | //可以从组件调用此方法获取值,一般配合计算属性动态获取值 60 | //(1)return this.$store.state.searchName 61 | //(2)return this.$store.getters.getSearchName 62 | getters: { 63 | getSearchName: function(state) { 64 | return state.searchName; 65 | } 66 | } 67 | }) 68 | 69 | /*new Vue({ 70 | el: '#app', 71 | render: (createElement) => createElement(App) 72 | })*/ 73 | 74 | const app = new Vue({ 75 | router, 76 | store 77 | }).$mount('#app') -------------------------------------------------------------------------------- /webroot/cms/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

wscat's test file

11 | 12 | 13 | 85 | 86 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/logins.html: -------------------------------------------------------------------------------- 1 |
Login
Register
-------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "20", 3 | "version": "3.1.9", 4 | "description": "A use of angular framework to write the news system, I used the style of weui, production of carousel figure by swiper, using nodejs's native module to make the server, using the gulp to build the project automation, I am wscats, my master is autumnswind,", 5 | "main": "http.js", 6 | "scripts": { 7 | "gulp": "gulp", 8 | "test": "gulp && node http", 9 | "cms": "node cms/news.js", 10 | "http": "node http", 11 | "dev": "npm run cms && npm run http" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/Wscats" 16 | }, 17 | "keywords": [ 18 | "node", 19 | "weui", 20 | "angular", 21 | "swiper", 22 | "node-server", 23 | "gulp", 24 | "autumnswind", 25 | "wscats" 26 | ], 27 | "author": { 28 | "name": "wscats" 29 | }, 30 | "license": "ISC", 31 | "_id": "20@3.1.6", 32 | "_shasum": "ba74f967dced66a2ded61202ff52664435f1ef61", 33 | "_from": "20@latest", 34 | "_npmVersion": "2.15.1", 35 | "_nodeVersion": "4.4.4", 36 | "_npmUser": { 37 | "name": "autumnswind", 38 | "email": "AutumnsWinds@gmail.com" 39 | }, 40 | "dist": { 41 | "shasum": "ba74f967dced66a2ded61202ff52664435f1ef61", 42 | "tarball": "https://registry.npmjs.org/20/-/20-3.1.6.tgz" 43 | }, 44 | "maintainers": [ 45 | { 46 | "name": "autumnswind", 47 | "email": "AutumnsWinds@gmail.com" 48 | } 49 | ], 50 | "_npmOperationalInternal": { 51 | "host": "packages-18-east.internal.npmjs.com", 52 | "tmp": "tmp/20-3.1.6.tgz_1481208347093_0.9346606880426407" 53 | }, 54 | "directories": {}, 55 | "_resolved": "https://registry.npmjs.org/20/-/20-3.1.6.tgz", 56 | "dependencies": { 57 | "gulp": "*", 58 | "gulp-uglify": "*", 59 | "gulp-rename": "*", 60 | "gulp-concat": "*", 61 | "gulp-minify-css": "*", 62 | "gulp-minify-html": "*", 63 | "gulp-imagemin": "*" 64 | }, 65 | "bugs": { 66 | "url": "https://github.com/Wscats/news/issues" 67 | }, 68 | "readme": "ERROR: No README data found!" 69 | } 70 | -------------------------------------------------------------------------------- /webroot/news/dist/html/directive/newsList.html: -------------------------------------------------------------------------------- 1 |
点击文字此处进行排序

{{new.title?new.title:'加载中...'}}

{{new.desc?new.desc:'加载中'}}

查看更多
正在加载
查看最新新闻
查看最久新闻
-------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |

News

5 | 6 |

7 | Use Weui, Angular Or Vue prepared by the news client 8 |

9 | 基于 Angular.js Vue.js, Weui 和 Node.js 重写的新闻客户端, 10 | Live Demo 11 |

12 | 13 |

14 | Made with ❤︎ by 15 | Wscats 16 | 17 |

18 | 19 |

20 | 21 | 22 | 23 | 24 |

25 | 26 |
27 | 28 | 29 | ## Installation(Git) 30 | 31 | 克隆项目地址并下载(需要已安装[Git](https://git-scm.com/downloads)),[点击预览(移动端效果更佳)](https://wscats.github.io/Angular-news/news/indexTest.html),[新增Vue2版本](https://wscats.github.io/Angular-news/vue-news/public/index.html) 32 | ``` 33 | git clone https://github.com/Wscats/news.git 34 | ``` 35 | 36 | 启动服务(http://localhost:12345/news/index.html) 37 | ``` 38 | npm run dev 39 | ``` 40 | ## Building 41 | 通过`npm`安装本地服务第三方依赖模块(需要已安装[Node.js](https://nodejs.org/)),当然也可以先不安装依赖暂时省略这步,运行`node http`直接查看项目效果 42 | ``` 43 | npm install 44 | ``` 45 | 然后执行[gulp](https://github.com/gulpjs/gulp)构建项目文件和打开服务器等 46 | ``` 47 | npm run test 48 | ``` 49 | 50 | 51 | ## Installation(NPM) 52 | 53 | 通过`npm`安装本地服务第三方依赖模块(需要已安装[Node.js](https://nodejs.org/)),当然也可以先不安装依赖暂时省略这步,运行`node http`直接查看项目效果 54 | ``` 55 | npm install 56 | ``` 57 | 执行node指令运行http.js 58 | ``` 59 | node http 60 | ``` 61 | 用浏览器打开链接 62 | ``` 63 | http://localhost:12345/news/index.html 64 | ``` 65 | 66 | ## License 67 | 68 | [MIT](http://opensource.org/licenses/MIT) 69 | Copyright (c) 2019 ❤︎[Wscats](https://github.com/Wscats) -------------------------------------------------------------------------------- /webroot/news/gulpfile.js: -------------------------------------------------------------------------------- 1 | //引入gulp模块 2 | var gulp = require('gulp'); 3 | //压缩js代码的模块 4 | var uglify = require('gulp-uglify'); 5 | //重名名的模块 6 | var rename = require('gulp-rename'); 7 | //合并代码 8 | var concat = require('gulp-concat'); 9 | //压缩css模块 10 | var minifycss = require('gulp-minify-css'); 11 | //压缩html模块 12 | var minifyhtml = require('gulp-minify-html'); 13 | //压缩图片的模块 14 | var imagemin = require('gulp-imagemin') 15 | //定义一个压缩js的任务 16 | gulp.task('minify', function() { 17 | gulp.src(['js/angular.js', 'js/ngPost.js', 'js/angular-ui-router.js', 'js/swiper.js']) 18 | //把js合并成main.js 19 | .pipe(concat('framework.js')) 20 | //重名名 21 | .pipe(rename({ 22 | //修改后缀 23 | suffix: '.wscats', 24 | })) 25 | //导出js 26 | .pipe(gulp.dest('dist/js')); 27 | 28 | //引入需要被处理的js文件 29 | gulp.src(['js/base.js', 'js/controller/controller.js', 'js/service/service.js', 'js/directive/directive.js']) 30 | //把js合并成main.js 31 | .pipe(concat('main.js')) 32 | //重名名 33 | .pipe(rename({ 34 | //修改后缀 35 | suffix: '.wscats', 36 | })) 37 | //压缩js 38 | .pipe(uglify()) 39 | //导出js 40 | .pipe(gulp.dest('dist/js')); 41 | }); 42 | //定义一个压缩css的任务 43 | gulp.task('minifycss', function() { 44 | gulp.src(['css/*.css']) 45 | .pipe(concat('main.css')) 46 | //重名名 47 | .pipe(rename({ 48 | //修改后缀 49 | suffix: '.wscats', 50 | })) 51 | .pipe(minifycss()) 52 | .pipe(gulp.dest('dist/css')) 53 | }) 54 | gulp.task('minifyhtml', function() { 55 | gulp.src(['directive/*.html']) 56 | .pipe(minifyhtml()) 57 | .pipe(gulp.dest('dist/html/directive')) 58 | 59 | gulp.src(['template/*.html']) 60 | .pipe(minifyhtml()) 61 | .pipe(gulp.dest('dist/html/template')) 62 | }) 63 | 64 | gulp.task('imagemin', function() { 65 | gulp.src('image/*+(jpg|png|gif|jpeg)') 66 | .pipe(imagemin({ 67 | optimizationLevel: 7, //类型:Number 默认:3 取值范围:0-7(优化等级) 68 | progressive: true, //类型:Boolean 默认:false 无损压缩jpg图片 69 | interlaced: true, //类型:Boolean 默认:false 隔行扫描gif进行渲染 70 | multipass: true //类型:Boolean 默认:false 多次优化svg直到完全优化 71 | })) 72 | .pipe(gulp.dest('dist/image')) 73 | }) 74 | 75 | //监听改动的js并执行压缩任务 76 | //gulp.watch(['js/base.js', 'js/controller/controller.js', 'js/service/service.js', 'js/directive/directive.js'], ['minify']) 77 | 78 | gulp.task('default', ['minify', 'minifycss', 'minifyhtml', 'imagemin']); -------------------------------------------------------------------------------- /old/view/game.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |

{{new.title}}

6 | 7 | 8 | 9 |

10 | {{new.desc}} 11 |

12 |
13 |
14 | 15 | 18 |
19 | 20 |
21 | -------------------------------------------------------------------------------- /webroot/news/template/logins.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 |
Login
16 |
Register
17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 |
28 |
29 | 30 |
31 |
32 |
33 |
34 | 登录 35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | 43 |
44 |
45 |
46 |
47 |
48 | 49 |
50 |
51 |
52 |
53 | 注册 54 |
55 |
56 |
57 | -------------------------------------------------------------------------------- /vue-news/public/api/list.json: -------------------------------------------------------------------------------- 1 | { 2 | "news_list": [ 3 | { 4 | "id": "15", 5 | "title": "\u4e3a\u4ec0\u4e48\u9152\u5e97\u5395\u6240\uff08\u6d74\u5ba4\uff09\u73bb\u7483\u90fd\u662f\u900f\u660e\uff0c\u6216\u8005\u534a\u900f\u660e\u7684\uff1f", 6 | "text": "\u6211\u6df1\u4fe1\u8fd9\u6837\u7684\u8bbe\u8ba1\u4e0d\u662f\u4e3a\u4e86\u770b\u91cc\u9762\u7684\u4eba\u6d17\u6fa1\uff08\u624d\u602a\uff01\uff1f\uff09\uff0c\u73bb\u7483\u7684\u80cc\u540e\u80af\u5b9a\u9690\u85cf\u4e86\u5f88\u6df1\u7684\u8bbe\u8ba1\u7528\u610f\uff0c\u55ef\uff0c\u4eca\u5929\u5c31\u4e3a\u4f60\u5448\u4e0a\u4f7f\u7528\u6d74\u5ba4\u900f\u660e\u73bb\u7483\u768410\u5927\u539f\u56e0\u2026\u2026", 7 | "channel_id": "6", 8 | "channel_name": "\u63a8\u8350", 9 | "image": "http:\/\/localhost:81\/news\/php\/uploads\/aaa_15.png" 10 | }, { 11 | "id": "16", 12 | "title": "\u6b64\u4eba\u6b7b\u540e\u8f70\u52a8\u6574\u4e2a\u4e0a\u6d77\u6ee9\uff0c\u4e09\u5341\u4e07\u4eba\u66ff\u5979\u9001\u846c\uff0c5\u540d\u5c11\u5973\u4e3a\u5176\u81ea\u6740", 13 | "text": "\u8981\u8bf4\u516c\u4f17\u4eba\u7269\uff0c\u660e\u661f\u80af\u5b9a\u4e5f\u662f\u5176\u4e2d\u4e00\u5458\uff0c\u800c\u5728\u6c11\u56fd\u5e74\u95f4\uff0c\u660e\u661f\u53ef\u4e0d\u50cf\u73b0\u5728\u8fd9\u4e48\u591a\uff0c\u90a3\u4e9b\u5f71\u89c6\u660e\u661f\u771f\u7684\u662f\u706b\u904d\u5927\u6c5f\u5357\u5317\uff0c\u4e3a\u4e16\u4eba\u6240\u719f\u77e5\uff0c\u6709\u7684\u5f71\u89c6\u6f14\u5458\u7684\u5f71\u54cd\u529b\u751a\u81f3\u4e0d\u8f93\u4e8e\u5f53\u65f6\u7684\u6587\u5b66\u5927\u5bb6\u3002\u800c\u4f4d\u4e8e\u6c11\u56fd\u56db\u5927\u7f8e\u5973\u4e4b\u4e00\u7684\u962e\u73b2\u7389\u5c31\u662f\u8fd9\u6837\u7684\u4e00\u4f4d\u5973\u6027\uff0c\u5979\u51fa\u751f\u8d2b\u5bd2\uff0c\u5374\u9760\u7740\u81ea\u5df1\u4e00\u6b65\u6b65\u7684\u52aa\u529b\u6210\u4e86\u6700\u8000\u773c\u7684\u660e\u661f\uff0c\u800c\u5979\u5374\u6b7b\u4e8e\u8206\u8bba\u4e4b\u4e0b\uff0c\u962e\u73b2\u7389\u6b7b\u7684\u65f6\u5019\uff0c\u5c31\u6709\u4e94\u540d\u5c11\u5973\u4e3a\u5979\u81ea\u6740\uff0c\u8fd9\u4e94\u540d\u90fd\u662f\u962e\u73b2\u7389\u7684\u5fe0\u5b9e\u7c89\u4e1d\uff0c\u5979\u4eec\u5c06\u962e\u73b2\u7389\u4f5c\u4e3a\u81ea\u5df1\u7684\u699c\u6837\uff0c\u8fd9\u4e9b\u4eba\u6b7b\u7684\u65f6\u5019\u7eb7\u7eb7\u8868\u793a\u962e\u73b2\u7389\u662f\u5979\u4eec\u7684\u7cbe\u795e\u652f\u67f1\uff0c\u5979\u6b7b\u4e86\uff0c\u5979\u4eec\u7684\u5fc3\u4e5f\u6b7b\u4e86\uff0c\u5979\u4eec\u613f\u610f\u8ddf\u968f\u962e\u73b2\u7389\u3002", 14 | "channel_id": "6", 15 | "channel_name": "\u63a8\u8350", 16 | "image": "http:\/\/localhost:81\/news\/php\/uploads\/aaa_19.png" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | //引入gulp模块 2 | var gulp = require('gulp'); 3 | //压缩js代码的模块 4 | var uglify = require('gulp-uglify'); 5 | //重名名的模块 6 | var rename = require('gulp-rename'); 7 | //合并代码 8 | var concat = require('gulp-concat'); 9 | //压缩css模块 10 | var minifycss = require('gulp-minify-css'); 11 | //压缩html模块 12 | var minifyhtml = require('gulp-minify-html'); 13 | //压缩图片的模块 14 | var imagemin = require('gulp-imagemin') 15 | //定义一个压缩js的任务 16 | gulp.task('minify', function() { 17 | gulp.src(['webroot/news/js/angular.js', 'webroot/news/js/ngPost.js', 'webroot/news/js/angular-ui-router.js', 'webroot/news/js/swiper.js']) 18 | //把js合并成main.js 19 | .pipe(concat('framework.js')) 20 | //重名名 21 | .pipe(rename({ 22 | //修改后缀 23 | suffix: '.wscats', 24 | })) 25 | //导出js 26 | .pipe(gulp.dest('webroot/news/dist/js')); 27 | 28 | //引入需要被处理的js文件 29 | gulp.src(['webroot/news/js/base.js', 'webroot/news/js/controller/controller.js', 'webroot/news/js/service/service.js', 'webroot/news/js/directive/directive.js']) 30 | //把js合并成main.js 31 | .pipe(concat('main.js')) 32 | //重名名 33 | .pipe(rename({ 34 | //修改后缀 35 | suffix: '.wscats', 36 | })) 37 | //压缩js 38 | .pipe(uglify()) 39 | //导出js 40 | .pipe(gulp.dest('webroot/news/dist/js')); 41 | }); 42 | //定义一个压缩css的任务 43 | gulp.task('minifycss', function() { 44 | gulp.src(['webroot/news/css/*.css']) 45 | .pipe(concat('main.css')) 46 | //重名名 47 | .pipe(rename({ 48 | //修改后缀 49 | suffix: '.wscats', 50 | })) 51 | .pipe(minifycss()) 52 | .pipe(gulp.dest('webroot/news/dist/css')) 53 | }) 54 | gulp.task('minifyhtml', function() { 55 | gulp.src(['webroot/news/directive/*.html']) 56 | .pipe(minifyhtml()) 57 | .pipe(gulp.dest('webroot/news/dist/html/directive')) 58 | 59 | gulp.src(['webroot/news/template/*.html']) 60 | .pipe(minifyhtml()) 61 | .pipe(gulp.dest('webroot/news/dist/html/template')) 62 | }) 63 | 64 | gulp.task('imagemin', function() { 65 | gulp.src('webroot/news/image/*+(jpg|png|gif|jpeg)') 66 | .pipe(imagemin({ 67 | optimizationLevel: 7, //类型:Number 默认:3 取值范围:0-7(优化等级) 68 | progressive: true, //类型:Boolean 默认:false 无损压缩jpg图片 69 | interlaced: true, //类型:Boolean 默认:false 隔行扫描gif进行渲染 70 | multipass: true //类型:Boolean 默认:false 多次优化svg直到完全优化 71 | })) 72 | .pipe(gulp.dest('webroot/news/dist/image')) 73 | }) 74 | 75 | //监听改动的js并执行压缩任务 76 | //gulp.watch(['js/base.js', 'js/controller/controller.js', 'js/service/service.js', 'js/directive/directive.js'], ['minify']) 77 | 78 | gulp.task('default', ['minify', 'minifycss', 'minifyhtml', 'imagemin']); -------------------------------------------------------------------------------- /old/view/hot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |

{{new.title}}

8 | 9 |

10 | {{new.description}} 11 |

12 |
13 |
14 |
15 |

查看更多

16 |
17 |
18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /old/view/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |

{{new.title}}

8 | 9 |

10 | {{new.description}} 11 |

12 |
13 |
14 |
15 |

查看更多

16 |
17 |
18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /webroot/cms/cms.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var url = require('url'); 3 | var querystring = require('querystring'); 4 | //引入cms操作数据库的模块 5 | var sqll = require('./sql.js'); 6 | 7 | function curd(request, response) { 8 | request.setEncoding('utf-8'); 9 | var pathname = url.parse(request.url).pathname; 10 | var paramsStr = url.parse(request.url).query; 11 | var param = querystring.parse(paramsStr); 12 | //后端路由 13 | console.log("路由:" + pathname); 14 | console.log("Hash值:" + paramsStr); 15 | response.writeHead(200, { 16 | "Content-Type": "text/jsonp;charset=utf-8" 17 | }) 18 | console.log("请求方式:" + request.method); 19 | if(request.method.toUpperCase() == 'POST') { 20 | var postData = ""; 21 | /** 22 | * 因为post方式的数据不太一样可能很庞大复杂, 23 | * 所以要添加监听来获取传递的数据 24 | * 也可写作 req.on("data",function(data){}); 25 | */ 26 | request.addListener("data", function(data) { 27 | postData += data; 28 | }); 29 | /** 30 | * 这个是如果数据读取完毕就会执行的监听方法 31 | */ 32 | request.addListener("end", function() { 33 | //处理angular的post请求的,去掉"[]",因为replace只替换一次,所以用循环替换 34 | while(postData.indexOf('params%5B') >= 0) { 35 | postData = postData.replace('params%5B', ''); 36 | } 37 | while(postData.indexOf('%5D') >= 0) { 38 | postData = postData.replace('%5D', ''); 39 | } 40 | var param = querystring.parse(postData); 41 | console.log("请求参数如下:"); 42 | console.log(param); 43 | if(pathname == '/news/add') { 44 | sqll.curd.add('news', param, function(err) { 45 | if(err) { 46 | console.log("INSERT ERROR" + err); 47 | } else { 48 | var obj = { 49 | status: 1, 50 | info: 'success' 51 | } 52 | response.end(JSON.stringify(obj)); 53 | } 54 | }); 55 | } else if(pathname == '/news/findAll') { 56 | sqll.curd.findAll('news', '*', function(err, rows) { 57 | var obj = {}; 58 | obj.arr = rows; 59 | response.end(JSON.stringify(obj)); 60 | }); 61 | } else if(pathname == '/news/delete') { 62 | sqll.curd.delete('news', param, function(err) { 63 | sqll.curd.findAll('news', '*', function(err, rows) { 64 | var obj = {}; 65 | obj.arr = rows; 66 | response.end(JSON.stringify(obj)); 67 | }); 68 | }); 69 | } else if(pathname == '/news/findByPk') { 70 | sqll.curd.findByPk('news', '*', param, function(err, rows) { 71 | var obj = {}; 72 | obj.new = rows; 73 | response.end(JSON.stringify(obj)); 74 | }); 75 | } else if(pathname == '/news/update') { 76 | sqll.curd.update('news', param, function(err) { 77 | if(err) {} else { 78 | var obj = { 79 | status: 1, 80 | info: 'success' 81 | } 82 | response.end(JSON.stringify(obj)); 83 | } 84 | }); 85 | } 86 | }); 87 | } else if(request.method.toUpperCase() == 'GET') { 88 | 89 | } else { 90 | //head put delete options etc. 91 | //注意angular的post请求监听到的了类型是option,所以记得处理 92 | } 93 | } 94 | 95 | exports.curd = curd; -------------------------------------------------------------------------------- /webroot/cms/sql.js: -------------------------------------------------------------------------------- 1 | var mysql = require('mysql'); 2 | 3 | function curd() { 4 | this.connection = mysql.createConnection({ 5 | //域名 6 | host: 'localhost', 7 | //数据库的用户名 8 | user: 'winds', 9 | //数据库的密码 10 | password: '123456789', 11 | database: 'ws' 12 | }) 13 | //数据库进行连接 14 | this.connection.connect(); 15 | } 16 | //取user表所有数据 17 | //进行查询数据 18 | //select 选择所在的列 from 数据库的表 where 选择条件 19 | curd.prototype.findAll = function(table, col, callback) { 20 | console.log('SQL:' + 'select ' + col + ' from ' + table); 21 | this.connection.query('select ' + col + ' from ' + table, function(err, rows, filed) { 22 | callback(err, rows); 23 | }) 24 | } 25 | //根据主键获取数据 26 | curd.prototype.findByPk = function(table, col, param, callback) { 27 | var arrKey = []; 28 | for(p in param) { 29 | arrKey.push(p + '="' + param[p] + '"'); 30 | } 31 | var keys = arrKey.join(" AND "); 32 | console.log('SQL:' + 'select ' + col + ' from ' + table + ' where ' + keys); 33 | this.connection.query('select ' + col + ' from ' + table + ' where ' + keys, function(err, rows) { 34 | callback(err, rows); 35 | }) 36 | } 37 | //INSERT INTO 数据库的表 (列名, 列名, 列名) VALUES (值, 值, 值); 38 | curd.prototype.add = function(table, param, callback) { 39 | //需要存进数据库的列名 40 | var arrKey = []; 41 | //需要存进数据库的值 42 | var arrValue = []; 43 | //遍历对象 44 | for(p in param) { 45 | arrKey.push(p); 46 | //让值两边都加上单引号 47 | //因为正确格式应该如下 48 | //INSERT INTO news (title,source,text) VALUES ('wscat','abc','cba') 49 | arrValue.push("'" + param[p] + "'"); 50 | } 51 | //数组转字符串 52 | var keys = arrKey.join(","); 53 | var values = arrValue.join(","); 54 | console.log('SQL:' + 'INSERT INTO ' + table + ' (' + keys + ') VALUES (' + values + ')'); 55 | //进行增加数据 56 | this.connection.query('INSERT INTO ' + table + ' (' + keys + ') VALUES (' + values + ')', function(err) { 57 | callback(err); 58 | }) 59 | } 60 | //DELETE FROM 数据库的表 WHERE 选择条件 61 | curd.prototype.delete = function(table, param, callback) { 62 | var arrValue = []; 63 | for(p in param) { 64 | arrValue.push(p + "='" + param[p] + "'"); 65 | } 66 | //支持多个条件删除 AND OR 67 | var values = arrValue.join(" AND "); 68 | console.log('SQL:' + 'DELETE FROM ' + table + ' WHERE ' + values); 69 | //进行删除数据 70 | this.connection.query('DELETE FROM ' + table + ' WHERE ' + values, function(err) { 71 | callback(err) 72 | }); 73 | } 74 | //UPDATE 数据库的表 SET 列=值,列=值 WHERE 选所在行的条件 75 | curd.prototype.update = function(table, param, callback) { 76 | var arrKey = []; 77 | for(p in param) { 78 | arrKey.push(p + "='" + param[p] + "'"); 79 | } 80 | var keys = arrKey.join(","); 81 | console.log('SQL:' + 'UPDATE ' + table + ' SET ' + keys + ' WHERE id =' + param.id) 82 | //进行改数据 根据主键来修改对应的数据 83 | this.connection.query('UPDATE ' + table + ' SET ' + keys + ' WHERE id =' + param.id, function(err) { 84 | callback(err); 85 | }) 86 | } 87 | //导出对象,外部引用 88 | exports.curd = new curd(); -------------------------------------------------------------------------------- /old/README.md: -------------------------------------------------------------------------------- 1 | 🐼Angular write a news single page application DEMO, the comprehensive use of angular commonly used some of the technical points, such as filters, routing, services, controllers, etc. 2 | 3 | #日日新闻客户端 4 | 5 | 效果如下 6 | 7 | ![这里写图片描述](http://img.blog.csdn.net/20160721173253764) 8 | ![这里写图片描述](http://img.blog.csdn.net/20160721173253764) 9 | 10 | | 存放控制器的文件 | 存放框架等文件 | 存放示例文件 | 存放图片素材| 存放视图文件 | 11 | | ------------- |:-------------:| :-------------:| :-------------:| -----:| 12 | |[control](https://github.com/Wscats/news/tree/master/control)|[dist](https://github.com/Wscats/news/tree/master/dist)|[gh-pages](https://github.com/Wscats/news/tree/master/ghpage) |[image](https://github.com/Wscats/news/tree/master/image)|[view](https://github.com/Wscats/news/tree/master/view) | 13 | 14 | [API来源](http://apistore.baidu.com/apiworks/servicedetail/688.html) 15 | 16 | 17 | #触摸滑动服务DEMO 18 | [触摸滑动服务DEMO](https://wscats.github.io/news/ghpage/touch.html) 19 | 20 | 21 | 在对应控制器注入服务`swipe` 22 | ``` 23 | app.controller('autumnsCtrl', ['$scope', 'swipe', function($scope, swipe) {}]) 24 | ``` 25 | 在swipe对象上面执行method服务,并传入需要执行的回调函数 26 | 格式`swipe.method([方向],[回调函数])` 27 | 方向为四个`top,bottom,left,right` 28 | 回调函数的参数可以获取滑动前后的x和y坐标,并且方向的信息 29 | 具体是对象中的`x1,x2,y1,y2`属性,和`direction`属性 30 | 例如 31 | ``` 32 | swipe.method("bottom",function(e){ 33 | console.log(e) 34 | }) 35 | ``` 36 | 37 | #Loading 38 | ![这里写图片描述](http://img.blog.csdn.net/20160730120815011) 39 | ![这里写图片描述](http://img.blog.csdn.net/20160730120815011) 40 | 41 | loading动画在控制器进入前显示,ajax请求数据回调成功触发隐藏 42 | `$scope.loading = true;` 43 | ``` 44 | $http.get(url).success(function(data) { 45 | $scope.loading = false; 46 | } 47 | ``` 48 | 49 | 然后在视图view页面增加loading层,可以用gif也可以用图片配合css3动画 50 | ``` 51 |
52 | .loading { 53 | position: absolute; 54 | z-index: 20; 55 | width: 100%; 56 | height: 100%; 57 | top: 0; 58 | opacity: 0.5; 59 | } 60 | 61 | .loading img { 62 | position: fixed; 63 | left: 50%; 64 | top: 50%; 65 | margin-left: -28px; 66 | margin-top: -28px; 67 | animation: mymove 2s infinite; 68 | animation-timing-function: linear; 69 | animation-direction: normal; 70 | } 71 | ``` 72 | 73 | #页内切换视图 74 | [页内切换视图DEMO](https://wscats.github.io/news/ghpage/tab.html) 75 | 76 | ![这里写图片描述](http://img.blog.csdn.net/20160730122406705) 77 | ![这里写图片描述](http://img.blog.csdn.net/20160730122406705) 78 | 79 | 视图如下,思路为根据点击的选项卡,用ng-if或者ng-show实现隐藏或者出现 80 | ``` 81 |
82 |
83 |
我的信息
84 |
我的登記
85 |
86 |
wsscat
87 |
456
88 |
89 | ``` 90 | ``` 91 | $scope.page1 =true 92 | $scope.page2 =false 93 | $scope.show = function(page){ 94 | if(page==1){ 95 | $scope.page1 =true; 96 | $scope.page2 =false; 97 | }else if(page==2){ 98 | $scope.page2 = true; 99 | $scope.page1 =false 100 | } 101 | } 102 | ``` 103 | -------------------------------------------------------------------------------- /webroot/news/directive/newsList.html: -------------------------------------------------------------------------------- 1 |
2 |
点击文字此处进行排序 3 | 4 | 10 |
11 | 24 | 31 |
32 | 33 | 正在加载 34 |
35 |
36 | 37 | 44 | 45 | 46 | 47 | 48 |
49 |
50 |
51 |
52 |
53 | 54 |
查看最新新闻
55 |
查看最久新闻
56 |
57 |
58 |
59 |
60 | -------------------------------------------------------------------------------- /http.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author wsscat 3 | */ 4 | //require属于AMD加载方案 seajs属于CMD加载方案 5 | //创建服务器模块 6 | var http = require('http'); 7 | //读取文件的模块 8 | var fs = require('fs'); 9 | //处理url的模块 10 | var url = require('url'); 11 | //解析url的信息 12 | var path = require('path'); 13 | //mime格式content-type格式 14 | var mime = require('./mime.js') 15 | //处理字符串的模块 16 | var querystring = require('querystring') 17 | 18 | //获取新闻信息的函数拿回来 19 | var newsApi = require('./newsApi.js'); 20 | exports.newsApi = newsApi.newsApi; 21 | 22 | //获取图灵机器人信息的函数拿回来 23 | var turingApi = require('./turingApi.js'); 24 | exports.turingApi = turingApi.turingApi; 25 | 26 | //引入cms的路由模块 27 | var newsCms = require('./webroot/cms/cms.js'); 28 | 29 | //用nodejs的原生模块http的createServer方法创建一个服务器 30 | http.createServer((request, response) => { 31 | //解决跨域 32 | //response.setHeader('Access-Control-Allow-Origin', '*'); 33 | //处理字符串,避免中文或者符号的识别问题 34 | var pathname = url.parse(request.url).pathname; 35 | //拿url的参数 36 | var paramStr = url.parse(request.url).query; 37 | //把url拿回来的参数处理成对象 38 | var param = querystring.parse(paramStr) 39 | //console.log("路由" + pathname); 40 | //判断浏览器只输入localhost:12345的情况 41 | if(pathname.slice(-1) === "/") { 42 | pathname = pathname + 'index.html'; 43 | } 44 | //拼接绝对路径 45 | var absPath = __dirname + '/webroot' + pathname 46 | //注意/webroot/index.html资源路径是错误的 47 | //这个才是正确的./webroot/index.html 48 | //判断是否存在我们要请求的文件 49 | fs.exists(absPath, function(exists) { 50 | //exists返回一个布尔值,根据布尔值判断文件是否存在,如果存在则fs.readFile读取该文件,并把读取的结果返回给浏览器 51 | if(exists) { 52 | //读取webroot服务器文件夹的某个资源,以二进制的方式读取 53 | fs.readFile(absPath, 'binary', function(err, data) { 54 | //如果找到对应的资源文件,提示404错误 55 | if(err) { 56 | console.log(err); 57 | //HTTP 状态码: 404 : NOT FOUND 58 | //Content Type: text/plain 59 | response.writeHead(404, { 60 | 'Content-Type': 'text/html' 61 | }); 62 | } 63 | //获取文件的后缀格式,格式如.css .html .js 64 | var ext = path.extname(pathname); 65 | //处理后缀,例如把.css处理成css 66 | ext = ext.slice(1); 67 | var contentType = mime.types[ext]; 68 | //写文件的请求头 69 | response.writeHead(200, { 70 | 'Content-Type': contentType 71 | }) 72 | //以二进制的方式解析结果,并输出到浏览器 73 | response.end(data, 'binary'); 74 | }) 75 | } else { 76 | //文件不存在则判断是否能进入某个路由,没有则输出404 77 | //根据路由判断进入到那个分支 78 | switch(pathname) { 79 | case '/newsApi': 80 | //请求新闻的内容 81 | // 测试链接 http://localhost:12345/newsApi?callback=JSON_CALLBACK&page=1&channelId=5572a109b3cdc86cf39001db&channelName=%E5%9B%BD%E5%86%85%E6%9C%80%E6%96%B0 82 | newsApi.newsApi(param, function() {}, response); 83 | break; 84 | case '/turingApi': 85 | //请求新闻的内容 86 | //测试链接 http://localhost:12345/turingApi?callback=JSON_CALLBACK&message=%E5%A7%9A%E6%98%8E 87 | turingApi.turingApi(param, function() {}, response); 88 | break; 89 | /*default: 90 | //在找不到任何文件的情况重定向到index.html 91 | response.writeHead(302, { 92 | 'Location': '/index.html' 93 | }); 94 | //在服务器目录下找不到文件就报404错误 95 | response.end(); 96 | //response.end('

404

'); 97 | break;*/ 98 | } 99 | //新闻CMS的路由,增删查改逻辑 100 | newsCms.curd(request, response) 101 | } 102 | }) 103 | }).listen(12345); 104 | //监听12345端口,端口号可以自定义 105 | console.log('在浏览器里面打开http://localhost:12345/news/index.html'); -------------------------------------------------------------------------------- /old/ghpage/touch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Javascript事件监听 8 | 9 | 10 | 11 | 12 |
13 |
上下左右滑动
14 |
15 | 16 | 32 | 105 | 106 | -------------------------------------------------------------------------------- /webroot/news/dist/html/template/detail.html: -------------------------------------------------------------------------------- 1 |

{{new.title}}

{{'来源:'+new.source}}

{{new.desc}}

点击查看大图

其他感兴趣
相关新闻

{{new.title}}

{{new.desc}}

Link
评论

{{new.title}}

{{new.desc}}

  • {{new.source}}
  • {{new.pubDate}}
  • {{new.channelName}}
{{new.channelName}}

{{new.pubDate}}

{{new.source}}

{{new.desc}}

-------------------------------------------------------------------------------- /webroot/cms/news.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var url = require('url'); 3 | var querystring = require('querystring'); 4 | var sqll = require('./sqll'); 5 | //输出JSON数据,API接口 6 | var writeOut = function(query, response) { 7 | response.write(JSON.stringify(query)); 8 | response.end(); 9 | } 10 | //request 接受请求 11 | //response 相应请求 12 | http.createServer(function(request, response) { 13 | request.setEncoding('utf-8'); 14 | var pathName = url.parse(request.url).pathname; 15 | var paramsStr = url.parse(request.url).query; 16 | var param = querystring.parse(paramsStr); 17 | //后端路由 18 | console.log("路由:" + pathName); 19 | console.log("参数:" + paramsStr); 20 | //解决跨域 21 | response.setHeader('Access-Control-Allow-Origin', '*'); 22 | response.writeHead(200, { 23 | "Content-Type": "text/jsonp;charset=utf-8" 24 | }) 25 | console.log(request.method); 26 | if(request.method.toUpperCase() == 'POST') { 27 | var postData = ""; 28 | /** 29 | * 因为post方式的数据不太一样可能很庞大复杂, 30 | * 所以要添加监听来获取传递的数据 31 | * 也可写作 req.on("data",function(data){}); 32 | */ 33 | request.addListener("data", function(data) { 34 | postData += data; 35 | }); 36 | /** 37 | * 这个是如果数据读取完毕就会执行的监听方法 38 | */ 39 | request.addListener("end", function() { 40 | console.log(postData); 41 | //处理angular的post请求的,去掉"[]",因为replace只替换一次,所以用循环替换 42 | while(postData.indexOf('params%5B') >= 0) { 43 | postData = postData.replace('params%5B', ''); 44 | } 45 | while(postData.indexOf('%5D') >= 0) { 46 | postData = postData.replace('%5D', ''); 47 | } 48 | var query = querystring.parse(postData); 49 | writeOut(query, response); 50 | }); 51 | } else if(request.method.toUpperCase() == 'GET') { 52 | /** 53 | * 也可使用var query=querystring.parse(url.parse(req.url).query); 54 | * 区别就是url.parse的arguments[1]为true: 55 | * 也能达到'querystring库'的解析效果,而且不使用querystring 56 | */ 57 | if(pathName == '/add') { 58 | sqll.curd.add('news', 'title,source,text', '"' + param.title + '",' + '"' + param.source + '",' + '"' + param.text + '"', function(err) { 59 | if(err) { 60 | 61 | } else { 62 | var obj = { 63 | status: 1, 64 | info: 'success' 65 | } 66 | response.end(param.callback + "(" + JSON.stringify(obj) + ")"); 67 | } 68 | }); 69 | /* 70 | * API:http://localhost:8899/find 71 | * params:NULL 72 | * return 新闻:title:标题,source:来源,text:内容 73 | * */ 74 | } else if(pathName == '/find') { 75 | sqll.curd.find('news', '*', function(err, rows) { 76 | console.log(rows); 77 | var obj = {}; 78 | obj.arr = rows; 79 | response.end(param.callback + "(" + JSON.stringify(obj) + ")"); 80 | }); 81 | } else if(pathName == '/delete') { 82 | sqll.curd.delete('news', 'id=' + param.id, function(err) { 83 | sqll.curd.find('news', '*', function(err, rows) { 84 | console.log(rows); 85 | var obj = {}; 86 | obj.arr = rows; 87 | response.end(param.callback + "(" + JSON.stringify(obj) + ")"); 88 | }); 89 | }); 90 | } else if(pathName == '/findByPk') { 91 | sqll.curd.findByPk('news', '*', 'id=' + param.id, function(err, rows) { 92 | console.log(rows); 93 | var obj = {}; 94 | obj.new = rows; 95 | response.end(param.callback + "(" + JSON.stringify(obj) + ")"); 96 | }); 97 | } else if(pathName == '/update') { 98 | sqll.curd.update('news', 'title="' + param.title + '"' + ', text="' + param.text + '"' + ', source="' + param.source + '"', 'id=' + param.id, function(err) { 99 | if(err) {} else { 100 | var obj = { 101 | status: 1, 102 | info: 'success' 103 | } 104 | response.end(param.callback + "(" + JSON.stringify(obj) + ")"); 105 | } 106 | }); 107 | } else if(pathName == '/search') { 108 | sqll.curd.findByPk('news', '*', 'text=' + '"' + param.search + '"', function(err, rows) { 109 | console.log(rows); 110 | var obj = {}; 111 | obj.new = rows; 112 | response.end(param.callback + "(" + JSON.stringify(obj) + ")"); 113 | }); 114 | } 115 | } else { 116 | //head put delete options etc. 117 | //注意angular的post请求监听到的了类型是option,所以记得处理 118 | } 119 | }).listen(8899); 120 | console.log("Start server:localhost:8899"); -------------------------------------------------------------------------------- /webroot/index.js: -------------------------------------------------------------------------------- 1 | digit = 2 | [ 3 | // [ 4 | // [0,0,0,1,1,1,0,0,0], 5 | // [0,0,1,1,0,1,1,0,0], 6 | // [0,1,1,0,0,0,1,1,0], 7 | // [0,1,1,0,0,0,1,1,0], 8 | // [0,1,1,0,0,0,1,1,0], 9 | // [0,1,1,0,0,0,1,1,0], 10 | // [0,1,1,0,0,0,1,1,0], 11 | // [0,1,1,0,0,0,1,1,0], 12 | // [0,0,1,1,0,1,1,0,0], 13 | // [0,0,0,1,1,1,0,0,0] 14 | // ],//0 15 | [ 16 | [0,0,1,1,1,1,1,1,1,0,0,0], 17 | [0,0,0,0,0,0,0,1,1,0,0,0], 18 | [0,0,0,0,0,0,1,1,0,0,0,0], 19 | [0,0,0,0,0,1,1,0,0,0,0,0], 20 | [0,0,0,0,1,1,1,0,0,0,0,0], 21 | [0,0,0,0,0,0,1,1,0,0,0,0], 22 | [0,0,0,0,0,0,0,1,1,0,0,0], 23 | [0,0,0,0,0,0,0,1,1,0,0,0], 24 | [0,0,1,1,0,0,0,1,1,0,0,0], 25 | [0,0,0,1,1,1,1,1,0,0,0,0] 26 | ],//3 27 | [ 28 | [0,0,0,1,1,1,1,1,0,0,0,0], 29 | [0,0,1,1,0,0,0,1,1,0,0,0], 30 | [0,0,0,0,0,0,0,1,1,0,0,0], 31 | [0,0,0,0,0,0,1,1,0,0,0,0], 32 | [0,0,0,0,0,1,1,0,0,0,0,0], 33 | [0,0,0,0,1,1,0,0,0,0,0,0], 34 | [0,0,0,1,1,0,0,0,0,0,0,0], 35 | [0,0,1,1,0,0,0,0,0,0,0,0], 36 | [0,0,1,1,0,0,0,1,1,0,0,0], 37 | [0,0,1,1,1,1,1,1,1,0,0,0] 38 | ],//2 39 | [ 40 | [0,0,0,0,0,1,1,0,0,0,0,0], 41 | [0,0,0,1,1,1,1,0,0,0,0,0], 42 | [0,0,0,0,0,1,1,0,0,0,0,0], 43 | [0,0,0,0,0,1,1,0,0,0,0,0], 44 | [0,0,0,0,0,1,1,0,0,0,0,0], 45 | [0,0,0,0,0,1,1,0,0,0,0,0], 46 | [0,0,0,0,0,1,1,0,0,0,0,0], 47 | [0,0,0,0,0,1,1,0,0,0,0,0], 48 | [0,0,0,0,0,1,1,0,0,0,0,0], 49 | [0,0,1,1,1,1,1,1,1,0,0,0] 50 | ],//1 51 | [ 52 | [0,0,0,0,0,0,0,0,0,0,0,0], 53 | [0,0,0,0,0,0,0,0,0,0,0,0], 54 | [0,0,0,1,0,0,0,0,1,0,0,0], 55 | [0,0,1,1,1,1,1,1,1,1,0,0], 56 | [0,0,1,0,0,0,0,0,0,1,0,0], 57 | [1,1,1,0,1,0,0,1,0,1,1,1], 58 | [0,0,1,0,0,1,1,0,0,1,0,0], 59 | [1,1,1,0,0,0,0,0,0,1,1,1], 60 | [0,0,0,1,1,1,1,1,1,0,0,0], 61 | [0,0,0,0,0,0,0,0,0,0,0,0] 62 | ],//Cat 63 | // [ 64 | // [0,0,0,0,1,1,0], 65 | // [0,0,0,1,1,1,0], 66 | // [0,0,1,1,1,1,0], 67 | // [0,1,1,0,1,1,0], 68 | // [1,1,0,0,1,1,0], 69 | // [1,1,1,1,1,1,1], 70 | // [0,0,0,0,1,1,0], 71 | // [0,0,0,0,1,1,0], 72 | // [0,0,0,0,1,1,0], 73 | // [0,0,0,1,1,1,1] 74 | // ],//4 75 | // [ 76 | // [1,1,1,1,1,1,1], 77 | // [1,1,0,0,0,0,0], 78 | // [1,1,0,0,0,0,0], 79 | // [1,1,1,1,1,1,0], 80 | // [0,0,0,0,0,1,1], 81 | // [0,0,0,0,0,1,1], 82 | // [0,0,0,0,0,1,1], 83 | // [0,0,0,0,0,1,1], 84 | // [1,1,0,0,0,1,1], 85 | // [0,1,1,1,1,1,0] 86 | // ],//5 87 | // [ 88 | // [0,0,0,0,1,1,0], 89 | // [0,0,1,1,0,0,0], 90 | // [0,1,1,0,0,0,0], 91 | // [1,1,0,0,0,0,0], 92 | // [1,1,0,1,1,1,0], 93 | // [1,1,0,0,0,1,1], 94 | // [1,1,0,0,0,1,1], 95 | // [1,1,0,0,0,1,1], 96 | // [1,1,0,0,0,1,1], 97 | // [0,1,1,1,1,1,0] 98 | // ],//6 99 | // [ 100 | // [1,1,1,1,1,1,1], 101 | // [1,1,0,0,0,1,1], 102 | // [0,0,0,0,1,1,0], 103 | // [0,0,0,0,1,1,0], 104 | // [0,0,0,1,1,0,0], 105 | // [0,0,0,1,1,0,0], 106 | // [0,0,1,1,0,0,0], 107 | // [0,0,1,1,0,0,0], 108 | // [0,0,1,1,0,0,0], 109 | // [0,0,1,1,0,0,0] 110 | // ],//7 111 | // [ 112 | // [0,1,1,1,1,1,0], 113 | // [1,1,0,0,0,1,1], 114 | // [1,1,0,0,0,1,1], 115 | // [1,1,0,0,0,1,1], 116 | // [0,1,1,1,1,1,0], 117 | // [1,1,0,0,0,1,1], 118 | // [1,1,0,0,0,1,1], 119 | // [1,1,0,0,0,1,1], 120 | // [1,1,0,0,0,1,1], 121 | // [0,1,1,1,1,1,0] 122 | // ],//8 123 | // [ 124 | // [0,1,1,1,1,1,0], 125 | // [1,1,0,0,0,1,1], 126 | // [1,1,0,0,0,1,1], 127 | // [1,1,0,0,0,1,1], 128 | // [0,1,1,1,0,1,1], 129 | // [0,0,0,0,0,1,1], 130 | // [0,0,0,0,0,1,1], 131 | // [0,0,0,0,1,1,0], 132 | // [0,0,0,1,1,0,0], 133 | // [0,1,1,0,0,0,0] 134 | // ],//9 135 | // [ 136 | // [0,0,0,0,0,0,0], 137 | // [0,0,0,0,0,0,0], 138 | // [0,1,1,0,0,0,0], 139 | // [0,1,1,0,0,0,0], 140 | // [0,0,0,0,0,0,0], 141 | // [0,0,0,0,0,0,0], 142 | // [0,1,1,0,0,0,0], 143 | // [0,1,1,0,0,0,0], 144 | // [0,0,0,0,0,0,0], 145 | // [0,0,0,0,0,0,0] 146 | // ],//: 147 | ]; -------------------------------------------------------------------------------- /webroot/news/template/detail.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{new.title}}

4 |
5 |
{{'来源:'+new.source}}
6 |

7 | {{new.desc}} 8 |

9 |

10 | 11 | 12 | 点击查看大图 13 | 14 |

15 |
16 |
17 |
18 | 28 | 29 |
30 |
其他感兴趣
31 | 42 | 48 |
49 |
50 |
相关新闻
51 |
52 |
53 |

{{new.title}}

54 |

{{new.desc}}

55 |
56 |
57 | 63 |
64 |
65 |
Link
66 |
67 | 78 |
79 |
80 |
81 |
评论
82 |
83 |
84 |

{{new.title}}

85 |

{{new.desc}}

86 |
    87 |
  • {{new.source}}
  • 88 |
  • {{new.pubDate}}
  • 89 |
  • {{new.channelName}}
  • 90 |
91 |
92 |
93 |
94 |
95 |
96 | 97 | {{new.channelName}} 98 |
99 |
100 |

101 | 102 | {{new.pubDate}} 103 |

104 |

105 | 106 | {{new.source}} 107 |

108 |

109 | 110 | {{new.desc}} 111 |

112 |
113 | 116 |
117 | 118 | 119 | -------------------------------------------------------------------------------- /webroot/news/dist/js/main.windiest.js: -------------------------------------------------------------------------------- 1 | var app=angular.module("newsApp",["ui.router","ng.post","news.controller","news.service","news.directive"]);app.config(["$stateProvider","$urlRouterProvider",function(e,n){e.state("index",{url:"/index",templateUrl:"template/index.html",controller:"indexCtrl"}).state("index.list",{url:"/list",templateUrl:"template/newsList.html",controller:"listCtrl"}).state("index.secondlist",{url:"/secondlist",templateUrl:"template/secondList.html",controller:"secondListCtrl"}).state("index.thirdlist",{url:"/thirdlist",templateUrl:"template/thirdList.html",controller:"thirdListCtrl"}).state("detail",{url:"/detail/:channelId/:id",templateUrl:"template/detail.html",controller:"detailCtrl"}).state("login",{url:"/login",templateUrl:"template/logins.html",controller:"loginsCtrl"}).state("register",{url:"/register",templateUrl:"template/register.html",controller:"registerCtrl"}).state("setting",{url:"/setting",templateUrl:"template/setting.html",controller:"settingCtrl"}),n.when("","/index/list")}]),app.value("apiUrl","http://localhost:12345/newsApi"),app.value("apiMethod","get");var news=json;console.log(news),function(){var e=angular.module("news.controller",[]);e.controller("indexCtrl",["$scope","$rootScope","$http","cookie","$window",function(e,n,o,t,i){var s=t.getCookie("token"),a=t.getCookie("username");o.post("http://localhost:81/angular/news/index.php/login_api/auto_login",{params:{token:s,username:a}}).success(function(e){console.log(e),e.code||(window.location.href="#/login")}),e.tabs=[{name:"国内最新",id:1,url:"#/index/list"},{name:"国际焦点",id:2,url:"#/index/secondlist"},{name:"游戏焦点",id:3,url:"#/index/thirdlist"},{name:"登录",id:4,url:"#/login"}],n.id=1,e.toggleTab=function(e,o){console.log(e),n.id=e,i.location.href=o}}]),e.controller("listCtrl",["$scope","$http","swiperImg","apiUrl",function(e,n,o,t){e.isShowSwiper=!0,e.page=1,e.isShow=!1,e.sortList=!1,e.type="pubDate",e.channelId="5572a109b3cdc86cf39001db",e.news=[],e.swiperImg=[];var i=function(){n.jsonp(t,{params:{page:e.page,channelId:"5572a109b3cdc86cf39001db",channelName:"国内最新",callback:"JSON_CALLBACK"}}).success(function(n){n=json,e.isShow=!0,console.log(n),e.news=e.news.concat(n.showapi_res_body.pagebean.contentlist),e.swiperImg=o.get(e.news)})};i(),e.searchName="",e.isSearch=!1,e.search=function(){e.isSearch=!0},e.cancelSearch=function(){e.isSearch=!1},e.loadMore=function(){e.isShow=!1,e.page++,i()}}]),e.controller("thirdListCtrl",["$scope","$http","$rootScope","swiperImg","apiUrl","apiMethod",function(e,n,o,t,i,s){e.isShowSwiper=!0,o.id=3,e.page=1,e.isShow=!1,e.channelId="5572a108b3cdc86cf39001d6",e.swiperImg=[],e.news=[];var a=function(){n.jsonp(i,{params:{page:e.page,channelId:"5572a108b3cdc86cf39001d6",channelName:"游戏焦点",callback:"JSON_CALLBACK"}}).success(function(n){n=json,e.isShow=!0,console.log(n),e.news=e.news.concat(n.showapi_res_body.pagebean.contentlist),e.swiperImg=t.get(e.news)})};a(),e.searchName="",e.isSearch=!1,e.search=function(){e.isSearch=!0},e.cancelSearch=function(){e.isSearch=!1},e.loadMore=function(){e.isShow=!1,e.page++,a()}}]),e.controller("secondListCtrl",["$scope","$http","$rootScope","swiperImg","apiUrl",function(e,n,o,t,i){e.isShowSwiper=!0,o.id=2,e.page=1,e.isShow=!1,e.channelId="5572a108b3cdc86cf39001ce",e.swiperImg=[],e.news=[];var s=function(){n.jsonp(i,{params:{page:e.page,channelId:"5572a108b3cdc86cf39001ce",channelName:"游戏焦点",callback:"JSON_CALLBACK"}}).success(function(n){n=json,e.isShow=!0,console.log(n),e.news=e.news.concat(n.showapi_res_body.pagebean.contentlist),e.swiperImg=t.get(e.news)})};s(),e.searchName="",e.isSearch=!1,e.search=function(){e.isSearch=!0},e.cancelSearch=function(){e.isSearch=!1},e.loadMore=function(){e.isShow=!1,e.page++,s()}}]),e.controller("detailCtrl",["$scope","$http","$state","apiUrl",function(e,n,o,t){e.isShowGallery=!1,e.id=parseInt(o.params.id),e.channelId=o.params.channelId,e.isShow=!1,e.showGallery=function(n,o){e.isShowGallery=n,console.log(o),e.imgUrl="background-image:url("+o+")"},console.log(o.params),n.jsonp(t,{params:{page:1,channelId:e.channelId,channelName:"",callback:"JSON_CALLBACK"}}).success(function(n){n=json,console.log(n),e.isShow=!0,e.allNum=n.showapi_res_body.pagebean.allNum,e.new=n.showapi_res_body.pagebean.contentlist[o.params.id],console.log(e.new)})}]),e.controller("loginsCtrl",["$scope","$http","cookie",function(e,n,o){e.page1=!0,e.page2=!1,e.show=function(n){1==n?(e.page1=!0,e.page2=!1):2==n&&(e.page2=!0,e.page1=!1)},e.login=function(){console.log("username:"+e.username),console.log("password:"+e.password),n.post("http://localhost:81/angular/news/index.php/login_api/login",{params:{username:e.username,password:e.password}}).success(function(e){console.log(e),e.code&&(o.setCookie("token",e.info.token),o.setCookie("username",e.username),window.location.href="#/index/list")})}}]),e.controller("registerCtrl",["$scope","$http","cookie",function(e,n,o){e.register=function(){console.log("username:"+e.username),console.log("password:"+e.password),n.post("http://localhost:81/angular/news/index.php/login_api/register",{params:{username:e.username,password:e.password}}).success(function(e){console.log(e),e.code&&(o.setCookie("username",e.username),o.setCookie("token",e.info.token),window.location.href="#/index/list")})}}]),e.controller("settingCtrl",["$scope","$http","cookie",function(e,n,o){var t=o.getCookie("token"),i=o.getCookie("username");n.post("http://localhost:81/angular/news/index.php/login_api/auto_login",{params:{token:t,username:i}}).success(function(e){console.log(e),e.code||(window.location.href="#/login")})}])}(),function(){var e=angular.module("news.service",[]);e.service("cookie",["$document",function(e){return{setCookie:function(n,o){var t=10,i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3),e[0].cookie=n+"="+o+";expires="+i},getCookie:function(n){var o,t=new RegExp("(^|)"+n+"=([^;]*)(;|$)");if(o=e[0].cookie.match(t))return o[2]}}}]),e.service("swiperImg",[function(){return{get:function(e,n){n||(n=2);var o=[];return angular.forEach(e,function(e,t){e.havePic&&o.length<=n&&(e.id=t,o.push(e))}),o}}}])}(),function(){var e=angular.module("news.directive",[]);e.directive("newsList",[function(){return{templateUrl:"directive/newsList.html"}}]),e.directive("searchBar",[function(){return{templateUrl:"directive/searchBar.html"}}]),e.directive("swiper",[function(){return{templateUrl:"directive/swiper.html",link:function(e,n,o){new Swiper(".swiper-container",{pagination:".swiper-pagination",paginationClickable:!0})}}}]),e.directive("loading",[function(){return{templateUrl:"directive/loading.html"}}])}(); -------------------------------------------------------------------------------- /webroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 114 | 115 | 116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 | 267 |
268 | 269 | 289 | 290 | -------------------------------------------------------------------------------- /webroot/news/js/controller/controller.js: -------------------------------------------------------------------------------- 1 | ; 2 | //控制器 3 | (function() { 4 | var app = angular.module('news.controller', []); 5 | app.controller('indexCtrl', ['$scope', '$rootScope', '$http', 'cookie', '$window', 6 | function($scope, $rootScope, $http, cookie, $window) { 7 | var token = cookie.getCookie('token'); 8 | var username = cookie.getCookie('username') 9 | /*$http.post('http://localhost:81/angular/news/index.php/login_api/auto_login', { 10 | params: { 11 | token: token, 12 | username: username 13 | } 14 | }).success(function(data) { 15 | console.log(data); 16 | if(data.code) {} else { 17 | window.location.href = '#/login' 18 | } 19 | })*/ 20 | $scope.tabs = [{ 21 | name: '国内最新', 22 | id: 1, 23 | url: '#/index/list' 24 | }, { 25 | name: '国际焦点', 26 | id: 2, 27 | url: '#/index/secondlist' 28 | }, { 29 | name: '游戏焦点', 30 | id: 3, 31 | url: '#/index/thirdlist' 32 | }, { 33 | name: '登录', 34 | id: 4, 35 | url: '#/login' 36 | }]; 37 | $rootScope.id = 1; 38 | $scope.toggleTab = function(id, url) { 39 | console.log(id); 40 | $rootScope.id = id; 41 | $window.location.href = url; 42 | } 43 | } 44 | ]); 45 | app.controller('listCtrl', ['$scope', '$http', 'swiperImg', 'apiUrl', function($scope, $http, swiperImg, apiUrl) { 46 | //默认显示轮播图 47 | $scope.isShowSwiper = true; 48 | //默认加载第一页 49 | $scope.page = 1; 50 | //默认显示loading 51 | $scope.isShow = false; 52 | //默认设置排序列表不出现 53 | $scope.sortList = false; 54 | $scope.type = 'pubDate'; 55 | //设置chanelId传给详细页面 56 | $scope.channelId = '5572a109b3cdc86cf39001db'; 57 | //渲染到视图的新闻数据数组 58 | $scope.news = []; 59 | //轮播图的三张图片 60 | $scope.swiperImg = []; 61 | var load = function() { 62 | $http.jsonp(apiUrl, { 63 | params: { 64 | page: $scope.page, 65 | channelId: '5572a109b3cdc86cf39001db', 66 | channelName: '国内最新', 67 | callback: 'JSON_CALLBACK' 68 | } 69 | }).success(function(data) { 70 | //测试数据,发布时删除 71 | data = json; 72 | 73 | $scope.isShow = true; 74 | console.log(data); 75 | $scope.news = $scope.news.concat(data.showapi_res_body.pagebean.contentlist); 76 | //用swiperImg自定义服务获取三张图片 77 | $scope.swiperImg = swiperImg.get($scope.news); 78 | }).error(function(data){ 79 | //测试数据,发布时删除 80 | data = json; 81 | 82 | $scope.isShow = true; 83 | console.log(data); 84 | $scope.news = $scope.news.concat(data.showapi_res_body.pagebean.contentlist); 85 | //用swiperImg自定义服务获取三张图片 86 | $scope.swiperImg = swiperImg.get($scope.news); 87 | }) 88 | } 89 | //第一次进来的时候自执行加载数据 90 | load(); 91 | //默认搜索内容 92 | $scope.searchName = ''; 93 | //搜索框默认的状态 94 | $scope.isSearch = false; 95 | $scope.search = function() { 96 | $scope.isSearch = true; 97 | } 98 | 99 | $scope.cancelSearch = function() { 100 | $scope.isSearch = false; 101 | } 102 | 103 | //加载更多的函数 104 | $scope.loadMore = function() { 105 | $scope.isShow = false; 106 | $scope.page++; 107 | load(); 108 | } 109 | 110 | }]); 111 | 112 | app.controller('thirdListCtrl', ['$scope', '$http', '$rootScope', 'swiperImg', 'apiUrl', 'apiMethod', function($scope, $http, $rootScope, swiperImg, apiUrl, apiMethod) { 113 | //默认显示轮播图 114 | $scope.isShowSwiper = true; 115 | $rootScope.id = 3; 116 | //默认加载第一页 117 | $scope.page = 1; 118 | //默认显示loading 119 | $scope.isShow = false; 120 | //设置chanelId传给详细页面 121 | $scope.channelId = '5572a108b3cdc86cf39001d6'; 122 | //轮播图的三张图片 123 | $scope.swiperImg = []; 124 | $scope.news = []; 125 | var load = function() { 126 | $http.jsonp(apiUrl, { 127 | params: { 128 | page: $scope.page, 129 | channelId: '5572a108b3cdc86cf39001d6', 130 | channelName: '游戏焦点', 131 | callback: 'JSON_CALLBACK' 132 | } 133 | }).success(function(data) { 134 | //测试数据,发布时删除 135 | data = json; 136 | 137 | $scope.isShow = true; 138 | console.log(data); 139 | $scope.news = $scope.news.concat(data.showapi_res_body.pagebean.contentlist); 140 | //用swiperImg自定义服务获取三张图片 141 | $scope.swiperImg = swiperImg.get($scope.news); 142 | }).error(function(data){ 143 | //测试数据,发布时删除 144 | data = json; 145 | 146 | $scope.isShow = true; 147 | console.log(data); 148 | $scope.news = $scope.news.concat(data.showapi_res_body.pagebean.contentlist); 149 | //用swiperImg自定义服务获取三张图片 150 | $scope.swiperImg = swiperImg.get($scope.news); 151 | }) 152 | } 153 | //第一次进来的时候自执行加载数据 154 | load(); 155 | //默认搜索内容 156 | $scope.searchName = ''; 157 | //搜索框默认的状态 158 | $scope.isSearch = false; 159 | $scope.search = function() { 160 | $scope.isSearch = true; 161 | } 162 | 163 | $scope.cancelSearch = function() { 164 | $scope.isSearch = false; 165 | } 166 | 167 | //加载更多的函数 168 | $scope.loadMore = function() { 169 | $scope.isShow = false; 170 | $scope.page++; 171 | load(); 172 | } 173 | }]); 174 | 175 | app.controller('secondListCtrl', ['$scope', '$http', '$rootScope', 'swiperImg', 'apiUrl', function($scope, $http, $rootScope, swiperImg, apiUrl) { 176 | //默认显示轮播图 177 | $scope.isShowSwiper = true; 178 | $rootScope.id = 2; 179 | //默认加载第一页 180 | $scope.page = 1; 181 | //默认显示loading 182 | $scope.isShow = false; 183 | //设置chanelId传给详细页面 184 | $scope.channelId = '5572a108b3cdc86cf39001ce'; 185 | //轮播图的三张图片 186 | $scope.swiperImg = []; 187 | $scope.news = []; 188 | var load = function() { 189 | $http.jsonp(apiUrl, { 190 | params: { 191 | page: $scope.page, 192 | channelId: '5572a108b3cdc86cf39001ce', 193 | channelName: '游戏焦点', 194 | callback: 'JSON_CALLBACK' 195 | } 196 | }).success(function(data) { 197 | //测试数据,发布时删除 198 | data = json; 199 | 200 | $scope.isShow = true; 201 | console.log(data); 202 | $scope.news = $scope.news.concat(data.showapi_res_body.pagebean.contentlist); 203 | //用swiperImg自定义服务获取三张图片 204 | $scope.swiperImg = swiperImg.get($scope.news); 205 | }).error(function(data){ 206 | //测试数据,发布时删除 207 | data = json; 208 | 209 | $scope.isShow = true; 210 | console.log(data); 211 | $scope.news = $scope.news.concat(data.showapi_res_body.pagebean.contentlist); 212 | //用swiperImg自定义服务获取三张图片 213 | $scope.swiperImg = swiperImg.get($scope.news); 214 | }) 215 | } 216 | //第一次进来的时候自执行加载数据 217 | load(); 218 | //默认搜索内容 219 | $scope.searchName = ''; 220 | //搜索框默认的状态 221 | $scope.isSearch = false; 222 | $scope.search = function() { 223 | $scope.isSearch = true; 224 | } 225 | 226 | $scope.cancelSearch = function() { 227 | $scope.isSearch = false; 228 | } 229 | 230 | //加载更多的函数 231 | $scope.loadMore = function() { 232 | $scope.isShow = false; 233 | $scope.page++; 234 | load(); 235 | } 236 | }]); 237 | 238 | //新闻详细页的控制器 239 | app.controller('detailCtrl', ['$scope', '$http', '$state', 'apiUrl', function($scope, $http, $state, apiUrl) { 240 | //是否显示放大图片 241 | $scope.isShowGallery = false 242 | //获取id,视图下一页逻辑需要的数据 243 | $scope.id = parseInt($state.params.id); 244 | //获取channelId,根据频道取对应的新闻数据 245 | $scope.channelId = $state.params.channelId; 246 | //默认加载loading等待数据回调后消失 247 | $scope.isShow = false; 248 | $scope.showGallery = function(isshow, url) { 249 | $scope.isShowGallery = isshow; 250 | console.log(url); 251 | $scope.imgUrl = "background-image:url(" + url + ")"; 252 | } 253 | console.log($state.params) 254 | $http.jsonp(apiUrl, { 255 | params: { 256 | page: 1, 257 | channelId: $scope.channelId, 258 | //channelName: '国内最新', 259 | channelName: '', 260 | callback: 'JSON_CALLBACK' 261 | } 262 | }).success(function(data) { 263 | //测试数据,发布时删除 264 | data = json; 265 | 266 | console.log(data); 267 | $scope.isShow = true; 268 | $scope.allNum = data.showapi_res_body.pagebean.allNum; 269 | $scope.new = data.showapi_res_body.pagebean.contentlist[$state.params.id]; 270 | console.log($scope.new) 271 | }).error(function(data){ 272 | //测试数据,发布时删除 273 | data = json; 274 | 275 | console.log(data); 276 | $scope.isShow = true; 277 | $scope.allNum = data.showapi_res_body.pagebean.allNum; 278 | $scope.new = data.showapi_res_body.pagebean.contentlist[$state.params.id]; 279 | console.log($scope.new) 280 | }) 281 | }]); 282 | 283 | app.controller('loginsCtrl', ['$scope', '$http', 'cookie', function($scope, $http, cookie) { 284 | $scope.page1 = true 285 | $scope.page2 = false 286 | $scope.show = function(page) { 287 | if(page == 1) { 288 | $scope.page1 = true; 289 | $scope.page2 = false; 290 | } else if(page == 2) { 291 | $scope.page2 = true; 292 | $scope.page1 = false 293 | } 294 | } 295 | $scope.login = function() { 296 | console.log('username:' + $scope.username); 297 | console.log('password:' + $scope.password); 298 | $http.post('http://localhost:81/angular/news/index.php/login_api/login', { 299 | params: { 300 | username: $scope.username, 301 | password: $scope.password 302 | } 303 | }).success(function(data) { 304 | console.log(data); 305 | if(data.code) { 306 | cookie.setCookie('token', data.info.token); 307 | cookie.setCookie('username', data.username); 308 | window.location.href = "#/index/list" 309 | } 310 | }) 311 | } 312 | }]); 313 | app.controller('registerCtrl', ['$scope', '$http', 'cookie', function($scope, $http, cookie) { 314 | $scope.register = function() { 315 | console.log('username:' + $scope.username); 316 | console.log('password:' + $scope.password); 317 | $http.post('http://localhost:81/angular/news/index.php/login_api/register', { 318 | params: { 319 | username: $scope.username, 320 | password: $scope.password 321 | } 322 | }).success(function(data) { 323 | console.log(data); 324 | if(data.code) { 325 | cookie.setCookie('username', data.username); 326 | cookie.setCookie('token', data.info.token); 327 | window.location.href = '#/index/list'; 328 | } 329 | }) 330 | } 331 | }]); 332 | app.controller('settingCtrl', ['$scope', '$http', 'cookie', function($scope, $http, cookie) { 333 | var token = cookie.getCookie('token'); 334 | var username = cookie.getCookie('username') 335 | $http.post('http://localhost:81/angular/news/index.php/login_api/auto_login', { 336 | params: { 337 | token: token, 338 | username: username 339 | } 340 | }).success(function(data) { 341 | console.log(data); 342 | if(data.code) {} else { 343 | window.location.href = '#/login' 344 | } 345 | }) 346 | }]) 347 | })(); -------------------------------------------------------------------------------- /old/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 日日头条 25 |
26 | 29 | 30 |
31 | 32 | 33 | 68 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | -------------------------------------------------------------------------------- /webroot/news/css/swiper.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Swiper 3.4.0 3 | * Most modern mobile touch slider and framework with hardware accelerated transitions 4 | * 5 | * http://www.idangero.us/swiper/ 6 | * 7 | * Copyright 2016, Vladimir Kharlampidi 8 | * The iDangero.us 9 | * http://www.idangero.us/ 10 | * 11 | * Licensed under MIT 12 | * 13 | * Released on: October 16, 2016 14 | */ 15 | .swiper-container { 16 | margin-left: auto; 17 | margin-right: auto; 18 | position: relative; 19 | overflow: hidden; 20 | /* Fix of Webkit flickering */ 21 | z-index: 1; 22 | } 23 | .swiper-container-no-flexbox .swiper-slide { 24 | float: left; 25 | } 26 | .swiper-container-vertical > .swiper-wrapper { 27 | -webkit-box-orient: vertical; 28 | -moz-box-orient: vertical; 29 | -ms-flex-direction: column; 30 | -webkit-flex-direction: column; 31 | flex-direction: column; 32 | } 33 | .swiper-wrapper { 34 | position: relative; 35 | width: 100%; 36 | height: 100%; 37 | z-index: 1; 38 | display: -webkit-box; 39 | display: -moz-box; 40 | display: -ms-flexbox; 41 | display: -webkit-flex; 42 | display: flex; 43 | -webkit-transition-property: -webkit-transform; 44 | -moz-transition-property: -moz-transform; 45 | -o-transition-property: -o-transform; 46 | -ms-transition-property: -ms-transform; 47 | transition-property: transform; 48 | -webkit-box-sizing: content-box; 49 | -moz-box-sizing: content-box; 50 | box-sizing: content-box; 51 | } 52 | .swiper-container-android .swiper-slide, 53 | .swiper-wrapper { 54 | -webkit-transform: translate3d(0px, 0, 0); 55 | -moz-transform: translate3d(0px, 0, 0); 56 | -o-transform: translate(0px, 0px); 57 | -ms-transform: translate3d(0px, 0, 0); 58 | transform: translate3d(0px, 0, 0); 59 | } 60 | .swiper-container-multirow > .swiper-wrapper { 61 | -webkit-box-lines: multiple; 62 | -moz-box-lines: multiple; 63 | -ms-flex-wrap: wrap; 64 | -webkit-flex-wrap: wrap; 65 | flex-wrap: wrap; 66 | } 67 | .swiper-container-free-mode > .swiper-wrapper { 68 | -webkit-transition-timing-function: ease-out; 69 | -moz-transition-timing-function: ease-out; 70 | -ms-transition-timing-function: ease-out; 71 | -o-transition-timing-function: ease-out; 72 | transition-timing-function: ease-out; 73 | margin: 0 auto; 74 | } 75 | .swiper-slide { 76 | -webkit-flex-shrink: 0; 77 | -ms-flex: 0 0 auto; 78 | flex-shrink: 0; 79 | width: 100%; 80 | height: 100%; 81 | position: relative; 82 | } 83 | /* Auto Height */ 84 | .swiper-container-autoheight, 85 | .swiper-container-autoheight .swiper-slide { 86 | height: auto; 87 | } 88 | .swiper-container-autoheight .swiper-wrapper { 89 | -webkit-box-align: start; 90 | -ms-flex-align: start; 91 | -webkit-align-items: flex-start; 92 | align-items: flex-start; 93 | -webkit-transition-property: -webkit-transform, height; 94 | -moz-transition-property: -moz-transform; 95 | -o-transition-property: -o-transform; 96 | -ms-transition-property: -ms-transform; 97 | transition-property: transform, height; 98 | } 99 | /* a11y */ 100 | .swiper-container .swiper-notification { 101 | position: absolute; 102 | left: 0; 103 | top: 0; 104 | pointer-events: none; 105 | opacity: 0; 106 | z-index: -1000; 107 | } 108 | /* IE10 Windows Phone 8 Fixes */ 109 | .swiper-wp8-horizontal { 110 | -ms-touch-action: pan-y; 111 | touch-action: pan-y; 112 | } 113 | .swiper-wp8-vertical { 114 | -ms-touch-action: pan-x; 115 | touch-action: pan-x; 116 | } 117 | /* Arrows */ 118 | .swiper-button-prev, 119 | .swiper-button-next { 120 | position: absolute; 121 | top: 50%; 122 | width: 27px; 123 | height: 44px; 124 | margin-top: -22px; 125 | z-index: 10; 126 | cursor: pointer; 127 | -moz-background-size: 27px 44px; 128 | -webkit-background-size: 27px 44px; 129 | background-size: 27px 44px; 130 | background-position: center; 131 | background-repeat: no-repeat; 132 | } 133 | .swiper-button-prev.swiper-button-disabled, 134 | .swiper-button-next.swiper-button-disabled { 135 | opacity: 0.35; 136 | cursor: auto; 137 | pointer-events: none; 138 | } 139 | .swiper-button-prev, 140 | .swiper-container-rtl .swiper-button-next { 141 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E"); 142 | left: 10px; 143 | right: auto; 144 | } 145 | .swiper-button-prev.swiper-button-black, 146 | .swiper-container-rtl .swiper-button-next.swiper-button-black { 147 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E"); 148 | } 149 | .swiper-button-prev.swiper-button-white, 150 | .swiper-container-rtl .swiper-button-next.swiper-button-white { 151 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E"); 152 | } 153 | .swiper-button-next, 154 | .swiper-container-rtl .swiper-button-prev { 155 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E"); 156 | right: 10px; 157 | left: auto; 158 | } 159 | .swiper-button-next.swiper-button-black, 160 | .swiper-container-rtl .swiper-button-prev.swiper-button-black { 161 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E"); 162 | } 163 | .swiper-button-next.swiper-button-white, 164 | .swiper-container-rtl .swiper-button-prev.swiper-button-white { 165 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E"); 166 | } 167 | /* Pagination Styles */ 168 | .swiper-pagination { 169 | position: absolute; 170 | text-align: center; 171 | -webkit-transition: 300ms; 172 | -moz-transition: 300ms; 173 | -o-transition: 300ms; 174 | transition: 300ms; 175 | -webkit-transform: translate3d(0, 0, 0); 176 | -ms-transform: translate3d(0, 0, 0); 177 | -o-transform: translate3d(0, 0, 0); 178 | transform: translate3d(0, 0, 0); 179 | z-index: 10; 180 | } 181 | .swiper-pagination.swiper-pagination-hidden { 182 | opacity: 0; 183 | } 184 | /* Common Styles */ 185 | .swiper-pagination-fraction, 186 | .swiper-pagination-custom, 187 | .swiper-container-horizontal > .swiper-pagination-bullets { 188 | bottom: 10px; 189 | left: 0; 190 | width: 100%; 191 | } 192 | /* Bullets */ 193 | .swiper-pagination-bullet { 194 | width: 8px; 195 | height: 8px; 196 | display: inline-block; 197 | border-radius: 100%; 198 | background: #000; 199 | opacity: 0.2; 200 | } 201 | button.swiper-pagination-bullet { 202 | border: none; 203 | margin: 0; 204 | padding: 0; 205 | box-shadow: none; 206 | -moz-appearance: none; 207 | -ms-appearance: none; 208 | -webkit-appearance: none; 209 | appearance: none; 210 | } 211 | .swiper-pagination-clickable .swiper-pagination-bullet { 212 | cursor: pointer; 213 | } 214 | .swiper-pagination-white .swiper-pagination-bullet { 215 | background: #fff; 216 | } 217 | .swiper-pagination-bullet-active { 218 | opacity: 1; 219 | background: #007aff; 220 | } 221 | .swiper-pagination-white .swiper-pagination-bullet-active { 222 | background: #fff; 223 | } 224 | .swiper-pagination-black .swiper-pagination-bullet-active { 225 | background: #000; 226 | } 227 | .swiper-container-vertical > .swiper-pagination-bullets { 228 | right: 10px; 229 | top: 50%; 230 | -webkit-transform: translate3d(0px, -50%, 0); 231 | -moz-transform: translate3d(0px, -50%, 0); 232 | -o-transform: translate(0px, -50%); 233 | -ms-transform: translate3d(0px, -50%, 0); 234 | transform: translate3d(0px, -50%, 0); 235 | } 236 | .swiper-container-vertical > .swiper-pagination-bullets .swiper-pagination-bullet { 237 | margin: 5px 0; 238 | display: block; 239 | } 240 | .swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet { 241 | margin: 0 5px; 242 | } 243 | /* Progress */ 244 | .swiper-pagination-progress { 245 | background: rgba(0, 0, 0, 0.25); 246 | position: absolute; 247 | } 248 | .swiper-pagination-progress .swiper-pagination-progressbar { 249 | background: #007aff; 250 | position: absolute; 251 | left: 0; 252 | top: 0; 253 | width: 100%; 254 | height: 100%; 255 | -webkit-transform: scale(0); 256 | -ms-transform: scale(0); 257 | -o-transform: scale(0); 258 | transform: scale(0); 259 | -webkit-transform-origin: left top; 260 | -moz-transform-origin: left top; 261 | -ms-transform-origin: left top; 262 | -o-transform-origin: left top; 263 | transform-origin: left top; 264 | } 265 | .swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar { 266 | -webkit-transform-origin: right top; 267 | -moz-transform-origin: right top; 268 | -ms-transform-origin: right top; 269 | -o-transform-origin: right top; 270 | transform-origin: right top; 271 | } 272 | .swiper-container-horizontal > .swiper-pagination-progress { 273 | width: 100%; 274 | height: 4px; 275 | left: 0; 276 | top: 0; 277 | } 278 | .swiper-container-vertical > .swiper-pagination-progress { 279 | width: 4px; 280 | height: 100%; 281 | left: 0; 282 | top: 0; 283 | } 284 | .swiper-pagination-progress.swiper-pagination-white { 285 | background: rgba(255, 255, 255, 0.5); 286 | } 287 | .swiper-pagination-progress.swiper-pagination-white .swiper-pagination-progressbar { 288 | background: #fff; 289 | } 290 | .swiper-pagination-progress.swiper-pagination-black .swiper-pagination-progressbar { 291 | background: #000; 292 | } 293 | /* 3D Container */ 294 | .swiper-container-3d { 295 | -webkit-perspective: 1200px; 296 | -moz-perspective: 1200px; 297 | -o-perspective: 1200px; 298 | perspective: 1200px; 299 | } 300 | .swiper-container-3d .swiper-wrapper, 301 | .swiper-container-3d .swiper-slide, 302 | .swiper-container-3d .swiper-slide-shadow-left, 303 | .swiper-container-3d .swiper-slide-shadow-right, 304 | .swiper-container-3d .swiper-slide-shadow-top, 305 | .swiper-container-3d .swiper-slide-shadow-bottom, 306 | .swiper-container-3d .swiper-cube-shadow { 307 | -webkit-transform-style: preserve-3d; 308 | -moz-transform-style: preserve-3d; 309 | -ms-transform-style: preserve-3d; 310 | transform-style: preserve-3d; 311 | } 312 | .swiper-container-3d .swiper-slide-shadow-left, 313 | .swiper-container-3d .swiper-slide-shadow-right, 314 | .swiper-container-3d .swiper-slide-shadow-top, 315 | .swiper-container-3d .swiper-slide-shadow-bottom { 316 | position: absolute; 317 | left: 0; 318 | top: 0; 319 | width: 100%; 320 | height: 100%; 321 | pointer-events: none; 322 | z-index: 10; 323 | } 324 | .swiper-container-3d .swiper-slide-shadow-left { 325 | background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); 326 | /* Safari 4+, Chrome */ 327 | background-image: -webkit-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 328 | /* Chrome 10+, Safari 5.1+, iOS 5+ */ 329 | background-image: -moz-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 330 | /* Firefox 3.6-15 */ 331 | background-image: -o-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 332 | /* Opera 11.10-12.00 */ 333 | background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 334 | /* Firefox 16+, IE10, Opera 12.50+ */ 335 | } 336 | .swiper-container-3d .swiper-slide-shadow-right { 337 | background-image: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); 338 | /* Safari 4+, Chrome */ 339 | background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 340 | /* Chrome 10+, Safari 5.1+, iOS 5+ */ 341 | background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 342 | /* Firefox 3.6-15 */ 343 | background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 344 | /* Opera 11.10-12.00 */ 345 | background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 346 | /* Firefox 16+, IE10, Opera 12.50+ */ 347 | } 348 | .swiper-container-3d .swiper-slide-shadow-top { 349 | background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); 350 | /* Safari 4+, Chrome */ 351 | background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 352 | /* Chrome 10+, Safari 5.1+, iOS 5+ */ 353 | background-image: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 354 | /* Firefox 3.6-15 */ 355 | background-image: -o-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 356 | /* Opera 11.10-12.00 */ 357 | background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 358 | /* Firefox 16+, IE10, Opera 12.50+ */ 359 | } 360 | .swiper-container-3d .swiper-slide-shadow-bottom { 361 | background-image: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); 362 | /* Safari 4+, Chrome */ 363 | background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 364 | /* Chrome 10+, Safari 5.1+, iOS 5+ */ 365 | background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 366 | /* Firefox 3.6-15 */ 367 | background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 368 | /* Opera 11.10-12.00 */ 369 | background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); 370 | /* Firefox 16+, IE10, Opera 12.50+ */ 371 | } 372 | /* Coverflow */ 373 | .swiper-container-coverflow .swiper-wrapper, 374 | .swiper-container-flip .swiper-wrapper { 375 | /* Windows 8 IE 10 fix */ 376 | -ms-perspective: 1200px; 377 | } 378 | /* Cube + Flip */ 379 | .swiper-container-cube, 380 | .swiper-container-flip { 381 | overflow: visible; 382 | } 383 | .swiper-container-cube .swiper-slide, 384 | .swiper-container-flip .swiper-slide { 385 | pointer-events: none; 386 | -webkit-backface-visibility: hidden; 387 | -moz-backface-visibility: hidden; 388 | -ms-backface-visibility: hidden; 389 | backface-visibility: hidden; 390 | z-index: 1; 391 | } 392 | .swiper-container-cube .swiper-slide .swiper-slide, 393 | .swiper-container-flip .swiper-slide .swiper-slide { 394 | pointer-events: none; 395 | } 396 | .swiper-container-cube .swiper-slide-active, 397 | .swiper-container-flip .swiper-slide-active, 398 | .swiper-container-cube .swiper-slide-active .swiper-slide-active, 399 | .swiper-container-flip .swiper-slide-active .swiper-slide-active { 400 | pointer-events: auto; 401 | } 402 | .swiper-container-cube .swiper-slide-shadow-top, 403 | .swiper-container-flip .swiper-slide-shadow-top, 404 | .swiper-container-cube .swiper-slide-shadow-bottom, 405 | .swiper-container-flip .swiper-slide-shadow-bottom, 406 | .swiper-container-cube .swiper-slide-shadow-left, 407 | .swiper-container-flip .swiper-slide-shadow-left, 408 | .swiper-container-cube .swiper-slide-shadow-right, 409 | .swiper-container-flip .swiper-slide-shadow-right { 410 | z-index: 0; 411 | -webkit-backface-visibility: hidden; 412 | -moz-backface-visibility: hidden; 413 | -ms-backface-visibility: hidden; 414 | backface-visibility: hidden; 415 | } 416 | /* Cube */ 417 | .swiper-container-cube .swiper-slide { 418 | visibility: hidden; 419 | -webkit-transform-origin: 0 0; 420 | -moz-transform-origin: 0 0; 421 | -ms-transform-origin: 0 0; 422 | transform-origin: 0 0; 423 | width: 100%; 424 | height: 100%; 425 | } 426 | .swiper-container-cube.swiper-container-rtl .swiper-slide { 427 | -webkit-transform-origin: 100% 0; 428 | -moz-transform-origin: 100% 0; 429 | -ms-transform-origin: 100% 0; 430 | transform-origin: 100% 0; 431 | } 432 | .swiper-container-cube .swiper-slide-active, 433 | .swiper-container-cube .swiper-slide-next, 434 | .swiper-container-cube .swiper-slide-prev, 435 | .swiper-container-cube .swiper-slide-next + .swiper-slide { 436 | pointer-events: auto; 437 | visibility: visible; 438 | } 439 | .swiper-container-cube .swiper-cube-shadow { 440 | position: absolute; 441 | left: 0; 442 | bottom: 0px; 443 | width: 100%; 444 | height: 100%; 445 | background: #000; 446 | opacity: 0.6; 447 | -webkit-filter: blur(50px); 448 | filter: blur(50px); 449 | z-index: 0; 450 | } 451 | /* Fade */ 452 | .swiper-container-fade.swiper-container-free-mode .swiper-slide { 453 | -webkit-transition-timing-function: ease-out; 454 | -moz-transition-timing-function: ease-out; 455 | -ms-transition-timing-function: ease-out; 456 | -o-transition-timing-function: ease-out; 457 | transition-timing-function: ease-out; 458 | } 459 | .swiper-container-fade .swiper-slide { 460 | pointer-events: none; 461 | -webkit-transition-property: opacity; 462 | -moz-transition-property: opacity; 463 | -o-transition-property: opacity; 464 | transition-property: opacity; 465 | } 466 | .swiper-container-fade .swiper-slide .swiper-slide { 467 | pointer-events: none; 468 | } 469 | .swiper-container-fade .swiper-slide-active, 470 | .swiper-container-fade .swiper-slide-active .swiper-slide-active { 471 | pointer-events: auto; 472 | } 473 | .swiper-zoom-container { 474 | width: 100%; 475 | height: 100%; 476 | display: -webkit-box; 477 | display: -moz-box; 478 | display: -ms-flexbox; 479 | display: -webkit-flex; 480 | display: flex; 481 | -webkit-box-pack: center; 482 | -moz-box-pack: center; 483 | -ms-flex-pack: center; 484 | -webkit-justify-content: center; 485 | justify-content: center; 486 | -webkit-box-align: center; 487 | -moz-box-align: center; 488 | -ms-flex-align: center; 489 | -webkit-align-items: center; 490 | align-items: center; 491 | text-align: center; 492 | } 493 | .swiper-zoom-container > img, 494 | .swiper-zoom-container > svg, 495 | .swiper-zoom-container > canvas { 496 | max-width: 100%; 497 | max-height: 100%; 498 | object-fit: contain; 499 | } 500 | /* Scrollbar */ 501 | .swiper-scrollbar { 502 | border-radius: 10px; 503 | position: relative; 504 | -ms-touch-action: none; 505 | background: rgba(0, 0, 0, 0.1); 506 | } 507 | .swiper-container-horizontal > .swiper-scrollbar { 508 | position: absolute; 509 | left: 1%; 510 | bottom: 3px; 511 | z-index: 50; 512 | height: 5px; 513 | width: 98%; 514 | } 515 | .swiper-container-vertical > .swiper-scrollbar { 516 | position: absolute; 517 | right: 3px; 518 | top: 1%; 519 | z-index: 50; 520 | width: 5px; 521 | height: 98%; 522 | } 523 | .swiper-scrollbar-drag { 524 | height: 100%; 525 | width: 100%; 526 | position: relative; 527 | background: rgba(0, 0, 0, 0.5); 528 | border-radius: 10px; 529 | left: 0; 530 | top: 0; 531 | } 532 | .swiper-scrollbar-cursor-drag { 533 | cursor: move; 534 | } 535 | /* Preloader */ 536 | .swiper-lazy-preloader { 537 | width: 42px; 538 | height: 42px; 539 | position: absolute; 540 | left: 50%; 541 | top: 50%; 542 | margin-left: -21px; 543 | margin-top: -21px; 544 | z-index: 10; 545 | -webkit-transform-origin: 50%; 546 | -moz-transform-origin: 50%; 547 | transform-origin: 50%; 548 | -webkit-animation: swiper-preloader-spin 1s steps(12, end) infinite; 549 | -moz-animation: swiper-preloader-spin 1s steps(12, end) infinite; 550 | animation: swiper-preloader-spin 1s steps(12, end) infinite; 551 | } 552 | .swiper-lazy-preloader:after { 553 | display: block; 554 | content: ""; 555 | width: 100%; 556 | height: 100%; 557 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); 558 | background-position: 50%; 559 | -webkit-background-size: 100%; 560 | background-size: 100%; 561 | background-repeat: no-repeat; 562 | } 563 | .swiper-lazy-preloader-white:after { 564 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); 565 | } 566 | @-webkit-keyframes swiper-preloader-spin { 567 | 100% { 568 | -webkit-transform: rotate(360deg); 569 | } 570 | } 571 | @keyframes swiper-preloader-spin { 572 | 100% { 573 | transform: rotate(360deg); 574 | } 575 | } 576 | -------------------------------------------------------------------------------- /old/dist/js/angular-animate.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.4.6 3 | (c) 2010-2015 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(F,x,Oa){'use strict';function va(a,b,c){if(!a)throw ngMinErr("areq",b||"?",c||"required");return a}function wa(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;Y(a)&&(a=a.join(" "));Y(b)&&(b=b.join(" "));return a+" "+b}function Fa(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function V(a,b,c){var d="";a=Y(a)?a:a&&M(a)&&a.length?a.split(/\s+/):[];q(a,function(a,y){a&&0=a&&(a=h,h=0,b.push(e),e=[]);e.push(l.fn); 29 | l.children.forEach(function(a){h++;c.push(a)});a--}e.length&&b.push(e);return b}(c)}var O=[],x=Q(a);return function(t,z,E){function h(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];q(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function S(a){var b=[],c={};q(a,function(a,g){var d=G(a.element),f=0<=["enter","move"].indexOf(a.event),d=a.structural?h(d):[];if(d.length){var e=f?"to":"from";q(d,function(a){var b=a.getAttribute("ng-animate-ref"); 30 | c[b]=c[b]||{};c[b][e]={animationID:g,element:I(a)}})}else b.push(a)});var d={},f={};q(c,function(c,e){var h=c.from,r=c.to;if(h&&r){var J=a[h.animationID],k=a[r.animationID],B=h.animationID.toString();if(!f[B]){var l=f[B]={structural:!0,beforeStart:function(){J.beforeStart();k.beforeStart()},close:function(){J.close();k.close()},classes:u(J.classes,k.classes),from:J,to:k,anchors:[]};l.classes.length?b.push(l):(b.push(J),b.push(k))}f[B].anchors.push({out:h.element,"in":r.element})}else h=h?h.animationID: 31 | r.animationID,r=h.toString(),d[r]||(d[r]=!0,b.push(a[h]))});return b}function u(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;dC.expectedEndTime)?v.cancel(C.timer):p.push(r)}z&&(u=v(d,u,!1),p[0]={timer:u,expectedEndTime:k},p.push(r),a.data("$$animateCss",p));a.on(m.join(" "),l);ya(a,c)}} 39 | function d(){var b=a.data("$$animateCss");if(b){for(var c=1;c=M&&b>=K&&(S=!0,r())}if(!s)if(g.parentNode){var H,m=[],k=function(a){if(S)z&&a&&(z=!1,r());else if(z=!a,D.animationDuration)if(a=ma(g,z),z)w.push(a);else{var b=w,c=b.indexOf(a);0<=a&&b.splice(c,1)}},p=0