first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<body>
<div class="dd">
<h2>{{hello}}</h2>
</div>
</body>
<script>
vm = new Vue(
{
el:'.dd',
data:{
hello:'11'
},
methods:{
},
watch:{
hello(ntest,otest){
console.log("ntest",ntest);
console.log("otest",otest);
}
},
computed:{
// test(){
// }
}
}
)
</script>
</html>

View File

@@ -0,0 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}

View File

@@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

View File

@@ -0,0 +1,5 @@
/build/
/config/
/dist/
/*.js
/test/unit/coverage/

View File

@@ -0,0 +1,29 @@
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}

View File

@@ -0,0 +1,17 @@
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

View File

@@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}

View File

@@ -0,0 +1,30 @@
# test1
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

View File

@@ -0,0 +1,41 @@
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})

View File

@@ -0,0 +1,54 @@
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,101 @@
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}

View File

@@ -0,0 +1,22 @@
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
module.exports = {
loaders: utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
}),
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}

View File

@@ -0,0 +1,92 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}

View File

@@ -0,0 +1,95 @@
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})

View File

@@ -0,0 +1,149 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig

View File

@@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})

View File

@@ -0,0 +1,76 @@
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}

View File

@@ -0,0 +1,4 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
}

View File

@@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>test1</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -0,0 +1,87 @@
{
"name": "test1",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Think <zhujingthink@outlook.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js"
},
"dependencies": {
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"nightwatch": "^0.9.12",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

View File

@@ -0,0 +1,23 @@
<template>
<div id="app">
<img src="./assets/logo.png">
<router-view/>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,113 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
>
Core Docs
</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
>
Forum
</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
>
Community Chat
</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href="http://vuejs-templates.github.io/webpack/"
target="_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>
vue-loader
</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
>
awesome-vue
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@@ -0,0 +1,15 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})

View File

@@ -0,0 +1,15 @@
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
}
]
})

View File

@@ -0,0 +1,27 @@
// A custom Nightwatch assertion.
// The assertion name is the filename.
// Example usage:
//
// browser.assert.elementCount(selector, count)
//
// For more information on custom assertions see:
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = 'Testing if element <' + selector + '> has count: ' + count
this.expected = count
this.pass = function (val) {
return val === this.expected
}
this.value = function (res) {
return res.value
}
this.command = function (cb) {
var self = this
return this.api.execute(function (selector) {
return document.querySelectorAll(selector).length
}, [selector], function (res) {
cb.call(self, res)
})
}
}

View File

@@ -0,0 +1,46 @@
require('babel-register')
var config = require('../../config')
// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
selenium: {
start_process: true,
server_path: require('selenium-server').path,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
}
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
}

View File

@@ -0,0 +1,48 @@
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'
const webpack = require('webpack')
const DevServer = require('webpack-dev-server')
const webpackConfig = require('../../build/webpack.prod.conf')
const devConfigPromise = require('../../build/webpack.dev.conf')
let server
devConfigPromise.then(devConfig => {
const devServerOptions = devConfig.devServer
const compiler = webpack(webpackConfig)
server = new DevServer(compiler, devServerOptions)
const port = devServerOptions.port
const host = devServerOptions.host
return server.listen(port, host)
})
.then(() => {
// 2. run the nightwatch test suite against it
// to run in additional browsers:
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
// 2. add it to the --env flag below
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
let opts = process.argv.slice(2)
if (opts.indexOf('--config') === -1) {
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
}
if (opts.indexOf('--env') === -1) {
opts = opts.concat(['--env', 'chrome'])
}
const spawn = require('cross-spawn')
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
runner.on('exit', function (code) {
server.close()
process.exit(code)
})
runner.on('error', function (err) {
server.close()
throw err
})
})

View File

@@ -0,0 +1,19 @@
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module.exports = {
'default e2e tests': function (browser) {
// automatically uses dev Server port from /config.index.js
// default: http://localhost:8080
// see nightwatch.conf.js
const devServer = browser.globals.devServerURL
browser
.url(devServer)
.waitForElementVisible('#app', 5000)
.assert.elementPresent('.hello')
.assert.containsText('h1', 'Welcome to Your Vue.js App')
.assert.elementCount('img', 1)
.end()
}
}

View File

@@ -0,0 +1,7 @@
{
"env": {
"jest": true
},
"globals": {
}
}

View File

@@ -0,0 +1,30 @@
const path = require('path')
module.exports = {
rootDir: path.resolve(__dirname, '../../'),
moduleFileExtensions: [
'js',
'json',
'vue'
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
transform: {
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
},
testPathIgnorePatterns: [
'<rootDir>/test/e2e'
],
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
setupFiles: ['<rootDir>/test/unit/setup'],
mapCoverage: true,
coverageDirectory: '<rootDir>/test/unit/coverage',
collectCoverageFrom: [
'src/**/*.{js,vue}',
'!src/main.js',
'!src/router/index.js',
'!**/node_modules/**'
]
}

View File

@@ -0,0 +1,3 @@
import Vue from 'vue'
Vue.config.productionTip = false

View File

@@ -0,0 +1,11 @@
import Vue from 'vue'
import HelloWorld from '@/components/HelloWorld'
describe('HelloWorld.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(HelloWorld)
const vm = new Constructor().$mount()
expect(vm.$el.querySelector('.hello h1').textContent)
.toEqual('Welcome to Your Vue.js App')
})
})

View File

@@ -0,0 +1,11 @@
{
"name": "vue",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

View File

@@ -0,0 +1,18 @@
var Config = {
// 开发阶段测试基地址
BaseUrl: 'http://127.0.0.1:3000/api',
// 上线阶段的正式基地址
// BaseUrl: 'http://xxx.com/aaaa/api',
apiUrl: {
bannerIndex: '/index/banner', // 获取banner列表接口
bannerInfo: '/index/bannerInfo', // 获取banner详情接口
threeMeals: '/index/threeMeals', // 每日三餐接口
type: '/index/type', // 九宫格菜单
indexClass: '/index/class', // 大家都在做接口
Foodrecipes:'/video/list',//美食视频
leftMenu:'/type/leftMenu',//分类左边的小类
rightMenu: '/type/rightMenu', // 右边接口
rightMenuList: '/type/rig htMenuList', // 点击右边小分类获取分类列表
indexInfo: '/index/info',//详情页面
}
}

View File

@@ -0,0 +1,41 @@
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var app = express();
app.all('*', function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Content-Type', 'application/json;charset=utf-8');
next();
});
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use('/api', indexRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;

View File

@@ -0,0 +1,87 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('caipu:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
console.log('App is run http://127.0.0.1:'+addr.port);
}

View File

@@ -0,0 +1,85 @@
module.exports = {
baseUrl: 'https://m.meishij.net',
HomeClassType: function (type = 1, page = 1) {
return `https://m.meishij.net/ajax/index_search_new.php?callback=jQuery2140868703264037048_1597809875093&format=json&type=${type}&page=${page}&_=1597809875094`
},
// 菜谱视频大全
VideoList: function (page = 1) {
return `https://m.meishij.net/shipin/index.php?callback=jQuery21408367060449076322_1597835324516&format=json&ajax=1&page=${page}&_=1597835324517`;
},
SearchWord: function (q = '', page = 1) {
return `https://m.meishij.net/search.php?q=${q}&ajax=1&page=${page}`
},
leftType: [
{
url: '/fenlei/shiyongfenlei/',
title: '实用分类',
position: 0,
},
{
url: '/fenlei/meirisancan/',
title: '每日三餐',
position: -50,
},
{
url: '/fenlei/zhushidaquan/',
title: '主食',
position: -75,
},
{
url: '/fenlei/jiachangcaipu/',
title: '家常菜谱',
position: -100,
},
{
url: '/caixi/',
title: '中华菜系',
position: -125,
},
{
url: '/xiaochi/',
title: '各地小吃',
position: -150,
},
{
url: '/fenlei/waiguocaipu/',
title: '外国菜谱',
position: -175,
},
{
url: '/fenlei/hongbei/',
title: '烘焙',
position: -200,
},
{
url: '/renqun/',
title: '人群',
position: -225,
},
{
url: '/fenlei/chuju/',
title: '厨具',
position: -250,
},
{
url: '/fenlei/changjing/',
title: '场景',
position: -275,
},
{
url: '/zangfutiaoli/',
title: '脏腑调理',
position: -325,
},
{
url: '/fenlei/gongyi/',
title: '工艺',
position: -375,
},
{
url: '/fenlei/kouwei/',
title: '口味',
position: -425,
}
],
}

View File

@@ -0,0 +1,841 @@
{
"name": "caipu",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/node": {
"version": "14.6.0",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.6.0.tgz",
"integrity": "sha1-fUQRv1FXM5M318/4ZNn/RfF3tJk="
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz",
"integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"ajv": {
"version": "6.12.4",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.4.tgz?cache=0&sync_timestamp=1597480760804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.4.tgz",
"integrity": "sha1-BhT6zEUiEn+nE0Rca/0+vTduIjQ=",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Farray-flatten%2Fdownload%2Farray-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
"integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=",
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
},
"aws4": {
"version": "1.10.1",
"resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.10.1.tgz?cache=0&sync_timestamp=1597238704875&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.10.1.tgz",
"integrity": "sha1-4eguTz6Zniz9YbFhKA0WoRH4ZCg="
},
"basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/basic-auth/download/basic-auth-2.0.1.tgz",
"integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=",
"requires": {
"safe-buffer": "5.1.2"
}
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"requires": {
"tweetnacl": "^0.14.3"
}
},
"body-parser": {
"version": "1.18.3",
"resolved": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.18.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbody-parser%2Fdownload%2Fbody-parser-1.18.3.tgz",
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "~1.6.3",
"iconv-lite": "0.4.23",
"on-finished": "~2.3.0",
"qs": "6.5.2",
"raw-body": "2.3.3",
"type-is": "~1.6.16"
}
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/boolbase/download/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"cheerio": {
"version": "1.0.0-rc.3",
"resolved": "https://registry.npm.taobao.org/cheerio/download/cheerio-1.0.0-rc.3.tgz",
"integrity": "sha1-CUY21CWy6cD065GkbAVjDJoai/Y=",
"requires": {
"css-select": "~1.2.0",
"dom-serializer": "~0.1.1",
"entities": "~1.1.1",
"htmlparser2": "^3.9.1",
"lodash": "^4.15.0",
"parse5": "^3.0.1"
}
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz",
"integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.2.tgz",
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz",
"integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js="
},
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.4.0.tgz",
"integrity": "sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo="
},
"cookie-parser": {
"version": "1.4.5",
"resolved": "https://registry.npm.taobao.org/cookie-parser/download/cookie-parser-1.4.5.tgz",
"integrity": "sha1-PlctS3wMgPnGHa9gTkM2gxtdHUk=",
"requires": {
"cookie": "0.4.0",
"cookie-signature": "1.0.6"
}
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"css-select": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/css-select/download/css-select-1.2.0.tgz",
"integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
"requires": {
"boolbase": "~1.0.0",
"css-what": "2.1",
"domutils": "1.5.1",
"nth-check": "~1.0.1"
}
},
"css-what": {
"version": "2.1.3",
"resolved": "https://registry.npm.taobao.org/css-what/download/css-what-2.1.3.tgz",
"integrity": "sha1-ptdgRXM2X+dGhsPzEcVlE9iChfI="
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"requires": {
"ms": "2.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"dom-serializer": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/dom-serializer/download/dom-serializer-0.1.1.tgz",
"integrity": "sha1-HsQFnihLq+027sKUHUqXChic58A=",
"requires": {
"domelementtype": "^1.3.0",
"entities": "^1.1.1"
}
},
"domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npm.taobao.org/domelementtype/download/domelementtype-1.3.1.tgz",
"integrity": "sha1-0EjESzew0Qp/Kj1f7j9DM9eQSB8="
},
"domhandler": {
"version": "2.4.2",
"resolved": "https://registry.npm.taobao.org/domhandler/download/domhandler-2.4.2.tgz",
"integrity": "sha1-iAUJfpM9ZehVRvcm1g9euItE+AM=",
"requires": {
"domelementtype": "1"
}
},
"domutils": {
"version": "1.5.1",
"resolved": "https://registry.npm.taobao.org/domutils/download/domutils-1.5.1.tgz?cache=0&sync_timestamp=1597680507221&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdomutils%2Fdownload%2Fdomutils-1.5.1.tgz",
"integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
"requires": {
"dom-serializer": "0",
"domelementtype": "1"
}
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/entities/download/entities-1.1.2.tgz?cache=0&sync_timestamp=1591227679482&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-1.1.2.tgz",
"integrity": "sha1-vfpzUplmTfr9NFKe1PhSKidf6lY="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.16.4",
"resolved": "https://registry.npm.taobao.org/express/download/express-4.16.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpress%2Fdownload%2Fexpress-4.16.4.tgz",
"integrity": "sha1-/d72GSYQniTFFeqX/S8b2/Yt8S4=",
"requires": {
"accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.3",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.4",
"qs": "6.5.2",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.2",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
}
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
"integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz?cache=0&sync_timestamp=1591599651635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-3.1.3.tgz",
"integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM="
},
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.1.tgz",
"integrity": "sha1-7r9O2EAHnIP0JJA4ydcDAIMBsQU=",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
}
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz",
"integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
},
"har-validator": {
"version": "5.1.5",
"resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.5.tgz?cache=0&sync_timestamp=1596082653557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhar-validator%2Fdownload%2Fhar-validator-5.1.5.tgz",
"integrity": "sha1-HwgDufjLIMD6E4It8ezds2veHv0=",
"requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
}
},
"htmlparser2": {
"version": "3.10.1",
"resolved": "https://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1582422905208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz",
"integrity": "sha1-vWedw/WYl7ajS7EHSchVu1OpOS8=",
"requires": {
"domelementtype": "^1.3.1",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.1.1"
}
},
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.3.tgz?cache=0&sync_timestamp=1593407710477&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-errors%2Fdownload%2Fhttp-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"iconv-lite": {
"version": "0.4.23",
"resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.23.tgz",
"integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.9.1.tgz",
"integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM="
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz",
"integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA="
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.20.tgz?cache=0&sync_timestamp=1597336001963&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.20.tgz",
"integrity": "sha1-tEqbYpe8tpjxxRo1RaKzs2jVnFI="
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/mime/download/mime-1.4.1.tgz",
"integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY="
},
"mime-db": {
"version": "1.44.0",
"resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz",
"integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I="
},
"mime-types": {
"version": "2.1.27",
"resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.27.tgz",
"integrity": "sha1-R5SfmOJ56lMRn1ci4PNOUpvsAJ8=",
"requires": {
"mime-db": "1.44.0"
}
},
"morgan": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/morgan/download/morgan-1.9.1.tgz",
"integrity": "sha1-Co0Wc0odmvvIJLmd+H5zjlji2lk=",
"requires": {
"basic-auth": "~2.0.0",
"debug": "2.6.9",
"depd": "~1.1.2",
"on-finished": "~2.3.0",
"on-headers": "~1.0.1"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.2.tgz",
"integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs="
},
"nth-check": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/nth-check/download/nth-check-1.0.2.tgz",
"integrity": "sha1-sr0pXDfj3VijvwcAN2Zjuk2c8Fw=",
"requires": {
"boolbase": "~1.0.0"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz",
"integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"on-headers": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.2.tgz",
"integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8="
},
"parse5": {
"version": "3.0.3",
"resolved": "https://registry.npm.taobao.org/parse5/download/parse5-3.0.3.tgz?cache=0&sync_timestamp=1595849319979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fparse5%2Fdownload%2Fparse5-3.0.3.tgz",
"integrity": "sha1-BC95L/3TaFFVHPTp4Gazh0q0W1w=",
"requires": {
"@types/node": "*"
}
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz",
"integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz?cache=0&sync_timestamp=1574278262588&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-to-regexp%2Fdownload%2Fpath-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-2.0.6.tgz",
"integrity": "sha1-/cIzZQVEfT8vLGOO0nLK9hS7sr8=",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.1"
}
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz",
"integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ="
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz",
"integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE="
},
"raw-body": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.3.3.tgz",
"integrity": "sha1-GzJOzmtXBuFThVvBFIxlu39uoMM=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.23",
"unpipe": "1.0.0"
}
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-3.6.0.tgz",
"integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"request": {
"version": "2.88.2",
"resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz",
"integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz",
"integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
},
"send": {
"version": "0.16.2",
"resolved": "https://registry.npm.taobao.org/send/download/send-0.16.2.tgz",
"integrity": "sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
}
},
"serve-static": {
"version": "1.13.2",
"resolved": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.13.2.tgz",
"integrity": "sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.2"
}
},
"setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.0.tgz",
"integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY="
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz",
"integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=",
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"statuses": {
"version": "1.4.0",
"resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz",
"integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic="
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.3.0.tgz",
"integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=",
"requires": {
"safe-buffer": "~5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz",
"integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY="
}
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz",
"integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=",
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.18.tgz",
"integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
"integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=",
"requires": {
"punycode": "^2.1.0"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz?cache=0&sync_timestamp=1595886825323&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz",
"integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
}
}
}

View File

@@ -0,0 +1,17 @@
{
"name": "caipu",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node-dev ./bin/www"
},
"dependencies": {
"cheerio": "^1.0.0-rc.3",
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"http-errors": "~1.6.3",
"morgan": "~1.9.1",
"request": "^2.88.2"
}
}

View File

