luyanan 6 gadi atpakaļ
vecāks
revīzija
d86ac437c6

+ 3 - 2
build/build.js

@ -1,7 +1,7 @@
1 1
'use strict'
2 2
require('./check-versions')()
3 3
4
process.env.NODE_ENV = 'production'
4
// process.env.NODE_ENV = 'production'
5 5
6 6
const ora = require('ora')
7 7
const rm = require('rimraf')
@ -11,7 +11,8 @@ const webpack = require('webpack')
11 11
const config = require('../config')
12 12
const webpackConfig = require('./webpack.prod.conf')
13 13
14
const spinner = ora('building for production...')
14
// const spinner = ora('building for production...')
15
var spinner = ora('building for ' + process.env.NODE_ENV + ' of ' + process.env.env_config+ ' mode...' )
15 16
spinner.start()
16 17
17 18
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {

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

@ -75,7 +75,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
75 75
    new HtmlWebpackPlugin({
76 76
      filename: 'index.html',
77 77
      template: 'index.html',
78
      inject: true
78
      inject: true,
79
      favicon: path.resolve('favicon.ico')
79 80
    }),
80 81
    // copy custom static assets
81 82
    new CopyWebpackPlugin([

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

@ -11,7 +11,8 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 11
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 12
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13 13
14
const env = require('../config/prod.env')
14
// const env = require('../config/prod.env')
15
const env = config.build[process.env.env_config+'Env']
15 16
16 17
const webpackConfig = merge(baseWebpackConfig, {
17 18
  module: {
@ -64,6 +65,7 @@ const webpackConfig = merge(baseWebpackConfig, {
64 65
      filename: config.build.index,
65 66
      template: 'index.html',
66 67
      inject: true,
68
      favicon: path.resolve('favicon.ico'),
67 69
      minify: {
68 70
        removeComments: true,
69 71
        collapseWhitespace: true,

+ 1 - 0
config/dev.env.js

@ -4,6 +4,7 @@ const prodEnv = require('./prod.env')
4 4
5 5
module.exports = merge(prodEnv, {
6 6
  NODE_ENV: '"development"',
7
  ENV_CONFIG:'"dev"',
7 8
  PLAT_ID: '"9619237FAF5E4B908F0F88A5845C8C9F"',
8 9
  BASE_API: '"http://localhost:7070"',
9 10
  KX_API: '"http://192.168.3.233:81"'

+ 2 - 0
config/index.js

@ -44,6 +44,8 @@ module.exports = {
44 44
  },
45 45
46 46
  build: {
47
    prodEnv: require('./prod.env'),
48
    testEnv: require('./test.env'),
47 49
    // Template for index.html
48 50
    index: path.resolve(__dirname, '../dist/index.html'),
49 51

+ 1 - 3
config/prod.env.js

@ -1,10 +1,8 @@
1 1
'use strict'
2 2
module.exports = {
3 3
  NODE_ENV: '"production"',
4
  ENV_CONFIG:'"prod"',
4 5
  PLAT_ID: '"F5DEA8EDB12E421A9FC4B701BB6176A6"',
5 6
  BASE_API: '"http://xttjpt.cn"',
6 7
  KX_API: '"https://www.ekexiu.com"'
7
  // PLAT_ID: '"9619237FAF5E4B908F0F88A5845C8C9F"',
8
  // BASE_API: '"http://192.168.3.233:2080"',
9
  // KX_API: '"http://192.168.3.233"'
10 8
}

+ 8 - 0
config/test.env.js

@ -0,0 +1,8 @@
1
'use strict'
2
module.exports = {
3
  NODE_ENV: '"testing"',
4
  ENV_CONFIG:'"test"',
5
  PLAT_ID: '"9619237FAF5E4B908F0F88A5845C8C9F"',
6
  BASE_API: '"http://192.168.3.233:2080"',
7
  KX_API: '"http://192.168.3.233"'
8
}

static/favicon.ico → favicon.ico


+ 1 - 2
index.html

@ -6,8 +6,7 @@
6 6
  	<meta name="description" content="">
7 7
  	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
8 8
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
9
  	<link rel="shortcut icon" type="image/png" href="./static/favicon.ico">
10
    <script type="text/javascript" src="static/plat-info.js"></script>
9
    <script type="text/javascript" src="/static/plat-info.js"></script>
11 10
  	<title></title>
12 11
  </head>
13 12
  <body>

+ 8 - 2
package.json

@ -7,8 +7,13 @@
7 7
  "scripts": {
8 8
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 9
    "start": "npm run dev",
10
    "lint": "eslint --ext .js,.vue src",
11
    "build": "node build/build.js"
10
    "unit": "jest --config test/unit/jest.conf.js --coverage",
11
    "e2e": "node test/e2e/runner.js",
12
    "test": "npm run unit && npm run e2e",
13
    "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
14
    "build": "node build/build.js",
15
    "build--test": "cross-env NODE_ENV=testing env_config=test node build/build.js",
16
    "build--prod": "cross-env NODE_ENV=production env_config=prod node build/build.js"
12 17
  },
13 18
  "dependencies": {
14 19
    "axios": "^0.17.1",
@ -35,6 +40,7 @@
35 40
    "babel-preset-stage-2": "^6.22.0",
36 41
    "chalk": "^2.0.1",
37 42
    "copy-webpack-plugin": "^4.0.1",
43
    "cross-env": "^5.2.0",
38 44
    "css-loader": "^0.28.11",
39 45
    "eslint": "^4.15.0",
40 46
    "eslint-config-standard": "^10.2.1",

+ 7 - 5
src/components/main-views/ViewHome.vue

@ -16,7 +16,7 @@
16 16
    </el-dialog>
17 17
18 18
    <el-dialog class="videoShow" title="邢台科技条件平台宣传片" :visible.sync="videoVisible" width="940px" @close='closeVideo'>
19
      <video class="video-box" v-if="videoVisible" :poster="posterImg" autoplay controls loop controlsList="nodownload">
19
      <video class="video-box" v-if="videoVisible" :poster="plat.posterImg" autoplay controls loop controlsList="nodownload">
20 20
          <source :src="videoSrc" type="video/mp4">
21 21
      </video>
22 22
    </el-dialog>
@ -232,11 +232,14 @@
232 232
        inputSer: '',
233 233
        inputRes: '',
234 234
        dialogFormVisible: false,
235
        videoVisible: false,
236
        posterImg: require('../../../static/xtkfq/video/xt.png'),
237
        videoSrc: this.plat.videoSrc ? this.plat.videoSrc : ''
235
        videoVisible: false
238 236
      };
239 237
    },
238
    computed: {
239
       videoSrc() {
240
          return this.plat.videoSrc;
241
       }
242
    },
240 243
    created() {
241 244
       this.platId = Cookies.get('platId');
242 245
       this.getAboutUs(this.platId);
@ -680,7 +683,6 @@
680 683
      .video-box
681 684
        width:100%
682 685
        height:530px
683
        bg-image('/static/xtkfq/video/xt.png')
684 686
      .el-dialog
685 687
        background:rgba(0,0,0,.1)
686 688
        position:relative

+ 1 - 1
src/components/sub-component/BaseResource.vue

@ -22,7 +22,7 @@
22 22
    data() {
23 23
      return {
24 24
        linkway: util.defaultSet.link.resource + this.itemSingle.id,
25
        imgUrl: this.itemSingle.images ? util.ImageUrl('resource/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.resource,
25
        imgUrl: (this.itemSingle && this.itemSingle.images) ? util.ImageUrl('resource/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.resource,
26 26
        ownerName: '',
27 27
        ownerAuth: ''
28 28
      };

+ 1 - 1
src/components/sub-component/BaseService.vue

@ -22,7 +22,7 @@
22 22
    data() {
23 23
      return {
24 24
        linkway: util.defaultSet.link.service + this.itemSingle.id,
25
        imgUrl: this.itemSingle.images ? util.ImageUrl('ware/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.service,
25
        imgUrl: (this.itemSingle && this.itemSingle.images) ? util.ImageUrl('ware/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.service,
26 26
        ownerName: '',
27 27
        ownerAuth: ''
28 28
      };

+ 2 - 2
static/plat-info.js

@ -19,8 +19,8 @@ PLAT.info = {
19 19
    //   "imgUrl": "/static/xtkfq/ad/xtfh.jpg"
20 20
    // }
21 21
  ],
22
  "videoSrc": "http://localhost/xtvideo.mp4",
23
  // "videoSrc": "http://xttjpt.cn/xtvideo.mp4",
22
  "posterImg": "/static/xtkfq/video/xt.png",
23
  "videoSrc": "http://192.168.3.233/xtvideo.mp4",
24 24
  "foot_cl": "2016-2018 邢台市科智创新服务中心",
25 25
  "foot_cn": "冀ICP备18020508号",
26 26
  "foot_bl": "",