xiaoyu 3 years ago
parent
commit
279519bc9c

+ 1 - 1
build/build.js

@@ -11,7 +11,7 @@ const webpack = require('webpack')
 const config = require('../config')
 const webpackConfig = require('./webpack.prod.conf')
 
-const spinner = ora('building for production...')
+const spinner = ora('building for production...') 
 spinner.start()
 
 rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {

+ 1 - 1
build/check-versions.js

@@ -11,7 +11,7 @@ function exec (cmd) {
 const versionRequirements = [
   {
     name: 'node',
-    currentVersion: semver.clean(process.version),
+    currentVersion: semver.clean(process.version), 
     versionRequirement: packageConfig.engines.node
   }
 ]

+ 101 - 101
build/utils.js

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

+ 1 - 1
build/vue-loader.conf.js

@@ -12,7 +12,7 @@ module.exports = {
     extract: isProduction
   }),
   cssSourceMap: sourceMapEnabled,
-  cacheBusting: config.dev.cacheBusting,
+  cacheBusting: config.dev.cacheBusting, 
   transformToRequire: {
     video: ['src', 'poster'],
     source: 'src',

+ 1 - 1
build/webpack.base.conf.js

@@ -13,7 +13,7 @@ function resolve (dir) {
 module.exports = {
   context: path.resolve(__dirname, '../'),
   entry: {
-    app: './src/main.js'
+    app: './src/main.js' 
   },
   output: {
     path: config.build.assetsRoot,

+ 1 - 1
build/webpack.dev.conf.js

@@ -13,7 +13,7 @@ const portfinder = require('portfinder')
 const HOST = process.env.HOST
 const PORT = process.env.PORT && Number(process.env.PORT)
 
-const devWebpackConfig = merge(baseWebpackConfig, {
+const devWebpackConfig = merge(baseWebpackConfig, { 
   module: {
     rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
   },

+ 1 - 1
build/webpack.prod.conf.js

@@ -13,7 +13,7 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
 
 const env = require('../config/prod.env')
 
-const webpackConfig = merge(baseWebpackConfig, {
+const webpackConfig = merge(baseWebpackConfig, { 
   module: {
     rules: utils.styleLoaders({
       sourceMap: config.build.productionSourceMap,

+ 1 - 0
config/dev.env.js

@@ -5,3 +5,4 @@ const prodEnv = require('./prod.env')
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"'
 })
+ 

+ 69 - 69
config/index.js

@@ -1,69 +1,69 @@
-'use strict'
-// Template version: 1.3.1
-// see http://vuejs-templates.github.io/webpack for documentation.
-
-const path = require('path')
-
-module.exports = {
-  dev: {
-
-    // Paths
-    assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
-    proxyTable: {},
-
-    // Various Dev Server settings
-    host: 'localhost', // can be overwritten by process.env.HOST
-    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
-    autoOpenBrowser: false,
-    errorOverlay: true,
-    notifyOnErrors: true,
-    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
-
-    
-    /**
-     * 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'
+// Template version: 1.3.1
+// see http://vuejs-templates.github.io/webpack for documentation.
+
+const path = require('path')
+
+module.exports = {
+  dev: {
+
+    // Paths
+    assetsSubDirectory: 'static',
+    assetsPublicPath: '/',
+    proxyTable: {},
+
+    // Various Dev Server settings
+    host: '192.168.1.160', // can be overwritten by process.env.HOST
+    port: 3333, // 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
+  }
+}

+ 1 - 0
config/prod.env.js

@@ -2,3 +2,4 @@
 module.exports = {
   NODE_ENV: '"production"'
 }
+ 

+ 14 - 13
index.html

@@ -1,13 +1,14 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <title>vue-project-init</title>
-  </head>
-  <body>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
-</html>
-<script src="https://open.95516.com/s/open/js/upsdk.js"></script>
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <title>vue-project-init</title>
+  </head>
+  <body>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>
+<script src="https://open.95516.com/s/open/js/upsdk.js"></script>
+ 

File diff suppressed because it is too large
+ 11907 - 11872
package-lock.json


+ 67 - 63
package.json

@@ -1,63 +1,67 @@
-{
-  "name": "vue-project-init",
-  "version": "1.0.0",
-  "description": "A Vue.js project",
-  "author": "null",
-  "private": true,
-  "scripts": {
-    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
-    "start": "npm run dev",
-    "build": "node build/build.js"
-  },
-  "dependencies": {
-    "vant": "^2.12.31",
-    "vue": "^2.5.2"
-  },
-  "devDependencies": {
-    "autoprefixer": "^7.1.2",
-    "babel-core": "^6.22.1",
-    "babel-helper-vue-jsx-merge-props": "^2.0.3",
-    "babel-loader": "^7.1.1",
-    "babel-plugin-import": "^1.13.3",
-    "babel-plugin-syntax-jsx": "^6.18.0",
-    "babel-plugin-transform-runtime": "^6.22.0",
-    "babel-plugin-transform-vue-jsx": "^3.5.0",
-    "babel-preset-env": "^1.3.2",
-    "babel-preset-stage-2": "^6.22.0",
-    "chalk": "^2.0.1",
-    "copy-webpack-plugin": "^4.0.1",
-    "css-loader": "^0.28.0",
-    "extract-text-webpack-plugin": "^3.0.0",
-    "file-loader": "^1.1.4",
-    "friendly-errors-webpack-plugin": "^1.6.1",
-    "html-webpack-plugin": "^2.30.1",
-    "node-notifier": "^5.1.2",
-    "optimize-css-assets-webpack-plugin": "^3.2.0",
-    "ora": "^1.2.0",
-    "portfinder": "^1.0.13",
-    "postcss-import": "^11.0.0",
-    "postcss-loader": "^2.0.8",
-    "postcss-url": "^7.2.1",
-    "rimraf": "^2.6.0",
-    "semver": "^5.3.0",
-    "shelljs": "^0.7.6",
-    "uglifyjs-webpack-plugin": "^1.1.1",
-    "url-loader": "^0.5.8",
-    "vue-loader": "^13.3.0",
-    "vue-style-loader": "^3.0.1",
-    "vue-template-compiler": "^2.5.2",
-    "webpack": "^3.6.0",
-    "webpack-bundle-analyzer": "^2.9.0",
-    "webpack-dev-server": "^2.9.1",
-    "webpack-merge": "^4.1.0"
-  },
-  "engines": {
-    "node": ">= 6.0.0",
-    "npm": ">= 3.0.0"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions",
-    "not ie <= 8"
-  ]
-}
+{
+  "name": "vue-project-init",
+  "version": "1.0.0",
+  "description": "A Vue.js project",
+  "author": "null",
+  "private": true,
+  "scripts": {
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
+    "start": "npm run dev",
+    "build": "node build/build.js"
+  },
+  "dependencies": {
+    "axios": "^0.24.0",
+    "js-cookie": "^3.0.1",
+    "vant": "^2.12.31",
+    "vue": "^2.5.2",
+    "vue-router": "^3.5.3"
+  },
+  "devDependencies": {
+    "autoprefixer": "^7.1.2",
+    "babel-core": "^6.22.1",
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
+    "babel-loader": "^7.1.1",
+    "babel-plugin-import": "^1.13.3",
+    "babel-plugin-syntax-jsx": "^6.18.0",
+    "babel-plugin-transform-runtime": "^6.22.0",
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
+    "babel-preset-env": "^1.3.2",
+    "babel-preset-stage-2": "^6.22.0",
+    "chalk": "^2.0.1",
+    "copy-webpack-plugin": "^4.0.1",
+    "css-loader": "^0.28.0",
+    "extract-text-webpack-plugin": "^3.0.0",
+    "file-loader": "^1.1.4",
+    "friendly-errors-webpack-plugin": "^1.6.1",
+    "html-webpack-plugin": "^2.30.1",
+    "node-notifier": "^5.1.2",
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
+    "ora": "^1.2.0",
+    "portfinder": "^1.0.13",
+    "postcss-import": "^11.0.0",
+    "postcss-loader": "^2.0.8",
+    "postcss-url": "^7.2.1",
+    "rimraf": "^2.6.0",
+    "semver": "^5.3.0",
+    "shelljs": "^0.7.6",
+    "uglifyjs-webpack-plugin": "^1.1.1",
+    "url-loader": "^0.5.8",
+    "vue-cup-ui": "^0.1.0",
+    "vue-loader": "^13.3.0",
+    "vue-style-loader": "^3.0.1",
+    "vue-template-compiler": "^2.5.2",
+    "webpack": "^3.6.0",
+    "webpack-bundle-analyzer": "^2.9.0",
+    "webpack-dev-server": "^2.9.1",
+    "webpack-merge": "^4.1.0"
+  },
+  "engines": {
+    "node": ">= 6.0.0",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not ie <= 8"
+  ]
+}

+ 16 - 28
src/App.vue

@@ -1,28 +1,16 @@
-<template>
-  <div id="app">
-<van-button type="primary">主要按钮</van-button>
-<van-button type="info">信息按钮</van-button>
-<van-button type="default">默认按钮</van-button>
-<van-button type="warning">警告按钮</van-button>
-<van-button type="danger">危险按钮</van-button>
-  </div>
-</template>
-
-<script>
-
-import {Button} from "vant"
-export default {
-  name: 'App',
-}
-</script>
-
-<style>
-#app {
-  font-family: 'Avenir', Helvetica, Arial, sans-serif;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  text-align: center;
-  color: #2c3e50;
-  margin-top: 60px;
-}
-</style>
+<template>
+  <div id="app">
+   <router-view />
+  </div>
+</template>
+
+<script>
+
+import {Button} from "vant"
+export default {
+  name: 'App',
+}
+</script>
+
+<style>
+</style> 

+ 33 - 0
src/api/index.js

@@ -0,0 +1,33 @@
+import axios from 'axios'
+
+
+const Prefix = 'http://192.168.1.218/applets/index.php?';
+export default {
+//code获取信息
+	login(params) {
+		 return axios({
+				method: 'post',
+				url: `${Prefix}act=login&op=unionpaystart&client_type=ajax`,
+				withCredentials : true,
+				headers: {
+					"Content-Type": "application/x-www-form-urlencoded",
+			},
+			data: params,
+			timeout: 120000
+		})
+	},
+	//获取用户实名信息
+	new_login(params) { 
+		return axios({
+			method: 'post',
+			url: `${Prefix}act=login&op=unionpayauthen&client_type=ajax`,
+			withCredentials : true,
+			headers: {
+				"Content-Type": "application/x-www-form-urlencoded",
+		},
+		data: params,
+		timeout: 120000
+	})
+	}
+
+}

+ 113 - 113
src/components/HelloWorld.vue

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

+ 0 - 0
src/components/Tabbar.vue


+ 23 - 14
src/main.js

@@ -1,14 +1,23 @@
-// 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.vue'
-import {Button} from 'vant';
-import 'vant/lib/index.css'
-Vue.use(Button);
-
-/* eslint-disable no-new */
-new Vue({
-  el: '#app',
-  components: { App },
-  template: '<App/>'
-})
+// 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.vue'
+import 'vant/lib/index.css'
+import router from './router'
+import api from './api/index'
+Vue.prototype._axios = api
+import VueCupUi from 'vue-cup-ui';
+import 'vue-cup-ui/lib/vue-cup-ui.css';
+Vue.use(VueCupUi);
+import {Button, Collapse, CollapseItem, row, col, icon } from 'vant';
+Vue.use(Button).use(Collapse).use(CollapseItem).use(row).use(col).use(icon);
+Vue.config.productionTip = false
+
+/* eslint-disable no-new */
+const vue = new Vue({
+  router,
+  render: h => h(App)
+}).$mount('#app')
+
+
+export default vue

+ 118 - 0
src/pages/home.vue

@@ -0,0 +1,118 @@
+<template>
+  <div id="home">
+    <!-- 顶部 -->
+    <!-- <van-search
+      v-model="value"
+      shape="round"
+      background="#edf0f5"
+      placeholder="请输入搜索关键词"
+      @click="getsearch"
+      disabled 
+    /> -->
+    <van-row class="">
+      <van-col span="16">
+        <!-- <div>
+         <van-icon name="location" />
+          当前您的定位在
+          {{msg ? msg : '加载中...'}}
+        </div> -->
+      </van-col>
+      <van-col span="8">
+        <UPButton @click="btnClick" :scope="scope" style="background: #edf0f5">
+          <van-icon
+            name="https://b.yzcdn.cn/vant/icon-demo-1126.png"
+            size="1.8rem"
+          />
+        </UPButton>
+      </van-col>
+    </van-row>
+    <!-- 轮播 -->
+    <!-- <van-swipe :autoplay="5000" style="width: 98%; margin: 5px auto;" indicator-color="#FE8A3D">
+  <van-swipe-item v-for="(item, index) in images" :key="index">
+    <img width="98%" height="200px" style="display:block;" v-lazy="item" />
+  </van-swipe-item>
+</van-swipe> -->
+    <!-- <Tabbar></Tabbar> -->
+    <!-- <transition name="van-slide-right">
+      <router-view></router-view>
+    </transition> -->
+  </div>
+</template>
+
+<script>
+import Cookies from "js-cookie";
+// import Tabbar from "@/components/Tabbar";
+export default {
+  name: "home",
+  // components: { Tabbar },
+
+  data() {
+    return {
+      scope: "scope.mobile",
+      msg: "",
+      code: "",
+      openId: "",
+      unionId: "",
+      value: '',
+      images: [
+        // require("@/assets/home/banner.png"),
+        // require("@/assets/home/banner.png"),
+        // require("@/assets/home/banner.png"),
+      ],
+    };
+  },
+  created() {
+    this.getdata();
+  },
+  methods: {
+    async btnClick(event, err, result) {
+      console.log(event, err, result);
+      // this.code = result.code;
+      // let params = new URLSearchParams();
+      // params.append("code", this.code);
+      // const login = await this._axios.login(params);
+
+      // this.openId = login.data.datas.openId;
+      // this.unionId = login.data.datas.unionId;
+
+      // if (this.openId && this.unionId) {
+      //   let params = new URLSearchParams();
+      //   params.append("openId", this.openId);
+      //   params.append("unionId", this.unionId);
+      //   const new_login = await this._axios.new_login(params);
+      //   console.log(new_login);
+      // }
+    },
+    async getdata() {
+      // console.log(111);
+    },
+    getsearch() {
+      // this.$router.push("/home/popup");
+    },
+  },
+};
+</script>
+
+<style scoped>
+body {
+  background-color: #edf0f5;
+}
+.van-row {
+  display: flex;
+  align-items: center;
+}
+.van-col--16 {
+  margin-left: 0.05rem;
+  font-size: 0.14px;
+}
+.van-col--8 {
+  width: 33.33333333%;
+  text-align: right;
+  margin-top: 0.06rem;
+}
+.van-swipe-item {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>

+ 487 - 0
src/pages/index.vue

@@ -0,0 +1,487 @@
+<template>
+<div id="app">
+
+  <Tabbar></Tabbar> 
+</div>
+
+</template>
+
+<script>
+var style="black"
+var isShow="true"
+var Bar=1
+import Tabbar  from '@/components/Tabbar'
+export default {
+
+  name: 'App',
+  components: { Tabbar },
+
+  data() {
+    return {
+      activeNames: ['0'],
+      scope:"scope.mobile",
+    }
+  },
+
+
+  methods: {
+
+    onSearch(val) {
+      Toast(val);
+    },
+
+    onCancel() {
+      Toast('取消');
+    },
+
+    btnClick(event, err, result) {
+        console.log(event, err, result)
+    },
+
+    setletStyle (){
+      upsdk.pluginReady(function () {
+      if(style=="black"){
+       upsdk.setTitleStyle({
+        appletStyle: 'white'
+        })
+       style="white"
+       }
+       else{
+        upsdk.setTitleStyle({
+        appletStyle: 'black'
+       })
+       style="black";
+       }
+      })
+    },
+
+    setTitleStyle () {
+      upsdk.pluginReady(function () {
+        if( isShow ){
+        upsdk.setTitleStyle({
+            backBtnVisible: '0'
+        });
+        isShow = false;
+        }else{
+        upsdk.setTitleStyle({
+            backBtnVisible: '1'
+        });
+        isShow = true;
+        }
+      })
+    },
+
+    setBarVisible() {
+      upsdk.pluginReady(function () {
+        if(Bar=="1"){
+        upsdk.setTitleStyle({
+        appletTitleBarVisible: '0'
+        })
+         Bar="0";
+        }
+        else{
+        upsdk.setTitleStyle({
+        appletTitleBarVisible: '1'
+        })
+        Bar="1";
+        }
+      })
+    },
+
+    setGradient () {
+      upsdk.pluginReady(function () {
+        upsdk.setTitleStyle({
+        navBackgroundColor:'0x8FFFFFFF',
+        appletTitleGradientOrient:'top',
+        appletTitleGradientStartColor:'0x8FFFFFFF',
+        appletTitleGradientEndColor:'0x88888888'
+      })
+    })
+    },
+
+    setTitleContent () {
+      upsdk.pluginReady(function () {
+        upsdk.setNavigationBarTitle({
+          title: '我换名字了'
+      })
+      })
+    },
+
+    setNavigate () {
+      upsdk.pluginReady(function () {
+        upsdk.setNavigationBarRightButton({
+          image: '/home/unionpay/docker/nginx/html/distH5/img/u=1641353646,126669045&fm=26&gp=0.jpg',
+          handler:function(){
+        }
+        })
+      })
+    },
+
+    getLocation () {
+      upsdk.pluginReady(function () {
+            upsdk.getLocationGps({
+                success: function(data){
+                    upsdk.showFlashInfo({
+                            msg:data
+                    })
+                },
+                fail: function(){}
+            })
+      })
+    },
+
+    getCity () {
+      upsdk.pluginReady(function () {
+            upsdk.getLocationCity({
+            success: function(cityCd){
+                upsdk.showFlashInfo({
+                  msg:cityCd
+                })
+            }
+          })
+      })
+    },
+
+    Navigate () {
+      upsdk.pluginReady(function () {
+            upsdk.navi({
+                sLat:'31.23958',        // 起点纬度
+                sLon:'121.499763',     // 起点经度
+                sName:'上海东方明珠',   // 起点名称
+                dLat:'39.917854',       // 终点维度
+                dLon:'116.397006',     // 终点经度
+                dName:'北京故宫',     // 终点名称
+                success:function(){
+                },
+                fail: function(msg){
+                }
+            })
+      })
+    },
+
+    scanQR () {
+      upsdk.pluginReady(function () {
+        upsdk.scanQRCodeNew()
+      })
+    },
+
+    qrCode () {
+      upsdk.pluginReady(function () {
+        upsdk.qrCodePay()
+      })
+    },
+
+    scanQRCode () {
+      upsdk.pluginReady(function () {
+            upsdk.scanQRCode({
+            scanType: ["qrCode","barCode"],
+            success: function(result){
+            alert('Scan result = ' + result)  //result返回地址
+            }
+          })
+      })
+    },
+
+    getLight () {
+      upsdk.pluginReady(function () {
+            upsdk.getScreenBrightness({
+                success:function(data){
+                    upsdk.showFlashInfo({
+                            msg:data
+                    });
+                },
+                fail: function(msg){
+                }
+            })
+      })
+    },
+
+    setLight () {
+      upsdk.pluginReady(function () {
+            upsdk.setScreenBrightness({
+                brightness: '1.0',
+                success:function(data){
+                },
+                fail: function(msg){
+                }
+            })
+      })
+    }, //调节好亮度后无法再调节
+
+    changeScreenShot () {
+      upsdk.pluginReady(function () {
+            upsdk.changeScreenShot({
+            switch:true,     // true表示禁止截屏,false表示允许截屏
+            success:function(){},
+            fail: function(msg){}
+          })
+      })
+    }, //仅限android使用
+
+    monitor () {
+      upsdk.pluginReady(function () {
+            upsdk.monitorScreenShot({
+                success:function(){
+                }
+            })
+      })
+    }, //仅限ios使用
+
+    remove () {
+      upsdk.pluginReady(function () {
+            upsdk.removeScreenShot({
+                success:function(){
+                }
+            })
+      })
+    },
+
+    Photo () {
+      upsdk.pluginReady(function () {
+            upsdk.chooseImage({
+                maxWidth:'400', //目标图片宽度, 默认500,可选
+                maxHeight: '400', //目标图片高度, 默认1000,可选
+                sourceType: '1', //1|2|3, 仅允许拍照|仅允许从手机相册中选图|拍照或从手机相册中选图都支持, 默认为3’,可选
+                success: function (data) {
+                    if (data.base64) {
+                    console.log(data)// 目标图片采用base64编码.
+                }
+            }
+          })
+      })
+    },
+
+    getFile () {
+      upsdk.pluginReady(function () {
+            upsdk.chooseFileFromAlbum({
+                maxSize:'524288', //不支持*号,此处为512*1024byte
+                sourceType:'02', // 00:仅支持视频文件,例如mp4、mov等。01:仅支持图片文件,例如png、jpg等。02:支持视频+图片文件
+                success:function(data){
+                    console.log(data.url)
+                    upsdk.readAlbumData({ //获取文件base64编码
+                        url:data.url,
+                        bufferSize: '524288',
+                        fromOffset: '0', //每块的开始位置,第一块为0,第二块为1*bufferSize,依次类推
+                        success:function(data){
+                            console.log(data)
+                        },
+                        fail:function(err){
+                            // {code:'00',msg:'参数错误'}
+                            // {code:'01',msg:'内部错误'}
+                            // {code:'02',msg:'权限失败'}
+                            // {code:'03',msg:'用户选择的文件超过最大值'}
+                            // {code:'04',msg:'其他错误'}
+                        }
+                    })
+                },
+                fail:function(err){
+                    console.log(err)
+                    // {code:’00’,msg:’参数错误’}
+                    // {code:’01’,msg:’内部错误’}
+                    // {code:’02’,msg:’权限失败’}
+                    // {code:’03’,msg:’用户选择的文件超过最大值’}
+                    // {code:’04’,msg:’其他错误’}
+                }
+            })
+      })
+    },
+
+
+    toast () {
+      upsdk.pluginReady(function () {
+            upsdk.showFlashInfo({
+                msg: '我是弹窗'
+           })
+      })
+    },
+
+    openApp () {
+      upsdk.pluginReady(function () {
+            upsdk.openApplet({
+                appId: '2618afce47553ed3',
+                //param: ‘key1=1&key2=2’,  //可选,拼在小程序首页url后的查询参数
+                isFinish: '1', // 可选, “1”表示关闭当前页面 非“0"不做处理, 默认为0
+                //toLink:'url', //可选,打开小程序时打开指定页,url不做编码,url要求域名在小程序安全域名范围内,仅支持云闪付9.0以上版本
+                fail:function(code){ //code=101表示appId为空,code=102表示找不到该应用
+            }
+          })
+      })
+    },
+
+    closeApp () {
+      upsdk.pluginReady(function () {
+            upsdk.closeWebApp()
+      })
+    },
+
+    collectApp () {
+      upsdk.pluginReady(function () {
+            upsdk.collectCurrentApplet({
+                success:function(data){
+                    console.log(data)
+                // 成功回调 data={"code":"00"}
+                // 用户点击了关注,且关注成功了
+                },
+                fail:function(error){
+                    console.log(error)
+                // 失败回调 error={"code":"", msg:””}
+                // ‘01’: 当前小程序已经关注
+                // ‘02’: 环境错误(在非小程序页面调用或者当前小程序运行异常)
+                // ‘03’: 网络异常(网络错误或者服务器响应错误)
+                // ‘04’: 用户取消(用户点击右上角X)
+                // ‘05’: 其它异常
+                }
+            })
+      })
+    },
+
+    addCard () {
+      upsdk.pluginReady(function () {
+            upsdk.addBankCard({
+                success: function(){
+                },
+                fail: function(){
+                }
+            })
+      })
+    },
+
+    addApp () {
+      upsdk.pluginReady(function () {
+            upsdk.addCommonApp({
+                url: "http://test.xiangyuetech.cn/unionpay/applet",    // 必填,应用的入口url,此url必须是后台配置中存在的应用首页url。
+                success:function(data){
+                    console.log(data)
+                // 成功回调 {code:’00’,msg:’添加成功’ } ,指首页应用未满,直接添加的场景,添加首页末尾
+                // 成功回调 {code:’01’,msg:’替换成功’ } ,指首页应用已满,替换应用的场景
+                },
+                fail: function(data){
+                    console.log(data)
+                // 失败回调 {code:’02’,msg:’用户取消’}
+                // 失败回调 {code:’03’,msg:’信息为空’} ,调用后台接口成功,但相应内容为空的场景
+                // 失败回调 {code:’04’,msg:’应用信息已存在常用应用中’}
+                // 失败回调 {code:’05’,msg:’请先登录’}
+                // 失败回调 {code:’99’,msg:’参数错误’}
+                // 其它失败回调 {code:’’,msg:’’}
+                }
+            })
+      })
+    },
+
+    createWeb () {
+      upsdk.pluginReady(function () {
+            upsdk.createWebView({
+                url: 'https://qxwouffjun.feishu.cn/docs/doccnCYISz6edfYReFiF6DZ4SSY',   // 新webview容器中运行的目标页面地址
+                isFinish:'1'  //是否关闭当前的窗口,'1':关闭,'0':不关闭
+            })
+      })
+    },
+
+    getUserDate () {
+      upsdk.pluginReady(function () {
+            upsdk.getUserLogoutDate({
+                success:function(data){ // 插件调用成功
+                    console.log(data)// data = {userLogoutDate:'1611566646395'} 1970时间戳,精确到毫秒
+                },
+                fail:function(){ // 插件调用失败
+                }
+            })
+      })
+    },
+
+    showShare () {
+      upsdk.pluginReady(function () {
+            upsdk.shareSinglePlugin({
+                title: '银联云闪付随机立减大优惠~!',
+                desc: '我刚刚使用银联云闪付, 省了30元,大家快来使用吧.',
+                shareUrl: '',// 默认为当前页面链接即location.href
+                picUrl: '', //默认显示银联云闪付图标
+                shareId: '3', // 详细见备注
+                shareType: '1', //’1’:链接分享,’2’:文字分享,’4’:图片分享, 详细见备注
+                shareData: {  // 详细见备注
+                    content:'',// 可选,当shareType为2时,必传
+                    image:'iVBORw…AAElFTkSuQmCC' //图片的base64数据,可选,仅当shareType为4时,传
+                },
+                fail:function(code){
+                    // code: '01':对应渠道的应用未安装,例如微信未安装,或该渠道调用失败
+                    // code: '02':检查shareType,shareaId是否正确
+                }
+            })
+      })
+    },
+
+    wakeShare () {
+      upsdk.pluginReady(function () {
+            upsdk.appletSharePopup({
+                success:function(){ // 插件调用成功
+                },
+                fail:function(){ // 插件调用失败
+                }
+            })
+      })
+    },
+
+    openBlue () {
+      upsdk.pluginReady(function () {
+            upsdk.openBluetoothAdapter({
+                    success:function(data){
+                    // 成功回调 {"isSupportBLE": "yes"} 支持BLE,不区分大小写
+                    // 成功回调 {"isSupportBLE": "no"} 不支持BLE,不区分大小写
+                    },
+                    fail:function(data){
+                        console.log(data)
+                    // 失败回调 {code:’’,msg:’’}
+                    }
+                })
+      })
+    },
+
+    closeBlue () {
+      upsdk.pluginReady(function () {
+            upsdk.closeBluetoothAdapter({
+                    success:function(){
+                    },
+                    fail:function() {
+                    }
+                })
+      })
+    },
+
+    wakeShare () {
+      upsdk.pluginReady(function () {
+            upsdk.appletSharePopup({
+                success:function(){ // 插件调用成功
+                },
+                fail:function(){ // 插件调用失败
+                }
+            })
+      })
+    },
+
+    queryData () {
+      upsdk.pluginReady(function () {
+            upsdk.queryData({
+                key:'textcontent',
+                success:function(result){
+                    console.log(result)
+                    // result = {code:'',msg:'',key:'xxx',value:'xxx'}
+                    }
+                })
+      })
+    },
+
+
+  }
+}
+</script>
+
+<style scoped>
+#app {
+  font-family: 'Avenir', Helvetica, Arial, sans-serif;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  text-align: center;
+  color: #2c3e50;
+  margin-top: 60px;
+}
+</style>

+ 44 - 0
src/router/index.js

@@ -0,0 +1,44 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+import Home from '../pages/home.vue'
+
+
+const routes = [
+  {
+    path: '/',
+    redirect: '/home'
+  },
+  {
+    path: '/home',
+    name: 'Home',
+    component: Home,
+    // children: [
+    //   {
+    //     path: 'popup',
+    //     name: 'Mypopup',
+    //     component: () => import('../pages/Mypopup.vue')
+
+    //   }
+
+    // ]
+    
+  },
+  {
+    path: '/index',
+    name: 'index',
+    component: () => import('../pages/index.vue')
+  },
+
+]
+
+const router = new VueRouter({
+  routes,
+  // mode:'history',
+  
+})
+const originalPush = VueRouter.prototype.push
+VueRouter.prototype.push = function push(location) {
+  return originalPush.call(this, location).catch(err => err)
+}
+Vue.use(VueRouter)
+export default router

+ 1 - 0
static/.gitkeep

@@ -0,0 +1 @@
+