@@ -0,0 +1,512 @@
const express = require('express');
const router = express.Router();
const config = require("../config")
const utils = require("../utils")
const cheerio = require('cheerio');
/**
* 1:首页获取分类数据接口
* 请求示例:http://127.0.0.1:3000/api/index/class?type=1&page=1
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/class
* 请求参数:
* type: 取值1(推荐),2(时令),3(食肉),4(素食),5(烘焙)
* page: 分页页码
*/
router.get('/index/class', function(req, res, next) {
var type = req.query.type || 1;
var page = req.query.page || 1;
utils.GET(config.HomeClassType(type,page),(result)=>{
let data = `${result.match(/jQuery2140868703264037048_1597809875093\(([\s\S]*?)\}\)/)[1]}}`
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: JSON.parse(data).data
});
})
});
/**
* 2:热门推荐
* 请求示例:http://127.0.0.1:3000/api/index/hot
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/hot
* 请求参数:无
*/
router.get('/index/hot', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
let dat = []
$(".con1w .cj_swiper_item").each(function (index,el) {
dat.push({
img: $(this).find(".img").attr("style").match(/background: url\(([\s\S]*?)\) center/)[1],
title: $(this).find(".t").text(),
url: $(this).find("a").attr("href"),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: dat
});
})
});
/**
* 3:每日三餐
* 请求示例:http://127.0.0.1:3000/api/index/threeMeals
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/threeMeals
* 请求参数:无
*/
router.get('/index/threeMeals', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
var titleArray = []
$(".sc_titlew_scroller").eq(0).find("span").each(function(index,el){
titleArray.push({
title: $(this).find("em").text(),
content: []
});
})
var content = {};
$(".top_sancan2019 .swiper-slide").each(function(index,el){
content[index] = [];
$(this).find(".sancan_swiper_item").each(function(i,e){
content[index].push({
url: $(this).find("a").attr("href"),
img: $(this).find("a img").attr("src"),
title: $(this).find("a .text").text(),
des: $(this).find("a .yyw .des").text(),
})
})
});
for (const key in content) {
titleArray[key].content = content[key]
}
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: titleArray
})
})
});
/**
* 4:获取banner图
* 请求示例:http://127.0.0.1:3000/api/index/banner
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/banner
* 请求参数:无
*/
router.get('/index/banner', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
let data = []
$(".swiper-container3 a").each(function (index,el) {
data.push({
url: $(this).attr("href"),
img: $(this).find("img").attr("src"),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 5:获取banner点击后的详情
* 请求示例:http://127.0.0.1:3000/api/index/bannerInfo?url=https://m.meishij.net/zt/chushulaoji6dianyinshiyuanzeyi.html
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/bannerInfo
* 请求参数:
* url:要进入的轮播url地址
*/
router.get('/index/bannerInfo', function(req, res, next) {
let url = req.query.url;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
let data = {}
data.banner = $(".topimgw img").attr("src")
data.title = $(".zttitlew h1").text()
data.content = $(".ztcontentw").html()
data.comment = []
$(".zt_pllist .zt_plitem").each(function (index,el){
data.comment.push({
name: $(this).find(".c1 strong").text(),
time: $(this).find(".c1 span").text(),
img: $(this).find(".c1 .avatarw img").attr("src"),
content: $(this).find(".pltxt").text()
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 6:菜谱视频大全列表
* 请求示例:http://127.0.0.1:3000/api/video/list
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/video/list
* 请求参数:无
*/
router.get('/video/list', function(req, res, next) {
console.log("请求地址:", config.VideoList(1))
var page = req.query.page || 1;
utils.GET(config.VideoList(page),(result)=>{
let data = result.match(/jQuery21408367060449076322_1597835324516\(([\s\S]*?)\)/)[1]
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: JSON.parse(data).data
});
})
});
/**
* 7:搜索接口
* 请求示例:http://127.0.0.1:3000/api/search/list?q=猪蹄&page=1
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/search/list
* 请求参数:
* q 要搜索的菜名称
* page 页码
*/
router.get('/search/list', function(req, res, next) {
var q = req.query.q || '';
var page = req.query.page || 1;
utils.GET(config.SearchWord(encodeURIComponent(q), page),(result)=>{
const $ = cheerio.load(result);
var data = []
$(".hasbb1").each(function (index,el) {
data.push({
href: $(this).find("a").attr("href"),
title: $(this).find("a h3").text(),
des: $(this).find("a .des").text(),
img: $(this).find("a img").attr("src"),
})
});
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 8:分类页面获取左侧分类菜单
* 请求示例:http://127.0.0.1:3000/api/type/leftMenu
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/type/leftMenu
* 请求参数:无
*/
router.get('/type/leftMenu', function(req, res, next) {
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: config.leftType
});
});
/**
* 9:分类页面获取右边的小内容
* 请求示例:http://127.0.0.1:3000/api/type/rightMenu?url=/fenlei/shiyongfenlei/
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/type/rightMenu
* 请求参数:
* url: 左侧分类的url字段
*/
router.get('/type/rightMenu', function(req, res, next) {
let url = `${config.baseUrl}${req.query.url}`;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
let data = []
$(".right_sort_list_scroller ul li a").each(function (index,el) {
data.push({
id: $(this).attr("href"),
img: $(this).find("img").attr("src"),
title: $(this).find("span").text(),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 10:点击右边小分类获取分类列表
* 请求示例:http://127.0.0.1:3000/api/type/rightMenuList?url=https://m.meishij.net/fenlei/recai/
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/type/rightMenuList
* 请求参数:
* url: 右侧分类的url字段
* p: 页码
*/
router.get('/type/rightMenuList', function(req, res, next) {
let url = req.query.url;
let page = req.query.p || 1;
console.log(`${url}p${page}`)
utils.GET(`${url}p${page}`,(result)=>{
const $ = cheerio.load(result);
var data = []
$(".con_data_s2_list").eq(0).find("li a").each(function (index, el){
var num = $(this).find("span").text().split("  ");
console.log(num)
data.push({
url: $(this).attr("href"),
img: $(this).find(".imgw img").attr("src"),
title: $(this).find(".imgw img").attr("alt"),
like: num[0],
view: num[1],
})
});
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 11:获取详情
* 请求示例:http://127.0.0.1:3000/api/index/info?url=https://m.meishij.net/html5/zuofa/douruhezidangao_1.html
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/info
* 请求参数:
* url: 右侧分类的url字段
*/
router.get('/index/info', function(req, res, next) {
let url = req.query.url;
let page = req.query.p || 1;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
var data= {};
if ($(".topimgw").length != 0) {
// 标题
data.title = $(".cpc_c1 h1").text()
// 作者
data.posttime = $(".cpc_c1 .posttime").text()
// 如果有视频
if ($(".topimgw .vw").length != 0) {
data.videoSrc = $(".topimgw .vw #artical_video").attr("src")
}
// 背景图
data.backImg = $(".topimgw img").attr("src");
data.Statistics = []
// 卡路里等
$(".yycardw .yyinfos .yy_left .yy_left_item").each(function (index,el){
data.Statistics.push({
title: $(this).find("strong").text(),
proportion: $(this).find(".jd").attr("style")
})
});
data.stepInfo = {
arr: [],
message: ''
};
var startIndex = 0;
// 图标步骤
$(".cpargsw .cpargs").each(function (index,el){
data.stepInfo.arr.push({
title: $(this).text(),
position: index != 3 ? startIndex+= -30 : -0
})
})
data.stepInfo.message = $(".cpdesw .cpdes").text()
data.material = {
main: [],
accessories: []
}
// 主料
$(".cpc_c3 .c_mtr_ul").eq(0).find(".c_mtr_li").each(function (index,el){
data.material.main.push({
title: $(this).find(".t").text(),
nums: $(this).find(".a").text()
})
})
// 辅料
$(".cpc_c3 .c_mtr_ul").eq(1).find(".c_mtr_li").each(function (index,el){
data.material.accessories.push({
title: $(this).find(".t1").text(),
nums: $(this).find(".a").text()
})
});
// 详细步骤
data.DetailedSteps = [];
$(".cpc_c4 .stepitem").each(function (index,el){
// 如果有成品图的话
if ($(this).find(".doneimgw").length !== 0) {
data.DetailedSteps.push({
step_title: $(this).find(".step_title").text(),
step_img: [],
step_text: null,
})
$(this).find(".doneimgw .imgset img").each(function (i,e){
data.DetailedSteps[index].step_img.push($(this).attr("src"))
})
} else {
data.DetailedSteps.push({
step_title: $(this).find(".step_title").text(),
step_img: $(this).find("img").attr("src") || null,
step_text: $(this).find(".stepdes").text(),
})
}
})
// 其他推荐
data.OtherRecommen = [];
$(".con_data_s1_list li").each(function (i,e){
data.OtherRecommen.push({
url: $(this).find("a").attr("href"),
title: $(this).find("strong").text(),
img: $(this).find("img").attr("src"),
})
})
// 相关推荐
data.RelatedRecommen = [];
$(".con_data_s2_list li").each(function (i,e){
if ($(this).find(".title").text().length !=0) {
data.RelatedRecommen.push({
title: $(this).find(".title").text(),
url: $(this).find("a").attr("href"),
view: $(this).find("span").text(),
img: $(this).find("img").attr("src"),
})
}
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
}
})
});
/**
* 12:获取banner图下面的九宫格分类数据
* 请求示例:http://127.0.0.1:3000/api/index/type
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/type
* 请求参数:
* url: 右侧分类的url字段
* p: 页码
*/
router.get('/index/type', function(req, res, next) {
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: [
{
title: '快手菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_1.png',
href: 'https://m.meishij.net/fenlei/kuaishoucai/'
},
{
title: '下饭菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_2.png',
href: 'https://m.meishij.net/fenlei/xiafancai/'
},
{
title: '肉食',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_5.png',
href: 'https://m.meishij.net/fenlei/roushi/'
},
{
title: '早餐',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_1.png',
href: 'https://m.meishij.net/fenlei/zaocan/'
},
{
title: '午餐',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_2.png',
href: 'https://m.meishij.net/fenlei/wucan/'
},
{
title: '夜宵',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_5.png',
href: 'https://m.meishij.net/fenlei/yexiao/'
},
{
title: '蛋糕面包',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_hongbei_1.png',
href: 'https://m.meishij.net/fenlei/dangaomianbao/'
},
{
title: '甜品点心',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_hongbei_3.png',
href: 'https://m.meishij.net/fenlei/tianpindianxin/'
},
{
title: '热菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_jiachangcaipu_1.png',
href: 'https://m.meishij.net/fenlei/recai/'
},
{
title: '主食',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_jiachangcaipu_6.png',
href: 'https://m.meishij.net/fenlei/zhushi/'
},
]
})
});
module.exports = router;

View File

@@ -0,0 +1,29 @@
const request = require('request');
class Utils {
constructor() {
this.options = {
url: null,
headers: {
'cookie': 'UM_distinctid=1739b1d471719c-04ea6eab4bf6e1-15306653-232800-1739b1d47188c0; Hm_lvt_9c1e85b5953d1badee5da8bbd6e213ef=1597762465; utrace=3E8920170005A7B318D9C35901202D11; Hm_lvt_01dd6a7c493607e115255b7e72de5f40=1597841958; login_redirect=https%3A%2F%2Fm.meishij.net%2Fhtml5%2F; CNZZDATA5955072=cnzz_eid%3D930894285-1596031998-https%253A%252F%252Fm.meishij.net%252F%26ntime%3D1598099253; __SessHandler=7d04ddf7323eb9bbf136f48602011327; last_update_time=1598103324; MSCookieKey=0ad175324d8efd79b3762290113fc7b9.14773285; Wap_ListLastPage_Key=https%253A%252F%252Fmeishij.net%252Fhtml5%252Fzuofa%252Fjiucaihezi_201.html; Hm_lpvt_01dd6a7c493607e115255b7e72de5f40=1598103503; Hm_lvt_01dd6a7c493607e115255b7e72de5f40=1598103503; CNZZDATA1259001544=1736519043-1596031804-%7C1598104578; Hm_lpvt_01dd6a7c493607e115255b7e72de5f40=1598109846',
'referer': 'https://m.meishij.net/',
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1',
'x-requested-with': 'XMLHttpRequest',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
}
};
}
GET(url,callback) {
this.options.url = url;
request(this.options, function (error, response, body){
if (!error && response.statusCode == 200) {
callback(body)
}
});
}
}
module.exports = new Utils()

View File

@@ -0,0 +1,23 @@
html {
font-size: 20px
}
@media only screen and (min-width: 400px) {
html {
font-size: 21.33px !important
}
}
@media only screen and (min-width: 414px) {
html {
font-size: 22.08px !important
}
}
@media only screen and (min-width: 480px) {
html {
font-size: 25.6px !important
}
}

View File

@@ -0,0 +1,41 @@
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var app = express();
app.all('*', function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Content-Type', 'application/json;charset=utf-8');
next();
});
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use('/api', indexRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;

View File

@@ -0,0 +1,87 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('caipu:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
console.log('App is run http://127.0.0.1:'+addr.port);
}

View File

@@ -0,0 +1,85 @@
module.exports = {
baseUrl: 'https://m.meishij.net',
HomeClassType: function (type = 1, page = 1) {
return `https://m.meishij.net/ajax/index_search_new.php?callback=jQuery2140868703264037048_1597809875093&format=json&type=${type}&page=${page}&_=1597809875094`
},
// 菜谱视频大全
VideoList: function (page = 1) {
return `https://m.meishij.net/shipin/index.php?callback=jQuery21408367060449076322_1597835324516&format=json&ajax=1&page=${page}&_=1597835324517`;
},
SearchWord: function (q = '', page = 1) {
return `https://m.meishij.net/search.php?q=${q}&ajax=1&page=${page}`
},
leftType: [
{
url: '/fenlei/shiyongfenlei/',
title: '实用分类',
position: 0,
},
{
url: '/fenlei/meirisancan/',
title: '每日三餐',
position: -50,
},
{
url: '/fenlei/zhushidaquan/',
title: '主食',
position: -75,
},
{
url: '/fenlei/jiachangcaipu/',
title: '家常菜谱',
position: -100,
},
{
url: '/caixi/',
title: '中华菜系',
position: -125,
},
{
url: '/xiaochi/',
title: '各地小吃',
position: -150,
},
{
url: '/fenlei/waiguocaipu/',
title: '外国菜谱',
position: -175,
},
{
url: '/fenlei/hongbei/',
title: '烘焙',
position: -200,
},
{
url: '/renqun/',
title: '人群',
position: -225,
},
{
url: '/fenlei/chuju/',
title: '厨具',
position: -250,
},
{
url: '/fenlei/changjing/',
title: '场景',
position: -275,
},
{
url: '/zangfutiaoli/',
title: '脏腑调理',
position: -325,
},
{
url: '/fenlei/gongyi/',
title: '工艺',
position: -375,
},
{
url: '/fenlei/kouwei/',
title: '口味',
position: -425,
}
],
}

View File

@@ -0,0 +1,841 @@
{
"name": "caipu",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/node": {
"version": "14.6.0",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.6.0.tgz",
"integrity": "sha1-fUQRv1FXM5M318/4ZNn/RfF3tJk="
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz",
"integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"ajv": {
"version": "6.12.4",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.4.tgz?cache=0&sync_timestamp=1597480760804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.4.tgz",
"integrity": "sha1-BhT6zEUiEn+nE0Rca/0+vTduIjQ=",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Farray-flatten%2Fdownload%2Farray-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
"integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=",
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
},
"aws4": {
"version": "1.10.1",
"resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.10.1.tgz?cache=0&sync_timestamp=1597238704875&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.10.1.tgz",
"integrity": "sha1-4eguTz6Zniz9YbFhKA0WoRH4ZCg="
},
"basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/basic-auth/download/basic-auth-2.0.1.tgz",
"integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=",
"requires": {
"safe-buffer": "5.1.2"
}
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"requires": {
"tweetnacl": "^0.14.3"
}
},
"body-parser": {
"version": "1.18.3",
"resolved": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.18.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbody-parser%2Fdownload%2Fbody-parser-1.18.3.tgz",
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "~1.6.3",
"iconv-lite": "0.4.23",
"on-finished": "~2.3.0",
"qs": "6.5.2",
"raw-body": "2.3.3",
"type-is": "~1.6.16"
}
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/boolbase/download/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"cheerio": {
"version": "1.0.0-rc.3",
"resolved": "https://registry.npm.taobao.org/cheerio/download/cheerio-1.0.0-rc.3.tgz",
"integrity": "sha1-CUY21CWy6cD065GkbAVjDJoai/Y=",
"requires": {
"css-select": "~1.2.0",
"dom-serializer": "~0.1.1",
"entities": "~1.1.1",
"htmlparser2": "^3.9.1",
"lodash": "^4.15.0",
"parse5": "^3.0.1"
}
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz",
"integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.2.tgz",
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz",
"integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js="
},
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.4.0.tgz",
"integrity": "sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo="
},
"cookie-parser": {
"version": "1.4.5",
"resolved": "https://registry.npm.taobao.org/cookie-parser/download/cookie-parser-1.4.5.tgz",
"integrity": "sha1-PlctS3wMgPnGHa9gTkM2gxtdHUk=",
"requires": {
"cookie": "0.4.0",
"cookie-signature": "1.0.6"
}
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"css-select": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/css-select/download/css-select-1.2.0.tgz",
"integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
"requires": {
"boolbase": "~1.0.0",
"css-what": "2.1",
"domutils": "1.5.1",
"nth-check": "~1.0.1"
}
},
"css-what": {
"version": "2.1.3",
"resolved": "https://registry.npm.taobao.org/css-what/download/css-what-2.1.3.tgz",
"integrity": "sha1-ptdgRXM2X+dGhsPzEcVlE9iChfI="
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"requires": {
"ms": "2.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"dom-serializer": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/dom-serializer/download/dom-serializer-0.1.1.tgz",
"integrity": "sha1-HsQFnihLq+027sKUHUqXChic58A=",
"requires": {
"domelementtype": "^1.3.0",
"entities": "^1.1.1"
}
},
"domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npm.taobao.org/domelementtype/download/domelementtype-1.3.1.tgz",
"integrity": "sha1-0EjESzew0Qp/Kj1f7j9DM9eQSB8="
},
"domhandler": {
"version": "2.4.2",
"resolved": "https://registry.npm.taobao.org/domhandler/download/domhandler-2.4.2.tgz",
"integrity": "sha1-iAUJfpM9ZehVRvcm1g9euItE+AM=",
"requires": {
"domelementtype": "1"
}
},
"domutils": {
"version": "1.5.1",
"resolved": "https://registry.npm.taobao.org/domutils/download/domutils-1.5.1.tgz?cache=0&sync_timestamp=1597680507221&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdomutils%2Fdownload%2Fdomutils-1.5.1.tgz",
"integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
"requires": {
"dom-serializer": "0",
"domelementtype": "1"
}
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/entities/download/entities-1.1.2.tgz?cache=0&sync_timestamp=1591227679482&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-1.1.2.tgz",
"integrity": "sha1-vfpzUplmTfr9NFKe1PhSKidf6lY="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.16.4",
"resolved": "https://registry.npm.taobao.org/express/download/express-4.16.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpress%2Fdownload%2Fexpress-4.16.4.tgz",
"integrity": "sha1-/d72GSYQniTFFeqX/S8b2/Yt8S4=",
"requires": {
"accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.3",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.4",
"qs": "6.5.2",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.2",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
}
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
"integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz?cache=0&sync_timestamp=1591599651635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-3.1.3.tgz",
"integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM="
},
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.1.tgz",
"integrity": "sha1-7r9O2EAHnIP0JJA4ydcDAIMBsQU=",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
}
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz",
"integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
},
"har-validator": {
"version": "5.1.5",
"resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.5.tgz?cache=0&sync_timestamp=1596082653557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhar-validator%2Fdownload%2Fhar-validator-5.1.5.tgz",
"integrity": "sha1-HwgDufjLIMD6E4It8ezds2veHv0=",
"requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
}
},
"htmlparser2": {
"version": "3.10.1",
"resolved": "https://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1582422905208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz",
"integrity": "sha1-vWedw/WYl7ajS7EHSchVu1OpOS8=",
"requires": {
"domelementtype": "^1.3.1",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.1.1"
}
},
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.3.tgz?cache=0&sync_timestamp=1593407710477&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-errors%2Fdownload%2Fhttp-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"iconv-lite": {
"version": "0.4.23",
"resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.23.tgz",
"integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.9.1.tgz",
"integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM="
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz",
"integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA="
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.20.tgz?cache=0&sync_timestamp=1597336001963&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.20.tgz",
"integrity": "sha1-tEqbYpe8tpjxxRo1RaKzs2jVnFI="
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/mime/download/mime-1.4.1.tgz",
"integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY="
},
"mime-db": {
"version": "1.44.0",
"resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz",
"integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I="
},
"mime-types": {
"version": "2.1.27",
"resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.27.tgz",
"integrity": "sha1-R5SfmOJ56lMRn1ci4PNOUpvsAJ8=",
"requires": {
"mime-db": "1.44.0"
}
},
"morgan": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/morgan/download/morgan-1.9.1.tgz",
"integrity": "sha1-Co0Wc0odmvvIJLmd+H5zjlji2lk=",
"requires": {
"basic-auth": "~2.0.0",
"debug": "2.6.9",
"depd": "~1.1.2",
"on-finished": "~2.3.0",
"on-headers": "~1.0.1"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.2.tgz",
"integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs="
},
"nth-check": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/nth-check/download/nth-check-1.0.2.tgz",
"integrity": "sha1-sr0pXDfj3VijvwcAN2Zjuk2c8Fw=",
"requires": {
"boolbase": "~1.0.0"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz",
"integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"on-headers": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.2.tgz",
"integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8="
},
"parse5": {
"version": "3.0.3",
"resolved": "https://registry.npm.taobao.org/parse5/download/parse5-3.0.3.tgz?cache=0&sync_timestamp=1595849319979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fparse5%2Fdownload%2Fparse5-3.0.3.tgz",
"integrity": "sha1-BC95L/3TaFFVHPTp4Gazh0q0W1w=",
"requires": {
"@types/node": "*"
}
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz",
"integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz?cache=0&sync_timestamp=1574278262588&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-to-regexp%2Fdownload%2Fpath-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-2.0.6.tgz",
"integrity": "sha1-/cIzZQVEfT8vLGOO0nLK9hS7sr8=",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.1"
}
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz",
"integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ="
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz",
"integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE="
},
"raw-body": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.3.3.tgz",
"integrity": "sha1-GzJOzmtXBuFThVvBFIxlu39uoMM=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.23",
"unpipe": "1.0.0"
}
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-3.6.0.tgz",
"integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"request": {
"version": "2.88.2",
"resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz",
"integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz",
"integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
},
"send": {
"version": "0.16.2",
"resolved": "https://registry.npm.taobao.org/send/download/send-0.16.2.tgz",
"integrity": "sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
}
},
"serve-static": {
"version": "1.13.2",
"resolved": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.13.2.tgz",
"integrity": "sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.2"
}
},
"setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.0.tgz",
"integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY="
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz",
"integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=",
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"statuses": {
"version": "1.4.0",
"resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz",
"integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic="
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.3.0.tgz",
"integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=",
"requires": {
"safe-buffer": "~5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz",
"integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY="
}
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz",
"integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=",
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.18.tgz",
"integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
"integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=",
"requires": {
"punycode": "^2.1.0"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz?cache=0&sync_timestamp=1595886825323&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz",
"integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
}
}
}

View File

@@ -0,0 +1,17 @@
{
"name": "caipu",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node-dev ./bin/www"
},
"dependencies": {
"cheerio": "^1.0.0-rc.3",
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"http-errors": "~1.6.3",
"morgan": "~1.9.1",
"request": "^2.88.2"
}
}

View File

@@ -0,0 +1,512 @@
const express = require('express');
const router = express.Router();
const config = require("../config")
const utils = require("../utils")
const cheerio = require('cheerio');
/**
* 1:首页获取分类数据接口
* 请求示例:http://127.0.0.1:3000/api/index/class?type=1&page=1
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/class
* 请求参数:
* type: 取值1(推荐),2(时令),3(食肉),4(素食),5(烘焙)
* page: 分页页码
*/
router.get('/index/class', function(req, res, next) {
var type = req.query.type || 1;
var page = req.query.page || 1;
utils.GET(config.HomeClassType(type,page),(result)=>{
let data = `${result.match(/jQuery2140868703264037048_1597809875093\(([\s\S]*?)\}\)/)[1]}}`
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: JSON.parse(data).data
});
})
});
/**
* 2:热门推荐
* 请求示例:http://127.0.0.1:3000/api/index/hot
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/hot
* 请求参数:无
*/
router.get('/index/hot', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
let dat = []
$(".con1w .cj_swiper_item").each(function (index,el) {
dat.push({
img: $(this).find(".img").attr("style").match(/background: url\(([\s\S]*?)\) center/)[1],
title: $(this).find(".t").text(),
url: $(this).find("a").attr("href"),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: dat
});
})
});
/**
* 3:每日三餐
* 请求示例:http://127.0.0.1:3000/api/index/threeMeals
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/threeMeals
* 请求参数:无
*/
router.get('/index/threeMeals', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
var titleArray = []
$(".sc_titlew_scroller").eq(0).find("span").each(function(index,el){
titleArray.push({
title: $(this).find("em").text(),
content: []
});
})
var content = {};
$(".top_sancan2019 .swiper-slide").each(function(index,el){
content[index] = [];
$(this).find(".sancan_swiper_item").each(function(i,e){
content[index].push({
url: $(this).find("a").attr("href"),
img: $(this).find("a img").attr("src"),
title: $(this).find("a .text").text(),
des: $(this).find("a .yyw .des").text(),
})
})
});
for (const key in content) {
titleArray[key].content = content[key]
}
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: titleArray
})
})
});
/**
* 4:获取banner图
* 请求示例:http://127.0.0.1:3000/api/index/banner
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/banner
* 请求参数:无
*/
router.get('/index/banner', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
let data = []
$(".swiper-container3 a").each(function (index,el) {
data.push({
url: $(this).attr("href"),
img: $(this).find("img").attr("src"),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 5:获取banner点击后的详情
* 请求示例:http://127.0.0.1:3000/api/index/bannerInfo?url=https://m.meishij.net/zt/chushulaoji6dianyinshiyuanzeyi.html
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/bannerInfo
* 请求参数:
* url:要进入的轮播url地址
*/
router.get('/index/bannerInfo', function(req, res, next) {
let url = req.query.url;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
let data = {}
data.banner = $(".topimgw img").attr("src")
data.title = $(".zttitlew h1").text()
data.content = $(".ztcontentw").html()
data.comment = []
$(".zt_pllist .zt_plitem").each(function (index,el){
data.comment.push({
name: $(this).find(".c1 strong").text(),
time: $(this).find(".c1 span").text(),
img: $(this).find(".c1 .avatarw img").attr("src"),
content: $(this).find(".pltxt").text()
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 6:菜谱视频大全列表
* 请求示例:http://127.0.0.1:3000/api/video/list
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/video/list
* 请求参数:无
*/
router.get('/video/list', function(req, res, next) {
console.log("请求地址:", config.VideoList(1))
var page = req.query.page || 1;
utils.GET(config.VideoList(page),(result)=>{
let data = result.match(/jQuery21408367060449076322_1597835324516\(([\s\S]*?)\)/)[1]
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: JSON.parse(data).data
});
})
});
/**
* 7:搜索接口
* 请求示例:http://127.0.0.1:3000/api/search/list?q=猪蹄&page=1
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/search/list
* 请求参数:
* q 要搜索的菜名称
* page 页码
*/
router.get('/search/list', function(req, res, next) {
var q = req.query.q || '';
var page = req.query.page || 1;
utils.GET(config.SearchWord(encodeURIComponent(q), page),(result)=>{
const $ = cheerio.load(result);
var data = []
$(".hasbb1").each(function (index,el) {
data.push({
href: $(this).find("a").attr("href"),
title: $(this).find("a h3").text(),
des: $(this).find("a .des").text(),
img: $(this).find("a img").attr("src"),
})
});
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 8:分类页面获取左侧分类菜单
* 请求示例:http://127.0.0.1:3000/api/type/leftMenu
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/type/leftMenu
* 请求参数:无
*/
router.get('/type/leftMenu', function(req, res, next) {
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: config.leftType
});
});
/**
* 9:分类页面获取右边的小内容
* 请求示例:http://127.0.0.1:3000/api/type/rightMenu?url=/fenlei/shiyongfenlei/
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/type/rightMenu
* 请求参数:
* url: 左侧分类的url字段
*/
router.get('/type/rightMenu', function(req, res, next) {
let url = `${config.baseUrl}${req.query.url}`;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
let data = []
$(".right_sort_list_scroller ul li a").each(function (index,el) {
data.push({
id: $(this).attr("href"),
img: $(this).find("img").attr("src"),
title: $(this).find("span").text(),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 10:点击右边小分类获取分类列表
* 请求示例:http://127.0.0.1:3000/api/type/rightMenuList?url=https://m.meishij.net/fenlei/recai/
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/type/rightMenuList
* 请求参数:
* url: 右侧分类的url字段
* p: 页码
*/
router.get('/type/rightMenuList', function(req, res, next) {
let url = req.query.url;
let page = req.query.p || 1;
console.log(`${url}p${page}`)
utils.GET(`${url}p${page}`,(result)=>{
const $ = cheerio.load(result);
var data = []
$(".con_data_s2_list").eq(0).find("li a").each(function (index, el){
var num = $(this).find("span").text().split("  ");
console.log(num)
data.push({
url: $(this).attr("href"),
img: $(this).find(".imgw img").attr("src"),
title: $(this).find(".imgw img").attr("alt"),
like: num[0],
view: num[1],
})
});
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 11:获取详情
* 请求示例:http://127.0.0.1:3000/api/index/info?url=https://m.meishij.net/html5/zuofa/douruhezidangao_1.html
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/info
* 请求参数:
* url: 右侧分类的url字段
*/
router.get('/index/info', function(req, res, next) {
let url = req.query.url;
let page = req.query.p || 1;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
var data= {};
if ($(".topimgw").length != 0) {
// 标题
data.title = $(".cpc_c1 h1").text()
// 作者
data.posttime = $(".cpc_c1 .posttime").text()
// 如果有视频
if ($(".topimgw .vw").length != 0) {
data.videoSrc = $(".topimgw .vw #artical_video").attr("src")
}
// 背景图
data.backImg = $(".topimgw img").attr("src");
data.Statistics = []
// 卡路里等
$(".yycardw .yyinfos .yy_left .yy_left_item").each(function (index,el){
data.Statistics.push({
title: $(this).find("strong").text(),
proportion: $(this).find(".jd").attr("style")
})
});
data.stepInfo = {
arr: [],
message: ''
};
var startIndex = 0;
// 图标步骤
$(".cpargsw .cpargs").each(function (index,el){
data.stepInfo.arr.push({
title: $(this).text(),
position: index != 3 ? startIndex+= -30 : -0
})
})
data.stepInfo.message = $(".cpdesw .cpdes").text()
data.material = {
main: [],
accessories: []
}
// 主料
$(".cpc_c3 .c_mtr_ul").eq(0).find(".c_mtr_li").each(function (index,el){
data.material.main.push({
title: $(this).find(".t").text(),
nums: $(this).find(".a").text()
})
})
// 辅料
$(".cpc_c3 .c_mtr_ul").eq(1).find(".c_mtr_li").each(function (index,el){
data.material.accessories.push({
title: $(this).find(".t1").text(),
nums: $(this).find(".a").text()
})
});
// 详细步骤
data.DetailedSteps = [];
$(".cpc_c4 .stepitem").each(function (index,el){
// 如果有成品图的话
if ($(this).find(".doneimgw").length !== 0) {
data.DetailedSteps.push({
step_title: $(this).find(".step_title").text(),
step_img: [],
step_text: null,
})
$(this).find(".doneimgw .imgset img").each(function (i,e){
data.DetailedSteps[index].step_img.push($(this).attr("src"))
})
} else {
data.DetailedSteps.push({
step_title: $(this).find(".step_title").text(),
step_img: $(this).find("img").attr("src") || null,
step_text: $(this).find(".stepdes").text(),
})
}
})
// 其他推荐
data.OtherRecommen = [];
$(".con_data_s1_list li").each(function (i,e){
data.OtherRecommen.push({
url: $(this).find("a").attr("href"),
title: $(this).find("strong").text(),
img: $(this).find("img").attr("src"),
})
})
// 相关推荐
data.RelatedRecommen = [];
$(".con_data_s2_list li").each(function (i,e){
if ($(this).find(".title").text().length !=0) {
data.RelatedRecommen.push({
title: $(this).find(".title").text(),
url: $(this).find("a").attr("href"),
view: $(this).find("span").text(),
img: $(this).find("img").attr("src"),
})
}
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
}
})
});
/**
* 12:获取banner图下面的九宫格分类数据
* 请求示例:http://127.0.0.1:3000/api/index/type
* 接口基地址:http://127.0.0.1:3000/
* 请求地址:/index/type
* 请求参数:
* url: 右侧分类的url字段
* p: 页码
*/
router.get('/index/type', function(req, res, next) {
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: [
{
title: '快手菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_1.png',
href: 'https://m.meishij.net/fenlei/kuaishoucai/'
},
{
title: '下饭菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_2.png',
href: 'https://m.meishij.net/fenlei/xiafancai/'
},
{
title: '肉食',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_5.png',
href: 'https://m.meishij.net/fenlei/roushi/'
},
{
title: '早餐',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_1.png',
href: 'https://m.meishij.net/fenlei/zaocan/'
},
{
title: '午餐',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_2.png',
href: 'https://m.meishij.net/fenlei/wucan/'
},
{
title: '夜宵',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_5.png',
href: 'https://m.meishij.net/fenlei/yexiao/'
},
{
title: '蛋糕面包',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_hongbei_1.png',
href: 'https://m.meishij.net/fenlei/dangaomianbao/'
},
{
title: '甜品点心',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_hongbei_3.png',
href: 'https://m.meishij.net/fenlei/tianpindianxin/'
},
{
title: '热菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_jiachangcaipu_1.png',
href: 'https://m.meishij.net/fenlei/recai/'
},
{
title: '主食',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_jiachangcaipu_6.png',
href: 'https://m.meishij.net/fenlei/zhushi/'
},
]
})
});
module.exports = router;

View File

@@ -0,0 +1,29 @@
const request = require('request');
class Utils {
constructor() {
this.options = {
url: null,
headers: {
'cookie': 'UM_distinctid=1739b1d471719c-04ea6eab4bf6e1-15306653-232800-1739b1d47188c0; Hm_lvt_9c1e85b5953d1badee5da8bbd6e213ef=1597762465; utrace=3E8920170005A7B318D9C35901202D11; Hm_lvt_01dd6a7c493607e115255b7e72de5f40=1597841958; login_redirect=https%3A%2F%2Fm.meishij.net%2Fhtml5%2F; CNZZDATA5955072=cnzz_eid%3D930894285-1596031998-https%253A%252F%252Fm.meishij.net%252F%26ntime%3D1598099253; __SessHandler=7d04ddf7323eb9bbf136f48602011327; last_update_time=1598103324; MSCookieKey=0ad175324d8efd79b3762290113fc7b9.14773285; Wap_ListLastPage_Key=https%253A%252F%252Fmeishij.net%252Fhtml5%252Fzuofa%252Fjiucaihezi_201.html; Hm_lpvt_01dd6a7c493607e115255b7e72de5f40=1598103503; Hm_lvt_01dd6a7c493607e115255b7e72de5f40=1598103503; CNZZDATA1259001544=1736519043-1596031804-%7C1598104578; Hm_lpvt_01dd6a7c493607e115255b7e72de5f40=1598109846',
'referer': 'https://m.meishij.net/',
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1',
'x-requested-with': 'XMLHttpRequest',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
}
};
}
GET(url,callback) {
this.options.url = url;
request(this.options, function (error, response, body){
if (!error && response.statusCode == 200) {
callback(body)
}
});
}
}
module.exports = new Utils()

View File

@@ -0,0 +1,230 @@
/* 头部css */
.menu{
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height:3.75rem;
z-index: 2;
background: #fff;
align-items: center;
display: flex;
box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
/* 头部搜索框css */
.menu input[type="text"]{
border: none;
height: 2rem;
width: 17.15rem;
display: block;
background: #f5f5f5;
border-radius: 50rem;
margin: 0 auto;
font-size: 0.8rem;
padding-left: 1rem;
color: #555;
line-height: 2rem;
align-content: center;
}
/* 内容css */
.content{
padding:3.75rem 0.45rem ;
box-sizing: border-box;
overflow: hidden;
}
.swiper-slide a img{
width: 100%;
}
/* 菜单css */
.menus{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.menus li{
width: 20%;
}
.menus a img{
width: 2.5rem;
}
.menus a{
display: block;
font-size:.6rem ;
color: #666;
text-align: center;
margin-top: 0.5rem;
}
/* 每日三餐css */
.mrsc_t{
padding: 1.6rem 0.8rem 0.8rem;
}
.mrsc_t p{
font-size: 0.8rem;
color: #666;
margin: 0.75rem 0;
}
.mrsc ul{
display: flex;
justify-content: center;
/* padding: 1.5rem 0.5rem; */
box-sizing: border-box;
}
.mrsc ul li{
color: #666;
width: 20%;
font-size: .8rem;
}
.mrsc ul .li_active::after,
.do_together_title .active::after {
content: '';
height: .3rem;
border-radius: .15rem;
width: 100%;
left: 0px;
bottom: .15rem;
background: #ff9d9b;
position: absolute;
z-index: 50;
display: block;
}
.li_active{
color: #666;
width: 20%;
border-bottom: 6px solid;
border-block-color: #ccc;
border-radius: 4px;
font-size: 0.8rem;
color: #333;
}
/* 每日三餐轮播 */
.ms_img{
margin: 1rem 0.25rem;
box-shadow: 0 3px 6px rgba(0,0,0,0.1);
border-radius:0.35rem ;
overflow: hidden;
width:8.375rem;
float: left;
box-sizing: border-box;
}
.ms_img a img{
width: 100%;
height:11.15rem;
width:8.375rem;
}
.img_t{
padding-left: 0.5rem;
box-sizing: border-box;
margin:0px 0.5rem 0.5rem 0rem;
}
.ms_img p{
font-size: 0.9rem;
color: #000;
font-weight: bolder;
/* 文字超出部分省略号 */
width: 8rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0.5rem 0rem;
}
.yang{
width: 0.7rem;
height: 0.7rem;
background: #ff8d8d;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0.15rem;
}
.yang span{
font-size: 0.4rem;
color: #fff;
font-weight: bolder;
}
.b_t{
height: 1.1rem;
width: 5.55rem;
display: flex;
justify-content: center;
align-items: center;
background: rgb(245, 235, 235);
border-radius: 0.15rem;
margin: 0.5rem 0rem;
}
.b_t span{
font-size: 0.55rem;
color: #ff8d8d;
}
.tf{
display: flex;
justify-content: space-between;
}
.tf_l{}
.tf_r span{
font-size:0.45rem;
}
.tf_l img{
width: 0.9rem !important;
height: 0.9rem !important;
border-radius: 50%;
}
.tf_l span{
font-size: 0.45rem;
color: #333;
}
.spance_bottom{
height: 3.5rem;
width: 100%;
background: #000;
}
/* 底部css */
.footer{
position: fixed;
bottom: 0;
height: 3.5rem;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem;
box-sizing: border-box;
z-index: 999;
background: #fff;
box-shadow: 3px 3px 3px 6px rgba(0,0,0,0.1);
}
.footer a img{
width: 1.5rem;
height: 1.5rem;
}
.footer a{
color: #333;
font-size: 0.75rem;
}
.footer a p{
margin-top: 0.05rem;
}

View File

@@ -0,0 +1,10 @@
body,a,ul,li {
margin: 0;
padding: 0;
list-style: none ;
text-decoration: none;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
html{
font-size: 20px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
.content_t{
/* width: 4rem; */
width:100%;
display: flex;
margin-top: 4rem;
}
.back_img{
background-image: url(https://s1.st.meishij.net/p2/20191108/20191108113258_481.png);
/* width: 100%; */
background-size: 1.25rem 25rem;
height: 1.25rem;
width: 1.25rem;
background-repeat: no-repeat;
margin-top: .3rem;
}
.left_menu ul{
white-space: nowrap;/*文本不会换行,文本会在在同一行上继续*/
overflow-y:auto;/*可滑动*/
}
.left_menu li{
width: 4rem;
height: 3.5rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
/* overflow-y:auto; */
}
.left_menu li p{
font-size:0.6rem;
}
/* 内容右边 */
.right_content{
/* width: calc(100%-2rem); */
width: 100%;
height: 100px;
background: #ccd;
}

View File

@@ -0,0 +1,203 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<link rel="stylesheet" type="text/css" href="./css/index.css">
<link rel="stylesheet" type="text/css" href="./css/public.css">
<link rel="stylesheet" type="text/css" href="./css/clear.css">
<link rel="stylesheet" type="text/css" href="./css/swiper-bundle.min.css">
<link rel="stylesheet" type="text/css" href="./plugin/aui/css/aui.css">
<body>
<!-- 头部 -->
<div class="menu">
<input type="text" value="" placeholder="搜索百万免费菜谱">
</div>
<!-- 内容 -->
<div class="content">
<!-- 内容第一个轮播 -->
<div class="swiper-container banner_swiper">
<div class="swiper-wrapper ">
</div>
<!-- 如果需要分页器 -->
<div class="swiper-pagination"></div>
<!-- 如果需要导航
按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<!-- 如果需要滚动条 -->
<div class="swiper-scrollbar"></div>
</div>
<!-- 菜单 -->
<ul class="menus">
</ul>
<!-- 每日三餐 -->
<div class="mrsc mrsc_item">
<div class="mrsc_t">
<p>每日三餐</p>
<ul>
</ul>
</div>
<div class="swiper-container mrsc_swiper sc">
<div class="swiper-wrapper">
</div>
</div>
</div>
<!-- 第二个轮播 -->
<div class="swiper-container mrsc_swiper ">
<div class="swiper-wrapper">
</div>
<!-- 下方内容循环 -->
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<!-- 为你推荐 -->
<div class="recommend padding">
<div class="recommend_title">为你推荐</div>
<ul>
<li class="recommend_active">
<a href="">
<img src="../img/t_1.png" alt="">
<span>每日优惠</span>
</a>
</li>
<li>
<a href="">
<img src="../img/t_2.png" alt="">
<span>食材大全</span>
</a>
</li>
<li>
<a href="">
<img src="../img/t_3.png" alt="">
<span>热门专题</span>
</a>
</li>
<li>
<a href="">
<img src="../img/t_4.png" alt="">
<span>菜谱分类</span>
</a>
</li>
<li>
<a href="">
<img src="../img/t_5.png" alt="">
<span>本周流行</span>
</a>
</li>
<li>
<a href="">
<img src="../img/t_6.png" alt="">
<span>视频菜谱</span>
</a>
</li>
</ul>
</div>
<!-- 大家都在做 -->
<div class="mrsc">
<div class="mrsc_t ">
<p>大家都在做</p>
<ul class="do_together_title">
</ul>
</div>
</div>
<ul class="do_together_title">
</ul>
<div class="ms_img">
<a href="#">
<img src="https://st-cn.meishij.net/r/53/149/2912303/s2912303_149308557220266.jpg" alt="">
<div class="img_t">
<p>超受欢迎的蔬菜素烩汤</p>
<div class="yang">
<span>养</span>
</div>
<div class="b_t">
<span>鲜香可口,美味下饭</span>
</div>
<div class="tf">
<div class="tf_l">
<img src="https://st-cn.meishij.net/user/68/143/ns13598318_155093722619492.jpg" alt="">
<span>阿言美食</span>
</div>
<div class="tf_r">
<i class="icon-font icon-yanjing"></i>
<span>3</span>
</div>
</div>
</div>
</a>
</div>
</div>
<!-- 底部菜单 -->
<div class="footer">
<a href="#">
<img src="https://st-cn.meishij.net/p2/20190805/20190805211654_179.png">
<p>推荐</p>
</a>
<a href="#">
<img src="https://st-cn.meishij.net/p2/20190805/20190805211654_179.png">
<p>推荐</p>
</a>
<a href="#">
<img src="https://st-cn.meishij.net/p2/20190805/20190805211654_179.png">
<p>推荐</p>
</a>
<a href="#">
<img src="https://st-cn.meishij.net/p2/20190805/20190805211654_179.png">
<p>推荐</p>
</a>
<a href="#">
<img src="https://st-cn.meishij.net/p2/20190805/20190805211654_179.png">
<p>推荐</p>
</a>
</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="./js/swiper-bundle.min.js"></script>
<script src="./plugin/aui/js/aui-toast.js"></script>
<script src="./plugin/aui/js/aui-scroll.js"></script>
<script src="./config/index.js"></script>
<script src="./js/utils/ajax.js"></script>
<script src="./service/index.js"></script>
<script src="./page/index.js"></script>
</html>

View File

@@ -0,0 +1,288 @@
// class Index {
// constructor() {
// this.index = 0;
// this.doTogetherData = [
// {
// type: 1,
// title: '推荐',
// content: [],
// page: 1
// },
// {
// type: 2,
// title: '时令',
// content: [],
// page: 1
// },
// {
// type: 3,
// title: '食肉',
// content: [],
// page: 1
// },
// {
// type: 4,
// title: '素食',
// content: [],
// page: 1
// },
// {
// type: 5,
// title: '烘焙',
// content: [],
// page: 1
// }
// ];
// this.getBannerList();
// this.renderMenu();
// this.getThreeMeals();
// this.renderDoTogether();
// this.DoTogether();
// this.scrollLoadData();
// }
// /**
// * 获取轮播图列表
// */
// async getBannerList() {
// var banner = $(".banner_swiper .swiper-wrapper");
// let res = await indexService.bannerIndex({ id: 1 });
// res.forEach((val,index) => {
// banner.append(`
// <div class="swiper-slide">
// <a href="bannerInfo.html?url=${val.url}">
// <img src="${val.img}" alt=""/>
// </a>
// </div>
// `)
// });
// this.initBannerSwiper();
// }
// // 初始化banner轮播图
// initBannerSwiper() {
// var mySwiper = new Swiper('.banner_swiper', {
// direction: 'horizontal',
// loop: true,
// // 如果需要分页器
// pagination: {
// el: '.swiper-pagination',
// }
// })
// }
// async getThreeMeals() {
// var mrscUl = $(".mrsc ul");
// var mrscSwiper = $(".mrsc_swiper .swiper-wrapper");
// let res = await indexService.threeMeals({});
// console.log(res)
// res.forEach((val,index)=>{
// mrscUl.append(`
// <li class="${index==0? 'active': ''}">${val.title}</li>
// `)
// mrscSwiper.append(
// `<div class="swiper-slide">
// <div class="mrsc_list">
// </div>
// </div>
// `
// );
// val.content.forEach((v,i)=>{
// $(".mrsc_swiper .swiper-wrapper .mrsc_list")
// .eq(index).append(
// `<div class="mrsc_list_item">
// <img src="${v.img}" alt="">
// <p class="tips_titles">${v.title}</p>
// <span class="tips_text">养</span>
// <p class="tips">${v.des}</p>
// </div>
// `
// );
// })
// });
// this.initMrsc()
// }
// initMrsc() {
// var MrscUl = $(".mrsc ul li");
// var MrscSwiper = new Swiper('.mrsc_swiper', {
// direction: 'horizontal',
// on: {
// slideChangeTransitionEnd: function(){
// console.log(this.activeIndex);
// MrscUl.eq(this.activeIndex).addClass("active").siblings().removeClass("active")
// },
// },
// });
// MrscUl.each(function(i,e) {
// $(this).on("click", function() {
// MrscSwiper.slideTo(i)
// });
// });
// }
// async renderMenu() {
// let res = await indexService.type({});
// console.log(res)
// res.forEach((v,i)=>{
// $(".menu").append(`
// <li>
// <a href="./info.html?url=${v.href}">
// <img src="${v.img}" alt="">
// <p>${v.title}</p>
// </a>
// </li>
// `)
// })
// }
// /**
// * 渲染内容的
// * @returns {Promise<void>}
// * @constructor
// */
// async DoTogether() {
// let res = await indexService.indexClass({
// type: this.doTogetherData[this.index].type,
// page: this.doTogetherData[this.index].page
// });
// this.doTogetherData[this.index].content
// = [ ...this.doTogetherData[this.index].content, ...res.items ]
// $(".do_together_content .roll_father").eq(this.index).empty()
// // 渲染列表的
// this.doTogetherData[this.index].content.forEach((v,i)=>{
// $(".do_together_content .roll_father").eq(this.index).append(`
// <div class="do_together_item"
// style="height: ${ typeof v.img == 'string' ? 'auto' : '12rem !important' }">
// <div class="item_img">
// ${
// typeof v.img == 'string'
// ? `<img src="${v.img}" alt="">`
// : `<img src="${v.img[0]}" alt="">`
// }
// </div>
// <div class="item_padd">
// <div class="tips_titles">${v.title}</div>
// <span class="tips_text">养</span>
// ${
// v.label == null || v.label.length == 0
// ? ''
// : `<p class="tips">${v.label.desc}</p>`
// }
// </div>
// ${
// v.author.hasOwnProperty("avatar_url")
// ? `<div class="item_avatr item_pa">
// <div class="avatr_left">
// <img src="${v.author.avatar_url}" alt="">
// <span>${v.author.nickname}</span>
// </div>
// <div class="avatr_view">
// <i class="iconfont icon-yanjing"></i>
// <span>${v.viewed_amount}</span>
// </div>
// </div>`
// : ''
// }
// </div>
// `)
// })
// // console.log("RenderDoTogether: ", res);
// }
// /**
// * 渲染标题
// */
// renderDoTogether() {
// this.doTogetherData.forEach((v,i)=>{
// $(".do_together_title").append(`
// <li class="${i==0?'active':''}">${v.title}</li>
// `);
// $(".do_together_content").append(`
// <div class="roll_father ${i==0?'showRoll':''}"></div>
// `)
// });
// var titleLi = $(".do_together_title li"),
// RollFather = $(".do_together_content .roll_father");
// var a = this;
// titleLi.on('click', function () {
// a.index = $(this).index();
// $(this).addClass("active").siblings().removeClass("active")
// if (a.doTogetherData[a.index].content.length == 0) {
// a.DoTogether()
// }
// RollFather.eq($(this).index()).addClass("showRoll").siblings().removeClass("showRoll")
// })
// }
// scrollLoadData() {
// var scroll = new auiScroll({
// listen:true,
// distance: 10 //判断到达底部的距离,isToBottom为true
// }, (ret) => {
// if(ret.isToBottom){
// console.log("滚动到底部")
// this.doTogetherData[this.index].page += 1;
// this.DoTogether()
// }
// });
// }
// }
class Index {
constructor() {
this.initSwiper()
}
initSwiper() {
var mySwiper = new Swiper('.swiper-container', {
direction: 'horizontal', // 垂直切换选项
loop: true, // 循环模式选项
// 如果需要分页器
pagination: {
el: '.swiper-pagination',
},
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
// 如果需要滚动条
scrollbar: {
el: '.swiper-scrollbar',
},
})
}
}
new Index()

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
function http(option) {
return new Promise(function(resolve,reject) {
$.ajax({
type: option.type,
url: `${Config.BaseUrl}${option.url}`,
data: option.data,
success: function(res) {
if (res.status == 200) {
resolve(res.result)
} else {
alert(res.message)
}
},
error: function(err) {
reject(err);
},
})
});
}

View File

@@ -0,0 +1,263 @@
class Index {
constructor() {
this.index = 0;
this.doTogetherData = [
{
type: 1,
title: '推荐',
content: [],
page: 1
},
{
type: 2,
title: '时令',
content: [],
page: 1
},
{
type: 3,
title: '食肉',
content: [],
page: 1
},
{
type: 4,
title: '素食',
content: [],
page: 1
},
{
type: 5,
title: '烘焙',
content: [],
page: 1
}
];
this.getBannerList();
this.renderMenu();
this.getThreeMeals();
this.renderDoTogether();
this.DoTogether();
this.scrollLoadData();
}
/**
* 获取轮播图列表
*/
async getBannerList() {
var banner = $(".banner_swiper .swiper-wrapper");
let res = await indexService.bannerIndex({ id: 1 });
res.forEach((val,index) => {
banner.append(`
<div class="swiper-slide">
<a href="info.html?url=${val.url}">
<img src="${val.img}" alt=""/>
</a>
</div>
`)
});
this.initBannerSwiper();
}
// 初始化banner轮播图
initBannerSwiper() {
var mySwiper = new Swiper('.banner_swiper', {
direction: 'horizontal',
loop: true,
// 如果需要分页器
pagination: {
el: '.swiper-pagination',
}
})
}
async getThreeMeals() {
var mrscUl = $(".mrsc_item ul");
var mrscSwiper = $(".mrsc_swiper .swiper-wrapper");
let res = await indexService.threeMeals({});
console.log(res)
res.forEach((val,index)=>{
mrscUl.append(`
<li class="${index==0? 'active': ''}">${val.title}</li>
`)
mrscSwiper.append(
`<div class="swiper-slide">
<div class="">
</div>
</div>
`
);
val.content.forEach((v,i)=>{
$(".sc .swiper-wrapper .swiper-slide ")
.eq(index).append(
`
<div class="ms_img">
<a href="#">
<img src="${v.img}" alt="">
<div class="img_t">
<p>${v.title}</p>
<div class="yang"><span>养</span></div>
<div class="b_t"><span>${v.des}</span></div>
</div>
</a>
</div>
`
);
})
});
this.initMrsc()
}
initMrsc() {
var MrscUl = $(".mrsc ul li");
var MrscSwiper = new Swiper('.mrsc_swiper', {
direction: 'horizontal',
on: {
slideChangeTransitionEnd: function(){
console.log(this.activeIndex);
MrscUl.eq(this.activeIndex).addClass("active").siblings().removeClass("active")
},
},
});
MrscUl.each(function(i,e) {
$(this).on("click", function() {
MrscSwiper.slideTo(i)
});
});
}
async renderMenu() {
let res = await indexService.type({});
console.log(res)
console.log(v.href)
res.forEach((v,i)=>{
$(".menus").append(`
<li>
<a href="./info.html?url=${v.href}">
<img src="${v.img}" alt="">
<p>${v.title}</p>
</a>
</li>
`)
})
}
/**
* 渲染内容的
* @returns {Promise<void>}
* @constructor
*/
async DoTogether() {
let res = await indexService.indexClass({
type: this.doTogetherData[this.index].type,
page: this.doTogetherData[this.index].page
});
this.doTogetherData[this.index].content
= [ ...this.doTogetherData[this.index].content, ...res.items ]
$(".do_together_content .roll_father").eq(this.index).empty()
// 渲染列表的
this.doTogetherData[this.index].content.forEach((v,i)=>{
$(".do_together_content .roll_father").eq(this.index).append(`
<div class="do_together_item"
style="height: ${ typeof v.img == 'string' ? 'auto' : '12rem !important' }">
<a href="info.html?url=${v.path}">
<div class="item_img">
${
typeof v.img == 'string'
? `<img src="${v.img}" alt="">`
: `<img src="${v.img[0]}" alt="">`
}
</div>
<div class="item_padd">
<div class="tips_titles">${v.title}</div>
<span class="tips_text">养</span>
${
v.label == null || v.label.length == 0
? ''
: `<p class="tips">${v.label.desc}</p>`
}
</div>
${
v.author.hasOwnProperty("avatar_url")
? `<div class="item_avatr item_pa">
<div class="avatr_left">
<img src="${v.author.avatar_url}" alt="">
<span>${v.author.nickname}</span>
</div>
<div class="avatr_view">
<i class="iconfont icon-yanjing"></i>
<span>${v.viewed_amount}</span>
</div>
</div>`
: ''
}
</div>
</a>
`)
})
// console.log("RenderDoTogether: ", res);
}
/**
* 渲染标题
*/
renderDoTogether() {
this.doTogetherData.forEach((v,i)=>{
$(".do_together_title").append(`
<li class="${i==0?'active':''}">${v.title}</li>
`);
$(".do_together_content").append(`
<div class="roll_father ${i==0?'showRoll':''}"></div>
`)
});
var titleLi = $(".do_together_title li"),
RollFather = $(".do_together_content .roll_father");
var a = this;
titleLi.on('click', function () {
a.index = $(this).index();
$(this).addClass("active").siblings().removeClass("active")
if (a.doTogetherData[a.index].content.length == 0) {
a.DoTogether()
}
RollFather.eq($(this).index()).addClass("showRoll").siblings().removeClass("showRoll")
})
}
scrollLoadData() {
var scroll = new auiScroll({
listen:true,
distance: 10 //判断到达底部的距离,isToBottom为true
}, (ret) => {
if(ret.isToBottom){
console.log("滚动到底部")
this.doTogetherData[this.index].page += 1;
this.DoTogether()
}
});
}
}
new Index()

View File

@@ -0,0 +1,50 @@
.aui-fold-active {
background: #f4f4f4;
}
.aui-fold-active .aui-fold-content {
display:block;
}
.aui-fold-content {
position: relative;
display: none;
margin: 12px -15px -12px;
padding-left: 15px;
background: #fff;
}
.aui-fold .aui-arrow-right {
position: relative;
display: block;
overflow: hidden;
margin: -12px -15px;
padding: inherit;
white-space: nowrap;
text-overflow: ellipsis;
color: inherit;
}
.aui-fold-ccontent-full {
margin-left: -15px;
margin-right: -15px;
padding: 0;
width: auto;
}
.aui-fold > .aui-arrow-right:after {
content: "\e661";
}
.aui-fold-active > .aui-arrow-right:after{
content: "\e6de"
}
.aui-fold-content .aui-list-view,
.aui-fold-content .aui-user-view {
margin-bottom: 0;
}
.aui-fold-content .aui-list-view:after,
.aui-fold-content .aui-user-view:after,
.aui-fold-content .aui-input-row:first-child:after {
border-top: 0;
}
.aui-fold-content .aui-list-view-cell:last-child:after,
.aui-fold-content .aui-user-view-cell:last-child:after,
.aui-fold-content .aui-input-row:last-child:after,
.aui-fold-content .aui-btn-row:last-child:after {
border-bottom: 0;
}

View File

@@ -0,0 +1,272 @@
/*
* =========================================================================
* APIClud - AUI UI 框架 流浪男 QQ:343757327 http://www.auicss.com
* Verson 1.0
* =========================================================================
*/
@charset "UTF-8";
html{
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 20px;
}
html,body {
-webkit-touch-callout:none;
-webkit-text-size-adjust:none;
-webkit-tap-highlight-color:rgba(0, 0, 0, 0);
-webkit-user-select:none;
width: 100%;
}
body {
line-height: 1.5;
font-size: 0.8rem;
color: #212121;
background-color: #f5f5f5;
outline: 0;
}
html,body,header,section,footer,div,ul,ol,li,img,a,span,em,del,legend,center,strong,var,fieldset,form,label,dl,dt,dd,cite,input,hr,time,mark,code,figcaption,figure,textarea,h1,h2,h3,h4,h5,h6,p{
margin:0;
border:0;
padding:0;
font-style:normal;
}
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-user-select: none;
-webkit-tap-highlight-color: transparent;
outline: none;
}
@media only screen and (min-width: 400px) {
html {
font-size: 21.33333333px !important;
}
}
@media only screen and (min-width: 414px) {
html {
font-size: 21px !important;
}
}
@media only screen and (min-width: 480px) {
html {
font-size: 25.6px !important;
}
}
.aui-flex-col,
.aui-flex-row {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.aui-flex-col:before,
.aui-flex-row:before,
.aui-flex-col:after,
.aui-flex-row:after {
content: " ";
display: -webkit-box;
display: -webkit-flex;
display: flex;
box-sizing: border-box;
}
.aui-flex-col:after,
.aui-flex-row:after {
clear: both;
}
.aui-flex-col {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
flex-direction: row;
}
.aui-flex-row {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
}
/*栅格*/
.aui-flex-item-1 {
float: left;
width: 8.33333333%;
}
.aui-flex-offset-1 {
margin-left: 8.33333333%;
}
.aui-flex-item-2 {
float: left;
width: 16.66666667%;
}
.aui-flex-offset-2 {
margin-left: 16.66666667%;
}
.aui-flex-item-3 {
float: left;
width: 25%;
}
.aui-flex-offset-3 {
margin-left: 25%;
}
.aui-flex-item-4 {
float: left;
width: 33.33333333%;
}
.aui-flex-offset-4 {
margin-left: 33.33333333%;
}
.aui-flex-item-5 {
float: left;
width: 41.66666667%;
}
.aui-flex-offset-5 {
margin-left: 41.66666667%;
}
.aui-flex-item-6 {
float: left;
width: 50%;
}
.aui-flex-offset-6 {
margin-left: 50%;
}
.aui-flex-item-7 {
float: left;
width: 58.33333333%;
}
.aui-flex-offset-7 {
margin-left: 58.33333333%;
}
.aui-flex-item-8 {
float: left;
width: 66.66666667%;
}
.aui-flex-offset-8 {
margin-left: 66.66666667%;
}
.aui-flex-item-9 {
float: left;
width: 75%;
}
.aui-flex-offset-9 {
margin-left: 75%;
}
.aui-flex-item-10 {
float: left;
width: 83.33333333%;
}
.aui-flex-offset-10 {
margin-left: 83.33333333%;
}
.aui-flex-order-10 {
-webkit-box-ordinal-group: 11;
-webkit-order: 10;
order: 10;
}
.aui-flex-item-11 {
float: left;
width: 91.66666667%;
}
.aui-flex-offset-11 {
margin-left: 91.66666667%;
}
.aui-flex-item-12 {
float: left;
width: 100%;
}
.aui-flex-offset-12 {
margin-left: 100%;
}
.aui-flex-auto {
float: left;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1;
}
.aui-flex-between {
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
/*对齐*/
.aui-flex-col.aui-flex-left {
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
}
.aui-flex-col.aui-flex-right {
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.aui-flex-col.aui-flex-top {
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.aui-flex-col.aui-flex-bottom {
-webkit-box-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
.aui-flex-col.aui-flex-center {
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.aui-flex-col.aui-flex-middle {
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.aui-flex-row.aui-flex-left {
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.aui-flex-row.aui-flex-right {
-webkit-box-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
.aui-flex-row.aui-flex-top {
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
}
.aui-flex-row.aui-flex-bottom {
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.aui-flex-row.aui-flex-center {
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.aui-flex-row.aui-flex-middle {
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
[class*=aui-flex-item-]{
position: relative;
}
[class*=aui-flex-auto].aui-flex-left {
margin-right: auto;
}
[class*=aui-flex-auto].aui-flex-right {
margin-left: auto;
}
[class*=aui-flex-auto].aui-flex-top {
margin-bottom: auto;
}
[class*=aui-flex-auto].aui-flex-bottom {
margin-top: auto;
}
[class*=aui-flex-auto].aui-flex-center {
margin-left: auto;
margin-right: auto;
}
[class*=aui-flex-auto].aui-flex-middle {
margin-top: auto;
margin-bottom: auto;
}

View File

@@ -0,0 +1,54 @@
/**
* aui-pull-refresh.css 下拉刷新
* verson 0.0.1
* @author 流浪男 && Beck
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
.aui-refresh-content {
position: relative;
-webkit-overflow-scrolling: touch;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.aui-refresh-load {
width: 100%;
height: 2.2rem;
position: absolute;
top: -2.2rem;
left: 0;
padding: 0.75rem 0;
}
.aui-refresh-pull-arrow {
width: 1.2rem;
height: 1.2rem;
position: absolute;
left: 50%;
top: 50%;
visibility: visible;
margin-left: -0.6rem;
margin-top: -0.6rem;
background: no-repeat center;
background-image: url('data:image/svg+xml;charset=utf-8,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M99.225 3.528c8.34 0 15.104 6.763 15.104 15.105 0 8.34-6.766 15.105-15.105 15.105-8.342 0-15.105-6.763-15.105-15.105S90.883 3.528 99.225 3.528zM76.567 48.843h45.315c4.17 0 7.552 3.38 7.552 7.552v5.035c0 4.172-3.382 7.552-7.552 7.552H76.567c-4.172 0-7.553-3.38-7.553-7.552v-5.035c0-4.172 3.38-7.552 7.553-7.552zm-10.07 35.245h65.455c4.17 0 7.552 3.38 7.552 7.552v5.035c0 4.172-3.382 7.552-7.552 7.552H66.497c-4.172 0-7.553-3.38-7.553-7.552V91.64c0-4.172 3.38-7.552 7.553-7.552zm8.044 87.596c-20.397-23.16-45.805-52.352-45.805-52.352h140.98s-25.146 28.735-45.4 51.884c-33.454 38.234-18.118 36.4-49.774.468z" fill="#707070" class="transform-group"/></svg>');
background-size: 1.2rem 1.2rem;
z-index: 10;
-webkit-transform: rotate(0deg) translate3d(0, 0, 0);
transform: rotate(0deg) translate3d(0, 0, 0);
-webkit-transition-duration: 300ms;
transition-duration: 300ms;
}
.aui-refresh-content.aui-refresh-pull-down .aui-refresh-pull-arrow {
-webkit-transform: rotate(0deg) translate3d(0,0,0);
transform: rotate(0deg) translate3d(0,0,0);
}
.aui-refresh-content.aui-refresh-pull-up .aui-refresh-pull-arrow {
-webkit-transform: rotate(180deg) translate3d(0,0,0);
transform: rotate(180deg) translate3d(0,0,0);
}
.aui-refreshing .aui-refresh-pull-arrow{
background-image: url('data:image/svg+xml;charset=utf-8,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M99.917.167C45.52.167 1.28 43.642.03 97.737c1.153-47.204 37.045-85.08 81.153-85.08 44.834 0 81.184 39.147 81.184 87.426 0 10.346 8.387 18.738 18.733 18.738 10.342 0 18.733-8.39 18.733-18.737C199.833 44.9 155.1.167 99.917.167zm0 199.833c54.395 0 98.637-43.475 99.883-97.57-1.15 47.2-37.042 85.082-81.15 85.082-44.833 0-81.183-39.15-81.183-87.43 0-10.34-8.392-18.732-18.738-18.732C8.39 81.35 0 89.737 0 100.083 0 155.267 44.733 200 99.917 200z" fill="#707070" class="transform-group"/></svg>');
-webkit-animation: rotate 1s 0s linear infinite;
animation: rotate 1s 0s linear infinite;
}

View File

@@ -0,0 +1,277 @@
/*
* ===================================================================================================
* APIClud - AUI UI 框架 流浪男 QQ:343757327 http://www.auicss.com
* Verson 2.0.0 自定义主题样式
* explain:自定义主题样式可以完成AUI内所有背景、控件颜色、字号等的修改,可以方便快速的搭建属于自己项目的一套主题色
* ===================================================================================================
*/
/*body背景色及色值*/
body {
color: #d1d1d1;
background-color: #1a1a1a;
}
p {
color: #757575;
}
a {
color: #0062cc;
}
.aui-text-default {
color: #212121 !important;
}
.aui-bg-default {
background-color: #f5f5f5 !important;
}
/*label*/
.aui-label {
padding: 0.3em 0.35em;
font-size: 0.6rem;
color: #616161;
background-color: #e0e0e0;
}
.aui-label-outlined {
border: 1px solid #d9d9d9;
background-color: transparent;
}
.aui-label .aui-iconfont {
font-size: 0.6rem;
}
/*角标*/
.aui-badge {
color: #ffffff;
background-color: #ff2600;
}
/*按钮*/
.aui-btn {
color: #212121;
background: #e0e0e0;
}
.aui-btn:active {
color: #212121;
background-color: #bdbdbd;
}
.aui-btn-outlined {
background: transparent;
border: 1px solid #bdbdbd;
}
.aui-btn-outlined:active {
background: transparent;
}
/*tab*/
.aui-tab .aui-tab-item {
height: 2.2rem;
line-height: 2.2rem;
font-size: 0.7rem;
color: #212121;
background-color: #ffffff;
}
/*tab选中时样式*/
.aui-tab .aui-tab-item.active {
color: #039be5;
border-bottom: 2px solid #039be5;
}
/*单选选中样式*/
.aui-radio:checked,
.aui-radio.aui-checked {
background-color: #edfb3f;
border: solid 1px #edfb3f;
}
/* 单选选中时中间对号颜色*/
.aui-radio:checked:before,
.aui-radio.aui-checked:before,
.aui-radio:checked:after,
.aui-radio.aui-checked:after {
border-color: #212121;
}
/*多选选中样式*/
.aui-checkbox:checked,
.aui-checkbox.aui-checked {
background-color: #edfb3f;
border: solid 1px #edfb3f;
}
/* 多选选中时中间对号颜色*/
.aui-checkbox:checked:before,
.aui-checkbox.aui-checked:before,
.aui-checkbox:checked:after,
.aui-checkbox.aui-checked:after{
border-color: #212121;
}
/*滑动开关*/
.aui-switch:checked {
border-color: #edfb3f;
background-color: #edfb3f;
}
.aui-switch:before {
background-color: #212121;
}
/*顶部导航栏*/
.aui-bar-nav {
background-color: #00bbd4;
color: #212121;
}
.aui-bar-nav .aui-iconfont {
color: #212121;
}
.aui-bar-nav .aui-btn .aui-iconfont {
color: #212121;
}
/*浅色顶部导航拦*/
.aui-bar-light {
color: #03a9f4;
background-color: #ffffff;
}
.aui-bar.aui-bar-light .aui-iconfont {
color: #03a9f4;
}
.aui-bar.aui-bar-light .aui-btn-outlined {
border-color: #03a9f4;
}
/*底部工具栏*/
.aui-bar-tab {
background-color: #ffffff;
color: #757575;
}
/*底部工具栏选中时颜色*/
.aui-bar-tab .active {
color: #039be5;
}
/*按钮工具栏*/
.aui-bar-btn .aui-bar-btn-item {
border-color: #edfb3f;
color: #edfb3f;
}
.aui-bar-btn .aui-bar-btn-item.active {
background-color: #edfb3f;
color: #ffffff;
}
/*顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav .aui-bar-btn-item {
border-color: #ffffff;
}
/*浅色顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn-item {
border-color: #03a9f4;
}
/*顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav .aui-bar-btn .aui-bar-btn-item.active {
background-color: #ffffff;
color: #03a9f4;
}
/*浅色顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn .aui-bar-btn-item.active {
background-color: #03a9f4;
color: #ffffff;
}
/*进度条*/
.aui-progress {
background-color: #f0f0f0;
}
/*进度条色带*/
.aui-progress .aui-progress-bar {
background-color: #eefb3f;
}
/*滑块*/
.aui-range input[type='range']{
/*滑块线条背景色*/
background-color: #f0f0f0;
}
.aui-range input[type='range']::-webkit-slider-thumb {
/*滑块圆圈样式*/
border-color: #edfb3f;
background-color: #edfb3f;
}
/*提示条*/
.aui-tips {
background-color: rgba(0,0,0,.6);
}
/*搜索条*/
.aui-searchbar {
background-color: #ebeced;
color: #9e9e9e;
}
/*列表背景色*/
.aui-list .aui-list-item {
color: #d1d1d1;
background-color: #1a1a1a;
}
/*列表头部*/
.aui-list .aui-list-header {
background-color: #242424;
color: #9e9e9e;
}
/*列表项内Ttitle标题*/
.aui-list .aui-list-item-title {
font-size: 0.8rem;
color: #d1d1d1;
}
/*列表文本区域字体*/
.aui-list .aui-list-item-text {
font-size: 0.7rem;
color: #d1d1d1;
}
/*列表右侧箭头*/
.aui-list-item-arrow:before {
border-color: #edfb3f;
}
/*列表右侧其他信息字体颜色*/
.aui-list .aui-list-item-right,
.aui-list-item-title-row em {
color: #edfb3f;
}
/*列表线条颜色*/
.aui-list:before,
.aui-list:after,
.aui-list .aui-list-item:after,
.aui-list.aui-list-in .aui-list-item-inner:after {
background-color: #242424;
}
/*列表项点击颜色*/
.aui-list .aui-list-item:active {
background-color: #f5f5f5;
}
/*媒体列表布局左(右)媒体宽度控制*/
.aui-list .aui-list-item-media {
width: 4.5rem;
}
/*列表内label、icon字体颜色*/
.aui-list .aui-list-item-label,
.aui-list .aui-list-item-label-icon {
color: #d1d1d1;
}
/*卡片列表顶部字体*/
.aui-card-list-header {
font-size: 0.8rem;
color: #212121;
}
/* 卡片列表内容区域*/
.aui-card-list-content,
.aui-card-list-content-padded {
font-size: 0.7rem;
color: #212121;
}
/*卡片列表底部*/
.aui-card-list-footer {
font-size: 0.7rem;
color: #757575;
}
/*信息条*/
.aui-info {
font-size: 0.7rem;
color: #757575;
background-color: transparent;
}
/*输入框类字体颜色*/
input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="number"],
select,
textarea {
color: #424242;
}

View File

@@ -0,0 +1,278 @@
/*
* ===================================================================================================
* APIClud - AUI UI 框架 流浪男 QQ:343757327 http://www.auicss.com
* Verson 2.0.0 自定义主题样式
* explain:自定义主题样式可以完成AUI内所有背景、控件颜色、字号等的修改,可以方便快速的搭建属于自己项目的一套主题色
* ===================================================================================================
*/
/*body背景色及色值*/
body {
color: #212121;
background-color: #f5f5f5;
}
p {
color: #757575;
}
a {
color: #0062cc;
}
.aui-text-default {
color: #212121 !important;
}
.aui-bg-default {
background-color: #f5f5f5 !important;
}
/*label*/
.aui-label {
padding: 0.3em 0.35em;
font-size: 0.6rem;
color: #616161;
background-color: #e0e0e0;
}
.aui-label-outlined {
border: 1px solid #d9d9d9;
background-color: transparent;
}
.aui-label .aui-iconfont {
font-size: 0.6rem;
}
/*角标*/
.aui-badge {
color: #ffffff;
background-color: #ff2600;
}
/*按钮*/
.aui-btn {
color: #212121;
background: #e0e0e0;
}
.aui-btn:active {
color: #212121;
background-color: #bdbdbd;
}
.aui-btn-outlined {
background: transparent;
border: 1px solid #bdbdbd;
}
.aui-btn-outlined:active {
background: transparent;
}
/*tab*/
.aui-tab .aui-tab-item {
height: 2.2rem;
line-height: 2.2rem;
font-size: 0.7rem;
color: #212121;
background-color: #ffffff;
}
/*tab选中时样式*/
.aui-tab .aui-tab-item.aui-active {
color: #039be5;
border-bottom: 2px solid #039be5;
}
/*单选选中样式*/
.aui-radio:checked,
.aui-radio.aui-checked {
background-color: #03a9f4;
border: solid 1px #03a9f4;
}
/* 单选选中时中间对号颜色*/
.aui-radio:checked:before,
.aui-radio.aui-checked:before,
.aui-radio:checked:after,
.aui-radio.aui-checked:after {
border-color: #ffffff;
}
/*多选选中样式*/
.aui-checkbox:checked,
.aui-checkbox.aui-checked {
background-color: #03a9f4;
border: solid 1px #03a9f4;
}
/* 多选选中时中间对号颜色*/
.aui-checkbox:checked:before,
.aui-checkbox.aui-checked:before,
.aui-checkbox:checked:after,
.aui-checkbox.aui-checked:after{
border-color: #ffffff;
}
/*滑动开关*/
.aui-switch:checked {
border-color: #03a9f4;
background-color: #03a9f4;
}
/*滑动开关圆圈颜色*/
.aui-switch:before {
background-color: #ffffff;
}
/*顶部导航栏*/
.aui-bar-nav {
background-color: #03a9f4;
color: #ffffff;
}
.aui-bar-nav .aui-iconfont {
color: #ffffff;
}
.aui-bar-nav .aui-btn .aui-iconfont {
color: #ffffff;
}
/*浅色顶部导航拦*/
.aui-bar-light {
color: #03a9f4;
background-color: #ffffff;
}
.aui-bar.aui-bar-light .aui-iconfont {
color: #03a9f4;
}
.aui-bar.aui-bar-light .aui-btn-outlined {
border-color: #03a9f4;
}
/*底部工具栏*/
.aui-bar-tab {
background-color: #ffffff;
color: #757575;
}
/*底部工具栏选中时颜色*/
.aui-bar-tab .aui-active {
color: #039be5;
}
/*按钮工具栏*/
.aui-bar-btn .aui-bar-btn-item {
border-color: #03a9f4;
color: #212121;
}
.aui-bar-btn .aui-bar-btn-item.aui-active {
background-color: #03a9f4;
color: #ffffff;
}
/*顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav .aui-bar-btn-item {
border-color: #ffffff;
}
/*浅色顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn-item {
border-color: #03a9f4;
}
/*顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav .aui-bar-btn .aui-bar-btn-item.aui-active {
background-color: #ffffff;
color: #03a9f4;
}
/*浅色顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn .aui-bar-btn-item.aui-active {
background-color: #03a9f4;
color: #ffffff;
}
/*进度条*/
.aui-progress {
background-color: #f0f0f0;
}
/*进度条色带*/
.aui-progress .aui-progress-bar {
background-color: #03a9f4;
}
/*滑块*/
.aui-range input[type='range']{
/*滑块线条背景色*/
background-color: #f0f0f0;
}
.aui-range input[type='range']::-webkit-slider-thumb {
/*滑块圆圈样式*/
border-color: #03a9f4;
background-color: #03a9f4;
}
/*提示条*/
.aui-tips {
background-color: rgba(0,0,0,.6);
}
/*搜索条*/
.aui-searchbar {
background-color: #ebeced;
color: #9e9e9e;
}
/*列表背景色*/
.aui-list .aui-list-item {
color: #212121;
background-color: #ffffff;
}
/*列表头部*/
.aui-list .aui-list-header {
background-color: #e0e0e0;
color: #212121;
}
/*列表项内Ttitle标题*/
.aui-list .aui-list-item-title {
font-size: 0.8rem;
color: #212121;
}
/*列表文本区域字体*/
.aui-list .aui-list-item-text {
font-size: 0.7rem;
color: #757575;
}
/*列表右侧箭头*/
.aui-list-item-arrow:before {
border-color: #dddddd;
}
/*列表右侧其他信息字体颜色*/
.aui-list .aui-list-item-right,
.aui-list-item-title-row em {
color: #757575;
}
/*列表线条颜色*/
.aui-list:before,
.aui-list:after,
.aui-list .aui-list-item:after,
.aui-list.aui-list-in .aui-list-item-inner:after {
background-color: #dddddd;
}
/*列表项点击颜色*/
.aui-list .aui-list-item:active {
background-color: #f5f5f5;
}
/*媒体列表布局左(右)媒体宽度控制*/
.aui-list .aui-list-item-media {
width: 4.5rem;
}
/*列表内label、icon字体颜色*/
.aui-list .aui-list-item-label,
.aui-list .aui-list-item-label-icon {
color: #212121;
}
/*卡片列表顶部字体*/
.aui-card-list-header {
font-size: 0.8rem;
color: #212121;
}
/* 卡片列表内容区域*/
.aui-card-list-content,
.aui-card-list-content-padded {
font-size: 0.7rem;
color: #212121;
}
/*卡片列表底部*/
.aui-card-list-footer {
font-size: 0.7rem;
color: #757575;
}
/*信息条*/
.aui-info {
font-size: 0.7rem;
color: #757575;
background-color: transparent;
}
/*输入框类字体颜色*/
input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="number"],
select,
textarea {
color: #424242;
}

View File

@@ -0,0 +1,113 @@
/**
* aui-slide.css 轮播样式
* verson 0.0.2
* @author 流浪男
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
.aui-slide-wrap {
display: block;
position: relative;
list-style: none;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
.aui-slide-wrap .aui-slide-node {
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
list-style: none;
overflow: hidden;
background: #ffffff;
}
.aui-slide-node-center {
display: -moz-box;
display: -webkit-box;
display: box;
-moz-box-pack: center;
-webkit-box-pack: center;
box-pack: center;
}
.aui-slide-node-middle {
display: -moz-box;
display: -webkit-box;
display: box;
-moz-box-align: center;
-webkit-box-align: center;
box-align: center;
}
.aui-slide-node img {
width: 100%;
height: 100%;
}
.aui-slide-page-wrap {
width: 100%;
height: 30px;
line-height: 30px;
position: absolute;
padding: 0;
left: 0;
right: 0;
bottom: 5px;
z-index: 9999;
text-align: center;
}
.aui-slide-page-dot {
position: relative;
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
list-style: none;
margin: 5px 3px 0 3px;
background: #c7c7c7;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.aui-slide-page-line {
position: absolute;
bottom: -14px;
height: 1px !important;
position: relative;
display: inline-block;
background: #eeeeee;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.aui-slide-page-active {
background: #1abc9c;
from { opacity: 0.3; }
to { opacity: 1 }
}
.aui-slide-prev-btn,
.aui-slide-next-btn {
display: inline-block;
width: 50px;
height: 30px;
line-height: 30px;
font-size: 1.2em;
color: #1abc9c;
background: rgba(249,249,249,0.6);
position: relative;
}
.aui-slide-prev-btn {
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
}
.aui-slide-next-btn {
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.aui-slide-prev-btn:active,
.aui-slide-next-btn:active {
color: #f1c40f;
}

View File

@@ -0,0 +1,607 @@
/*
* APICloud JavaScript Library
* Copyright (c) 2014 apicloud.com
*/
(function(window){
var u = {};
var isAndroid = (/android/gi).test(navigator.appVersion);
var uzStorage = function(){
var ls = window.localStorage;
if(isAndroid){
ls = os.localStorage();
}
return ls;
};
function parseArguments(url, data, fnSuc, dataType) {
if (typeof(data) == 'function') {
dataType = fnSuc;
fnSuc = data;
data = undefined;
}
if (typeof(fnSuc) != 'function') {
dataType = fnSuc;
fnSuc = undefined;
}
return {
url: url,
data: data,
fnSuc: fnSuc,
dataType: dataType
};
}
u.trim = function(str){
if(String.prototype.trim){
return str == null ? "" : String.prototype.trim.call(str);
}else{
return str.replace(/(^\s*)|(\s*$)/g, "");
}
};
u.trimAll = function(str){
return str.replace(/\s*/g,'');
};
u.isElement = function(obj){
return !!(obj && obj.nodeType == 1);
};
u.isArray = function(obj){
if(Array.isArray){
return Array.isArray(obj);
}else{
return obj instanceof Array;
}
};
u.isEmptyObject = function(obj){
if(JSON.stringify(obj) === '{}'){
return true;
}
return false;
};
u.addEvt = function(el, name, fn, useCapture){
if(!u.isElement(el)){
console.warn('$api.addEvt Function need el param, el param must be DOM Element');
return;
}
useCapture = useCapture || false;
if(el.addEventListener) {
el.addEventListener(name, fn, useCapture);
}
};
u.rmEvt = function(el, name, fn, useCapture){
if(!u.isElement(el)){
console.warn('$api.rmEvt Function need el param, el param must be DOM Element');
return;
}
useCapture = useCapture || false;
if (el.removeEventListener) {
el.removeEventListener(name, fn, useCapture);
}
};
u.one = function(el, name, fn, useCapture){
if(!u.isElement(el)){
console.warn('$api.one Function need el param, el param must be DOM Element');
return;
}
useCapture = useCapture || false;
var that = this;
var cb = function(){
fn && fn();
that.rmEvt(el, name, cb, useCapture);
};
that.addEvt(el, name, cb, useCapture);
};
u.dom = function(el, selector){
if(arguments.length === 1 && typeof arguments[0] == 'string'){
if(document.querySelector){
return document.querySelector(arguments[0]);
}
}else if(arguments.length === 2){
if(el.querySelector){
return el.querySelector(selector);
}
}
};
u.domAll = function(el, selector){
if(arguments.length === 1 && typeof arguments[0] == 'string'){
if(document.querySelectorAll){
return document.querySelectorAll(arguments[0]);
}
}else if(arguments.length === 2){
if(el.querySelectorAll){
return el.querySelectorAll(selector);
}
}
};
u.byId = function(id){
return document.getElementById(id);
};
u.first = function(el, selector){
if(arguments.length === 1){
if(!u.isElement(el)){
console.warn('$api.first Function need el param, el param must be DOM Element');
return;
}
return el.children[0];
}
if(arguments.length === 2){
return this.dom(el, selector+':first-child');
}
};
u.last = function(el, selector){
if(arguments.length === 1){
if(!u.isElement(el)){
console.warn('$api.last Function need el param, el param must be DOM Element');
return;
}
var children = el.children;
return children[children.length - 1];
}
if(arguments.length === 2){
return this.dom(el, selector+':last-child');
}
};
u.eq = function(el, index){
return this.dom(el, ':nth-child('+ index +')');
};
u.not = function(el, selector){
return this.domAll(el, ':not('+ selector +')');
};
u.prev = function(el){
if(!u.isElement(el)){
console.warn('$api.prev Function need el param, el param must be DOM Element');
return;
}
var node = el.previousSibling;
if(node.nodeType && node.nodeType === 3){
node = node.previousSibling;
return node;
}
};
u.next = function(el){
if(!u.isElement(el)){
console.warn('$api.next Function need el param, el param must be DOM Element');
return;
}
var node = el.nextSibling;
if(node.nodeType && node.nodeType === 3){
node = node.nextSibling;
return node;
}
};
u.closest = function(el, selector){
if(!u.isElement(el)){
console.warn('$api.closest Function need el param, el param must be DOM Element');
return;
}
var doms, targetDom;
var isSame = function(doms, el){
var i = 0, len = doms.length;
for(i; i<len; i++){
if(doms[i].isEqualNode(el)){
return doms[i];
}
}
return false;
};
var traversal = function(el, selector){
doms = u.domAll(el.parentNode, selector);
targetDom = isSame(doms, el);
while(!targetDom){
el = el.parentNode;
if(el != null && el.nodeType == el.DOCUMENT_NODE){
return false;
}
traversal(el, selector);
}
return targetDom;
};
return traversal(el, selector);
};
u.contains = function(parent,el){
var mark = false;
if(el === parent){
mark = true;
return mark;
}else{
do{
el = el.parentNode;
if(el === parent){
mark = true;
return mark;
}
}while(el === document.body || el === document.documentElement);
return mark;
}
};
u.remove = function(el){
if(el && el.parentNode){
el.parentNode.removeChild(el);
}
};
u.attr = function(el, name, value){
if(!u.isElement(el)){
console.warn('$api.attr Function need el param, el param must be DOM Element');
return;
}
if(arguments.length == 2){
return el.getAttribute(name);
}else if(arguments.length == 3){
el.setAttribute(name, value);
return el;
}
};
u.removeAttr = function(el, name){
if(!u.isElement(el)){
console.warn('$api.removeAttr Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 2){
el.removeAttribute(name);
}
};
u.hasCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.hasCls Function need el param, el param must be DOM Element');
return;
}
if(el.className.indexOf(cls) > -1){
return true;
}else{
return false;
}
};
u.addCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.addCls Function need el param, el param must be DOM Element');
return;
}
if('classList' in el){
el.classList.add(cls);
}else{
var preCls = el.className;
var newCls = preCls +' '+ cls;
el.className = newCls;
}
return el;
};
u.removeCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.removeCls Function need el param, el param must be DOM Element');
return;
}
if('classList' in el){
el.classList.remove(cls);
}else{
var preCls = el.className;
var newCls = preCls.replace(cls, '');
el.className = newCls;
}
return el;
};
u.toggleCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.toggleCls Function need el param, el param must be DOM Element');
return;
}
if('classList' in el){
el.classList.toggle(cls);
}else{
if(u.hasCls(el, cls)){
u.removeCls(el, cls);
}else{
u.addCls(el, cls);
}
}
return el;
};
u.val = function(el, val){
if(!u.isElement(el)){
console.warn('$api.val Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 1){
switch(el.tagName){
case 'SELECT':
var value = el.options[el.selectedIndex].value;
return value;
break;
case 'INPUT':
return el.value;
break;
case 'TEXTAREA':
return el.value;
break;
}
}
if(arguments.length === 2){
switch(el.tagName){
case 'SELECT':
el.options[el.selectedIndex].value = val;
return el;
break;
case 'INPUT':
el.value = val;
return el;
break;
case 'TEXTAREA':
el.value = val;
return el;
break;
}
}
};
u.prepend = function(el, html){
if(!u.isElement(el)){
console.warn('$api.prepend Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('afterbegin', html);
return el;
};
u.append = function(el, html){
if(!u.isElement(el)){
console.warn('$api.append Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('beforeend', html);
return el;
};
u.before = function(el, html){
if(!u.isElement(el)){
console.warn('$api.before Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('beforebegin', html);
return el;
};
u.after = function(el, html){
if(!u.isElement(el)){
console.warn('$api.after Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('afterend', html);
return el;
};
u.html = function(el, html){
if(!u.isElement(el)){
console.warn('$api.html Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 1){
return el.innerHTML;
}else if(arguments.length === 2){
el.innerHTML = html;
return el;
}
};
u.text = function(el, txt){
if(!u.isElement(el)){
console.warn('$api.text Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 1){
return el.textContent;
}else if(arguments.length === 2){
el.textContent = txt;
return el;
}
};
u.offset = function(el){
if(!u.isElement(el)){
console.warn('$api.offset Function need el param, el param must be DOM Element');
return;
}
var sl = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
var st = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
var rect = el.getBoundingClientRect();
return {
l: rect.left + sl,
t: rect.top + st,
w: el.offsetWidth,
h: el.offsetHeight
};
};
u.css = function(el, css){
if(!u.isElement(el)){
console.warn('$api.css Function need el param, el param must be DOM Element');
return;
}
if(typeof css == 'string' && css.indexOf(':') > 0){
el.style && (el.style.cssText += ';' + css);
}
};
u.cssVal = function(el, prop){
if(!u.isElement(el)){
console.warn('$api.cssVal Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 2){
var computedStyle = window.getComputedStyle(el, null);
return computedStyle.getPropertyValue(prop);
}
};
u.jsonToStr = function(json){
if(typeof json === 'object'){
return JSON && JSON.stringify(json);
}
};
u.strToJson = function(str){
if(typeof str === 'string'){
return JSON && JSON.parse(str);
}
};
u.setStorage = function(key, value){
if(arguments.length === 2){
var v = value;
if(typeof v == 'object'){
v = JSON.stringify(v);
v = 'obj-'+ v;
}else{
v = 'str-'+ v;
}
var ls = uzStorage();
if(ls){
ls.setItem(key, v);
}
}
};
u.getStorage = function(key){
var ls = uzStorage();
if(ls){
var v = ls.getItem(key);
if(!v){return;}
if(v.indexOf('obj-') === 0){
v = v.slice(4);
return JSON.parse(v);
}else if(v.indexOf('str-') === 0){
return v.slice(4);
}
}
};
u.rmStorage = function(key){
var ls = uzStorage();
if(ls && key){
ls.removeItem(key);
}
};
u.clearStorage = function(){
var ls = uzStorage();
if(ls){
ls.clear();
}
};
/*by king*/
u.fixIos7Bar = function(el){
if(!u.isElement(el)){
console.warn('$api.fixIos7Bar Function need el param, el param must be DOM Element');
return;
}
var strDM = api.systemType;
if (strDM == 'ios') {
var strSV = api.systemVersion;
var numSV = parseInt(strSV,10);
var fullScreen = api.fullScreen;
var iOS7StatusBarAppearance = api.iOS7StatusBarAppearance;
if (numSV >= 7 && !fullScreen && iOS7StatusBarAppearance) {
el.style.paddingTop = '20px';
}
}
};
u.fixStatusBar = function(el){
if(!u.isElement(el)){
console.warn('$api.fixStatusBar Function need el param, el param must be DOM Element');
return;
}
var sysType = api.systemType;
if(sysType == 'ios'){
u.fixIos7Bar(el);
}else if(sysType == 'android'){
var ver = api.systemVersion;
ver = parseFloat(ver);
if(ver >= 4.4){
el.style.paddingTop = '25px';
}
}
};
u.toast = function(title, text, time){
var opts = {};
var show = function(opts, time){
api.showProgress(opts);
setTimeout(function(){
api.hideProgress();
},time);
};
if(arguments.length === 1){
var time = time || 500;
if(typeof title === 'number'){
time = title;
}else{
opts.title = title+'';
}
show(opts, time);
}else if(arguments.length === 2){
var time = time || 500;
var text = text;
if(typeof text === "number"){
var tmp = text;
time = tmp;
text = null;
}
if(title){
opts.title = title;
}
if(text){
opts.text = text;
}
show(opts, time);
}
if(title){
opts.title = title;
}
if(text){
opts.text = text;
}
time = time || 500;
show(opts, time);
};
u.post = function(/*url,data,fnSuc,dataType*/){
var argsToJson = parseArguments.apply(null, arguments);
var json = {};
var fnSuc = argsToJson.fnSuc;
argsToJson.url && (json.url = argsToJson.url);
argsToJson.data && (json.data = argsToJson.data);
if(argsToJson.dataType){
var type = argsToJson.dataType.toLowerCase();
if (type == 'text'||type == 'json') {
json.dataType = type;
}
}else{
json.dataType = 'json';
}
json.method = 'post';
api.ajax(json,
function(ret,err){
if (ret) {
fnSuc && fnSuc(ret);
}
}
);
};
u.get = function(/*url,fnSuc,dataType*/){
var argsToJson = parseArguments.apply(null, arguments);
var json = {};
var fnSuc = argsToJson.fnSuc;
argsToJson.url && (json.url = argsToJson.url);
//argsToJson.data && (json.data = argsToJson.data);
if(argsToJson.dataType){
var type = argsToJson.dataType.toLowerCase();
if (type == 'text'||type == 'json') {
json.dataType = type;
}
}else{
json.dataType = 'text';
}
json.method = 'get';
api.ajax(json,
function(ret,err){
if (ret) {
fnSuc && fnSuc(ret);
}
}
);
};
/*end*/
window.$api = u;
})(window);

View File

@@ -0,0 +1,118 @@
/**
* aui-actionsheet.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiActionsheet = function() {
};
var isShow = false;
auiActionsheet.prototype = {
init: function(params,callback){
this.frameBounces = params.frameBounces;
this.title = params.title;
this.buttons = params.buttons;
this.cancelTitle = params.cancelTitle;
this.destructiveTitle = params.destructiveTitle;
this.maskDiv;
this.actionsheetDiv;
var self = this;
self.open(params,callback);
},
open: function(params,callback) {
var titleHtml='',buttonsHtml='',destructiveHtml='',cancelHtml='',btnHtml='';
var self = this;
if(self.actionsheetDiv || (!self.title && !self.buttons && !self.cancelTitle && !self.destructiveTitle))return;
if(!self.maskDiv){
self.maskDiv = document.createElement("div");
self.maskDiv.className = "aui-mask";
document.body.appendChild(self.maskDiv);
}
self.actionsheetDiv = document.createElement("div");
self.actionsheetDiv.className = "aui-actionsheet";
document.body.appendChild(self.actionsheetDiv);
if(self.title){
titleHtml = '<div class="aui-actionsheet-title aui-border-b aui-font-size-12">'+self.title+'</div>';
}
if(self.buttons && self.buttons.length){
for(var i = 0; i < self.buttons.length;i++){
if(i == self.buttons.length-1){
buttonsHtml += '<div class="aui-actionsheet-btn-item">'+self.buttons[i]+'</div>';
}else{
buttonsHtml += '<div class="aui-actionsheet-btn-item aui-border-b">'+self.buttons[i]+'</div>';
}
}
}
if(self.destructiveTitle){
destructiveHtml = '<div class="aui-actionsheet-btn-item aui-border-t aui-text-danger">'+self.destructiveTitle+'</div>';
}else{
var destructiveHtml = '';
}
if(self.title || (self.buttons && self.buttons.length)){
btnHtml = '<div class="aui-actionsheet-btn">'+titleHtml+''+buttonsHtml+''+destructiveHtml+'</div>';
}
if(self.cancelTitle){
cancelHtml = '<div class="aui-actionsheet-btn"><div class="aui-actionsheet-btn-item">'+self.cancelTitle+'</div></div>';
}
self.actionsheetDiv.insertAdjacentHTML('beforeend', btnHtml+cancelHtml);
var actionsheetHeight = document.querySelector(".aui-actionsheet").offsetHeight;
self.maskDiv.classList.add("aui-mask-in");
self.actionsheetDiv.style.webkitTransform = self.actionsheetDiv.style.transform = "translate3d(0,0,0)";
self.actionsheetDiv.style.opacity = 1;
self.actionsheetDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
self.maskDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:false
});
}
var actionsheetButtons = document.querySelectorAll(".aui-actionsheet-btn-item");
if(actionsheetButtons && actionsheetButtons.length > 0){
setTimeout(function(){
self.maskDiv.onclick = function(){self.close();return;};
for(var ii = 0; ii < actionsheetButtons.length; ii++){
(function(e){
actionsheetButtons[e].onclick = function(){
if(callback){
callback({
buttonIndex: e+1,
buttonTitle: this.textContent
});
};
self.close();
return;
}
})(ii)
}
}, 350)
}
},
close: function(){
var self = this;
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:true
});
}
if(self.actionsheetDiv){
var actionsheetHeight = self.actionsheetDiv.offsetHeight;
self.actionsheetDiv.style.webkitTransform = self.actionsheetDiv.style.transform = "translate3d(0,"+actionsheetHeight+"px,0)";
self.maskDiv.style.opacity = 0;
setTimeout(function(){
if(self.maskDiv){
self.maskDiv.parentNode.removeChild(self.maskDiv);
}
self.actionsheetDiv.parentNode.removeChild(self.actionsheetDiv);
self.actionsheetDiv = self.maskDiv = false;
}, 300)
}
}
};
window.auiActionsheet = auiActionsheet;
})(window);

View File

@@ -0,0 +1,44 @@
/**
* aui-collapse.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiCollapse = function(params) {
this.init(params);
};
auiCollapse.prototype = {
init: function(params,callback){
var collapseHeader = document.querySelectorAll(".aui-collapse-header");
if(collapseHeader.length){
for(var i=0;i<collapseHeader.length;i++){
(function(e){
collapseHeader[e].onclick = function(){
if(collapseHeader[e].nextSibling.nextElementSibling.className.indexOf("aui-collapse-content") > -1){
if(collapseHeader[e].nextSibling.nextElementSibling.className.indexOf("aui-show") > -1){
collapseHeader[e].nextSibling.nextElementSibling.classList.remove("aui-show");
collapseHeader[e].classList.remove("aui-active");
}else{
if(params.autoHide){
if(document.querySelector(".aui-collapse-header.aui-active")){
document.querySelector(".aui-collapse-header.aui-active").classList.remove("aui-active");
}
if(document.querySelector(".aui-collapse-content.aui-show")){
document.querySelector(".aui-collapse-content.aui-show").classList.remove("aui-show");
}
}
collapseHeader[e].nextSibling.nextElementSibling.classList.toggle("aui-show");
collapseHeader[e].classList.toggle("aui-active");
}
}
}
})(i)
}
}
}
};
window.auiCollapse = auiCollapse;
})(window);

View File

@@ -0,0 +1,125 @@
/**
* aui-dialog.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiDialog = function() {
};
var isShow = false;
auiDialog.prototype = {
params: {
title:'',
msg:'',
buttons: ['取消','确定'],
input:false
},
create: function(params,callback) {
var self = this;
var dialogHtml = '';
var buttonsHtml = '';
var headerHtml = params.title ? '<div class="aui-dialog-header">' + params.title + '</div>' : '<div class="aui-dialog-header">' + self.params.title + '</div>';
if(params.input){
params.text = params.text ? params.text: '';
var msgHtml = '<div class="aui-dialog-body"><input type="text" placeholder="'+params.text+'"></div>';
}else{
var msgHtml = params.msg ? '<div class="aui-dialog-body">' + params.msg + '</div>' : '<div class="aui-dialog-body">' + self.params.msg + '</div>';
}
var buttons = params.buttons ? params.buttons : self.params.buttons;
if (buttons && buttons.length > 0) {
for (var i = 0; i < buttons.length; i++) {
buttonsHtml += '<div class="aui-dialog-btn" tapmode button-index="'+i+'">'+buttons[i]+'</div>';
}
}
var footerHtml = '<div class="aui-dialog-footer">'+buttonsHtml+'</div>';
dialogHtml = '<div class="aui-dialog">'+headerHtml+msgHtml+footerHtml+'</div>';
document.body.insertAdjacentHTML('beforeend', dialogHtml);
// listen buttons click
var dialogButtons = document.querySelectorAll(".aui-dialog-btn");
if(dialogButtons && dialogButtons.length > 0){
for(var ii = 0; ii < dialogButtons.length; ii++){
dialogButtons[ii].onclick = function(){
if(callback){
if(params.input){
callback({
buttonIndex: parseInt(this.getAttribute("button-index"))+1,
text: document.querySelector("input").value
});
}else{
callback({
buttonIndex: parseInt(this.getAttribute("button-index"))+1
});
}
};
self.close();
return;
}
}
}
self.open();
},
open: function(){
if(!document.querySelector(".aui-dialog"))return;
var self = this;
document.querySelector(".aui-dialog").style.marginTop = "-"+Math.round(document.querySelector(".aui-dialog").offsetHeight/2)+"px";
if(!document.querySelector(".aui-mask")){
var maskHtml = '<div class="aui-mask"></div>';
document.body.insertAdjacentHTML('beforeend', maskHtml);
}
// document.querySelector(".aui-dialog").style.display = "block";
setTimeout(function(){
document.querySelector(".aui-dialog").classList.add("aui-dialog-in");
document.querySelector(".aui-mask").classList.add("aui-mask-in");
document.querySelector(".aui-dialog").classList.add("aui-dialog-in");
}, 10)
document.querySelector(".aui-mask").addEventListener("touchmove", function(e){
e.preventDefault();
})
document.querySelector(".aui-dialog").addEventListener("touchmove", function(e){
e.preventDefault();
})
return;
},
close: function(){
var self = this;
document.querySelector(".aui-mask").classList.remove("aui-mask-in");
document.querySelector(".aui-dialog").classList.remove("aui-dialog-in");
document.querySelector(".aui-dialog").classList.add("aui-dialog-out");
if (document.querySelector(".aui-dialog:not(.aui-dialog-out)")) {
setTimeout(function(){
if(document.querySelector(".aui-dialog"))document.querySelector(".aui-dialog").parentNode.removeChild(document.querySelector(".aui-dialog"));
self.open();
return true;
},200)
}else{
document.querySelector(".aui-mask").classList.add("aui-mask-out");
document.querySelector(".aui-dialog").addEventListener("webkitTransitionEnd", function(){
self.remove();
})
document.querySelector(".aui-dialog").addEventListener("transitionend", function(){
self.remove();
})
}
},
remove: function(){
if(document.querySelector(".aui-dialog"))document.querySelector(".aui-dialog").parentNode.removeChild(document.querySelector(".aui-dialog"));
if(document.querySelector(".aui-mask")){
document.querySelector(".aui-mask").classList.remove("aui-mask-out");
}
return true;
},
alert: function(params,callback){
var self = this;
return self.create(params,callback);
},
prompt:function(params,callback){
var self = this;
params.input = true;
return self.create(params,callback);
}
};
window.auiDialog = auiDialog;
})(window);

View File

@@ -0,0 +1,48 @@
/**
* aui-lazyload.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var _loadImgNodes;
var auiLazyload = function(params) {
this.errorImage = params.errorImage||false;
this._init(params);
};
auiLazyload.prototype = {
_init: function(params) {
var self = this;
_loadImgNodes = document.querySelectorAll('[data-src]');
self._judgeImages();
window.addEventListener('scroll', function(){
_loadImgNodes = document.querySelectorAll('[data-src]');
self._judgeImages();
}, false);
},
_judgeImages:function() {
var self = this;
if(_loadImgNodes.length){
for(var i = 0; i < _loadImgNodes.length; i++){
if (_loadImgNodes[i].getBoundingClientRect().top < window.innerHeight) {
self._loadImage(_loadImgNodes[i]);
}
}
}
},
_loadImage:function(el){
var self = this;
var img = new Image();
img.src = el.getAttribute('data-src');
el.src = el.getAttribute('data-src');
el.removeAttribute("data-src");
// // 图片加载失败
img.onerror = function() {
el.src = self.errorImage || el.getAttribute('src');
el.removeAttribute("data-src");
};
}
}
window.auiLazyload = auiLazyload;
})(window);

View File

@@ -0,0 +1,243 @@
/**
* aui-list-swipe.js 列表页滑动菜单
* verson 0.0.3
* @author 流浪男 && Beck
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function(window) {
"use strict";
var translateVal,
friction = 1,
firstTouchX,
firstTouchxy,
firstTouchY,
firstTouch,
firstTouchTime,
touchXDelta,
handleTranslateVal;
var TranslateZero = "translate3d(0,0,0)",
TranslateCent = "translate3d(100%,0,0)";
var swipeHandle = false,
btnWidth = false,
swipeBtnsRight = false;
var isMoved = false,isOpened=false;
var d = false;
var auiListSwipe = function (callback) {
this._init(callback);
}
auiListSwipe.prototype = {
// var self = this;
_init: function(callback){
var self = this;
// var d = document.querySelectorAll("selectors")
window.addEventListener('touchstart', function(event){
if(isOpened){
console.log(1)
// return;
isOpened = false;
return;
}
if(swipeHandle){
event.preventDefault();
self.setTranslate(swipeHandle,"0px");
swipeHandle.classList.remove("aui-swipe-opened");
swipeHandle = false;
return;
}
isMoved = false;
swipeHandle = false;
var target = event.target;
// 过滤点击
for(; target && target !== document; target = target.parentNode){
// console.log(target.classList)
if (target.classList){
if (target.classList.contains("aui-swipe-handle")) {
swipeHandle = target;
firstTouch = event.changedTouches[0];
firstTouchX = firstTouch.clientX;
firstTouchY = firstTouch.clientY;
firstTouchTime = event.timeStamp;
if(swipeHandle.className.indexOf("aui-swipe-opened") > -1){
// console.log(1)
// self.setTranslate(swipeHandle,"0px");
// swipeHandle.classList.remove("aui-swipe-opened");
event.preventDefault();
return;
}else{
// setTimeout(function(){
self.toggleEvents(swipeHandle,callback);
// }, 100)
}
}
}
}
})
// window.addEventListener('touchmove', function(event){
// if(swipeHandle){
// // event.preventDefault();
// // self.setTranslate(swipeHandle,"0px");
// // swipeHandle.classList.remove("aui-swipe-opened");
// // swipeHandle = false;
// // return;
// }
// if(document.querySelector(".aui-swipe-opened")){
// event.preventDefault();
// if(swipeHandle != document.querySelector(".aui-swipe-opened")){
// self.setTranslate(document.querySelector(".aui-swipe-opened"),"0px");
// document.querySelector(".aui-swipe-opened").classList.remove("aui-swipe-opened");
// isOpened = false;
// event.stopPropagation()
// return;
// }
// }
// })
window.addEventListener("touchmove", function(){
})
},
toggleEvents:function(element,callback){
if(!swipeHandle){
return;
}
var self = this;
self.setTransform(element,300);
element.addEventListener('touchstart', function(event){
// if(element.className.indexOf("aui-swipe-opened") > -1){
// self.setTranslate(element,"0px");
// element.classList.remove("aui-swipe-opened");
// return;
// }
//:active样式引起列表背景色冲突
element.parentNode.style.backgroundColor = "#ffffff";
if(!element.nextSibling)return;
},false)
element.addEventListener('touchmove', function(event){
if(document.querySelector(".aui-swipe-opened")){
event.preventDefault();
if(swipeHandle != document.querySelector(".aui-swipe-opened")){
self.setTranslate(document.querySelector(".aui-swipe-opened"),"0px");
document.querySelector(".aui-swipe-opened").classList.remove("aui-swipe-opened");
isOpened = false;
event.stopPropagation()
return;
}
}
// self.getAngle(event)
self.setTransform(element,0);
// if(element.className.indexOf("aui-swipe-opened") > -1)return;
if(element.parentNode.querySelector(".aui-swipe-btn")){
btnWidth = element.parentNode.querySelector(".aui-swipe-btn").offsetWidth;
}
// 列表触摸滑动时如果有已经显示的将其关闭,并退出。
var touchMoveObj = event.changedTouches[0],
touchX = touchMoveObj.clientX;
touchXDelta = -Math.pow(firstTouchX-touchX, 0.85);
handleTranslateVal = touchXDelta/friction;
// touchXDelta = touchX - firstTouchX;
// handleTranslateVal = touchXDelta/0.15;
// console.log(handleTranslateVal)
var moveX = touchMoveObj.clientX - firstTouchX;
var moveY = touchMoveObj.clientY - firstTouchY;
var direction = self.getDirection(moveX,moveY);
var angle = self.getAngle(Math.abs(moveX),Math.abs(moveY));
// console.log(isMoved);
// // 解决滑动屏幕返回时事件冲突,主要针对部分特殊机型
// if(touchMoveObj.screenX < 0){
// firstTouchxy = '';
// }
if(direction == "right"){
isMoved = false;
event.preventDefault();
}
if(direction == "top" || direction == "down"){
isMoved = false;
return;
}
if(angle <= 15 && direction === 'left'){
event.preventDefault()
isMoved = true;
}
// console.log(handleTranslateVal)
// if(isMoved)self.setTranslate(element,""+(handleTranslateVal+10)+"px");
if((event.timeStamp - firstTouchTime) >= 100 && touchXDelta < 0 && touchMoveObj.screenX > 0 && isMoved){
// event.stopPropagation();
// element.classList.add("aui-swipe-moving");
// event.preventDefault();
if(element.className.indexOf("aui-swipe-opened") <= -1){
if((handleTranslateVal+10) > -btnWidth){
self.setTranslate(element,""+(handleTranslateVal+10)+"px");
}
}else{
return
}
}
},false)
element.addEventListener('touchend', function(event){
self.setTransform(element,300);
var touchEndObj = event.changedTouches[0];
var touchEndxy = {
x: touchEndObj.clientX || 0,
y: touchEndObj.clientY || 0
};
var toucheEndX = touchEndObj.clientX - firstTouchX;
var toucheEndY = touchEndObj.clientY - firstTouchY;
var direction = self.getDirection(toucheEndX,toucheEndY);
// element.classList.remove("aui-swipe-moving");
if(direction=='left' && handleTranslateVal < (-btnWidth/3) && isMoved){
self.setTranslate(element,""+-btnWidth+"px");
element.classList.add("aui-swipe-opened");
callback({
'status':true,
'dom':element
})
isOpened = true;
}else{
element.classList.remove("aui-swipe-opened");
self.setTranslate(element,"0px");
isOpened = false;
}
// isMoved = false;
console.log(isOpened)
},true)
},
setTransform : function (el,value){
el.style.webkitTransitionDuration = el.style.transitionDuration = value+'ms';
},
setTranslate : function (el,value){
if(el)el.style.webkitTransform = el.style.transform = "translate3d("+value+",0,0)";
},
getDistance : function(p1, p2, props) {
if (!props) { props = ['x', 'y'];}
var x = p2[props[0]] - p1[props[0]];
var y = p2[props[1]] - p1[props[1]];
return Math.sqrt((x * x) + (y * y));
},
getAngle:function(moveX, moveY){
// var x = Math.abs(x1 - x2);
// var y = Math.abs(y1 - y2);
var z = Math.sqrt(moveX*moveX + moveY*moveY);
return Math.round((Math.asin(moveY / z) / Math.PI*180));
},
getDirection : function(x, y) {
if (x === y) { return '';}
if (Math.abs(x) >= Math.abs(y)) {
return x > 0 ? 'right' : 'left';
} else {
return y > 0 ? 'down' : 'up';
}
}
}
window.auiListSwipe = auiListSwipe;
})(window);

View File

@@ -0,0 +1,221 @@
/**
* aui-list-swipe.js 列表页滑动菜单
* verson 0.0.3
* @author 流浪男 && Beck
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function(window) {
"use strict";
var translateVal,
friction = 1,
firstTouchX,
firstTouchxy,
firstTouchY,
firstTouch,
firstTouchTime,
touchXDelta,
handleTranslateVal;
var TranslateZero = "translate3d(0,0,0)",
TranslateCent = "translate3d(100%,0,0)";
var swipeHandle = false,
btnWidth = false,
swipeBtnsRight = false;
var isMoved = false,isOpened=false;
var d = false;
var auiListSwipe = function (callback) {
this._init(callback);
}
auiListSwipe.prototype = {
// var self = this;
_init: function(callback){
var self = this;
// var d = document.querySelectorAll("selectors")
window.addEventListener('touchstart', function(event){
// 如果已经打开,将已经打开的关闭
if(isOpened && swipeHandle){
// isOpened = false;
self.setTranslate(swipeHandle,"0px");
swipeHandle.classList.remove("aui-swipe-opened");
return;
}else{
var target = event.target;
// 过滤点击
for(; target && target !== document; target = target.parentNode){
// console.log(target.classList)
if (target.classList){
if (target.classList.contains("aui-swipe-handle")) {
swipeHandle = target;
firstTouch = event.changedTouches[0];
firstTouchX = firstTouch.clientX;
firstTouchY = firstTouch.clientY;
firstTouchTime = event.timeStamp;
if(swipeHandle.className.indexOf("aui-swipe-opened") > -1){
// console.log(1)
// self.setTranslate(swipeHandle,"0px");
// swipeHandle.classList.remove("aui-swipe-opened");
event.preventDefault();
return;
}else{
// setTimeout(function(){
self.toggleEvents(swipeHandle,callback);
// }, 100)
}
}
}
}
}
// if(swipeHandle){
// event.preventDefault();
// self.setTranslate(swipeHandle,"0px");
// swipeHandle.classList.remove("aui-swipe-opened");
// swipeHandle = false;
// return;
// }
// isMoved = false;
// swipeHandle = false;
})
},
toggleEvents:function(element,callback){
if(!swipeHandle){
return;
}
var self = this;
self.setTransform(element,300);
element.addEventListener('touchstart', function(event){
// if(element.className.indexOf("aui-swipe-opened") > -1){
// self.setTranslate(element,"0px");
// element.classList.remove("aui-swipe-opened");
// return;
// }
//:active样式引起列表背景色冲突
element.parentNode.style.backgroundColor = "#ffffff";
if(!element.nextSibling)return;
},false)
element.addEventListener('touchmove', function(event){
event.preventDefault();
if(document.querySelector(".aui-swipe-opened")){
event.preventDefault();
if(swipeHandle != document.querySelector(".aui-swipe-opened")){
self.setTranslate(document.querySelector(".aui-swipe-opened"),"0px");
document.querySelector(".aui-swipe-opened").classList.remove("aui-swipe-opened");
isOpened = false;
event.stopPropagation()
return;
}
}
// self.getAngle(event)
self.setTransform(element,0);
// if(element.className.indexOf("aui-swipe-opened") > -1)return;
if(element.parentNode.querySelector(".aui-swipe-btn")){
btnWidth = element.parentNode.querySelector(".aui-swipe-btn").offsetWidth;
}
// 列表触摸滑动时如果有已经显示的将其关闭,并退出。
var touchMoveObj = event.changedTouches[0],
touchX = touchMoveObj.clientX;
touchXDelta = -Math.pow(firstTouchX-touchX, 0.85);
handleTranslateVal = touchXDelta/friction;
// touchXDelta = touchX - firstTouchX;
// handleTranslateVal = touchXDelta/0.15;
// console.log(handleTranslateVal)
var moveX = touchMoveObj.clientX - firstTouchX;
var moveY = touchMoveObj.clientY - firstTouchY;
var direction = self.getDirection(moveX,moveY);
var angle = self.getAngle(Math.abs(moveX),Math.abs(moveY));
// console.log(isMoved);
// // 解决滑动屏幕返回时事件冲突,主要针对部分特殊机型
// if(touchMoveObj.screenX < 0){
// firstTouchxy = '';
// }
if(direction == "right"){
isMoved = false;
event.preventDefault();
}
if(direction == "top" || direction == "down"){
isMoved = false;
return;
}
if(angle <= 15 && direction === 'left'){
event.preventDefault()
isMoved = true;
}
// console.log(handleTranslateVal)
// if(isMoved)self.setTranslate(element,""+(handleTranslateVal+10)+"px");
if((event.timeStamp - firstTouchTime) >= 100 && touchXDelta < 0 && touchMoveObj.screenX > 0 && isMoved){
// event.stopPropagation();
// element.classList.add("aui-swipe-moving");
// event.preventDefault();
if(element.className.indexOf("aui-swipe-opened") <= -1){
if((handleTranslateVal+10) > -btnWidth){
self.setTranslate(element,""+(handleTranslateVal+10)+"px");
}
}else{
return
}
}
},false)
element.addEventListener('touchend', function(event){
self.setTransform(element,300);
var touchEndObj = event.changedTouches[0];
var touchEndxy = {
x: touchEndObj.clientX || 0,
y: touchEndObj.clientY || 0
};
var toucheEndX = touchEndObj.clientX - firstTouchX;
var toucheEndY = touchEndObj.clientY - firstTouchY;
var direction = self.getDirection(toucheEndX,toucheEndY);
// element.classList.remove("aui-swipe-moving");
if(direction=='left' && handleTranslateVal < (-btnWidth/3) && isMoved){
self.setTranslate(element,""+-btnWidth+"px");
element.classList.add("aui-swipe-opened");
callback({
'status':true,
'dom':element
})
// isOpened = true;
}else{
element.classList.remove("aui-swipe-opened");
self.setTranslate(element,"0px");
isOpened = false;
}
// isMoved = false;
console.log(isOpened)
},true)
},
setTransform : function (el,value){
el.style.webkitTransitionDuration = el.style.transitionDuration = value+'ms';
},
setTranslate : function (el,value){
if(el)el.style.webkitTransform = el.style.transform = "translate3d("+value+",0,0)";
},
getDistance : function(p1, p2, props) {
if (!props) { props = ['x', 'y'];}
var x = p2[props[0]] - p1[props[0]];
var y = p2[props[1]] - p1[props[1]];
return Math.sqrt((x * x) + (y * y));
},
getAngle:function(moveX, moveY){
// var x = Math.abs(x1 - x2);
// var y = Math.abs(y1 - y2);
var z = Math.sqrt(moveX*moveX + moveY*moveY);
return Math.round((Math.asin(moveY / z) / Math.PI*180));
},
getDirection : function(x, y) {
if (x === y) { return '';}
if (Math.abs(x) >= Math.abs(y)) {
return x > 0 ? 'right' : 'left';
} else {
return y > 0 ? 'down' : 'up';
}
}
}
window.auiListSwipe = auiListSwipe;
})(window);

View File

@@ -0,0 +1,135 @@
/**
* aui-popup.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiPopup = function() {
};
var isShow = false;
auiPopup.prototype = {
init: function(params,callback){
this.frameBounces = params.frameBounces;
this.location = params.location;
this.buttons = params.buttons;
this.maskDiv;
this.popupDiv;
var self = this;
self.open(params,callback);
},
open: function(params,callback) {
var buttonsHtml='',locationClass = 'aui-popup-top';
var self = this;
if(self.popupDiv){
self.close();
return;
}
if(!self.maskDiv){
self.maskDiv = document.createElement("div");
self.maskDiv.className = "aui-mask";
document.body.appendChild(self.maskDiv);
}
switch (self.location) {
case "top":
locationClass = 'aui-popup-top';
break;
case "top-left":
locationClass = 'aui-popup-top-left';
break;
case "top-right":
locationClass = 'aui-popup-top-right';
break;
case "bottom":
locationClass = 'aui-popup-bottom';
break;
case "bottom-left":
locationClass = 'aui-popup-bottom-left';
break;
case "bottom-right":
locationClass = 'aui-popup-bottom-right';
break;
default:
locationClass = 'aui-popup-top';
break;
}
self.popupDiv = document.createElement("div");
self.popupDiv.className = "aui-popup "+locationClass;
self.popupDiv.innerHTML = '<div class="aui-popup-arrow"></div><div class="aui-popup-content"></div>';
document.body.appendChild(self.popupDiv);
if(self.buttons && self.buttons.length){
buttonsHtml += '<ul class="aui-list aui-list-noborder">';
for(var i = 0; i < self.buttons.length;i++){
buttonsHtml += '<li class="aui-list-item aui-list-item-middle">';
buttonsHtml += '<div class="aui-list-item-label-icon"><img src="'+self.buttons[i].image+'"></div>';
buttonsHtml += '<div class="aui-list-item-inner">'+self.buttons[i].text+'</div>';
buttonsHtml += '</li>';
}
buttonsHtml += '</ul>';
}
document.querySelector(".aui-popup .aui-popup-content").insertAdjacentHTML('beforeend', buttonsHtml);
var actionsheetHeight = document.querySelector(".aui-popup").offsetHeight;
self.maskDiv.classList.add("aui-mask-in");
self.popupDiv.classList.add("aui-popup-in");
self.popupDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
self.maskDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:false
});
}
var popupButtons = document.querySelectorAll(".aui-popup .aui-list-item");
if(popupButtons && popupButtons.length > 0){
setTimeout(function(){
self.maskDiv.onclick = function(){self.close();return;};
for(var ii = 0; ii < popupButtons.length; ii++){
(function(e){
popupButtons[e].onclick = function(){
if(self.buttons[e].value){
var _value = self.buttons[e].value;
}else{
var _value = null;
}
if(callback){
callback({
buttonIndex: e+1,
buttonTitle: this.textContent,
buttonValue: _value
});
};
self.close();
return;
}
})(ii)
}
}, 350)
}
},
close: function(){
var self = this;
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:true
});
}
if(self.popupDiv){
var actionsheetHeight = self.popupDiv.offsetHeight;
self.popupDiv.classList.add("aui-popup-out");
self.maskDiv.style.opacity = 0;
setTimeout(function(){
if(self.maskDiv){
self.maskDiv.parentNode.removeChild(self.maskDiv);
}
self.popupDiv.parentNode.removeChild(self.popupDiv);
self.maskDiv = self.popupDiv = false;
}, 300)
}
}
};
window.auiPopup = auiPopup;
})(window);

View File

@@ -0,0 +1,94 @@
/**
* aui-popup.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiPopup = function() {
this._init();
};
var CLASS_MASK = "aui-mask",
CLASS_MASK_IN = 'aui-mask-in',
CLASS_MASK_OUT = 'aui-mask-out',
CLASS_POPUP = 'aui-popup',
CLASS_POPUP_IN = 'aui-popup-in',
CLASS_POPUP_OUT = 'aui-popup-out',
CLASS_POPUP_FOR = 'aui-popup-for';
var __MASK = '.'+CLASS_MASK,
__MASK_IN = '.'+CLASS_MASK_IN,
__MASK_OUT = '.'+CLASS_MASK_OUT,
__POPUP = '.'+CLASS_POPUP,
__POPUP_IN = '.'+CLASS_POPUP_IN,
__POPUP_OUT = '.'+CLASS_POPUP_OUT;
var popupStatus = false;
auiPopup.prototype = {
_init: function() {
var self = this;
var _btn = document.querySelectorAll("["+CLASS_POPUP_FOR+"]");
if(_btn){
for(var i=0;i<_btn.length;i++){
_btn[i].setAttribute("tapmode", "");
_btn[i].onclick = function(e){
var popupId = this.getAttribute(CLASS_POPUP_FOR);
var popupDom = document.getElementById(popupId);
if(popupDom){
if(popupDom.className.indexOf(CLASS_POPUP_IN) > -1 || document.querySelector(__POPUP_IN)){
self.hide(popupDom);
}else{
self.show(popupDom);
}
}else{
return;
}
}
}
}
},
show: function(el){
var self = this;
if(el.className.indexOf(CLASS_POPUP_IN) > -1 || document.querySelector(__POPUP_IN)){
self.hide(el);
return;
}
if(popupStatus) return;
if(!document.querySelector(__MASK)){
var maskHtml = '<div class="aui-mask"></div>';
document.body.insertAdjacentHTML('beforeend', maskHtml);
}
el.style.display = "block";
setTimeout(function(){
document.querySelector(__MASK).classList.add(CLASS_MASK_IN);
el.classList.add(CLASS_POPUP_IN);
popupStatus = true;
}, 10)
document.querySelector(__MASK).addEventListener("touchstart", function(event){
event.preventDefault();
self.hide(el);
})
el.addEventListener("touchmove", function(event){
event.preventDefault();
},false)
},
hide: function(el){
if(!popupStatus) return;
document.querySelector(__MASK).classList.remove(CLASS_MASK_IN);
document.querySelector(__MASK).classList.add(CLASS_MASK_OUT);
if(!document.querySelector(__POPUP_IN))return;
document.querySelector(__POPUP_IN).classList.add(CLASS_POPUP_OUT);
document.querySelector(__POPUP_IN).classList.remove(CLASS_POPUP_IN);
setTimeout(function(){
if(!document.querySelector(__POPUP_OUT))return;
document.querySelector(__POPUP_OUT).style.display = "none";
document.querySelector(__POPUP_OUT).classList.remove(CLASS_POPUP_OUT);
if(document.querySelector(__MASK)){
document.querySelector(__MASK).parentNode.removeChild(document.querySelector(__MASK));
}
popupStatus = false;
}, 300)
}
};
window.auiPopup = auiPopup;
})(window);

View File

@@ -0,0 +1,174 @@
/**
* aui-pull-refresh.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function(window) {
'use strict';
/**
* Extend obj function
*
* This is an object extender function. It allows us to extend an object
* by passing in additional variables and overwriting the defaults.
*/
var auiPullToRefresh = function (params,callback) {
this.extend(this.params, params);
this._init(callback);
}
var touchYDelta;
var isLoading = false;
var docElem = window.document.documentElement,
loadWrapH,
win = {width: window.innerWidth, height: window.innerHeight},
winfactor= 0.2,
translateVal,
isMoved = false,
firstTouchY, initialScroll;
auiPullToRefresh.prototype = {
params: {
container: document.querySelector('.aui-refresh-content'),
friction: 2.5,
triggerDistance: 100,
callback:false
},
_init : function(callback) {
var self = this;
var loadingHtml = '<div class="aui-refresh-load"><div class="aui-refresh-pull-arrow"></div></div>';
self.params.container.insertAdjacentHTML('afterbegin', loadingHtml);
self.params.container.addEventListener('touchstart', function(ev){
self.touchStart(ev)
});
self.params.container.addEventListener('touchmove', function(ev){
self.touchMove(ev)
});
self.params.container.addEventListener('touchend', function(ev){
self.touchEnd(ev,callback);
});
},
touchStart : function(ev) {
// this.params.container.classList.remove("refreshing");
if (isLoading) {
return;
}
isMoved = false;
this.params.container.style.webkitTransitionDuration =
this.params.container.style.transitionDuration = '0ms';
touchYDelta = '';
var touchobj = ev.changedTouches[0];
// register first touch "y"
firstTouchY = parseInt(touchobj.clientY);
initialScroll = this.scrollY();
},
touchMove : function (ev) {
if (isLoading) {
ev.preventDefault();
return;
}
var self = this;
var moving = function() {
var touchobj = ev.changedTouches[0], // reference first touch point for this event
touchY = parseInt(touchobj.clientY);
touchYDelta = touchY - firstTouchY;
if ( self.scrollY() === 0 && touchYDelta > 0 ) {
ev.preventDefault();
}
if ( initialScroll > 0 || self.scrollY() > 0 || self.scrollY() === 0 && touchYDelta < 0 ) {
firstTouchY = touchY;
return;
}
translateVal = Math.pow(touchYDelta, 0.85);
self.params.container.style.webkitTransform = self.params.container.style.transform = 'translate3d(0, ' + translateVal + 'px, 0)';
isMoved = true;
if(touchYDelta > self.params.triggerDistance){
self.params.container.classList.add("aui-refresh-pull-up");
self.params.container.classList.remove("aui-refresh-pull-down");
}else{
self.params.container.classList.add("aui-refresh-pull-down");
self.params.container.classList.remove("aui-refresh-pull-up");
}
};
this.throttle(moving(), 20);
},
touchEnd : function (ev,callback) {
var self =this;
if (isLoading|| !isMoved) {
isMoved = false;
return;
}
// 根据下拉高度判断是否加载
if( touchYDelta >= this.params.triggerDistance) {
isLoading = true; //正在加载中
ev.preventDefault();
this.params.container.style.webkitTransitionDuration =
this.params.container.style.transitionDuration = '300ms';
this.params.container.style.webkitTransform =
this.params.container.style.transform = 'translate3d(0,60px,0)';
document.querySelector(".aui-refresh-pull-arrow").style.webkitTransitionDuration =
document.querySelector(".aui-refresh-pull-arrow").style.transitionDuration = '0ms';
self.params.container.classList.add("aui-refreshing");
if(callback){
callback({
status:"success"
});
}
}else{
this.params.container.style.webkitTransitionDuration =
this.params.container.style.transitionDuration = '300ms';
this.params.container.style.webkitTransform =
this.params.container.style.transform = 'translate3d(0,0,0)';
if(callback){
callback({
status:"fail"
});
}
}
isMoved = false;
return;
},
cancelLoading : function () {
var self =this;
isLoading = false;
self.params.container.classList.remove("aui-refreshing");
document.querySelector(".aui-refresh-pull-arrow").style.webkitTransitionDuration =
document.querySelector(".aui-refresh-pull-arrow").style.transitionDuration = '300ms';
this.params.container.style.webkitTransitionDuration =
this.params.container.style.transitionDuration = '0ms';
self.params.container.style.webkitTransform =
self.params.container.style.transform = 'translate3d(0,0,0)';
self.params.container.classList.remove("aui-refresh-pull-up");
self.params.container.classList.add("aui-refresh-pull-down");
return;
},
scrollY : function() {
return window.pageYOffset || docElem.scrollTop;
},
throttle : function(fn, delay) {
var allowSample = true;
return function(e) {
if (allowSample) {
allowSample = false;
setTimeout(function() { allowSample = true; }, delay);
fn(e);
}
};
},
winresize : function () {
var resize = function() {
win = {width: window.innerWidth, height: window.innerHeight};
};
throttle(resize(), 10);
},
extend: function(a, b) {
for (var key in b) {
if (b.hasOwnProperty(key)) {
a[key] = b[key];
}
}
return a;
}
}
window.auiPullToRefresh = auiPullToRefresh;
})(window);

View File

@@ -0,0 +1,53 @@
/*
* AUI JAVASCRIPT PLUGIN
* 滑动 aui-range
* Copyright (c) 2015 auicss.com @流浪男 QQ:343757327 群:344869952
*/
(function( window, undefined ) {
"use strict";
var auiRange = function(params,callback) {
this._init(params,callback);
};
var time=null;
var distance,offsetLeft,tooltipWidth;
auiRange.prototype = {
_init: function(params,callback) {
var self = this;
distance = Math.abs(params.element.max - params.element.min);
offsetLeft = params.element.offsetLeft;
tooltipWidth = params.element.offsetWidth - 28;
params.element.insertAdjacentHTML('afterend','<div class="aui-range-tip aui-hide">'+params.element.value+'</div>');
var scaleWidth = (tooltipWidth / distance) * Math.abs(params.element.value - params.element.min);
params.element.nextSibling.style.left = (offsetLeft + scaleWidth - 11)+'px';
params.element.addEventListener("input",function(){
self._showTip(params.element,callback);
});
params.element.addEventListener("touchmove",function(){
self._showTip(params.element,callback);
});
params.element.addEventListener("touchend",function(){
self._hideTip(params.element);
});
},
_showTip: function(el,callback){
el.nextSibling.classList.remove("aui-hide");
var scaleWidth = (tooltipWidth / distance) * Math.abs(el.value - el.min);
el.nextSibling.style.left = (offsetLeft + scaleWidth - 11)+'px';
el.nextSibling.innerText = el.value;
callback({
value:el.value
});
},
_hideTip : function(el){
if (time) {
clearTimeout(time);
}
time = setTimeout(function() {
el.nextSibling.classList.add("aui-hide");
}, 1500);
}
}
window.auiRange = auiRange;
})(window);

View File

@@ -0,0 +1,66 @@
/**
* aui-scroll.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function(window) {
'use strict';
var isToBottom = false,isMoved = false;
var auiScroll = function (params,callback) {
this.extend(this.params, params);
this._init(params,callback);
}
auiScroll.prototype = {
params: {
listren:false,
distance: 100
},
_init : function(params,callback) {
var self = this;
if(self.params.listen){
document.body.addEventListener("touchmove", function(e){
self.scroll(callback);
});
document.body.addEventListener("touchend", function(e){
self.scroll(callback);
});
}
window.onscroll = function(){
self.scroll(callback);
}
},
scroll : function (callback) {
var self = this;
var clientHeight = document.documentElement.scrollTop === 0 ? document.body.clientHeight : document.documentElement.clientHeight;
var scrollTop = document.documentElement.scrollTop === 0 ? document.body.scrollTop : document.documentElement.scrollTop;
var scrollHeight = document.documentElement.scrollTop === 0 ? document.body.scrollHeight : document.documentElement.scrollHeight;
if (scrollHeight-scrollTop-self.params.distance <= window.innerHeight) {
isToBottom = true;
if(isToBottom){
callback({
"scrollTop":scrollTop,
"isToBottom":true
})
}
}else{
isToBottom = false;
callback({
"scrollTop":scrollTop,
"isToBottom":false
})
}
},
extend: function(a, b) {
for (var key in b) {
if (b.hasOwnProperty(key)) {
a[key] = b[key];
}
}
return a;
}
}
window.auiScroll = auiScroll;
})(window);

View File

@@ -0,0 +1,119 @@
/**
* aui-sharebox.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiSharebox = function() {
};
var isShow = false;
auiSharebox.prototype = {
init: function(params,callback){
this.frameBounces = params.frameBounces;
this.col = params.col;
this.buttons = params.buttons;
this.cancelTitle = params.cancelTitle;
this.maskDiv;
this.shareBoxDiv;
var self = this;
self.open(params,callback);
},
open: function(params,callback) {
var shareboxHtml='',buttonsHtml = '';
var self = this;
if(self.shareBoxDiv || !self.buttons)return;
if(!self.maskDiv){
self.maskDiv = document.createElement("div");
self.maskDiv.className = "aui-mask";
document.body.appendChild(self.maskDiv);
}
if(!self.col)self.col = 5;
self.shareBoxDiv = document.createElement("div");
self.shareBoxDiv.className = "aui-sharebox aui-grid";
document.body.appendChild(self.shareBoxDiv);
if(self.buttons && self.buttons.length){
buttonsHtml = '<div class="aui-row aui-row-padded">';
for(var i = 0; i < self.buttons.length;i++){
if(self.col == 5){
buttonsHtml += '<div class="aui-col-5 aui-sharebox-btn">';
}else{
buttonsHtml += '<div class="aui-col-xs-'+(12/self.col)+' aui-sharebox-btn">';
}
if(self.buttons[i].image)buttonsHtml += '<img src="'+self.buttons[i].image+'">';
if(self.buttons[i].text)buttonsHtml += '<div class="aui-grid-label">'+self.buttons[i].text+'</div>';
buttonsHtml += '</div>';
}
buttonsHtml += '</div>';
}
if(self.cancelTitle){
buttonsHtml += '<div class="aui-sharebox-close-btn aui-border-t">'+this.cancelTitle+'</div>';
}
self.shareBoxDiv.innerHTML = buttonsHtml;
var actionsheetHeight = self.shareBoxDiv.offsetHeight;
self.maskDiv.classList.add("aui-mask-in");
self.shareBoxDiv.style.webkitTransform = self.shareBoxDiv.style.transform = "translate3d(0,0,0)";
self.shareBoxDiv.style.opacity = 1;
self.shareBoxDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
self.maskDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:false
});
}
var shareboxButtons = document.querySelectorAll(".aui-sharebox-btn");
if(shareboxButtons && shareboxButtons.length > 0){
setTimeout(function(){
self.maskDiv.onclick = function(){self.close();return;};
for(var ii = 0; ii < shareboxButtons.length; ii++){
(function(e){
shareboxButtons[e].onclick = function(){
if(self.buttons[e].value){
var _value = self.buttons[e].value;
}else{
var _value = null;
}
if(callback){
callback({
buttonIndex: e+1,
buttonValue:_value
});
};
self.close();
return;
}
})(ii)
}
}, 350)
}
document.querySelector(".aui-sharebox-close-btn").onclick = function(){self.close();return;};
},
close: function(){
var self = this;
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:true
});
}
if(self.shareBoxDiv){
var actionsheetHeight = self.shareBoxDiv.offsetHeight;
self.shareBoxDiv.style.webkitTransform = self.shareBoxDiv.style.transform = "translate3d(0,"+actionsheetHeight+"px,0)";
self.maskDiv.style.opacity = 0;
setTimeout(function(){
if(self.maskDiv){
self.maskDiv.parentNode.removeChild(self.maskDiv);
}
self.shareBoxDiv.parentNode.removeChild(self.shareBoxDiv);
self.maskDiv = self.shareBoxDiv = false;
}, 300)
}
}
};
window.auiSharebox = auiSharebox;
})(window);

View File

@@ -0,0 +1,89 @@
/**
* aui-skin.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiSkin = function(params) {
this.extend(this.params, params);
this._init();
};
var fileRef;
auiSkin.prototype = {
params: {
name: "", //主题名字
skinPath: "",//主题路径
default: false, //默认是否立即使用
beginTime: "",//开始时间
endTime: ""//结束时间
},
_init: function() {
var self = this;
if(!self.params.name)return;
if(!self.params.skinPath)return;
fileRef = document.createElement('link');
fileRef.setAttribute("rel","stylesheet");
fileRef.setAttribute("type","text/css");
fileRef.setAttribute("aui-skin-name",self.params.name);
fileRef.setAttribute("href",self.params.skinPath);
if(self.params.default){
document.getElementsByTagName("head")[0].appendChild(fileRef);
}else{
if(!self.params.beginTime || !self.params.endTime)return;
if(!self.check(self.params.beginTime,self.params.endTime))return;
var _date = new Date();
if(_date.getMinutes() < 10){
var nowM = "0"+_date.getMinutes();
}else{
var nowM = _date.getMinutes();
}
var nowTime = _date.getHours()+":"+nowM;
var b = parseInt(self.params.beginTime.replace(":", ''));
var e = parseInt(self.params.endTime.replace(":", ''));
var n = parseInt(nowTime.replace(":", ''));
if(b > e){
if(n >= b || n <= e)self.setSkin();
}else if(b < e){
if(n >= b && n <= e)self.setSkin();
}else{
self.removeSkin();
}
}
},
setSkin:function(){
document.getElementsByTagName("head")[0].appendChild(fileRef);
},
removeSkin:function(){
var self = this;
if(document.querySelector("link[aui-skin-name='"+self.params.name+"']"))
document.querySelector("link[aui-skin-name='"+self.params.name+"']").parentNode.removeChild(document.querySelector("link[aui-skin-name='"+self.params.name+"']"));
},
check:function(beginTime,endTime){
var strb = beginTime.split (":");
if (strb.length != 2)return false;
var stre = endTime.split (":");
if (stre.length != 2)return false;
var b = new Date ();
var e = new Date ();
b.setHours (strb[0]);
b.setMinutes (strb[1]);
e.setHours (stre[0]);
e.setMinutes (stre[1]);
if(strb[0] > 24 || strb[0] < 0 || stre[0] > 24 || stre[0] < 0)return false;
if(strb[1] > 59 || strb[1] < 0 || stre[1] > 59 || stre[1] < 0)return false;
return true;
},
extend: function(a, b) {
for (var key in b) {
if (b.hasOwnProperty(key)) {
a[key] = b[key];
}
}
return a;
}
};
window.auiSkin = auiSkin;
})(window);

View File

@@ -0,0 +1,333 @@
/**
* aui-slide.js 轮播组件
* @author 流浪男
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function(window) {
"use strict";
var translateVal,
firstTouchX,
firstTouchY,
touchXDelta,
handleTranslateVal;
var touchStartTime; //开始触摸事件
var offsetX,
offsetY,
isScrolling;
// CLASS 组装
var CLASS_SLIDER_NODE = "aui-slide-node",
CLASS_SLIDE_PAGE_WRAP = "aui-slide-page-wrap",
CLASS_SLIDE_PAGE = "aui-slide-page",
CLASS_SLIDE_PAGE_ACTIVE = "aui-slide-page-active",
CLASS_SLIDE_PAGE_DOT = "aui-slide-page-dot",
CLASS_SLIDE_PAGE_LINE = "aui-slide-page-line";
var __SLIDER_NODE = "."+CLASS_SLIDER_NODE,
__SLIDE_PAGE_WRAP = "."+CLASS_SLIDE_PAGE_WRAP,
__SLIDE_PAGE = "."+CLASS_SLIDE_PAGE,
__SLIDE_PAGE_ACTIVE = "."+CLASS_SLIDE_PAGE_ACTIVE;
auiSlide.prototype.options = {
container:'',
width:'auto',
height:'auto',
speed: 300, //滑动速速
autoPlay: 0, //自动播放
pageShow: true, //是否显示分页器
pageStyle: 'dot',
dotPosition: 'center',
friction:1, //阻力
loop:true,
currentPage:false,
PageCount:false
};
auiSlide.prototype._init = function(options) {
extend(this.options, options);
if(!this.options.container){
return;
}
this.index = 0; //索引值
this.continuous = true;//用于判断长度为2时的特殊处理
this.container = this.options.container;
// console.log(this.options.loop);
this.loop = this.options.loop;
this.speed = this.options.speed;
this.container.style.position = "relative";
this.container.style.width = this.options.width+"px";
this.container.style.height = this.options.height+"px";
var element = this.container.children[0];
this.slideWrap = element;
this.slideNodeList = this.slideWrap.querySelectorAll(__SLIDER_NODE);
if(!element || !this.slideNodeList){
return;
}
// this.options.pageCount(this.slideNodeList.length);
this.slideWrapWidth = this.slideWrap.offsetWidth;
this.slideNodeListLength = this.slideNodeList.length;
if (this.slideNodeListLength == 2) { //当长度为2时作特殊处理
element.appendChild(this.slideWrap.children[0].cloneNode(true));
element.appendChild(this.slideWrap.children[1].cloneNode(true));
this.slideWrap = element;
this.slideNodeList = this.slideWrap.querySelectorAll(__SLIDER_NODE);
this.slideNodeListLength = this.slideNodeList.length;
this.continuous = false;
}
for (var i = 0; i < this.slideNodeListLength; i++) {
this.slideNodeList[i] && (this.slideNodeList[i].style.webkitTransform = this.slideNodeList[i].style.transform = "translate3d("+(this.slideWrapWidth*i)+"px,0,0)");
}
if(this.slideNodeListLength > 1) {
if(this.options.pageShow){
this.createPagination(0);
this.setPageDotPosition();
}
if(this.options.autoPlay > 500 && this.loop){
this.autoPlay(0);
}
this.slideWrap.addEventListener('touchstart', this.touchStart.bind(this), false);
this.slideWrap.addEventListener('touchmove', this.touchMove.bind(this), false);
this.slideWrap.addEventListener('touchend', this.touchEnd.bind(this), false);
}
};
// 当分页器为圆点时位置设置
auiSlide.prototype.setPageDotPosition = function(){
var self = this;
var pageDotPosition = self.options.dotPosition;
this.container.querySelector(__SLIDE_PAGE_WRAP).style.textAlign = pageDotPosition;
};
// 自动播放
auiSlide.prototype.autoPlay = function (index) {
var self = this;
setInterval(function(){
self.slideTo(self.getCircle(self.index-1), -self.slideWrapWidth, 0);
self.slideTo(self.getCircle(self.index+2), self.slideWrapWidth, 0);
self.slideTo(self.index, -self.slideWrapWidth, self.options.speed);
self.slideTo(self.getCircle(self.index+1), 0, self.options.speed);
self.index = self.getCircle(self.index+1);
self.setPaginationActive(self.index);
}, self.options.autoPlay)
};
// 设置当前分页
auiSlide.prototype.setPaginationActive = function(index){
var self = this;
if(self.options.currentPage){
self.options.currentPage(index);
}
if(!this.container.querySelector(__SLIDE_PAGE_WRAP)){
return;
}
var pageList = this.container.querySelectorAll(__SLIDE_PAGE);
if(this.container.querySelector(__SLIDE_PAGE+__SLIDE_PAGE_ACTIVE)){
this.container.querySelector(__SLIDE_PAGE+__SLIDE_PAGE_ACTIVE).classList.remove(CLASS_SLIDE_PAGE_ACTIVE);
}
if(!this.continuous){
if(this.index == 3){
pageList[1].classList.add(CLASS_SLIDE_PAGE_ACTIVE);
}else if(this.index==2){
pageList[0].classList.add(CLASS_SLIDE_PAGE_ACTIVE);
}else{
pageList[this.index].classList.add(CLASS_SLIDE_PAGE_ACTIVE);
}
}else{
pageList[this.index].classList.add(CLASS_SLIDE_PAGE_ACTIVE);
}
};
// 创建分页器
auiSlide.prototype.createPagination = function(index){
var self = this;
var pageWrap = this.container.querySelector(__SLIDE_PAGE_WRAP);
if(!pageWrap){
return;
}
pageWrap.innerHTML = '';
var pageShowHtml = '';
switch (self.options.pageStyle) {
case "dot":// 原点
if (!this.continuous) {
for (var i = 0; i < 2; i++) {
pageShowHtml += '<span class="'+CLASS_SLIDE_PAGE+' '+CLASS_SLIDE_PAGE_DOT+'"></span>';
}
}else{
for (var i = 0; i < this.slideNodeListLength; i++) {
pageShowHtml += '<span class="'+CLASS_SLIDE_PAGE+' '+CLASS_SLIDE_PAGE_DOT+'"></span>';
}
}
pageWrap.innerHTML = pageShowHtml;
self.setPaginationActive(0);
break;
case "line":// 线条
if (!this.continuous) {
for (var i = 0; i < 2; i++) {
pageShowHtml += '<span class="'+CLASS_SLIDE_PAGE+' '+CLASS_SLIDE_PAGE_LINE+'" style="width:50%"></span>';
}
}else{
for (var i = 0; i < this.slideNodeListLength; i++) {
pageShowHtml += '<span class="'+CLASS_SLIDE_PAGE+' '+CLASS_SLIDE_PAGE_LINE+'" style="width:'+(100/this.slideNodeListLength)+'%"></span>';
}
}
pageWrap.innerHTML = pageShowHtml;
self.setPaginationActive(0);
break;
}
};
// 总页数
auiSlide.prototype.pageCount = function() {
var self = this;
return self.slideNodeList.length;
};
auiSlide.prototype.touchStart = function(event) {
touchStartTime = new Date() * 1;
firstTouchX = parseInt(event.changedTouches[0].pageX);
firstTouchY = parseInt(event.changedTouches[0].pageY);
isScrolling = undefined;
};
auiSlide.prototype.touchMove = function(event) {
var touchMoveObj = event.changedTouches[0],
touchX = parseInt(touchMoveObj.pageX);
touchXDelta = touchX - firstTouchX;
handleTranslateVal = touchXDelta/this.options.friction;
// 滑动位移
offsetX = parseInt(touchMoveObj.pageX) - firstTouchX;
offsetY = parseInt(touchMoveObj.pageY) - firstTouchY;
var direction = this.getDirection(offsetX,offsetY);
if ( typeof isScrolling == 'undefined') {
isScrolling = !!( isScrolling || Math.abs(offsetX) < Math.abs(offsetY) );
}
if(!isScrolling){
event.preventDefault();
if(!this.loop){ //不循环
if(!this.continuous && this.index==1 && direction=='left'){
return;
}
if(!this.continuous && this.index==0 && direction=='right'){
return;
}
if(this.index == this.slideNodeList.length-1){
if(handleTranslateVal <= 0){
return;
}
this.setTranslate(this.getCircle(this.index-1), handleTranslateVal - this.slideWrapWidth, 0);
}else if(this.index == 0){
if(handleTranslateVal >= 0){
return;
}
this.setTranslate(this.getCircle(this.index+1), this.slideWrapWidth, 0);
}
}
this.setTranslate(this.getCircle(this.index-1), handleTranslateVal - this.slideWrapWidth, 0);
this.setTranslate(this.index, handleTranslateVal , 0);
this.setTranslate(this.getCircle(this.index+1), handleTranslateVal + this.slideWrapWidth, 0);
}
};
auiSlide.prototype.touchEnd = function(event) {
var touchEndObj = event.changedTouches[0];
var touchEndX = parseInt(touchEndObj.pageX) - firstTouchX;
var touchEndY = parseInt(touchEndObj.pageY) - firstTouchY;
var touchEndxy = {
x: touchEndObj.pageX || 0,
y: touchEndObj.pageY || 0
};
var moveDirection = this.getDirection(touchEndX,touchEndY); //滑动方向
var boundary = this.slideWrapWidth/4;
var duration = (new Date() * 1) - touchStartTime;
var isValid = Number(duration) < 250 && Math.abs(offsetX) > 20 || Math.abs(offsetX) > boundary;
if (isScrolling) {
return;
}
if(isValid){
if(offsetX < 0){
if(!this.loop && this.index == this.slideNodeList.length-1){
return;
}
if(!this.loop && !this.continuous && this.index==1){
return;
}
if(offsetX < -boundary && moveDirection == 'left'){
// left
this.slideTo(this.getCircle(this.index-1), -this.slideWrapWidth, 0);
this.slideTo(this.getCircle(this.index+2), this.slideWrapWidth, 0);
this.slideTo(this.index, -this.slideWrapWidth, this.speed);
this.slideTo(this.getCircle(this.index+1), 0, this.speed);
this.index = this.getCircle(this.index+1);
}else{
// this.slideTo(this.getCircle(this.index-1), -this.slideWrapWidth, this.speed);
this.slideTo(this.index, 0, this.speed);
this.slideTo(this.getCircle(this.index+1), this.slideWrapWidth, this.speed);
}
}else if(offsetX > 0){
if(!this.loop && this.index == 0){
return;
}
if(!this.loop && !this.continuous && this.index==0){
return;
}
if(offsetX > boundary && moveDirection == 'right'){
// right
this.slideTo(this.getCircle(this.index+1), this.slideWrapWidth, 0);
this.slideTo(this.getCircle(this.index-2), -this.slideWrapWidth, 0);
this.slideTo(this.index, this.slideWrapWidth, this.speed);
this.slideTo(this.getCircle(this.index-1), 0, this.speed);
this.index = this.getCircle(this.index-1);
}else{
// this.slideTo(this.getCircle(this.index-1), -this.slideWrapWidth, this.speed);
this.slideTo(this.index, 0, this.speed);
this.slideTo(this.getCircle(this.index+1), this.slideWrapWidth, this.speed);
}
}
}else{
if(offsetX){
this.slideTo(this.getCircle(this.index-1), -this.slideWrapWidth, this.speed);
this.slideTo(this.index, 0, this.speed);
this.slideTo(this.getCircle(this.index+1), this.slideWrapWidth, this.speed);
}
}
this.setPaginationActive(this.index);
};
auiSlide.prototype.setTranslate = function (index,dist,speed){
if(this.slideNodeList[index]){
this.slideNodeList[index].style.webkitTransitionDuration =
this.slideNodeList[index].style.transitionDuration = speed + 'ms';
this.slideNodeList[index].style.webkitTransform =
this.slideNodeList[index].style.transform = "translate3d("+dist+"px,0,0)";
}
};
auiSlide.prototype.slideTo = function (index, dist, speed) {
this.setTranslate(index, dist, speed);
// index = dist;
};
auiSlide.prototype.getCircle = function (index) {
return (this.slideNodeListLength + (index % this.slideNodeListLength)) % this.slideNodeListLength;
};
auiSlide.prototype.getDirection = function(x, y) {
if (x === y) { return '';}
if (Math.abs(x) >= Math.abs(y)) {
return x > 0 ? 'right' : 'left';
} else {
return y > 0 ? 'down' : 'up';
}
}
function extend (a, b) {
for (var key in b) {
if (b.hasOwnProperty(key)) {
a[key] = b[key];
}
}
return a;
}
function auiSlide (options) {
this._init(options);
}
window.auiSlide = auiSlide;
})(window);

View File

@@ -0,0 +1,69 @@
/**
* aui-tab.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiTab = function(params,callback) {
this.extend(this.params, params);
this._init(callback);
};
var tabItems;
auiTab.prototype = {
params: {
element: false,
index: 1, //默认选中
repeatClick: false //是否允许重复点击
},
_init: function(callback) {
var self = this;
if(!self.params.element || self.params.element.nodeType!=1){
return;
}
tabItems = self.params.element.children;
if(tabItems){
self.setActive();
for(var i=0; i<tabItems.length; i++){
tabItems[i].setAttribute("tapmode","");
tabItems[i].setAttribute("data-item-order",i);
tabItems[i].onclick = function(e){
if(!self.params.repeatClick){
if(this.className.indexOf("aui-active") > -1)return;
}
if(callback){
callback({
index: parseInt(this.getAttribute("data-item-order"))+1,
dom:this
})
};
this.parentNode.querySelector(".aui-active").classList.remove("aui-active");
this.classList.add("aui-active");
}
}
}
},
setRepeat:function(value){
var self = this;
self.params.repeatClick = value ? value : false;
},
setActive: function(index){
var self = this;
index = index ? index : self.params.index;
var _tab = tabItems[index-1];
if(_tab.parentNode.querySelector(".aui-active"))_tab.parentNode.querySelector(".aui-active").classList.remove("aui-active");
_tab.classList.add("aui-active");
},
extend: function(a, b) {
for (var key in b) {
if (b.hasOwnProperty(key)) {
a[key] = b[key];
}
}
return a;
}
};
window.auiTab = auiTab;
})(window);

View File

@@ -0,0 +1,92 @@
/**
* aui-popup.js
* @author 流浪男
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiToast = function() {
// this.create();
};
var isShow = false;
auiToast.prototype = {
create: function(params,callback) {
var self = this;
var toastHtml = '';
switch (params.type) {
case "success":
var iconHtml = '<i class="aui-iconfont aui-icon-correct"></i>';
break;
case "fail":
var iconHtml = '<i class="aui-iconfont aui-icon-close"></i>';
break;
case "custom":
var iconHtml = params.html;
break;
case "loading":
var iconHtml = '<div class="aui-toast-loading"></div>';
break;
}
var titleHtml = params.title ? '<div class="aui-toast-content">'+params.title+'</div>' : '';
toastHtml = '<div class="aui-toast">'+iconHtml+titleHtml+'</div>';
if(document.querySelector(".aui-toast"))return;
document.body.insertAdjacentHTML('beforeend', toastHtml);
var duration = params.duration ? params.duration : "2000";
self.show();
if(params.type == 'loading'){
if(callback){
callback({
status: "success"
});
};
}else{
setTimeout(function(){
self.hide();
}, duration)
}
},
show: function(){
var self = this;
document.querySelector(".aui-toast").style.display = "block";
document.querySelector(".aui-toast").style.marginTop = "-"+Math.round(document.querySelector(".aui-toast").offsetHeight/2)+"px";
if(document.querySelector(".aui-toast"))return;
},
hide: function(){
var self = this;
if(document.querySelector(".aui-toast")){
document.querySelector(".aui-toast").parentNode.removeChild(document.querySelector(".aui-toast"));
}
},
remove: function(){
if(document.querySelector(".aui-dialog"))document.querySelector(".aui-dialog").parentNode.removeChild(document.querySelector(".aui-dialog"));
if(document.querySelector(".aui-mask")){
document.querySelector(".aui-mask").classList.remove("aui-mask-out");
}
return true;
},
success: function(params,callback){
var self = this;
params.type = "success";
return self.create(params,callback);
},
fail: function(params,callback){
var self = this;
params.type = "fail";
return self.create(params,callback);
},
custom:function(params,callback){
var self = this;
params.type = "custom";
return self.create(params,callback);
},
loading:function(params,callback){
var self = this;
params.type = "loading";
return self.create(params,callback);
}
};
window.auiToast = auiToast;
})(window);

View File

@@ -0,0 +1,38 @@
/**
* 首页的ajax请求中间层封装
*/
class IndexService {
async bannerIndex(params) {
return await http({
type: 'GET',
url: Config.apiUrl.bannerIndex,
data: params
})
}
async threeMeals(params) {
return await http({
type: 'GET',
url: Config.apiUrl.threeMeals,
data: params
})
}
async type(params) {
return await http({
type: 'GET',
url: Config.apiUrl.type,
data: params
})
}
async indexClass(params) {
return await http({
type: 'GET',
url: Config.apiUrl.indexClass,
data: params
})
}
}
var indexService = new IndexService()

View File

@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<link rel="stylesheet" type="text/css" href="./css/index.css">
<link rel="stylesheet" type="text/css" href="./css/public.css">
<link rel="stylesheet" type="text/css" href="./css/clear.css">
<link rel="stylesheet" type="text/css" href="./css/type.css">
<body>
<!-- 头部 -->
<div class="menu">
<input type="text" value="" placeholder="搜索百万免费菜谱">
</div>
<!-- 内容 -->
<div class="content_t">
<!-- 内容左边 -->
<ul class="left_menu">
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
<li>
<div class="back_img"></div>
<p>实用分类</p>
</li>
</ul>
<!-- 内容右边 -->
<div class="right_content">
qqqqqqqqqqqqqqq
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,113 @@
function http(option) {
return new Promise(function(resolve,reject) {
$.ajax({
type: option.type,
url: `${Config.BaseUrl}${option.url}`,
data: option.data,
success: function(res) {
if (res.status == 200) {
resolve(res.result)
} else {
alert(res.message)
}
},
error: function(err) {
reject(err);
},
})
});
}~

View File

@@ -0,0 +1,25 @@
function debounce(fn,delay) {
var timeout = null; // 创建一个标记用来存放定时器的返回值
return function (e) {
// 每当用户输入的时候把前一个 setTimeout clear 掉
clearTimeout(timeout);
// 然后又创建一个新的 setTimeout, 这样就能保证interval 间隔内如果时间持续触发,就不会执行 fn 函数
timeout = setTimeout(() => {
console.log("111111")
console.log( fn())
// fn.apply(this, arguments);
}, delay);
};
}
/**
*
* @param name
* @returns {string|null}
* @constructor
*/
function GetQueryString(name) {
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}

View File

@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<link rel="stylesheet" type="text/css" href="./css/index.css">
<link rel="stylesheet" type="text/css" href="./css/public.css">
<link rel="stylesheet" type="text/css" href="./css/clear.css">
<link rel="stylesheet" type="text/css" href="./css/vedio.css">
<body>
<!-- 头部 -->
<div class="menu">
<input type="text" value="" placeholder="搜索百万免费菜谱">
</div>
<!-- 内容 -->
<div class="content">
<div class="ms_img">
<a href="#">
<img src="https://st-cn.meishij.net/r/53/149/2912303/s2912303_149308557220266.jpg" alt="">
<div class="img_t">
<p>超受欢迎的蔬菜素烩汤</p>
<div class="yang">
<span>养</span>
</div>
<div class="b_t">
<span>鲜香可口,美味下饭</span>
</div>
<div class="tf">
<div class="tf_l">
<img src="https://st-cn.meishij.net/user/68/143/ns13598318_155093722619492.jpg" alt="">
<span>阿言美食</span>
</div>
<div class="tf_r">
<i class="icon-font icon-yanjing"></i>
<span>3</span>
</div>
</div>
</div>
</a>
</div>
</div>
</body>
</html>