wangcz 8 жил өмнө
parent
commit
5ce6ecc097

+ 17 - 5
pages/mobile/search/_keycode.vue

@@ -5,7 +5,7 @@
       <span :class="activeType=='support'?'active':''" @click="clickType('support')">店铺自营</span>
     </div>
 
-    <div class="brand-list-content" v-if="!productList.brands && productList.components[0].brands">
+    <div class="brand-list-content" v-if="!productList.brands && productList.expose">
       <div class="brand-list-top">
         <span>品牌墙</span>
         <span @click="onclick()">展开<i class="iconfont icon-arrow-down"></i></span>
@@ -36,12 +36,12 @@
           <p>型号:<span>{{item.code}}</span></p>
           <p>品牌:<span>{{item.brand.nameCn}}</span></p>
           <p>产品描述:<span>{{item.kind.nameCn}}</span></p>
-          <i class="iconfont icon-shoucang"></i>
+          <i class="iconfont icon-shoucang" :style="(item.isFocus==='true')?'color:#ff7800':'color:#333'"></i>
         </div>
       </nuxt-link>
     </div>
 
-    <div class="none-state" v-if="!productList.components[0].brands">
+    <div class="none-state" v-if="!productList.expose">
       <img src="/images/mobile/@2x/sousuokongzhuangtai@2x.png">
     </div>
   </div>
@@ -58,7 +58,8 @@
         page: '',
         sorting: {},
         isShow: true,
-        isMove: ''
+        isMove: '',
+        isFocus: false
       }
     },
     fetch ({store, route}) {
@@ -69,7 +70,17 @@
     },
     computed: {
       productList () {
-        return this.$store.state.searchData.searchList.lists.data
+//        const listData = this.$store.state.provider.stores.storeList.data
+//        for (let i = 0; i < listData.components.length; i++) {
+//          this.$http.get('/trade/storeFocus/ifFocus?storeid=' + listData.components[i].id)
+//            .then(
+//              function (response) {
+//                listData.components[i].isFocus = response.data
+//              }
+//            )
+//        }
+//        return listData
+        return this.$store.state.provider.stores.storeList.data
       },
       brandList () {
         return this.$store.state.searchData.searchBrands.brands.data
@@ -85,6 +96,7 @@
       clickType (type) {
         if (type === 'store') {
           this.activeType = 'store'
+          this.$store.dispatch('searchData/searchForList', {count: 15, filter: {}, keyword: this.$route.query.w, page: 1, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}})
         }
         if (type === 'support') {
           this.activeType = 'support'

+ 14 - 3
pages/mobile/shop/index.vue

@@ -21,7 +21,7 @@
           <p>电话:<span>{{item.enterprise.enTel}}</span></p>
           <p>传真:<span>{{item.enterprise.enFax}}</span></p>
           <p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.uuid">点击查看</nuxt-link></p>
-          <i class="iconfont icon-shoucang" ></i>
+          <i class="iconfont icon-shoucang" :style="(item.isFocus==='false')?'color:#ff7800':'color:#333'"></i>
         </div>
       </div>
     </div>
@@ -37,7 +37,8 @@
         count: '',
         types: '',
         down: false,
-        downName: '全部'
+        downName: '全部',
+        isFocus: true
       }
     },
     fetch ({ store }) {
@@ -47,7 +48,17 @@
     },
     computed: {
       list () {
-        return this.$store.state.provider.stores.storeList.data
+        const listData = this.$store.state.provider.stores.storeList.data
+        for (let i = 0; i < listData.content.length; i++) {
+          this.$http.get('/trade/storeFocus/ifFocus?storeid=' + listData.content[i].id)
+            .then(
+              function (response) {
+                listData.content[i].isFocus = response.data
+                console.log(listData.content[i])
+              }
+            )
+        }
+        return listData
       }
     },
     methods: {

+ 33 - 10
pages/mobile/user/_uuid.vue

@@ -11,17 +11,17 @@
       </ul>
     </div>
 
-    <div class="shop-list" v-if="isShop">
-      <h3>{{}}</h3>
+    <div class="shop-list" v-if="isShop" v-for="item in focusPage.content">
+      <h3>{{item.storeName}}</h3>
       <div class="list-item">
         <div class="item-img">
           <i></i>
-          <img src="/images/component/default.png" alt="">
+          <img :src="item.storeInfo.logoUrl || '/images/component/default.png'">
         </div>
         <div class="list-item-phone">
-          <p>电话:<span>0755-1234567</span></p>
-          <p>传真:<span>0755-1234567</span></p>
-          <p>商家介绍: <nuxt-link to="/">点击查看</nuxt-link></p>
+          <p>电话:<span>{{item.storeInfo.enterprise.enTel}}</span></p>
+          <p>传真:<span>{{item.storeInfo.enterprise.enFax}}</span></p>
+          <p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.storeInfo.uuid">点击查看</nuxt-link></p>
           <i class="iconfont icon-shoucang"></i>
         </div>
       </div>
@@ -37,6 +37,10 @@
         </div>
       </nuxt-link>
     </div>
+
+    <div class="none-state" v-if="!(collectSave.content && focusPage.content)">
+      <img src="/images/mobile/@2x/shoucangkongzhuangtai@2x.png">
+    </div>
   </div>
 </template>
 
@@ -59,7 +63,7 @@
       return Promise.all([
         store.dispatch('product/saveStores', { count: 25, page: 1, type: 'component' }),
         store.dispatch('loadUserInfo'),
-        store.dispatch('shop/StoreFocusList', { count: 5, page: 1 })
+        store.dispatch('shop/StoreFocusPage', { count: 5, page: 1 })
       ])
     },
     methods: {
@@ -93,6 +97,9 @@
       },
       loadUserInfo () {
         return this.$store.state.option.user.data
+      },
+      focusPage () {
+        return this.$store.state.shop.storeInfo.focusPage.data
       }
     }
   }
