Commit e42adbbd by hank

init

parents
File added
File added
{
"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"]
}
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
// 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'
}
}
.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
// 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": {}
}
}
# rujian
> 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).
# rujian
'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'
))
})
})
'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)
}
}
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
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 [MiniCssExtractPlugin.loader].concat(loaders)
} 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')
})
}
}
'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'
}
}
'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'),
'src': resolve('src')
}
},
module: {
rules: [
// ...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
// {
// test: /\.less$/,
// loader: 'style-loader!css-loader!less-loader'
// },
// {
// test:/\.css$/,
// loader:'css-loader!style-loader',
// },
{
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'
}
}
'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)
}
})
})
'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 MiniCssExtractPlugin = require('mini-css-extract-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')
console.log(webpack.optimize)
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
// splitChunks: {
// chunks: "initial", // 必须三选一: "initial" | "all"(默认就是all) | "async" minSize: 0, // 最小尺寸,默认0 minChunks: 1, // 最小 chunk ,默认1 maxAsyncRequests: 1, // 最大异步请求数, 默认1 maxInitialRequests : 1, // 最大初始化请求书,默认1 name: function(){}, // 名称,此选项可接收 function cacheGroups:{ // 这里开始设置缓存的 chunks priority: 0, // 缓存组优先级 vendor: { // key 为entry中定义的 入口名称 chunks: "initial", // 必须三选一: "initial" | "all" | "async"(默认就是异步) test: /react|lodash/, // 正则规则验证,如果符合就提取 chunk name: "vendor", // 要缓存的 分隔出来的 chunk 名称 minSize: 0, minChunks: 1, enforce: true, maxAsyncRequests: 1, // 最大异步请求数, 默认1 maxInitialRequests : 1, // 最大初始化请求书,默认1 reuseExistingChunk: true // 可设置是否重用该chunk(查看源码没有发现默认值) } } } },
// minSize: 0, // 最小尺寸,默认0
// minChunks: 1, // 最小 chunk ,默认1
// maxAsyncRequests: 1, // 最大异步请求数, 默认1
// maxInitialRequests: 1, // 最大初始化请求书,默认1
// name: function () { }, // 名称,此选项可接收 function
// cacheGroups: { // 这里开始设置缓存的 chunks
// priority: 0, // 缓存组优先级
// vendor: { // key 为entry中定义的 入口名称
// chunks: "initial", // 必须三选一: "initial" | "all" | "async"(默认就是异步)
// test: /react|lodash/, // 正则规则验证,如果符合就提取 chunk
// name: "vendor", // 要缓存的 分隔出来的 chunk 名称
// minSize: 0,
// minChunks: 1,
// enforce: true,
// maxAsyncRequests: 1, // 最大异步请求数, 默认1
// maxInitialRequests: 1, // 最大初始化请求书,默认1
// reuseExistingChunk: true // 可设置是否重用该chunk(查看源码没有发现默认值)
// }
// }
// },
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,
// }),
new MiniCssExtractPlugin({
filename: utils.assetsPath('css/[name].css'),
chunkFilename: utils.assetsPath('css/[name].[contenthash].css')
}),
// 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
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// new webpack.optimize.SplitChunksPlugin({
// chunks: "all",
// minSize: 20000,
// minChunks: 1,
// maxAsyncRequests: 5,
// maxInitialRequests: 3,
// name: true
// // splitChunks: {
// // chunks: "initial", // 必须三选一: "initial" | "all"(默认就是all) | "async" minSize: 0, // 最小尺寸,默认0 minChunks: 1, // 最小 chunk ,默认1 maxAsyncRequests: 1, // 最大异步请求数, 默认1 maxInitialRequests : 1, // 最大初始化请求书,默认1 name: function(){}, // 名称,此选项可接收 function cacheGroups:{ // 这里开始设置缓存的 chunks priority: 0, // 缓存组优先级 vendor: { // key 为entry中定义的 入口名称 chunks: "initial", // 必须三选一: "initial" | "all" | "async"(默认就是异步) test: /react|lodash/, // 正则规则验证,如果符合就提取 chunk name: "vendor", // 要缓存的 分隔出来的 chunk 名称 minSize: 0, minChunks: 1, enforce: true, maxAsyncRequests: 1, // 最大异步请求数, 默认1 maxInitialRequests : 1, // 最大初始化请求书,默认1 reuseExistingChunk: true // 可设置是否重用该chunk(查看源码没有发现默认值) } } } },
// // minSize: 0, // 最小尺寸,默认0
// // minChunks: 1, // 最小 chunk ,默认1
// // maxAsyncRequests: 1, // 最大异步请求数, 默认1
// // maxInitialRequests : 1, // 最大初始化请求书,默认1
// // name: function () {}, // 名称,此选项可接收 function
// // cacheGroups: { // 这里开始设置缓存的 chunks
// // priority: 0, // 缓存组优先级
// // vendor: { // key 为entry中定义的 入口名称
// // chunks: "initial", // 必须三选一: "initial" | "all" | "async"(默认就是异步)
// // test: /react|lodash/, // 正则规则验证,如果符合就提取 chunk
// // name: "vendor", // 要缓存的 分隔出来的 chunk 名称
// // minSize: 0,
// // minChunks: 1,
// // enforce: true,
// // maxAsyncRequests: 1, // 最大异步请求数, 默认1
// // maxInitialRequests : 1, // 最大初始化请求书,默认1
// // reuseExistingChunk: true // 可设置是否重用该chunk(查看源码没有发现默认值)
// // }
// // }
// // }
// }),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.inlineSource) {
const InlineSourcePlugin = require('../plugins/InlineSoucePlugins')
webpackConfig.plugins.push(
new InlineSourcePlugin({
match: /\.(js|css)/
})
)
}
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
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://testapi.rujian.net/kjob"'
// BASE_API: '"http://192.168.1.124:8080/kjob_dev"'
})
\ No newline at end of file
'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: 8082, // 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',
inlineSource: true,
// 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
}
}
'use strict'
module.exports = {
NODE_ENV: '"production"',
BASE_API: '"http://api.rujian.net/kjob"'
}
\ No newline at end of file
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<!--申明当前页面的编码集-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--网页关键词-->
<meta name="keywords" content="" />
<!--网页描述-->
<meta name="description" content="" />
<!--适配当前屏幕-->
<!-- <meta name="viewport" content="width=device-width, initial-scale=10, maximum-scale=1.0, user-scalable=0" /> -->
<!-- <meta name="viewport" content="width=375, initial-scale=1, user-scalable=no, target-densitydpi=device-dpi" /> -->
<!--禁止自动识别电话号码-->
<meta name="format-detection" content="telephone=no" />
<!--禁止自动识别邮箱-->
<meta content="email=no" name="format-detection" />
<!--iphone中safari私有meta标签,
允许全屏模式浏览,隐藏浏览器导航栏-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<!--iphone中safari顶端的状态条的样式black(黑色)-->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script>
var phoneWidth = parseInt(window.screen.width);
var phoneScale = phoneWidth/375;
document.write('<meta name="viewport" content="width=375,initial-scale='+ phoneScale +',minimum-scale = '+ phoneScale +', maximum-scale = '+ phoneScale +', target-densitydpi=device-dpi">');
</script>
<title>如荐</title>
</head>
<body>
<div id="app"></div>
<!-- <von-app></von-app> -->
<!-- built files will be auto injected -->
</body>
</html>
{
"name": "rujian",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "hank <764671440@qq.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": {
"axios": "^0.18.0",
"babel-runtime": "^6.26.0",
"js-cookie": "^2.2.0",
"mint-ui": "^2.2.13",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vue2-animate": "^2.0.0",
"vuex": "^3.0.1",
"vux": "^2.9.2"
},
"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.6.0",
"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": "^4.0.0-beta.5",
"mini-css-extract-plugin": "^0.4.5",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"less": "^3.0.2",
"less-loader": "^4.1.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": "^14.2.2",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.5.17",
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^3.1.0",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
\ No newline at end of file
const HtmlWebpackPlugin = require('html-webpack-plugin')
class InlineSourcePlugin {
constructor (obj) {
this.reg = obj.match
}
processTags (data, compilation) {
// 处理标签
console.log(data)
let headTags = []
let bodyTags = []
data.headTags.forEach(headTag => {
headTags.push(this.processTag(headTag, compilation))
})
data.bodyTags.forEach(bodyTag => {
bodyTags.push(this.processTag(bodyTag, compilation))
})
return { ...data, headTags, bodyTags }
}
processTag (tag, compilation) {
let newTag, url
console.log(tag, 'tag')
if (tag.tagName === 'link' && this.reg.test(tag.attributes.href)) {
newTag = {
tagName: 'style',
attributes: {
type: 'text/css'
}
}
url = tag.attributes.href
}
if (tag.tagName === 'script' && this.reg.test(tag.attributes.src)) {
newTag = {
tagName: 'script',
attributes: {
type: 'application/javascript'
}
}
url = tag.attributes.src
}
if (url) {
newTag.innerHTML = compilation.assets[url.replace('./', '')].source() // 取到文件内容放到innerHtml
delete compilation.assets[url.replace('./', '')]
return newTag
}
return tag
}
apply (compiler) {
// 要通过html-webpack-plugin
compiler.hooks.compilation.tap('InlineSourcePlugin', (compilation) => {
console.log('The InlineSourcePlugin is starting a new compilation...')
// Staic Plugin interface |compilation |HOOK NAME | register listener
HtmlWebpackPlugin.getHooks(compilation).alterAssetTagGroups.tapAsync(
'alterPlugin', // <-- Set a meaningful name here for stacktraces
(data, cb) => {
// Manipulate the content
data = this.processTags(data, compilation)
// Tell webpack to move on
cb(null, data)
}
)
})
}
}
/**
* new InlineSourcePlugin({
* match: /\.(js|css)/
* })
*
*/
module.exports = InlineSourcePlugin
<template>
<div id="app">
<!-- <img src="./assets/logo.png"> -->
<transition :name="transitionName" class="child-view">
<router-view class="child-view"/>
</transition>
</div>
</template>
<script>
var self = null;
export default {
name: 'App',
data() {
return {
transitionName: 'slide-left',
};
},
watch: {
$route: old => {
let isBack = self.$router.isBack;
if (isBack) {
self.transitionName = 'slide-right';
} else {
self.transitionName = 'slide-left';
}
// 做完回退动画后,要设置成前进动画,否则下次打开页面动画将还是回退
self.$router.isBack = false;
},
},
created() {
self = this;
if (window.history && window.history.pushState) {
console.log(12313123)
history.pushState(null, null, document.URL);
window.addEventListener('popstate', (e)=> {
this.$router.isBack = true;
}, false);
}
// var phoneWidth = parseInt(window.screen.width);
// var phoneScale = phoneWidth / 375;
// // document.querySelector('html').style.zoom = phoneScale;
// window.addEventListener('resize', function() {
// var phoneWidth = parseInt(window.screen.width);
// var phoneScale = phoneWidth / 375;
// // document.querySelector('html').style.zoom = phoneScale;
// });
},
};
</script>
<style>
* {
margin: 0;
padding: 0;
}
html {
font-size: 14px !important;
}
#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; */
min-height: 100vh;
background: #f0f0f5;
}
.child-view {
position: absolute;
width: 100%;
transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
}
.slide-left-enter,
.slide-right-leave-active {
opacity: 0;
-webkit-transform: translate(250px, 0);
transform: translate(250px, 0);
}
.slide-left-leave-to {
opacity: 0;
-webkit-transform: translate(-50px, 0);
transform: translate(-50px, 0);
}
.slide-left-leave-active,
.slide-right-enter {
opacity: 0;
-webkit-transform: translate(-250px, 0);
transform: translate(-250px, 0);
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s !important;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
transition: opacity 0.1s !important;
opacity: 0 !important;
}
.slide-fade-enter-active {
transition: all 0.3s ease;
}
.slide-fade-leave-active {
transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active for below version 2.1.8 */ {
transform: translateX(350px);
opacity: 0;
}
</style>
import request from 'src/config/request'
import { CLIENT_CHOOSE_IMAGE } from 'src/config/jsBridge'
import { upLoad } from 'src/api/files'
export function getAllCity() { // 获取所有城市
return request({
url: '/city/all',
method: 'get',
params: {}
})
}
export function avatarUpload(token) {
return new Promise(function(resolve, reject) {
CLIENT_CHOOSE_IMAGE().then((res) => {
var src = JSON.parse(res)[0].data
upLoad(src, 3).then(res => {
// alert(res.data.data[0]);
request({
url: '/user/updateBasicInfo',
method: 'post',
params: {
portrait: res.data.data[0],
ticket: token
}
}).then(res => {
console.log('啊哈哈')
})
resolve(res.data.data[0])
}).catch(err => {
reject(err)
})
})
})
}
export function getcityList(parentcode) {
return request({
url: '/area/parentcode/' + parentcode,
method: 'get',
params: {}
})
}
export function updateInfo(name, gendar, age, education, experience, ticket, introduce, identityNo, portrait) {
return request({
url: '/user/updateBasicInfo',
method: 'post',
params: {
name,
gendar,
age,
education,
experience,
ticket,
introduce,
identityNo,
portrait
}
})
}
export function getDict() { // 获取字典
return request({
url: '/dict/all',
method: 'get',
params: {}
})
}
export function addUserHope(jobType, dictCityId, salary, ticket, minSalary, maxSalary) {
return request({
url: '/userexpect/add',
method: 'post',
data: {
jobType,
dictCityId,
salary,
ticket,
minSalary,
maxSalary
// data: {
// }
}
})
}
export function updateUserHope(jobType, dictCityId, salary, ticket, id, minSalary, maxSalary) {
return request({
url: '/userexpect/update',
method: 'post',
data: {
jobType,
dictCityId,
salary,
ticket,
id,
minSalary,
maxSalary
// data: {
// }
}
})
}
export function getUserInfo(userId, ticket) {
return request({
url: '/user/getBasicInfo',
method: 'get',
params: {
userId: userId,
ticket: ticket
}
})
}
export function addWork(companyName, position, startTime, endTime, content, ticket) {
return request({
url: '/workexperience/add',
method: 'post',
params: {
companyName,
position,
startTime,
endTime,
content,
ticket
}
})
}
export function editWork(data) {
return request({
url: '/workexperience/modify',
method: 'post',
data: {
data: data
}
})
}
export function getWork(userId, ticket) {
return request({
url: '/workexperience/find',
method: 'get',
params: {
userId: userId,
ticket: ticket
}
})
}
export function getUserExpect(userId, ticket) {
return request({
url: '/userexpect/find',
method: 'get',
params: {
userId: userId,
ticket: ticket
}
})
}
export function selectType(type, ticket) {
return request({
url: '/user/selectType',
method: 'post',
params: {
type,
ticket
}
})
}
import request from 'src/config/request'
export function sendCode (phone) {
// 获取所有公司
return request({
url: '/sms/sendvcode',
method: 'post',
params: {
mobile: phone,
channel: 1
},
data: {
mobile: phone,
channel: 1
}
})
}
export function login (phone, code, qrid) {
// 获取所有公司
return request({
url: '/login/mobile',
method: 'post',
data: {
mobile: phone,
vcode: code,
qrid
},
params: {
mobile: phone,
vcode: code,
qrid
}
})
}
export function getAllCompany () {
// 获取所有公司
return request({
url: '/company',
method: 'get',
params: {}
})
}
export function getCompanyIndustry () {
// 获取所有公司领域
return request({
url: '/company/industry',
method: 'get',
params: {}
})
}
export function getCompanyScale () {
// 获取所有公司规模
return request({
url: '/company/scale',
method: 'get',
params: {}
})
}
/*
{
"data": {
"address": "string",
"companyLicenseUrl": "string",
"companyScaleId": 0,
"id": 0,
"industryFieldIds": [
0
],
"introduce": "string",
"logoUrl": "string",
"name": "string",
"shortName": "string",
"status": 0
}
}
*/
export function createCompany (data) {
// 添加公司
return request({
url: '/company',
method: 'post',
data: {
data: data
}
})
}
export function editCompany (data) {
// 更新公司
return request({
url: '/company',
method: 'put',
data: {
data: data
}
})
}
export function deleteCompany (id) {
// 删除公司
return request({
url: '/company/' + id,
method: 'post',
data: {}
})
}
export function getPositon () {
// 获取职位列表
return request({
url: '/job',
method: 'get',
params: {}
})
}
export function getPositonDetail (id) {
// 获取职位详情
return request({
url: '/job/' + id,
method: 'get',
params: {}
})
}
export function createPositon (datas) {
// 添加职位
return request({
url: '/job',
method: 'post',
data: {
data: datas
}
})
}
export function unlinePositon (id, status) {
// 职位上下线
return request({
url: '/job/Offline/' + id + '/' + status,
method: 'put',
data: {}
})
}
export function editPositon (datas) {
// 编辑职位
return request({
url: '/job',
method: 'put',
data: {
data: datas
}
})
}
export function deletePositon (id) {
// 删除职位
return request({
url: '/job/' + id,
method: 'delete',
data: {}
})
}
export function getAddress (id) {
// 所有地址
return request({
url: '/job/addresses',
method: 'get'
})
}
export function getAddresDetail (id) {
// 地址详情
return request({
url: '/job/addresses/' + id,
method: 'get',
data: {
data: datas
}
})
}
export function createAddress (datas) {
// 地址添加
return request({
url: '/job/address',
method: 'post',
data: {
data: datas
}
})
}
export function editAddress (datas) {
// 地址编辑
return request({
url: '/job/address',
method: 'put',
data: {
data: datas
}
})
}
export function deleteAddress (id) {
// 地址删除
return request({
url: '/job/address/' + id,
method: 'delete',
data: {}
})
}
export function addjobadvantage (data) {
// 添加亮点
return request({
url: '/job/advantage',
method: 'post',
data: {
data
}
})
}
export function getJobadvantage () {
// 获取亮点
return request({
url: '/job/advantage',
method: 'get',
data: {}
})
}
export function getApplyUser (userId) {
// 获取候选人
return request({
url: '/applyjob/' + userId,
method: 'get',
data: {}
})
}
export function addContract (data) {
// 添加录用协议
return request({
url: '/contract',
method: 'post',
data: {
data: data
}
})
}
export function getContract (id, isview = true) {
// 获取录用协议
return request({
url: '/contract/' + id ,
method: 'get',
params: {
view : isview
},
data: {}
})
}
export function changeContractSatus (contractId, status) {
// 改变录用协议状态
return request({
url: `/contract/${contractId}/${status}`,
method: 'patch',
data: {}
})
}
export function rejectContract (contractId, content) {
// 拒绝工作
return request({
url: `/contract/refuse/${contractId}`,
method: 'patch',
data: {
data: content
}
})
}
export function uploadContract (contractId, url) {
// 上传合同
// alert(JSON.stringify(url))
contractId = parseInt(contractId)
return request({
url: `/contract/accept/${contractId}`,
method: 'patch',
data: url
})
}
export function contractComment (data) {
// 职位评论
return request({
url: `/comment`,
method: 'post',
data: {
data
}
})
}
export function getPositionList (companyId) {
//
return request({
url: `/job/${companyId}/1/50`,
method: 'get',
data: {}
})
}
export function addCompanyCollection (userId, jobId) {
// 公司端添加收藏
return request({
url: `/collection/company`,
method: 'post',
data: {
data: {
userId,
jobId
}
}
})
}
export function addPersonalCollection (id) {
// 个人端添加收藏
return request({
url: `/collection/person`,
method: 'post',
data: {
data: id
}
})
}
export function delCompanyCollection (id) {
// 公司端删除收藏
return request({
url: `/collection/company/${id}`,
method: 'delete',
data: {}
})
}
export function delPersonalCollection (id) {
// 个人端删除收藏
return request({
url: `/collection/person/${id}`,
method: 'delete',
data: {}
})
}
export function getPersonalCollection (id, jobId) {
// 个人端删除收藏
return request({
url: `/collection/person/job/${id}`,
method: 'get',
params: {
jobId
}
})
}
export function getCompanyCollection (id, jobId) {
// 公司端获取收藏
return request({
url: `/collection/company/applicant/${id}`,
method: 'get',
params: {
jobId
}
})
}
export function getEmploymentList (status) {
// 查询录用列表
return request({
url: `/contract/jobuser/job`,
method: 'get',
params: {
status: status
}
})
}
export function getEmploymentUserList (jobTypeId, page, status) {
// 查询职位录用人列表
return request({
url: `/contract/jobuser/user`,
method: 'get',
params: {
status,
jobTypeId: jobTypeId,
pageNo: page,
pageSize: 20
}
})
}
export function getEmploymentUserDetail (contractId, user_id) {
return request({
url: `/contract/jobuser/entry`,
method: 'get',
params: {
contractId: contractId,
userId: user_id
}
})
}
export function getUserAcceptDetail (id) {
// 获取用户之前是否入职
return request({
url: `/contract/status/accept/${id}`,
method: 'get'
})
}
export function getCompanyComment (companyId, pageNo, pageSize) {
// 获取公司评论记录
return request({
url: `/comment/${companyId}/${pageNo}/${pageSize || 20}`,
method: 'get'
})
}
export function getComment(contractId) {
return request({
url: `/comment/${contractId}`,
method: 'get'
})
}
\ No newline at end of file
import request from 'src/config/request'
export function addFeedback(term_id, categories, type, title, content, contact, images, client) { // 添加反馈
return request({
url: '/api/feedback',
method: 'post',
data: {
term_id,
categories,
type,
title,
content,
contact,
images,
client
}
})
}
export function getClassInfo(class_id, term_id) {
return request({
url: 'api/front/classes/class_appoint',
method: 'get',
params: {
class_id,
term_id
}
})
}
export function getClassStudent(class_id, term_id, limit, page) {
return request({
url: '/api/front/classes/class_students',
method: 'get',
params: {
class_id,
term_id,
limit,
page
}
})
}
export function getClassAtt(class_id, term_id, limit, page) {
return request({
url: 'api/front/class/attendance?search=class_id:' + class_id,
method: 'get',
params: {
term_id,
class_id,
page,
limit
}
})
}
export function appExpulsion(term_id, student_ids, apply_description, expulsion_cate) { // 申请除名
return request({
url: '/api/front/expulsion',
method: 'post',
data: {
term_id,
student_ids,
apply_description,
expulsion_cate
}
})
}
export function getSudentDetail() {
return request({
url: '/api/front/student/me',
method: 'get'
})
}
export function getStransfer(term_id, student_ids, target_class_id, apply_description, apply_status_name) { // 转班
return request({
url: '/api/front/transfer',
method: 'post',
data: {
term_id,
student_ids,
target_class_id,
apply_description
}
})
}
export function getLeaves() { // 请假列表
return request({
url: 'api/front/leaves',
method: 'get'
})
}
export function getLeaveinfo(id) { // 请假详情
return request({
url: 'api/approve/' + id,
method: 'get'
})
}
export function getMeettingLeave(data) { // 班会请假
return request({
url: 'api/front/meetingleave',
method: 'post',
data
})
}
export function getAssignmentleave(data) { // 作业请假
return request({
url: '/api/front/assignmentleave',
method: 'post',
data: data
})
}
export function getClassmeeting() { // 班级班会
return request({
url: 'api/front/classmeeting',
method: 'get'
})
}
export function getNotes(term_id, course_id, note_type, limit, page) { // 笔记列表
return request({
url: 'api/front/notes',
method: 'get',
params: {
term_id,
course_id,
note_type,
limit,
page
}
})
}
export function getMyNote(term_id) {
return request({
url: 'api/front/mynotes',
method: 'get',
params: {
term_id
}
})
}
export function addNotes(term_id, course_id, note_type, limit, page) { // 笔记添加
return request({
url: '/api/front/notes',
method: 'post',
data: {
term_id,
course_id,
note_type,
limit,
page
}
})
}
export function editNotes(id, content, is_public) { // 笔记编辑
return request({
url: '/api/front/notes/' + id,
method: 'put',
data: {
content,
is_public
}
})
}
export function deleteNotes(id) { // 笔记删除
return request({
url: '/api/front/notes/' + id,
method: 'delete'
})
}
export function getChildren(data) {
return request({
url: '/api/comment/childcomment',
method: 'get',
params: {
comment_id: data.target_id
}
})
}
export function editUser(id, icon) {
return request({
url: '/api/user/' + id,
method: 'put',
data: {
icon: icon
}
})
}
import request from 'src/config/request'
export function upLoad(file, type) {
// let formData = new FormData()
// formData.append('uploadType', type)
// formData.append('file', [convertBase64UrlToBlob(file)])
// alert(JSON.stringify(formData) + convertBase64UrlToBlob(file) + 'file'+file + 'typ' + type)
return request({
url: '/upload',
method: 'post',
data: {
data: [file]
}
// headers: {
// 'content-type': 'multipart/form-data'
// }
})
}
export function convertBase64UrlToBlob(urlData) {
var bytes = window.atob(urlData.split(',')[1]); // 去掉url的头,并转换为byte
// 处理异常,将ascii码小于0的转换为大于0
var ab = new ArrayBuffer(bytes.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < bytes.length; i++) {
ia[i] = bytes.charCodeAt(i);
}
console.log(new Blob([ab], {
type: 'image/png'
}))
return new Blob([ab], {
type: 'image/png'
});
}
export function downLoad(token, url) {
var iframe = document.createElement('iframe')
iframe.style.display = 'none'
console.log(process.env.BASE_API)
iframe.src = process.env.BASE_API + '/api/file/download' + '?token=' + token + '&url=' + url
document.body.appendChild(iframe)
}
export function baseUrl() {
return process.env.BASE_API
}
export function getawayUrl() {
return process.env.GETAWAY
}
export function resetUrl() {
console.log(process.env, '?callback=' + process.env.CALLBACKURL)
return process.env.RESET_URL + '?callback=' + process.env.CALLBACKURL
}
.app-container {
background: #f0f0f5;
}
.div::-webkit-scrollbar {
display: none;
}
.mint-header {
background: white;
color: black;
}
.padding-both {
background: white;
padding: 0 1rem;
}
.content {
display: flex;
justify-content: space-between;
background: #ffffff;
padding: 1.5rem 0 1.5rem 0;
}
.content img {
width: 3.57rem;
height: 3.57rem;
background: #efefef;
border-radius: 0.57rem ;
}
.content-center {
padding-left: 1rem;
}
.content-center .com-name {
width: 15rem;
height: 1rem;
font-size: 15px;
font-family: PingFang-SC-Medium;
columns: #333333;
line-height: 1rem;
padding-bottom: 1rem;
}
.content-center .addr {
color: #999999;
font-size: 0.75rem;
}
.content-center .addr .line {
padding: 0 1rem;
}
.content-right .evaluation {
text-align: right;
height: 2rem;
font-size: 0.81rem;
font-family: PingFang-SC-Medium;
color: #666666;
}
.content-right .evaluation-num {
text-align: right;
padding-right: 1rem;
color: #01B888;
}
.height20 {
height: 10px;
background: #f0f0f5;
}
.content2 {
background: #ffffff;
min-height: 22.06rem;
}
.content2 .item-content {
padding: 0 1rem;
}
.content2 .item-content video {
margin: 0 auto;
height: 12.34rem;
background: #333333;
}
.content2 .item-content .text {
font-size: 0.81rem;
font-family: PingFang-SC-Medium;
color: #999999;
line-height: 1.25rem;
overflow: hidden;
/*内容超出后隐藏*/
text-overflow: ellipsis;
/* 超出内容显示为省略号*/
}
.evaluation-title {
line-height: 2rem;
height: 2rem;
font-size: 0.94rem;
font-family: PingFang-SC-Medium;
color: #333333;
border-bottom: 1px solid #EEEEEE;
}
.right {
float: right;
margin-left: auto;
}
.right::before {
content: "";
clear: both;
}
.evaluation-item {
padding-top: 1rem;
}
.evaluation-item .title {
line-height: 1rem;
display: flex;
font-size: 14px;
}
.evaluation-item .title img {
display: inline-block;
border-radius: 50px;
width: 1.88rem;
height: 1.88rem;
}
.evaluation-item .title .item-name {
margin-left: 1rem;
line-height: 1rem;
}
.app-container{
background: #f0f0f5;
}
.mint-header {
background: white;
color: black;
}
.padding-both{
background: white;
padding: 0 1rem;
}
.content {
display: flex;
justify-content: space-between;
// width:53.57rem;
background:rgba(255,255,255,1);
padding: 1.5rem 0 1.5rem 0;
}
.content img {
width:3.57rem;
height:3.57rem;
background:rgba(239,239,239,1);
border-radius: 0.57rem ;
}
.content-center {
padding-left: 1rem;
.com-name {
width: 15rem;
height:1rem;
font-size:15px;
font-family:PingFang-SC-Medium;
columns: #333333;
line-height:1rem;
padding-bottom: 1rem;
}
.addr {
color: #999999;
font-size: 0.75rem;
.line {
padding: 0 1rem;
}
}
}
.content-right {
.evaluation {
text-align: right;
height: 2rem;
font-size:0.81rem;
font-family:PingFang-SC-Medium;
color:rgba(102,102,102,1);
}
.evaluation-num {
text-align: right;
padding-right: 1rem;
color:#01B888;
}
}
.height20{
height: 1rem;
background:#EEEEEE;
}
.content2 {
background: #ffffff;
min-height: 22.06rem;
.item-content {
padding: 0 1rem;
video {
margin: 0 auto;
height: 12.34rem;
background:rgba(51,51,51,1);
}
.text {
// height:2.09rem;
font-size:0.81rem;
font-family:PingFang-SC-Medium;
color:rgba(153,153,153,1);
line-height:1.25rem;
overflow: hidden;/*内容超出后隐藏*/
text-overflow: ellipsis;/* 超出内容显示为省略号*/
// white-space: nowrap;/*文本不进行换行*/
}
}
}
.evaluation-title {
line-height: 2rem;
height: 2rem;
font-size:0.94rem;
font-family:PingFang-SC-Medium;
color:rgba(51,51,51,1);
border-bottom: 1px solid #EEEEEE;
}
.right{
float: right;
// flex: 1;
// text-align: right;
margin-left: auto;
&::before {
content: "";
clear: both;
}
}
.evaluation-item{
padding-top: 1rem;
.title {
line-height: 1rem;
display: flex;
img {
display: inline-block;
border-radius: 50px;
width:1.88rem;
height:1.88rem;
}
.item-name {
margin-left: 1rem;
line-height: 1rem;
}
}
}
\ No newline at end of file
.mint-header-title {
color: #333333 !important;
}
.mint-header {
background: white !important;
box-shadow: 2px 3px 3px rgba(240, 240, 242, 1);
.mint-header-title {
font-size: 18px;
height: 100%;
line-height: 41px;
// overflow: auto !important;
}
}
.mint-msgbox-title {
font-weight: normal;
}
.mint-cell-wrapper {
padding: 0 !important;
margin: 0 15px !important;
width: auto !important;
}
.app-container {
background: #f0f0f5;
}
.mint-header {
background: white;
color: black;
}
.mint-cell:last-child {
background: none !important;
}
.padding-both {
background: white;
padding: 0 1rem;
}
.content {
display: flex; // justify-content: space-between; // width:53.57rem;
background: rgba(255, 255, 255, 1);
padding: 1.5rem 0 1rem 0;
position: relative;
.comment-content {
font-size:13px;
font-family:PingFang-SC-Medium;
color:rgba(153,153,153,1);
}
}
.content img {
width: 50px;
height: 50px;
background: rgba(239, 239, 239, 1);
border-radius: 8px;
}
.content-center {
padding-left: 15px;
.com-name {
// width: 15rem;
height: 15px;
font-size: 15px;
font-family: PingFang-SC-Medium;
columns: #333333;
line-height: 15px;
padding-bottom: 7px;
}
.addr {
color: #999999;
font-size: 13px;
.line {
padding: 0 4px;
}
padding-bottom: 7px;
}
}
.content-right {
float: right;
position: absolute;
right: 0;
top: 5px;
align-content: flex-end;
img {
width: 28px;
height: 28px;
color: white;
background: white;
margin-top: 15px;
}
.evaluation {
text-align: right;
height: 2rem;
font-size: 0.81rem;
font-family: PingFang-SC-Medium;
color: rgba(102, 102, 102, 1);
}
.evaluation-num {
text-align: right;
padding-right: 1rem;
color: #01B888;
}
}
.height20 {
height: 10px;
background: #F0F0F5;
}
.liner {
display: inline-block;
width: 1px;
background: #999999;
height: 10px;
margin: 0 2px;
}
.content2 {
background: #ffffff;
min-height: 22.06rem;
.item-content {
padding: 0 1rem;
video {
margin: 0 auto;
height: 12.34rem;
background: rgba(51, 51, 51, 1);
}
.text {
// height:2.09rem;
font-size: 12px;
font-family: PingFang-SC-Medium;
color: rgba(153, 153, 153, 1);
line-height: 1.25rem;
overflow: hidden;
/*内容超出后隐藏*/
text-overflow: ellipsis;
/* 超出内容显示为省略号*/
// white-space: nowrap;/*文本不进行换行*/
}
}
}
.evaluation-title {
line-height: 2rem;
height: 2rem;
font-size: 0.94rem;
font-family: PingFang-SC-Medium;
color: rgba(51, 51, 51, 1);
border-bottom: 1px solid #EEEEEE;
}
.right {
float: right; // flex: 1;
// text-align: right;
margin-left: auto;
&::before {
content: "";
clear: both;
}
}
.evaluation-item {
padding-top: 15px;
.title {
font-size: 14px;
line-height: 20px;
display: flex;
img {
display: inline-block;
border-radius: 50px;
width: 40px;
height: 40px;
}
.item-name {
margin-left: 1rem;
line-height: 20px;
}
}
}
.padding {
padding: 0 1rem;
}
.rj-textarea {
display: block;
width: 100%;
height: 152px;
background: #F0F0F5;
border: none;
outline: none;
margin-top: 10px;
border-radius: 1px;
padding: 5px;
box-sizing: border-box;
}
.hidden-border .hairline-top {
display: none !important;
}
.color {
color: #01B888 !important;
}
.color2 {
color: #BBBBBB !important;
}
.color3 {
color: #666666 !important;
}
.xuanze {
color: #BBBBBB;
font-size: 12px;
}
.mint-cell-value {
color: #BBBBBB !important;
font-size: 15px;
}
.mint-cell-title {
color: #333333;
}
.mint-cell img {
vertical-align:middle;
margin-right: -6px;
}
.mint-datetime-cancel {
box-sizing: border-box;
text-align: left !important;
padding-left: 15px;
color: #BBBBBB !important;
}
.mint-datetime-action {
line-height: inherit !important;
}
.mint-datetime-confirm {
box-sizing: border-box;
text-align: right !important;
padding-right: 15px;
color: #01B888 !important;
}
.picker-toolbar {
height: 50px !important;
line-height: 50px;
}
.progress {
position: fixed;
top: 37px;
left: 0;
z-index: 30;
}
.mint-cell {
min-height: 55px;
}
.mint-cell:last-child .mint-cell-wrapper {
background-image: none !important;
}
.mint-cell-wrapper {
background-position: bottom left !important;
}
.mint-msgbox-message {
font-size: 11px!important;
line-height: 1.5 !important;
}
.hidden-input {
outline: none;
text-align: right;
border: none;
font-size: 15px;
color: #666666;
}
::-webkit-input-placeholder { /* WebKit browsers */
color: #BBBBBB;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #BBBBBB;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #BBBBBB;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: #BBBBBB;
}
.ye-tips {
height: 35px;
line-height: 35px;
color: #A27F26;
font-size: 13px;
background: rgba(254, 249, 219, 1);
}
*::-webkit-scrollbar {
display: none;
}
div::-webkit-scrollbar {
display: none;
}
html::-webkit-scrollbar {
display: none;
}
body::-webkit-scrollbar {
display: none;
}
.text-hidden {
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
max-width: 220px;
}
.bold {
// font-weight: 500;
}
.jiancheng .mint-cell-wrapper {
background: none;
}
.bgf0-container {
position: absolute;
background: #f0f0f5;
}
.app-container {
}
\ No newline at end of file
html {
font-size: 16px;
}
@media only screen and (min-width: 401px) {
html {
font-size: 25px !important;
}
}
@media only screen and (min-width: 428px) {
html {
font-size: 26.75px !important;
}
}
@media only screen and (min-width: 481px) {
html {
font-size: 30px !important;
}
}
@media only screen and (min-width: 569px) {
html {
font-size: 35px !important;
}
}
@media only screen and (min-width: 641px) {
html {
font-size: 40px !important;
}
}
html,body {
min-height: 100%;
width: 100%;
background: white;
}
html::-webkit-scrollbar{
width:0px;
display: none;
opacity: 0;
}
body::-webkit-scrollbar{
width:0px;
display: none;
opacity: 0;
}
div::-webkit-scrollbar{
width:0px;
display: none;
opacity: 0;
}
body {
/* font-family: "Helvetica Neue", Helvetica, "STHeiTi", sans-serif; */
font-family: PingFang SC,Helvetica Neue,Helvetica,Arial,Hiragino Sans GB,Heiti SC,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif;
overflow-x: hidden;
overflow-y: auto;
font-size: 0.7rem;
}
.clear {
zoom: 1;
}
.clear:after {
content: '';
display: block;
clear: both;
}
.fl {
float: left;
}
.fr {
float: right;
}
.viewport {
max-width: 640px;
margin: 0 auto;
overflow-x: hidden;
}
.button-balanced {
background: #01B888 !important;
}
.mint-header-title {
color: #333333 !important;
}
.mint-header {
background: white;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
\ No newline at end of file
<template>
<div class="hello">
臥榻哎呦弄啥嘞
</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>
<template>
<div>
臥榻哎呦弄啥嘞
</div>
</template>
<script>
export default {
data () {
return {
value: ''
}
}
}
</script>
<style>
</style>
<template>
<div class="login-container">
<div class="top">
<div class="text">加入如荐,工作就在身边!</div>
</div>
<div class="login-content">
<mt-field label="姓名" placeholder="请填写" :disableClear="true" v-model="name"></mt-field>
<mt-field
label="性别"
placeholder="请选择"
@click.native="showActionSheetSex"
readonly
:disabled="true"
:disableClear="true"
v-model="sex"
>
<img src="/static/img/right.png" width="24" height="24">
</mt-field>
<mt-field
label="年龄"
placeholder="请选择"
@click.native="showActionSheetAge"
readonly
:disabled="true"
:disableClear="true"
v-model="age"
>
<img src="/static/img/right.png" width="24" height="24">
</mt-field>
<mt-field
label="手机"
placeholder="请输入常用手机号"
:attr="{ maxlength: 11 }"
type="number"
v-model="phone"
></mt-field>
<mt-field
label="验证码"
:disableClear="true"
:attr="{ maxlength: 6}"
type="number"
v-model="number"
>
<div class>
<span @click="sendcode" v-if="is_disabled">获取验证码</span>
<span v-else>{{time}}s</span>
</div>
</mt-field>
</div>
<div class="btn-container">
<mt-button @click.native="next" type="danger" size="large" :disabled="is_disabled">进入如荐</mt-button>
</div>
<div class="tips">
进入如荐代表你已同意
<span @click="goAgree" path="/useagree" class="color">《如荐用户协议》</span>
</div>
<my-popup
@callbackvalue="enter"
@cancel="cancel"
v-bind:popupVisible="popupVisible"
:popupData="popupData"
></my-popup>
</div>
</template>
<script>
import myPopup from "@/views/myPopup.vue";
import ENUM from "src/config/enum";
import { isPhone } from "@/utils";
import { updateInfo, selectType } from "src/api/city";
import { sendCode, login } from "src/api/company";
import axios from "axios";
import downVue from "./down.vue";
export default {
components: {
ENUM,
myPopup
},
data: () => {
return {
number: "",
phone: "",
name: "",
sex: "",
age: "",
is_disabled: true,
time: 60,
key: "",
popupData: [],
popupVisible: false
};
},
methods: {
sendcode() {
if (!isPhone(this.phone)) {
this.$toast({
message: "请填写正确的手机号",
position: "bottom",
duration: 2000
});
return;
}
sendCode(this.phone).then(res => {
if (res.data.status == 1) {
this.is_disabled = false;
this.time = 60;
this.time--;
window.timer = setInterval(() => {
this.time--;
if (this.time == 0) {
window.clearInterval(window.timer);
this.is_disabled = true;
this.number = "";
}
}, 1000);
}
});
},
showActionSheetSex(theme) {
this.popupData = [
{
flex: 1,
values: ["女", "男"],
defaultIndex: 1,
textAlign: "center"
}
];
this.popupVisible = true;
this.key = "sex";
},
showActionSheetAge() {
var values = [];
for (var i = 16; i <= 65; i++) {
values.push(i);
}
this.popupData = [
{
flex: 1,
values: values,
defaultIndex: 0,
value: "",
textAlign: "center"
}
];
this.popupVisible = true;
this.key = "age";
},
enter(value) {
console.log(value);
this[this.key] = value;
this.popupVisible = false;
},
cancel() {
this.popupVisible = false;
},
goAgree() {
this.$router.push({
path: "/useagree"
});
},
next() {
if (this.name == "" || this.name == "请填写") {
this.$toast({
message: "请填写姓名",
position: "middle",
duration: 2000
});
} else if (this.sex == "" || this.sex == "请选择") {
this.$toast({
message: "请选择性别",
position: "middle",
duration: 2000
});
} else if (this.age == "" || this.age == "请选择") {
this.$toast({
message: "请选择年龄",
position: "middle",
duration: 2000
});
} else if (!isPhone(this.phone)) {
this.$toast({
message: "请填写正确的手机号",
position: "middle",
duration: 2000
});
} else if (this.number == "") {
this.$toast({
message: "请填写验证码",
position: "middle",
duration: 2000
});
} else {
login(parseInt(this.phone), this.number, this.$route.query.qrid).then(
res => {
if (res.data.status == 1 && !res.data.data.type) {
this.$store.dispatch("setUserInfo", res.data.data);
updateInfo(
this.name,
this.sex,
this.age,
"",
"",
this.$store.getters.userInfo.ticket,
"",
"",
"/static/img/logo.png"
).then(res => {
selectType(1, this.$store.getters.userInfo.ticket)
.then(res => {
this.$router.push({
path: "/down"
});
})
.catch(() => {});
});
} else {
if (
res.data.data == "registered" ||
res.data.errorMessage.indexOf("手机号已注册") != -1 ||
res.data.data.type
) {
this.$toast({
message: "此手机号已注册,可通过APP直接登录 然后直接进入到 APP 下载页面",
position: "middle",
duration: 2000
});
this.$router.push({
path: "/down"
});
} else {
this.$toast({
message: "" + res.data.errorMessage,
position: "middle",
duration: 2000
});
}
}
}
);
}
}
}
};
</script>
<style lang="scss" scoped>
.login-container {
background: white;
height: 100vh;
padding-top: 60px;
box-sizing: border-box;
.top {
padding: 0 20px;
display: block;
align-items: center;
text-align: center;
height: 25px;
.text {
font-size: 19px;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: rgba(51, 51, 51, 1);
font-size: 19px;
color: #333333;
}
margin-bottom: 35px;
}
.login-content {
position: relative;
input {
text-align: right;
}
.mint-field-core {
text-align: right;
}
.code {
position: absolute;
right: 20px;
bottom: 15px;
color: #666666;
font-size: 13px;
}
}
.mint-cell-wrapper {
padding: 0 !important;
margin: 0 20px !important;
width: 100% !important;
}
.btn-container {
padding: 50px 20px 15px;
}
.tips {
padding-left: 20px;
color: #cccccc;
font-size: 12px;
}
}
</style>
<style>
.login-container .mint-cell-wrapper {
padding: 0 !important;
margin: 0 20px !important;
width: 100% !important;
}
.login-container input:disabled {
background-color: #fff;
color: #333333;
opacity: 1;
/* -webkit-text-fill-color:#333333 ; */
-webkit-opacity: 1;
}
  .login-container .mint-field-core {
font-size: 15px;
}
.login-container .mint-button--danger {
background-color: #01b888;
}
.login-content input {
position: relative;
text-align: right;
}
.login-content .mint-cell:last-child .mint-cell-wrapper {
background-image: linear-gradient(
180deg,
#d9d9d9,
#d9d9d9 50%,
transparent 50%
) !important;
}
</style>
export default {
getID: {
salary: {
'2000-2500': 1,
'2500-3000': 2,
'3000-3500': 3,
'3500-4000': 4
},
intrduction: {
'我想挣钱': 1,
'我想学知识,长知识': 2,
'我想边工作: 3,边玩': 4
},
sex: {
'男': 1,
'女': 2
},
edu: {
'初中以下': 1,
'高中以上': 2,
'大学': 3,
'大专': 4,
'高中': 5,
'初中': 6,
'不限': 7
},
jobTime: {
'无经验': 1,
'一年以下': 2,
'一年至三年': 3,
'三年以上': 4
}
},
sex: [{
flex: 1,
values: ['男', '女'],
textAlign: 'center',
defaultIndex: 0
}],
edu: [{
flex: 1,
values: [
'不限',
'初中',
'高中',
'大专',
'大学'
],
textAlign: 'center',
defaultIndex: 0
}],
jobTime: [{
flex: 1,
values: [
'无经验',
'1年以下',
'1-3年',
'3年以上'
],
textAlign: 'center',
defaultIndex: 0
}],
introduction: [{
flex: 1,
values: ['我想挣钱', '我想学知识,长知识', '我想边工作,边玩'],
textAlign: 'center',
defaultIndex: 0
}],
salary: [{
flex: 1,
values: ['2000-2500', '2500-3000', '3000-3500', '3500-4000'],
textAlign: 'center',
defaultIndex: 0
}],
jobAccommodation: [{
flex: 1,
values: ['包吃住', '包吃 不包住', '包住 不包吃', '不包吃住'],
textAlign: 'center',
defaultIndex: 0
}]
}
import store from 'src/store/index'
export function setupWebViewJavascriptBridge (callback) {
var bridge =
window.WebViewJavascriptBridge || window.WKWebViewJavascriptBridge
if (bridge) {
return callback(bridge)
}
var callbacks = window.WVJBCallbacks || window.WKWVJBCallbacks
if (callbacks) {
return callbacks.push(callback)
}
window.WVJBCallbacks = window.WKWVJBCallbacks = [callback]
if (window.WKWebViewJavascriptBridge) {
window.webkit.messageHandlers.iOS_Native_InjectJavascript.postMessage(
null
)
} else {
var WVJBIframe = document.createElement('iframe')
WVJBIframe.style.display = 'none'
WVJBIframe.src = 'https://__bridge_loaded__'
document.documentElement.appendChild(WVJBIframe)
setTimeout(function () {
document.documentElement.removeChild(WVJBIframe)
}, 0)
}
}
export function CLIENT_USER_INFO () {
// 用户信息
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
console.log(bridge, '+++++')
bridge.callHandler('CLIENT_USER_INFO', function (response) {
// alert(response)
store.dispatch('setUserInfo', JSON.parse(response))
resolve(response)
})
})
})
}
export function CLIENT_CHOOSE_IMAGE (options) {
var option = {
opentype: 'menu', // 打开方式: 相机?相册? 选择菜单
filetype: 'photo', // 文件类型: 图片?视频
selecttype: 'single' // 选择方式: 单选?多选
}
if (options) {
option = options
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_CHOOSE_IMAGE', option, function (response) {
resolve(response)
})
})
})
}
export function CLIENT_USER_LOCATION () {
// 客户端定位
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_USER_LOCATION', function (response) {
resolve(response)
})
})
})
}
export function CLIENT_GET_IP () {
// 客户端定位
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_GET_IP', function (response) {
resolve(response)
})
})
})
}
export function CLIENT_EXIT_WEBAPP () {
// 关闭webview
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_EXIT_WEBAPP', function (response) {
resolve(response)
})
})
})
}
export function CLIENT_REFRESH_PUBLISH_JOB () {
// 上下线刷新列表
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_REFRESH_PUBLISH_JOB', function (response) {
resolve(response)
})
})
})
}
export function CLIENT_OPEN_MAIN () {
// 打开主页面
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_OPEN_MAIN', function (response) {
resolve(response)
})
})
})
}
export function CLIENT_CHAT (
emId,
name,
avatar,
companyName,
apply_job,
job_id
) {
// "emId":"string",
// * "name":"string",
// * "avatar":"string",
// * "companyName":"string",
// * "apply_job":"string"
// alert(JSON.stringify({
// emId, name, avatar, companyName, apply_job, job_id
// }));
if (!emId || !name || !avatar || !companyName || !apply_job) {
alert('参数不对')
return false
}
var option = {
emId: '' + emId,
name: '' + name,
avatar: '' + avatar,
companyName: '' + companyName,
apply_job: '' + apply_job,
job_id: '' + job_id
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_CHAT', option, function (response) {
resolve(response)
})
})
})
}
export function CLIENT_CHOSE_CITY (cityName, cityCode) {
// 选择城市的回调
// if (!emId || !name || !avatar || !companyName) {
// alert('参数不对')
// return false
// }
var option = {
cityName: cityName,
cityCode: cityCode
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_CHOSE_CITY', option, function (response) {
resolve(response)
})
})
})
}
export function CLIENT_OPEN_JOB_MANAGE (cityName, cityCode) {
// if (!emId || !name || !avatar || !companyName) {
// alert('参数不对')
// return false
// }
var option = {
cityName: cityName,
cityCode: cityCode
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_OPEN_JOB_MANAGE', option, function (
response
) {
resolve(response)
})
})
})
}
export function CLIENT_SEND_OFFER (offer_id) {
// 录用Offer
// if (!emId || !name || !avatar || !companyName) {
// alert('参数不对')
// return false
// }
var option = {
offer_id: offer_id
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_SEND_OFFER', option, function (response) {
resolve(response)
})
})
})
}
export function CLIENT_REFRESH_CHAT_OFFER (offer_id) {
// 同意/拒绝/放弃 Offer
// if (!emId || !name || !avatar || !companyName) {
// alert('参数不对')
// return false
// }
var option = {
offer_id: offer_id
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_REJECT_OFFER', option, function (response) {
resolve(response)
})
})
})
}
export function CLIENT_READ_TEXT (text, status) {
// 文字读取
// if (!emId || !name || !avatar || !companyName) {
// alert('参数不对')
// return false
// }
var option = {
operate: status, // 1-播放 2-暂停 3-继续播放
text: text + ''
}
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_READ_TEXT', option, function (response) {
resolve(response)
})
})
})
}
export function CLIENT_REFRESH_PERSONAL_OFFER_LIST (text) {
// 不是聊天进入刷新列表
return new Promise((resolve, reject) => {
setupWebViewJavascriptBridge(function (bridge) {
bridge.callHandler('CLIENT_REFRESH_PERSONAL_OFFER_LIST', function (
response
) {
resolve(response)
})
})
})
}
import axios from 'axios'
import { Toast } from 'mint-ui'
import store from 'src/store'
// import { getToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url
timeout: 10000 // 请求超时时间
})
// console.log(service)
// request拦截器
service.interceptors.request.use(config => {
// Do something before request is sent
// console.log(config.url)
if (store.getters.userInfo.ticket) {
config.headers['ticket'] = store.getters.userInfo.ticket // 让每个请求携带token--['ticket']为自定义key 请根据实际情况自行修改
}
if (!config.headers['Content-Type']) {
if (config.url != '/upload') {
config.headers['Content-Type'] = 'application/json'
}
}
config.headers['platform'] = 'front'
return config
}, error => {
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
})
// respone拦截器
service.interceptors.response.use(
response => response,
/**
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过xmlhttprequest 状态码标识 逻辑可写在下面error中
*/
err => {
console.log('errwww' + err) // for debug
if (err && err.response) {
switch (err.response.status) {
case 400:
err.message = `${err.response.data.message}`
break
case 401:
err.message = `${err.response.data.message}`
break
case 403:
err.message = `${err.response.data.message}`
break
case 404:
err.message = `请求地址出错: ${err.response.config.url}`
break
case 405:
err.message = `方法错误: ${err.response.data.message}`
break
case 408:
err.message = '请求超时'
break
case 500:
err.message = `服务器出了点小问题,请稍后再试。`
break
case 501:
err.message = '服务未实现'
break
case 502:
err.message = '网关错误'
break
case 503:
err.message = '服务不可用'
break
case 504:
err.message = '网关超时'
break
case 505:
err.message = 'HTTP版本不受支持'
break
}
}
Toast({
message: err.message,
position: 'bottom',
duration: 3 * 1000
})
console.log('❎❎')
return Promise.reject(err)
})
export default service
\ No newline at end of file
// 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 router from './router'
// import Vonic from 'vonic'
import App from './App'
import store from './store'
import mintUi from 'mint-ui'
import '@/assets/app.scss'
import './assets/index.css'
import 'mint-ui/lib/style.css'
Vue.use(mintUi)
Vue.config.productionTip = false
/* eslint-disable no-new */
window.router = router
new Vue({
el: '#app',
router,
store,
components: {
App
},
template: '<App/>'
})
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/login'
Vue.use(Router)
Router.prototype.go = function (n) {
if (n === -1) {
console.log(this)
this.isBack = true
}
history.go(n)
}
Router.prototype.back = function () {
this.isBack = true
this.go(-1)
}
console.log(Router.back, 121)
export default new Router({
scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
setTimeout(() => {
window.scrollTo(savedPosition.x, savedPosition.y)
}, 200)
}
},
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld,
redirect: '/login'
},
{
path: '/login',
name: 'login',
component: Login
}
]
})
import Vue from 'vue'
export default new Vue()
const getters = {
sidebar: state => state.app.sidebar,
token: state => state.user.token,
avatar: state => state.user.userInfo.icon,
name: state => state.user.name,
roles: state => state.user.roles,
userInfo: state => state.user.userInfo,
noticeList: state => state.user.noticeList,
city: state => state.user.cityList,
dict: state => state.user.dict,
}
export default getters
import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import getters from './getters'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app,
user
},
getters
})
export default store
// import Cookies from 'js-cookie'
const app = {
state: {
sidebar: {
opened: ''
}
},
mutations: {
TOGGLE_SIDEBAR: state => {
if (state.sidebar.opened) {
} else {
}
state.sidebar.opened = !state.sidebar.opened
}
},
actions: {
ToggleSideBar: ({ commit }) => {
commit('TOGGLE_SIDEBAR')
}
}
}
export default app
// import { login, logout, getInfo } from '@/api/login's
const user = {
state: {
token: '',
name: '',
avatar: '',
roles: [],
userInfo: JSON.parse(window.sessionStorage.getItem('userInfo')) || {
ticket: '645d3d2520e547498f679a6a45de6785',
userId: 86
},
id: window.sessionStorage.getItem('user_id') || '',
newsList: [],
newsDetial: {},
cityList: [],
dict: [],
temp: {}
},
mutations: {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_NAME: (state, name) => {
state.name = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_ID: (state, id) => {
state.id = id
window.sessionStorage.setItem('user_id', id)
},
SET_USER_INFO: (state, userInfo) => {
window.sessionStorage.setItem('userInfo', JSON.stringify(userInfo))
state.userInfo = userInfo
},
ASSIGN_USER_INFO: (state, data) => {
Object.assign(state.userInfo, data)
},
GET_NEWS_LIST: (state, newsList) => {
state.newsList = newsList
},
SET_DICT: (state, dict) => {
state.dict = dict
},
SET_CITY_LIST: (state, cityList) => {
state.cityList = cityList
}
},
actions: {
setUserInfo ({commit}, userInfo) {
commit('SET_USER_INFO', userInfo)
},
setCity ({commit}, City) {
commit('SET_CITY_LIST', City)
},
setDict ({commit}, dict) {
commit('SET_DICT', dict)
},
// 登录
Login ({commit}, userInfo) {
const username = userInfo.username.trim()
return new Promise((resolve, reject) => {
// login(username, userInfo.password).then(response => {
// const data = response.data.data
// console.log(data.access_token)
// commit('SET_USER_INFO', data)
// commit('SET_TOKEN', data.access_token)
// commit('SET_ID', data.id)
// window.sessionStorage.setItem('user_id', data.id)
// setToken(data.access_token)
// resolve()
// }).catch(error => {
// reject(error)
// })
})
},
// 获取用户信息
GetInfo ({commit, state}) {
return new Promise((resolve, reject) => {
getInfo(state.id)
.then(response => {
const data = response.data.data
commit('SET_ROLES', data.roles)
commit('SET_NAME', data.name)
commit('SET_AVATAR', data.avatar)
commit('ASSIGN_USER_INFO', data)
resolve(response)
})
.catch(error => {
reject(error)
})
})
}
}
}
export default user
import Cookies from 'js-cookie'
const TokenKey = 'Token'
export function getToken () {
return Cookies.get(TokenKey)
}
export function setToken (token) {
return Cookies.set(TokenKey, token)
}
export function removeToken () {
return Cookies.remove(TokenKey)
}
export function formatDate(date, fmt) {
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
const o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (const k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
const str = o[k] + ''
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : padLeftZero(str))
}
}
return fmt
}
function padLeftZero(str) {
return ('00' + str).substr(str.length)
}
export function getTime(time) {
var time = time.replace('-', '/')
return new Date(time).getTime()
}
/**
* Created by jiachenpan on 16/11/18.
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (('' + time).length === 10) time = parseInt(time) * 1000
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
if (key === 'a') return ['一', '二', '三', '四', '五', '六', '日'][value - 1]
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
export function formatTime(time, option) {
time = +time * 1000
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
} else if (diff < 3600) { // less 1 hour
return Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
return '1天前'
}
if (option) {
return parseTime(time, option)
} else {
return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分'
}
}
export function isCard(card) {
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
return reg.test(card)
}
export function isPhone(phone) {
var reg = /^1[3-8][0-9]\d{4,8}$/;
return reg.test(phone)
}
\ No newline at end of file
import axios from 'axios'
import Vue from 'vue'
Vue.use(axios)
import { Message } from 'mint-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url
timeout: 5000 // 请求超时时间
})
// console.log(service)
// request拦截器
service.interceptors.request.use(config => {
// Do something before request is sent
if (store.getters.token) {
config.headers['token'] = getToken() // 让每个请求携带token--['X-Token']为自定义key 请根据实际情况自行修改
}
config.headers['Content-Type'] = 'application/json'
config.headers['platform'] = 'front'
return config
}, error => {
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
})
// respone拦截器
service.interceptors.response.use(
response => response,
/**
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过xmlhttprequest 状态码标识 逻辑可写在下面error中
*/
err => {
console.log('errwww' + err)// for debug
if (err && err.response) {
switch (err.response.status) {
case 400:
err.message = '请求错误'
break
case 401:
err.message = `${err.response.data.message}`
break
case 403:
err.message = '拒绝访问'
break
case 404:
err.message = `请求地址出错: ${err.response.config.url}`
break
case 405:
err.message = `方法错误: ${err.response.data.message}`
break
case 408:
err.message = '请求超时'
break
case 500:
err.message = `服务器内部错误:${err.response.data.message}`
break
case 501:
err.message = '服务未实现'
break
case 502:
err.message = '网关错误'
break
case 503:
err.message = '服务不可用'
break
case 504:
err.message = '网关超时'
break
case 505:
err.message = 'HTTP版本不受支持'
break
}
}
Message({
message: err.message,
type: 'error',
duration: 3 * 1000
})
return Promise.reject(err)
})
export default service
/**
* Created by jiachenpan on 16/11/18.
*/
export function isvalidUsername(str) {
const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0
}
/* 合法uri*/
export function validateURL(textval) {
const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return urlregex.test(textval)
}
/* 小写字母*/
export function validateLowerCase(str) {
const reg = /^[a-z]+$/
return reg.test(str)
}
/* 大写字母*/
export function validateUpperCase(str) {
const reg = /^[A-Z]+$/
return reg.test(str)
}
/* 大小写字母*/
export function validatAlphabets(str) {
const reg = /^[A-Za-z]+$/
return reg.test(str)
}
// 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)
})
}
}
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
}
}
}
}
// 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
})
})
// 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()
}
}
{
"env": {
"jest": true
},
"globals": {
}
}
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/**'
]
}
import Vue from 'vue'
Vue.config.productionTip = false
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')
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment