-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 431ee02
Showing
82 changed files
with
17,017 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"modules": false, | ||
"targets": { | ||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"] | ||
} | ||
}], | ||
"stage-2" | ||
], | ||
"plugins": ["transform-vue-jsx", "transform-runtime"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.DS_Store | ||
node_modules/ | ||
/dist/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// https://github.com/michael-ciniawsky/postcss-load-config | ||
|
||
module.exports = { | ||
"plugins": { | ||
"postcss-import": {}, | ||
"postcss-url": {}, | ||
// to edit target browsers: use "browserslist" field in package.json | ||
"autoprefixer": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# 小试牛刀之vue2.0豆瓣app项目 | ||
|
||
> A Vue.js project | ||
## Build Setup | ||
|
||
``` bash | ||
# 下载后安装依赖 | ||
npm install | ||
|
||
# 然后就可以跑起这个项目了 at localhost:8080 | ||
npm run dev | ||
|
||
注意用的是vue2.0+vue-cli2,node版本为v10.14.1 如果出现版本不兼容情况 那就不兼容吧 哈哈!! | ||
``` | ||
|
||
# 豆瓣电影 | ||
|
||
## 1、电影正在热映 URL: | ||
|
||
``http://api.douban.com/v2/movie/nowplaying?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 2、电影条目信息 URL: | ||
|
||
``https://api.douban.com/v2/movie/subject/:id`` | ||
|
||
## 3、电影条目剧照 URL: | ||
|
||
``http://api.douban.com/v2/movie/subject/:id/photos?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
``http://api.douban.com/movie/subject/:id/photos?alt=json&apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
``http://api.douban.com/movie/subject/:id/photos?alt=json&apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 4.影人条目信息 URL: | ||
|
||
``http://api.douban.com/v2/movie/celebrity/:id?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 5.影人剧照 URL: | ||
|
||
``http://api.douban.com/v2/movie/celebrity/:id/photos?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 6.即将上映 URL: | ||
|
||
``http://api.douban.com/v2/movie/coming?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 8.TOP250 URL: | ||
|
||
``http://api.douban.com/v2/movie/top250?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 9.电影本周口碑榜 URL: | ||
|
||
`http://api.douban.com/v2/movie/weekly?apikey=0df993c66c0c636e29ecbb5344252a4a` | ||
|
||
## 10.北美票房榜 URL: | ||
|
||
``http://api.douban.com/v2/movie/us_box?apikey=0df993c66c0c636e29ecbb5344252a4a`` | ||
|
||
## 11.新片榜 URL: | ||
|
||
`http://api.douban.com/v2/movie/new_movies?apikey=0df993c66c0c636e29ecbb5344252a4a` | ||
|
||
## 附加: | ||
|
||
热映电影 | ||
`http://api.douban.com/v2/movie/in_theaters` | ||
`https://api.douban.com/v2/movie/in_theaters?count=8` | ||
搜索 | ||
`https://api.douban.com/v2/movie/search?q=总经理&count=10` | ||
|
||
电影条目搜索 | ||
|
||
`http://api.douban.com/v2/movie/search?tag=喜剧` | ||
|
||
即将上映的电影 | ||
`https://api.douban.com/v2/movie/coming_soon?count=8` | ||
|
||
豆瓣电影Top250 | ||
`https://api.douban.com/v2/movie/top250?count=8` | ||
|
||
# 豆瓣小组 | ||
|
||
### 成员 | ||
|
||
`https://api.douban.com/v2/group/husttgeek/members` | ||
|
||
1. 获取小组基本信息:/group/:id? 如:`https://api.douban.com/v2/group/husttgeek/` | ||
2. 获取话题列表: /group/:id/topics? 如:`https://api.douban.com/v2/group/husttgeek/topics` | ||
3. 新发话题估计是POST到上面那个地址,没测试 | ||
4. 获取某话题评论列表: /group/topic/:id/comments? 如:`https://api.douban.com/v2/group/topic/33488193/comments` | ||
|
||
# 豆瓣音乐 | ||
|
||
``` | ||
搜索 https://api.douban.com/v2/music/search?q=欧美&count=15? | ||
详情 https://api.douban.com/v2/music/:id | ||
``` | ||
|
||
# 豆瓣图书 | ||
|
||
``` | ||
https://api.douban.com/v2/book/search?q=虚构类&count=8 | ||
https://api.douban.com/v2/book/search?q=非虚构类&count=8 | ||
https://api.douban.com/v2/book/search?q=旅行&count=8 | ||
详情:https://api.douban.com/v2/book/:id | ||
``` | ||
|
||
### 其他 | ||
|
||
`某大神的镜像代理66哒http://douban.uieee.com/v2/book/27073559 ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict' | ||
require('./check-versions')() | ||
|
||
process.env.NODE_ENV = 'production' | ||
|
||
const ora = require('ora') | ||
const rm = require('rimraf') | ||
const path = require('path') | ||
const chalk = require('chalk') | ||
const webpack = require('webpack') | ||
const config = require('../config') | ||
const webpackConfig = require('./webpack.prod.conf') | ||
|
||
const spinner = ora('building for production...') | ||
spinner.start() | ||
|
||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { | ||
if (err) throw err | ||
webpack(webpackConfig, (err, stats) => { | ||
spinner.stop() | ||
if (err) throw err | ||
process.stdout.write(stats.toString({ | ||
colors: true, | ||
modules: false, | ||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. | ||
chunks: false, | ||
chunkModules: false | ||
}) + '\n\n') | ||
|
||
if (stats.hasErrors()) { | ||
console.log(chalk.red(' Build failed with errors.\n')) | ||
process.exit(1) | ||
} | ||
|
||
console.log(chalk.cyan(' Build complete.\n')) | ||
console.log(chalk.yellow( | ||
' Tip: built files are meant to be served over an HTTP server.\n' + | ||
' Opening index.html over file:// won\'t work.\n' | ||
)) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict' | ||
const chalk = require('chalk') | ||
const semver = require('semver') | ||
const packageConfig = require('../package.json') | ||
const shell = require('shelljs') | ||
|
||
function exec (cmd) { | ||
return require('child_process').execSync(cmd).toString().trim() | ||
} | ||
|
||
const versionRequirements = [ | ||
{ | ||
name: 'node', | ||
currentVersion: semver.clean(process.version), | ||
versionRequirement: packageConfig.engines.node | ||
} | ||
] | ||
|
||
if (shell.which('npm')) { | ||
versionRequirements.push({ | ||
name: 'npm', | ||
currentVersion: exec('npm --version'), | ||
versionRequirement: packageConfig.engines.npm | ||
}) | ||
} | ||
|
||
module.exports = function () { | ||
const warnings = [] | ||
|
||
for (let i = 0; i < versionRequirements.length; i++) { | ||
const mod = versionRequirements[i] | ||
|
||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { | ||
warnings.push(mod.name + ': ' + | ||
chalk.red(mod.currentVersion) + ' should be ' + | ||
chalk.green(mod.versionRequirement) | ||
) | ||
} | ||
} | ||
|
||
if (warnings.length) { | ||
console.log('') | ||
console.log(chalk.yellow('To use this template, you must update following to modules:')) | ||
console.log() | ||
|
||
for (let i = 0; i < warnings.length; i++) { | ||
const warning = warnings[i] | ||
console.log(' ' + warning) | ||
} | ||
|
||
console.log() | ||
process.exit(1) | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
'use strict' | ||
const path = require('path') | ||
const config = require('../config') | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin') | ||
const packageConfig = require('../package.json') | ||
|
||
exports.assetsPath = function (_path) { | ||
const assetsSubDirectory = process.env.NODE_ENV === 'production' | ||
? config.build.assetsSubDirectory | ||
: config.dev.assetsSubDirectory | ||
|
||
return path.posix.join(assetsSubDirectory, _path) | ||
} | ||
|
||
exports.cssLoaders = function (options) { | ||
options = options || {} | ||
|
||
const cssLoader = { | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: options.sourceMap | ||
} | ||
} | ||
|
||
const postcssLoader = { | ||
loader: 'postcss-loader', | ||
options: { | ||
sourceMap: options.sourceMap | ||
} | ||
} | ||
|
||
// generate loader string to be used with extract text plugin | ||
function generateLoaders (loader, loaderOptions) { | ||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] | ||
|
||
if (loader) { | ||
loaders.push({ | ||
loader: loader + '-loader', | ||
options: Object.assign({}, loaderOptions, { | ||
sourceMap: options.sourceMap | ||
}) | ||
}) | ||
} | ||
|
||
// Extract CSS when that option is specified | ||
// (which is the case during production build) | ||
if (options.extract) { | ||
return ExtractTextPlugin.extract({ | ||
use: loaders, | ||
fallback: 'vue-style-loader' | ||
}) | ||
} else { | ||
return ['vue-style-loader'].concat(loaders) | ||
} | ||
} | ||
|
||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html | ||
return { | ||
css: generateLoaders(), | ||
postcss: generateLoaders(), | ||
less: generateLoaders('less'), | ||
sass: generateLoaders('sass', { indentedSyntax: true }), | ||
scss: generateLoaders('sass'), | ||
stylus: generateLoaders('stylus'), | ||
styl: generateLoaders('stylus') | ||
} | ||
} | ||
|
||
// Generate loaders for standalone style files (outside of .vue) | ||
exports.styleLoaders = function (options) { | ||
const output = [] | ||
const loaders = exports.cssLoaders(options) | ||
|
||
for (const extension in loaders) { | ||
const loader = loaders[extension] | ||
output.push({ | ||
test: new RegExp('\\.' + extension + '$'), | ||
use: loader | ||
}) | ||
} | ||
|
||
return output | ||
} | ||
|
||
exports.createNotifierCallback = () => { | ||
const notifier = require('node-notifier') | ||
|
||
return (severity, errors) => { | ||
if (severity !== 'error') return | ||
|
||
const error = errors[0] | ||
const filename = error.file && error.file.split('!').pop() | ||
|
||
notifier.notify({ | ||
title: packageConfig.name, | ||
message: severity + ': ' + error.name, | ||
subtitle: filename || '', | ||
icon: path.join(__dirname, 'logo.png') | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
const utils = require('./utils') | ||
const config = require('../config') | ||
const isProduction = process.env.NODE_ENV === 'production' | ||
const sourceMapEnabled = isProduction | ||
? config.build.productionSourceMap | ||
: config.dev.cssSourceMap | ||
|
||
module.exports = { | ||
loaders: utils.cssLoaders({ | ||
sourceMap: sourceMapEnabled, | ||
extract: isProduction | ||
}), | ||
cssSourceMap: sourceMapEnabled, | ||
cacheBusting: config.dev.cacheBusting, | ||
transformToRequire: { | ||
video: ['src', 'poster'], | ||
source: 'src', | ||
img: 'src', | ||
image: 'xlink:href' | ||
} | ||
} |
Oops, something went wrong.