├── .babelrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── README.md ├── build ├── build.js ├── check-versions.js ├── logo.png ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── favicon.ico ├── index.html ├── package-lock.json ├── package.json ├── screenshot ├── ask.png ├── data.png ├── home.png ├── my.png ├── register.png └── search.png ├── src ├── App.vue ├── api │ ├── ajax.js │ └── index.js ├── assets │ ├── css │ │ ├── base.css │ │ ├── iconfont.css │ │ └── reset.css │ ├── img │ │ ├── default.jpg │ │ ├── default.png │ │ └── nodata.png │ └── js │ │ ├── common.js │ │ ├── config.js │ │ ├── data.js │ │ └── filters.js ├── base │ ├── ask-menu │ │ └── ask-menu.vue │ ├── cell │ │ └── cell.vue │ ├── footer │ │ └── footer.vue │ ├── header │ │ └── header.vue │ ├── loadMore │ │ └── loadMore.vue │ ├── loginStyle │ │ └── loginStyle.vue │ ├── scroll │ │ └── scroll.vue │ ├── slide │ │ └── slide.vue │ └── tabHeader │ │ └── tabHeader.vue ├── components │ ├── anno-detail │ │ └── anno-detail.vue │ ├── anno │ │ └── anno.vue │ ├── ask │ │ └── ask.vue │ ├── card │ │ └── card.vue │ ├── category │ │ └── category.vue │ ├── details │ │ └── details.vue │ ├── forget │ │ └── forget.vue │ ├── home │ │ └── home.vue │ ├── login │ │ ├── bg.jpg │ │ └── login.vue │ ├── my-answer │ │ └── my-answer.vue │ ├── my-ques │ │ └── my-ques.vue │ ├── my-reply │ │ └── my-reply.vue │ ├── my │ │ ├── bg.png │ │ └── my.vue │ ├── publish │ │ └── publish.vue │ ├── register │ │ ├── bg.jpg │ │ └── register.vue │ └── search │ │ └── search.vue ├── main.js └── router │ └── index.js └── static └── .gitkeep /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime", ["import", { 12 | "libraryName": "vant", 13 | "libraryDirectory": "es", 14 | "style": true 15 | }]] 16 | } 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 前言 2 | 3 | 这是一款基于 Vue 的问答移动端实战项目,是本人初学 Vue 时利用业余时间写的。该项目不大不小,20 个页面左右,但功能丰富,登陆注册,提问、回答、评论、搜索,还有采纳答案,上传头像、个人中心等,期待你去体验。该项目并不完美,仍有许多缺陷。分享出来希望可以帮助一些跟本人当时一样,处于初学 Vue 的朋友们。 4 | 5 | **注:本项目不在维护,仅供学习交流使用,喜欢的可以点个 "Star" 支持一下 谢谢! 。** 6 | 7 | ### 技术栈 8 | 9 | vue + vue-router + vant + better-scroll + axios + vue-core-image-upload + es6 + less 10 | 11 | ### 服务端接口 12 | 13 | 后台项目地址:https://github.com/yaozhongnan/node-ask 14 | 15 | ### 效果演示 16 | 17 | [查看demo请戳这里](http://47.99.74.241:8080) 18 | 19 | 请用 chrome 手机模式预览,无法滑动请刷新页面。由于本人域名尚未备案,因此需要携带端口号。买的服务器不好,因此访问接口速度会较慢,请多等待片刻。 20 | 21 | ### 项目运行 22 | 23 | ```bash 24 | # install dependencies 25 | npm install 26 | 27 | # serve with hot reload at localhost 28 | npm run dev 29 | or 30 | npm start 31 | 32 | # build for production with minification 33 | npm run build 34 | 35 | # build for production and view the bundle analyzer report 36 | npm run build --report 37 | ``` 38 | 39 | ## 部分截图 40 | 41 | ![](https://raw.githubusercontent.com/yaozhongnan/Mohen_AskAppClient/master/screenshot/home.png) ![](https://raw.githubusercontent.com/yaozhongnan/Mohen_AskAppClient/master/screenshot/register.png) 42 | 43 | ![](https://raw.githubusercontent.com/yaozhongnan/Mohen_AskAppClient/master/screenshot/my.png) ![](https://raw.githubusercontent.com/yaozhongnan/Mohen_AskAppClient/master/screenshot/data.png) 44 | 45 | ![](https://raw.githubusercontent.com/yaozhongnan/Mohen_AskAppClient/master/screenshot/ask.png) ![](https://raw.githubusercontent.com/yaozhongnan/Mohen_AskAppClient/master/screenshot/search.png) 46 | 47 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/build/logo.png -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader', 51 | publicPath: '../../' 52 | }) 53 | } else { 54 | return ['vue-style-loader'].concat(loaders) 55 | } 56 | } 57 | 58 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 59 | return { 60 | css: generateLoaders(), 61 | postcss: generateLoaders(), 62 | less: generateLoaders('less'), 63 | sass: generateLoaders('sass', { indentedSyntax: true }), 64 | scss: generateLoaders('sass'), 65 | stylus: generateLoaders('stylus'), 66 | styl: generateLoaders('stylus') 67 | } 68 | } 69 | 70 | // Generate loaders for standalone style files (outside of .vue) 71 | exports.styleLoaders = function (options) { 72 | const output = [] 73 | const loaders = exports.cssLoaders(options) 74 | 75 | for (const extension in loaders) { 76 | const loader = loaders[extension] 77 | output.push({ 78 | test: new RegExp('\\.' + extension + '$'), 79 | use: loader 80 | }) 81 | } 82 | 83 | return output 84 | } 85 | 86 | exports.createNotifierCallback = () => { 87 | const notifier = require('node-notifier') 88 | 89 | return (severity, errors) => { 90 | if (severity !== 'error') return 91 | 92 | const error = errors[0] 93 | const filename = error.file && error.file.split('!').pop() 94 | 95 | notifier.notify({ 96 | title: packageConfig.name, 97 | message: severity + ': ' + error.name, 98 | subtitle: filename || '', 99 | icon: path.join(__dirname, 'logo.png') 100 | }) 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' 22 | ? config.build.assetsPublicPath 23 | : config.dev.assetsPublicPath 24 | }, 25 | resolve: { 26 | extensions: ['.js', '.vue', '.json'], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.esm.js', 29 | '@': resolve('src'), 30 | } 31 | }, 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.vue$/, 36 | loader: 'vue-loader', 37 | options: vueLoaderConfig 38 | }, 39 | { 40 | test: /\.js$/, 41 | loader: 'babel-loader', 42 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] 43 | }, 44 | { 45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 46 | loader: 'url-loader', 47 | options: { 48 | limit: 10000, 49 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 50 | } 51 | }, 52 | { 53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 54 | loader: 'url-loader', 55 | options: { 56 | limit: 10000, 57 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 58 | } 59 | }, 60 | { 61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 62 | loader: 'url-loader', 63 | options: { 64 | limit: 10000, 65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 66 | } 67 | }, 68 | { 69 | test: /\.less$/, 70 | use: ['style-loader','css-loader','less-loader'] 71 | } 72 | ] 73 | }, 74 | node: { 75 | // prevent webpack from injecting useless setImmediate polyfill because Vue 76 | // source contains it (although only uses it if it's native). 77 | setImmediate: false, 78 | // prevent webpack from injecting mocks to Node native modules 79 | // that does not make sense for the client 80 | dgram: 'empty', 81 | fs: 'empty', 82 | net: 'empty', 83 | tls: 'empty', 84 | child_process: 'empty' 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const path = require('path') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 11 | const portfinder = require('portfinder') 12 | 13 | const HOST = process.env.HOST 14 | const PORT = process.env.PORT && Number(process.env.PORT) 15 | 16 | const devWebpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 19 | }, 20 | // cheap-module-eval-source-map is faster for development 21 | devtool: config.dev.devtool, 22 | 23 | // these devServer options should be customized in /config/index.js 24 | devServer: { 25 | clientLogLevel: 'warning', 26 | historyApiFallback: { 27 | rewrites: [ 28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, 29 | ], 30 | }, 31 | hot: true, 32 | contentBase: false, // since we use CopyWebpackPlugin. 33 | compress: true, 34 | host: HOST || config.dev.host, 35 | port: PORT || config.dev.port, 36 | open: config.dev.autoOpenBrowser, 37 | overlay: config.dev.errorOverlay 38 | ? { warnings: false, errors: true } 39 | : false, 40 | publicPath: config.dev.assetsPublicPath, 41 | proxy: config.dev.proxyTable, 42 | quiet: true, // necessary for FriendlyErrorsPlugin 43 | watchOptions: { 44 | poll: config.dev.poll, 45 | } 46 | }, 47 | plugins: [ 48 | new webpack.DefinePlugin({ 49 | 'process.env': require('../config/dev.env') 50 | }), 51 | new webpack.HotModuleReplacementPlugin(), 52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 53 | new webpack.NoEmitOnErrorsPlugin(), 54 | // https://github.com/ampedandwired/html-webpack-plugin 55 | new HtmlWebpackPlugin({ 56 | filename: 'index.html', 57 | template: 'index.html', 58 | inject: true 59 | }), 60 | // copy custom static assets 61 | new CopyWebpackPlugin([ 62 | { 63 | from: path.resolve(__dirname, '../static'), 64 | to: config.dev.assetsSubDirectory, 65 | ignore: ['.*'] 66 | } 67 | ]) 68 | ] 69 | }) 70 | 71 | module.exports = new Promise((resolve, reject) => { 72 | portfinder.basePort = process.env.PORT || config.dev.port 73 | portfinder.getPort((err, port) => { 74 | if (err) { 75 | reject(err) 76 | } else { 77 | // publish the new Port, necessary for e2e tests 78 | process.env.PORT = port 79 | // add port to devServer config 80 | devWebpackConfig.devServer.port = port 81 | 82 | // Add FriendlyErrorsPlugin 83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 84 | compilationSuccessInfo: { 85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 86 | }, 87 | onErrors: config.dev.notifyOnErrors 88 | ? utils.createNotifierCallback() 89 | : undefined 90 | })) 91 | 92 | resolve(devWebpackConfig) 93 | } 94 | }) 95 | }) 96 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 13 | 14 | const env = require('../config/prod.env') 15 | 16 | const webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true, 21 | usePostCSS: true 22 | }) 23 | }, 24 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 25 | output: { 26 | path: config.build.assetsRoot, 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 29 | }, 30 | plugins: [ 31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 32 | new webpack.DefinePlugin({ 33 | 'process.env': env 34 | }), 35 | new UglifyJsPlugin({ 36 | uglifyOptions: { 37 | compress: { 38 | warnings: false 39 | } 40 | }, 41 | sourceMap: config.build.productionSourceMap, 42 | parallel: true 43 | }), 44 | // extract css into its own file 45 | new ExtractTextPlugin({ 46 | filename: utils.assetsPath('css/[name].[contenthash].css'), 47 | // Setting the following option to `false` will not extract CSS from codesplit chunks. 48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. 49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 51 | allChunks: true, 52 | }), 53 | // Compress extracted CSS. We are using this plugin so that possible 54 | // duplicated CSS from different components can be deduped. 55 | new OptimizeCSSPlugin({ 56 | cssProcessorOptions: config.build.productionSourceMap 57 | ? { safe: true, map: { inline: false } } 58 | : { safe: true } 59 | }), 60 | // generate dist index.html with correct asset hash for caching. 61 | // you can customize output by editing /index.html 62 | // see https://github.com/ampedandwired/html-webpack-plugin 63 | new HtmlWebpackPlugin({ 64 | filename: config.build.index, 65 | template: 'index.html', 66 | inject: true, 67 | minify: { 68 | removeComments: true, 69 | collapseWhitespace: true, 70 | removeAttributeQuotes: true 71 | // more options: 72 | // https://github.com/kangax/html-minifier#options-quick-reference 73 | }, 74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 75 | chunksSortMode: 'dependency' 76 | }), 77 | // keep module.id stable when vendor modules does not change 78 | new webpack.HashedModuleIdsPlugin(), 79 | // enable scope hoisting 80 | new webpack.optimize.ModuleConcatenationPlugin(), 81 | // split vendor js into its own file 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'vendor', 84 | minChunks (module) { 85 | // any required modules inside node_modules are extracted to vendor 86 | return ( 87 | module.resource && 88 | /\.js$/.test(module.resource) && 89 | module.resource.indexOf( 90 | path.join(__dirname, '../node_modules') 91 | ) === 0 92 | ) 93 | } 94 | }), 95 | // extract webpack runtime and module manifest to its own file in order to 96 | // prevent vendor hash from being updated whenever app bundle is updated 97 | new webpack.optimize.CommonsChunkPlugin({ 98 | name: 'manifest', 99 | minChunks: Infinity 100 | }), 101 | // This instance extracts shared chunks from code splitted chunks and bundles them 102 | // in a separate chunk, similar to the vendor chunk 103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 104 | new webpack.optimize.CommonsChunkPlugin({ 105 | name: 'app', 106 | async: 'vendor-async', 107 | children: true, 108 | minChunks: 3 109 | }), 110 | 111 | // copy custom static assets 112 | new CopyWebpackPlugin([ 113 | { 114 | from: path.resolve(__dirname, '../static'), 115 | to: config.build.assetsSubDirectory, 116 | ignore: ['.*'] 117 | } 118 | ]) 119 | ] 120 | }) 121 | 122 | if (config.build.productionGzip) { 123 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 124 | 125 | webpackConfig.plugins.push( 126 | new CompressionWebpackPlugin({ 127 | asset: '[path].gz[query]', 128 | algorithm: 'gzip', 129 | test: new RegExp( 130 | '\\.(' + 131 | config.build.productionGzipExtensions.join('|') + 132 | ')$' 133 | ), 134 | threshold: 10240, 135 | minRatio: 0.8 136 | }) 137 | ) 138 | } 139 | 140 | if (config.build.bundleAnalyzerReport) { 141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 143 | } 144 | 145 | module.exports = webpackConfig 146 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: {}, 14 | 15 | // Various Dev Server settings 16 | host: 'localhost', // can be overwritten by process.env.HOST 17 | port: 3002, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 18 | autoOpenBrowser: false, 19 | errorOverlay: true, 20 | notifyOnErrors: true, 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 22 | 23 | 24 | /** 25 | * Source Maps 26 | */ 27 | 28 | // https://webpack.js.org/configuration/devtool/#development 29 | devtool: 'cheap-module-eval-source-map', 30 | 31 | // If you have problems debugging vue-files in devtools, 32 | // set this to false - it *may* help 33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 34 | cacheBusting: true, 35 | 36 | cssSourceMap: true 37 | }, 38 | 39 | build: { 40 | // Template for index.html 41 | index: path.resolve(__dirname, '../dist/index.html'), 42 | 43 | // Paths 44 | assetsRoot: path.resolve(__dirname, '../dist'), 45 | assetsSubDirectory: 'static', 46 | assetsPublicPath: './', 47 | 48 | /** 49 | * Source Maps 50 | */ 51 | 52 | productionSourceMap: true, 53 | // https://webpack.js.org/configuration/devtool/#production 54 | devtool: '#source-map', 55 | 56 | // Gzip off by default as many popular static hosts such as 57 | // Surge or Netlify already gzip all static assets for you. 58 | // Before setting to `true`, make sure to: 59 | // npm install --save-dev compression-webpack-plugin 60 | productionGzip: false, 61 | productionGzipExtensions: ['js', 'css'], 62 | 63 | // Run the build command with an extra argument to 64 | // View the bundle analyzer report after build finishes: 65 | // `npm run build --report` 66 | // Set to `true` or `false` to always turn it on or off 67 | bundleAnalyzerReport: process.env.npm_config_report 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/favicon.ico -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 一款基于 Vue 的问答移动端实战项目 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-ask", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "Zahirah <425923407@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "axios": "^0.18.0", 14 | "better-scroll": "^1.13.2", 15 | "vant": "^1.3.4", 16 | "vue": "^2.5.2", 17 | "vue-core-image-upload": "^2.4.11", 18 | "vue-router": "^3.0.1" 19 | }, 20 | "devDependencies": { 21 | "autoprefixer": "^7.1.2", 22 | "babel-core": "^6.22.1", 23 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 24 | "babel-loader": "^7.1.1", 25 | "babel-plugin-import": "^1.9.1", 26 | "babel-plugin-syntax-jsx": "^6.18.0", 27 | "babel-plugin-transform-runtime": "^6.22.0", 28 | "babel-plugin-transform-vue-jsx": "^3.5.0", 29 | "babel-preset-env": "^1.3.2", 30 | "babel-preset-stage-2": "^6.22.0", 31 | "chalk": "^2.0.1", 32 | "copy-webpack-plugin": "^4.0.1", 33 | "css-loader": "^0.28.0", 34 | "extract-text-webpack-plugin": "^3.0.0", 35 | "file-loader": "^1.1.4", 36 | "friendly-errors-webpack-plugin": "^1.6.1", 37 | "html-webpack-plugin": "^2.30.1", 38 | "less": "^2.7.3", 39 | "less-loader": "^4.1.0", 40 | "node-notifier": "^5.1.2", 41 | "optimize-css-assets-webpack-plugin": "^3.2.0", 42 | "ora": "^1.2.0", 43 | "portfinder": "^1.0.13", 44 | "postcss-import": "^11.0.0", 45 | "postcss-loader": "^2.0.8", 46 | "postcss-url": "^7.2.1", 47 | "rimraf": "^2.6.0", 48 | "semver": "^5.3.0", 49 | "shelljs": "^0.7.6", 50 | "style-loader": "^0.23.0", 51 | "uglifyjs-webpack-plugin": "^1.1.1", 52 | "url-loader": "^0.5.8", 53 | "vue-loader": "^13.3.0", 54 | "vue-style-loader": "^3.0.1", 55 | "vue-template-compiler": "^2.5.2", 56 | "webpack": "^3.6.0", 57 | "webpack-bundle-analyzer": "^2.9.0", 58 | "webpack-dev-server": "^2.9.1", 59 | "webpack-merge": "^4.1.0" 60 | }, 61 | "engines": { 62 | "node": ">= 6.0.0", 63 | "npm": ">= 3.0.0" 64 | }, 65 | "browserslist": [ 66 | "> 1%", 67 | "last 2 versions", 68 | "not ie <= 8" 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /screenshot/ask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/screenshot/ask.png -------------------------------------------------------------------------------- /screenshot/data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/screenshot/data.png -------------------------------------------------------------------------------- /screenshot/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/screenshot/home.png -------------------------------------------------------------------------------- /screenshot/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/screenshot/my.png -------------------------------------------------------------------------------- /screenshot/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/screenshot/register.png -------------------------------------------------------------------------------- /screenshot/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/screenshot/search.png -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 34 | -------------------------------------------------------------------------------- /src/api/ajax.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import qs from 'qs' 3 | import { getLocalStorage } from '@/assets/js/common' 4 | 5 | const axios_instance = axios.create({ 6 | // transformRequest: [function (data) { 7 | // return qs.stringify(data) 8 | // }], 9 | headers: { 10 | 'Content-Type': 'application/x-www-form-urlencoded' 11 | } 12 | }) 13 | 14 | // 在所以请求发送之前,检测是否存在 token,如果存在则放到请求头中 15 | axios_instance.interceptors.request.use(config => { 16 | let token = getLocalStorage('token', 'string') 17 | if (token) { 18 | config.headers.Authorization = token; 19 | } 20 | return config 21 | }) 22 | 23 | export default function ajax(url, data = {}, type = 'get') { 24 | 25 | return new Promise( (resolve, reject) => { 26 | let promise = null 27 | type = type.toUpperCase() 28 | // 请求类型为 get 29 | if (type === 'GET') { 30 | let dataStr = '' 31 | Object.keys(data).forEach((item) => { 32 | dataStr += `${item}=${data[item]}&` 33 | }) 34 | if (dataStr) { 35 | dataStr = dataStr.substring(0, dataStr.lastIndexOf('&')) 36 | url += `?${dataStr}` 37 | } 38 | promise = axios_instance.get(url) 39 | } 40 | 41 | // 请求类型为 post 42 | if (type === 'POST') { 43 | data = qs.stringify(data) 44 | promise = axios_instance.post(url, data) 45 | } 46 | 47 | promise.then((res) => { 48 | resolve(res.data) 49 | }).catch((err) => { 50 | reject(err) 51 | }) 52 | 53 | }) 54 | } 55 | -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | import ajax from './ajax' 2 | 3 | const BASE_URL = 'http://47.99.74.241:5000' 4 | // const BASE_URL = 'http://localhost:5000' 5 | 6 | // get - 首页 - 接口 7 | export const GET_HOMEDATA = () => ajax(BASE_URL + '/home') 8 | 9 | // post - 注册接口 10 | export const POST_REGISTER = (nickname, phone, password) => ajax(BASE_URL + '/user/register', { 11 | nickname, 12 | phone, 13 | password 14 | }, 'post') 15 | 16 | // post - 登录接口 17 | export const POST_LOGIN = (phone, password) => ajax(BASE_URL + '/user/login', { 18 | phone, 19 | password 20 | }, 'post') 21 | 22 | // get - 退出登录接口 23 | export const GET_EXIT = (token) => ajax(BASE_URL + '/user/exit', { 24 | token 25 | }) 26 | 27 | // post - 修改密码接口 28 | export const POST_MODIFY_PASSWORD = (phone, password) => ajax(BASE_URL + '/user/modifypassword', { 29 | phone, 30 | password 31 | }, 'post') 32 | 33 | // 我的 相关接口 start ------------------------------------------------------------------------------------------- 34 | 35 | // 我的 - get - 首页 36 | export const GET_MY_INDEX = (token) => ajax(BASE_URL + '/my/index', { 37 | token 38 | }) 39 | 40 | // 我的 - get - 个人资料 41 | export const GET_MY_INFORMATION = (token) => ajax(BASE_URL + '/my/information', { 42 | token 43 | }) 44 | 45 | // 我的 - post - 个人资料 46 | export const POST_MY_INFORMATION = (user_id, avatar, nickname, gender, birthday, bio) => ajax(BASE_URL + '/my/information', { 47 | user_id, 48 | avatar, 49 | nickname, 50 | gender, 51 | birthday, 52 | bio 53 | }, 'post') 54 | 55 | // 我的 - get - 我的问题 56 | export const GET_MY_QUESTION = (page) => ajax(BASE_URL + '/my/question', { 57 | page 58 | }) 59 | 60 | // 我的 - post - 申请精华 61 | export const POST_MY_APPLYBEST = (question_id) => ajax(BASE_URL + '/my/applybest', { 62 | question_id 63 | }, 'post') 64 | 65 | // 我的 - post - 申请置顶 66 | export const POST_MY_APPLYTOP = (question_id) => ajax(BASE_URL + '/my/applytop', { 67 | question_id 68 | }, 'post') 69 | 70 | // 我的 - get - 我的问题 71 | export const GET_MY_ANSWER = (page) => ajax(BASE_URL + '/my/answer', { 72 | page 73 | }) 74 | 75 | // 我的 相关接口 end ------------------------------------------------------------------------------------------- 76 | 77 | 78 | // 问答 相关接口 start ------------------------------------------------------------------------------------------- 79 | 80 | // 问答 - get - 获取问答分类接口 81 | export const GET_ASK_CATEGORY = () => ajax(BASE_URL + '/ask/category') 82 | 83 | // 问答 - post - 发表问题接口 84 | export const POST_ASK_PUBLISH = (cate_id, title, description) => ajax(BASE_URL + '/ask/publish', { 85 | cate_id, 86 | title, 87 | description 88 | }, 'post') 89 | 90 | // 问答首页根据不同的状态获取问题 - get 91 | export const GET_ASK_QUESTION = (page, state) => ajax(BASE_URL + '/ask/question', { 92 | page, 93 | state 94 | }) 95 | 96 | // get - 查看问题详情接口 97 | export const GET_ASK_DETAIL = (question_id) => ajax(BASE_URL + '/ask/detail', { 98 | question_id 99 | }) 100 | 101 | // post - 回答问题接口 102 | export const POST_ASK_ANSWER = (question_id, content) => ajax(BASE_URL + '/ask/answer', { 103 | question_id, 104 | content 105 | }, 'post') 106 | 107 | // post - 修改问题接口 108 | export const POST_ASK_MODIFYQUES = (question_id, title, description) => ajax(BASE_URL + '/ask/modify_ques', { 109 | question_id, 110 | title, 111 | description 112 | }, 'post') 113 | 114 | // post - 修改回答接口 115 | export const POST_ASK_MODIFYANSWER = (answer_id, content) => ajax(BASE_URL + '/ask/modify_answer', { 116 | answer_id, content 117 | }, 'post') 118 | 119 | // get - 采纳回答接口 120 | export const GET_ASK_ADOPT = (answer_id, question_id) => ajax(BASE_URL + '/ask/adopt', { 121 | answer_id, 122 | question_id 123 | }) 124 | 125 | // post - 回复接口 126 | export const POST_ASK_REPLY = (answer_id, reply_content) => ajax(BASE_URL + '/ask/reply', { 127 | answer_id, 128 | reply_content 129 | }, 'post') 130 | 131 | // post - 查看数量 +1 接口 132 | export const POST_ASK_WATCHNUM = (question_id) => ajax(BASE_URL + '/ask/watchnum', { 133 | question_id 134 | }, 'post') 135 | 136 | // get - 获取问题分类下的问题 接口 137 | export const GET_ASK_QEUSBYCATE = (cate_id, state, page) => ajax(BASE_URL + '/ask/quesbycate', { 138 | cate_id, 139 | state, 140 | page 141 | }) 142 | 143 | // 问答 相关接口 end ------------------------------------------------------------------------------------------- 144 | 145 | // 公告 相关接口 start ------------------------------------------------------------------------------------------- 146 | 147 | // get - 获取公告列表 接口 148 | export const GET_ANNO_LIST = () => ajax(BASE_URL + '/anno/list') 149 | 150 | // get - 获取公告详情 接口 151 | export const GET_ANNO_DETAIL = (anno_id) => ajax(BASE_URL + '/anno/detail', { 152 | anno_id 153 | }) 154 | 155 | // post - 增加公告阅读数量 接口 156 | export const POST_ANNO_ADDWATCHNUM = (anno_id) => ajax(BASE_URL + '/anno/addwatchnum', { 157 | anno_id 158 | }, 'post') 159 | 160 | // 公告 相关接口 end ------------------------------------------------------------------------------------------- 161 | 162 | 163 | // 搜索接口 164 | export const GET_SEARCH = (title) => ajax(BASE_URL + '/home/search', { 165 | title 166 | }) -------------------------------------------------------------------------------- /src/assets/css/base.css: -------------------------------------------------------------------------------- 1 | @media screen and (min-width: 320px) { 2 | html { 3 | font-size: 14px; 4 | } 5 | } 6 | @media screen and (min-width: 414px) { 7 | html { 8 | font-size: 16px; 9 | } 10 | } 11 | @media screen and (min-width: 768px) { 12 | html { 13 | font-size: 20px; 14 | } 15 | } 16 | @media screen and (min-width: 1024px) { 17 | html { 18 | font-size: 26px; 19 | } 20 | } 21 | .root-wrap{ 22 | position: relative; 23 | width: 100%; 24 | height: 100%; 25 | overflow: hidden; 26 | } 27 | .content{ 28 | position: absolute; 29 | top: 40px; 30 | left: 0; 31 | right: 0; 32 | bottom: 0; 33 | overflow: hidden; 34 | } 35 | .main{ 36 | width: 100%; 37 | height: 100%; 38 | padding-bottom: 50px; 39 | overflow: hidden; 40 | } 41 | .border{ 42 | width: 100%; 43 | height:1px; 44 | background: rgba(255,255,255,.2); 45 | } 46 | .submit-btn{ 47 | display: block; 48 | width: 80%; 49 | height: 36px; 50 | line-height: 36px; 51 | text-align: center; 52 | margin: 30px auto 0; 53 | background-color: #2a2e38; 54 | } 55 | /* 左右边距 */ 56 | .pd{ 57 | padding-left: 1rem; 58 | padding-right: 1rem; 59 | } 60 | .bg{ 61 | background: #20232A; 62 | } 63 | .mgb{ 64 | margin-bottom: 1rem; 65 | } 66 | .head{ 67 | height: 2.8rem; 68 | line-height: 2.8rem; 69 | background: #20232A; 70 | padding-left: 1rem; 71 | } 72 | .define-loading{ 73 | position: fixed; 74 | top: 50%; 75 | left: 50%; 76 | margin-left: -15px; 77 | margin-top: -15px; 78 | } 79 | .van-dialog__message, .van-dialog__header{ 80 | color: #666; 81 | } 82 | /* 当像素比为 2 时,高度缩小一倍 */ 83 | @media only screen and (-webkit-device-pixel-ratio:2 ) { 84 | .border{ 85 | transform: scaleY(.5); 86 | } 87 | } 88 | /* 当像素比为 3 时,高度缩小至三分之一 */ 89 | @media only screen and (-webkit-device-pixel-ratio:3 ) { 90 | .border{ 91 | transform: scaleY(.333333333333333333); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/assets/css/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('//at.alicdn.com/t/font_784998_y16ocgrgga.eot?t=1539833818870'); /* IE9*/ 4 | src: url('//at.alicdn.com/t/font_784998_y16ocgrgga.eot?t=1539833818870#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAB1cAAsAAAAALcgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ikqDY21hcAAAAYAAAAG0AAAEtNcpQflnbHlmAAADNAAAFqQAACG0mNSHnGhlYWQAABnYAAAAMQAAADYS+oWdaGhlYQAAGgwAAAAgAAAAJAfeA7hobXR4AAAaLAAAABsAAACwsBH//mxvY2EAABpIAAAAWgAAAFqv+qgMbWF4cAAAGqQAAAAfAAAAIAE/AMNuYW1lAAAaxAAAAUUAAAJtPlT+fXBvc3QAABwMAAABTQAAAg2CBCEteJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbyYyNzwv4EhhrmBYQpQmBEkBwDoxAyKeJzV1D1PU2EYxvF/S61aShXFqvUd38UQJCQMDDSmYcGh2EbcGEgYSdjYYWFkdXLli13lW+D19GoMsjJ57vyanpOcuz3PfT0HuAFM2WerQfU3FX+j8stXK+PrUzTG12uVfZ9/pet7qqqoprpamlVbHc1rUcta0arW1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wj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicbVDXcsIwEPSCcYMEUkjvvcCDYTL5g/xGRtjCFhiJBGsw/vqcsUNeooebvb22WqNmlM8z/n891FCHiQYs2HDgwkMTLWxhG210sINd7GEfXRzgEEc4xglOcYZzXOASV7jGDW5xh3s84BFPeMYLXtFD37ATxUIho1aczljyJgIlB+/NJZcTzWTImLTzWBQN9iLmBAetoiVVOhNMRt5K6QkByjtBzKaEBM9FrMVYe7lWVa29bqZQ5c6MFs4JN3KRaWmVow26mgo3iLmMIiUjq7xYX2hlR6RmJHxvQoMZ4f6HSbRvlbw9JzrRshlOl58hE1NizaUKuVMVfLdQ3U/5IvU2yLdIkcpEY81Y6+ibCRsxK2AiZNL9lelv0MBce1Iq89tfmvYImhtzHo5YxQ+dyjOfvqD0iv/dHGw2DbsR/+Yyj1XhzMZRw/gBqmWWYAAAAA==') format('woff'), 6 | url('//at.alicdn.com/t/font_784998_y16ocgrgga.ttf?t=1539833818870') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('//at.alicdn.com/t/font_784998_y16ocgrgga.svg?t=1539833818870#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-loading:before { content: "\e600"; } 19 | 20 | .icon-htmal5icon27:before { content: "\e640"; } 21 | 22 | .icon-wenjuandaan:before { content: "\e66e"; } 23 | 24 | .icon-zhiding:before { content: "\e637"; } 25 | 26 | .icon-shezhi2:before { content: "\e650"; } 27 | 28 | .icon-icontouxiang:before { content: "\e622"; } 29 | 30 | .icon-youjiantou:before { content: "\e630"; } 31 | 32 | .icon-chakantiezihuifu:before { content: "\e663"; } 33 | 34 | .icon-zuojiantou:before { content: "\e64b"; } 35 | 36 | .icon-xiangxiajiantou:before { content: "\e651"; } 37 | 38 | .icon-mingpian:before { content: "\e6a9"; } 39 | 40 | .icon-zixun:before { content: "\e60a"; } 41 | 42 | .icon-chakan:before { content: "\e61a"; } 43 | 44 | .icon-wenti:before { content: "\e689"; } 45 | 46 | .icon-chenggong:before { content: "\e666"; } 47 | 48 | .icon-shezhi:before { content: "\e604"; } 49 | 50 | .icon-suo:before { content: "\e646"; } 51 | 52 | .icon-guanbi1:before { content: "\e611"; } 53 | 54 | .icon-jingxuan-F:before { content: "\e616"; } 55 | 56 | .icon-suo1:before { content: "\e644"; } 57 | 58 | .icon-guanbi:before { content: "\e63f"; } 59 | 60 | .icon-pinglun:before { content: "\e891"; } 61 | 62 | .icon-dkw_daikuan:before { content: "\e601"; } 63 | 64 | .icon-wode:before { content: "\e60e"; } 65 | 66 | .icon-pinglun1:before { content: "\e678"; } 67 | 68 | .icon-icon-test:before { content: "\e683"; } 69 | 70 | .icon-icon-test1:before { content: "\e684"; } 71 | 72 | .icon-xiaoxi:before { content: "\e63b"; } 73 | 74 | .icon-icon-:before { content: "\e60d"; } 75 | 76 | .icon-icon-1:before { content: "\e60b"; } 77 | 78 | .icon-laba:before { content: "\e60c"; } 79 | 80 | .icon-caidan:before { content: "\e653"; } 81 | 82 | .icon-mingpian1:before { content: "\e654"; } 83 | 84 | .icon-mingpian2:before { content: "\e606"; } 85 | 86 | .icon-daan:before { content: "\e631"; } 87 | 88 | .icon-shezhi1:before { content: "\e634"; } 89 | 90 | .icon-question-feedba:before { content: "\e62e"; } 91 | 92 | .icon-shezhi3:before { content: "\e657"; } 93 | 94 | .icon-zhiding1:before { content: "\e704"; } 95 | 96 | .icon-shouye:before { content: "\e65f"; } 97 | 98 | .icon-icon-test2:before { content: "\e632"; } 99 | 100 | .icon-mingpian3:before { content: "\e753"; } 101 | 102 | .icon-gerenzhongxintouxiang:before { content: "\e671"; } 103 | -------------------------------------------------------------------------------- /src/assets/css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font: inherit; 23 | font-size: 100%; 24 | vertical-align: baseline; 25 | box-sizing: border-box; 26 | } 27 | /* HTML5 display-role reset for older browsers */ 28 | article, aside, details, figcaption, figure, 29 | footer, header, hgroup, menu, nav, section { 30 | display: block; 31 | } 32 | body { 33 | line-height: 1; 34 | } 35 | html,body{ 36 | width: 100%; 37 | height: 100%; 38 | overflow: hidden; 39 | /* background: #20232A; */ 40 | background: #20232A; 41 | color: rgba(255,255,255,.8); 42 | font-size: 14px; 43 | } 44 | ol, ul { 45 | list-style: none; 46 | } 47 | blockquote, q { 48 | quotes: none; 49 | } 50 | a{ 51 | text-decoration: none; 52 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 53 | color: rgba(255,255,255,.8); 54 | } 55 | blockquote:before, blockquote:after, 56 | q:before, q:after { 57 | content: ''; 58 | content: none; 59 | } 60 | table { 61 | border-collapse: collapse; 62 | border-spacing: 0; 63 | } -------------------------------------------------------------------------------- /src/assets/img/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/src/assets/img/default.jpg -------------------------------------------------------------------------------- /src/assets/img/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/src/assets/img/default.png -------------------------------------------------------------------------------- /src/assets/img/nodata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/src/assets/img/nodata.png -------------------------------------------------------------------------------- /src/assets/js/common.js: -------------------------------------------------------------------------------- 1 | import { 2 | Toast, 3 | Dialog 4 | } from 'vant' 5 | 6 | // 对后台响应的数据做出处理 7 | export const handleResponse = function (res, callback) { 8 | 9 | if (res.code === 0) { 10 | callback() 11 | } 12 | if (res.code === -1) { 13 | Toast(res.msg) 14 | } 15 | if (res.code === -999) { 16 | // 清除 token 17 | setLocalStorage('token', '', 'string') 18 | 19 | Dialog.confirm({ 20 | title: '温馨提示', 21 | message: '您的登录已过期', 22 | confirmButtonText: '去登陆' 23 | }).then(() => { 24 | // 跳转登录页面 25 | window.location.href = `${window.location.origin}/#/login` 26 | }).catch(() => { 27 | // 跳转首页 28 | window.location.href = `${window.location.origin}/#/` 29 | }); 30 | } 31 | } 32 | 33 | // 计算输入的字符长度 34 | export const calRealLength = function (str) { 35 | 36 | if (!str) return 37 | 38 | let reallength = 0 39 | for (let i = 0; i < str.length; i++) { 40 | let charCode = str.charCodeAt(i) 41 | if (charCode >= 0 && charCode <= 128) { 42 | reallength += 1 43 | } else { 44 | reallength += 2 45 | } 46 | } 47 | return reallength 48 | 49 | } 50 | 51 | // 向 localstorage 中存入数据 仅支持存字符串与对象格式 52 | export const setLocalStorage = function (key, val, type) { 53 | if (!type) return 54 | if (type === 'string') { 55 | localStorage.setItem(key, val) 56 | } 57 | if (type === 'object') { 58 | localStorage.setItem(key, JSON.stringify(val)) 59 | } 60 | 61 | } 62 | 63 | // 向 localstorage 中取数据 64 | export const getLocalStorage = function (key, type) { 65 | if (!type) return 66 | if (type === 'string') { 67 | return localStorage.getItem(key) 68 | } 69 | if (type === 'object') { 70 | return JSON.parse(localStorage.getItem(key)) 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /src/assets/js/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | limit: 12, // 一页的条数 3 | } -------------------------------------------------------------------------------- /src/assets/js/data.js: -------------------------------------------------------------------------------- 1 | // 我的 页面相关数据 2 | export const myCellData = [ 3 | { 4 | title: "个人名片", 5 | content: "修改", 6 | to: '/my/card', 7 | icon: { 8 | class: "icon-mingpian2", 9 | color: "#4AC49D" 10 | } 11 | }, 12 | { 13 | title: "登录密码", 14 | content: "修改", 15 | to: '/forget', 16 | icon: { 17 | class: "icon-suo1", 18 | color: "#E2B96F" 19 | } 20 | }, 21 | { 22 | title: "我的问题", 23 | to: '/my/ques', 24 | icon: { 25 | class: "icon-wenti", 26 | color: "#4AC49D" 27 | } 28 | }, 29 | { 30 | title: "我的回答", 31 | to: '/my/answer', 32 | icon: { 33 | class: "icon-wenjuandaan", 34 | color: "#E2B96F" 35 | } 36 | }, 37 | { 38 | title: "我的评论", 39 | to: '/my/reply', 40 | icon: { 41 | class: "icon-pinglun", 42 | color: "#186EFE" 43 | } 44 | } 45 | ] 46 | 47 | // 问答首页 - 横向导航数据 48 | export const askNavData = [ 49 | { 50 | name: '全部', 51 | }, 52 | { 53 | name: '精华问题', 54 | extra_state: 1 55 | }, 56 | { 57 | name: '置顶问题', 58 | extra_state: 2 59 | }, 60 | { 61 | name: '已解决问题', 62 | state: 1 63 | }, 64 | { 65 | name: '待解决问题', 66 | state: 0 67 | }, 68 | ] 69 | -------------------------------------------------------------------------------- /src/assets/js/filters.js: -------------------------------------------------------------------------------- 1 | export const dateFilter = function (time, format = 'YY-MM-DD hh:mm:ss') { 2 | let date = new Date(time); 3 | 4 | let year = date.getFullYear(), 5 | month = date.getMonth() + 1, //月份是从0开始的 6 | day = date.getDate(), 7 | hour = date.getHours(), 8 | min = date.getMinutes(), 9 | sec = date.getSeconds(); 10 | let preArr = Array.apply(null, Array(10)).map(function (elem, index) { 11 | return '0' + index; 12 | }); ////开个长度为10的数组 格式为 00 01 02 03 13 | 14 | let newTime = format.replace(/YY/g, year) 15 | .replace(/MM/g, preArr[month] || month) 16 | .replace(/DD/g, preArr[day] || day) 17 | .replace(/hh/g, preArr[hour] || hour) 18 | .replace(/mm/g, preArr[min] || min) 19 | .replace(/ss/g, preArr[sec] || sec); 20 | 21 | return newTime; 22 | } 23 | -------------------------------------------------------------------------------- /src/base/ask-menu/ask-menu.vue: -------------------------------------------------------------------------------- 1 | 17 | 51 | 80 | 81 | -------------------------------------------------------------------------------- /src/base/cell/cell.vue: -------------------------------------------------------------------------------- 1 | 13 | 50 | 51 | 81 | -------------------------------------------------------------------------------- /src/base/footer/footer.vue: -------------------------------------------------------------------------------- 1 | 9 | 40 | 41 | 68 | -------------------------------------------------------------------------------- /src/base/header/header.vue: -------------------------------------------------------------------------------- 1 | 13 | 36 | 37 | 70 | 71 | -------------------------------------------------------------------------------- /src/base/loadMore/loadMore.vue: -------------------------------------------------------------------------------- 1 | 16 | 75 | 80 | 81 | -------------------------------------------------------------------------------- /src/base/loginStyle/loginStyle.vue: -------------------------------------------------------------------------------- 1 | 27 | 107 | 199 | -------------------------------------------------------------------------------- /src/base/scroll/scroll.vue: -------------------------------------------------------------------------------- 1 | 8 | 78 | 84 | 85 | -------------------------------------------------------------------------------- /src/base/slide/slide.vue: -------------------------------------------------------------------------------- 1 | 9 | 23 | 24 | -------------------------------------------------------------------------------- /src/base/tabHeader/tabHeader.vue: -------------------------------------------------------------------------------- 1 | 11 | 21 | 22 | 34 | -------------------------------------------------------------------------------- /src/components/anno-detail/anno-detail.vue: -------------------------------------------------------------------------------- 1 | 18 | 53 | 76 | 77 | -------------------------------------------------------------------------------- /src/components/anno/anno.vue: -------------------------------------------------------------------------------- 1 | 21 | 53 | 93 | -------------------------------------------------------------------------------- /src/components/ask/ask.vue: -------------------------------------------------------------------------------- 1 | 69 | 227 | 344 | 349 | -------------------------------------------------------------------------------- /src/components/card/card.vue: -------------------------------------------------------------------------------- 1 | 91 | 211 | 254 | 268 | 269 | 270 | 271 | -------------------------------------------------------------------------------- /src/components/category/category.vue: -------------------------------------------------------------------------------- 1 | 57 | 169 | 278 | 279 | -------------------------------------------------------------------------------- /src/components/details/details.vue: -------------------------------------------------------------------------------- 1 | 104 | 333 | 448 | 481 | 482 | 483 | -------------------------------------------------------------------------------- /src/components/forget/forget.vue: -------------------------------------------------------------------------------- 1 | 27 | 74 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/components/home/home.vue: -------------------------------------------------------------------------------- 1 | 57 | 104 | 201 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /src/components/login/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/src/components/login/bg.jpg -------------------------------------------------------------------------------- /src/components/login/login.vue: -------------------------------------------------------------------------------- 1 | 12 | 45 | 53 | 54 | -------------------------------------------------------------------------------- /src/components/my-answer/my-answer.vue: -------------------------------------------------------------------------------- 1 | 50 | 110 | 204 | -------------------------------------------------------------------------------- /src/components/my-ques/my-ques.vue: -------------------------------------------------------------------------------- 1 | 41 | 121 | 190 | -------------------------------------------------------------------------------- /src/components/my-reply/my-reply.vue: -------------------------------------------------------------------------------- 1 | 7 | 20 | 32 | -------------------------------------------------------------------------------- /src/components/my/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/src/components/my/bg.png -------------------------------------------------------------------------------- /src/components/my/my.vue: -------------------------------------------------------------------------------- 1 | 32 | 104 | 174 | -------------------------------------------------------------------------------- /src/components/publish/publish.vue: -------------------------------------------------------------------------------- 1 | 45 | 105 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /src/components/register/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/src/components/register/bg.jpg -------------------------------------------------------------------------------- /src/components/register/register.vue: -------------------------------------------------------------------------------- 1 | 13 | 45 | 52 | 53 | -------------------------------------------------------------------------------- /src/components/search/search.vue: -------------------------------------------------------------------------------- 1 | 58 | 113 | 240 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import '@/assets/css/reset.css' 7 | import '@/assets/css/base.css' 8 | import '@/assets/css/iconfont.css' 9 | import { Pagination, Dialog, Collapse, CollapseItem, DatetimePicker, Actionsheet, Picker, Field, Loading, PullRefresh, List, Swipe, SwipeItem, Tab, Tabs, Popup, Cell, CellGroup } from 'vant'; 10 | import { dateFilter } from '@/assets/js/filters' 11 | 12 | Vue.use(Dialog).use(Pagination).use(Collapse).use(CollapseItem).use(DatetimePicker).use(Actionsheet).use(Picker).use(Field).use(Loading).use(PullRefresh).use(Swipe).use(SwipeItem).use(Tab).use(Tabs).use(Popup).use(Cell).use(CellGroup).use(List); 13 | 14 | Vue.config.productionTip = false 15 | 16 | Vue.filter('dataFilter', dateFilter) 17 | 18 | /* eslint-disable no-new */ 19 | new Vue({ 20 | el: '#app', 21 | router, 22 | components: { App }, 23 | template: '' 24 | }) 25 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import { getLocalStorage } from '@/assets/js/common' 4 | 5 | Vue.use(Router) 6 | 7 | const checkToken = function (to, from, next) { 8 | let token = getLocalStorage('token', 'string') 9 | if (!token) { 10 | next({ 11 | path: '/login' 12 | }) 13 | } else { 14 | next() 15 | } 16 | } 17 | 18 | const home = () => import('@/components/home/home') 19 | const ask = () => import('@/components/ask/ask') 20 | const search = () => import('@/components/search/search') 21 | const my = () => import('@/components/my/my') 22 | const register = () => import('@/components/register/register') 23 | const login = () => import('@/components/login/login') 24 | const forget = () => import('@/components/forget/forget') 25 | const card = () => import('@/components/card/card') 26 | const publish = () => import('@/components/publish/publish') 27 | const details = () => import('@/components/details/details') 28 | const my_ques = () => import('@/components/my-ques/my-ques') 29 | const my_answer = () => import('@/components/my-answer/my-answer') 30 | const my_reply = () => import('@/components/my-reply/my-reply') 31 | const category = () => import('@/components/category/category') 32 | const anno = () => import('@/components/anno/anno') 33 | const anno_detail = () => import('@/components/anno-detail/anno-detail') 34 | 35 | const router = new Router({ 36 | routes: [ 37 | { path: '/', redirect: '/home' }, 38 | { path: '/register', component: register }, 39 | { path: '/login', component: login }, 40 | { path: '/forget', component: forget }, 41 | { path: '/home', component: home }, 42 | { path: '/anno', component: anno }, 43 | { path: '/anno/detail/:id', component: anno_detail }, 44 | { path: '/ask', component: ask }, 45 | { path: '/ask/category/:id', component: category }, 46 | { path: '/ask/publish', component: publish }, 47 | { path: '/ask/details', component: details }, 48 | { path: '/search', component: search }, 49 | { path: '/my', component: my }, 50 | { path: '/my/card', component: card, beforeEnter: (to, from, next) => { 51 | checkToken(to, from, next) 52 | }}, 53 | { path: '/my/ques', component: my_ques, beforeEnter: (to, from, next) => { 54 | checkToken(to, from, next) 55 | }}, 56 | { path: '/my/answer', component: my_answer, beforeEnter: (to, from, next) => { 57 | checkToken(to, from, next) 58 | }}, 59 | { path: '/my/reply', component: my_reply} 60 | ] 61 | }) 62 | 63 | 64 | 65 | export default router 66 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaozhongnan/vue-ask/2790d7c69964b917e2631a9357d65b2d355e6805/static/.gitkeep --------------------------------------------------------------------------------