Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mall-web-ssr into HEAD

yangc 8 years ago
parent
commit
a7d25f5b51

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

@@ -58,7 +58,7 @@
     margin: 0;
     width: 82px;
     height: 70px;
-    border: 1px solid #999;
+    border: transparent;
     border-radius: 0;
   }
   .el-upload-list--picture-card .el-upload-list__item-thumbnail {

+ 95 - 57
components/product/component/StoreInfo.vue

@@ -3,11 +3,11 @@
     <div class="form-group">
       <div class="storeIns">
         <div class="sign">选择商家:</div>
-        <div class="storeInList" v-for="item in store">
-          <div :class="{'storeIn-active' : item.isSelected, 'item' : !item.isSelected}">
-          <a>
-            <img :src="item.logoUrl || '/images/component/default.png'" :alt="item.storeName" :title="item.storeName">
-          </a>
+        <div class="storeInList" v-for="storeIn in store">
+          <div class="choose" :class="{'storeIn-active' : storeIn.isSelected, 'storeIn' : !storeIn.isSelected}" @click="addStore(storeIn)">
+            <a class="storeLogo">
+              <img :src="storeIn.logoUrl || '/images/component/default.png'" :alt="storeIn.storeName" :title="storeIn.storeName">
+            </a>
           </div>
         </div>
         <div class="storeInList" style="font-size: 14px" v-if="!store || store.length == 0">
@@ -20,12 +20,12 @@
         <div style="font-size: 14px">
           <span>产品匹配:</span>
           <span v-if="store && store.length > 0">
-            <input type="checkbox">
-            <span>&nbsp;库存寄售</span>
-            <input type="checkbox">
-            <span>&nbsp;店铺自营</span>
+            <input type="checkbox" v-if="storeExist && UmallExist">
+            <span v-if="UmallExist">&nbsp;库存寄售</span>
+            <input type="checkbox" v-if="storeExist && UmallExist">
+            <span v-if="storeExist">&nbsp;店铺自营</span>
           </span>
-          <span v-if="!store || store.length == 0">暂无可匹配的信息</span>
+          <span v-if="!store || store.length == 0">暂无可匹配的信息 </span>
         </div>
       </div>
     </div>
@@ -117,6 +117,13 @@
   import Buy from '~components/common/buyOrCar/buyComponent.vue'
   export default {
     name: 'StoreInfo',
+    data () {
+      return {
+        storeIds: [],
+        UmallExist: false,
+        storeExist: false
+      }
+    },
     components: {
       Buy
     },
@@ -137,31 +144,62 @@
       store () {
         return this.stores.data
       },
-      storeLists () {
-        return this.$store.state.componentInformation.information
-      },
       storeList () {
-        return this.storeLists.data
+        let storeList = this.$store.state.componentInformation.information.data
+        if (storeList.storeid && storeList.storeid !== '') {
+          this.storeIds = storeList.storeid
+        }
+        this.storeId
+        if (this.storeIds.length > 0) {
+          if (this.storeIds.indexOf(this.storeId) === -1) {
+            this.storeExist = true
+          } else {
+            this.storeIds.splice(this.storeIds.indexOf(this.storeId), 1)
+            if (this.storeIds.length > 0) {
+              this.storeExist = true
+            }
+            this.UmallExist = true
+          }
+        }
+        return storeList
+      },
+      storeId () {
+        let UmallStoreId = this.$store.state.componentUmallStoreId.storeId.data
+        return UmallStoreId
+      }
+    },
+    methods: {
+      addStore (storeIn) {
+        if (this.storeIds.indexOf(storeIn.uuid) !== -1) {
+          this.storeIds.splice(this.storeIds.indexOf(storeIn.uuid), 1)
+          storeIn.isSelected = false
+        } else {
+          this.storeIds.push(storeIn.uuid)
+          storeIn.isSelected = true
+        }
       }
     }
   }
 </script>
 <style scoped>
