Commit 9e987216 by 王锐

app

parents
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-runtime", "syntax-dynamic-import"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["istanbul"]
}
}
}
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
*.suo
*.ntvs*
*.njsproj
*.sln
.vscode
\ No newline at end of file
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
# 1.0.0
rebuild done.
\ No newline at end of file
# Intro
A Vue.js template that can support more than 100 thousand lines of code in our business, I hope it can help you too~
Status: building...
## Docs
- [tutorial](/docs/tutorial.md)
## Start
run followed code in your iterm:
```
npm i
npm run dev
```
## Commands
- `npm run dev`
- `npm run start`
- `npm run build`
- `npm run mock`
- `npm run analyz`
require('./check-versions')()
process.env.NODE_ENV = 'production'
var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
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'
))
})
})
var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
var shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
var 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 () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var 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 (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
require('./check-versions')()
var config = require('../config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
}
var opn = require('opn')
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
// automatically open browser, if not set will be false
var autoOpenBrowser = !!config.dev.autoOpenBrowser
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: false,
heartbeat: 2000
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(options.filter || context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
// 简易本地 mock
// app.use('/mock', express.static('./mock'))
// json-server
var jsonServer = require('json-server')
var apiServer = jsonServer.create()
var apiRouter = jsonServer.router('./mock/db.json')
var middlewares = jsonServer.defaults()
apiServer.use(middlewares)
apiServer.use('/', apiRouter)
apiServer.listen(port + 1, function () {
console.log('JSON Server is running')
})
var uri = 'http://localhost:' + port
var _resolve
var readyPromise = new Promise(resolve => {
_resolve = resolve
})
console.log('> Starting dev server...')
devMiddleware.waitUntilValid(() => {
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
}
_resolve()
})
var server = app.listen(port)
module.exports = {
ready: readyPromise,
close: () => {
server.close()
}
}
var path = require('path')
var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
var loaders = [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,
publicPath:'../../',
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) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
var utils = require('./utils')
var config = require('../config')
var isProduction = process.env.NODE_ENV === 'production'
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
}),
transformToRequire: {
video: 'src',
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
var webpack = require("webpack")
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
var originalConfig = {
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'),
'~': resolve('node_modules'),
'Views': resolve('src/views'),
'Store': resolve('src/store'),
'Utils': resolve('src/utils'),
'Config': resolve('src/config'),
'Routes': resolve('src/routes'),
'Assets': resolve('src/assets'),
'Service': resolve('src/service'),
'Plugins': resolve('src/Plugins'),
'Components': resolve('src/Components'),
'Directives': resolve('src/directives'),
'styles': resolve('src/assets/styles'),
}
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(css|scss)$/,
loader: 'style!css!sass',
include: [resolve('src')]
},
{
test: /\.less$/,
loader: 'style!css!less',
include: [resolve('src')]
},
{
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]')
}
}
]
}
}
const vuxLoader = require('vux-loader')
const webpackConfig = originalConfig // 原来的 module.exports 代码赋值给变量 webpackConfig
module.exports = vuxLoader.merge(webpackConfig, {
plugins: ['vux-ui']
})
\ No newline at end of file
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function(name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
new FriendlyErrorsPlugin()
]
})
\ No newline at end of file
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var CleanWebpackPlugin = require('clean-webpack-plugin')
var env = config.build.env
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
new CleanWebpackPlugin(
['dist/**.*.js'],  //匹配删除的文件
{
root: __dirname,           //根目录
verbose: true,           //开启在控制台输出信息
dry: false           //启用删除文件
}
),
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: 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: {
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'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// 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',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var 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) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"/api"'
})
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
productionSourceMap: 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
},
dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://demo.dcloud.net.cn', // 接口的域名
// secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
pathRewrite: {
'^/api': '/api'
}
}
},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
},
}
\ No newline at end of file
module.exports = {
NODE_ENV: '"production"'
}
[0325/091852.500:ERROR:http_transport_win.cc(276)] WinHttpSendRequest: ɹɡ (0x0)
This diff is collapsed. Click to expand it.
File added
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>纺检</title>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<!-- <link rel="stylesheet" href="path/build/css/ydui.css" /> -->
<script src="static/js/ydui.flexible.js"></script>
<script src="static/js/mui.js"></script>
<script src="static/js/pinyin_dict_firstletter.js"></script>
<script src="static/js/pinyinUtil.js"></script>
</head>
<body style="overflow:visible; ">
<div id="app"></div>
<script>
if (window.plus) {
plusReady();
} else {
document.addEventListener("plusready", plusReady, false);
}
function plusReady() {
var ws = plus.webview.currentWebview();
}
// window.GLOBAL = {}
// mui.init({
// keyEventBind: {
// backbutton: true //关闭back按键监听
// }
// });
//首页返回键处理
//处理逻辑:1秒内,连续两次按返回键,则退出应用;
var first = null;
mui.back = function () {
//首次按键,提示‘再按一次退出应用’
if (!first) {
first = new Date().getTime(); //记录第一次按下回退键的时间
mui.toast('再按一次退出应用'); //给出提示
// history.go(0)//回退到上一页面
setTimeout(function () { //1s中后清除
first = null;
}, 1000);
} else {
if (new Date().getTime() - first < 1000) { //如果两次按下的时间小于1s,
plus.runtime.quit(); //那么就退出app
}
}
};
</script>
</body>
</html>
\ No newline at end of file
{
"info": {
"code": 0,
"msg": "success",
"data": {
"name": "Zero"
}
},
"test": {
"code": 0,
"msg": "success",
"data": {
"city": "china"
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "vue-onsenui-base",
"version": "1.0.0",
"description": "A Vue.js project based on onsenui",
"author": "Mingzhe Yang <yangmingzhe@benmu-health.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"mock": "json-server --watch mock/db.json",
"analyz": "NODE_ENV=production npm_config_report=true npm run build"
},
"dependencies": {
"axios": "^0.16.0",
"better-scroll": "^1.14.1",
"element-ui": "^2.4.11",
"es6-promise": "^4.0.5",
"fastclick": "^1.0.6",
"highlight.js": "^9.11.0",
"jquery": "^3.3.1",
"lodash": "^4.17.4",
"moment": "^2.23.0",
"vue": "^2.5.16",
"vue-awesome-swiper": "^3.1.3",
"vue-datepicker": "^1.3.0",
"vue-directive-touch": "^1.0.22",
"vue-onsenui": "^2.4.2",
"vue-router": "^3.0.1",
"vue-swiper-component": "^2.1.3",
"vue-ydui": "^1.2.6",
"vue-zj-contractlist": "^1.0.3",
"vuex": "^3.0.1",
"vux": "^2.9.2"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"babili-webpack-plugin": "^0.1.2",
"chalk": "^2.0.1",
"clean-webpack-plugin": "^0.1.16",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.11",
"cssnano": "^3.10.0",
"echarts": "^4.2.0-rc.2",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"json-server": "^0.14.0",
"less": "^2.3.1",
"less-loader": "^4.1.0",
"node-sass": "^4.5.3",
"npmproject-wr": "^1.0.0",
"onsenui": "^2.8.2",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"sass-loader": "^6.0.6",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"style-loader": "^0.23.1",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"swiper": "^4.4.2",
"uglify-js": "^3.4.9",
"uglifyjs-webpack-plugin": "^2.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^12.1.0",
"vue-scroller": "^2.2.4",
"vue-style-loader": "^3.0.1",
"vue-swipe": "^2.4.0",
"vue-template-compiler": "^2.3.3",
"vux-loader": "^1.2.9",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0",
"yaml-loader": "^0.5.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
<template>
<div>
<!-- <transition name="fade" mode="out-in"> -->
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<!-- </transition> -->
<loading v-show="bLoading"></loading>
<!-- <transition name="fade" mode="out-in"> -->
<router-view v-if="!$route.meta.keepAlive"></router-view>
<!-- </transition> -->
<footera v-show="this.$root.$data.bfoot"></footera>
</div>
</template>
<style >
.photoview {
padding: 0.2rem;
position: fixed;
overflow: hidden;
width: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 999;
min-height: 10rem;
align-items: center;
display: flex;
}
.photoview img {
/* width: 100%; */
max-height: 4rem;
width: 7rem;
}
.photoview a {
position: absolute;
top: 0.2rem;
right: 0.2rem;
background: rgba(223, 63, 65, 0.4);
color: white;
height: 24px;
width: 24px;
text-align: center;
line-height: 24px;
border-radius: 50%;
}
.header {
height: 0.8rem;
width: 100%;
text-align: center;
display: flex;
justify-content: center;
overflow: hidden;
align-items: center;
position: relative;
}
.header-font {
font-size: 0.36rem;
font-weight: bold;
}
.header .callbacka {
display: flex;
position: absolute;
left: 0.4rem;
align-items: center;
}
.header .gobackicon {
position: relative;
}
.header .gobackicon:before {
position: absolute;
width: 0.2rem;
height: 0.2rem;
margin-top: -0.08rem;
border-right: 0.02rem solid #000;
border-bottom: 0.02rem solid #000;
transform: rotate(135deg);
content: "";
}
</style>
<script>
import { mapActions, mapGetters ,mapState } from "Vuex";
import footera from "./components/footera";
import loading from "./components/loading";
export default {
components: {
footera,
loading
},
// computed: mapGetters(["bLoading"]),
computed: {
...mapGetters(["bLoading"])
},
// methods: {
// ...mapActions(["getUserInfo"]),
// bindEvent() {
// GLOBAL.vbus.$on("business.response.incorrect", resData => {});
// // 自行触发
// GLOBAL.vbus.$on("ajax.request.error", resData => {});
// GLOBAL.vbus.$on("ajax.response.error", resData => {});
// },
// init() {
// this.getUserInfo();
// }
// },
created(){
},
watch: {
$route: {
handler: function(newvalue) {
if (/home|checkstandard|user|group/.test(newvalue.path)) {
this.$root.$data.bfoot = true;
} else {
this.$root.$data.bfoot = false;
}
},
immediate: true
}
}
};
</script>
<style>
p {
font-weight: normal;
}
@import "./assets/icon/iconfont.css";
@import "./assets/style/index.scss";
</style>
let baseUrl = 'http://k5.jst-gov.com';
export {
baseUrl
}
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
!function(e){var t=e.document,n=t.documentElement,i="orientationchange"in e?"orientationchange":"resize",a=function e(){var t=n.getBoundingClientRect().width;return n.style.fontSize=5*Math.max(Math.min(t/750*20,11.2),8.55)+"px",e}();n.setAttribute("data-dpr",e.navigator.appVersion.match(/iphone/gi)?e.devicePixelRatio:1),/iP(hone|od|ad)/.test(e.navigator.userAgent)&&(t.documentElement.classList.add("ios"),parseInt(e.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1],10)>=8&&t.documentElement.classList.add("hairline")),t.addEventListener&&(e.addEventListener(i,a,!1),t.addEventListener("DOMContentLoaded",a,!1))}(window);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
@import './reset.scss';
@import './util.scss';
.ivu-form-item-content h1,
.ivu-form-item-content h2,
.ivu-form-item-content h3,
.ivu-form-item-content h4,
.ivu-form-item-content h5,{
margin-top: 2px ;
}
html, body{
width: 100%;
height: 100%;
background: #f3f3f3;
overflow-x: hidden;
}
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
-webkit-box-shadow: 0 0 0 1000px white inset;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus {
-webkit-box-shadow: 0 0 0 1000px white inset;
}
.card-container {
padding: 10px 10px 0 0;
}
p {
color: $primary-font-color;
font-weight: bold;
}
.ivu-affix{
height: 1px;
}
.detail-container .ivu-select-dropdown, .detail-container .ivu-poptip-popper{
position: absolute !important;
}
.schedule-container .ivu-poptip{
position: relative;
.ivu-poptip-popper{
left: -180px !important;
top: 5px !important;
.ivu-poptip-inner{
background-color: rgba(36, 90, 136, 0.72);
color: white;
}
.ivu-poptip-arrow {
display: none;
}
}
}
// .detail-container .ivu-poptip-popper
.detail-container .ivu-select-dropdown{
top: 33px!important;
left: auto;
width: inherit;
}
// 以便在父元素没有height而只有min-height时,依然能够保持水平垂直居中
.ivu-spin-fix {
margin: auto;
}
\ No newline at end of file
//== Position
.relative {
position: relative;
}
.code {
background: #f5f7f9;
padding: 10px 0 10px 20px;
border-radius: 3px;
border-left: 3px solid $primary-color;
}
//== Display
.block {
display: block !important;
}
.hidden {
display: none;
}
.inline-block {
display: inline-block !important;
}
.width-auto {
width: 100%
}
//== Margin
.mg-tp-0 {
margin-top: 0px !important;
}
.mg-tp-5 {
margin-top: 5px !important;
}
.mg-tp-10 {
margin-top: 10px !important;
}
.mg-tp-15 {
margin-top: 15px !important;
}
.mg-tp-20 {
margin-top: 20px !important;
}
.mg-tp-50 {
margin-top: 50px !important;
}
.mg-tp-40 {
margin-top: 40px !important;
}
.mg-bt-0 {
margin-bottom: 0px !important;
}
.mg-bt-5 {
margin-bottom: 5px !important;
}
.mg-bt-10 {
margin-bottom: 10px !important;
}
.mg-bt-0 {
margin-bottom: 0px !important;
}
.mg-bt-15 {
margin-bottom: 15px !important;
}
.mg-bt-20 {
margin-bottom: 20px !important;
}
.mg-bt-30 {
margin-bottom: 30px !important;
}
.mg-lf-10 {
margin-left: 10px !important;
}
.mg-lf-25 {
margin-left: 25px !important;
}
//== Padding
.pd-0 {
padding: 0 !important;
}
.pd-tp-0 {
padding-top: 0 !important;
}
.pd-tp-15 {
padding-top: 15px !important;
}
.pd-lf-15 {
padding-left: 15px !important;
}
.pd-lf-20 {
padding-left: 20px !important;
}
.pd-rg-0 {
padding-right: 0 !important;
}
.pd-bt-15 {
padding-bottom: 15px !important;
}
.pd-bt-30 {
padding-bottom: 30px !important;
}
//== Text
.text-inline {
display: block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left !important;
}
.text-right {
text-align: right;
}
//== Float
.float-right {
float: right;
}
//== Font
.font-bold {
font-weight: 700 !important;
}
.font-normal {
font-weight: 400 !important;
}
//== Vertical
.vertical-middle {
vertical-align: middle;
}
//== Overflow
.overflow-auto {
overflow: auto;
}
.overflow-x-auto {
overflow-x: auto;
}
.overflow-y-auto {
overflow-y: auto;
}
.w200{
width: 200px;
}
.w50{
width: 50px;
}
.w70{
width: 70px;
}
.w100{
width: 100px;
}
.w300{
width: 300px;
}
.w400{
width: 400px;
}
.w500{
width: 500px;
}
.color-white{
color: white
}
.demo-tabs-style1 > .ivu-tabs-card > .ivu-tabs-content {
margin-top: -16px;
}
.demo-tabs-style1 > .ivu-tabs-card > .ivu-tabs-content > .ivu-tabs-tabpane {
background: #fff;
padding: 16px;
}
.demo-tabs-style1 > .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab {
border-color: transparent;
}
.demo-tabs-style1 > .ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab-active {
border-color: #fff;
}
.demo-tabs-style2 > .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab{
border-radius: 0;
background: #fff;
}
.demo-tabs-style2 > .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab-active{
border-top: 1px solid #3399ff;
}
.demo-tabs-style2 > .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab-active:before{
content: '';
display: block;
width: 100%;
height: 1px;
background: #3399ff;
position: absolute;
top: 0;
left: 0;
}
\ No newline at end of file
@import './test.scss';
@import '../../../static/style/libs/_export.scss';
@import './base/_export.scss';
@import './page/_export.scss';
\ No newline at end of file
@import './index.scss';
@import './login.scss';
\ No newline at end of file
html, body {
// color: $primary-font-color;
}
.layout {
min-width: 1000px;
background: #f3f3f3;
padding: 0;
.layout-content {
zoom: 1;
min-height: 800px;
.layout-left {
float: left;
position: fixed;
.layout-ceiling {
width: $layout-left-position;
height: 100px;
background: $primary-color;
overflow: hidden;
box-shadow: 1px 3px 4px rgba(88, 95, 94, 0.91);
.layout-logo {
width: auto;
color: white;
float: left;
font-size: 35px;
margin-left: 10px;
height: 80px;
margin-top: 10px;
margin-left: 30px;
}
.layout-ceiling-main {
margin-right: 15px;
padding-top: 20px;
a {
color: white;
font-size: 20px;
}
}
}
.layout-userinfo {
width: 240px;
margin-top: 20px;
min-height: 250px;
color: #444;
padding: 20px;
background: white;
box-shadow: 1px 1px 3px rgba(152,152,152,0.91);
}
.username {
text-align: center;
margin-bottom: 10px;
}
.userinfo {
text-align: center;
min-height: 140px;
p {
color: white;
}
}
.userhandle {
text-align: center;
}
}
.layout-content-wapper {
zoom: 1;
width: 100%;
padding-left: $layout-left-position + 10;
box-sizing: border-box;
padding-right: 0px;
// margin-top: 10px;
.layout-content-main {
width: 100%;
word-wrap: break-word;
min-height: 600px;
.layout-copy {
text-align: center;
padding: 30px 0 20px;
color: #9ea7b4;
}
}
}
}
}
.ivu-table-cell {
padding: 18px;
}
.ivu-menu-vertical.ivu-menu-light:after {
background: none;
}
// detail full
.detail-btn {
background-color: transparent;
border: none;
}
.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu) {
color: white;
border-left: 5px solid $primary-color;
border-right: 0;
z-index: 2;
background-color: #474b4e;
}
.ivu-table .table-active-row td {
background-color: #ebf7ff !important;
}
.title {
padding-left: 5px;
border-left: 6px solid $primary-color;
border-bottom: 2px solid $primary-color;
display: inline-block;
padding-right: 30px;
}
.title-bottom {
padding-left: 5px;
color: #73767b;
border-left: 6px solid $primary-color;
}
.page-tab-container {
position: relative;
width: 100%;
min-height: 600px;
display: inline-grid;
}
.navbar {
top: 10px;
width: $layout-left-position;
margin-right: -200px;
overflow-y: auto;
overflow-x: hidden;
max-height: 525px;
box-shadow: 1px 1px 3px rgba(152, 152, 152, 0.91);
}
.common-filter {
.filter-title {
cursor: pointer;
z-index: 9;
position: fixed;
right: 10px;
top: 10px;
padding: 10px 20px;
background: white;
/* color: white; */
border-radius: 2px;
box-shadow: 0px 0px 5px #e4e5e7;
}
.filter-card-contanier {
z-index: 9;
position: fixed;
right: 0;
top: 52px;
padding: 10px;
.filter-card {
background-color: rgba(255, 255, 255, 0.95);
box-shadow: 0 0 5px #dddee1;
border-radius: 2px;
.ivu-card-body {
padding: 0px;
}
.filter-content {
padding: 16px;
}
}
}
}
.home-container {
width: 100%;
height: 100%;
background: url(https://lev-inf.benmu-health.com/resource/image/1b63702d8aaec125e036b778065060c5.jpg) no-repeat 0;
position: absolute;
background-size: cover;
top: 0;
z-index: 999;
bottom: 0;
left: 0;
right: 0;
.home-login-container {
width: 300px;
height: 300px;
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: translateY(-30%);
.home-login-logo {
text-shadow: 0 0 4px rgba(36, 90, 136, 0.9), 0 0 10px white;
width: 300px;
height: 80px;
display: block;
color: white;
font-size: 50px;
margin-bottom: 25px;
}
.ivu-card {
width: 300px;
border: none;
box-shadow: 0 0 5px black;
}
.copy-right {
text-align: center;
margin-top: 20px;
color: white;
}
}
}
.ccccccccccccc {
color:red;
background-color: red;
}
\ No newline at end of file
<template>
<div class="home-news">
<div class="home-news-left">
<b>视点推荐</b>
</div>
<div class="home-news-right">
<yd-rollnotice autoplay="2000" :height="'40'" style="font-size:0.3rem ;color:#999;" >
<yd-rollnotice-item >
<span class="home-news-rollnotice">
<span style="color:#FF6A6A;"></span>&nbsp;比较重要的行业资讯业资讯业资业资业资业资
</span>
</yd-rollnotice-item>
</yd-rollnotice>
</div>
</div>
</template>
<script>
export default {};
</script>
<style>
.home-news {
background-color: white;
}
.home-news-left{
margin-left: 0.3rem;
margin-right: 0.4rem;
float: left;
height: 40px;
font-size: 0.3rem;
display: flex;
align-items: center;
}
.home-news-right{
float: left;
}
.home-news-rollnotice{
width: 210px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
</style>
<template>
<yd-pullrefresh :callback="loadList" ref="pullrefreshDemo">
<yd-list theme="4">
<yd-list-item v-for="(item, key) in list" :key="key">
<img slot="img" :src="item.img">
<span slot="title">{{item.title}}</span>
<yd-list-other slot="other">
<div>
<span class="list-price">
<em>¥</em>
{{item.marketprice}}
</span>
<span class="list-del-price">¥{{item.productprice}}</span>
</div>
<div>content</div>
</yd-list-other>
</yd-list-item>
</yd-list>
</yd-pullrefresh>
</template>
<script type="text/babel">
import * as types from "./common/mixin";
export default {
data() {
return {
page: 1,
list: [
{
img: "http://img1.shikee.com/try/2016/06/23/14381920926024616259.jpg",
title: "标题标题标题标题标题",
marketprice: 56.23,
productprice: 89.36
},
]
};
},
methods: {
loadList() {
setTimeout(() => {
this.$dialog.toast({
mes:
"条内容"+"已是最新内容"
});
this.$refs.pullrefreshDemo.$emit('ydui.pullrefresh.finishLoad');
}, 1000);
}
}
};
</script>
\ No newline at end of file
<template>
<yd-infinitescroll :callback="loadList" ref="infinitescrollDemo" style="margin-bottom:1rem;" >
<yd-list theme="1" slot="list">
<yd-list-item v-for="(item, key) in list" :key="key">
<img slot="img" :src="item.img">
<span slot="title">{{item.title}}</span>
<yd-list-other slot="other">
<div>
<span class="list-price"><em>¥</em>{{item.marketprice}}</span>
<span class="list-del-price">¥{{item.productprice}}</span>
</div>
<div>content</div>
</yd-list-other>
</yd-list-item>
</yd-list>
<!-- 数据全部加载完毕显示 -->
<span slot="doneTip">啦啦啦,啦啦啦,没有数据啦~~</span>
<!-- 加载中提示,不指定,将显示默认加载中图标 -->
<imgslot="loadingTip" src="http://static.ydcss.com/uploads/ydui/loading/loading10.svg"/>
</yd-infinitescroll>
</template>
<script type="text/babel">
Vue.component(InfiniteScroll.name, InfiniteScroll);
export default {
data() {
return {
page: 1,
pageSize: 10,
list: [
{
img: "http://img1.shikee.com/try/2016/06/23/14381920926024616259.jpg",
title: "标题标题标题标题标题",
marketprice: 56.23,
productprice: 89.36
},
{
img: "http://img1.shikee.com/try/2016/06/21/10172020923917672923.jpg",
title: "骆驼男装2016夏装男士短袖T恤 圆领衣服 印花男装体恤 半袖打底衫",
marketprice: 56.23,
productprice: 89.36
},
{
img: "http://img1.shikee.com/try/2016/06/23/15395220917905380014.jpg",
title: "条纹短袖T恤男士韩版衣服大码潮流男装夏季圆领体恤2016新款半袖",
marketprice: 56.23,
productprice: 89.36
},
{
img: "http://img1.shikee.com/try/2016/06/25/14244120933639105658.jpg",
title: "夏季青少年衣服男生潮牌t恤 男士 夏秋学生 日系棉短袖半袖男小衫",
marketprice: 56.23,
productprice: 89.36
},
{
img: "http://img1.shikee.com/try/2016/06/26/12365720933909085511.jpg",
title: "2016夏装新款时尚潮流短袖T恤男纯棉V领日系青少年韩版夏季上衣服",
marketprice: 56.23,
productprice: 89.36
},
{
img: "http://img1.shikee.com/try/2016/06/19/09430120929215230041.jpg",
title: "男装衣服男夏t恤 男士短袖t恤圆领夏季潮牌宽松原宿风半截袖男",
marketprice: 56.23,
productprice: 89.36
}
]
}
},
methods: {
loadList() {
// this.$http.jsonp('http://list.ydui.org/getdata.php?type=backposition', {
// params: {
// page: this.page,
// pagesize: this.pageSize
// }
// }).then(function (response) {
// const _list = response.body;
// this.list = [...this.list, ..._list];
// if (_list.length < this.pageSize || this.page == 3) {
// /* 所有数据加载完毕 */
this.$refs.infinitescrollDemo.$emit('ydui.infinitescroll.loadedDone');
// return;
// }
// /* 单次请求数据完毕 */
this.$refs.infinitescrollDemo.$emit('ydui.infinitescroll.finishLoad');
// this.page++;
// });
}
}
}
</script>
\ No newline at end of file
export function fileWrite(name, data) {
plus.io.requestFileSystem(plus.io.PUBLIC_DOCUMENTS, function (fs) {
fs.root.getFile(name + '.json', {
create: true
}, function (fileEntry) {
fileEntry.file(function (file) {
var fileWrite = new plus.io.FileWriter;
fileEntry.createWriter(function (fileWrite) {
fileWrite.write(data);
fileWrite.onwrite = function (e) {
alert("write ok");
}
})
});
});
});
};
export function fileReader(name, callback) {
plus.io.requestFileSystem(plus.io.PUBLIC_DOCUMENTS, function (fs) {
fs.root.getFile(name + '.json', {
create: true
}, function (fileEntry) {
fileEntry.file(function (file) {
var fileReader = new plus.io.FileReader();
fileReader.readAsText(file, 'utf-8');
fileReader.onloadend = function (evt) {
alert("reader ok");
callback(evt.target.result)
// var data = JSON.parse(evt.target.result)
}
});
});
});
};
\ No newline at end of file
//到时分秒的日期格式化
exports.dateFormat = (dateText) => {
let _func = function (number, length) {
length = length || 2;
return ("0".repeat(length) + number).substr(-length);
};
if (dateText == null) return "";
let date = new Date(dateText);
return (
date.getFullYear() +
"-" +
_func(date.getMonth() + 1) +
"-" +
_func(date.getDate()) +
" " +
_func(date.getHours()) +
":" +
_func(date.getMinutes())
);
},
//日期格式化自定义
exports.Format = (dateText, fmt) => {
//author: meizz
if (dateText == null) return "";
let date = new Date(dateText);
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
S: date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1 ?
o[k] :
("00" + o[k]).substr(("" + o[k]).length)
);
return fmt;
},
//金额格式化
exports.MoneyFormat = (s, n) => {
if (s < 0) {
n = n > 0 && n <= 20 ? n : 2;
s = 0 - s;
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
var l = s
.split(".")[0]
.split("")
.reverse(),
r = s.split(".")[1],
t = "";
for (var i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 === 0 && i + 1 != l.length ? "," : "");
}
return (
"-" +
t
.split("")
.reverse()
.join("") +
"." +
r
);
} else {
n = n > 0 && n <= 20 ? n : 2;
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
var l = s
.split(".")[0]
.split("")
.reverse(),
r = s.split(".")[1],
t = "";
for (var i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 === 0 && i + 1 != l.length ? "," : "");
}
return (
t
.split("")
.reverse()
.join("") +
"." +
r
);
}
},
//金额以万为单位
exports.MoneyToChineseTail = (number) => {
return (number / 10000).toFixed(2) + '万';
}
export function latitude() {
plus.geolocation.getCurrentPosition(
function(res) {
//成功回调
var user_latitude = res.coords.latitude; //纬度
var user_longitude = res.coords.longitude; //经度
},
function(e) {
console.log(
"Gelocation Error: code - " + e.code + "; message - " + e.message
);
switch (e.code) {
case 10:
mui.alert(
"请开启应用的定位权限",
"温馨提示",
"确定",
function() {},
"div"
);
break;
case 9:
//mui.alert('请开启手机定位服务');
mui.alert(
"请开启手机定位服务",
"温馨提示",
"确定",
function() {},
"div"
);
break;
case 2:
if (e.message.indexOf("[geolocation:13]") > -1) {
//如果网络开启,定位失败,提示检查定位权限
mui.alert(
"请开启应用的定位权限",
"温馨提示",
"确定",
function() {},
"div"
);
}
if (e.message.indexOf("[geolocation:14]") > -1) {
//如果应用的权限开了,提示网络异常
mui.alert(
"请检查网络是否正常",
"温馨提示",
"确定",
function() {},
"div"
);
}
break;
case e.PERMISSION_DENIED:
mui.alert(
"请求定位被拒绝",
"温馨提示",
"确定",
function() {},
"div"
);
break;
case e.POSITION_UNAVAILABLE:
mui.alert(
"位置信息不可用",
"温馨提示",
"确定",
function() {},
"div"
);
break;
case e.TIMEOUT:
mui.alert(
"获取位置信息超时",
"温馨提示",
"确定",
function() {},
"div"
);
break;
case e.UNKNOWN_ERROR:
mui.alert("未知错误", "温馨提示", "确定", function() {}, "div");
break;
}
},
{
//超时未获取到经纬度信息 执行失败回调 (默认为5秒)
timeout: 3000
}
);
}
\ No newline at end of file
import {
Confirm,
Alert,
Toast,
Notify,
Loading
} from 'vue-ydui/dist/lib.rem/dialog';
import echarts from 'echarts';
import {
helpers
} from "./mixin"
export default {
install: (Vue, options) => {
Vue.prototype.$dialog = {
confirm: Confirm,
alert: Alert,
toast: Toast,
notify: Notify,
loading: Loading,
},
Vue.prototype.$helpers = helpers,
Vue.prototype.$echarts = echarts
}
}
export default{
    pySort(arr){
        var $this = this;
var letters = "ABCDEFGHJKLMNOPQRSTWXYZ".split('');
var result = [];
var curr;
for(var i=0;i<letters.length;i++){
curr = {letter: letters[i], data:[]};
for(var j =0;j<arr.length;j++){
var firstLetter = pinyinUtil.getFirstLetter(arr[j].Name)
var initial = firstLetter.charAt(0);//截取第一个字符
if(initial==letters[i]||initial==letters[i].toLowerCase()){
curr.data.push({
Name:arr[j].Name,
Image:arr[j].Image,
MonitorFlag:arr[j].MonitorFlag,
Student_ID:arr[j].Student_ID
});
}
}
if(curr.data.length) {
result.push(curr);
}
}
return result;
}
}
\ No newline at end of file
export function video() {
// 调用原生android摄像头
var VIDEOZOOM = 200;
var MediaStore = plus.android.importClass("android.provider.MediaStore");
var Intent = plus.android.importClass("android.content.Intent");
// 导入后可以使用new方法创建类的示例对象
var intent = new Intent("android.media.action.VIDEO_CAPTURE");
intent.putExtra("android.intent.extra.videoQuality", 1); //0 means low quality, 1 means high quality
//intent.putExtra("android.provider.MediaStore.EXTRA_OUTPUT", url);
intent.putExtra("android.intent.extra.durationLimit", 3); //设置录像时间
var main = plus.android.runtimeMainActivity();
main.startActivityForResult(intent, VIDEOZOOM);
//获取返回参数
main.onActivityResult = function(requestCode, resultCode, data) {
var context = main;
plus.android.importClass(data);
var uri = data.getData();
var resolver = context.getContentResolver();
plus.android.importClass(resolver);
var cursor = resolver.query(uri, null, null, null, null);
plus.android.importClass(cursor);
cursor.moveToFirst();
var column = cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);
// 获取录制的视频路径
var filePath = cursor.getString(column);
// 解析视频文件的属性
plus.io.resolveLocalFileSystemURL(
filePath,
function(entry) {
entry.file(function(file) {
console.log("size==" + file.size);
console.log("name==" + file.name);
});
},
function(e) {
console.log("Resolve file URL failed: " + e.message);
}
);
};
}
\ No newline at end of file
export function websql() {
function dataBaseCRUD() {
var dataBase = openDatabase(
"schoo",
"1.0.0",
"学校数据库",
1024 * 1024 * 2
);
/**
* (1)openDatabase方法打开一个已经存在的数据库,如果数据库不存在,它还可以创建数据库。几个参数意义分别是:
* 1,数据库名称。
* 2,数据库的版本号,目前来说传个1.0就可以了,当然可以不填;
* 3,对数据库的描述。
* 4,设置分配的数据库的大小(单位是kb)。
* 5,回调函数(可省略)。
*/
if (!dataBase) {
console.info("当前浏览器不支持Html5本地数据库");
return false;
} else {
dataBase.transaction(function(ts) {
//启动一个事务,并设置回调函数
ts.executeSql(
"create table if not exists Student(id int,name text null,age int,sex text null)",
[],
function(ts, result) {
console.info("创建数据库成功" + result);
},
function(ts, message) {
console.info("创建数据库失败", message);
}
);
});
dataBase.transaction(function(ts) {
ts.executeSql(
"insert into Student(id,name,age,sex) values(?,?,?,?) ",
[1, "小1", 21, "男"],
function(ts, result) {
console.info("插入数据成功!" + result);
},
function(ts, message) {
console.info("插入数据失败!" + message);
}
);
});
dataBase.transaction(function(ts) {
ts.executeSql(
"insert into Student(id,name,age,sex) values(?,?,?,?) ",
[2, "小红", 20, "女"],
function(ts, result) {
console.info("插入数据成功!" + result);
},
function(ts, message) {
console.info("插入数据失败!" + message);
}
);
});
dataBase.transaction(function(ts) {
ts.executeSql(
"update Student set name = ? where id = ? ",
["小红s", 2],
function(ts, result) {
console.info("更新数据成功!" + result);
},
function(ts, message) {
console.info("更新数据失败!" + message);
}
);
});
dataBase.transaction(function(ts) {
ts.executeSql(
"delete from Student where id = ? ",
[2],
function(ts, result) {
console.info("删除数据成功!" + result);
},
function(ts, message) {
console.info("删除数据失败!" + message);
}
);
});
dataBase.transaction(function(ts) {
ts.executeSql(
"select * from Student ",
[],
function(ts, result) {
if (result) {
for (var i = 0; i < result.rows.length; i++) {
console.info(result.rows.item(i));
}
}
console.info("查询数据成功!");
},
function(ts, message) {
console.info("查询数据失败!" + message);
}
);
});
}
/**
* (2)db.transaction方法可以设置一个回调函数,此函数可以接受一个参数就是我们开启的事务的对象。然后通过此对象可以进行执行Sql脚本,跟下面的步骤可以结合起来。
* (3)通过executeSql方法执行查询。
* ts.executeSql(sqlQuery,[value1,value2..],dataHandler,errorHandler)
* 参数说明:
* 1,sqlQuery:需要具体执行的sql语句,可以是create、select、update、delete;
* 2,[value1,value2..]:sql语句中所有使用到的参数的数组,在executeSql方法中,将s>语句中所要使用的参数先用“?”代替,然后依次将这些参数组成数组放在第二个参数中
* 3,dataHandler:执行成功是调用的回调函数,通过该函数可以获得查询结果集;
* 4,errorHandler:执行失败时调用的回调函数;
*
*/
}
dataBaseCRUD();
//根据学号删除学生信息
}
\ No newline at end of file
{
"DomiId":"test",
"employees": [{
"firstName": "Bill",
"lastName": "Gates"
},
{
"firstName": "George",
"lastName": "Bush"
},
{
"firstName": "Thomas",
"lastName": "Carter"
}
]
}
<template>
<div class="footNav">
<router-link to="/home" tag="dl" active-class="footeractive1">
<a href="javascript:;">
<dt>
<i class="iconfont icon-ren">&#xe618;</i>
</dt>
<dd>首页</dd>
</a>
</router-link>
<router-link to="/checkstandard" tag="dl" active-class="footeractive3">
<a href="javascript:;">
<dt>
<i class="iconfont icon-ren">&#xe638;</i>
</dt>
<dd>标准</dd>
</a>
</router-link>
<router-link to="/group" tag="dl" active-class="footeractive4">
<a href="javascript:;">
<dt>
<i class="iconfont icon-ren">&#xe674;</i>
</dt>
<dd>业务</dd>
</a>
</router-link>
<router-link to="/user" tag="dl" active-class="footeractive5">
<a href="javascript:;">
<dt>
<i class="iconfont icon-ren">&#xe671;</i>
</dt>
<dd>我的</dd>
</a>
</router-link>
<div class="clearfix"></div>
</div>
</template>
<style>
.footNav {
position: fixed;
left: 0;
bottom: 0;
z-index: 999;
width: 100%;
height: 1rem;
border-top: #ddd 1px solid;
background: #f7f7f7;
}
.footNav dl {
float: left;
width: 25%;
text-align: center;
color: #999;
}
.footNav dl i {
font-size: 0.4rem;
}
.footNav dt {
height: 0.6rem;
line-height: 0.6rem;
}
.footNav dd {
font-size: 0.24rem;
}
.footNav .footeractive1 {
color: #d81e06;
}
.footNav .footeractive2 {
color: #437dff;
}
.footNav .footeractive3 {
color: #63f7de;
}
.footNav .footeractive4 {
color: #87c596;
}
.footNav .footeractive5 {
color: #37c4fe;
}
</style>
<script>
</script>
<template>
<div classs="bloading" >
<div class="loading">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
</template>
<style scoped>
.loading{
width: 110px;
height: 15px;
margin: 0 auto;
margin-top:100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
}
.loading span{
display: inline-block;
width: 15px;
height: 100%;
margin-right: 5px;
border-radius: 50%;
background: lightgreen;
-webkit-animation: load 1.04s ease infinite;
}
.loading span:last-child{
margin-right: 0px;
}
@-webkit-keyframes load{
0%{
opacity: 1;
}
100%{
opacity: 0;
}
}
.loading span:nth-child(1){
-webkit-animation-delay:0.13s;
}
.loading span:nth-child(2){
-webkit-animation-delay:0.26s;
}
.loading span:nth-child(3){
-webkit-animation-delay:0.39s;
}
.loading span:nth-child(4){
-webkit-animation-delay:0.52s;
}
.loading span:nth-child(5){
-webkit-animation-delay:0.65s;
}
</style>
<template>
<yd-lightbox>
<yd-lightbox-img v-for="(item, key) in this.photo" :key="key" :src="item"></yd-lightbox-img>
</yd-lightbox>
</template>
<script>
export default {
props:['photo']
}
</script>
<template>
<div
class="my-scroll"
:class="[scrollState?'prohibit':'allow']"
ref="myScroll"
@scroll.passive="onScroll($event)"
@touchstart="touchStart($event)"
@touchmove="touchMove($event)"
@touchend="touchEnd($event)"
>
<div class="scroll-top" :style="{height:top+'px'}">
<div v-if="aspect==2">
<p style="color:red;" v-if="state==6">下拉刷新</p>
<p v-if="state==1">
<i>
<img src="../assets/img/pullrefresh.gif">
</i>
<br>
<a style="color:red;">刷新中</a>
</p>
<p style="color:red;" v-if="state==2">松开刷新</p>
<p style="color:red;" v-if="state==3">
<i>
<img src="../assets/img/pullrefresh.gif">
</i>
<br>刷新完成
</p>
</div>
</div>
<!-- top -->
<div class="scroll-list" :style="{ transform: 'translate3d(0, ' + top + 'px, 0)'}">
<slot name="scrollList"></slot>
<div style="color:red;" class="scroll-bottom">
<div v-if="state==4">加载中</div>
<div v-if="state==5">加载完成</div>
<div v-if="state==7">没有更多</div>
</div>
</div>
</div>
</template>
<script type="text/javascript">
// import tween from '@/plugins/tween'
// import Load from '@/assets/Load.gif'
export default {
name: "myScroll",
props: {
page: {
type: Object //counter:当前页 pageStart:开始页数 pageEnd:结束页数 total:总页数
},
onRefresh: {
//刷新回调
type: Function,
require: true
},
onPull: {
//加载回调
type: Function,
require: true
},
getScrollTop: {
//获取滚动条位置
type: Function
},
setScrollPage: {
//改变滚动条位置
type: Function
},
scrollState: {
//是否可滑动
type: Boolean,
require: true
}
},
data() {
return {
// Load,
pageX: 0,
pageY: 0,
state: 0,
scrollPosition: 0,
myScroll: null,
myScrollList: null,
top: 0,
aspect: 0, //1:向下 2:向上
listHeight: 0
};
},
created() {},
methods: {
ScrollTop(top) {
//修改滚动条位置
this.myScroll.scrollTop = top;
},
easeInOut(t, b, c, d) {
if ((t /= d / 2) < 1) return (c / 2) * t * t * t * t + b;
return (-c / 2) * ((t -= 2) * t * t * t - 2) + b;
},
/*
* 刷新中:1
* 松开刷新:2
* 刷新完成:3
* 加载中:4
* 加载完成:5
* 下拉刷新:6
* 没有更多:7
*/
setState(index) {
//修改状态
this.state = index;
if (index == 5 || index == 3) {
setTimeout(() => {
this.state = 0;
let timer = null;
let that = this;
var b = 50,
c = 100,
d = 100,
t = 0;
cancelAnimationFrame(timer);
timer = requestAnimationFrame(function fn() {
var oTop = that.top;
if (that.top > 0) {
that.top =
Math.ceil(that.easeInOut(10, oTop, 8, 10)) - 15;
timer = requestAnimationFrame(fn);
} else {
cancelAnimationFrame(timer);
that.top = 0;
}
});
}, 500);
}
},
touchStart(e) {
//触摸事件
this.pageX = e.targetTouches[0].pageX;
this.pageY = e.targetTouches[0].pageY;
},
touchMove(e) {
//触摸滑动事件
// console.log( this.scrollPosition)
if (document.documentElement.scrollTop == 0) {
this.scrollPosition = this.myScroll.scrollTop; //获取滚动条位置
if (this.scrollState && e.targetTouches[0].pageY > this.pageY) {
//向上滑动
this.aspect = 2;
if (this.myScroll.scrollTop == 0) {
let diff =
e.targetTouches[0].pageY -
this.pageY -
this.scrollPosition;
// console.log(diff)
this.top = Math.pow(diff, 0.9);
let ranget = (diff / document.body.clientHeight) * 100; //计算在屏幕上滑动了多少
if (ranget > 10) {
this.state = 2;
this.top = 50;
} else if (ranget < 5) {
this.state = 6;
}
e.preventDefault();
}
} else if (this.scrollState && this.state != 4) {
//向上滑动
this.aspect = 1;
}
}
},
touchEnd(e) {
if ((this.aspect == 2 && this.state == 2) || this.state == 1) {
//上拉处理
this.top = 50;
this.state = 1;
this.topCallback();
} else if (this.aspect == 2) {
this.state = 0;
this.top = 0;
}
},
onScroll(e) {
let listHeight = this.myScrollList.offsetHeight; //列表总高度
let listScrollTop = e.target.scrollTop + this.myScroll.offsetHeight; //当前滚动条位置
if (this.state == 0 && listHeight - listScrollTop < 100) {
this.bottomCallback();
}
if (this.getScrollTop) this.getScrollTop(e.target.scrollTop); //返回X,Y
},
topCallback() {
//刷新回调
this.onRefresh(this.state);
},
bottomCallback() {
//加载回调
if (this.state != 7) {
this.state = 4;
this.onPull(this.state);
}
}
},
mounted() {
this.myScroll = this.$refs.myScroll; //获取滑条dom
this.myScrollList = this.myScroll.children[1]; //获取列表dom
// console.log(this.myScroll)
}
};
</script>
<style lang="scss" scoped>
.allow {
overflow: hidden;
height: auto;
}
.prohibit {
max-width: 100%;
max-height: 100%;
height: 100%;
overflow: hidden;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
will-change: transform;
transition: all 450ms;
backface-visibility: hidden;
perspective: 1000;
}
.my-scroll {
position: relative;
color: #fff;
.scroll-top {
text-align: center;
display: flex;
position: absolute;
top: 0;
left: 0;
width: 100%;
overflow: hidden;
div {
display: flex;
height: auto;
width: 100%;
justify-content: center;
align-items: center;
flex-wrap: wrap;
i {
flex: 1 0 100%;
display: block;
height: 0.4rem;
}
img {
width: 0.6rem;
}
p {
flex: 1 0 100%;
}
}
}
.scroll-list {
overflow: hidden;
min-height: 100%;
}
.scroll-bottom {
text-align: center;
line-height: 40px;
}
}
</style>
<template>
<yd-search :result="result" fullpage v-model="value2" :item-click="itemClickHandler" :on-submit="submitHandler"></yd-search>
</template>
<script type="text/babel">
export default {
data() {
return {
value2: '',
result: []
}
},
methods: {
getResult(val) {
if (!val) return [];
return [
'Apple', 'Banana', 'Orange', 'Durian', 'Lemon', 'Peach', 'Cherry', 'Berry',
'Core', 'Fig', 'Haw', 'Melon', 'Plum', 'Pear', 'Peanut', 'Other'
].filter(value => new RegExp(val, 'i').test(value));
},
itemClickHandler(item) {
this.$dialog.toast({mes: `搜索:${item}`});
},
submitHandler(value) {
this.$dialog.toast({mes: `搜索:${value}`});
}
},
watch: {
value2(val) {
this.result = this.getResult(val);
}
}
}
</script>
\ No newline at end of file
<template>
<swipe :showIndicators="false" class="my-swipe">
<swipe-item v-for="(item ,index) in oldimg" class="slide" :key="index">
<img :src="item.imgurl" alt>
</swipe-item>
</swipe>
</template>
<script>
import { Swipe, SwipeItem } from "vue-swipe";
import "vue-swipe/dist/vue-swipe.css"; //引入样式
import { setTimeout } from "timers";
export default {
data() {
return {
type: "",
oldimg: [
{ imgurl: "static/img/lunbo.png" },
{ imgurl: "static/img/lunbo1.jpg" },
{ imgurl: "static/img/lunbo2.jpg" }
],
newimg: [],
urlAll: []
};
},
components: {
swipe: Swipe,
"swipe-item": SwipeItem
},
created() {
var vm = this;
// vm.init();
vm.getDownloadUrl();
},
methods: {
init() {
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1; //android终端
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
this.type = isiOS ? "1" : "0";
},
getDownloadUrl() {
var vm = this;
vm.$ajax
.get("Restful/Kivii.Contents.Entities.Content/Query.json")
.then(res => {
for (let index = 0; index < res.data.Results.length; index++) {
var url = vm.$baseurl + res.data.Results[index].TitleImageUrl;
vm.urlAll.push(url.split("?")[0]);
}
var downUrl = vm.urlAll; //下载链接,数组形式 必填
var localUrl = "image"; //文件类型 json 或 image 必填
vm.download(downUrl, localUrl);
})
.catch(responseerror => {
console.log('error')
});
},
download(downUrl, localUrl) {
var vm = this;
if (localUrl == null || downUrl == null) return;
if (vm.type == "0" || vm.type == "1") {
vm.downloadfile(downUrl, localUrl);
} else {
for (var i = 0; i < downUrl.length; i++) {
let downimg = {};
downimg.imgurl = downUrl[i];
vm.newimg.push(downimg);
}
vm.oldimg = vm.newimg;
}
},
downloadfile(downUrl, localUrl) {
var vm = this;
if (downUrl == null || localUrl == null) return;
//图片下载成功 默认保存在本地相对路径的"_downloads"文件夹里面,
for (var index = 0; index < downUrl.length; index++) {
var relativePath = "";
var filename = downUrl[index].substring(
downUrl[index].lastIndexOf("/") + 1,
downUrl[index].length
);
relativePath = "_downloads/" + localUrl + "/" + filename;
//检查文件是否已存在
console.log(relativePath)
(function(relativePath, downUrl) {
plus.io.resolveLocalFileSystemURL(
relativePath,
function(entry) {
console.log(localUrl + "文件存在,直接设置=" + relativePath);
//如果文件存在,则直接设置本地图片
vm.setImgFromLocal(relativePath);
},
function(e) {
console.log(localUrl + "图片不存在,联网下载=" + relativePath);
//如果文件不存在,联网下载图片
vm.setImgFromNet(downUrl, relativePath, localUrl);
}
);
})(relativePath, downUrl[index]);
}
},
setImgFromLocal(relativePath) {
//本地相对路径("_downloads/logo.jpg")转成SD卡绝对路径("/storage/emulated/0/Android/data/io.dcloud.HBuilder/.HBuilder/downloads/logo.jpg");
var vm = this;
var downimg = {};
var sd_path = plus.io.convertLocalFileSystemURL(relativePath);
downimg.imgurl = sd_path;
vm.newimg.push(downimg);
vm.oldimg = vm.newimg;
},
setImgFromNet(loadUrl, relativePath, localUrl) {
var vm = this;
// 创建下载任务
var dtask = plus.downloader.createDownload(
loadUrl,
{ method: "GET", filename: "_downloads/" + localUrl + "/" },
function(d, status) {
if (status == 200) {
//下载成功
console.log("下载成功=" + relativePath);
vm.setImgFromLocal(d.filename);
} else {
//下载失败,需删除本地临时文件,否则下次进来时会检查到图片已存在
console.log("下载失败=" + status + "==" + relativePath);
//dtask.abort();//文档描述:取消下载,删除临时文件;(但经测试临时文件没有删除,故使用delFile()方法删除);
if (relativePath != null) {
vm.delFile(relativePath);
}
}
}
);
//启动下载任务
dtask.start();
},
delFile(relativePath) {
plus.io.resolveLocalFileSystemURL(relativePath, function(entry) {
entry.remove(
function(entry) {
console.log("文件删除成功==" + relativePath);
},
function(e) {
console.log("文件删除失败=" + relativePath);
}
);
});
}
}
};
</script>
<style>
.slide img {
width: 100%;
height: 2rem;
}
.my-swipe {
width: 100%;
display: block;
height: 2rem;
color: red;
font-size: 30px;
text-align: center;
}
</style>
// 当前宿主平台
import {baseUrl} from '../api/index'
export const HOST_PLATFORM = 'WEB'
// 这个就不多说了
export const NODE_ENV = process.env.NODE_ENV || 'prod'
// 是否强制所有请求访问本地 MOCK,看到这里同学不难猜到,每个请求也可以单独控制是否请求 MOCK
export const AJAX_LOCALLY_ENABLE = false
// 是否开启监控
export const MONITOR_ENABLE = true
// 路由默认配置,路由表并不从此注入
export const ROUTER_DEFAULT_CONFIG = {
waitForData: true,
transitionOnLoad: true
}
// axios 默认配置
export const AXIOS_DEFAULT_CONFIG = {
timeout: 20000,
// maxContentLength: 2000,
headers: { },
baseURL:baseUrl,
withCredentials:true,
}
// vuex 默认配置
export const VUEX_DEFAULT_CONFIG = {
strict: process.env.NODE_ENV !== 'production'
}
// API 默认配置
export const API_DEFAULT_CONFIG = {
mockBaseURL: '',
mock: true,
debug: false,
sep: '/'
}
// CONST 默认配置
export const CONST_DEFAULT_CONFIG = {
sep: '/'
}
// 还有一些业务相关的配置
// ...
// 还有一些方便开发的配置
export const DEBUG_VUE_DEVTOOLS = true // vue devtools 开关
export const DEBUG_VUE_DEBUG = true // vue debug 开关
export const DEBUG_VUE_TIP = true // vue tip 开关
export const CONSOLE_REQUEST_ENABLE = false // 开启请求参数打印
export const CONSOLE_RESPONSE_ENABLE = true // 开启响应参数打印
export const CONSOLE_MONITOR_ENABLE = true // 监控记录打印
\ No newline at end of file
import {CONSOLE_REQUEST_ENABLE,CONSOLE_RESPONSE_ENABLE} from '../index.js'
import {baseUrl} from "../../api/index"
import store from "../../store/store"
import router from "Plugins/router";
import Vue from 'vue'; //引入vue
//必须实例化 Vue
let vm = new Vue();
export function requestSuccessFunc(requestObj) {
CONSOLE_REQUEST_ENABLE && console.info('requestInterceptorFunc', `url: ${requestObj.url}`, "info", requestObj)
// 自定义请求拦截逻辑,可以处理权限,请求发送监控等
if(requestObj.url!=baseUrl+"/auth/Customer.json" && requestObj.url!=baseUrl+"/Customer/Register/Personal"){
store.dispatch("VIEW_LOADING", true);
}
return requestObj
}
export function requestFailFunc(requestError) {
// 自定义发送请求失败逻辑,断网,请求发送监控等
// ...
// console.log(requestError)
return Promise.reject(requestError);
}
export function responseSuccessFunc(responseObj) {
store.dispatch("VIEW_LOADING", false);
// 自定义响应成功逻辑,全局拦截接口,根据不同业务做不同处理,响应成功监控等
// 假设我们请求体为
// {
// code: 1010,
// msg: 'this is a msg',
// data: null
// }
// let resData = responseObj.data
// let {code} = resData
// switch(code) {
// case 0: // 如果业务成功,直接进成功回调
// return resData.data;
// case 1111:
// 如果业务失败,根据不同 code 做不同处理
// 比如最常见的授权过期跳登录
// 特定弹窗
// 跳转特定页面等
// location.href = xxx // 这里的路径也可以放到全局配置里
// return;
// default:
// 业务中还会有一些特殊 code 逻辑,我们可以在这里做统一处理,也可以下方它们到业务层
// !responseObj.config.noShowDefaultError && GLOBAL.vbus.$emit('business.response.incorrect', resData.msg);
// return Promise.reject(resData);
// }
return responseObj
}
export function responseFailFunc(responseError) {
// 响应失败,可根据 responseError.message 和 responseError.response.status 来做监控处理
// ...
store.dispatch("VIEW_LOADING", false);
if(responseError){
switch(responseError.response.status){
case 401:
vm.$dialog.toast({
mes: '登陆状态错误,请重新登陆',
timeout: 2000,
icon: 'error',
});
setTimeout(() => {
router.replace({
path: '/login'
})
}, 2000);break;
}
}
return Promise.reject(responseError);
}
import {requestSuccessFunc, requestFailFunc, responseSuccessFunc, responseFailFunc} from './axios'
import {routerBeforeEachFunc} from './router'
export default {
requestSuccessFunc,
requestFailFunc,
responseSuccessFunc,
responseFailFunc,
routerBeforeEachFunc
}
\ No newline at end of file
import store from "../../store/store"
export function routerBeforeEachFunc (to, from, next) {
// 这里可以做页面拦截,很多后台系统中也非常喜欢在这里面做权限处理
if (to.meta.requireAuth) { // 判断该路由是否需要登录权限
if (store.state.token==1) { // 通过vuex state获取当前的token是否存在 1登陆 0 未登录
next();
}
else {
store.commit("CHANGE_LOGINURL",to.fullPath)
next({
path: '/login',
query: {redirect: to.fullPath} // 将跳转的路由path作为参数,登录成功后跳转到该路由
})
}
}
else {
next();
}
}
const SPECIAL_CLASS_HANDLE = ['ivu-modal']
function containsSpecial (target) {
let isContains = false
SPECIAL_CLASS_HANDLE.forEach((item) => {
if(target.className.indexOf(item) > -1) isContains = true
})
return isContains
}
export default {
bind (el, binding, vnode) {
function documentHandler (e) {
let _target = e.target
if(containsSpecial(_target)) return
if (el.contains(_target)) return false
if (binding.expression) binding.value(e);
}
el.__vueClickOutside__ = documentHandler;
document.addEventListener('click', documentHandler);
},
update () {
},
unbind (el, binding) {
document.removeEventListener('click', el.__vueClickOutside__);
delete el.__vueClickOutside__;
}
};
\ No newline at end of file
import hljs from 'highlight.js'
export default {
deep: true,
bind: function(el, binding) {
// on first bind, highlight all targets
let targets = el.querySelectorAll('code')
Array.from(targets).forEach((target) => {
// if a value is directly assigned to the directive, use this
// instead of the element content.
if (binding.value) {
target.textContent = binding.value
}
hljs.highlightBlock(target)
})
},
componentUpdated: function(el, binding) {
// after an update, re-fill the content and then highlight
let targets = el.querySelectorAll('code')
Array.from(targets).forEach((target) => {
if (binding.value) {
target.textContent = binding.value
hljs.highlightBlock(target)
}
})
}
}
import Vue from 'vue'
import highlightjs from'./highlight'
import clickoutside from './clickoutside'
Vue.directive('highlightjs', highlightjs)
Vue.directive('clickoutside', clickoutside)
\ No newline at end of file
import Vue from "vue";
import {
baseUrl
} from './api/index'
// GLOBAL.vbus = new Vue();
// import 'Components'// 全局组件注册
import $ from "jquery"
import "Directives";
import fastclick from 'fastclick';
import VueScroller from 'vue-scroller'
import router from "Plugins/router";
import inject from "Plugins/inject";
import store from "Store/store";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// import VueOnsen from "vue-onsenui";
// import "onsenui/css/onsenui.css";
// import "onsenui/css/onsen-css-components.css";
import echarts from 'echarts';
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
import YDUI from "vue-ydui";
import "vue-ydui/dist/ydui.rem.css";
import {
Confirm,
Alert,
Toast,
Notify,
Loading
} from 'vue-ydui/dist/lib.rem/dialog';
import App from "./App";
import touch from "vue-directive-touch";
import {
helpers
} from "./components/common/mixin";
import filters from "./components/common/filters";
Object.keys(filters).forEach((k) =>{ Vue.filter(k, filters[k])});
Vue.prototype.$baseurl = baseUrl;
Vue.prototype.$helpers = helpers
Vue.prototype.$echarts = echarts;
Vue.prototype.$dialog = {
confirm: Confirm,
alert: Alert,
toast: Toast,
notify: Notify,
loading: Loading,
};
Vue.use(ElementUI);
Vue.use(YDUI);
Vue.use(touch);
Vue.use(VueAwesomeSwiper)
Vue.use(inject);
// Vue.use(VueOnsen);
Vue.use(VueScroller)
fastclick.attach(document.body);
var vm = new Vue({
el: "#app",
router,
store,
data() {
return {
bfoot: false,
saletitle: '',
purchase: ''
}
},
template: "<App/>",
components: {
App
},
render: h => h(App)
});
import axios from './axios'
import _pick from 'lodash/pick'
import _assign from 'lodash/assign'
import _isEmpty from 'lodash/isEmpty'
import { assert } from 'Utils/tools'
import { API_DEFAULT_CONFIG } from 'Config'
import API_CONFIG from 'Service/api'
class MakeApi {
constructor(options) {
this.api = {}
this.apiBuilder(options)
}
apiBuilder({
sep = '|',
config = {},
mock = false,
debug = false,
mockBaseURL = ''
}) {
Object.keys(config).map(namespace => {
this._apiSingleBuilder({
namespace,
mock,
mockBaseURL,
sep,
debug,
config: config[namespace]
})
})
}
_apiSingleBuilder({
namespace,
sep = '|',
config = {},
mock = false,
debug = false,
mockBaseURL = ''
}) {
config.forEach( api => {
const {name, desc, params, method, mockEnable, path, mockPath } = api
const isMock = process.env.NODE_ENV === 'production' ? false : mock || mockEnable
const url = isMock ? mockPath : path
const baseURL = isMock && mockBaseURL
debug && assert(name, `${url} :接口name属性不能为空`)
debug && assert(url.indexOf('/') === 0, `${url} :接口路径path,首字符应为/`)
Object.defineProperty(this.api, `${namespace}${sep}${name}`, {
value(outerParams, outerOptions) {
const _data = _isEmpty(outerParams) ? params : _pick(_assign({}, params, outerParams), Object.keys(params))
const _options = isMock ? {url, desc, baseURL, method} : {url, desc, method}
return axios(_normoalize(_assign(_options, outerOptions), _data))
}
})
})
}
}
function _normoalize(options, data) {
if (options.method === 'POST') {
options.data = data
} else if (options.method === 'GET') {
options.params = data
}
return options
}
export default new MakeApi({
config: API_CONFIG,
...API_DEFAULT_CONFIG
})['api']
import axios from 'axios'
import {
AXIOS_DEFAULT_CONFIG
} from 'Config/index'
import {
requestSuccessFunc,
requestFailFunc,
responseSuccessFunc,
responseFailFunc
} from 'Config/interceptors/axios'
let axiosInstance = {}
axiosInstance = axios.create(AXIOS_DEFAULT_CONFIG)
// 注入请求拦截
axiosInstance
.interceptors.request.use(requestSuccessFunc, requestFailFunc)
// 注入失败拦截
axiosInstance
.interceptors.response.use(responseSuccessFunc, responseFailFunc)
export default axiosInstance
import _pick from 'lodash/pick'
import _assign from 'lodash/assign'
import _isEmpty from 'lodash/isEmpty'
import { assert } from 'Utils/tools'
import { CONST_DEFAULT_CONFIG } from 'Config'
import CONST_CONFIG from 'Service/const'
class MakeConst {
constructor(options) {
this.const = {}
this.constBuilder(options)
}
constBuilder({
sep = '/',
config = []
}) {
Object.keys(config).map(namespace => {
this._constSingleBuilder({namespace, sep, config: config[namespace]})
})
}
_constSingleBuilder({
namespace,
sep = '/',
config = {}
}) {
config.forEach( cst => {
let {name, value} = cst
let constName = `${namespace.toUpperCase()}${sep}${name}`
Object.defineProperty(this.const, constName, { value })
})
}
}
// console.log(new MakeConst({
// config: CONST_CONFIG,
// ...CONST_DEFAULT_CONFIG
// })['const'])
export default new MakeConst({
config: CONST_CONFIG,
...CONST_DEFAULT_CONFIG
})['const']
import axios from './axios'
import api from './api'
import consts from './const'
// GLOBAL.ajax = axios
export default {
install: (Vue, options) => {
Vue.prototype.$api = api
Vue.prototype.$ajax = axios
Vue.prototype.$const = consts
// 需要挂载的都放在这里
}
}
import Vue from 'vue'
import Router from 'vue-router'
import ROUTES from 'Routes'
import {ROUTER_DEFAULT_CONFIG} from 'Config/index'
import {routerBeforeEachFunc} from 'Config/interceptors/router'
Vue.use(Router)
// 注入默认配置和路由表
let routerInstance = new Router({
...ROUTER_DEFAULT_CONFIG,
routes: ROUTES
})
// 注入拦截器
routerInstance.beforeEach(routerBeforeEachFunc)
export default routerInstance
\ No newline at end of file
import Vue from 'vue'
import Vuex from 'Vuex'
import {VUEX_DEFAULT_CONFIG} from 'Config'
import commonStore from 'Service/store/common'
Vue.use(Vuex)
export default new Vuex.Store({
...commonStore,
...VUEX_DEFAULT_CONFIG
})
\ No newline at end of file
export default [{
name: "home",
path: "/home",
component: resolve => require(['Views/home/home'], resolve),
meta: {
keepAlive: true, // 添加该字段,是否要缓存该组件
}
},
{
name: "index",
path: "/",
redirect: '/home',
component: resolve => require(['Views/home/home'], resolve),
},
{
name: "data",
path: "/data",
component: resolve => require(['Views/data/data'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "detect",
path: "/detect",
component: resolve => require(['Views/home/detect'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "complex",
path: "/complex",
component: resolve => require(['Views/home/complex'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "checkstandard",
path: "/checkstandard",
component: resolve => require(['Views/home/complex/checkstandard'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "schedule",
path: "/schedule",
component: resolve => require(['Views/home/complex/schedule'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "detailschedule",
path: "/detailschedule",
component: resolve => require(['Views/home/complex/detailschedule'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "detailcontract",
path: "/detailcontract",
component: resolve => require(['Views/home/complex/detailcontract'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "detailreport",
path: "/detailreport",
component: resolve => require(['Views/home/complex/detailreport'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "report",
path: "/report",
component: resolve => require(['Views/home/complex/report'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "sample",
path: "/sample",
component: resolve => require(['Views/home/complex/sample'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "contract",
path: "/contract",
component: resolve => require(['Views/home/complex/contract'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "detailedstandard",
path: "/detailedstandard",
component: resolve => require(['Views/home/complex/detailedstandard'], resolve),
meta:{
requireAuth: true,
}
},
{
name: "qrcode",
path: "/qrcode",
component: resolve => require(['Views/home/qrcode'], resolve),
meta:{
requireAuth: true,
}
},
]
export default [
{
name: "group",
path: "/group",
component: resolve => require(['Views/group/group'], resolve),
meta: {
requireAuth: true,
}
},
{
name: "grorder",
path: "/grorder",
component: resolve => require(['Views/group/grorder'], resolve),
meta: {
requireAuth: true,
}
},
{
name: "detailorder",
path: "/detailorder",
component: resolve => require(['Views/group/detailorder'], resolve),
meta: {
requireAuth: true,
}
},
]
import car from './car'
import user from './userroute'
import login from './loginroute'
import group from './group'
export default [
...car,...user,...login,...group
]
var counter =(function(){
var a=0;
function changby(val){
a+=val;
}
return {
increment: function () {
changby(1)
},
decermrnt: function(){
changby(-1)
},
value: function(){
return a;
}
}
})()
\ No newline at end of file
This diff is collapsed. Click to expand it.
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.
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 to comment