Browse Source

Merge remote-tracking branch 'origin/master'

yingp 8 years ago
parent
commit
43d7d43138

+ 1 - 0
app.html

@@ -5,6 +5,7 @@
   <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"/>
+  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css"/>
   {{ HEAD }}
   <script>
     (function (w, d) {

+ 8 - 1
components/home/Carousel.vue

@@ -32,13 +32,20 @@
           mousewheelControl: false,
           effect: 'fade',
           lazyLoading: true,
+          loop: true,
           prevButton: '.swiper-button-prev',
           nextButton: '.swiper-button-next',
           onTransitionStart: (swiper) => {
             // 不要通过vue刷新dom,会导致pagination无法刷新
             // this.activeSlide = swiper.activeIndex
+            if (this.banners.data.length && swiper.activeIndex > this.banners.data.length) {
+              swiper.activeIndex = 1
+            }
+            if (this.banners.data.length && swiper.activeIndex <= 0) {
+              swiper.activeIndex = this.banners.data.length
+            }
             document.querySelector('.carousel').style.backgroundColor =
-              this.banners.data[swiper.activeIndex].metadata['background-color']
+              this.banners.data[swiper.activeIndex - 1].metadata['background-color']
           }
         }
       }

+ 45 - 9
components/product/BrandList.vue

@@ -26,29 +26,57 @@
 </template>
 
 <script>
+  function sortList (letter) {
+    return function (a, b) {
+      var value1 = a[letter]
+      var value2 = b[letter]
+      if (value1 > value2) {
+        return 1
+      } else if (value1 < value2) {
+        return -1
+      } else {
+        return 0
+      }
+    }
+  }
   export default {
     name: 'brandList',
     computed: {
       brandList () {
-        return this.$store.state.product.brand.brandList.data
+        let brandsList = this.$store.state.product.brand.brandList.data
+        if (brandsList) {
+          for (let i in brandsList) {
+            brandsList[i] = brandsList[i].sort(sortList('nameEn'))
+          }
+        }
+        let temp = {}
+        let keys = []
+        for (let key in brandsList) {
+          keys.push(key)
+        }
+        keys = keys.sort()
+        for (let i = 0; i < keys.length; i++) {
+          temp[keys[i]] = brandsList[keys[i]]
+        }
+        return temp
       }
     }
   }
 </script>
 
-<style scoped>
+<style>
   /** brandList*/
   #brandsList {
     clear: both;
     width: 1190px;
-    padding: 0px;
+    padding: 0;
   }
 
   #brandsList .hr-blue {
     border-bottom: 2px solid #6493FF;
-    border-right: 0px;
-    border-top: 0px;
-    border-left: 0px;
+    border-right: 0;
+    border-top: 0;
+    border-left: 0;
     width: 100%;
   }
 
@@ -57,7 +85,7 @@
   }
 
   #brandsList .row {
-    margin: 20px 0px;
+    margin: 20px 0;
   }
 
   #brandsList .row .initial {
@@ -67,7 +95,7 @@
     color: #787878;
   }
 
-  #brandsList .row .initial:hover{
+  #brandsList .row .initial:hover a,#brandsList .row li.initial.active a {
     color: #5078CB;
     font-weight: bold;
     cursor: pointer;
@@ -77,7 +105,15 @@
     color: #5078CB;
     font-weight: bold;
   }
-
+  #brandsList .row .initial a{
+    font-size: 16px;
+    color: #787878;
+  }
+  #brandsList .row .initial:hover a{
+    color: #5078CB;
+    font-weight: bold;
+    cursor: pointer;
+  }
   #brands .container {
     width: 1190px;
     padding: 0px;

+ 8 - 3
components/product/ComponentGoods.vue

@@ -147,7 +147,8 @@
         this.pageParams.page = 1
         this.pageCmpGoods(this.pageParams)
       },
