Browse Source

Merge branch 'master' into release-20170915

yangc 8 years ago
parent
commit
85a2025bd1

+ 8 - 0
assets/scss/common.scss

@@ -618,3 +618,11 @@ div.el-tree-node__content{
   padding: 14px !important;
 }
 
+a {
+  color: #2d8cf0;
+  background: 0 0;
+  text-decoration: none;
+  outline: 0;
+  cursor: pointer;
+  transition: color .2s ease;
+}

+ 19 - 3
components/common/page/pageComponent.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="page-wrap" v-if="total/1.0/pageSize>1">
     <el-pagination
-      :current-page.sync="current"
+      :current-page.sync="nowPage"
       :page-size="pageSize"
       layout="prev, pager, next"
       :total="total"
@@ -23,7 +23,7 @@
   export default {
     data () {
       return {
-        nowPage: this.current
+        nowPage: 1
       }
     },
     watch: {
@@ -44,7 +44,7 @@
 </script>
 
 <style>
-  a {
+  .page-wrap a {
     color: #2d8cf0;
     background: 0 0;
     text-decoration: none;
@@ -52,8 +52,21 @@
     cursor: pointer;
     transition: color .2s ease;
   }
+  .el-pagination {
+    padding: 0;
+  }
   .el-pagination .btn-next, .el-pagination .btn-prev {
     color: #337ab7;
+    width: 33px;
+    height: 30px;
+  }
+  .el-pagination .btn-next {
+    border-top-right-radius: 4px;
+    border-bottom-right-radius: 4px;
+  }
+  .el-pagination .btn-prev {
+    border-top-left-radius: 4px;
+    border-bottom-left-radius: 4px;
   }
   .el-pager li{
     color: #337ab7;
@@ -61,6 +74,9 @@
     background-color: #fff;
     border: 1px solid #ddd;
     font-size: 10px;
+    width: 33px;
+    height: 30px;
+    border-right: none;
   }
   .el-pager li:not(.active):hover, .el-pagination button:hover {
     z-index: 3;

+ 1 - 1
components/main/count/Item.vue

@@ -19,7 +19,7 @@
     methods: {
       formatNumber (num) {
         let re = /(\d+)(\d{3})/
-        num = (Array(10 - String(num).length).join(0) + num)
+        num = (Array(Math.max(0, 10 - String(num).length)).join(0) + num)
         while (re.test(num)) {
           num = num.replace(re, '$1,$2')
         }

+ 12 - 9
components/product/component/StoreInfo.vue

@@ -46,12 +46,12 @@
           </tr>
         </thead>
         <tbody class="text-center">
-          <tr style="cursor: pointer;" v-for="list in storeList.content">
-            <td><a :href="'/store/' + list.storeid + '/' + list.batchCode">{{list.code}}</a></td>
-            <td><a :href="'/store/' + list.storeid + '/' + list.batchCode">{{list.produceDate}}</a></td>
-            <td><a :href="'/store/' + list.storeid + '/' + list.batchCode">{{list.packaging || '暂无包装方式'}}</a></td>
+          <tr style="cursor: pointer;" v-for="list in storeList.content" @click="goProductDetail(list.storeid, list.batchCode)">
+            <td><a>{{list.code}}</a></td>
+            <td><a>{{list.produceDate}}</a></td>
+            <td><a>{{list.packaging || '暂无包装方式'}}</a></td>
             <td style="text-align: left;padding-left: 25px;">
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div>
                   <span>库存:</span>
                   <span>{{list.reserve}}</span>
@@ -67,14 +67,14 @@
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-for="price in list.prices">
                   <span>{{price.start}}</span>+
                 </div>
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-show="list.currencyName.indexOf('USD')==-1 || !list.prices">
                   <span>—</span>
                 </div>
@@ -84,7 +84,7 @@
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-show="list.currencyName.indexOf('RMB')==-1 || !list.prices">
                   <span>—</span>
                 </div>
@@ -94,7 +94,7 @@
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-show="list.b2cMinDelivery">
                   <span>交期:</span>
                   <span>{{list.b2cMinDelivery}}</span>
@@ -216,6 +216,9 @@
           this.params.filter.ignoreStore = !this.params.filter.ignoreStore
         }
         this.$store.dispatch('loadComponentInformation', this.params)
+      },
+      goProductDetail: function (storeid, batchcode) {
+        window.location.href = '/store/' + storeid + '/' + batchcode
       }
     }
   }

+ 1 - 1
components/provider/NewStore.vue

@@ -107,7 +107,7 @@ export default {
         height: 50px;
         display: inline-block;
         text-align: center;
-        line-height: 50px;
+        line-height: 45px;
         border: #e8e8e8 1px solid;
 
         img {

+ 2 - 2
components/provider/Suppliers.vue

@@ -14,8 +14,8 @@
           </div>
         </td>
         <td width="150" style="vertical-align: middle"><span>入驻商家:</span><span class="text-message">{{stores ? stores.totalElements : 0}}</span><span>家</span></td>
-        <td width="150">
-          <a href="/vendor#/store-apply"><button class="btn btn-primary" style="margin-left: 6px;">立即入驻</button></a>
+        <td width="150" style="vertical-align: middle;">
+          <a href="/vendor#/store-apply" style="width: 100px; height: 30px; display: inline-block;"><button class="btn btn-primary" style="margin-left: 6px;">立即入驻</button></a>
         </td>
       </tr>
       </thead>

+ 1 - 1
nuxt.config.js

@@ -106,5 +106,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/release/**', '/auth/store/**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/release/**', '/auth/store/**', '/produce/**']
 }

+ 0 - 1
pages/news/index.vue

@@ -28,7 +28,6 @@
     methods: {
       listenChild: function (nPage) {
         this.nowPage = nPage
-        console.log(this.nowPage)
         this.$store.dispatch('newsData/loadAllNews', { page: this.nowPage, pageSize: this.pageSize })
       }
     }

+ 1 - 1
pages/store/_uuid/_batchCode.vue

@@ -11,7 +11,7 @@ export default {
   layout: 'shop',
   fetch ({ store, route }) {
     return Promise.all([
-      store.dispatch('shop/findStoreInfoFromUuid', route.params),
+//      store.dispatch('shop/findStoreInfoFromUuid', route.params),
       store.dispatch('shop/findCommodityOnBatchInfo', route.params)
     ])
   },

+ 16 - 0
store/shop.js

@@ -10,6 +10,19 @@ function StoreFocusList ({ commit }, params = {}) {
       commit('storeInfo/GET_FOCUSLIST_FAILURE', err)
     })
 }
+// 根据UUID获取某店铺信息
+function findStoreInfoFromUuid ({ commit }, params = {}) {
+  commit('storeInfo/REQUEST_STORE_INFO')
+  return axios.get('/api/store-service/stores', { params })
+    .then(response => {
+      commit('storeInfo/GET_STORE_INFO_SUCCESS', response.data)
+      return Promise.all([
+        StoreFocusList({ commit }, {id: response.data.id})
+      ])
+    }, err => {
+      commit('storeInfo/GET_STORE_INFO_FAILURE', err)
+    })
+}
 
 export const actions = {
   // 根据UUID获取某店铺信息
@@ -35,6 +48,9 @@ export const actions = {
         return axios.get(`/api/commodity/component/${commodity.uuid}`)
           .then(response => {
             commit('storeInfo/GET_COMPONENT_SUCCESS', response.data)
+            return Promise.all([
+              findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
+            ])
           }, err => {
             commit('storeInfo/GET_COMPONENT_FAILURE', err)
           })