├── static └── .gitkeep ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── src ├── store │ ├── actions.js │ ├── mutationsType.js │ ├── index.js │ └── mutations.js ├── utils │ ├── ajax.js │ └── util.js ├── assets │ ├── font_smaller.svg │ ├── font_bigger.svg │ ├── down.svg │ ├── line_spacing_normal.svg │ ├── line_spacing_small.svg │ ├── up.svg │ ├── moon.svg │ ├── line_spacing_big.svg │ ├── list.svg │ ├── rank_other.svg │ ├── search.svg │ ├── trash.svg │ ├── book.svg │ ├── rank.svg │ ├── sun.svg │ ├── category.svg │ └── setting.svg ├── App.vue ├── main.js ├── components │ ├── book │ │ ├── ChangeSource.vue │ │ └── ReadBook.vue │ ├── ranklist │ │ ├── RankItem.vue │ │ ├── Ranklist.vue │ │ ├── RanklistDetail.vue │ │ └── Rank.vue │ ├── category │ │ ├── Bookcategory.vue │ │ └── BookcatDetail.vue │ ├── common │ │ ├── Booklist.vue │ │ └── Book.vue │ ├── Home.vue │ ├── bookshelf │ │ └── Bookshelf.vue │ └── search │ │ └── Search.vue ├── router │ └── index.js └── api │ └── api.js ├── config ├── prod.env.js ├── test.env.js ├── dev.env.js └── index.js ├── screenshot ├── book.png ├── rank.png ├── catory.png ├── chapter.png ├── errBook.png ├── nReader.png ├── search.png ├── bookshelf.png ├── catDetail.png ├── nightMode.png ├── rankType.png └── readbook.png ├── .eslintrc.json ├── test ├── unit │ ├── .eslintrc │ ├── specs │ │ └── Hello.spec.js │ ├── index.js │ └── karma.conf.js └── e2e │ ├── specs │ └── test.js │ ├── custom-assertions │ └── elementCount.js │ ├── runner.js │ └── nightwatch.conf.js ├── .gitignore ├── .editorconfig ├── .postcssrc.js ├── Dockerfile ├── .babelrc ├── index.html ├── LICENSE.md ├── README.md ├── package.json └── doc └── zhuishushenqi.md /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/store/actions.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // 将设置放入此文件中以覆盖默认值和用户设置。 2 | { 3 | "eslint.enable": true 4 | } -------------------------------------------------------------------------------- /screenshot/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/book.png -------------------------------------------------------------------------------- /screenshot/rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/rank.png -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard", 3 | "plugins": [ 4 | "html" 5 | ] 6 | } -------------------------------------------------------------------------------- /screenshot/catory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/catory.png -------------------------------------------------------------------------------- /screenshot/chapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/chapter.png -------------------------------------------------------------------------------- /screenshot/errBook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/errBook.png -------------------------------------------------------------------------------- /screenshot/nReader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/nReader.png -------------------------------------------------------------------------------- /screenshot/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/search.png -------------------------------------------------------------------------------- /screenshot/bookshelf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/bookshelf.png -------------------------------------------------------------------------------- /screenshot/catDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/catDetail.png -------------------------------------------------------------------------------- /screenshot/nightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/nightMode.png -------------------------------------------------------------------------------- /screenshot/rankType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/rankType.png -------------------------------------------------------------------------------- /screenshot/readbook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimplexing/vue-nReader/HEAD/screenshot/readbook.png -------------------------------------------------------------------------------- /test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true, 7 | "sinon": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | test/unit/coverage 8 | test/e2e/reports 9 | selenium-debug.log 10 | .idea 11 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /src/utils/ajax.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | export default { 4 | install (Vue, option = {}) { 5 | const http = axios.create(option) 6 | Vue.http = http 7 | Vue.prototype.$http = http 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8.9.1 2 | RUN apt-get update 3 | RUN apt-get install -y nginx 4 | WORKDIR /app 5 | COPY . /app/ 6 | EXPOSE 80 7 | RUN npm install 8 | RUN npm run build 9 | RUN cp -r dist/* /var/www/html 10 | RUN rm -rf /app 11 | CMD ["nginx","-g","daemon off;"] 12 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "presets": ["env", "stage-2"], 11 | "plugins": [ "istanbul" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/store/mutationsType.js: -------------------------------------------------------------------------------- 1 | export const SET_RANK = 'SET_RANK' 2 | export const SET_BACK_POSITION = 'SET_BACK_POSITION' 3 | export const SET_CURRENT_SOURCE = 'SET_CURRENT_SOURCE' 4 | export const SET_SEC_PATH = 'SET_SEC_PATH' 5 | export const SET_THIRD_PATH = 'SET_THIRD_PATH' 6 | export const SET_HEAD_TITLE = 'SET_HEAD_TITLE' 7 | export const SET_READ_BOOK = 'SET_READ_BOOK' 8 | -------------------------------------------------------------------------------- /test/unit/specs/Hello.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Hello from '@/components/Hello' 3 | 4 | describe('Hello.vue', () => { 5 | it('should render correct contents', () => { 6 | const Constructor = Vue.extend(Hello) 7 | const vm = new Constructor().$mount() 8 | expect(vm.$el.querySelector('.hello h1').textContent) 9 | .to.equal('Welcome to Your Vue.js App') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | // import action from 'action' 4 | import mutations from './mutations' 5 | 6 | Vue.use(Vuex) 7 | 8 | const state = { 9 | weekRankId: '', 10 | monthRankId: '', 11 | totalRankId: '', 12 | headTitle: '', // 头部文字 13 | previousPosition: '书架', 14 | source: '', // 小说源 15 | backPath: {}, 16 | bookInfo: {} 17 | } 18 | 19 | export default new Vuex.Store({ 20 | state, 21 | mutations 22 | }) 23 | -------------------------------------------------------------------------------- /test/unit/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.config.productionTip = false 4 | 5 | // require all test files (files that ends with .spec.js) 6 | const testsContext = require.context('./specs', true, /\.spec$/) 7 | testsContext.keys().forEach(testsContext) 8 | 9 | // require all src files except main.js for coverage. 10 | // you can also change this to match only the subset of files that 11 | // you want coverage for. 12 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/) 13 | srcContext.keys().forEach(srcContext) 14 | -------------------------------------------------------------------------------- /src/assets/font_smaller.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "0.1.0", 5 | "command": "npm", 6 | "isShellCommand": true, 7 | "showOutput": "always", 8 | "suppressTaskName": true, 9 | "tasks": [ 10 | { 11 | "taskName": "install", 12 | "args": ["install"] 13 | }, 14 | { 15 | "taskName": "update", 16 | "args": ["update"] 17 | }, 18 | { 19 | "taskName": "test", 20 | "args": ["run", "test"] 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/assets/font_bigger.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/assets/down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/line_spacing_normal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 47 | -------------------------------------------------------------------------------- /src/assets/line_spacing_small.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/utils/util.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zimplexing 3 | * @Date: 2017-06-24 19:24:32 4 | * @Last Modified by: zimplexing 5 | * @Last Modified time: 2017-07-02 12:48:13 6 | */ 7 | 8 | import _ from 'lodash' 9 | 10 | const localStroage = window.localStorage 11 | 12 | export default { 13 | 14 | staticPath: 'http://statics.zhuishushenqi.com', 15 | 16 | /** 17 | * 获取localstroage的数据 18 | * @param {String} key 获取localstroage的item 19 | */ 20 | getLocalStroageData (item) { 21 | return _.isEmpty(JSON.parse(localStroage.getItem(item))) ? null : JSON.parse(localStroage.getItem(item)) 22 | }, 23 | 24 | /** 25 | * 设置localstroage的值 26 | * @param {String} item 27 | * @param {Object} obj 28 | */ 29 | setLocalStroageData (item, obj) { 30 | localStroage.setItem(item, JSON.stringify(obj)) 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 随便看 21 | 22 | 23 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /src/assets/up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // the name of the method is the filename. 3 | // can be used in tests like this: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // for how to write custom assertions see 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | exports.assertion = function (selector, count) { 10 | this.message = 'Testing if element <' + selector + '> has count: ' + count 11 | this.expected = count 12 | this.pass = function (val) { 13 | return val === this.expected 14 | } 15 | this.value = function (res) { 16 | return res.value 17 | } 18 | this.command = function (cb) { 19 | var self = this 20 | return this.api.execute(function (selector) { 21 | return document.querySelectorAll(selector).length 22 | }, [selector], function (res) { 23 | cb.call(self, res) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/store/mutations.js: -------------------------------------------------------------------------------- 1 | import { 2 | SET_RANK, 3 | SET_BACK_POSITION, 4 | SET_CURRENT_SOURCE, 5 | SET_SEC_PATH, 6 | SET_THIRD_PATH, 7 | SET_HEAD_TITLE, 8 | SET_READ_BOOK 9 | } from './mutationsType' 10 | 11 | export default { 12 | [SET_RANK] (state, rankDetail) { 13 | state.weekRankId = rankDetail._id 14 | state.monthRankId = rankDetail.monthRank 15 | state.totalRankId = rankDetail.totalRank 16 | state.headTitle = rankDetail.shortTitle 17 | }, 18 | [SET_BACK_POSITION] (state, position) { 19 | state.previousPosition = position 20 | }, 21 | [SET_CURRENT_SOURCE] (state, source) { 22 | state.source = source 23 | }, 24 | [SET_SEC_PATH] (state, prePath) { 25 | state.backPath.secPath = prePath 26 | }, 27 | [SET_THIRD_PATH] (state, prePath) { 28 | state.backPath.thirdPath = prePath 29 | }, 30 | [SET_HEAD_TITLE] (state, text) { 31 | state.headTitle = text 32 | }, 33 | [SET_READ_BOOK] (state, book) { 34 | state.bookInfo = book 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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.vue' 5 | import VueTouch from 'vue-touch' 6 | import router from './router' 7 | import Ajax from './utils/ajax' 8 | import store from './store' 9 | import MintUI from 'mint-ui' 10 | import 'mint-ui/lib/style.css' 11 | import vuescroll from 'vue-scroll' 12 | 13 | Vue.use(vuescroll) 14 | VueTouch.config.swipe = { 15 | direction: 'horizontal' 16 | } 17 | 18 | Vue.use(VueTouch, { 19 | name: 'v-touch' 20 | }) 21 | Vue.use(MintUI) 22 | Vue.config.productionTip = false 23 | Vue.use(Ajax, { 24 | baseURL: 'http://65.49.197.99:3000/' 25 | }) 26 | 27 | /* eslint-disable no-new */ 28 | new Vue({ 29 | el: '#app', 30 | router, 31 | store, 32 | template: '', 33 | components: { 34 | App 35 | } 36 | }) 37 | 38 | // Disable context menu 39 | document.addEventListener('contextmenu', event => { 40 | event.preventDefault() 41 | event.stopPropagation() 42 | }) 43 | -------------------------------------------------------------------------------- /src/assets/moon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/unit/karma.conf.js: -------------------------------------------------------------------------------- 1 | // This is a karma config file. For more details see 2 | // http://karma-runner.github.io/0.13/config/configuration-file.html 3 | // we are also using it with karma-webpack 4 | // https://github.com/webpack/karma-webpack 5 | 6 | var webpackConfig = require('../../build/webpack.test.conf') 7 | 8 | module.exports = function (config) { 9 | config.set({ 10 | // to run in additional browsers: 11 | // 1. install corresponding karma launcher 12 | // http://karma-runner.github.io/0.13/config/browsers.html 13 | // 2. add it to the `browsers` array below. 14 | browsers: ['PhantomJS'], 15 | frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'], 16 | reporters: ['spec', 'coverage'], 17 | files: ['./index.js'], 18 | preprocessors: { 19 | './index.js': ['webpack', 'sourcemap'] 20 | }, 21 | webpack: webpackConfig, 22 | webpackMiddleware: { 23 | noInfo: true 24 | }, 25 | coverageReporter: { 26 | dir: './coverage', 27 | reporters: [ 28 | { type: 'lcov', subdir: '.' }, 29 | { type: 'text-summary' } 30 | ] 31 | } 32 | }) 33 | } 34 | -------------------------------------------------------------------------------- /src/assets/line_spacing_big.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | var server = require('../../build/dev-server.js') 4 | 5 | server.ready.then(() => { 6 | // 2. run the nightwatch test suite against it 7 | // to run in additional browsers: 8 | // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" 9 | // 2. add it to the --env flag below 10 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 11 | // For more information on Nightwatch's config file, see 12 | // http://nightwatchjs.org/guide#settings-file 13 | var opts = process.argv.slice(2) 14 | if (opts.indexOf('--config') === -1) { 15 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 16 | } 17 | if (opts.indexOf('--env') === -1) { 18 | opts = opts.concat(['--env', 'chrome']) 19 | } 20 | 21 | var spawn = require('cross-spawn') 22 | var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 23 | 24 | runner.on('exit', function (code) { 25 | server.close() 26 | process.exit(code) 27 | }) 28 | 29 | runner.on('error', function (err) { 30 | server.close() 31 | throw err 32 | }) 33 | }) 34 | -------------------------------------------------------------------------------- /test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/gettingstarted#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: require('selenium-server').path, 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/assets/list.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/rank_other.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/book/ChangeSource.vue: -------------------------------------------------------------------------------- 1 | 12 | 47 | 56 | -------------------------------------------------------------------------------- /src/components/ranklist/RankItem.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 32 | 33 | 34 | 70 | -------------------------------------------------------------------------------- /src/assets/trash.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | Vue.use(Router) 5 | 6 | const Home = resolve => require(['@/components/Home'], resolve) 7 | const Ranklist = resolve => require(['@/components/ranklist/Ranklist'], resolve) 8 | const RanklistDetail = resolve => require(['@/components/ranklist/RanklistDetail'], resolve) 9 | const Book = resolve => require(['@/components/common/Book'], resolve) 10 | const ReadBook = resolve => require(['@/components/book/ReadBook'], resolve) 11 | const BookcatDetail = resolve => require(['@/components/category/BookcatDetail'], resolve) 12 | const ChangeSource = resolve => require(['@/components/book/ChangeSource'], resolve) 13 | 14 | export default new Router({ 15 | routes: [ 16 | { 17 | path: '/', 18 | name: 'home', 19 | component: Home 20 | }, { 21 | path: '/bookcat/detail', 22 | name: 'bookcatDetail', 23 | component: BookcatDetail 24 | }, { 25 | path: '/readbook/:bookId', 26 | name: 'readbook', 27 | component: ReadBook 28 | }, { 29 | path: '/book/:bookId', 30 | name: 'book', 31 | component: Book 32 | }, { 33 | path: '/changeSource/:bookId', 34 | name: 'changeSource', 35 | component: ChangeSource 36 | }, { 37 | path: '/ranklist', 38 | name: 'ranklist', 39 | redirect: '/ranklist/weekRank', 40 | component: Ranklist, 41 | children: [{ 42 | path: '/ranklist/*', 43 | name: 'RanklistDetail', 44 | component: RanklistDetail 45 | }] 46 | } 47 | ] 48 | }) 49 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 8080, 27 | autoOpenBrowser: true, 28 | assetsSubDirectory: 'static', 29 | assetsPublicPath: '/', 30 | proxyTable: {}, 31 | // CSS Sourcemaps off by default because relative paths are "buggy" 32 | // with this option, according to the CSS-Loader README 33 | // (https://github.com/webpack/css-loader#sourcemaps) 34 | // In our experience, they generally work as expected, 35 | // just be aware of this issue when enabling this option. 36 | cssSourceMap: false 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/components/ranklist/Ranklist.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 38 | 39 | 40 | 67 | -------------------------------------------------------------------------------- /src/components/category/Bookcategory.vue: -------------------------------------------------------------------------------- 1 | 14 | 39 | 74 | -------------------------------------------------------------------------------- /src/assets/book.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/rank.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/common/Booklist.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 42 | 43 | 44 | 96 | -------------------------------------------------------------------------------- /src/components/Home.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 70 | 71 | 80 | -------------------------------------------------------------------------------- /src/assets/sun.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/category.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/ranklist/RanklistDetail.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 88 | 89 | 90 | 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![DeepScan Grade](https://deepscan.io/api/projects/479/branches/739/badge/grade.svg)](https://deepscan.io/dashboard/#view=project&pid=479&bid=739) 2 | # vue-nReader 3 | 4 | 使用`mint-ui`对整个项目进行了重构,整理了项目的目录结构与代码,较上个版本新增了`小说换源`、`搜索历史记录`、优化了`滚动下载`和`下拉刷新` 5 | 6 | 整个项目一共14个页面(包括通用组件),主要使用了vue2.0+vue-router+vuex,主要实现了小说排行榜,小说分类,小说详情,小说阅读,搜索页面,小说阅读记录等页面。达到了可用来看小说的基本需求。 7 | 8 | 项目中的API均来自追书神器,纯属共享学习之用,有任何疑问或建议可提[issue](https://github.com/zimplexing/vue-nReader/issues/new),使用代理,本地可以完美运行。 9 | 10 | [API文档](https://github.com/zimplexing/vue-nReader/blob/master/doc/zhuishushenqi.md) 11 | 12 | [本地运行代理](https://gist.github.com/zimplexing/c7c1f15ea3f270de3962fc0ab466d82e) 13 | 14 | ## 本地运行 15 | 16 | 使用vue-cli工具构建,基本命令如下: 17 | ``` bash 18 | # 安装依赖 19 | npm install 20 | 21 | # 开发模式 22 | npm run dev 23 | 24 | # 生产模式 25 | npm run build 26 | 27 | ``` 28 | ## 预览地址 29 | 项目放在国外虚拟主机上,代理也运行在上面,所以加载速度可能会比较慢。其中有一些小说封面会加载不出来,这个是api的问题,并不是网络的原因。 30 | 31 | 32 | 电脑端请开启开发者模式 33 | [在线预览地址](http://65.49.197.99:32768/) 34 | 35 | 手机扫码: 36 | 37 | 38 | ## 实现功能 39 | 40 | - [x] 小说书架 41 | - [x] 分类查询 42 | - [x] 排行榜 43 | - [x] 搜索(搜索历史,自动补全) 44 | - [x] 小说详情 45 | - [x] **小说换源** 46 | - [x] 阅读历史记录(记录阅读章节) 47 | - [x] 阅读夜间模式 48 | - [x] 章节倒叙查看 49 | 50 | ## TODO 51 | - [ ] 记录阅读历史位置 52 | 53 | - [ ] 增加发现页面 54 | 55 | - [ ] 社区评论功能 56 | 57 | - [ ] 组件切换动效 58 | 59 | - [ ] 阅读界面设置功能 60 | 61 | - [ ] 小说下载 62 | 63 | ## 屏幕截图 64 | 65 | 66 | 67 | ## 问题 68 | 记录在项目中遇到的一些问题,和解决方法 69 | - [ ] 滚动条控制 70 | - 在不是 `HTML5 history `模式下,还没找到解决的方法 71 | 72 | - [x] flex布局下横向滚动 73 | - 设置属性`flex-shrink:0`,默认下该属性值为1,空间不够时,后等比例缩小,设置为0之后,不会缩小项目 74 | 75 | - [x] 标签选中后active样式的添加 76 |    - 使用`:class` 判断条件为点击当前标签的索引值 77 | 78 | - [x] 同时绑定按键修饰符(keyup事件但不包括按键enter) 79 | - 监听`input`事件,绑定`keyup.enter`事件 80 | 81 | - [x] 返回路径问题 82 | - 使用`$router.go()`进行模拟返回 83 | 84 | - [x] 图片加载错误处理 85 | - 图片加载错误的onerror方法中的静态地址webpack打包不会将其转化为base64编码,所以现在的解决方法是贴一个在线的图片地址 86 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-nReader", 3 | "version": "1.0.0", 4 | "description": "A novel reader webapp", 5 | "author": "zimplexing ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "node build/dev-server.js", 10 | "build": "node build/build.js", 11 | "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", 12 | "e2e": "node test/e2e/runner.js", 13 | "test": "npm run unit && npm run e2e" 14 | }, 15 | "dependencies": { 16 | "axios": "^0.16.1", 17 | "lodash": "^4.17.4", 18 | "mint-ui": "^2.2.7", 19 | "moment": "^2.18.1", 20 | "vue": "^2.2.6", 21 | "vue-router": "^2.3.1", 22 | "vue-scroll": "^2.0.3", 23 | "vue-touch": "^2.0.0-beta.4", 24 | "vuex": "^2.3.1" 25 | }, 26 | "devDependencies": { 27 | "autoprefixer": "^6.7.2", 28 | "babel-core": "^6.22.1", 29 | "babel-loader": "^6.2.10", 30 | "babel-plugin-istanbul": "^4.1.1", 31 | "babel-plugin-transform-runtime": "^6.22.0", 32 | "babel-preset-env": "^1.3.2", 33 | "babel-preset-stage-2": "^6.22.0", 34 | "babel-register": "^6.22.0", 35 | "chai": "^3.5.0", 36 | "chalk": "^1.1.3", 37 | "chromedriver": "^2.27.2", 38 | "connect-history-api-fallback": "^1.3.0", 39 | "copy-webpack-plugin": "^4.0.1", 40 | "cross-env": "^4.0.0", 41 | "cross-spawn": "^5.0.1", 42 | "css-loader": "^0.28.0", 43 | "eslint": "^4.1.1", 44 | "eslint-config-standard": "^10.2.1", 45 | "eslint-plugin-html": "^3.0.0", 46 | "eslint-plugin-import": "^2.6.1", 47 | "eslint-plugin-node": "^5.1.0", 48 | "eslint-plugin-promise": "^3.5.0", 49 | "eslint-plugin-standard": "^3.0.1", 50 | "eventsource-polyfill": "^0.9.6", 51 | "express": "^4.14.1", 52 | "extract-text-webpack-plugin": "^2.0.0", 53 | "file-loader": "^0.11.1", 54 | "friendly-errors-webpack-plugin": "^1.1.3", 55 | "html-webpack-plugin": "^2.28.0", 56 | "http-proxy-middleware": "^0.17.3", 57 | "inject-loader": "^3.0.0", 58 | "karma": "^1.4.1", 59 | "karma-coverage": "^1.1.1", 60 | "karma-mocha": "^1.3.0", 61 | "karma-phantomjs-launcher": "^1.0.2", 62 | "karma-phantomjs-shim": "^1.4.0", 63 | "karma-sinon-chai": "^1.3.1", 64 | "karma-sourcemap-loader": "^0.3.7", 65 | "karma-spec-reporter": "0.0.30", 66 | "karma-webpack": "^2.0.2", 67 | "lolex": "^1.5.2", 68 | "mocha": "^3.2.0", 69 | "nightwatch": "^0.9.12", 70 | "opn": "^4.0.2", 71 | "optimize-css-assets-webpack-plugin": "^1.3.0", 72 | "ora": "^1.2.0", 73 | "phantomjs-prebuilt": "^2.1.14", 74 | "rimraf": "^2.6.0", 75 | "selenium-server": "^3.0.1", 76 | "semver": "^5.3.0", 77 | "shelljs": "^0.7.6", 78 | "sinon": "^2.1.0", 79 | "sinon-chai": "^2.8.0", 80 | "url-loader": "^0.5.8", 81 | "vue-loader": "^11.3.4", 82 | "vue-style-loader": "^2.0.5", 83 | "vue-template-compiler": "^2.2.6", 84 | "webpack": "^2.3.3", 85 | "webpack-bundle-analyzer": "^2.2.1", 86 | "webpack-dev-middleware": "^1.10.0", 87 | "webpack-hot-middleware": "^2.18.0", 88 | "webpack-merge": "^4.1.0" 89 | }, 90 | "engines": { 91 | "node": ">= 4.0.0", 92 | "npm": ">= 3.0.0" 93 | }, 94 | "browserslist": [ 95 | "> 1%", 96 | "last 2 versions", 97 | "not ie <= 8" 98 | ] 99 | } 100 | -------------------------------------------------------------------------------- /src/components/ranklist/Rank.vue: -------------------------------------------------------------------------------- 1 | 48 | 88 | 89 | 128 | -------------------------------------------------------------------------------- /src/assets/setting.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/api/api.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | export default { 4 | 5 | /** 6 | * 获取所有的排行榜类型 7 | * @returns {null} 8 | */ 9 | getRankType () { 10 | return Vue.http.get('/ranking/gender') 11 | }, 12 | 13 | /** 14 | * 根据id获取排行榜 15 | * @returns {String} id为周榜id,月榜id,总榜id 16 | */ 17 | getRankList (id) { 18 | return Vue.http.get('/ranking/' + id) 19 | }, 20 | 21 | /** 22 | * 获取所有分类 23 | * @returns {null} 24 | * http://api.zhuishushenqi.com/cats/lv2 25 | */ 26 | getCategory () { 27 | return Vue.http.get('/cats/lv2/statistics') 28 | }, 29 | 30 | /** 31 | * 获取细分的类别 32 | */ 33 | getCategoryDetail () { 34 | return Vue.http.get('/cats/lv2') 35 | }, 36 | 37 | /** 38 | * 根据分类获取小说列表 39 | * @param {String} gender 可选:male/female/press 40 | * @param {String} type 可选:hot(热门)/new(新书)/reputation(好评)/over(完结)/monthly(包月) 41 | * @param {String} major 42 | * @param {String} minor 43 | * @param {Number} start 44 | * @param {Number} limit 45 | * https://api.zhuishushenqi.com/book/by-categories?gender=male&type=hot&major=%E5%A5%87%E5%B9%BB&minor=&start=0&limit=20 46 | */ 47 | // todo 入参需要用es6优化 48 | getNovelListByCat (gender, type, major, minor = '', start = 0, limit = 20) { 49 | return Vue.http.get('/book/by-categories?gender=' + gender + '&type=' + type + '&major=' + major + '&minor=' + minor + '&start=' + start + '&limit=' + limit) 50 | }, 51 | 52 | /** 53 | * 根据id获取小说 54 | * @param {String} bookId 小说id 55 | */ 56 | getBook (bookId) { 57 | return Vue.http.get('/book/' + bookId) 58 | }, 59 | 60 | /** 61 | * 获取小说源(正版源) 62 | * @param {String} bookId 小说id 63 | * 'http://api.zhuishushenqi.com/btoc?view=summary&book=548d9c17eb0337ee6df738f5' 64 | */ 65 | getGenuineSource (bookId) { 66 | return Vue.http.get('/btoc?view=summary&book=' + bookId) 67 | }, 68 | 69 | /** 70 | * 获取小说源(正版源与盗版源) 71 | * @param {String} bookId 小说id 72 | * 'http://api.zhuishushenqi.com/atoc?view=summary&book=548d9c17eb0337ee6df738f5' 73 | */ 74 | getMixSource (bookId) { 75 | return Vue.http.get('/atoc?view=summary&book=' + bookId) 76 | }, 77 | 78 | /** 79 | * 获取小说章节(混合源,大概可认为是正版网站的公众章节+最快更新的盗版网站章节的混合) 80 | * @param {String} bookId 小说id 81 | * http://api.zhuishushenqi.com/mix-atoc/50bff3ec209793513100001c?view=chapters 82 | */ 83 | getMixChapters (bookId) { 84 | return Vue.http.get('/mix-atoc/' + bookId + '?view=chapters') 85 | }, 86 | 87 | /** 88 | * 获取小说章节 89 | * @param {String} sourceId 小说源id 90 | */ 91 | getChapters (sourceId) { 92 | return Vue.http.get('/atoc/' + sourceId + '?view=chapters') 93 | }, 94 | 95 | /** 96 | * 获取小说章节内容 97 | * @param {String} chapterUrl 章节url 98 | * http://chapterup.zhuishushenqi.com/chapter/http://vip.zhuishushenqi.com/chapter/5817f1161bb2ca566b0a5973?cv=1481275033588 99 | */ 100 | getBookChapterContent (chapterUrl) { 101 | return Vue.http.get('/getChapter?chapterUrl=' + chapterUrl) 102 | }, 103 | 104 | /** 105 | * 获取搜索热词 106 | * @returns {null} 107 | */ 108 | getHotWords () { 109 | return Vue.http.get('/book/search-hotwords') 110 | }, 111 | 112 | /** 113 | * 搜索自动补充 114 | * @param {String} searchWord 搜索内容 115 | * http://api05iye5.zhuishushenqi.com/book/auto-complete?query=%E6%96%97%E7%BD%97 116 | */ 117 | autoComplete (searchWord) { 118 | return Vue.http.get('/book/auto-complete?query=' + searchWord) 119 | }, 120 | 121 | /** 122 | * 模糊搜索 123 | * @param {String} searchWord 搜索内容 124 | */ 125 | fuzzySearch (searchWord) { 126 | return Vue.http.get('/book/fuzzy-search?query=' + searchWord) 127 | }, 128 | 129 | /** 130 | * 获取小说最新章节(书架) 131 | * @param {Array} bookList 获取更新的小说id 132 | * http://api05iye5.zhuishushenqi.com/book?view=updated&id=531169b3173bfacb4904ca67,51d11e782de6405c45000068 133 | */ 134 | getUpdate (bookList) { 135 | return Vue.http.get('/book?view=updated&id=' + bookList.toString()) 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /src/components/bookshelf/Bookshelf.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 112 | 113 | 114 | 189 | -------------------------------------------------------------------------------- /src/components/category/BookcatDetail.vue: -------------------------------------------------------------------------------- 1 | 24 | 148 | 194 | -------------------------------------------------------------------------------- /doc/zhuishushenqi.md: -------------------------------------------------------------------------------- 1 | ## nReader 2 | 3 | #### 追书神器api文档 4 | 5 | 追书神器`api`官方地址: 6 | 7 | ```javascript 8 | http://api.zhuishushenqi.com 9 | http://api05iye5.zhuishushenqi.com 10 | http://http://chapterup.zhuishushenqi.com/chapter 11 | ``` 12 | 13 | 由于官方`api`地址没有进行CROS处理,所以调用时会存在跨域问题,这里提供了一个代理地址: 14 | 15 | ```JavaScript 16 | http://65.49.197.99/:3000 17 | ``` 18 | 19 | 有能力的童鞋可以自己搭一个代理,对请求进行转发. 20 | 21 | #### 接口 22 | 23 | 1. 获取所有分类 24 | 2. 获取排行榜类型 25 | 3. 获取排行榜小说 26 | 4. 获取分类下小类别 27 | 5. 根据分类获取小说列表 28 | 6. 获取小说信息 29 | 7. 获取小说正版源 30 | 8. 获取小说源(正版➕盗版) 31 | 9. 获取小说章节(根据小说id) 32 | 10. 获取小说章节(根据小说源id) 33 | 11. 获取小说章节内容 34 | 12. 获取搜索热词 35 | 13. 搜索自动补充 36 | 14. 模糊搜索 37 | 15. 获取小说最新章节 38 | 39 | 40 | 41 | **所有接口都是`GET`请求** 42 | 43 | ##### 1. 获取所有分类 44 | 45 | | 类型 | 值 | 46 | | ------ | ---------------------------------------- | 47 | | 接口地址 | /cats/lv2/statistics | 48 | | 参数 | null | 49 | | 实例接口地址 | http://api.zhuishushenqi.com/cats/lv2/statistics | 50 | 51 | ##### 2. 获取排行榜类型 52 | 53 | | 类型 | 值 | 54 | | ------ | ---------------------------------------- | 55 | | 接口地址 | /ranking/gender | 56 | | 参数 | null | 57 | | 实例接口地址 | http://api.zhuishushenqi.com/ranking/gender | 58 | 59 | ##### 3. 获取排行榜小说 60 | 61 | | 类型 | 值 | 62 | | ------ | ---------------------------------------- | 63 | | 接口地址 | /ranking/:rankId | 64 | | 参数 | 排行榜的ID,不同字段对应不同的榜单,具体ID从接口2中获取 | 65 | | | _id: 周榜ID | 66 | | | monthRank: 月榜ID | 67 | | | totalRank: 总榜ID | 68 | | 实例接口地址 | http://api.zhuishushenqi.com/ranking/54d43437d47d13ff21cad58b | 69 | 70 | ##### 4. 获取分类下小类别 71 | 72 | | 类型 | 值 | 73 | | ------ | ------------------------------------- | 74 | | 接口地址 | /cats/lv2 | 75 | | 参数 | null | 76 | | 实例接口地址 | http://api.zhuishushenqi.com/cats/lv2 | 77 | 78 | ##### 5. 根据分类获取小说列表 79 | 80 | | 类型 | 值 | 81 | | ------ | ---------------------------------------- | 82 | | 接口地址 | /book/by-categories | 83 | | 参数 | 说明无 | 84 | | | gender: 男生:`mael` 女生:`female` 出版:`press` | 85 | | | type: 热门:`hot` 新书:`new` 好评:`repulation` 完结: `over` 包月: `month` | 86 | | | major: 大类别 从接口1获取 | 87 | | | minor: 小类别 从接口4获取 (非必填) | 88 | | | start: 分页开始页 | 89 | | | limit: 分页条数 | 90 | | 实例接口地址 | https://api.zhuishushenqi.com/book/by-categories?gender=male&type=hot&major=%E5%A5%87%E5%B9%BB&minor=&start=0&limit=20 | 91 | 92 | ##### 6. 获取小说信息 93 | 94 | | 类型 | 值 | 95 | | ------ | ---------------------------------------- | 96 | | 接口地址 | /book/:booId | 97 | | 参数 | booId具体小说的ID | 98 | | 实例接口地址 | http://api.zhuishushenqi.com/book/548d9c17eb0337ee6df738f5 | 99 | 100 | ##### 7. 获取小说正版源 101 | 102 | | 类型 | 值 | 103 | | ------ | ---------------------------------------- | 104 | | 接口地址 | /btoc | 105 | | 参数 | view: 暂时只知道`summary`这个参数 book: 对应的bookId | 106 | | 实例接口地址 | http://api.zhuishushenqi.com/btoc?view=summary&book=548d9c17eb0337ee6df738f5 | 107 | 108 | ##### 8. 获取小说正版源于盗版源(混合) 109 | 110 | | 类型 | 值 | 111 | | ------ | ---------------------------------------- | 112 | | 接口地址 | /atoc | 113 | | 参数 | `view`: 暂时只知道`summary`这个参数` book`: 对应的bookId | 114 | | 实例接口地址 | http://api.zhuishushenqi.com/atoc?view=summary&book=548d9c17eb0337ee6df738f5 | 115 | 116 | ##### 9. 获取小说章节(根据小说id) 117 | 118 | | 类型 | 值 | 119 | | ------ | ---------------------------------------- | 120 | | 接口地址 | /mix-atoc/:bookId | 121 | | 参数 | `bookId`:对应小说id `view`:暂时只知道`chapters` | 122 | | 实例接口地址 | http://api.zhuishushenqi.com/mix-atoc/50bff3ec209793513100001c?view=chapters | 123 | 124 | ##### 10. 获取小说章节(根据小说源id) 125 | 126 | | 类型 | 值 | 127 | | ------ | ---------------------------------------- | 128 | | 接口地址 | /atoc 或者/btoc | 129 | | 参数 | `sourceId`:对应小说源id `view`:暂时只知道`chapters | 130 | | 实例接口地址 | http://api.zhuishushenqi.com/atoc/568fef99adb27bfb4b3a58dc?view=chapters | 131 | 132 | ##### 11. 获取小说章节内容 133 | 134 | | 类型 | 值 | 135 | | ------ | ---------------------------------------- | 136 | | 接口地址 | chapterup.zhuishushenqi.com/chapter/ | 137 | | 参数 | link: 章节地址 | 138 | | 实例接口地址 | http://chapterup.zhuishushenqi.com/chapter/http://vip.zhuishushenqi.com/chapter/5817f1161bb2ca566b0a5973?cv=1481275033588 | 139 | 140 | ##### 12. 获取搜索热词 141 | 142 | | 类型 | 值 | 143 | | ------ | ---------------------------------------- | 144 | | 接口 | /book/search-hotwords | 145 | | 参数 | null | 146 | | 实例接口地址 | http://api.zhuishushenqi.com/book/search-hotword | 147 | 148 | ##### 13. 搜索自动补充 149 | 150 | | 类型 | 值 | 151 | | ------ | ---------------------------------------- | 152 | | 接口 | /book/auto-complete | 153 | | 参数 | `query`:查询值 | 154 | | 实例接口地址 | http://api.zhuishushenqi.com/book/auto-complete?query=%E6%96%97%E7%BD%97 | 155 | 156 | ##### 14. 模糊搜索 157 | 158 | | 类型 | 值 | 159 | | ---- | ---------------------------------------- | 160 | | 接口 | /book/fuzzy-search | 161 | | 参数 | `query`:查询值 | 162 | | 实例地址 | http://api.zhuishushenqi.com/book/fuzzy-search?query=%E6%96%97%E7%BD%97 | 163 | 164 | ##### 15. 获取小说最新章节 165 | 166 | | 类型 | 值 | 167 | | ------ | ---------------------------------------- | 168 | | 接口 | /book | 169 | | 参数 | `view`: updated `id`:以都好分割的bookId | 170 | | 实例接口地址 | http://api05iye5.zhuishushenqi.com/book?view=updated&id=531169b3173bfacb4904ca67 | 171 | -------------------------------------------------------------------------------- /src/components/search/Search.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 129 | 130 | 131 | 247 | -------------------------------------------------------------------------------- /src/components/common/Book.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 151 | 152 | 153 | 280 | -------------------------------------------------------------------------------- /src/components/book/ReadBook.vue: -------------------------------------------------------------------------------- 1 | 72 | 73 | 277 | 278 | 279 | --------------------------------------------------------------------------------