diff --git a/README.md b/README.md index 3621af2..0579d52 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ # code-review-web +CodeReview is a professional platform for code review, communication, and sharing. Engineers can submit their code for expert review to improve the quality of their code. It was founded by 6 Internet lovers, including me. + +![img](./img/cr1.jpg) + +![img](./img/cr2.jpg) + +# Projects + +* [code-review-server](https://github.com/lzwjava/code-review-server) +* [code-review-web](https://github.com/lzwjava/code-review-web) ### Building @@ -16,6 +26,16 @@ git submodule init git submodule update ``` -### 本地调试 +### Debug 将 apitest.conf 复制到 /usr/local/nginx/conf/sites/ 下面。在 nginx.conf 中引入 sites/*.conf。重启 nginx。 + +### Contributors + +| author | commits | +| ------------- | ------------- | +| lzwjava | 302 | +| LeslieYQ | 73 | +|Martin|52| +|zangqilong|4| + diff --git a/build/html.plugin.conf.js b/build/html.plugin.conf.js index 2766ec3..1775407 100644 --- a/build/html.plugin.conf.js +++ b/build/html.plugin.conf.js @@ -9,7 +9,8 @@ var HtmlWebpackPlugin = require('html-webpack-plugin') var path = require('path') var devConfig = ['index.html', 'case.html', 'article.html', 'order.html', 'reviewer.html', 'setting.html', -'statement.html', 'write-review.html', 'reviewers.html', 'belief.html', 'paid.html', 'video.html']; +'statement.html', 'write-review.html', 'reviewers.html', 'belief.html', 'paid.html', 'video.html', +'notifications.html', 'event.html', 'workshop.html']; function HtmlWebpackPluginConfig(type) { var filePath = ''; diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index 592c519..af7c419 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -16,7 +16,10 @@ module.exports = { statement: ['./src/statement.js'], belief: ['./src/belief.js'], paid: ['./src/paid.js'], - video: ['./src/video.js'] + video: ['./src/video.js'], + notifications: ['./src/notifications.js'], + event: ['./src/event.js'], + workshop: ['./src/workshop.js'] }, output: { path: path.resolve(__dirname, '../dist/static/'), @@ -33,6 +36,7 @@ module.exports = { modulesDirectories: ['node_modules','plupload', srcPath] }, module: { + noParse: [/autoit.js/], // https://github.com/isagalaev/highlight.js/issues/895 loaders: [ { test: /\.vue$/, @@ -47,6 +51,10 @@ module.exports = { test: /\.(png|jpg|gif)$/, loader: 'url-loader?limit=8190' }, + { + test: /\.(mp4|webm)/, + loader: 'file-loader' + }, { test: /\.css$/, loader: "style-loader!css-loader" }, diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index 5846fc6..c827bfd 100644 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -1,3 +1,4 @@ +var webpack = require('webpack') var config = require('./webpack.base.conf') var path = require('path') var htmlConfig = require('./html.plugin.conf') @@ -18,6 +19,12 @@ config.devServer = { // when serving the html from in-memory config.output.publicPath = '/' -config.plugins = (config.plugins || []).concat(htmlConfig('dev')) +config.plugins = (config.plugins || []).concat([ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: '"local"' + } + }) +]).concat(htmlConfig('dev')) module.exports = config diff --git a/img/cr1.jpg b/img/cr1.jpg new file mode 100644 index 0000000..360f461 Binary files /dev/null and b/img/cr1.jpg differ diff --git a/img/cr2.jpg b/img/cr2.jpg new file mode 100644 index 0000000..4cf9c1a Binary files /dev/null and b/img/cr2.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..6858ebe --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + + Simple HTML Page + + +

Hello, World!

+

This is a simple HTML page.

+ + \ No newline at end of file diff --git a/package.json b/package.json index 2533d44..18b2098 100644 --- a/package.json +++ b/package.json @@ -47,15 +47,18 @@ "blueimp-md5": "^1.1.1", "es6-promise": "^3.0.2", "firebase": "^2.3.1", + "font-awesome": "^4.5.0", "github-markdown-css": "^2.1.1", + "highlight.js": "^9.1.0", + "jeet": "^6.1.2", "jquery": "^2.1.4", "marked": "^0.3.5", "moment": "^2.11.0", "qiniu-js-sdk": "0.0.2", + "rupture": "^0.6.1", "sprintf-js": "^1.0.3", "vue": "^1.0.10", "vue-router": "^0.7.5", - "word-color": "^1.2.0", - "highlight.js": "^9.1.0" + "word-color": "^1.2.0" } } diff --git a/src/article.html b/src/article.html index edece76..d7f39ea 100644 --- a/src/article.html +++ b/src/article.html @@ -7,6 +7,7 @@ CodeReview一个专业的代码审查交流分享平台 + + + diff --git a/src/components/event-form.vue b/src/components/event-form.vue new file mode 100644 index 0000000..ac11180 --- /dev/null +++ b/src/components/event-form.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/src/components/guide.vue b/src/components/guide.vue index 78bdb8a..7dd1caa 100644 --- a/src/components/guide.vue +++ b/src/components/guide.vue @@ -2,20 +2,20 @@
-

Code Review 使用指南

+

Code Review 申请指南

-

{{stepText}}

+

{{stepText}}

{{title}}

{{text}}

