Browse Source

店铺关注相关内容

yangc 8 years ago
parent
commit
91652f2a15
1 changed files with 4 additions and 4 deletions
  1. 4 4
      components/mobile/store/StoreDetail.vue

+ 4 - 4
components/mobile/store/StoreDetail.vue

@@ -3,7 +3,7 @@
     <div class="store-logo">
       <div class="store-logo-box">
         <img :src="store.logoUrl || '/images/component/default.png'"/>
-        <i class="iconfont icon-shoucang" :style="isFocus?'color:#ff7800':'color: #ddd'" @click="collectStore"></i>
+        <i class="iconfont icon-shoucang" :style="isFocus === 'true'?'color:#ff7800':'color: #ddd'" @click="collectStore"></i>
       </div>
     </div>
     <div class="store-switch-item">
@@ -129,14 +129,14 @@
         this.$router.push('/mobile/brand/componentDetail/' + uuid)
       },
       collectStore: function () {
-        if (!this.isFocus) {
-          this.$store.dispatch('shop/StoreFocus', {storeName: this.store.storeName, storeid: this.store.uuid})
+        if (this.isFocus === 'false') {
+          this.$store.dispatch('shop/StoreFocus', {storeName: this.store.storeName, storeid: this.store.id})
             .then(response => {
               this.$store.dispatch('shop/StoreFocusList', {id: this.store.id})
               this.collectResult = '收藏成功'
               this.timeoutCount++
             })
-        } else {
+        } else if (this.isFocus === 'true') {
           this.$http.post('/trade/storeFocus/delete/storeId', [this.store.id])
             .then(response => {
               this.$store.dispatch('shop/StoreFocusList', {id: this.store.id})