Commit dbd2ad6e by zhanghui1

0110

parents
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.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": {}
}
}
# poolin_app
> 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
```
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).
'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')
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')
})
}
}
'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)
}
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: [
{
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'
}
}
'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.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 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: 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
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
'use strict'
// Template version: 1.2.8
// 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: 8081, // 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-
/**
* 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
}
}
'use strict'
module.exports = {
NODE_ENV: '"production"'
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<title>poolin_app</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "poolin_app",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "xin3w <xin3w@126.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.17.1",
"echarts": "^3.8.5",
"mint-ui": "^2.2.13",
"vue": "^2.5.2",
"vue-awesome-swiper": "^3.1.0",
"vue-clipboard2": "0.0.8",
"vue-echarts-v3": "^1.0.18",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.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",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.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",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"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",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"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"
]
}
<template>
<div id="app">
<transition name="fade" mode="out-in">
<router-view/>
</transition>
</div>
</template>
<script>
export default {
name: 'app',
data() {
return {
}
}
}
</script>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8"?><svg width='120px' height='120px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-ring"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><defs><filter id="uil-ring-shadow" x="-100%" y="-100%" width="300%" height="300%"><feOffset result="offOut" in="SourceGraphic" dx="0" dy="0"></feOffset><feGaussianBlur result="blurOut" in="offOut" stdDeviation="0"></feGaussianBlur><feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend></filter></defs><path d="M10,50c0,0,0,0.5,0.1,1.4c0,0.5,0.1,1,0.2,1.7c0,0.3,0.1,0.7,0.1,1.1c0.1,0.4,0.1,0.8,0.2,1.2c0.2,0.8,0.3,1.8,0.5,2.8 c0.3,1,0.6,2.1,0.9,3.2c0.3,1.1,0.9,2.3,1.4,3.5c0.5,1.2,1.2,2.4,1.8,3.7c0.3,0.6,0.8,1.2,1.2,1.9c0.4,0.6,0.8,1.3,1.3,1.9 c1,1.2,1.9,2.6,3.1,3.7c2.2,2.5,5,4.7,7.9,6.7c3,2,6.5,3.4,10.1,4.6c3.6,1.1,7.5,1.5,11.2,1.6c4-0.1,7.7-0.6,11.3-1.6 c3.6-1.2,7-2.6,10-4.6c3-2,5.8-4.2,7.9-6.7c1.2-1.2,2.1-2.5,3.1-3.7c0.5-0.6,0.9-1.3,1.3-1.9c0.4-0.6,0.8-1.3,1.2-1.9 c0.6-1.3,1.3-2.5,1.8-3.7c0.5-1.2,1-2.4,1.4-3.5c0.3-1.1,0.6-2.2,0.9-3.2c0.2-1,0.4-1.9,0.5-2.8c0.1-0.4,0.1-0.8,0.2-1.2 c0-0.4,0.1-0.7,0.1-1.1c0.1-0.7,0.1-1.2,0.2-1.7C90,50.5,90,50,90,50s0,0.5,0,1.4c0,0.5,0,1,0,1.7c0,0.3,0,0.7,0,1.1 c0,0.4-0.1,0.8-0.1,1.2c-0.1,0.9-0.2,1.8-0.4,2.8c-0.2,1-0.5,2.1-0.7,3.3c-0.3,1.2-0.8,2.4-1.2,3.7c-0.2,0.7-0.5,1.3-0.8,1.9 c-0.3,0.7-0.6,1.3-0.9,2c-0.3,0.7-0.7,1.3-1.1,2c-0.4,0.7-0.7,1.4-1.2,2c-1,1.3-1.9,2.7-3.1,4c-2.2,2.7-5,5-8.1,7.1 c-0.8,0.5-1.6,1-2.4,1.5c-0.8,0.5-1.7,0.9-2.6,1.3L66,87.7l-1.4,0.5c-0.9,0.3-1.8,0.7-2.8,1c-3.8,1.1-7.9,1.7-11.8,1.8L47,90.8 c-1,0-2-0.2-3-0.3l-1.5-0.2l-0.7-0.1L41.1,90c-1-0.3-1.9-0.5-2.9-0.7c-0.9-0.3-1.9-0.7-2.8-1L34,87.7l-1.3-0.6 c-0.9-0.4-1.8-0.8-2.6-1.3c-0.8-0.5-1.6-1-2.4-1.5c-3.1-2.1-5.9-4.5-8.1-7.1c-1.2-1.2-2.1-2.7-3.1-4c-0.5-0.6-0.8-1.4-1.2-2 c-0.4-0.7-0.8-1.3-1.1-2c-0.3-0.7-0.6-1.3-0.9-2c-0.3-0.7-0.6-1.3-0.8-1.9c-0.4-1.3-0.9-2.5-1.2-3.7c-0.3-1.2-0.5-2.3-0.7-3.3 c-0.2-1-0.3-2-0.4-2.8c-0.1-0.4-0.1-0.8-0.1-1.2c0-0.4,0-0.7,0-1.1c0-0.7,0-1.2,0-1.7C10,50.5,10,50,10,50z" fill="#337ab7" filter="url(#uil-ring-shadow)"><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" repeatCount="indefinite" dur="1s"></animateTransform></path></svg>
\ No newline at end of file
(function (doc, win) {
var docEl = doc.documentElement
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
var recalc = function () {
var clientWidth = docEl.clientWidth
if (!clientWidth) return
docEl.style.fontSize = 50 * (clientWidth / 375) + 'px'
}
if (!doc.addEventListener) return
win.addEventListener(resizeEvt, recalc, false)
doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import dictionaries from '@/assets/js/dictionaries.js'; //字典
const state = {
refresh_time: 10000, //定时刷新
// is_login: $auth.isAuthenticated(), //是否登录
init_url: {}, //全站入口信息
cur_coins: [], //获取支持的币种
txt: dictionaries.txt, //字典
language: 'zh-cn', //en/zh-cn切换语言,从localStorage中取;
coin_type_show: false, //是否显示币种切换
enter_panel:false,//是否从子账户面板进来的
base_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1/url", //初始接口
common_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1", //币种切换对应的baseUrl
// base_url: "BASE_URL", //初始接口
// common_url: "COMMON_URL", //币种切换对应的baseUrl
puid: '', //初始用户id为空,与localStorage同步
coin_type: '', //默认币种类型
region_id: '', //默认节点
refresh:'',
}
const mutations = {
setEnterPannel(state,v){
state.enter_panel=v;
localStorage.setItem("enter_panel", v);
},
setRefresh(state){
state.refresh=new Date().getTime();
},
setInitUrl(state, v) {
state.init_url = v;
},
setCurCoins(state, v) {
state.cur_coins = v
},
setCoinType(state, v) {
state.coin_type = v;
localStorage.setItem("coin_type", v);
},
setRegionId(state, v) {
state.region_id = v
localStorage.setItem("region_id", v);
},
setPuid(state, v) {
state.puid = v
localStorage.setItem("puid", v);
},
setLanguage(state,v){
state.language = v
localStorage.setItem("language", v);
}
}
const getters = {
// count: function(state) {
// return state.count += 100;
// }
}
const actions = {
// addAction(context) {
// context.commit('add', 10)
// }
}
export default new Vuex.Store({
state,
mutations,
getters,
actions
})
//去除a和label的虚线
.remove-dotted() {
a,
label {
blr: ~'expression(this.onFocus=this.blur())';
}
a,
label {
outline: none;
}
}
//浮动
.fl(@f:left;) {
float: @f;
display: inline;
}
.fr(@f:right) {
float: @f;
display: inline;
}
//定位
.rel(@rel:relative) {
position: @rel;
}
.abs(@abs:absolute) {
position: @abs;
}
.fix(@fix:fixed) {
position: @fix;
}
//全局定位
.pos (r) {
position: relative;
}
.pos (a) {
position: absolute;
}
.pos (f) {
position: fixed;
}
.pos-box(@w:500px, @h:400px, @pos:absolute) {
width: @w;
height: @h;
position: @pos;
left: 0;
top: 0;
}
//定位居中
.pos-box-cc(@w:600px, @h:360px, @pos:absolute) {
width: @w;
height: @h;
position: @pos;
left: 50%;
top: 50%;
margin-left: -@w / 2;
margin-top: -@h / 2;
}
//布局
.bc() {
margin-left: auto;
margin-right: auto;
}
.bc-d(@w:500px) {
width: @w;
.bc();
}
.wh(@w) {
width: @w;
height: @w;
}
//高度100%
.h100() {
height: 100%;
}
//文字垂直居中
.txt-ver(@h) {
height: @h;
line-height: @h;
}
//display
.d-b() {
display: block;
}
.d-i() {
display: inline;
}
.d-ib() {
display: inline-block;
}
.d-ib7() {
display: inline-block;
*display: inline;
*zoom: 1;
}
.d-t() {
display: table;
}
.d-n() {
display: none;
}
//font family
.font-fm() {
font-family: "Microsoft Yahei","微软雅黑";
}
.font-fs() {
font-family: "SimSun","宋体";
}
.font-fa() {
font-family: "Arial";
}
.font-fv() {
font-family: Verdana;
}
//font weight
.font-wb() {
font-weight: bold;
}
.font-wn() {
font-weight: normal;
}
//添加下划线
.tu() {
text-decoration: underline;
}
.tn() {
text-decoration: none;
}
.tl() {
text-align: left;
}
.text-l() {
text-align: left;
}
.tc() {
text-align: center;
}
.tr() {
text-align: right;
}
//特殊需求
.min-width(@width) {
min-width: @width;
_width: @width;
}
.max-width(@width, @id) {
max-width: @width;
_width: ~'expression(document.getElementById("@{id}").offsetHeight>parseInt("@{width}")?"@{width}":"auto")';
overflow: hidden;
}
.min-height(@height) {
min-height: @height;
_height: @height;
}
.max-height(@height, @id) {
max-height: @height;
_height: ~'expression(document.getElementById("@{id}").offsetHeight>parseInt("@{height}")?"@{height}":"auto")';
overflow: hidden;
}
//边框附加内容
.triangle-compatible() {
width: 0;
height: 0;
overflow: hidden;
}
//单独方向
.triangle-b(@w:5px, @color:#ccc) {
border-style: solid dashed dashed dashed;
border-color: @color transparent transparent transparent;
border-width: @w;
.triangle-compatible();
}
.triangle-l(@w:5px, @color:#ccc) {
border-style: dashed solid dashed dashed;
border-color: transparent @color transparent transparent;
border-width: @w;
.triangle-compatible();
}
.triangle-t(@w:5px, @color:#ccc) {
border-style: dashed dashed solid dashed;
border-color: transparent transparent @color transparent;
border-width: @w;
.triangle-compatible();
}
.triangle-r(@w:5px, @color:#ccc) {
border-style: dashed dashed dashed solid;
border-color: transparent transparent transparent @color;
border-width: @w;
.triangle-compatible();
}
//透明度
.opa(@opacity:80) {
opacity: @opacity / 100;
filter:~"alpha(opacity=@{opacity})";
}
.rgba(@red, @green, @blue, @alpha:1) {
@filtercolor: `(_f = function(d){var v = (parseInt(d)|0).toString(16);return v.length<2 ? "0"+v:v;},'#'+_f(@{alpha}*255) + _f(@{red}) + _f(@{green})+ _f(@{blue}))`;
background-color: ~'rgba(@{red},@{green},@{blue},@{alpha})';
-ms-filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{filtercolor}',endColorstr='@{filtercolor}')";
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{filtercolor}',endColorstr='@{filtercolor}')";
}
.clearfix() {
*zoom: 1;
&:before,
&:after {
display: table;
content: "";
line-height: 0;
}
&:after {
clear: both;
}
}
//文字省略号
// @substract单位为%
.ellipsis-basic() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.font-fa();
}
.ellipsis(@substract:0) {
.ellipsis-basic();
width: 100% - @substract;
}
@color1:#15558D;
@color2:#1AAFB5;
@deg:-45;
//.line-jb(45deg,#f00,#ff0);
.line-jb(@deg,@color1,@color2) {
background: @color1; /* Old browsers */
background: -moz-linear-gradient(@deg, @color1 0%, @color2 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(@deg, @color1 0%,@color2 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(180+@deg, @color1 0%,@color2 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@color1', endColorstr='@color2',GradientType=1 );
// startColorstr='@color1', endColorstr='@color2',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.line-jb2(@deg,@color1,@color2){
background: @color1; /* Old browsers */
background: -moz-linear-gradient(@deg, @color1 45%, @color2 100%, @color2 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(@deg, @color1 45%,@color2 100%,@color2 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(180+@deg, @color1 45%,@color2 100%,@color2 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@color1', endColorstr='@color2',GradientType=1 );
/* IE6-9 fallback on horizontal gradient */
}
.ohz(){overflow: hidden; zoom:1;}
@import url('../css/reset.css');
@import url('function.less');
@import url('animate.less');
@font-face {
font-family: 'Droid Sans Mono';
font-style: normal;
font-weight: 400;
src: local('Droid Sans Mono'), local('DroidSansMono'), url(../fonts/Droid_Sans_Mono_400.woff) format('woff'), url(../fonts/Droid_Sans_Mono_400.ttf) format('truetype'), url(../fonts/Droid_Sans_Mono_400.svg#DroidSansMono) format('svg')
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/Open_Sans_300.woff) format('woff'), url(../fonts/Open_Sans_300.ttf) format('truetype'), url(../fonts/Open_Sans_300.svg#OpenSans) format('svg')
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(../fonts/Open_Sans_400.woff) format('woff'), url(../fonts/Open_Sans_400.ttf) format('truetype'), url(../fonts/Open_Sans_400.svg#OpenSans) format('svg')
}
@font-face {
font-family: Roboto;
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(../fonts/Roboto_300.woff) format('woff'), url(../fonts/Roboto_300.ttf) format('truetype'), url(../fonts/Roboto_300.svg#Roboto) format('svg')
}
@font-face {
font-family: Roboto;
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(../fonts/Roboto_400.woff) format('woff'), url(../fonts/Roboto_400.ttf) format('truetype'), url(../fonts/Roboto_400.svg#Roboto) format('svg')
}
@font-face {
font-family: 'Roboto Condensed';
font-style: normal;
font-weight: 400;
src: local('Roboto Condensed'), local('RobotoCondensed-Regular'), url(../fonts/Roboto_Condensed_400.woff) format('woff'), url(../fonts/Roboto_Condensed_400.ttf) format('truetype'), url(../fonts/Roboto_Condensed_400.svg#RobotoCondensed) format('svg')
}
@font-face {
font-family: Lato;
font-style: normal;
font-weight: 100;
src: local('Lato Hairline'), local('Lato-Hairline'), url(../fonts/Lato_100.woff) format('woff'), url(../fonts/Lato_100.ttf) format('truetype'), url(../fonts/Lato_100.svg#Lato) format('svg')
}
.fade-enter {opacity: 0}
.fade-leave {opacity: 1}
.fade-enter-active{transition: 0.3s all;}
.fade-leave-active{transition: 0.3s all; opacity: 0}
.eq-font {font-family: "Droid Sans Mono", Menlo, Monaco, Consolas, "Courier New", monospace}
html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); background: #ededf2;font-family: "Roboto","Helvetica Neue",Helvetica,"Hiragino Sans GB",STHeitiSC-Light,"Microsoft YaHei","微软雅黑",Arial,sans-serif;width:100%;height:100%;}
@blue:#103f73;
.header-home {height:2.9rem; background:@blue;
.logo {width:2.8rem; height:auto; display:block;margin:0 auto;}
}
<template>
<div class="">
{{msg}} <button @click="dashboard">跳转到子账户面板</button>
</div>
</template>
<script>
export default {
name: 'create',
data() {
return {
msg: '创建子账户'
}
},
mounted() {
},
methods: {
dashboard(){
this.$router.replace("/my/puid/coin_type/region_id/dashboard")
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<button @click="goMiners">跳转到矿机列表</button>
</div>
</template>
<script>
export default {
name: 'dashboard',
data() {
return {
msg: '子账户面板'
}
},
mounted() {
},
methods: {
goMiners() {
this.$router.push({ name: 'miners' })
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<button @click="goBack">提交返回</button>
</div>
</template>
<script>
export default {
name: 'defaultCoin',
data() {
return {
msg: '设置默认币种'
}
},
mounted() {
},
methods: {
goBack() {
this.$router.go(-1)
}
}
}
</script>
<style>
</style>
<template>
<div class="warp">
<div class="header-home"><img class="logo" src="../assets/img/logo.png" alt="" /></div>
<swiper :options="swiperOption" ref="mySwiper">
<!-- slides -->
<swiper-slide>I'm Slide 1</swiper-slide>
<swiper-slide>I'm Slide 2</swiper-slide>
<swiper-slide>I'm Slide 3</swiper-slide>
<!-- Optional controls -->
<div class="swiper-button-prev" slot="button-prev"></div>
<div class="swiper-button-next" slot="button-next"></div>
</swiper>
{{msg}}
<button @click="login">登录</button>
<button @click="reg">注册</button>
</div>
</template>
<script>
import fn from '@/assets/js/function.js'
import { mapState } from 'vuex'
// import indexChart from "@/components/charts/indexChart.vue"
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
name: 'home',
components: {
swiper,
swiperSlide
},
data() {
return {
msg: '这是一个未登录的首页',
swiperOption: {
notNextTick: true,
autoplay: 3000,
direction: 'horizontal',
grabCursor: true,
setWrapperSize: true,
autoHeight: true,
paginationClickable: true,
prevButton: '.swiper-button-prev',
nextButton: '.swiper-button-next',
mousewheelControl: true,
observeParents: true,
debugger: true,
slidesPerView:3
}
}
},
mounted() {
},
methods: {
login() {
this.$router.push('/login')
},
reg() {
this.$router.push('/reg')
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<h3>这个需要根据情况判断跳转到下面可能的页面</h3>
<ul>
<li>
<router-link to="/create">1.跳转到新建子账户页</router-link>
</li>
<!-- <li>
<router-link to="/subaccount">2.跳转到账户列表</router-link>
</li> -->
<li>
<router-link to="/welcome">2.跳转到欢迎页,即列表页精简版</router-link>
</li>
<li @click="goDashboard" style="cursor:pointer">3.跳转到子账户面板</li>
</ul>
</div>
</template>
<script>
export default {
name: 'jump',
data() {
return {
msg: '判断跳转中...'
}
},
mounted() {},
methods: {
goDashboard() {
this.$router.replace("/my/puid/coin_type/region_id/dashboard")
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<button @click="goBack">返回</button>
</div>
</template>
<script>
export default {
name: 'language',
data() {
return {
msg: '语言设置'
}
},
mounted() {
},
methods: {
goBack() {
this.$router.go(-1)
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}} <button @click="loginOk">登录成功后!</button>
</div>
</template>
<script>
export default {
name: 'login',
data() {
return {
msg: '用户登录页',
}
},
mounted() {
},
methods: {
loginOk(){
console.log("login ok");
this.$router.replace('/jump')
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}} <button @click="goPayments">跳转到收益页</button>
</div>
</template>
<script>
export default {
name: 'minershow',
data() {
return {
msg: '矿机详情页面'
}
},
mounted() {
},
methods: {
goPayments(){
this.$router.push({name:'payments'})
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}} <button @click="goMinerShow">跳转到矿机详情页</button>
</div>
</template>
<script>
export default {
name: 'dashboard',
data() {
return {
msg: '矿机列表页面'
}
},
mounted() {
},
methods: {
goMinerShow(){
this.$router.push('/my/puid/coin_type/region_id/miners/worker_id')
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<button @click="goNoticeList">跳转到通知列表</button>
</div>
</template>
<script>
export default {
name: 'dashboard',
data() {
return {
msg: '通知中心'
}
},
mounted() {
},
methods: {
goNoticeList() {
this.$router.push('/noticeList')
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<button @click="goNoticeShow">跳转到通知详情</button>
</div>
</template>
<script>
export default {
name: 'noticeList',
data() {
return {
msg: '通知列表'
}
},
mounted() {
},
methods: {
goNoticeShow() {
this.$router.push('/NoticeShow')
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
</div>
</template>
<script>
export default {
name: 'noticeShow',
data() {
return {
msg: '通知详情'
}
},
mounted() {
},
methods: {
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
</div>
</template>
<script>
export default {
name: 'payments',
data() {
return {
msg: '收益页面'
}
},
mounted() {
},
methods: {
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}<button @click="loginOk">注册成功后?重新登录:直接跳jump!</button>
</div>
</template>
<script>
export default {
name: 'reg',
data() {
return {
msg: '用户注册'
}
},
mounted() {
},
methods: {
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
</div>
</template>
<script>
export default {
name: 'dashboard',
data() {
return {
msg: '设置页面'
}
},
mounted() {
},
methods: {
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}} <button @click="goDashboard">跳转到子帐户面板</button>
</div>
</template>
<script>
export default {
name: 'dashboard',
data() {
return {
msg: '当前子账户列表'
}
},
mounted() {
},
methods: {
goDashboard(){
this.$router.push('/my/puid/coin_type/region_id/dashboard')
}
}
}
</script>
<style>
</style>
<template>
<div class="">
{{msg}}
<button @click="goDashboard">跳转到子帐户面板</button>
</div>
</template>
<script>
export default {
name: 'dashboard',
data() {
return {
msg: '首次进入到欢迎页,即子账户列表的精简版'
}
},
mounted() {
},
methods: {
goDashboard() {
this.$router.push('/my/puid/coin_type/region_id/dashboard')
}
}
}
</script>
<style>
</style>
<template>
<span>{{ tweeningValue }}</span>
</template>
<script>
export default {
props:['value','fixed'],
data: function() {
return {
tweeningValue: 0
}
},
watch: {
value: function(newValue, oldValue) {
this.tween(oldValue, newValue)
}
},
mounted: function() {
this.tween(0, this.value)
},
methods: {
tween: function(startValue, endValue) {
var vm = this
function animate() {
if (TWEEN.update()) {
requestAnimationFrame(animate)
}
}
new TWEEN.Tween({ tweeningValue: startValue })
.to({ tweeningValue: endValue }, 1000)
.onUpdate(function() {
vm.tweeningValue = this.tweeningValue.toFixed(vm.fixed)
})
.start()
animate()
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<h2 class="title s4 pl50 pr50 pt30">
<span v-if="language=='zh-cn'">{{init_url.coins[$route.params.coin_type]['text_zh-cn']}}{{txt[language].suanlitubiao}}</span>
<span v-if="language=='en'">{{init_url.coins[$route.params.coin_type]['text_en']}} {{txt[language].suanlitubiao}}</span>
</h2>
<p class="mt30 pl50 pr50 mb20">
<button class="btn sm" :class="btnIdx==1?'active':''" @click=getHour(1)>{{txt[language].yixiaoshi}}</button>&nbsp;&nbsp;&nbsp;&nbsp;
<button class="btn sm" :class="btnIdx==0?'active':''" @click="getDay(0)">{{txt[language].yitian}}</button>
</p>
<div class="c-charts">
<IEcharts :option="line"></IEcharts>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex';
import IEcharts from 'vue-echarts-v3';
import fn from '@/assets/js/function.js'
export default {
components: {
IEcharts,
},
data: () => ({
shareHistory: {},
shareHistoryTime: [], //算力历史时间
shareHistoryYes: [], //算力历史成功
shareHistoryNo: [], //算力历史拒绝
btnIdx: 1,
language: localStorage.getItem('language'),
unit: '',
maxOnOff: false,
}),
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
"color": [
"#18a8ea",
"#fb7778",
],
title: {
text: ''
},
tooltip: {
trigger: 'axis',
formatter: function(params) {
// console.log(params)
return params[0].name + '<br/>' +
params[0].seriesName + ' : ' + (params[0].value).toFixed(3) + ' ' + self.unit + 'H/s<br/>' +
params[1].seriesName + ' : ' + params[1].value + '%<br/>';
}
},
legend: {
// data: ["成功率", "拒绝率"]
},
grid: {
top: '9%',
left: '3%',
right: '5%',
bottom: '5%',
containLabel: true,
show: false
},
xAxis: [{
type: 'category',
boundaryGap: false,
data: this.shareHistoryTime,
axisLabel: {
formatter: function(value, idx) {
return value.slice(value.length - 5, value.length)
}
},
axisLine: {
lineStyle: {
color: '#999',
shadowColor: 'rgba(0, 0, 0, 0.3)',
shadowBlur: 10
}
},
splitLine: {
show: false,
},
axisTick: {
show: false
},
}],
yAxis: [{
type: 'value',
name: '算力(' + this.unit + 'H/s)',
axisLine: {
show: true,
lineStyle: {
color: '#999',
shadowColor: 'rgba(0, 0, 0, 0.3)',
shadowBlur: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
}, {
type: 'value',
name: '拒绝率(%)',
min: 0,
max: this.maxOnOff ? 100 : 20,
axisLine: {
show: true,
lineStyle: {
color: '#999',
shadowColor: 'rgba(0, 0, 0, 0.3)',
shadowBlur: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
}],
series: [{
name: '算力',
type: 'line',
stack: '',
smooth: true,
areaStyle: {
normal: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgb(170, 228, 255)' // 100% 处的颜色
// color: 'rgb(24, 168, 234)' // 0% 处的颜色
}, {
offset: 1,
color: 'rgb(239, 250, 255)' // 100% 处的颜色
}],
}
}
},
data: this.shareHistoryYes
},
{
name: '拒绝率',
type: 'line',
stack: '%',
smooth: true,
lineStyle: {
normal: {
width: 1
}
},
yAxisIndex: 1,
xAxisIndex: 0,
areaStyle: {
normal: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgb(255, 172, 172)' // 0% 处的颜色
}, {
offset: 1,
color: 'rgb(255, 225, 225)' // 100% 处的颜色
}],
}
}
},
data: this.shareHistoryNo,
},
]
}
},
refresh() {
return $store.state.refresh;
}
},
created() {
this.pageInit(72, '1h', parseInt((new Date().getTime() - (86400000 * 3)) / 1000));
},
methods: {
pageInit(count, dimension, start) {
let self = this;
let puid = this.$route.params.puid;
let coin_type = this.$route.params.coin_type;
let region_id = this.$route.params.region_id;
this.language = localStorage.getItem('language');
//获取子帐户算力图表
fn.getApiBaseUrl(region_id, coin_type)
.then(api => {
if (api == "") {
$router.replace("/my/" + puid + "/" + localStorage.getItem('coin_type'))
} else {
fn.getWorkerShareHistory(api, puid, count, dimension, start)
.then(res => {
//console.log(res)
if (res.data.err_no == 0) {
//console.log("算力图表数据chartData:", res.data.data)
self.chartData = res.data.data;
self.shareHistory = {};
self.shareHistoryTime = [];
self.shareHistoryYes = [];
self.shareHistoryNo = [];
self.unit = res.data.data.unit;
let hour, day;
_.each(self.chartData.tickers, function(v, i) {
if (self.btnIdx == 0) {
self.shareHistoryTime.push(fn.getYMD(v[0] * 1000))
} else {
self.shareHistoryTime.push(fn.getYMDHM(v[0] * 1000))
}
self.shareHistoryYes.push(v[1]);
self.shareHistoryNo.push((v[2] * 100).toFixed(2));
if ((v[2] * 100).toFixed(2) > 20) {
self.maxOnOff = true;
}
});
} else {
self.$message.error("获取子帐户算力图表错误!")
$router.replace({
name: 'my_puid_cointype',
path: '/my/' + self.$route.params.puid + '/' + self.$route.params.coin_type
})
}
})
}
})
},
getDay: function(idx) {
this.btnIdx = idx;
this.pageInit(30, '1d', parseInt((new Date().getTime() - (86400000 * 30)) / 1000));
},
getHour: function(idx) {
this.btnIdx = idx;
this.pageInit(72, '1h', parseInt((new Date().getTime() - (86400000 * 3)) / 1000));
},
},
watch: {
'$route' (to, from) {
this.btnIdx = 1;
this.pageInit(72, '1h', parseInt((new Date().getTime() - (86400000 * 3)) / 1000));
},
refresh(v) {
this.btnIdx = 1;
this.pageInit(72, '1h', parseInt((new Date().getTime() - (86400000 * 3)) / 1000));
}
}
}
</script>
<style scoped>
.el-col {
margin-bottom: 16px;
}
.material-icons {
font-size: 80px;
color: #ddd;
}
.cart-string {
height: 100px;
padding-top: 10px;
font-size: 1.1rem;
}
.c-charts {
height: 400px;
width: 100%;
}
</style>
<template>
<div>
<h2 class="title s5 mt50 mb30" v-if="language=='zh-cn'">{{init_url.coins[params_coin]['text_zh-cn']}}{{txt[language].suanlitubiao}}</h2>
<h2 class="title s5 mt50 mb30" v-if="language=='en'">{{init_url.coins[params_coin]['text_en']}} {{txt[language].suanlitubiao}}</h2>
<p class="f-tac"><span class="v"><animated-num :value="shares_1h" :fixed=3></animated-num></span><span class="k">{{shares_unit}}H/s</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="v"><animated-num :value="workers" :fixed=0></animated-num></span><span class="k">在线矿机</span></p>
<div class="c-charts">
<IEcharts :option="line"></IEcharts>
</div>
</div>
</template>
<script>
import fn from '@/assets/js/function.js';
import { mapState } from 'vuex';
import IEcharts from 'vue-echarts-v3';
import animatedNum from "@/components/pages/animatednum.vue";
export default {
components: {
IEcharts,
animatedNum
},
data: () => ({
shares_1h: '',
shares_unit: '',
workers: '',
shareHistoryTime: [], //算力历史时间
shareHistoryYes: [], //算力历史成功
shareHistoryNo: [], //算力历史拒绝
language: localStorage.getItem('language'),
unit: '',
}),
props: ["params_coin"],
computed: {
...mapState(["txt", "init_url", "cur_coins"]),
line: function() {
let self = this;
return {
"color": [
"#18a8ea",
],
title: {
text: ''
},
tooltip: {
trigger: 'axis',
formatter: function(params) {
//console.log(params)
return params[0].name + '<br/>' +
params[0].seriesName + ' : ' + (params[0].value).toFixed(3) + ' ' + self.unit + 'H/s'
}
},
legend: {},
grid: {
top: '9%',
left: '3%',
right: '5%',
bottom: '5%',
containLabel: true,
show: false
},
xAxis: [{
type: 'category',
boundaryGap: false,
data: this.shareHistoryTime,
axisLabel: {
formatter: function(value, idx) {
return value.slice(value.length - 5, value.length)
}
},
axisLine: {
lineStyle: {
color: '#999',
shadowColor: 'rgba(0, 0, 0, 0.3)',
shadowBlur: 10
}
},
splitLine: {
show: false,
},
axisTick: {
show: false
},
}],
yAxis: [{
type: 'value',
name: '算力(' + this.unit + 'H/s)',
axisLine: {
show: true,
lineStyle: {
color: '#999',
shadowColor: 'rgba(0, 0, 0, 0.3)',
shadowBlur: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
}],
series: [{
name: '算力',
type: 'line',
stack: '总量',
smooth: true,
areaStyle: {
normal: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgb(170, 228, 255)' // 100% 处的颜色
// color: 'rgb(24, 168, 234)' // 0% 处的颜色
}, {
offset: 1,
color: 'rgb(239, 250, 255)' // 100% 处的颜色
}],
}
}
},
data: this.shareHistoryYes
}]
}
},
// refresh() {
// return $store.state.refresh
// }
},
watch: {
// refresh(v) {
// this.pageInitInterval()
// }
},
created() {
this.pageInitInterval()
},
methods: {
pageInitInterval() {
let self = this;
clearInterval(window.dingshiqi)
self.pageInit();
window.dingshiqi = setInterval(function() {
self.pageInit();
}, $store.state.refresh_time)
},
pageInit() {
let self = this;
this.language = localStorage.getItem('language');
fn.getStats(self.params_coin)
.then(res => {
if (res.data.err_no == 0) {
self.shares_1h = res.data.data.shares.shares_1h
self.shares_unit = res.data.data.shares.shares_unit
self.workers = res.data.data.workers
} else {
this.$message.error("获取矿池合并实时算力错误!")
}
})
fn.getShareHistory(72, "1h", self.params_coin)
.then(res => {
let hour;
self.shareHistoryTime=[];
self.shareHistoryYes=[];
self.shareHistoryNo=[];
if (res.data.err_no == 0) {
self.unit = res.data.data.unit;
_.each(res.data.data.tickers, function(v, i) {
//时间戳转小时
// hour = new Date(v[0] * 1000).getHours();
// self.shareHistoryTime.push((Array(2).join(0) + hour).slice(-2) + ":00");
self.shareHistoryTime.push(fn.getYMDHM(v[0] * 1000))
self.shareHistoryYes.push(v[1]);
self.shareHistoryNo.push(v[2]);
});
} else {
this.$message.error("获取矿池合并算力历史错误!")
}
})
}
}
}
</script>
<style scoped>
.el-col {
margin-bottom: 16px;
}
.material-icons {
font-size: 80px;
color: #ddd;
}
.cart-string {
height: 100px;
padding-top: 10px;
font-size: 1.1rem;
}
.c-charts {
height: 400px;
width: 100%;
}
</style>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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