Commit e86d1b2c by 王锐

init

parents
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
# xxxui
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
'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'
}
}
var webpack=require('webpack')
'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
},
plugins: [
new webpack.ProvidePlugin({
$:"jquery",
jQuery:"jquery",
"windows.jQuery":"jquery"
})
],
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.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api':{
target: "http://127.0.0.1:90",
changeOrigin:true,
pathRewrite:{
'^/api':''
}
}
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* 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"'
}
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>xxxui</title>
<script src="//unpkg.com/vue-ydui/dist/ydui.flexible.js"></script>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<script>
// window.onload=function(){
// var btn=document.getElementById("btn1")
// btn.onclick=function(){
// alert(1)
// }
// var btn6=document.getElementById("btn6")
// btn6.onclick=function(){
// alert(16)
// }
// }
window.onload = function () {
$(".demo-chose").on("click", function () {
console.log(this)
})
}
</script>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "test-zui",
"version": "1.0.5",
"description": "A Vue.js project",
"author": "wr <584490439@qq.com>",
"private": false,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.19.0",
"vue": "^2.5.2",
"vue-awesome-swiper": "^3.1.3",
"vue-router": "^3.0.1",
"vue-ydui": "^1.2.6"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"jquery": "^3.4.1",
"nightwatch": "^0.9.12",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"main": "src/packages/index.js",
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
<template>
<div id="app">
<component
v-for="(item ,index) of comlist"
:is="item.name"
:key="index"
:dataSource="item.dataSource"
:uiConfig="item.uiConfig"
></component>
</div>
</template>
<script>
export default {
name: "App",
data() {
return { comlist: [], d: "index" };
},
created() {
if (!this.getQueryVariable("d")) {
this.d = "login";
} else {
this.d = this.getQueryVariable("d");
}
this.$get(`/api/api/${this.d}.json?t=` + Math.random()).then(res => {
console.log(res);
this.comlist = res;
});
},
methods: {
getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return decodeURI(pair[1]);
}
}
return false;
}
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
</style>
import Vue from 'Vue'
export default new Vue
\ No newline at end of file
/* 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;
}
@font-face {
font-family: "iconfont";
src: url('iconfont.eot?t=1568618219882');
/* IE9 */
src: url('iconfont.eot?t=1568618219882#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,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') format('woff2'),
url('iconfont.woff?t=1568618219882') format('woff'),
url('iconfont.ttf?t=1568618219882') format('truetype'),
/* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1568618219882#iconfont') format('svg');
/* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-kuaidi:before {
content: "\e643";
}
.icon-baogao:before {
content: "\e640";
}
.icon-qian:before {
content: "\e604";
}
.icon-yemian:before {
content: "\e602";
}
.icon-biaozhun:before {
content: "\e613";
}
.icon-jifen:before {
content: "\e68c";
}
.icon-wodedangxuan:before {
content: "\e603";
}
.icon-buhege:before {
content: "\e63d";
}
.icon-hege:before {
content: "\e63e";
}
.icon-kuaidi-copy:before {
content: "\e68d";
}
!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
let formatdata= function (dateText, fmt) {
fmt = fmt ? fmt : 'yyyy-MM-dd'
// var fmt =
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;
}
export { formatdata }
\ No newline at end of file
<template>
<yd-infinitescroll :callback="loadList" ref="infinitescrollKv">
<yd-list theme="1" slot="list">
<div v-for="(item, key) in list" :key="key">
<img slot="img" :src="item.img" />
<span slot="title">{{item.title}}</span>
</div>
</yd-list>
<!-- 数据全部加载完毕显示 -->
<span slot="doneTip">啦啦啦,啦啦啦,没有数据啦~~</span>
<!-- 加载中提示,不指定,将显示默认加载中图标 -->
<img slot="loadingTip" src="path/img/loading.svg" />
</yd-infinitescroll>
</template>
<script type="text/babel">
export default {
data() {
return {
page: 0,
pageSize: 20,
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() {
var vm = this;
this.$get(
"http://k5.jst-gov.com/Restful/Jst.Lims.Entities.Contract/Query.json",
{
Skip: vm.page * 20,
Take: vm.pageSize
}
).then(function(response) {
const _list = response.Results;
console.log(vm.list);
vm.list = [...vm.list, ..._list];
console.log(vm.list);
if (_list.length < vm.pageSize) {
/* 所有数据加载完毕 */
vm.$refs.infinitescrollKv.$emit("ydui.infinitescroll.loadedDone");
return;
}
/* 单次请求数据完毕 */
vm.$refs.infinitescrollKv.$emit("ydui.infinitescroll.finishLoad");
vm.page++;
});
}
}
};
</script>
\ No newline at end of file
<template>
<div class="hello">
<div @click="to1">传值</div> zi 2
{{msg}}
</div>
</template>
<script>
import bus from "../assets/bus.js";
export default {
name: "HelloWorld",
data() {
return {
msg: "子2"
};
},
mounted() {
var vm = this;
bus.$on("userDefinedEvent", function(msg) {
vm.msg = msg;
});
},
methods: {
to1() {
bus.$emit("toson","来自2")
}
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1,
h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
import axios from 'axios';
axios.defaults.timeout = 5000;
axios.defaults.baseURL ='';
//http request 拦截器
axios.interceptors.request.use(
config => {
// const token = getCookie('名称');注意使用的时候需要引入cookie方法,推荐js-cookie
config.data = JSON.stringify(config.data);
config.headers = {
'Content-Type':'application/x-www-form-urlencoded'
}
// if(token){
// config.params = {'token':token}
// }
return config;
},
error => {
return Promise.reject(err);
}
);
//http response 拦截器
axios.interceptors.response.use(
response => {
if(response.data.errCode ==2){
router.push({
path:"/login",
querry:{redirect:router.currentRoute.fullPath}//从哪个页面跳转
})
}
return response;
},
error => {
return Promise.reject(error)
}
)
/**
* 封装get方法
* @param url
* @param data
* @returns {Promise}
*/
export function get(url,params={}){
return new Promise((resolve,reject) => {
axios.get(url,{
params:params
})
.then(response => {
resolve(response.data);
})
.catch(err => {
reject(err)
})
})
}
/**
* 封装post请求
* @param url
* @param data
* @returns {Promise}
*/
export function post(url,data = {}){
return new Promise((resolve,reject) => {
axios.post(url,data)
.then(response => {
resolve(response.data);
},err => {
reject(err)
})
})
}
/**
* 封装patch请求
* @param url
* @param data
* @returns {Promise}
*/
export function patch(url,data = {}){
return new Promise((resolve,reject) => {
axios.patch(url,data)
.then(response => {
resolve(response.data);
},err => {
reject(err)
})
})
}
/**
* 封装put请求
* @param url
* @param data
* @returns {Promise}
*/
export function put(url,data = {}){
return new Promise((resolve,reject) => {
axios.put(url,data)
.then(response => {
resolve(response.data);
},err => {
reject(err)
})
})
}
\ No newline at end of file
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import demoui from './packages/index.js'
import $ from 'jquery'
import "../src/assets/iconfont/iconfont.css"
Vue.use(demoui)
Vue.config.productionTip = false
import YDUI from 'vue-ydui'; /* 相当于import YDUI from 'vue-ydui/ydui.rem.js' */
import 'vue-ydui/dist/ydui.rem.css';
/* 使用px:import 'vue-ydui/dist/ydui.px.css'; */
Vue.use(YDUI);
import {
post,
get,
patch,
put
} from './http'
import * as custom from "./common/filters"
Object.keys(custom).forEach(key => {
Vue.filter(key, custom[key])
})
export let bus = new Vue
Vue.prototype.$post = post;
Vue.prototype.$get = get;
Vue.prototype.$patch = patch;
Vue.prototype.$put = put;
/* eslint-disable no-new */
import VueAwesomeSwiper from 'vue-awesome-swiper'
// require styles
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper, /* { default global options } */ )
new Vue({
el: '#app',
router,
components: {
App
},
template: '<App/>'
})
<template>
<div>
<yd-search
v-if="uiConfig.switchsearch"
v-model="value1"
:on-submit="submitHandler"
:on-cancel="cnacelHandler"
></yd-search>
<yd-infinitescroll :callback="loadList" ref="infinitescrollKv">
<yd-list theme="1" slot="list">
<a href="reportDetail.html" class="sdlist" v-for="(item,index) of list" :key="index">
<div class="sdlist_left reportlist_left" :style="{'background':uiConfig.bgcolor}">
<img :src="uiConfig.bgimg" alt />
<p>{{uiConfig.itemtitle}}</p>
</div>
<div class="sdlist_right">
<div class="sdlist_center">
<span></span>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
<span></span>
</div>
<div class="sdlist_right_cont">
<div>{{item.title}}</div>
<div>
{{item.subTitle}}
<span class="right_arrow"></span>
</div>
<div>
<span>{{uiConfig.bottomcontent1}}: {{item.bottom1 |formatdata}}</span>
&nbsp; &nbsp;
<span>{{uiConfig.bottomcontent2}}: {{item.bottom2}}</span>
</div>
</div>
</div>
</a>
</yd-list>
<span slot="doneTip">加载完毕~~</span>
</yd-infinitescroll>
</div>
</template>
<script>
export default {
name: "KvBusinesslist",
props: {
dataSource: {
type: Object,
default: function() {
return {
url:
"http://k5.jst-gov.com/Restful/Jst.Lims.Entities.Contract/Query.json",
root: "",
fields: {
title: "ProductName",
subTitle: "ReportId",
bottom1: "DealDate",
bottom2: "ProductJudgement"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
bgcolor: "#1b81ee",
bgimg: "../../../static/baogao.png",
itemtitle: "报告",
href: "javascript:;",
switchsearch: true,
bottomcontent1: "日期",
bottomcontent2: "结论"
};
}
}
},
methods: {
submitHandler(value) {
this.searchValue = value;
this.page = 0;
this.loadList();
this.list = [];
},
cnacelHandler() {
this.searchValue = "";
this.value1=""
this.page = 0;
this.loadList();
this.list = [];
},
loadList() {
var vm = this;
var item = vm.dataSource.fields;
console.log(vm.page);
this.$get(vm.dataSource.url, {
Skip: vm.page * 20,
Take: vm.pageSize,
QueryKeys: "ReportId,ProductBrand",
QueryValues: vm.searchValue
}).then(function(res) {
console.log(res);
var lists = [];
for (let i = 0; i < res.Results.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res.Results[i][item[key]];
}
lists.push(obj);
}
console.log(lists);
const _list = lists;
vm.list = [...vm.list, ..._list];
if (_list.length < vm.pageSize) {
/* 所有数据加载完毕 */
vm.$refs.infinitescrollKv.$emit("ydui.infinitescroll.loadedDone");
return;
}
/* 单次请求数据完毕 */
vm.$refs.infinitescrollKv.$emit("ydui.infinitescroll.finishLoad");
vm.page++;
});
}
},
data() {
return {
value1: "",
page: 0,
pageSize: 20,
list: [],
searchValue: ""
};
},
created() {
this.loadList();
},
mounted() {}
};
</script>
<style scoped>
.right_arrow {
display: inline-block;
border-top: 2px solid;
border-right: 2px solid;
width: 14px;
height: 14px;
border-color: #7e7e7e;
transform: rotate(45deg);
}
.sdlist {
overflow: hidden;
height: 1.8rem;
display: block;
margin-bottom: 0.2rem;
}
.sdlist_left {
height: 1.8rem;
width: 20%;
background: #73d765;
color: white;
font-weight: bold;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 0.3rem;
border-radius: 5px;
float: left;
}
.reportlist_left {
background: #1b81ee;
}
.sdlist_left img {
height: 0.6rem;
margin-bottom: 0.1rem;
}
.sdlist_center {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
width: 0.2rem;
float: left;
}
.sdlist_center i {
height: 6px;
width: 6px;
background: #f5f5f5;
border-radius: 50%;
display: inline-block;
margin-left: -3px;
}
.sdlist_center span {
height: 0.2rem;
width: 0.2rem;
border-radius: 50%;
background: #f5f5f5;
display: inline-block;
}
.sdlist_center span:nth-child(1) {
margin-top: -0.1rem;
margin-left: -0.1rem;
}
.sdlist_border_bottom {
height: 0.2rem;
}
.sdlist_center span:nth-child(10) {
margin-bottom: -0.1rem;
margin-left: -0.1rem;
}
.sdlist_right {
background: white;
width: 80%;
height: 1.8rem;
float: left;
border-radius: 5px;
}
.sdlist_right_cont {
font-size: 0.3rem;
padding: 0.2rem;
}
.sdlist_right_cont div:nth-child(2) {
font-weight: 500;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.1rem;
}
.sdlist_right_cont div:nth-child(2) em {
width: 80%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sdlist_right_cont div:nth-child(1) {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
margin-bottom: 0.1rem;
}
.sdlist_right_cont div:nth-child(3) {
font-size: 0.24rem;
color: #a19e9e;
text-align: left;
}
</style>
\ No newline at end of file
import businesslist from "./businesslist"
businesslist.install=function(Vue){
Vue.component(businesslist.name,businesslist)
}
export default businesslist
\ No newline at end of file
<template>
<div class="weui-cells">
<yd-cell-item arrow v-for="(item,index) of jsondata" :key="index">
<img slot="icon" :src="item.icon">
<span slot="left" style="font-size:0.3rem;">{{item.title}}</span>
<span slot="right"></span>
</yd-cell-item>
</div>
</template>
<script>
export default {
name: "KvCelllist",
props: {
jsondata: {
type: Array,
default: function() {
return [
{
"icon": "../../../static/fankui.png",
"title": "反馈记录",
"href": "javascript:;"
},
{
"icon": "../../../static/lianxi.png",
"title": "客服经理",
"href": "javascript:;"
}
];
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.weui-cells {
background-color: #ffffff;
}
.yd-cell-item{
border-bottom: 1px solid #e1e1e1;
}
.yd-cell-item img{
height: 0.4rem;
}
</style>
\ No newline at end of file
import celllist from "./celllist"
celllist.install=function(Vue){
Vue.component(celllist.name,celllist)
}
export default celllist
\ No newline at end of file
<template>
<div>
<yd-cell-group>
<yd-cell-item>
<span slot="left">手机号:</span>
<yd-input
slot="right"
v-model="input9"
ref="input9"
required
regex="mobile"
placeholder="请输入手机号码"
></yd-input>
</yd-cell-item>
<p slot="bottom" style="color:#F00;padding: 0 .3rem;" v-html="result"></p>
<yd-cell-item>
<yd-icon slot="icon" name="phone3" size=".45rem"></yd-icon>
<input type="text" slot="right" placeholder="请输入验证码" />
<!-- ↓↓关键代码是这里↓↓ -->
<yd-sendcode slot="right" v-model="start1" @click.native="sendCode1" type="warning"></yd-sendcode>
<!-- ↑↑关键代码是这里↑↑ -->
</yd-cell-item>
</yd-cell-group>
</div>
</template>
<script>
export default {
name: "KvChangeph",
data() {
return {
input9: "",
result: "",start1: false
};
},
created() {},
methods: {
sendCode1() {
this.$dialog.loading.open('发送中...');
setTimeout(() => {
this.start1 = true;
this.$dialog.loading.close();
this.$dialog.toast({
mes: '已发送',
icon: 'success',
timeout: 1500
});
}, 1000);
}
},
mounted() {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
import chnagephone from "./chnagephone"
chnagephone.install=function(Vue){
Vue.component(chnagephone.name,chnagephone)
}
export default chnagephone
\ No newline at end of file
<template>
<div>
<yd-tab>
<yd-tab-panel label="选项一"> <ul class="col_rp">
<li class="col_rp_list">
<div class="clo_rp_list_left" style="background: #73D765;">
<img src="../../../static/fangfa.png" alt />
</div>
<div class="clo_rp_list_right">
<div>
<p>报告名字报告名字报告名字报字报告名字报告名字报告名字报字</p>
<p>GB-123456789</p>
</div>
<img src="../../../static/ljt.png" alt />
</div>
</li>
<li class="col_rp_list">
<div class="clo_rp_list_left" style="background: #73D765;">
<img src="../../../static/fangfa.png" alt />
</div>
<div class="clo_rp_list_right">
<div>
<p>报告名字报告名字报告名字报字报告名字报告名字报告名字报字</p>
<p>GB-123456789</p>
</div>
<img src="../../../static/ljt.png" alt />
</div>
</li>
</ul></yd-tab-panel>
<yd-tab-panel label="选项二"> <ul class="col_rp">
<li class="col_rp_list">
<div class="clo_rp_list_left" style="background: #73D765;">
<img src="../../../static/fangfa.png" alt />
</div>
<div class="clo_rp_list_right">
<div>
<p>报告名字报告名字报告名字报字报告名字报告名字报告名字报字</p>
<p>GB-123456789</p>
</div>
<img src="../../../static/ljt.png" alt />
</div>
</li>
<li class="col_rp_list">
<div class="clo_rp_list_left" style="background: #73D765;">
<img src="../../../static/fangfa.png" alt />
</div>
<div class="clo_rp_list_right">
<div>
<p>报告名字报告名字报告名字报字报告名字报告名字报告名字报字</p>
<p>GB-123456789</p>
</div>
<img src="../../../static/ljt.png" alt />
</div>
</li>
</ul></yd-tab-panel>
</yd-tab>
</div>
</template>
<script>
export default {
name: "KvCollection",
props: {
jsondata: {
type: Object,
default: function() {
return {
userlits: [],
switchtitle: true,
titlecontent: "服务",
type: 1
};
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.col_rp {
background: white;
}
.col_rp_list {
border-radius: 4px;
overflow: hidden;
margin-bottom: 0.2rem;
}
.clo_rp_list_left {
background: #1b81ee;
width: 0.8rem;
height: 1.2rem;
border-radius: 6px 0 0 6px;
display: flex;
justify-content: center;
align-items: center;
float: left;
}
.clo_rp_list_left img {
height: 0.4rem;
width: 0.4rem;
}
.clo_rp_list_right {
padding: 0.2rem;
overflow: hidden;
background: #f5f5f5;
border-radius: 0 6px 6px 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.clo_rp_list_right img {
height: 0.8rem;
width: 0.8rem;
}
.clo_rp_list_right p {
font-size: 0.3rem;
line-height: 0.4rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 5rem;
}
</style>
\ No newline at end of file
import collection from "./collection"
collection.install=function(Vue){
Vue.component(collection.name,collection)
}
export default collection
\ No newline at end of file
<template>
<div>
<div class="m-cell">
<div class="cell-item">
<label class="cell-right cell-arrow">
<select id="select" class="cell-select">
<option value="建议">建议</option>
<option value="投诉">投诉</option>
</select>
</label>
</div>
</div>
<yd-cell-group>
<yd-cell-item>
<yd-textarea slot="right" placeholder="请输入内容" maxlength="100"></yd-textarea>
</yd-cell-item>
<div class="addimg">
<div class="choseimg last">
<img src="../../../static/xiangji.png" alt />
</div>
</div>
</yd-cell-group>
<yd-button size="large" type="primary">提交</yd-button>
</div>
</template>
<script>
export default {
name: "KvFeedback",
data() {
return {
radio1: "建议"
};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.m-cell {
position: relative;
z-index: 1;
margin-bottom: 0.35rem;
background-color: #fff;
}
.cell-item {
display: flex;
position: relative;
padding-left: 0.24rem;
overflow: hidden;
}
.cell-right {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
min-height: 1rem;
color: #525252;
text-align: right;
font-size: 0.26rem;
padding-right: 0.24rem;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.cell-select {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
color: #a9a9a9;
margin-left: -0.08rem;
display: block;
-webkit-box-flex: 1;
height: 1rem;
border: none;
font-size: 0.3rem;
}
.cell-arrow:after {
margin-left: 0.05rem;
margin-right: -0.08rem;
margin-top: 0.2rem;
font-size: 0.34rem;
color: #c9c9c9;
content: "";
display: block;
box-sizing: border-box;
outline: 0;
width: 0;
height: 0;
border-width: 5px;
border-style: solid;
border-color: #c9c9c9 transparent transparent transparent;
}
.addimg {
padding: 0.2rem;
overflow: hidden;
}
.addimg .last img {
width: 1rem;
height: 1rem;
}
.choseimg img {
width: 100%;
height: 100%;
}
.choseimg {
margin-right: 0.3rem;
height: 2rem;
width: 2rem;
background: #e1e1e1;
display: flex;
justify-content: center;
align-items: center;
margin-top: 0.2rem;
float: left;
}
</style>
\ No newline at end of file
import feedback from "./feedback"
feedback.install=function(Vue){
Vue.component(feedback.name,feedback)
}
export default feedback
\ No newline at end of file
<template>
<div>
<ul id="J_ListContent" class="fd_content">
<li class="fd_list">
<a href="javascript:;">
<p class="fd_list_title">
<span>业务营销 建议 务营销 建议务营销 建议务营销 建议</span>
<span>未处理</span>
</p>
<p class="fd_list_time">
<span>2019-02-02</span>
<span >建议</span>
</p>
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: "KvFeedbacklist",
data() {
return {
};
},
created() {
this.$get("http://k5t.jst-gov.com/Restful/Kivii.Customers.Entities.Feedback/Query.json").then(res=>{
console.log(res)
})
},
mounted() {},
filters: {
suggestiontype: function(e) {
if (!e) return "";
if (e == "建议") {
return "<span style = 'color:#05FD0F'>" + e + "</span>";
} else {
return "<span style = 'color:#FF0909'>" + e + "</span>";
}
}
}
};
</script>
<style scoped>
.fd_content {
padding: 0.2rem;
}
.fd_list {
padding: 0.2rem;
background: white;
border-radius: 4px;
margin-bottom: 0.2rem;
}
.fd_list a {
display: block;
}
.fd_list_title {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
}
.fd_list_title span:nth-child(1) {
font-size: 0.28rem;
width: 80%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fd_list_title span:nth-child(2) {
font-size: 0.24rem;
width: 20%;
text-align: center;
}
.fd_list_time {
margin-top: 0.2rem;
font-size: 0.24rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.fd_list_time span:nth-child(2) {
width: 20%;
text-align: center;
}
</style>
\ No newline at end of file
import feedbacklist from "./feedbacklist"
feedbacklist.install=function(Vue){
Vue.component(feedback.name,feedback)
}
export default feedbacklist
\ No newline at end of file
<template>
<div>
<footer class="footer">
<a
v-for="(item, index) in item"
:href="uiConfig.href"
:class="[item.active?'footer_active':'']"
:key="index"
>
<span :class="item.img"></span>
<span>{{item.title}}</span>
</a>
</footer>
</div>
</template>
<script>
export default {
name: "KvFooter",
data() {
return {
item:[
{
"Title": "标准",
"Img": "icon-biaozhun iconfont",
"Active": false
}
]
}
},
props: {
dataSource: {
type: Object,
default: function() {
return {
url: "/api/api/funlists.json",
root: "",
fields: {
title: "Title"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
href: "javascript:;"
};
}
}
},
mounted() {
var vm = this;
var item = vm.dataSource.fields;
this.$get(this.dataSource.url).then(res => {
var list = [];
for (let i = 0; i < res.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res[i][item[key]];
}
list.push(obj);
}
vm.item = list;
});
}
};
</script>
<style scoped>
footer {
display: flex;
justify-content: space-around;
width: 100%;
align-items: center;
height: 1rem;
position: fixed;
bottom: 0;
background: white;
}
footer a {
display: flex;
flex-direction: column;
min-width: 20%;
height: 100%;
align-items: center;
justify-content: center;
}
footer a span:nth-child(1) {
font-size: 0.46rem;
}
footer a span:nth-child(2) {
font-size: 0.28rem;
}
.footer_active {
color: rgb(0, 140, 255);
}
</style>
\ No newline at end of file
import footers from "./footers"
footers.install=function(Vue){
Vue.component(footers.name,footers)
}
export default footers
\ No newline at end of file
<template>
<div>
<div
style="padding:0 0.2rem 0.2rem 0.2rem; font-size:0.3rem; text-align:left;"
v-if="uiConfig.titleSwitch"
>{{uiConfig.titleContent}}</div>
<div class="funlist_content">
<a
v-for="(item,index) of item"
:key="index"
class="funlist_list"
:href="uiConfig.href"
>
<img :src="item.img" alt />
<div>
<p>{{item.title}}</p>
</div>
</a>
</div>
</div>
</template>
<script>
export default {
name: "KvFunlist",
data() {
return {
item: [
{
href: "javascript:;",
title: "进度查询",
img: "../static/inquiry.png",
id: "btn1"
},
{
href: "javascript:;",
title: "服务指南",
img: "../static/fwzn.png",
id: "btn2"
},
{
href: "javascript:;",
title: "扫码查询",
img: "../static/sys.png",
id: "btn3"
},
{
href: "javascript:;",
title: "快递查询",
img: "../static/kuaidi.png",
id: "btn4"
}
]
};
},
mounted() {
var vm = this;
var item = vm.dataSource.fields;
this.$get(this.dataSource.url).then(res => {
var list = [];
for (let i = 0; i < res.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res[i][item[key]];
}
list.push(obj);
}
vm.item = list;
});
},
props: {
dataSource: {
type: Object,
default: function() {
return {
url: "/api/api/funlist.json",
root: "",
fields: {
title: "Title",
img: "Img",
href: "Href"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
titleContent: "常用功能",
titleSwitch: true
};
}
}
}
};
</script>
<style scoped>
.funlist_content {
overflow: hidden;
padding: 0 0.2rem;
box-shadow: #e1e1e1 0px 0px 10px;
}
.funlist_list {
border-bottom: 1px solid #e1e1e1;
border-right: 1px solid #e1e1e1;
padding: 0.2rem;
overflow: hidden;
width: 50%;
float: left;
text-align: center;
display: flex;
align-items: center;
height: 1.2rem;
justify-content: center;
}
.funlist_list:nth-child(2n) {
border-right: none;
}
.funlist_list:nth-child(5) {
border-bottom: none;
}
.funlist_list:nth-child(6) {
border-bottom: none;
}
.funlist_list img {
margin-right: 0.2rem;
height: 0.5rem;
width: 0.5rem;
float: left;
}
.funlist_list p {
font-size: 0.28rem;
}
.funlist_list span {
font-size: 0.24rem;
color: rgb(120, 121, 120);
margin-top: 0.2rem;
}
</style>
\ No newline at end of file
import funlist from "./funlist"
funlist.install=function(Vue){
Vue.component(funlist.name,funlist)
}
export default funlist
\ No newline at end of file
<template>
<div class="funlists_bottom">
<a v-for="(item,index) of item" :key="index" class="funlists_bottom_left" :href="uiConfig.href">
<img :src="item.img" alt />
<div>{{item.title}}</div>
</a>
<!-- <a class="funlists_bottom_right" href="html/feedBack.html">
<img src="../../assets/xinfeng.png" alt />
<div>意见反馈</div>
</a>-->
</div>
</template>
<script>
export default {
name: "KvFunlists",
props: {
dataSource: {
type: Object,
default: function() {
return {
url: "/api/api/footer.json",
root: "",
fields: {
title: "Title",
img: "Img",
active: "Active"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
href: "javascript:;"
};
}
}
},
data() {
return {
item: [
{
title: "意见反馈",
img: "../static/xinfeng.png"
},
{
title: "网上受理",
img: "../static/xing.png"
}
]
};
},
mounted() {
var vm = this;
var item = vm.dataSource.fields;
this.$get(this.dataSource.url).then(res => {
var list = [];
for (let i = 0; i < res.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res[i][item[key]];
}
list.push(obj);
}
vm.item = list;
});
}
};
</script>
<style scoped>
.funlists_bottom {
display: flex;
width: 100%;
padding: 0.2rem;
font-size: 0.28rem;
margin-bottom: 105px;
}
.funlists_bottom_left {
width: 48%;
margin-right: 4%;
border: 1px solid #e1e1e1;
height: 1.2rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.funlists_bottom_left img {
height: 0.5rem;
margin-right: 0.2rem;
}
.funlists_bottom_right img {
height: 0.5rem;
margin-right: 0.2rem;
}
.funlists_bottom_right {
width: 48%;
border: 1px solid #e1e1e1;
height: 1.2rem;
display: flex;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
</style>
\ No newline at end of file
import funlists from "./funlists"
funlists.install=function(Vue){
Vue.component(funlists.name,funlists)
}
export default funlists
\ No newline at end of file
import KvFooter from "./footers/index"
import KvSwiper from "./swipers/index"
import KvRollnotice from "./rollnotice/index"
import KvFunlist from "./funlist/index"
import KvFunlists from "./funlists/index"
import KvUserlist from "./userlist/index"
import KvThreelist from "./threelist/index"
import KvCelllist from "./celllist/index"
import KvUserinfo from "./userinfo/index"
import KvBusinesslist from "./businesslist/index"
import KvTab from "./tab/index"
import KvSearch from "./search/index"
import KvFeedback from "./feedback/index"
import KvFeedbacklist from "./feedbacklist/index"
import KvInvoice from "./invoice/index"
import KvOverage from "./overage/index"
import KvCollection from "./collection/index"
import KvPassword from "./password/index"
import KvChangeph from "./changephone/index"
import KvNews from "./news/index"
import KvLogin from "./login/index"
import KvRegister from "./register/index"
const components = [
KvFooter, KvSwiper, KvRollnotice, KvFunlist, KvFunlists, KvUserlist, KvThreelist, KvCelllist, KvUserinfo, KvBusinesslist, KvTab, KvSearch, KvFeedback, KvFeedbacklist, KvInvoice, KvOverage, KvCollection, KvPassword,KvChangeph,KvNews,KvLogin,KvRegister
]
const install = function (Vue) {
if (install.installed) return
components.forEach(component => {
Vue.component(component.name, component)
});
}
if (typeof window !== "undefind" && window.Vue) {
install(window.Vue)
}
export default {
install,
KvFooter,
KvSwiper,
KvRollnotice,
KvFunlist,
KvFunlists,
KvUserlist,
KvThreelist,
KvCelllist,
KvUserinfo,
KvBusinesslist,
KvTab,
KvSearch,
KvFeedback,
KvFeedbacklist,
KvInvoice,
KvOverage,
KvCollection,
KvPassword,KvChangeph,KvNews,KvLogin,KvRegister
}
import invoice from "./invoice"
invoice.install=function(Vue){
Vue.component(invoice.name,invoice)
}
export default invoice
\ No newline at end of file
<template>
<div>
<div class="billing" id="J_ListContent">
<a class="list" href="billingdetail.html" style="display: block;">
<p>江苏纺检</p>
<p class="billingnum">¥1000.00</p>
<p class="inviconum">
<span class="invleft">
<span style="margin-right:0.1rem;">发票编号</span>
</span>
<span>2019.1.1</span>
</p>
</a>
</div>
</div>
</template>
<script>
export default {
name: "KvInvoice",
data() {
return {
};
},
created() {
},
mounted() {}
};
</script>
<style scoped>
.list {
background: white;
border-radius: 5px;
padding: 0.2rem;
}
.billingnum {
color: #FC9605;
font-size: 0.36rem;
}
.inviconum {
display: flex;
justify-content: space-between;
border-top: 1px dotted #e1e1e1;
padding: 0 0.1rem;
padding-top: 0.2rem;
}
.inviconum .invleft {
font-size: 0.24rem;
}
</style>
\ No newline at end of file
<template>
<div class="login" v-touch:right="onSwipeRight" style="min-height:10rem;">
<yd-navbar title="重置密码">
<a href="javascript:window.history.go(-1);" slot="left">
<yd-navbar-back-icon></yd-navbar-back-icon>
</a>
</yd-navbar>
<div class="page-container">
<yd-cell-group>
<yd-cell-item style=" border-bottom:1px solid #DEDBDB; border-top:1px solid #DEDBDB;">
<yd-input
:debug="true"
v-model="phone"
placeholder="请输入手机号码"
required
regex="mobile"
slot="right"
></yd-input>
</yd-cell-item>
<yd-cell-item style="width:100%; border-bottom:1px solid #DEDBDB;">
<input
type="tel"
slot="right"
placeholder="请输入验证码"
v-model="regcode"
maxlength="6"
@input="formatDigit($event)"
>
<yd-sendcode
style="height:0.9rem; border:none;width:30%"
slot="right"
v-model="startSend"
@click.native="sendCode"
:type="rightMobile?'warning':'disabled'"
></yd-sendcode>
</yd-cell-item>
</yd-cell-group>
<div>
<yd-button
size="large"
type="warning"
:disabled="!validRegister"
@click.native="register"
>下一步</yd-button>
</div>
</div>
</div>
</template>
<script>
import { CheckIcon } from "vux";
import { setStore,getStore } from "../../components/common/mixin";
export default {
name: "Login",
created() {
// this.$dialog.loading.open("发送中...");
this.phone=JSON.parse(getStore('userinfo')).phone
},
data() {
return {
regcode: "",
phone: "",
state: "注册",
correctCode: "",
startSend: false,
checkProtocol: true
};
},
components: { CheckIcon },
computed: {
rightMobile() {
return /^1[3,4,5,7,8,9]\d{9}$/.test(this.phone);
},
rightCode() {
return /^\d{6}$/gi.test(this.regcode) && this.startSend;
},
validRegister() {
return this.rightMobile && this.rightCode && this.checkProtocol;
}
},
methods: {
onSwipeRight(event, start, end) {
if (start.X >= 80) return;
// if(end.X<=250)return;
this.$router.go(-1);
},
formatDigit(event) {
this.code = event.target.value.replace(/\D/g, "");
},
sendCode() {
let vm = this;
vm.startSend=true;
},
register() {
let vm = this;
vm.$router.push({path:'inputpassword'})
}
}
};
</script>
<style lang='less' scoped>
@import "../../style/mixin.less";
.page-container {
padding: 0.2rem;
.forget-pwd {
display: block;
width: 2rem;
padding: 0.1rem 0;
.text-center;
margin: 0.8rem auto;
color: @blue;
border: 1px solid currentColor;
border-radius: 5px;
&:active {
background-color: @blue;
color: @white;
}
}
// margin-top: 2rem;
}
.tips {
margin: 1rem auto 0;
font-size: 0.32rem;
}
.login {
height: 100%;
width: 100%;
position: absolute;
opacity: 0.8;
left: 0;
overflow: hidden;
}
.login h1 {
text-align: center;
font-size: 40px;
transition-duration: 1s;
transition-timing-function: ease-in-put;
font-weight: 200;
}
</style>
\ No newline at end of file
import login from "./login"
login.install=function(Vue){
Vue.component(login.name,login)
}
export default login
\ No newline at end of file
<template>
<div class="login" style="min-height:10rem;">
<yd-navbar :title="title">
<a @click="goback" slot="left">
<yd-navbar-back-icon></yd-navbar-back-icon>
</a>
<a
style="color:red;"
@click="login_register"
slot="right"
>{{loginregister}}</a>
</yd-navbar>
<login v-if="loginorregister"></login>
<register v-if="!loginorregister"></register>
</div>
</template>
<script>
import login from "./login";
import register from "./register";
export default {
data() {
return {
loginregister: "注册",
title: "登陆",
loginorregister: true, //控制登陆或注册显示
// routefrom: ""
};
},
components: {
login,
register
},
methods: {
login_register() {
var vm = this;
if (vm.loginregister == "注册") {
vm.loginregister = "登陆";
vm.title = "注册";
vm.loginorregister=false
// vm.$router.replace('/register')
} else {
vm.loginregister = "注册";
vm.title = "登陆";
// vm.$router.replace('/login')
vm.loginorregister=true
}
},
goback() {
this.$router.go(-1)
},
setData(path) {
this.routefrom = path;
},
setTitle() {
this.title = "重置密码";
}
},
// beforeRouteEnter(to, from, next) {
// if (from.path == "/forgetpassword") {
// next();
// } else {
// next(vm => vm.setData(from.path));
// }
// },
// beforeRouteLeave(to, from, next) {
// if (to.path == "/forgetpassword") {
// next(vm => vm.setTitle());
// }
// }
};
</script>
<template>
<div class="login" v-touch:right="onSwipeRight" style="min-height:10rem;">
<yd-navbar title="重置密码">
<a href="javascript:window.history.go(-1);" slot="left">
<yd-navbar-back-icon></yd-navbar-back-icon>
</a>
</yd-navbar>
<div class="page-container">
<yd-cell-group>
<yd-cell-item style=" border-bottom:1px solid #DEDBDB; border-top:1px solid #DEDBDB;">
<yd-input
slot="right"
type="password"
placeholder="请输入密码(不得少于6位)"
:min="6"
v-model="newpassword"
></yd-input>
</yd-cell-item>
<yd-cell-item style=" border-bottom:1px solid #DEDBDB; ">
<yd-input
slot="right"
type="password"
placeholder="请输入密码(不得少于6位)"
:min="6"
v-model="againpassword"
></yd-input>
</yd-cell-item>
</yd-cell-group>
<div>
<yd-button size="large" type="warning" :disabled="!validRegister" @click.native="reset">重置</yd-button>
</div>
</div>
</div>
</template>
<script>
import { CheckIcon } from "vux";
import { setStore } from "../../components/common/mixin";
export default {
name: "Login",
created() {
// this.$dialog.loading.open("发送中...");
},
data() {
return {
newpassword: "",
againpassword: "",
state: "注册",
correctCode: "",
startSend: false,
checkProtocol: true
};
},
components: { CheckIcon },
computed: {
rightnewPwd() {
return /[0-9a-zA-Z].{5,16}/.test(this.newpassword);
},
rightagainPwd() {
return /[0-9a-zA-Z].{5,16}/.test(this.againpassword);
},
validRegister() {
return this.rightnewPwd && this.rightagainPwd && this.newpassword==this.againpassword;
}
},
methods: {
onSwipeRight(event, start, end) {
if (start.X >= 80) return;
// if(end.X<=250)return;
this.$router.go(-1);
},
reset() {
let vm = this;
vm.$dialog.loading.open("注册中...");
var url = "/Customer/Register/Personal";
var _data = {};
vm.$ajax
.post(url, _data)
.then(function(resp) {
vm.$dialog.loading.close();
vm.$dialog.toast({
mes: "",
timeout: 1000,
icon: "success",
callback: () => {
}
});
})
.catch(function(resp) {
vm.$dialog.loading.close();
vm.$dialog.toast({
mes: resp.response.data.ResponseStatus.Message,
icon: "error",
timeout: 2000
});
});
}
}
};
</script>
<style lang='less' scoped>
@import "../../style/mixin.less";
.page-container {
padding: 0.2rem;
.forget-pwd {
display: block;
width: 2rem;
padding: 0.1rem 0;
.text-center;
margin: 0.8rem auto;
color: @blue;
border: 1px solid currentColor;
border-radius: 5px;
&:active {
background-color: @blue;
color: @white;
}
}
// margin-top: 2rem;
}
.tips {
margin: 1rem auto 0;
font-size: 0.32rem;
}
.login {
height: 100%;
width: 100%;
position: absolute;
opacity: 0.8;
left: 0;
overflow: hidden;
}
.login h1 {
text-align: center;
font-size: 40px;
transition-duration: 1s;
transition-timing-function: ease-in-put;
font-weight: 200;
}
</style>
\ No newline at end of file
<template>
<div class="login" style="min-height:10rem;">
<div class="page-container">
<yd-cell-group>
<yd-cell-item
v-show="!logincode"
style="border-top:1px solid #DEDBDB; border-bottom:1px solid #DEDBDB;"
>
<span slot="left">账户 &nbsp;&nbsp;&nbsp;</span>
<yd-input v-model="username" placeholder="请输入手机号" required slot="right"></yd-input>
</yd-cell-item>
<yd-cell-item v-show="!logincode" style="border-bottom:1px solid #DEDBDB;">
<span slot="left">密码&nbsp;&nbsp;&nbsp;</span>
<yd-input
slot="right"
type="password"
placeholder="请输入密码(不得少于6位)"
:min="6"
v-model="password"
></yd-input>
</yd-cell-item>
<yd-cell-item
v-show="logincode"
style="border-top:1px solid #DEDBDB; border-bottom:1px solid #DEDBDB;"
>
<span slot="left">账户 &nbsp;&nbsp;&nbsp;</span>
<yd-input v-model="phone" placeholder="请输入手机号" regex="mobile" required slot="right"></yd-input>
</yd-cell-item>
<yd-cell-item v-show="logincode" style="border-bottom:1px solid #DEDBDB;">
<span slot="left">验证码&nbsp;&nbsp;&nbsp;</span>
<input v-model="inputcode" maxlength="6" type="text" slot="right" placeholder="请输入验证码" />
<!-- ↓↓关键代码是这里↓↓ -->
<yd-sendcode
style="height:0.9rem; border:none;width:30%"
slot="right"
v-model="codevalue"
@click.native="sendloginCode"
:type="rightphone?'warning':'disabled'"
></yd-sendcode>
<!-- ↑↑关键代码是这里↑↑ -->
</yd-cell-item>
</yd-cell-group>
<!-- <div v-show="!logincode" class="forgetpassword">
<a href="javascript:;" >忘记密码?</a>
</div> -->
<div class="flex just-between">
<yd-button type="primary" size="large" :disabled="!validLogin" @click.native="login">登 录</yd-button>
<div v-show="!logincode" class="logincode" @click="switchcode">验证码登陆</div>
<div v-show="logincode" class="logincode" @click="switchcode">密码登陆</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "KvLogin",
data() {
return {
//judge login or register,default way is login
header: "",
username: "",
password: "",
phone: "",
//获取验证码的类型,验证码登陆同样需要
state: "登陆",
//获取验证码接口所需传值,登陆则不需要
verifier: "VCODE",
codevalue: false,
logincode: false,
getcodebtn: false,
userid: "",
inputcode: ""
};
},
computed: {
rightusername() {
return /\S/.test(this.username);
},
rightphone() {
return /^1[3,4,5,7,8,9]\d{9}$/.test(this.phone);
},
rightPwd() {
return /[0-9a-zA-Z].{5,}/.test(this.password);
},
rightcode() {
return /^\d{6}$/gi.test(this.inputcode) && this.getcodebtn;
},
validLogin() {
return (
(this.rightusername && this.rightPwd) ||
(this.rightphone && this.rightcode)
);
}
},
activated() {
this.password = "";
},
created() {},
methods: {
sendloginCode() {},
switchcode() {
this.logincode = !this.logincode;
},
login() {},
forget() {}
}
};
</script>
<style scoped>
.page-container {
padding: 0.2rem;
}
.forget-pwd {
display: block;
width: 2rem;
padding: 0.1rem 0;
}
.text-center {
margin: 0.1rem auto;
color: blue;
border: 1px solid currentColor;
border-radius: 5px;
}
.active {
background-color: blue;
color: white;
}
.tips {
margin: 1rem auto 0;
font-size: 0.32rem;
}
.logincode {
text-align: center;
width: 100%;
font-size: 13px;
height: 0.8rem;
line-height: 0.8rem;
color: red;
}
.login {
height: 100%;
width: 100%;
position: absolute;
opacity: 0.8;
left: 0;
overflow: hidden;
}
.forgetpassword {
overflow: hidden;
}
.forgetpassword a {
float: right;
font-size: 12px;
color: red;
}
.login-registerr {
position: absolute;
right: 0.2rem;
}
</style>
\ No newline at end of file
<template>
<div style="background:white; padding:0 0.2rem;">
<yd-navbar >
<a href="javascript:window.history.go(-1);" slot="left">
<yd-navbar-back-icon></yd-navbar-back-icon>
</a>
</yd-navbar>
</div>
</template>
import news from "./news"
news.install=function(Vue){
Vue.component(news.name,news)
}
export default news
\ No newline at end of file
<template>
<div style="background:white; padding:0.2rem;">
<h4
id="title"
style="width: 100%; text-align: center; padding-top:1rem; font-size:0.3rem;"
>{{item.title}}</h4>
<p
id="time"
style="text-align: center; font-size: 14px; color: #898383; margin: 0.2rem 0;"
>{{item.time | formatdata}}</p>
<div id="content" v-html="item.content" style="font-size:0.24rem;"></div>
</div>
</template>
<script>
export default {
name: "KvNews",
props: {
dataSource: {
type: Object,
default: function() {
return {
url: "",
root: "",
fields: {
title: "Title",
time: "UpdateTime",
content: "DisplayContent"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
href: "javascript:;"
};
}
}
},
mounted() {
var vm = this;
var item = vm.dataSource.fields;
var querys = {};
vm.dataSource.queryName.forEach(element => {
querys[element] = vm.getQueryVariable(element);
console.log(querys);
});
this.$get(this.dataSource.url, querys).then(res => {
console.log(res);
var list = [];
for (let i = 0; i < res.Results.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res.Results[i][item[key]];
}
}
vm.item = obj;
// console.log(item)
});
},
data() {
return {
item: {
title: "111",
time: "2015",
content: "222"
}
};
},
//965EB729-3DE3-4725-BFF2-6995545693AA
created() {},
methods: {
getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return decodeURI(pair[1]);
}
}
return false;
}
}
};
</script>
<style scoped>
#content img {
width: 100% !important;
}
body,
html {
background: white;
}
</style>
\ No newline at end of file
import overage from "./overage"
overage.install=function(Vue){
Vue.component(overage.name,overage)
}
export default overage
\ No newline at end of file
<template>
<div >
<div class="heade" style="margin-top: 10px;">
<p><i class="iconfont">&#xe604;</i>当前余额(元)</p>
<p>2.00</p>
</div>
<div class="comDetail">
<p class="comTitle">
<span>交易明细</span>
<a href="moreConsumerDetails.html">更多</a>
</p>
<ul class="comContent">
<li>
<a href="javascript:;">
<div>
<p>消费</p>
<p>2017-05-01 15:00</p>
</div>
<div class="comright">20</div>
</a>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
name: "KvOverage",
props: {
jsondata: {
type: Object,
default: function() {
return {
userlits: [
],
switchtitle: true,
titlecontent: "服务",
type:1
};
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.heade {
width: 100%;
height: 2rem;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
background: white;
}
.heade p:nth-child(1){
font-size: 0.27rem;
color: #BCB8B8;
}
.heade p:nth-child(1) i{
color: #FAA207;
}
.heade p:nth-child(2){
font-size:0.5rem;
}
.comDetail{
background: white;
margin-top: 0.2rem;
}
.comTitle{
padding:0.2rem;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #f1f1f1;
}
.comTitle a{
color: #747272;
font-size: 14px;
}
.comContent li a{
display: flex;
justify-content: space-between;
padding: 0.2rem;
font-size: 0.27rem;
border-bottom: 1px solid #f1f1f1;
width: 100%;
}
.comright{
color: #0DC9FB;
display: flex;
align-items: center;
}
</style>
\ No newline at end of file
import password from "./password"
password.install=function(Vue){
Vue.component(password.name,password)
}
export default password
\ No newline at end of file
<template>
<div>
<yd-cell-group>
<yd-cell-item>
<span slot="left">旧密码:</span>
<yd-input
slot="right"
v-model="input8"
required
:show-success-icon="false"
:show-error-icon="false"
regex="mobile"
placeholder="请输入旧密码"
></yd-input>
</yd-cell-item>
<yd-cell-item>
<span slot="left">新密码:</span>
<yd-input
slot="right"
v-model="input8"
required
:show-success-icon="false"
:show-error-icon="false"
regex="mobile"
placeholder="请输入新密码"
></yd-input>
</yd-cell-item>
<yd-cell-item>
<span slot="left">确认密码:</span>
<yd-input
slot="right"
v-model="input8"
required
:show-success-icon="false"
:show-error-icon="false"
regex="mobile"
placeholder="请再次输入新密码"
></yd-input>
</yd-cell-item>
</yd-cell-group>
<yd-button size="large" type="primary">修改密码</yd-button>
</div>
</template>
<script>
export default {
name: "KvPassword",
data() {
return {
input8: ""
};
},
created() {},
methods: {},
mounted() {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
import register from "./register"
register.install=function(Vue){
Vue.component(register.name,register)
}
export default register
\ No newline at end of file
<template>
<div class="login" style="min-height:10rem;">
<div class="page-container">
<yd-cell-group>
<yd-cell-item style=" border-bottom:1px solid #DEDBDB; border-top:1px solid #DEDBDB;">
<yd-input
:debug="true"
v-model="phone"
placeholder="请输入手机号码"
required
regex="mobile"
slot="right"
></yd-input>
</yd-cell-item>
<yd-cell-item style="width:100%; border-bottom:1px solid #DEDBDB;">
<input
type="tel"
slot="right"
placeholder="请输入验证码"
v-model="regcode"
maxlength="6"
@input="formatDigit($event)"
/>
<yd-sendcode
style="height:0.9rem; border:none;width:30%"
slot="right"
v-model="startSend"
@click.native="sendCode"
:type="rightMobile?'warning':'disabled'"
></yd-sendcode>
</yd-cell-item>
</yd-cell-group>
<div>
<yd-checklist v-model="checklist1" :callback="checklist">
<yd-checklist-item val="1">
<div style="height: 50px;line-height: 50px;">《用户注册协议》</div>
</yd-checklist-item>
</yd-checklist>
<!-- <check-icon :value.sync="checkProtocol" type="plain">{{checkProtocol?'同意':'不同意'}}</check-icon> -->
<!-- <router-link to="/registerprotocol" class="protocol">《用户注册协议》</router-link> -->
<yd-button
size="large"
type="warning"
:disabled="!validRegister"
@click.native="register"
>注册</yd-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: "KvRegister",
created() {
// this.$dialog.loading.open("发送中...");
this.routefrom = this.$route.query.redirect;
},
data() {
return {
regcode: "",
phone: "",
regstate: "注册",
correctCode: "",
startSend: false,
checkProtocol: true,
checklist1: [1]
};
},
computed: {
rightMobile() {
return /^1[3,4,5,7,8,9]\d{9}$/.test(this.phone);
},
rightCode() {
return /^\d{6}$/gi.test(this.regcode) && this.startSend;
},
validRegister() {
return this.rightMobile && this.rightCode && this.checkProtocol;
}
},
activated() {
this.password = "";
},
methods: {
checklist(e){
console.log(e)
},
onSwipeRight(event, start, end) {
if (start.X >= 80) return;
// if(end.X<=250)return;
this.$router.go(-1);
},
formatDigit(event) {
this.code = event.target.value.replace(/\D/g, "");
},
sendCode() {},
register() {}
}
};
</script>
<style scoped>
.page-container {
padding: 0.2rem;
}
.forget-pwd {
display: block;
width: 2rem;
padding: 0.1rem 0;
}
.text-center {
margin: 0.8rem auto;
color: blue;
border: 1px solid currentColor;
border-radius: 5px;
}
.active {
background-color: blue;
color: white;
}
.tips {
margin: 1rem auto 0;
font-size: 0.32rem;
}
.login {
height: 100%;
width: 100%;
position: absolute;
opacity: 0.8;
left: 0;
overflow: hidden;
}
.login h1 {
text-align: center;
font-size: 40px;
transition-duration: 1s;
transition-timing-function: ease-in-put;
font-weight: 200;
}
</style>
\ No newline at end of file
import rollnotice from "./rollnotice"
rollnotice.install=function(Vue){
Vue.component(rollnotice.name,rollnotice)
}
export default rollnotice
\ No newline at end of file
<template>
<yd-rollnotice :autoplay="uiConfig.autotime">
<yd-rollnotice-item v-for="(item,index) of item" :key="index">
<a :href="uiConfig.href+item.Kvid">
<img src="../../assets/laba.png" alt />
<span>{{item.title}}</span>
</a>
</yd-rollnotice-item>
</yd-rollnotice>
</template>
<script type="text/babel">
export default {
name: "KvRollnotice",
data() {
return {
item: []
};
},
props: {
dataSource: {
type: Object,
default: function() {
return {
url: "http://e.debug.jst-gov.com/contents/apps/Announcement.json",
root: "",
fields: {
title: "Title"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
autotime: 5000
};
}
}
},
mounted() {
var vm = this;
var item = vm.dataSource.fields;
this.$get(this.dataSource.url).then(res => {
var list = [];
for (let i = 0; i < res.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res[i][item[key]];
}
list.push(obj);
}
console.log(list)
vm.item = list;
});
}
};
</script>
<style lang="">
.yd-rollnotice-item {
width: 100%;
}
.yd-rollnotice {
margin-bottom: 0.2rem;
}
.yd-rollnotice-item a {
width: 100%;
height: 30px;
display: block;
}
.yd-rollnotice-item a img {
height: 20px;
float: left;
width: 20px;
margin-top: 5px;
margin-left: 10px;
margin-right: 10px;
}
.yd-rollnotice-item a span {
height: 30px;
line-height: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
display: block;
width: calc(100% - 50px);
text-align: left;
}
</style>
\ No newline at end of file
import search from "./search"
search.install=function(Vue){
Vue.component(search.name,search)
}
export default search
\ No newline at end of file
<template>
<div>
<yd-search v-model="value1" :on-submit="submitHandler" ></yd-search>
</div>
</template>
<script>
import {bus} from "../../main"
export default {
name:'KvSearch',
data() {
return {
value1: ''
}
},
created() {
},
methods: {
submitHandler(value) {
this.$dialog.toast({mes: `搜索:${value}`});
bus.$emit("tobusiness",value)
}
},
mounted() {
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
import swipers from "./swipers"
swipers.install=function(Vue){
Vue.component(swipers.name,swipers)
}
export default swipers
\ No newline at end of file
<template>
<yd-slider
style="height:4rem; width:100%; margin-bottom:0.2rem;"
:autoplay="uiConfig.autotime"
speed="600"
:show-pagination="false"
>
<yd-slider-item v-for="(item,index) of item" :key="index">
<a :href="item.href">
<img :src="'http://k5t.jst-gov.com/'+
item.img" />
<span>{{item.title}}</span>
</a>
</yd-slider-item>
</yd-slider>
</template>
<script>
export default {
name: "KvSwiper",
props: {
dataSource: {
type: Object,
default: function() {
return {
url: "http://k5t.jst-gov.com/contents/apps/TitleImage.json",
root: "",
fields: {
title: "Title",
img: "TitleImageUrl"
}
};
}
},
uiConfig: {
type: Object,
default: function() {
return {
autotime: 5000
};
}
}
},
mounted() {
var vm = this;
var item = vm.dataSource.fields;
this.$get(this.dataSource.url).then(res => {
var list = [];
for (let i = 0; i < res.length; i++) {
var obj = {};
for (const key in item) {
obj[key] = res[i][item[key]];
}
list.push(obj);
}
vm.item = list;
});
},
data() {
return {
item: [
// {
// img:
// "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1499844476,2082399552&fm=26&gp=0.jpg",
// title:
// "标题1标题1标题1标题1标题1标题1题1标题1题1标题1题1标题1题1标题1题1标题1题1标题1题1标题1标题1",
// href: "javascript:;"
// },
// {
// img:
// "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3125448337,4108128754&fm=26&gp=0.jpg",
// title: "标题2标题2标题2标题2标题2标题2标题2",
// href: "javascript:;"
// },
// {
// img:
// "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3820928597,3773863502&fm=26&gp=0.jpg",
// title: "标题3标题3标题3标题3标题3标题3标题3标题3标题3",
// href: "javascript:;"
// }
]
};
}
};
</script>
<style scoped>
.yd-slider-item {
height: 4rem;
width: 100%;
}
.yd-slider-item img {
height: 4rem;
width: 100%;
}
.yd-slider-item a {
display: block;
height: 4rem;
position: relative;
width: 100%;
}
.yd-slider-item a span {
position: absolute;
bottom: 0;
font-size: 0.3rem;
height: 0.4rem;
line-height: 0.4rem;
width: 100%;
padding: 0 0.2rem;
box-sizing: border-box;
overflow: hidden;
background: rgba(0, 0, 0, 0.3);
color: white;
left: 0;
right: 0;
}
</style>
\ No newline at end of file
import tab from "./tab"
tab.install=function(Vue){
Vue.component(tab.name,tab)
}
export default tab
\ No newline at end of file
<template>
<yd-tab>
<yd-tab-panel v-for="(item,index) of jsondata" :key="index" :label="item.labtitle">
<demo-businesslist :jsondata="item.itemlist"></demo-businesslist>
</yd-tab-panel>
</yd-tab>
</template>
<script>
export default {
name: "KvTab",
props: {
jsondata: {
type: Array,
default: function() {
return [
{
labtitle: "选项一",
itemlist: {
bgcolor: "#1b81ee",
bgimg: "../../../static/baogao.png",
itemtitle: "报告",
href: "javascript:;",
itemdata: [
{
title: "委托单位名称委托单位",
subtitle: "JST-123456",
times: "2001-02-04",
results: "合格"
},
{
title: "委托单位名称委托单位1",
subtitle: "JST-123456",
times: "2001-02-02",
results: "合格"
}
]
}
},
{
labtitle: "选项二",
itemlist: {
bgcolor: "#1b81ee",
bgimg: "../../../static/baogao.png",
itemtitle: "报告",
href: "javascript:;",
itemdata: [
{
title: "委托单位名称委托单位",
subtitle: "JST-123456",
times: "2001-02-03",
results: "合格"
},
{
title: "委托单位名称委托单位1",
subtitle: "JST-123456",
times: "2001-02-02",
results: "合格"
}
]
}
}
];
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
import threelist from "./threelist"
threelist.install=function(Vue){
Vue.component(threelist.name,threelist)
}
export default threelist
\ No newline at end of file
<template>
<div class="weui-grids" style="margin-top: 0">
<a :href="item.href" class="weui-grid js_grid" v-for="(item,index) of jsondata" :key="index">
<div class="weui-grid__icon">
<img :src="item.img" alt />
</div>
<p class="weui-grid__label">{{item.title}}</p>
</a>
</div>
</template>
<script>
export default {
name: "KvThreelist",
props:{
jsondata:{
type:Array,
default:function(){
return [
]
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.weui-grids {
background: white;
display: flex;
justify-content: space-around;
margin-bottom: 0.2rem;
}
.weui-grid {
position: relative;
float: left;
padding: 20px 10px;
width: 33.33333333%;
box-sizing: border-box;
}
.js_grid {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 0.4rem 0;
}
.weui-grid__icon {
width: 0.56rem;
height: 0.56rem;
margin: 0 auto;
margin-bottom: 0.2rem;
}
.weui-grid__icon img {
display: block;
width: 100%;
height: 100%;
}
.weui-grid:before {
content: " ";
position: absolute;
right: 0;
top: 0;
width: 1px;
bottom: 0;
border-right: 1px solid #d9d9d9;
color: #d9d9d9;
-webkit-transform-origin: 100% 0;
transform-origin: 100% 0;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
}
.weui-grid:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid #d9d9d9;
color: #d9d9d9;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.weui-grid__label {
display: block;
text-align: center;
color: #000000;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
</style>
\ No newline at end of file
import userinfo from "./userinfo"
userinfo.install=function(Vue){
Vue.component(userinfo.name,userinfo)
}
export default userinfo
\ No newline at end of file
<template>
<div style="margin-bottom:0.2rem;">
<a class="head" href="javascript:;" style="display: flex; align-items: center;">
<img id="userhead" :src="jsondata.img" alt />
<div class="info">
<div class="name">
<span id="name">{{jsondata.name}}</span>
</div>
<div class="phone" id="billing">
<span>{{jsondata.company}}</span>
<span style="color: #05A3FA">,立即绑定</span>
</div>
<div class="phone">
<span id="org"></span>
</div>
</div>
<div style="margin-left: 0.4rem;">
<span class="right_arrow"></span>
</div>
</a>
</div>
</template>
<script>
export default {
name: "KvUserinfo",
props:{
jsondata:{
type:Object,
default:function(){
return{
}
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.head img {
height: 1.5rem;
width: 1.5rem;
border-radius: 50%;
float: left;
margin-right: 0.2rem;
margin-left: 0.4rem;
}
.info {
float: left;
padding: 0.2rem 0;
width: 50%;
}
.head {
padding: 0.2rem;
display: block;
color: #333;
width: 100%;
overflow: hidden;
}
.name {
font-size: 0.36rem;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.name span:nth-child(2) {
font-size: 12px;
color: #b2b1b1;
}
.phone {
text-align: left;
font-size: 0.28rem;
margin-top: 0.1rem;
}
.right_arrow {
display: inline-block;
border-top: 2px solid;
border-right: 2px solid;
width: 14px;
height: 14px;
border-color: #7e7e7e;
transform: rotate(45deg);
}
</style>
\ No newline at end of file
import userlist from "./userlist"
userlist.install=function(Vue){
Vue.component(userlist.name,userlist)
}
export default userlist
\ No newline at end of file
<template>
<div class="user-server">
<p class="title" v-if="jsondata.switchtitle">{{jsondata.titlecontent}}</p>
<ul class="content">
<li v-for="(item,index) in jsondata.userlits" :key="index" :data-id="item.id" class="demo-chose">
<a :href="item.href" class="purview">
<img :src="item.img" v-if="jsondata.type==1"/>
<span v-else-if="jsondata.type==2">{{item.img}}</span>
<span>{{item.name}}</span>
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: "KvUserlist",
props: {
jsondata: {
type: Object,
default: function() {
return {
userlits: [
{
href: "javascript:;",
name: "企业信息",
img: "../../../static/company.png",
id:"btn4"
},
{
href: "javascript:;",
name: "开票管理",
img: "../../../static/invioce.png",
id:"btn5"
},
{
href: "javascript:;",
name: "权限管理",
img: "../../../static/quanxian.png",
id:"btn6"
}
],
switchtitle: true,
titlecontent: "服务",
type:1
};
}
}
},
data() {
return {};
},
created() {},
mounted() {}
};
</script>
<style scoped>
.user-server {
background: white;
margin-bottom: 0.2rem;
padding: 0.2rem;
}
.user-server .title {
border-bottom: 1px solid #f2f2f2;
font-size: 0.3rem;
padding-bottom: 0.2rem;
text-align: left;
}
.user-server .content li span:nth-child(1) {
font-size: 0.36rem;
color: #FF9102
}
.user-server .content {
display: flex;
justify-content: space-around;
margin-top: 0.2rem;
}
.content li a {
display: flex;
flex-direction: column;
align-items: center;
}
.content li img {
width: 0.5rem;
margin-bottom: 0.2rem;
}
.content li span:nth-child(2) {
font-size: 0.3rem;
color: #bab4ad;
}
.content li span:nth-child(1) {
font-size: 0.36rem;
margin-bottom: 0.2rem;
color: #bab4ad;
}
</style>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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 to comment