Browse Source

修改全局样式引入方式

yingp 8 years ago
parent
commit
8fa093e68b

+ 4 - 0
app.html

@@ -2,6 +2,10 @@
 <html {{ HTML_ATTRS }}>
 <head>
   {{ HEAD }}
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css">
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css">
   <script>
     (function (w, d) {
       if (/(MSIE)|(Trident)/.test(w.navigator.userAgent)) {

+ 0 - 3
assets/scss/app.scss

@@ -9,8 +9,5 @@
 // reset style
 @import "reset.scss";
 
-// Iconfont
-@import "../font/iconfont.css";
-
 // Common style
 @import "common.scss";

+ 4 - 6
components/common/buyOrCar/buyComponent.vue

@@ -6,8 +6,6 @@
 </template>
 
 <script>
-  import axios from '~/plugins/axios'
-  import {Message} from 'element-ui'
   export default {
     props: ['item'],
     methods: {
@@ -24,7 +22,7 @@
             // this.$emit('buyAction', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
             if (isBuy) {
               // this.$store.dispatch('user/getBuyInfo', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
-              axios.post('trade/order/buyNow', [{
+              this.$http.post('trade/order/buyNow', [{
                 uuid: this.item.uuid,
                 batchCode: this.item.batchCode,
                 number: this.item.minBuyQty
@@ -36,7 +34,7 @@
                 })
             } else {
               // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
-              axios.post('trade/cart/add', {
+              this.$http.post('trade/cart/add', {
                 uuid: this.item.uuid,
                 batchCode: this.item.batchCode,
                 number: this.item.minBuyQty
@@ -44,12 +42,12 @@
                 .then(response => {
                   console.log(response.data)
                   if (response.data.success) {
-                    Message({
+                    this.$message({
                       message: '添加购物车成功',
                       type: 'success'
                     })
                   } else {
-                    Message.error(response.data.message)
+                    this.$message.error(response.data.message)
                     // console.log(response.data.message)
                   }
                 })

+ 0 - 1
components/common/image-upload/imageUpload.vue

@@ -42,7 +42,6 @@
   }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   input[type="file"] {
     display: none;
   }

+ 0 - 2
components/common/page/pageComponent.vue

@@ -44,8 +44,6 @@
 </script>
 
 <style>
-  @import "~font-awesome/css/font-awesome.css";
-  @import "~element-ui/lib/theme-default/index.css";
   a {
     color: #2d8cf0;
     background: 0 0;

+ 0 - 1
components/default/RightBar.vue

@@ -214,7 +214,6 @@
   }
 </script>
 <style lang="scss" scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   /*查看*/
   #image-box .x-floating-wrap {
     position: fixed;

+ 1 - 2
components/help/left.vue

@@ -70,8 +70,7 @@
   }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
-   .el-tree{
+  .el-tree{
     border: none;
      min-height: 300px;
   }

+ 5 - 6
components/messageBoard/MessageBoard.vue

@@ -135,7 +135,6 @@
 <script>
   import ImageUpload from '~components/common/image-upload/imageUpload.vue'
   import PageComponent from '~components/common/page/pageComponent.vue'
-  import {Message} from 'element-ui'
   export default {
     name: 'messageBoard',
     data () {
@@ -222,19 +221,19 @@
         this.$store.dispatch('uploadMessageBoardInformation', {question: this.messageBoard.question, role: this.messageBoard.role, submitTitle: '【优软商城】IC电子元器件现货采购交易平台商城', submitUrl: window.location.href, type: this.messageBoard.type, imgs: this.dialogImageUrl, userTel: '13333333333'})
         if (this.messageBoard) {
           if (!this.messageBoard.question) {
-            Message.info('您还没有填写反馈内容')
+            this.$message.info('您还没有填写反馈内容')
           } else if (!this.messageBoard.role) {
-            Message.info('请选择您的身份信息')
+            this.$message.info('请选择您的身份信息')
           } else if (!this.messageBoard.type) {
-            Message.info('请选择一种反馈类型')
+            this.$message.info('请选择一种反馈类型')
           } else if (!this.user) {
             if (!this.messageBoard.userTel && !this.messageBoard.email) {
-              Message.info('请填写任意一种联系方式')
+              this.$message.info('请填写任意一种联系方式')
             }
           } else {
             this.$store.dispatch('uploadMessageBoardInformation', {question: this.messageBoard.question, role: this.messageBoard.role, submitTitle: '【优软商城】IC电子元器件现货采购交易平台商城', submitUrl: window.location.href, type: this.messageBoard.type, imgs: this.dialogImageUrl, userTel: '13333333333'})
             this.isOpendMessage()
-            Message.info('感谢您的宝贵意见')
+            this.$message.info('感谢您的宝贵意见')
 //            window.location.reload()
             this.messageBoard = {}
           }

+ 0 - 1
components/product/ComponentGoods.vue

@@ -174,7 +174,6 @@
 </script>
 
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   .product-list{
     width: 1190px;
     margin-bottom: 20px;

+ 0 - 1
components/product/brand/BrandComponent.vue

@@ -98,7 +98,6 @@
   }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   .component-list {
     float: left;
     margin-left: 20px;

+ 0 - 1
components/product/brand/CategoriesList.vue

@@ -114,7 +114,6 @@
   }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   /*  产品分类调整*/
   .el-tree {
     border: none;

+ 0 - 1
components/product/component/ComponentDetail.vue

@@ -132,7 +132,6 @@
   }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   .header-text {
     text-align: center;
     font-size: 20px;

+ 0 - 1
components/provider/Suppliers.vue

@@ -137,7 +137,6 @@ export default {
 }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   .el-pagination .el-pager li.active{
     background-color: #5078cb;
     border-color: #337ab7;

+ 2 - 3
components/store/CommodityInfo.vue

@@ -136,7 +136,6 @@ function initFragment (commodity) {
   }
   return fragment
 }
-import {Message} from 'element-ui'
 function getFragment (commodity, fragment) {
   // 判断是否小于第一分段的起订量
   if (commodity.prices[0].start > fragment.num) {
@@ -254,12 +253,12 @@ export default {
               .then(response => {
                 console.log(response.data)
                 if (response.data.success) {
-                  Message({
+                  this.$message({
                     message: '添加购物车成功',
                     type: 'success'
                   })
                 } else {
-                  Message.error(response.data.message)
+                  this.$message.error(response.data.message)
                   // console.log(response.data.message)
                 }
               })

+ 0 - 1
components/store/CommodityList.vue

@@ -216,7 +216,6 @@ export default {
 }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
 /*  产品分类调整*/
   .category-content .el-tree{
     border: none;

+ 0 - 1
components/store/common/StoreHeader.vue

@@ -129,7 +129,6 @@ export default {
 }
 </script>
 <style scoped>
-  @import "~element-ui/lib/theme-default/index.css";
   body{
 		font-family: "Microsoft Yahei", "微软雅黑";
 	}

+ 1 - 1
nuxt.config.js

@@ -85,7 +85,7 @@ module.exports = {
       })
     ]
   },
-  css: [ {src: 'bootstrap/dist/css/bootstrap.min.css'},
+  css: [
     /* {
     src: 'font-awesome/css/font-awesome.css'
   }, */{src: '~assets/scss/app.scss', lang: 'scss'}/* , {

+ 3 - 1
plugins/element-ui.js

@@ -1,5 +1,5 @@
 import Vue from 'vue'
-import { Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog } from 'element-ui'
+import { Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog, Message } from 'element-ui'
 
 Vue.use(Breadcrumb)
 Vue.use(BreadcrumbItem)
@@ -7,3 +7,5 @@ Vue.use(Tree)
 Vue.use(Pagination)
 Vue.use(Upload)
 Vue.use(Dialog)
+
+Vue.prototype.$message = Message