-  .container .storeIns{
+  .storeInfo .storeIns{
     margin-top: 20px;
     width: 1190px;
     height: 48px;
     line-height: 48px;
   }
-  .container .storeIns .sign {
+  .storeInfo .storeIns .sign {
     display: table-cell;
     vertical-align: middle;
     font-size: 14px;
   }
-  .container .storeIns .storeInList {
+  .storeInfo .storeIns .storeInList {
     display: table-cell;
   }
-  .container .storeIn {
+  .storeInfo .choose {
+    border: 1px solid #ccc;
+  }
+  .storeInfo .storeIn {
     width: 98px;
     height: 49px;
     line-height: 30px;
@@ -172,7 +210,7 @@
     margin-right: 15px;
     cursor: pointer;
   }
-  .container .storeIn-active {
+  .storeInfo .storeIn-active {
     width: 98px;
     float: left;
     border: 1px solid #5078cb;
@@ -181,22 +219,22 @@
     margin-right: 15px;
     cursor: pointer;
   }
-  .container .storeIn a,.componentDetail .storeIn-active a {
+  .storeInfo .storeIn a,.componentDetail .storeIn-active a {
     display: table-cell;
     height: 46px;
     width: 98px;
     text-align: center;
     vertical-align: middle;
   }
-  .storeIn a>img,.storeIn-active a>img {
+  a.storeLogo>img,.storeIn-active a.storeLogo>img {
     max-width: 95px;
     max-height: 46px;
   }
-  .container .goodsList {
+  .storeInfo .goodsList {
     clear: both;
     font-size: 14px;
   }
-  .container .goodsList .goods-item {
+  .storeInfo .goodsList .goods-item {
     height: 30px;
     width: 120px;
     background-color: #5078cb;
@@ -205,68 +243,68 @@
     vertical-align: middle;
     line-height: 30px;
   }
-  .container .goodsList thead {
+  .storeInfo .goodsList thead {
     background-color: #F7F7F7;
   }
-  .container .goodsList tbody tr td{
+  .storeInfo .goodsList tbody tr td{
     vertical-align: middle;
     text-align: center;
   }
-  .container .goodsList tbody tr td:hover a{
+  .storeInfo .goodsList tbody tr td:hover a{
     color: #474443;
   }
-/*  .container .goodsList .btn{
-    border-radius: 4px;
-    width: 80px;
-    height: 30px;
-    color: #214797;
-    font-size: 14px;
-    line-height: 14px;
-    text-align: center;
-    margin: 5px 0;
-    padding: 0;
-    user-select: none;
-    background-image: none;
-    border: 1px solid transparent;
-    font-weight: 400;
-  }
-  .container .goodsList .btn-buyNow {
-    color: #fff;
-    background-color: #5078cb;
-  }
-  .container .goodsList .btn-default{
-    background-color: #fff;
-    border-color: #ccc;
-  }*/
-  .container .form-group input{
+  /*.storeInfo .goodsList .btn{*/
+    /*border-radius: 4px;*/
+    /*width: 80px;*/
+    /*height: 30px;*/
+    /*color: #214797;*/
+    /*font-size: 14px;*/
+    /*line-height: 14px;*/
+    /*text-align: center;*/
+    /*margin: 5px 0;*/
+    /*padding: 0;*/
+    /*user-select: none;*/
+    /*background-image: none;*/
+    /*border: 1px solid transparent;*/
+    /*font-weight: 400;*/
+  /*}*/
+  /*.storeInfo .goodsList .btn-buyNow {*/
+    /*color: #fff;*/
+    /*background-color: #5078cb;*/
+  /*}*/
+  /*.storeInfo .goodsList .btn-default{*/
+    /*background-color: #fff;*/
+    /*border-color: #ccc;*/
+  /*}*/
+  .storeInfo .form-group input{
     vertical-align: sub;
   }
-  .container .height54{
+  .storeInfo .height54{
     height: 54px;
     background: none;
     color: #333;
   }
-  .container .height54 th{
+  .storeInfo .height54 th{
     line-height: 54px;
     border-bottom: none;
     padding: 0;
   }
-  .container .table tbody td{
+  .storeInfo .table tbody td{
     border-bottom: #ddd 1px solid;
     border-top: none;
   }
-  .container .table tbody{
+  .storeInfo .table tbody{
     border-left: #ddd 1px solid;
     border-right: #ddd 1px solid;
   }
-  .container .table tbody td div{
+  .storeInfo .table tbody td div{
     text-align: center;
     margin-left: 10%;
   }
-  .container .table tbody tr:hover{
+  .storeInfo .table tbody tr:hover{
     background: #f5f5f5;
   }
-  .container .table tbody tr:hover{
+  .storeInfo .table tbody tr:hover{
     background: #f5f5f5;
   }
 </style>

+ 3 - 13
store/index.js

@@ -1,4 +1,4 @@
-import axios from '~plugins/axios'
+import axios from '~plugins/axios'
 
 // 获取品牌详情产品分类信息
 function loadBrandCategories ({commit}, params = {}) {
@@ -259,9 +259,9 @@ export const actions = {
     commit('brandPages/REQUEST_PAGES', params)
     return axios.get('/api/product/PAGES/list', { params })
       .then(response => {
-        commit('brandPages/GET_PAGES_SUCCESS', response.data)
+        commit('brandPages/GET__SUCCESS', response.data)
       }, err => {
-        commit('brandPages/GET_PAGES_FAILURE', err)
+        commit('brandPages/GET_COMPONENT_FAILURE', err)
       })
   },
   // 留言板
@@ -297,16 +297,6 @@ export const actions = {
         commit('messageBoardInformation/GET_INFORMATION_FAILURE', err)
       })
   },
-  // // 上传图片
-  // uploadImg ({commit}) {
-  //   commit('uploadImg/REQUEST_IMG')
-  //   return axios.post('/api/images')
-  //     .then(response => {
-  //       commit('uploadImg/GET_IMG_SUCCESS', response.data)
-  //     }, err => {
-  //       commit('uploadImg/GET_IMG_FAILURE', err)
-  //     })
-  // },
   // 获取帮助中心信息
   loadHelpSnapsho ({ commit }, params = {}) {
     commit('help/REQUEST_SNAPSHO')