@@ -164,7 +164,7 @@ blue = #1cb2ef -webkit-transform scale(1) transition all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) -webkit-transition all 0.6 cubic-bezier(0.68, -0.55, 0.265, 1.55) - &。step4 + &.step4 transform scale(0) -webkit-transform scale(0) transition all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) @@ -205,7 +205,7 @@ blue = #1cb2ef &:hover color blue &.disabled - opacity .5 + display none cursor not-allowed .card-content top 0px diff --git a/src/components/loading.vue b/src/components/loading.vue index f2a6a01..cef890f 100644 --- a/src/components/loading.vue +++ b/src/components/loading.vue @@ -26,6 +26,9 @@ export default { this.$on('loaded', () => { this.loading = false; }); + this.$on('loading', () => { + this.loading = true; + }); } }; diff --git a/src/components/login.vue b/src/components/login.vue index 5e2e4ed..bded7b8 100644 --- a/src/components/login.vue +++ b/src/components/login.vue @@ -7,14 +7,16 @@
  • +
  • +
- +

忘记密码?

您还没有注册?

@@ -44,6 +46,10 @@ e.stopPropagation(); this.$dispatch('changeView', 'signup'); }, + toForgot(e) { + e.stopPropagation(); + this.$dispatch('changeView', 'reset-password'); + }, login (){ this.$http.post(serviceUrl.login, { mobilePhoneNumber: this.phone, @@ -61,15 +67,17 @@ } diff --git a/src/components/markdown-area.vue b/src/components/markdown-area.vue index e84d440..00911a1 100644 --- a/src/components/markdown-area.vue +++ b/src/components/markdown-area.vue @@ -8,7 +8,7 @@ 预览模式 -
+
编辑模式
+ + + + +
+ +

验证码已发送至 {{phone}}
请输入验证码及新密码完成{{actionTitle}}

+ + + + +
+ +
+ + + + + + diff --git a/src/components/signup.vue b/src/components/signup.vue index 4cb3d34..85f3023 100644 --- a/src/components/signup.vue +++ b/src/components/signup.vue @@ -4,19 +4,26 @@

注册开启 Code Review 之旅

+ +
-
+
+
+ +
+ +

注册前请仔细阅读 服务条款

@@ -100,11 +107,12 @@ diff --git a/src/components/user-avatar.vue b/src/components/user-avatar.vue index face5a7..9031e6a 100644 --- a/src/components/user-avatar.vue +++ b/src/components/user-avatar.vue @@ -1,6 +1,6 @@ diff --git a/src/components/workshop-form.vue b/src/components/workshop-form.vue new file mode 100644 index 0000000..06f3466 --- /dev/null +++ b/src/components/workshop-form.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/src/event.html b/src/event.html new file mode 100644 index 0000000..8e0cdaa --- /dev/null +++ b/src/event.html @@ -0,0 +1,34 @@ + + + + + + + CodeReview一个专业的代码审查交流分享平台 + + + + + + + + + + + + + + + + diff --git a/src/event.js b/src/event.js new file mode 100644 index 0000000..25e6d4e --- /dev/null +++ b/src/event.js @@ -0,0 +1,13 @@ +import Vue from 'vue' +import Nav from './views/nav.vue' +import MainBody from './views/event.vue' +import util from './common/util' +util.configVue(Vue) + +let reviewer = new Vue({ + el: 'html', + components:{ + 'my-nav': Nav, + 'main-body': MainBody + } +}); diff --git a/src/font/iconfont.css b/src/font/iconfont.css new file mode 100755 index 0000000..1650eee --- /dev/null +++ b/src/font/iconfont.css @@ -0,0 +1,50 @@ +@font-face { + font-family: 'icomoon'; + src: url('http://7xotd0.com1.z0.glb.clouddn.com/icomoon.eot?csr0me'); + src: url('http://7xotd0.com1.z0.glb.clouddn.com/icomoon.eot?csr0me#iefix') format('embedded-opentype'), + url('http://7xotd0.com1.z0.glb.clouddn.com/icomoon.ttf?csr0me') format('truetype'), + url('http://7xotd0.com1.z0.glb.clouddn.com/icomoon.woff?csr0me') format('woff'), + url('http://7xotd0.com1.z0.glb.clouddn.com/icomoon.svg?csr0me#icomoon') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-"], [class*=" icon-"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'icomoon' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-Password:before { + content: "\e900"; +} +.icon-Phone:before { + content: "\e901"; +} +.icon-User:before { + content: "\e902"; +} +.icon-Verify:before { + content: "\e903"; +} + +.icon { + position: absolute; + font-size: 32px; + color: #282F31; + margin-top: -43px; + margin-left: 13px; + opacity: 0.65; +} + + + diff --git a/src/font/iconfonts/icomoon.eot b/src/font/iconfonts/icomoon.eot new file mode 100755 index 0000000..9ca77cd Binary files /dev/null and b/src/font/iconfonts/icomoon.eot differ diff --git a/src/font/iconfonts/icomoon.svg b/src/font/iconfonts/icomoon.svg new file mode 100755 index 0000000..01faee7 --- /dev/null +++ b/src/font/iconfonts/icomoon.svg @@ -0,0 +1,14 @@ + + + +Generated by IcoMoon + + + + + + + + + + \ No newline at end of file diff --git a/src/font/iconfonts/icomoon.ttf b/src/font/iconfonts/icomoon.ttf new file mode 100755 index 0000000..c331c9f Binary files /dev/null and b/src/font/iconfonts/icomoon.ttf differ diff --git a/src/font/iconfonts/icomoon.woff b/src/font/iconfonts/icomoon.woff new file mode 100755 index 0000000..1493234 Binary files /dev/null and b/src/font/iconfonts/icomoon.woff differ diff --git a/src/img/comment-emptystate@2x.png b/src/img/comment-emptystate@2x.png new file mode 100644 index 0000000..45ed24c Binary files /dev/null and b/src/img/comment-emptystate@2x.png differ diff --git a/src/img/event/MartinRGB.jpg b/src/img/event/MartinRGB.jpg new file mode 100644 index 0000000..9ecc1f5 Binary files /dev/null and b/src/img/event/MartinRGB.jpg differ diff --git a/src/img/event/agenda_bg.png b/src/img/event/agenda_bg.png new file mode 100644 index 0000000..bfa3715 Binary files /dev/null and b/src/img/event/agenda_bg.png differ diff --git a/src/img/event/biao.jpg b/src/img/event/biao.jpg new file mode 100644 index 0000000..f9b52b4 Binary files /dev/null and b/src/img/event/biao.jpg differ diff --git a/src/img/event/event_qrcode.jpg b/src/img/event/event_qrcode.jpg new file mode 100644 index 0000000..5038f5f Binary files /dev/null and b/src/img/event/event_qrcode.jpg differ diff --git a/src/img/event/info_bg.jpg b/src/img/event/info_bg.jpg new file mode 100644 index 0000000..06dcd95 Binary files /dev/null and b/src/img/event/info_bg.jpg differ diff --git a/src/img/event/intro_bg.png b/src/img/event/intro_bg.png new file mode 100644 index 0000000..9cef7ed Binary files /dev/null and b/src/img/event/intro_bg.png differ diff --git a/src/img/event/ios_programmer.jpg b/src/img/event/ios_programmer.jpg new file mode 100644 index 0000000..469e69a Binary files /dev/null and b/src/img/event/ios_programmer.jpg differ diff --git a/src/img/event/lzwjava_avatar.jpg b/src/img/event/lzwjava_avatar.jpg new file mode 100644 index 0000000..82c6e3e Binary files /dev/null and b/src/img/event/lzwjava_avatar.jpg differ diff --git a/src/img/event/map_3w.jpg b/src/img/event/map_3w.jpg new file mode 100644 index 0000000..7c03e7b Binary files /dev/null and b/src/img/event/map_3w.jpg differ diff --git a/src/img/event/mount.jpg b/src/img/event/mount.jpg new file mode 100644 index 0000000..4481ba7 Binary files /dev/null and b/src/img/event/mount.jpg differ diff --git a/src/img/event/speaker_bg.png b/src/img/event/speaker_bg.png new file mode 100644 index 0000000..86dea96 Binary files /dev/null and b/src/img/event/speaker_bg.png differ diff --git a/src/img/event/ticket_bg.png b/src/img/event/ticket_bg.png new file mode 100644 index 0000000..323f067 Binary files /dev/null and b/src/img/event/ticket_bg.png differ diff --git a/src/img/event/wenhan.jpg b/src/img/event/wenhan.jpg new file mode 100644 index 0000000..174babe Binary files /dev/null and b/src/img/event/wenhan.jpg differ diff --git a/src/img/event/yanrui.jpg b/src/img/event/yanrui.jpg new file mode 100644 index 0000000..46d0fdd Binary files /dev/null and b/src/img/event/yanrui.jpg differ diff --git a/src/img/event/yeguchen.jpg b/src/img/event/yeguchen.jpg new file mode 100644 index 0000000..3daa5d0 Binary files /dev/null and b/src/img/event/yeguchen.jpg differ diff --git a/src/img/guide/Step1.jpg b/src/img/guide/Step1.jpg index 08402b9..5bc2c31 100644 Binary files a/src/img/guide/Step1.jpg and b/src/img/guide/Step1.jpg differ diff --git a/src/img/guide/Step3.jpg b/src/img/guide/Step3.jpg index 2f55313..c78b8f9 100644 Binary files a/src/img/guide/Step3.jpg and b/src/img/guide/Step3.jpg differ diff --git a/src/img/icon/new-comment.png b/src/img/icon/new-comment.png new file mode 100644 index 0000000..cf30260 Binary files /dev/null and b/src/img/icon/new-comment.png differ diff --git a/src/img/icon/reply-comment.png b/src/img/icon/reply-comment.png new file mode 100644 index 0000000..1729f01 Binary files /dev/null and b/src/img/icon/reply-comment.png differ diff --git a/src/img/qrcode.png b/src/img/qrcode.png deleted file mode 100644 index 583289e..0000000 Binary files a/src/img/qrcode.png and /dev/null differ diff --git a/src/img/workshop/beijing_bg.png b/src/img/workshop/beijing_bg.png new file mode 100644 index 0000000..d493113 Binary files /dev/null and b/src/img/workshop/beijing_bg.png differ diff --git a/src/img/workshop/big-calendar.svg b/src/img/workshop/big-calendar.svg new file mode 100644 index 0000000..29ef9b6 --- /dev/null +++ b/src/img/workshop/big-calendar.svg @@ -0,0 +1,20 @@ + + + + big-calendar + Created with Sketch. + + + + + + + + + + + + + + + diff --git a/src/img/workshop/big-location.svg b/src/img/workshop/big-location.svg new file mode 100644 index 0000000..2a61f8d --- /dev/null +++ b/src/img/workshop/big-location.svg @@ -0,0 +1,20 @@ + + + + big-location + Created with Sketch. + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/img/workshop/big-swift.svg b/src/img/workshop/big-swift.svg new file mode 100644 index 0000000..e10c0a0 --- /dev/null +++ b/src/img/workshop/big-swift.svg @@ -0,0 +1,20 @@ + + + + big-swift + Created with Sketch. + + + + + + + + + + + + + + + diff --git a/src/img/workshop/intro_bg.jpg b/src/img/workshop/intro_bg.jpg new file mode 100644 index 0000000..89e3190 Binary files /dev/null and b/src/img/workshop/intro_bg.jpg differ diff --git a/src/img/workshop/intro_bg1.png b/src/img/workshop/intro_bg1.png new file mode 100644 index 0000000..3fdae64 Binary files /dev/null and b/src/img/workshop/intro_bg1.png differ diff --git a/src/img/workshop/iphoneblack.png b/src/img/workshop/iphoneblack.png new file mode 100644 index 0000000..d58d76f Binary files /dev/null and b/src/img/workshop/iphoneblack.png differ diff --git a/src/img/workshop/photo-eiffeltower.jpg b/src/img/workshop/photo-eiffeltower.jpg new file mode 100644 index 0000000..1ca5443 Binary files /dev/null and b/src/img/workshop/photo-eiffeltower.jpg differ diff --git a/src/img/workshop/photo-louvre.jpg b/src/img/workshop/photo-louvre.jpg new file mode 100644 index 0000000..8af9c32 Binary files /dev/null and b/src/img/workshop/photo-louvre.jpg differ diff --git a/src/img/workshop/screen-iphone6.png b/src/img/workshop/screen-iphone6.png new file mode 100644 index 0000000..13e1929 Binary files /dev/null and b/src/img/workshop/screen-iphone6.png differ diff --git a/src/img/workshop/screen-swift.png b/src/img/workshop/screen-swift.png new file mode 100644 index 0000000..af6a607 Binary files /dev/null and b/src/img/workshop/screen-swift.png differ diff --git a/src/img/workshop/storehouse.mp4 b/src/img/workshop/storehouse.mp4 new file mode 100644 index 0000000..762bdf3 Binary files /dev/null and b/src/img/workshop/storehouse.mp4 differ diff --git a/src/img/workshop/workshop_qrcode.jpg b/src/img/workshop/workshop_qrcode.jpg new file mode 100644 index 0000000..94a0daf Binary files /dev/null and b/src/img/workshop/workshop_qrcode.jpg differ diff --git a/src/notifications.html b/src/notifications.html new file mode 100644 index 0000000..cb6f13f --- /dev/null +++ b/src/notifications.html @@ -0,0 +1,34 @@ + + + + + + + CodeReview一个专业的代码审查交流分享平台 + + + + + + + + + + + + + + + + diff --git a/src/notifications.js b/src/notifications.js new file mode 100644 index 0000000..4cb5606 --- /dev/null +++ b/src/notifications.js @@ -0,0 +1,15 @@ +import Vue from 'vue' +import Nav from './views/nav.vue' +import Footer from './views/footer.vue' +import MainBody from './views/notifications.vue' +import util from './common/util' +util.configVue(Vue) + +let reviewer = new Vue({ + el: 'html', + components:{ + 'my-nav': Nav, + 'my-footer': Footer, + 'main-body': MainBody + } +}); diff --git a/src/stylus/base.styl b/src/stylus/base.styl index 7045f26..eb36fe7 100644 --- a/src/stylus/base.styl +++ b/src/stylus/base.styl @@ -1,47 +1,20 @@ @import "variables.styl" @import "reset.styl" -*{ - box-sizing: border-box; -} - -@font-face - font-family Raleway-Regular - src url('../font/Raleway-Regular.ttf') - -@font-face - font-family Raleway-Light - src url('../font/Raleway-Light.ttf') - -@font-face - font-family Raleway-ExtraLight - src url('../font/Raleway-ExtraLight.ttf') - -@font-face - font-family Raleway-SemiBold - src url('../font/Raleway-SemiBold.ttf') - -.raleway-first-font - font-family Raleway-Regular,"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","WenQuanYi Micro Hei",Arial,"Microsoft Yahei",Verdana,sans-serif - -.pingfang-first-font - font-family "PingFang SC","Helvetica Neue",Helvetica,"Hiragino Sans GB","WenQuanYi Micro Hei",Arial,"Microsoft Yahei",Verdana,sans-serif - -.raleway-regular-font - font-family Raleway-Regular,"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","WenQuanYi Micro Hei",Arial,"Microsoft Yahei",Verdana,sans-serif +* + box-sizing border-box html, body, a - @extend .raleway-first-font + font-family Helvetica,"Helvetica Neue","PingFang","Hiragino Sans GB","WenQuanYi Micro Hei",Arial,"Microsoft Yahei",Verdana,sans-serif color textColor text-decoration none -h2 - font-family Raleway-Regular - body - min-width 1200px background #F1F5F6 + @media screen and (max-width:768px) + width 100% + button,input,select,textarea border-radius 3px @@ -56,6 +29,7 @@ ul.list a:hover opacity 0.8 + transition .5s .btn-common margin 5px @@ -68,8 +42,12 @@ a:hover .btn-blue background #00BDEF - box-shadow 0px 1px 4px 0px rgba(0,0,0,0.50) color #fff + -webkit-box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset,0px 1px 2px rgba(0,0,0,0.15) + box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset,0px 1px 2px rgba(0,0,0,0.15) + &:hover + background #00ABD8 + transition .5s .btn-green background #33C96F @@ -100,7 +78,6 @@ h1 font-size 3.75rem font-weight 100 h2 - @extend .pingfang-first-font font-size 1.5rem font-weight 100 h3 @@ -108,6 +85,12 @@ h3 h4 font-size 1rem font-weight 600 - @extend .pingfang-first-font h5 font-size 20px + +input, textarea, select + &:focus + border none + outline none + box-shadow 0px 1px 4px 0px rgba(0,0,0,.06) + -webkit-box-shadow 0px 1px 4px 0px rgba(0,0,0,.06) diff --git a/src/views/article.vue b/src/views/article.vue index 43f9d88..dad9dfc 100644 --- a/src/views/article.vue +++ b/src/views/article.vue @@ -1,5 +1,6 @@ @@ -64,6 +71,7 @@ import util from '../common/util' import serviceUrl from "../common/serviceUrl.js" import Markdown from "../components/markdown.vue" import RewardForm from '../components/reward-form.vue' +import CommentList from '../components/comment-list.vue' var debug = require('debug')('article'); @@ -71,7 +79,8 @@ export default { components: { 'markdown': Markdown, 'overlay': Overlay, - 'reward-form': RewardForm + 'reward-form': RewardForm, + 'comment-list': CommentList }, data () { return { @@ -82,7 +91,8 @@ export default { }, review: { content: '' - } + }, + reviewId: 0 } }, computed: { @@ -97,16 +107,19 @@ export default { window.document.title = this.order.reviewer.username + ': ' + window.document.title; } }, util.httpErrorFn(this)); - } - }, - created() { - var params = util.getSearchParameters() - if (!params.reviewId) { - util.show(this, 'error', '请提供 reviewId 参数'); - return; - } - - this.$http.get(serviceUrl.reviewsView.replace(/:id/, params.reviewId)) + }, + postVisit(reviewId) { + this.$http.post(serviceUrl.reviewVisitCreate.replace(/:id/, reviewId),{ + referrer: document.referrer + }).then((resp) => { + if (util.filterError(this, resp)) { + } + }, (resp) => { + // 一秒中访问次数超过1,太快了 + }) + }, + loadReview(reviewId) { + this.$http.get(serviceUrl.reviewsView.replace(/:id/, reviewId)) .then((resp) => { if (util.filterError(this, resp)) { debug('%j', resp.data.result); @@ -115,16 +128,21 @@ export default { this.fetchOrder(this.review.orderId); } }, util.httpErrorFn(this)); - - this.$http.post(serviceUrl.reviewVisitCreate.replace(/:id/, params.reviewId),{ - referrer: document.referrer - }).then((resp) => { - if (util.filterError(this, resp)) { - - } - }, (resp) => { - // 一秒中访问次数超过1,太快了 - }) + } + }, + created() { + debug('article created'); + var params = util.getSearchParameters() + if (!params.reviewId) { + util.show(this, 'error', '请提供 reviewId 参数'); + return; + } + var reviewId = params.reviewId; + this.reviewId = reviewId; + debug('broadcast events'); + this.$broadcast('loadComments'); + this.loadReview(reviewId); + this.postVisit(reviewId); } } @@ -137,10 +155,11 @@ export default { body background #fff -.navbar - position fixed - top 0 - z-index 2 +@media screen and (min-width:768px) + .navbar + position fixed + top 0 + z-index 2 .header-area max-width 900px @@ -168,8 +187,11 @@ body .bottom-area .order-area .content-area - max-width 700px + max-width 65% margin 40px auto + @media screen and (max-width:768px) + max-width 90% + .btn-github width 84px height 27px diff --git a/src/views/case.vue b/src/views/case.vue index 2f52fe6..1356159 100755 --- a/src/views/case.vue +++ b/src/views/case.vue @@ -43,7 +43,8 @@ this.$broadcast('loaded'); this.caseList = res.data.result; if (this.caseList.length > 0) { - this.topReview = this.caseList[this.getRandomInt(0, this.caseList.length - 1)]; + this.topReview = this.caseList[0]; + //this.topReview = this.caseList[this.getRandomInt(0, this.caseList.length - 1)]; } }, 'no-article': function(){ @@ -88,11 +89,12 @@ margin 0 auto h1 margin-top 30px - font-size 60px - width 440px + font-size 50px + width 600px font-weight 100 margin-left -20px - line-height 84px + font-family Raleway-Light,PingFang-SC + line-height 70px .detail margin-left -20px height 40px diff --git a/src/views/event.vue b/src/views/event.vue new file mode 100644 index 0000000..c9cb8ba --- /dev/null +++ b/src/views/event.vue @@ -0,0 +1,632 @@ + + + + + + diff --git a/src/views/footer.vue b/src/views/footer.vue index da5db06..4a2b312 100644 --- a/src/views/footer.vue +++ b/src/views/footer.vue @@ -75,7 +75,7 @@ components: { text-align center color white .list - width 1160px + width 85% margin 0 auto display flex flex-direction row @@ -96,10 +96,10 @@ components: { margin-bottom 20px font-size 24px .rfont1 - font-family Raleway-Light + font-family Helvetica font-weight lighter .rfont2 - font-family Raleway-SemiBold + font-family Helvetica font-weight bold .detail2 opacity 0.6 @@ -108,19 +108,19 @@ components: { font-weight normal p color white - font-family Raleway + font-family Helvetica margin-top: -5px; .year - font-family Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif + font-family Helvetica Neue,Helvetica .ICP color white - font-family Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif + font-family Helvetica Neue,Helvetica li text-align left margin 0 auto line-height 19px - .number + .number margin-bottom 20px font-weight 500 font-size 20px @@ -131,6 +131,9 @@ components: { a color white cursor pointer - + +@media screen and (max-width:768px) + .slogan + display none diff --git a/src/views/home.vue b/src/views/home.vue index 8f73557..df3b6f3 100755 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -334,7 +334,7 @@ #header2 font-size 1.5rem font-weight 100 - font-family Raleway-ExtraLight,"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","WenQuanYi Micro Hei",Arial,"Microsoft Yahei",Verdana,sans-serif + font-family "Helvetica Neue",Helvetica .navbar position fixed z-index 8 // signup login overlay = 9 @@ -365,7 +365,6 @@ height 80px margin-top 60px .help - @extend .raleway-regular-font height 50px width 240px background #1CB2EF @@ -374,9 +373,7 @@ margin-top 70px color white border 1px solid #00A3E6 - -webkit-box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset,0px 1px 2px rgba(0,0,0,0.15) - box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset,0px 1px 2px rgba(0,0,0,0.15) - font-family Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif + font-family Helvetica Neue,Helvetica .feature height 450px padding 125px 0 @@ -416,7 +413,7 @@ line-height 180% font-size 0.88rem .review-document - font-family Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif + font-family Helvetica Neue,Helvetica .reviewer height 800px; position relative @@ -589,7 +586,7 @@ h6 width 200px word-break break-word - font-family "PingFang SC","Hiragino Sans GB","WenQuanYi Micro Hei",Arial,"Microsoft Yahei",Verdana,sans-serif + font-family "PingFang SC" .title font-size 1.5rem line-height 2rem diff --git a/src/views/nav.vue b/src/views/nav.vue index ab12360..6ae7877 100644 --- a/src/views/nav.vue +++ b/src/views/nav.vue @@ -20,18 +20,26 @@
  • 发现大神
  • 精彩案例
  • 直播视频
  • +
  • 线下活动
  • +
  • 研讨班
  • 注册
  • 登录
  • - +
    -
    +
    {{user.username}}
    @@ -50,6 +58,7 @@ import Overlay from '../components/overlay.vue'; import Login from '../components/login.vue'; import Signup from '../components/signup.vue'; + import ResetPassword from '../components/reset-password.vue'; import DropDown from '../components/dropdown.vue'; import UserAvatar from '../components/user-avatar.vue'; import serviceUrl from "../common/serviceUrl.js"; @@ -62,7 +71,8 @@ login: Login, signup: Signup, dropdown: DropDown, - 'user-avatar':UserAvatar + 'user-avatar':UserAvatar, + 'reset-password': ResetPassword }, data (){ return { @@ -70,9 +80,12 @@ overlayStatus: false, currentView: 'login', messages: [], - user: {} + user: {}, + notificationCount: 0 } }, + computed: { + }, events:{ changeView(view){ this.currentView = view; @@ -96,6 +109,10 @@ this.overlayStatus = true; this.currentView = 'signup'; }, + forgot () { + this.overlayStatus = true; + this.currentView = 'reset-password'; + }, viewUserDropdown (e) { e && e.preventDefault(); this.showUserDropdown = true; @@ -121,8 +138,27 @@ setTimeout(function() { this.clear(index); }.bind(this), timeout); + }, + check: function() { + // 这个在 notifications.vue 被调用了 + if (!this.user.username) return; + this.$http.get(serviceUrl.notificationsCount) + .then((resp) => { + if (util.filterError(this, resp)) { + this.notificationCount = resp.data.result.count; + debug('notificationsCount: ' + this.notificationCount); + } + }, util.httpErrorFn(this)) } }, + ready () { + this.check(); + //setTimeout(this.check.bind(this), 500); + var interval = 300000; + // check every 5 minutes + // this.check.bind(this); + setInterval(this.check.bind(this), interval); + }, created () { // console.log('created nav'); /*this.$http.get(serviceUrl.userStatus).then((res) => { @@ -159,13 +195,13 @@ background white border-bottom 1px solid rgba(0,0,0,0.15) box-shadow 0 2px 1px 0px rgba(135,135,135,.15) - min-width 1200px + width 100% left 0 right 0 .container margin 0 auto line-height totalHeight - 2 * paddingTop - width 1160px + width 80% height 100% .navbar-brand width 35px @@ -201,17 +237,30 @@ font-weight 600 &.hover-btn:hover color blue + .dropdown-anchor + position relative + .badge + position absolute + top 4px + right 4px + width 8px + height 8px + border-radius 50% + font-size 5px + background #f00 .dropdown-inner width 220px right 0 &:before,&:after left 90% + .notification-num + color #f00 .avatar width totalHeight - 2 * paddingTop height totalHeight - 2 * paddingTop img border-radius 50% - border 1px solid rgba(0,0,0,0.1) + border 1px solid #8F9DA4 #message position fixed diff --git a/src/views/notifications.vue b/src/views/notifications.vue new file mode 100644 index 0000000..aa1a1bc --- /dev/null +++ b/src/views/notifications.vue @@ -0,0 +1,175 @@ + + + + + + diff --git a/src/views/order-list.vue b/src/views/order-list.vue index df20adf..a5ade27 100644 --- a/src/views/order-list.vue +++ b/src/views/order-list.vue @@ -233,11 +233,19 @@ line-height 96px height: 96px text-align center + border-bottom 1px solid rgba(0,0,0,0.15) + border-right 1px solid rgba(0,0,0,0.15) + border-bottom 1px solid rgba(0,0,0,0.15) + box-shadow inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 2px rgba(0,0,0,0.15) + webkit-box-shadow 0 1px 0 rgba(255,255,255,0.15) inset, 0 1px 2px rgba(0,0,0,0.15) .list display: table; width: 100%; background #FDFFFF - font-family "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei", Arial, "Microsoft Yahei", Verdana, sans-serif + border 1px solid rgba(0,0,0,.15) + box-shadow inset 0 1px 0 hsla(0,0%,100%,.15),0 1px 2px rgba(0,0,0,.15) + -webkit-box-shadow 0 1px 0 hsla(0,0%,100%,.15) inset,0 1px 2px rgba(0,0,0,.15) + font-family "Helvetica Neue", Helvetica .list-row display: table-row background: rgba(255,255,255,0.03) diff --git a/src/views/paid.vue b/src/views/paid.vue index cdea658..e6b392a 100644 --- a/src/views/paid.vue +++ b/src/views/paid.vue @@ -1,7 +1,20 @@ @@ -19,15 +32,18 @@ export default { }, data () { return { + type: 'order' } }, computed: { - }, methods: { }, created() { - + var params = util.getSearchParameters(); + if (params.type) { + this.type = params.type; + } } } @@ -36,10 +52,16 @@ export default { diff --git a/src/views/reviewer-detail.vue b/src/views/reviewer-detail.vue index 6014838..48a7f91 100755 --- a/src/views/reviewer-detail.vue +++ b/src/views/reviewer-detail.vue @@ -1,7 +1,7 @@ @@ -70,11 +81,15 @@ import serviceUrl from "../common/serviceUrl.js" import Tag from '../components/tag.vue' import Loading from '../components/loading.vue' + import ResetPassword from '../components/reset-password.vue' + import Overlay from '../components/overlay.vue' export default { components: { 'user-avatar': UserAvatar, 'tag': Tag, - 'loading': Loading + 'loading': Loading, + 'reset-password': ResetPassword, + 'overlay': Overlay }, data () { return { @@ -88,7 +103,8 @@ avatarUrl: '', tags: [], allTags: [], - selected: '' + selected: '', + overlayStatus: false, } }, events: { @@ -187,10 +203,27 @@ }, applyReviewer () { var localUser = util.getLocalUser(); - if (!localUser.gitHubUsername || !localUser.company - || !localUser.jobTitle || !localUser.introduction - || localUser.avatarUrl == 'http://7xotd0.com1.z0.glb.clouddn.com/defaultAvatar.png') { - util.show(this, 'info', '请先完善并保存 GitHub、公司、职位、简介、头像信息。公司名称仅用作审核,不展示。', 8000); + var defaultUrl = 'http://7xotd0.com1.z0.glb.clouddn.com/defaultAvatar.png'; + if (!localUser.gitHubUsername && !localUser.company + && !localUser.jobTitle && !localUser.introduction + && localUser.avatarUrl == defaultUrl) { + util.show(this, 'info', '请先完善并保存各项资料。公司名称仅用作审核,不展示。'); + return; + } + if (!localUser.gitHubUsername) { + util.show(this, 'info', '请先完善并保存 GitHub 用户名'); + return; + } + if (!localUser.company) { + util.show(this, 'info', '请先完善并保存职务'); + return; + } + if (!localUser.introduction) { + util.show(this, 'info', '请先完善并保存简介'); + return; + } + if (localUser.avatarUrl == defaultUrl) { + util.show(this, 'info', '请先上传头像'); return; } this.$http.post(serviceUrl.applicationsCreate, { @@ -199,6 +232,9 @@ util.show(this, 'info', '已收到您的申请,将尽快处理'); } }, util.httpErrorFn(this)) + }, + showChangePassword() { + this.overlayStatus = true; } }, created() { @@ -331,6 +367,8 @@ .form width 61% font-weight 200 + box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) + -webkit-box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) .white background white padding-bottom 54px @@ -358,13 +396,15 @@ border-bottom-left-radius 3px border-bottom-right-radius 3px p - opacity 0.6 line-height 32px + opacity 0.75 + font-size 14px + font-weight 700 span opacity .6 position absolute top 78px - left 50px + padding-left 15px input height 50px border 1px solid rgba(40,47,49,.3) @@ -373,16 +413,19 @@ text-indent 15px box-shadow 0 1px 4px rgba(0,0,0,0.03) color rgba(40,47,49,.6) + &:focus + border 1px solid #1CB2EF textarea width 100% height 280px - padding 10px + padding 15px resize none color rgba(40,47,49,.6) font-size 1rem border 1px solid rgba(40,47,49,.3) - font-family Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif - + font-family Helvetica Neue,Helvetica + &:focus + border 1px solid #1CB2EF .update-btn margin 27px 0 54px background blue @@ -392,10 +435,15 @@ .apply-btn margin 27px 0 54px float right + .pwd-btn + width 80px + height 30px + line-height 100% .tags width 34% margin-left 5% - box-shadow 0 4px 4px rgba(135,135,135,0.15) + box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) + -webkit-box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) .tags-content background #FDFFFF font-weight 200 @@ -414,8 +462,10 @@ border-bottom-left-radius 3px border-bottom-right-radius 3px p - opacity 0.6 + opacity 0.75 line-height 50px + font-size 14px + font-weight 700 select height 50px width 205px @@ -423,6 +473,8 @@ border 1px solid rgba(40,47,49,0.3) box-shadow 0 1px 4px rgba(0,0,0,0.03) background white + &:focus + border 1px solid #1CB2EF option -webkit-appearance: none height 40px diff --git a/src/views/statement.vue b/src/views/statement.vue index e148223..6bb0778 100644 --- a/src/views/statement.vue +++ b/src/views/statement.vue @@ -90,7 +90,7 @@ body .markdown-body h1 text-align center - font-family Raleway-Regular,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif + font-family Helvetica Neue,Helvetica font-size 28px margin-bottom 40px !important diff --git a/src/views/video.vue b/src/views/video.vue index 013a333..d82f959 100644 --- a/src/views/video.vue +++ b/src/views/video.vue @@ -215,7 +215,7 @@ body opacity 0.6 font-size 14px margin-left 20px - font-family Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,WenQuanYi Micro Hei,Arial,Microsoft Yahei,Verdana,sans-serif + font-family Helvetica Neue,Helvetica .pull-right float right @@ -229,9 +229,8 @@ body .footer-area position absolute - bottom 0 + bottom 0px width 100% - height 100px margin 0 line-height 100px display none diff --git a/src/views/workshop.vue b/src/views/workshop.vue new file mode 100644 index 0000000..de3b432 --- /dev/null +++ b/src/views/workshop.vue @@ -0,0 +1,717 @@ + + + + + + diff --git a/src/views/write-review.vue b/src/views/write-review.vue index 902e58c..7d94a8d 100644 --- a/src/views/write-review.vue +++ b/src/views/write-review.vue @@ -37,7 +37,7 @@

    {{rightTitle}}

    -
    +
    请输入 Review 标题 @@ -181,10 +181,15 @@ export default { flex 1 margin-right 25px border 1px solid rgba(0,0,0,0.15) + box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) + -webkit-box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) + height 100% &.right flex 2 margin-left 25px border 1px solid rgba(0,0,0,0.15) + box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) + -webkit-box-shadow 0px 1px 0px rgba(255,255,255,0.15) inset, 0px 1px 2px rgba(0,0,0,0.15) .header border-bottom 1px solid rgba(0,0,0,.15) padding 30px @@ -193,9 +198,12 @@ export default { font-weight 600 h4 border-bottom 1px solid rgba(0,0,0,.15) - color rgba(40,47,49,.6) + color rgba(40,47,49,1) padding-top 10px padding-bottom 10px + opacity 0.75 + font-size 14px + font-weight 700 .content padding 30px .row @@ -225,6 +233,8 @@ export default { text-indent 10px font-size 16px opacity 0.8 + &:focus + border 1px solid #1CB2EF .edit-area textarea @@ -236,16 +246,22 @@ export default { font-size 16px opacity 0.8 padding 10px + max-width 597px + &:focus + border 1px solid #1CB2EF p.tip color rgba(40,47,49,.6) font-size 13px margin 8px 0px .submit-btn - btn(#00CFF5, #fff, 0.8, 220px, 50px) + btn(#1cb2ef, #fff, 0.8, 220px, 50px) margin 20px auto 10px display block font-size: 1rem; line-height: 50px; + border 1px solid #00a3e6 + box-shadow inset 0 1px 0 hsla(0,0%,100%,.15),0 1px 2px rgba(0,0,0,.15) + -webkit-box-shadow inset 0 1px 0 hsla(0,0%,100%,.15),0 1px 2px rgba(0,0,0,.15) diff --git a/src/workshop.html b/src/workshop.html new file mode 100644 index 0000000..e02b6bc --- /dev/null +++ b/src/workshop.html @@ -0,0 +1,35 @@ + + + + + + + CodeReview一个专业的代码审查交流分享平台 + + + + + + + + + + + + + + + + + diff --git a/src/workshop.js b/src/workshop.js new file mode 100644 index 0000000..407cae8 --- /dev/null +++ b/src/workshop.js @@ -0,0 +1,15 @@ +import Vue from 'vue' +import Nav from './views/nav.vue' +import MainBody from './views/workshop.vue' +import Footer from './views/footer.vue' +import util from './common/util' +util.configVue(Vue) + +let reviewer = new Vue({ + el: 'html', + components:{ + 'my-nav': Nav, + 'main-body': MainBody, + 'my-footer': Footer + } +});