Browse Source

正式环境下,未登录点击规格书跳转至登录页面。

yangc 8 years ago
parent
commit
0c0bf35fd0

+ 1 - 1
components/product/ComponentGoods.vue

@@ -25,7 +25,7 @@
         <td>
         <td>
           <!--store/{{compGoods.storeId}}#/batchInfo/{{compGoods.batchCode}}-->
           <!--store/{{compGoods.storeId}}#/batchInfo/{{compGoods.batchCode}}-->
           <nuxt-link v-if="compGoods.batchCode" :to="`/store/${compGoods.storeId}/${compGoods.batchCode}`" target="_blank">
           <nuxt-link v-if="compGoods.batchCode" :to="`/store/${compGoods.storeId}/${compGoods.batchCode}`" target="_blank">
-            <img :src="compGoods.img?compGoods.img:compGoods.brand.logoUrl?compGoods.brand.logoUrl:'/images/all/default.png'"/>
+            <img :src="compGoods.img?compGoods.img:'/images/all/default.png'"/>
           </nuxt-link>
           </nuxt-link>
           <img v-if="!compGoods.batchCode" :src="compGoods.img || '/images/all/default.png'"/>
           <img v-if="!compGoods.batchCode" :src="compGoods.img || '/images/all/default.png'"/>
           <!--store/{{compGoods.storeId}}#/home-->
           <!--store/{{compGoods.storeId}}#/home-->

+ 14 - 2
components/product/component/ComponentDetail.vue

@@ -6,7 +6,7 @@
       </div>-->
       </div>-->
       <div class="detail">
       <div class="detail">
         <div class="component-img">
         <div class="component-img">
-          <img :src="list.img?list.img:list.brand.logoUrl?list.brand.logoUrl:'/images/component/default.png'"/>
+          <img :src="list.img||'/images/component/default.png'"/>
         </div>
         </div>
         <div class="component-message">
         <div class="component-message">
           <div class="message-code">
           <div class="message-code">
@@ -37,7 +37,7 @@
             <div class="form-group row">
             <div class="form-group row">
               <div class="message-item">下载</div>
               <div class="message-item">下载</div>
               <div class="colon">:</div>
               <div class="colon">:</div>
-              <div class="message-body"><a :href="list.attach" v-if="list.attach">规格书</a><span v-if="!list.attach">暂无规格书</span></div>
+              <div class="message-body"><a @click="toAttach(list.attach)" v-if="list.attach">规格书</a><span v-if="!list.attach">暂无规格书</span></div>
             </div>
             </div>
             <div class="form-group">
             <div class="form-group">
                <button type="text" v-if="!collectList" @click="collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</button>
                <button type="text" v-if="!collectList" @click="collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</button>
@@ -115,6 +115,18 @@
             }
             }
           })
           })
         }
         }
+      },
+      toAttach: function (url) {
+        console.log(url)
+        if (url === '1') {
+          this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+            if (response.data) {
+              this.$router.push('/auth/login')
+            }
+          })
+        } else {
+          window.open(url)
+        }
       }
       }
     }
     }
   }
   }

+ 1 - 1
components/search/GoodList.vue

@@ -56,7 +56,7 @@
           <tr v-for="item in good_list.components">
           <tr v-for="item in good_list.components">
             <td>
             <td>
               <nuxt-link class="component-img-box" :to="item.batchCode?`/store/${item.storeId}/${item.batchCode}`:`/product/component/${item.uuid}`">
               <nuxt-link class="component-img-box" :to="item.batchCode?`/store/${item.storeId}/${item.batchCode}`:`/product/component/${item.uuid}`">
-                <img :src="item.img?item.img:item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">
+                <img :src="item.img?item.img:item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">
               </nuxt-link>
               </nuxt-link>
             </td>
             </td>
             <td class="brand-code">
             <td class="brand-code">