@@ -101,8 +108,20 @@
 <style scoped lang="scss">
   .user-content{
     margin-bottom: .98rem;
-    min-height: 10rem;
-    background: #e2e4e6;
+    background: #dfe2e4;
+
+    .none-state{
+      text-align: center;
+      padding:1.5rem 0;
+      background: #fff;
+      margin-top:.1rem;
+      width:100%;
+      img{
+        margin:0 auto;
+        width:3rem;
+        hight:3rem;
+      }
+    }
     .user-name{
       padding:.14rem .38rem .09rem .34rem;
       background:#fff;
@@ -149,6 +168,9 @@
       background:#fff;
       margin-top:.12rem;
       padding-bottom:.28rem;
+      &:hover{
+         background: #e1e1e1;
+       }
       h3{
         font-size:.32rem;
         line-height: .8rem;
@@ -200,8 +222,9 @@
     .detail-brand{
       background: #f8fcff;
       width:100%;
+      margin-top:.12rem;
       min-height:1.5rem;
-      padding-top:.2rem;
+      padding:.2rem 0;
       .brand-item{
         width:7rem;
         margin:0 auto;

+ 10 - 0
store/shop.js

@@ -112,5 +112,15 @@ export const actions = {
       }, err => {
         commit('storeInfo/GET_FOCUS_FAILURE', err)
       })
+  },
+  // 根据UUID获取收藏店铺信息
+  StoreFocusPage ({commit}, params = {}) {
+    commit('storeInfo/REQUEST_FOCUSPAGE')
+    return axios.get(`/trade/storeFocus/page`, {params})
+      .then(response => {
+        commit('storeInfo/GET_FOCUSPAGE_SUCCESS', response.data)
+      }, err => {
+        commit('storeInfo/GET_FOCUSPAGE_FAILURE', err)
+      })
   }
 }

+ 14 - 0
store/shop/storeInfo.js

@@ -29,6 +29,10 @@ export const state = () => ({
   focusList: {
     fetching: false,
     data: {}
+  },
+  focusPage: {
+    fetching: false,
+    data: {}
   }
 })
 
@@ -102,5 +106,15 @@ export const mutations = {
   GET_FOCUSLIST_SUCCESS (state, result) {
     state.focusList.fetching = false
     state.focusList.data = result
+  },
+  REQUEST_FOCUSPAGE (state) {
+    state.focusPage.fetching = true
+  },
+  GET_FOCUSPAGE_SUCCESS (state, result) {
+    state.focusPage.fetching = false
+    state.focusPage.data = result
+  },
+  GET_FOCUSPAGE_FAILURE (state) {
+    state.focusPage.fetching = false
   }
 }