-      async pageCmpGoods (pageParams) {
+//      async pageCmpGoods (pageParams) {
+      pageCmpGoods (pageParams) {
         let params = {}
         params.filter = { kindid: pageParams.filter.kindid }
         if (pageParams.filter.brandid && pageParams.filter.brandid !== '') {
@@ -158,8 +159,12 @@
         }
         params.page = pageParams.page
         params.count = pageParams.count
-        let { data } = await this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
-        this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', data)
+//        let { data } = await this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
+//        this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', data)
+        this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
+          .then(response => {
+            this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', response.data)
+          })
       },
       handleCurrentChange (page) {
         this.pageParams.page = page

+ 7 - 3
components/product/brand/BrandComponent.vue

@@ -84,9 +84,13 @@
         this.pageParams.page = 1
         this.pageCmpGoods(this.pageParams)
       },
-      async pageCmpGoods (params) {
-        let { data } = await this.$http.get('/api/product/component/list', { params })
-        this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', data)
+//      async pageCmpGoods (params) {
+      pageCmpGoods (params) {
+//        let { data } = await this.$http.get('/api/product/component/list', { params })
+//        this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', data)
+        this.$http.get('/api/product/component/list', { params }).then(response => {
+          this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', response)
+        })
       },
       handleCurrentChange (page) {
         this.pageParams.page = page

+ 12 - 6
components/product/brand/CategoriesList.vue

@@ -102,13 +102,19 @@
         this.pageParams.filter.kindid = data.id
         this.pageCommodity(this.pageParams, this.ids)
       },
-      async pageCommodity (params) {
-        try {
-          let { data } = await this.$http.get('/api/product/component/list', { params })
-          this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', data)
-        } catch (err) {
+//      async pageCommodity (params) {
+      pageCommodity (params) {
+//        try {
+//          let { data } = await this.$http.get('/api/product/component/list', { params })
+//          this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', data)
+//        } catch (err) {
+//          this.$store.commit('brandComponent/GET_COMPONENT_FAILURE', err)
+//        }
+        this.$http.get('/api/product/component/list', { params }).then(response => {
+          this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', response)
+        }, err => {
           this.$store.commit('brandComponent/GET_COMPONENT_FAILURE', err)
-        }
+        })
       }
     }
   }

+ 1 - 1
components/provider/RecommendOriginal.vue

@@ -39,7 +39,7 @@ export default {
 		padding: 0px;
 	}
 
-	#recommends .title-icon {
+  .title-icon {
 	  font-size: 24px;
     color: #323232;
     margin-top: 30px;

+ 7 - 2
components/store/CommodityInfo.vue

@@ -411,8 +411,13 @@ export default {
 	.content .com-info .name {
 		letter-spacing: 15px;
 	}
-
-	.commodity-info-detail {
+  .content .com-info a{
+    color: #1162a4;
+  }
+  .content .com-info:hover a{
+    color: #23527c;
+  }
+  .commodity-info-detail {
 		float: left;
 		padding-top: 10px;
 		width: 582px;

+ 12 - 6
components/store/CommodityList.vue

@@ -183,17 +183,23 @@ export default {
       this.pageParams.page = 1
       this.pageCommodity(this.pageParams, this.ids, keyword)
     },
-    async pageCommodity (pageParams, kindId, keyword) {
+//    async pageCommodity (pageParams, kindId, keyword) {
+    pageCommodity (pageParams, kindId, keyword) {
       let params = { storeid: this.$route.params.uuid, origin: 'store', kindUuid: kindId, code: keyword }
       params.page = pageParams.page
       params.count = pageParams.count
 
-      try {
-        let { data } = await this.$http.get('/api/commodity/commodities', { params })
-        this.$store.commit('shop/storeInfo/GET_STORE_COMMODITY_SUCCESS', data)
-      } catch (err) {
+//      try {
+//        let { data } = await this.$http.get('/api/commodity/commodities', { params })
+//        this.$store.commit('shop/storeInfo/GET_STORE_COMMODITY_SUCCESS', data)
+//      } catch (err) {
+//        this.$store.commit('shop/storeInfo/GET_STORE_COMMODITY_FAILURE', err)
+//      }
+      this.$http.get('/api/commodity/commodities', { params }).then(response => {
+        this.$store.commit('shop/storeInfo/GET_STORE_COMMODITY_SUCCESS', response)
+      }, err => {
         this.$store.commit('shop/storeInfo/GET_STORE_COMMODITY_FAILURE', err)
-      }
+      })
     },
     handleCurrentChange (page) {
       this.pageParams.page = page

+ 2 - 2
components/store/RecommendProduct.vue

@@ -63,10 +63,10 @@
                   console.log(err)
                 })
             } else {
+              console.log(item)
               // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
-              axios.post('trade/cart/add', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
+              axios.post('trade/cart/add', {uuid: item.comUuid, batchCode: item.batchCode, number: item.minBuyQty, currencyName: item.currency})
                 .then(response => {
-                  console.log(response.data)
                   if (response.data.success) {
                     this.$message({
                       message: '添加购物车成功',

+ 4 - 4
nuxt.config.js

@@ -74,10 +74,10 @@ module.exports = {
   css: [
     /* {
     src: 'font-awesome/css/font-awesome.css'
-  }, */{src: '~assets/scss/app.scss', lang: 'scss'},
-    {
+  }, */{src: '~assets/scss/app.scss', lang: 'scss'}
+    /* {
       src: 'swiper/dist/css/swiper.css'
-    } /* , {
+    } */ /* , {
       src: 'element-ui/lib/theme-default/index.css'
     } */
   ],
@@ -106,5 +106,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/platform-b2c**', '/store**', '/order/proxy**', '/report/**', '/store/**#/', '/kdn/**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/', '/kdn/**', '/product/**Submit']
 }