Browse Source

Merge branch 'master' into feature/yc-mobile-1020

# Conflicts:
#	app.html
#	pages/auth/logout.vue
yangc 8 years ago
parent
commit
7d553d3a1b

+ 1 - 1
Dockerfile

@@ -8,6 +8,6 @@ COPY . /app
 RUN chmod +x run.sh
 
 RUN cnpm install
-#RUN npm run build
+RUN npm run build
 
 CMD [ "/app/run.sh" ]

+ 9 - 0
app.html

@@ -9,6 +9,7 @@
   <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_tnqskb835gs98uxr.css">
   {{ HEAD }}
   <script>
+    var _hmt = _hmt || [];
     (function (w, d) {
       if (/(MSIE)|(Trident)/.test(w.navigator.userAgent)) {
         var head = d.getElementsByTagName('head')[0]
@@ -21,6 +22,12 @@
         appendScript('https://cdn.bootcss.com/html5shiv/r29/html5.min.js')
         appendScript('https://cdn.bootcss.com/js-polyfills/0.1.33/polyfill.min.js')
       }
+      var hm = d.createElement("script");
+      hm.src = "https://hm.baidu.com/hm.js?34793672f88552a77437f2cee7864118;"
+      var s = d.getElementsByTagName("script")[0];
+      s.parentNode.insertBefore(hm, s);
+      var cnzz_protocol = (("https:" == d.location.protocol) ? " https://" : " http://");
+      d.write(unescape("%3Cspan id='cnzz_stat_icon_1267002346'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1267002346%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));
       if (/(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(w.navigator.userAgent)) {
         let meta1 = document.createElement('meta')
         let meta2 = document.createElement('meta')
@@ -47,6 +54,8 @@
       }
     })(window, document)
   </script>
+  <script type="text/javascript">
+  </script>
 </head>
 <body {{ BODY_ATTRS }}>
 {{ APP }}

+ 18 - 0
assets/scss/common.scss

@@ -18,6 +18,11 @@
     background-color: rgba(95,95,95, .7);
   }
 }
+
+#cnzz_stat_icon_1267002346 {
+  display: none;
+}
+
 // common style
 .clearfix {
   &:before, &:after {
@@ -626,3 +631,16 @@ a {
   cursor: pointer;
   transition: color .2s ease;
 }
+.select-adder {
+  background:url("../../static/images/all/xiala.png") right no-repeat #fff !important;
+  background-position-x: 100% !important;
+  /*将默认的select选择框样式清除*/
+  appearance:none;
+  -moz-appearance:none;
+  -webkit-appearance:none;
+  -ms-appearance:none;
+
+}
+.select-adder::-ms-expand {
+  display: none;
+}

+ 1 - 1
components/common/buyOrCar/buyComponent.vue

@@ -13,7 +13,7 @@
         if (!this.$store.state.option.user.logged) {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 6 - 6
components/default/Footer.vue

@@ -71,17 +71,17 @@
           url: 'http://www.usoftchina.com/usoft',
           title: '深圳市优软科技'
         }, {
-          url: 'http://www.fantem.com',
-          title: '丰唐物联技术(深圳)'
+          url: 'http://www.51cube.com',
+          title: '酷比魔方'
         }, {
-          url: 'http://www.hiways.com',
-          title: '深圳市海威思科技'
+          url: 'http://www.szsoling.com/home',
+          title: 'SOLING 索菱'
         }, {
           url: 'http://www.huashangweitai.com',
           title: '深圳市华商维泰显示科技'
         }, {
-          url: 'http://www.ufct.com.cn',
-          title: '联合创泰科技'
+          url: 'http://www.szmadigi.com',
+          title: '迈迪杰科技'
         }]
       }
     }

+ 7 - 5
components/default/Header.vue

@@ -37,7 +37,7 @@
             <!--<a class="item" :href="url + '/user'">买家中心</a>
             <a class="item" :href="url + '/vendor'">卖家中心</a>-->
             <a class="item" href="/user#/index">买家中心</a>
-            <a class="item" href="/vendor#/index">卖家中心</a>
+            <a class="item" href="/vendor#/index" v-if="enterprise.uu">卖家中心</a>
           </template>
           <template v-else>
             <a class="item" @click="onLoginClick()">登录</a>
@@ -77,13 +77,16 @@
     },
     methods: {
       logout () {
-        this.$router.push('/auth/logout')
+        this.$http.get('/logout/crossBefore').then(response => {
+          if (response.data) {
+            window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
       },
       onLoginClick () {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
-//            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
         // TODO 待Account Center改版
@@ -91,7 +94,6 @@
       onRegisterClick () {
         this.$http.get('/register/page').then(response => {
           if (response.data) {
-        //    this.$router.push('/auth/login')
             window.location.href = response.data.content
           }
         })

+ 1 - 1
components/default/RightBar.vue

@@ -148,7 +148,7 @@
       goLogin: function () {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
       },

+ 36 - 9
components/main/Search.vue

@@ -1,6 +1,10 @@
 <template>
   <div class="search-box">
     <div class="input-group">
+      <select @change="onSelectTypeChange" class="form-control select-type select-adder">
+        <option value="">产品</option>
+        <option value="">店铺</option>
+      </select>
       <input v-model="keyword" type="text" class="search-input form-control input-primary"
              placeholder="型号/类目/品牌"
              @focus.stop.prevent="onFocus()"
@@ -12,7 +16,7 @@
         <button class="btn btn-primary search-btn" type="button">搜&nbsp;索</button>
       </span>
     </div>
-    <ul class="association" v-show="showAssociate"
+    <ul class="association" v-show="showAssociate && searchType == 'product'"
         @mouseenter="associate.focus=true" @mouseleave="associate.focus=false">
       <li v-for="(k, index) in similarKeywords.data" :key="k" class="item"
           :class="{'active': index==associate.activeIndex}"
@@ -40,7 +44,8 @@
           show: false,
           activeIndex: null
         },
-        click_flag: false
+        click_flag: false,
+        searchType: 'product'
       }
     },
     computed: {
@@ -82,6 +87,14 @@
       }
     },
     methods: {
+      onSelectTypeChange: function (e) {
+        let type = e.target[e.target.selectedIndex].innerHTML
+        if (type === '产品') {
+          this.searchType = 'product'
+        } else if (type === '店铺') {
+          this.searchType = 'store'
+        }
+      },
       onFocus () {
         this.associate.show = true
       },
@@ -126,7 +139,11 @@
         if (this.keyword) {
           this.associate.show = false
           this.$store.dispatch('resetSearchKeywords')
-          this.$router.push({path: '/search?w=' + encodeURIComponent(this.keyword)})
+          if (this.searchType === 'product') {
+            this.$router.push({path: '/search?w=' + encodeURIComponent(this.keyword)})
+          } else if (this.searchType === 'store') {
+            this.$router.push({path: '/searchStore?w=' + encodeURIComponent(this.keyword)})
+          }
         }
       },
       onAssociateClick (word) {
@@ -146,18 +163,28 @@
     border-radius: 0;
   }
   .search-box {
-    width: 470px;
+    width: 520px;
     height: 40px;
     position: relative;
-
+    .search-input{
+      width: 372px;
+      float: left;
+    }
     .search-input, .search-btn {
       height: 40px;
       border-width: 2px;
     }
-
+    .select-type{
+      width: 70px;
+      float: left;
+      border: #5078cb 2px solid;
+      height: 40px;
+      border-right: none;
+      margin-right: -1px;
+    }
     .search-btn {
       font-size: 16px;
-      width: 78px;
+      width: 79px;
       border-radius: 0;
     }
     .search-hot ul li a{
@@ -177,9 +204,9 @@
 
     .association {
       position: absolute;
-      left: 0;
+      left: 69px;
       top: 100%;
-      right: 79px;
+      right: 81px;
       background: $white;
       border: $border;
       border-top-width: 0;

+ 14 - 14
components/main/count/Box.vue

@@ -32,21 +32,21 @@
       counts () {
         return this.$store.state.product.common.counts
       }
-    },
-    mounted () {
-      this.$nextTick(() => {
-//        this.loadCounts()
-        // 刷新统计信息
-        setInterval(() => {
-          this.loadCounts()
-        }, 30000)
-      })
-    },
-    methods: {
-      loadCounts () {
-        this.$store.dispatch('loadProductCounts', { _status: 'actived' })
-      }
     }
+//    mounted () {
+//      this.$nextTick(() => {
+//        this.loadCounts()
+//        // 刷新统计信息
+//        setInterval(() => {
+//          this.loadCounts()
+//        }, 30000)
+//      })
+//    },
+//    methods: {
+//      loadCounts () {
+//        this.$store.dispatch('loadProductCounts', { _status: 'actived' })
+//      }
+//    }
   }
 </script>
 <style lang="scss" scoped>

+ 4 - 5
components/product/ComponentGoods.vue

@@ -25,9 +25,9 @@
         <td>
           <!--store/{{compGoods.storeId}}#/batchInfo/{{compGoods.batchCode}}-->
           <nuxt-link v-if="compGoods.batchCode" :to="`/store/${compGoods.storeId}/${compGoods.batchCode}`" target="_blank">
-            <img :src="compGoods.img?compGoods.img:'/images/all/default.png'"/>
+            <img :src="compGoods.img?compGoods.img:compGoods.brand&&compGoods.brand.logoUrl?compGoods.brand.logoUrl:'/images/all/default.png'"/>
           </nuxt-link>
-          <img v-if="!compGoods.batchCode" :src="compGoods.img || '/images/all/default.png'"/>
+            <img v-if="!compGoods.batchCode" :src="compGoods.img?compGoods.img:compGoods.brand&&compGoods.brand.logoUrl?compGoods.brand.logoUrl:'/images/all/default.png'"/>
           <!--store/{{compGoods.storeId}}#/home-->
           <nuxt-link :to="'/store/' + compGoods.storeId" class="contact" :title="compGoods.storeName" target="_blank">{{compGoods.storeName}}</nuxt-link>
         </td>
@@ -234,12 +234,11 @@
   .product-list tbody>tr {
     border: 1px solid #e8e8e8;
   }
-
   .product-list tbody>tr img {
     border: 1px solid #e8e8e8;
     margin: 10px 0 5px 0;
-    width: 36px;
-    height: 36px;
+    max-width: 36px;
+    max-height: 36px;
   }
   .product-list tbody>tr .contact{
     font-size: 14px;

+ 3 - 3
components/product/component/ComponentDetail.vue

@@ -6,7 +6,7 @@
       </div>-->
       <div class="detail">
         <div class="component-img">
-          <img :src="list.img||'/images/component/default.png'"/>
+          <img :src="list.img?list.img:list.brand&&list.brand.logoUrl?list.brand.logoUrl:'/images/component/default.png'"/>
         </div>
         <div class="component-message">
           <div class="message-code">
@@ -111,7 +111,7 @@
         } else {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         }
@@ -120,7 +120,7 @@
         if (url === '1') {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 1 - 1
components/provider/NewStore.vue

@@ -57,7 +57,7 @@ export default {
       if (!this.user.logged) {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
       } else {

+ 2 - 2
components/search/Kind.vue

@@ -326,7 +326,7 @@
         this.brand_open = !this.brand_open
       },
       getType: function (arr, obj) {
-        return !(JSON.stringify(arr).indexOf(JSON.stringify(obj)) === -1)
+        return !(JSON.stringify(arr).indexOf(obj.store_type) === -1)
       },
       click_kind: function (id, index) {
         this.kind_arr.push(id)
@@ -447,7 +447,7 @@
         return -1
       },
       crnameInArr: function (arr, obj) {
-        return (JSON.stringify(arr).indexOf(JSON.stringify(obj)) === -1)
+        return (JSON.stringify(arr).indexOf(obj.cr_name) === -1)
       }
     }
   }

+ 179 - 0
components/searchStore/SearchTitle.vue

@@ -0,0 +1,179 @@
+<template>
+  <div class="search-store-title">
+    <span class="search-result">
+      搜索 "
+      <span style="color: #ff0101">{{keyword}}</span>
+      ",为您找到
+      <span v-text="goodsCount">1000</span>
+      家店铺:
+    </span>
+    <div class="tab-filter" >
+      <div class="fr">
+        <div :class="activeType == 0?'active':''" @click="defaultSearch"><a >综合排序</a></div>
+        <!--<div :class="activeType == 1?'active':''"><a >库存</a></div>-->
+        <!--<div :class="activeType == 2?'active':''"><a >销量</a></div>-->
+        <!--<div :class="activeType == 3?'active':''"><a >信用</a></div>-->
+        <div :class="activeType == 4?'active':''">
+          <select @change="onSelectTypeChange" class="form-control select-type select-adder">
+            <option value="">店铺类型</option>
+            <option value="">原厂</option>
+            <option value="">代理</option>
+            <option value="">经销</option>
+            <!--<option value="">寄售</option>-->
+          </select>
+        </div>
+        <!--<div class=""><a >所在地</a></div>-->
+    </div>
+      <!--<div class="off">-->
+        <!--<a @click="showClick">-->
+          <!--<span v-text="show?'收起':'展开'" style="margin-right: 10px;"></span>-->
+          <!--<i v-show="!show" class="fa fa-angle-down"></i>-->
+          <!--<i v-show="show" class="fa fa-angle-up"></i>-->
+        <!--</a>-->
+      <!--</div>-->
+  </div>
+  </div>
+</template>
+<script>
+  export default {
+    props: ['keyword'],
+    data () {
+      return {
+        activeType: 0,
+        paramType: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT',
+        show: true
+      }
+    },
+    computed: {
+      goodsCount () {
+        if (this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores) {
+          return this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores.totalElements || 0
+        } else {
+          return 0
+        }
+      }
+    },
+    methods: {
+      defaultSearch: function () {
+        this.activeType = 0
+        this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+        this.$store.dispatch('searchStore/searchStoreDetail',
+          {
+            page: 1,
+            count: 4,
+            keyword: this.$route.query.w,
+            types: this.paramType,
+            op: 'pageByType'})
+      },
+      onSelectTypeChange: function (e) {
+        let type = e.target[e.target.selectedIndex].innerHTML
+        if (type === '原厂') {
+          this.paramType = 'ORIGINAL_FACTORY'
+        } else if (type === '代理') {
+          this.paramType = 'AGENCY'
+        } else if (type === '经销') {
+          this.paramType = 'DISTRIBUTION'
+        } else if (type === '店铺类型') {
+          this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+        }
+        this.$emit('typeAction', this.paramType)
+        this.$store.dispatch('searchStore/searchStoreDetail',
+          {
+            page: 1,
+            count: 4,
+            keyword: this.$route.query.w,
+            types: this.paramType,
+            op: 'pageByType'})
+        this.activeType = 4
+      },
+      showClick: function () {
+        this.show = !this.show
+        this.$emit('showAction', this.show)
+      }
+    }
+  }
+</script>
+<style>
+  .search-store-title {
+    margin-top: 22px;
+  }
+  .search-store-title .select-type {
+    min-width: 87px;
+  }
+  .tab-filter{
+    width: 1190px;
+    height: 40px;
+    margin-top: 14px;
+    line-height: 40px;
+    background: #f4f8ff;
+    border: 1px solid rgb( 231, 231, 231 );
+    border-bottom: none;
+  }
+  .tab-filter .fl,.tab-filter .fr{
+    float: left;
+  }
+  .tab-filter .fl{
+    font-size: 14px;
+  }
+  .tab-filter .fr{
+    max-width: 1050px;
+    margin-left: 10px;
+  }
+  .tab-filter .fl span{
+    font-size: 14px;
+  }
+  .tab-filter .fr div{
+    float: left;
+    margin-right: 10px;
+  }
+  .tab-filter .fr div.active a, .tab-filter .fr div.active select{
+    border: #5078cb 1px solid;
+    color: #5078cb;
+  }
+  .tab-filter .fr div.active select option {
+    color: #000;
+  }
+  .tab-filter .fr a{
+    display: inline-block;
+    padding: 0 10px;
+    border: #ccc 1px solid;
+    line-height: 30px;
+    font-size: 14px;
+    text-align: center;
+    color: #333;
+    height: 30px;
+    background: #fff;
+  }
+  .tab-filter .fr a i{
+    /*margin-left: 5px;*/
+  }
+  .tab-filter .fr a:hover{
+    border: #5078cb 1px solid;
+    color: #5078cb;
+  }
+  .tab-filter .off{
+    float: right;
+    margin-right: 20px;
+    color: black;
+  }
+  .tab-filter .off a:hover{
+    border: none;
+    color: #5078cb;
+  }
+  .tab-filter .off a{
+    border: none;
+    text-align: right;
+    background: none;
+    color: #333;
+  }
+  .tab-filter .off a i{
+    font-size: 16px;
+  }
+  .tab-filter .fr .form-control{
+    width: 85px;
+    height: 30px;
+    line-height: 30px;
+    border-radius: 0;
+    padding: 0 5px;
+  }
+</style>

+ 317 - 0
components/searchStore/StoreContent.vue

@@ -0,0 +1,317 @@
+<template>
+  <div>
+  <ul class="store-list" v-if="storeData.content && storeData.content.length > 0">
+    <li v-for="(store, index) in storeData.content">
+      <div class="store-content-left">
+        <a :href="'/store/' + store.uuid" target="_blank">
+          <img :src="store.logoUrl?store.logoUrl:'/images/all/default.png'" class="storeImg" alt="">
+        </a>
+        <div class="store-detail">
+          <a :href="'/store/' + store.uuid" target="_blank" :title="store.storeName">{{store.storeName}}</a>
+          <span style="position: relative;" class="call-seller">
+            <img src="static/img/common/songguo.png?_v=1503050008623">
+							<a name="21059" href="javascript:void(0)" class="contact_btn">联系卖家</a>
+          </span>
+          <span class="main-product">
+             <a :href="'/store/' + store.uuid" target="_blank" v-text="'店铺简介:' + store.description"></a>
+          </span>
+        </div>
+        <div class="component-count">
+          <span style="margin-right: 30px">销量:<span v-text="salesData[index]"></span></span>
+          <span>库存量:<span v-text="store.totalReserve"></span></span>
+        </div>
+        <div class="btn-content">
+          <a class="focus-store store-btn" @click="focusStore(store, index)" v-text="focusData[index] === 'true'?'已关注':'关注店铺'" :class="{'is-focus': focusData[index] === 'true'}"></a>
+          <a :href="'/store/' + store.uuid" target="_blank" class="enter-store store-btn">进入店铺</a>
+        </div>
+      </div>
+      <ul class="store-component-list" v-if="componentData">
+        <li v-for="(item, index2) in componentData[index].content" @click="goStore(index, index2)">
+          <!--<a :href="`/product/component/${item.uuid}`" style="display: block"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
+          <div class="describe-list">
+            <a style="margin-bottom: 8px" :href="`/product/component/${item.uuid}`" class="store-component-code" v-text="item.code" :title="item.code"></a>
+            <a style="margin-bottom: 8px" :href="`/product/brand/${item.branduuid}`" v-text="item.brandNameEn"></a>
+            <a :href="`/product/kind/${item.kindUuid}`" v-text="item.kindNameCn"></a>
+          </div>-->
+          <a style="display: block"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
+          <div class="describe-list">
+            <a class="store-component-code" v-text="item.code" :title="item.code"></a>
+            <a v-text="item.brandNameEn" :title="item.brandNameEn"></a>
+            <a v-text="item.kindNameCn" :title="item.kindNameCn"></a>
+          </div>
+        </li>
+      </ul>
+    </li>
+  </ul>
+    <page :total="storeData.totalElements" :page-size="pageSize"
+          :current="nowPage" v-on:childEvent="listenPage"></page>
+    <el-dialog
+      :visible.sync="dialogVisible"
+      size="tiny"
+    >
+      <h3 class="header-text">关注成功!</h3>
+      <div class="focus modal-body">
+        <button type="button" @click="dialogVisible = false" class="btn" style="margin-left:25px;">关&nbsp;&nbsp;闭</button>
+        <button type="button" @click="dialogVisible = false" class="focus-btn btn btn btn-info" style="margin-left:35px;">
+          <a href="/user#/storeFocus" target="_blank">查看我的店铺关注</a>
+        </button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import Page from '~components/common/page/pageComponent.vue'
+  export default {
+    data () {
+      return {
+        dialogVisible: false,
+        pageSize: 8,
+        nowPage: 1
+      }
+    },
+    components: {
+      Page
+    },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      },
+      storeDetail () {
+        return this.$store.state.searchStore.searchStoreDetail.detail.data
+      },
+      storeData () {
+        return this.storeDetail[0].stores
+      },
+      focusData () {
+        return this.storeDetail[1].isFocus
+      },
+      componentData () {
+        return this.storeDetail[1].image
+      },
+      salesData () {
+        return this.storeDetail[1].sales
+      }
+    },
+    methods: {
+      focusStore: function (store, index) {
+        if (!this.user.logged) {
+          this.$http.get('/login/page').then(response => {
+            if (response.data) {
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+            }
+          })
+        } else {
+          if (this.focusData[index] === 'true') {
+            // 已关注
+            this.$message.error('店铺已关注,不能重复关注')
+          } else {
+            // 未关注
+            this.$http.post('/trade/storeFocus/save', {storeName: store.storeName, storeid: store.id})
+              .then(response => {
+                if (response.data === 'success') {
+                  // 关注成功
+                  this.dialogVisible = true
+                  this.focusData[index] = 'true'
+                } else {
+                  // 关注失败
+                  this.$message.error('关注失败')
+                }
+              })
+          }
+        }
+      },
+      listenPage: function (page) {
+        this.$emit('pageAction', page)
+      },
+      goStore: function (index, compIndex) {
+        window.open('/store/' + this.componentData[index].content[compIndex].storeid + '/' + this.componentData[index].content[compIndex].batchCode)
+      }
+    }
+  }
+</script>
+<style scoped>
+  .store-list {
+    border-right: 1px solid rgb( 231, 231, 231 );
+    border-left: 1px solid rgb( 231, 231, 231 );
+  }
+  .store-list >li{
+    border-bottom: 1px solid rgb( 231, 231, 231 );
+    padding: 20px 0;
+  }
+  .store-content-left {
+    display: inline-block;
+    margin-right: 27px;
+  }
+  .store-content-left .component-count{
+    display: block;
+    margin-left: 10px;
+    margin-top: 20px;
+  }
+  .store-content-left >div {
+    display: inline-block;
+  }
+  .store-content-left >a {
+    color: black;
+    float: left;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+    display: inline-block;
+    border: 1px solid rgb( 231, 231, 231 );
+    overflow: hidden;
+    margin-left: 10px;
+  }
+  .store-content-left >a >img.storeImg {
+    max-width: 100px;
+    max-height: 100px;
+  }
+  .btn-content {
+    display: block!important;
+    margin-top: 20px;
+  }
+  .btn-content >span {
+    display: block;
+  }
+  .btn-content >span:hover {
+    cursor: pointer;
+  }
+  .store-detail {
+    margin-left: 20px;
+  }
+  .store-detail >a {
+    font-size: 14px;
+    font-weight: 700;
+    color: black;
+    display: block;
+    overflow: hidden;
+    width: 175px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+  .store-detail >span{
+    display: block;
+    font-size: 12px;
+    width: 190px;
+  }
+  .store-detail .call-seller {
+    margin-top: 14px;
+  }
+  .store-detail .call-seller .contact_btn {
+    width: 62px;
+    height: 18px;
+    line-height: 18px;
+    background: #ef7f03;
+    display: inline-block;
+    text-align: center;
+    color: #fff;
+    font-size: 12px;
+    border-radius: 5px;
+    margin-left: 5px;
+  }
+  .store-detail .main-product {
+    margin-top: 12px;
+  }
+  .store-detail .main-product a:hover {
+    cursor: pointer;
+    color: #5078cb!important;
+  }
+  .store-detail .main-product a {
+    color: #333;
+    width: 126px;
+    display: inline-block;
+    float: left;
+    overflow: hidden;
+    word-break: break-all;
+    height: 35px;
+    line-height: 16px;
+    text-overflow: ellipsis;
+    /*-webkit-line-clamp: 2;
+    -moz-line-clamp: 2;
+    -o-line-clamp: 2;
+    -ms-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    -moz-box-orient: vertical;
+    -o-box-orient: vertical;
+    -ms-box-orient: vertical;*/
+  }
+  .btn-content .store-btn {
+    padding: 4px 14px;
+    color: white;
+    display: inline-block;
+  }
+  .btn-content .focus-store {
+    margin-right: 30px;
+    margin-left: 10px;
+    background: #5078cb;
+    border: 1px solid #5078cb;
+  }
+  .btn-content .is-focus {
+    background: #999;
+    border: 1px solid #999;
+  }
+  .btn-content .enter-store {
+    background: #ff8522;
+    border: 1px solid #ff8522;
+  }
+  .store-component-list {
+    display: inline-block;
+    margin-right: 6px;
+    width: 834px;
+    float: right;
+  }
+  .store-component-list >li {
+    display: inline-block;
+    text-align: center;
+    border: 1px solid rgb( 231, 231, 231 );
+    margin-right: 14px;
+    width: 152px;
+    height: 178px;
+  }
+  .store-component-list >li:hover {
+    cursor: pointer;
+    color: #fff!important;
+    border: 1px solid #5078cb;
+  }
+  .store-component-list >li:hover .describe-list {
+    background: #5078cb;
+  }
+  .store-component-list >li:hover div a {
+    color: #fff;
+  }
+  .store-component-list >li img {
+    width: 149px;
+    height:114px;
+  }
+  .store-component-list >li .describe-list {
+    padding: 2px 10px;
+    background: #dee0e5;
+    height: 64px;
+  }
+  .store-component-list >li div a {
+    display: block;
+    font-size: 14px;
+    text-align: left;
+    color: #333;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    line-height: 20px;
+    white-space: nowrap;
+  }
+ /* .store-component-list >li a:hover {
+    color: #f39801;
+  }*/
+  /*.store-component-list .store-component-code {
+  }*/
+  .header-text {
+    text-align: center;
+    font-size: 20px;
+    color: #008B00;
+    margin-top: 0;
+  }
+  .el-dialog__body{
+    padding: 20px !important;
+  }
+  .focus button.focus-btn a{
+    color: #fff;
+  }
+</style>

+ 4 - 0
components/searchStore/index.js

@@ -0,0 +1,4 @@
+import SearchTitle from './SearchTitle.vue'
+import StoreContent from './StoreContent.vue'
+
+export { SearchTitle, StoreContent }

+ 6 - 5
components/store/CommodityInfo.vue

@@ -27,7 +27,7 @@
               <span class="money">
                 <span v-if="fragment.currency == 'RMB'">¥</span>
                 <span v-if="fragment.currency == 'USD'">$</span>
-                <span v-text="fragment.price"></span>
+                <span>{{fragment.price | currency}}</span>
               </span>
             </div>
             <div class="com-info">
@@ -79,14 +79,14 @@
               <div class="select">
                 <span v-if="fragment.currency == 'RMB'">¥</span>
                 <span v-if="fragment.currency == 'USD'">$</span>
-                <span>{{(fragment.price || 0)}}</span>
+                <span>{{(fragment.price || 0) | currency}}</span>
                 <span v-if="fragment.currency == 'RMB'" class="tax"> ( 含税 ) </span>
               </div>
               <span class="money">
                  <span v-if="fragment.currency == 'RMB'">¥</span>
                  <span v-if="fragment.currency == 'USD'">$</span>
-                 <span>{{(calculate || 0)}}</span>
+                 <span>{{(calculate || 0) | currency}}</span>
               </span>
             </div>
             <div class="button">
@@ -244,6 +244,7 @@ export default {
       let pack = this.commodity.perQty || this.commodity.minPackQty
       let buy = this.commodity.minBuyQty
       let reserve = this.commodity.reserve
+      newNum = parseInt(newNum)
       if (newNum < buy) {
         this.$message.error('该商品最少购买' + buy + '件')
         this.fragment.num = buy
@@ -301,7 +302,7 @@ export default {
         this.changeNum(this.fragment.num)
         getFragment(this.commodity, this.fragment)
       } else {
-        this.$message.error('请输入数')
+        this.$message.error('请输入数')
         this.fragment.num = this.commodity.minBuyQty
       }
     },
@@ -309,7 +310,7 @@ export default {
       if (!this.$store.state.option.user.logged) {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
       } else {

+ 31 - 5
components/store/RecommendProduct.vue

@@ -7,16 +7,16 @@
           <div class="content">
             <p v-text="commodity.comCode">MRFE6S9045NF001</p>
             <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>
-            <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB}}</p>
-            <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>
+            <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
+            <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</p>
           </div>
           <div class="hover-show" :href="commodity.batchCode ? '/store/' + storeInfo.uuid + '/' + commodity.batchCode : '#'">
             <a :href="commodity.batchCode ? '/store/' + storeInfo.uuid + '/' + commodity.batchCode : '#'" class="href">
               <div class="title" v-text="commodity.comCode">MRFE6S9045NF001</div>
               <div class="type" v-text="commodity.brandNameCn">PANFAEFQ</div>
               <div class="hr"><span>抢购价</span></div>
-              <div class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB}}</div>
-              <div class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</div>
+              <div class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</div>
+              <div class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</div>
             </a>
             <div class="by-cart"><button title="加入购物车" @click="buyNow(false, commodity)"><img src="/images/store/icon/cart-blue.png"/></button></div>
             <div class="buy-now"><button title="立即购买" @click="buyNow(true, commodity)">立即购买</button></div>
@@ -41,12 +41,38 @@
         return this.$store.state.shop.storeInfo.store.data
       }
     },
+    filters: {
+      currency: function (num) {
+        if (typeof num === 'number') {
+          if (num <= 0.000001) {
+            num = 0.000001
+          } else {
+            if (num.toString().indexOf('.') === -1) {
+              num += '.00'
+            } else {
+              let inputStr = num.toString()
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
+              if (floatNum.length > 6) {
+                num = inputStr.substring(0, arr[0].length + 7)
+                if (Number(floatNum.charAt(6)) > 4) {
+                  num = (Number(num) * 1000000 + 1) / 1000000
+                }
+              } else if (floatNum.length === 1) {
+                num = num + '0'
+              }
+            }
+          }
+        }
+        return num
+      }
+    },
     methods: {
       buyNow: function (isBuy, item) {
         if (!this.$store.state.option.user.logged) {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 1 - 1
components/store/common/StoreHeader.vue

@@ -100,7 +100,7 @@ export default {
       if (!this.user.logged) {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
       } else {

+ 29 - 22
layouts/error.vue

@@ -1,13 +1,12 @@
 <template>
   <div class="error">
-    <div class="error-content">
-      <h1 class="error-code">{{ error.statusCode }}</h1>
-      <div class="error-wrapper-message">
-        <h2 class="error-message">找不到页面</h2>
+    <div class="section">
+      <div class="container">
+        <div class="btn-click">
+          <a href="/"><i class="fa fa-home" style="margin-right:5px;"></i>返回首页</a>
+          <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
+        </div>
       </div>
-      <p>
-        <nuxt-link class="error-link" to="/">返回首页</nuxt-link>
-      </p>
     </div>
   </div>
 </template>
@@ -18,21 +17,29 @@
   }
 </script>
 
-<style lang="scss">
-  @import '~assets/scss/mixins';
-  @import '~assets/scss/variables';
-  .error {
-    position: relative;
-    background-color: $module-bg;
-    min-height: 10em;
-    width: 100%;
-    overflow: hidden;
+<style scoped lang="scss">
+  .section{
+    background: #ebfdff url('/images/404.png')no-repeat center center;
+    height:900px;
+    position:relative;
+  }
+  .section .btn-click{
+    position:absolute;
+    top:54%;
+    left:50%;
+    margin-left:-150px;
+  }
+  .section .btn-click a{
+    display:inline-block;
+    width:130px;
+    height:33px;
+    font-size: 16px;
+    line-height: 33px;
+    color:#fff;
+    background: #f87c29;
     text-align: center;
-    padding: 2em 0;
-    .error-content {
-      .error-code {
-        font-size: 6rem;
-      }
-    }
+    margin:0 10px;
+    border-radius: 2px;
+    text-decoration: none;
   }
 </style>

+ 5 - 1
middleware/authenticated.js

@@ -4,6 +4,10 @@ export default function ({ isServer, store, req, redirect }) {
   if (isServer && !req) return
 
   if (!store.state.option.user.logged) {
-    redirect('/auth/login')
+    this.$http.get('/logout/crossBefore').then(response => {
+      if (response.data) {
+        window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+      }
+    })
   }
 }

+ 1 - 1
nuxt.config.js

@@ -108,5 +108,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/**', '/produce/**', '/file**']
+  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/**', '/file**', '/rate/**']
 }

+ 0 - 55
pages/auth/login.vue

@@ -1,55 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/login/crossBefore')
-        const params = data || {}
-        this.proxyLogin(params.askUrl, params.askData, params.loginUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogin (askUrl, askData, loginUrl) {
-      const crossAfter = this.crossAfter
-      this.$jsonp(`${askUrl}?askData=${askData}`, function (err, data) {
-        if (err) throw err
-
-        // 判断是否已经登录
-        if (data.error) {
-          // 如果未登录,跳转登录界面
-          window.location.href = loginUrl
-        } else {
-          crossAfter(data.content)
-        }
-      })
-    },
-    async crossAfter (content) {
-      if (!content || content === '') {
-        this.$router.replace('/')
-      }
-
-      try {
-        let { data } = await this.$http.post('/login/crossAfter', {}, { params: { replyTxt: content } })
-
-        this.$store.dispatch('loadUserInfo', data)
-        window.location.href = data.returnUrl || '/'
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    }
-  }
-}
-</script>

+ 0 - 32
pages/auth/logout.vue

@@ -1,32 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/logout/crossBefore')
-        const params = data || {}
-        this.proxyLogout(params.askUrl, params.returnUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogout (askUrl, returnUrl) {
-      this.$jsonp(`${askUrl}`, function (err, data) {
-        if (err) throw err
-        window.location.href = returnUrl && returnUrl !== 'null' ? returnUrl : '/'
-      })
-    }
-  }
-}
-</script>

+ 1 - 2
pages/index.vue

@@ -26,8 +26,7 @@
         store.dispatch('loadFloors'),
         store.dispatch('loadBanners', {type: 'home'}),
         store.dispatch('loadProductKinds', { id: 0 }),
-        store.dispatch('loadNewsSnapshot', { page: 1, pageSize: 10 }),
-        store.dispatch('loadProductCounts', { _status: 'actived' })
+        store.dispatch('loadNewsSnapshot', { page: 1, pageSize: 10 })
       ])
     },
     components: {

+ 0 - 56
pages/platform-b2c/login/proxy.vue

@@ -1,56 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/login/crossBefore')
-        const params = data || {}
-        this.proxyLogin(params.askUrl, params.askData, params.loginUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogin (askUrl, askData, loginUrl) {
-      const crossAfter = this.crossAfter
-      this.$jsonp(`${askUrl}?askData=${askData}`, function (err, data) {
-        if (err) throw err
-
-        // 判断是否已经登录
-        if (data.error) {
-          // 如果未登录,跳转登录界面
-          window.location.href = loginUrl
-        } else {
-          crossAfter(data.content)
-        }
-      })
-    },
-    async crossAfter (content) {
-      if (!content && content === '') {
-        this.$router.replace('/')
-      }
-
-      try {
-        let { data } = await this.$http.post('/login/crossAfter', {}, { params: { replyTxt: content } })
-
-        this.$store.dispatch('loadUserInfo', data)
-
-        window.location.href = data.returnUrl || '/'
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    }
-  }
-}
-</script>

+ 0 - 34
pages/platform-b2c/logout/proxy.vue

@@ -1,34 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/logout/crossBefore')
-        const params = data || {}
-        this.proxyLogout(params.askUrl, params.returnUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogout (askUrl, returnUrl) {
-      this.$jsonp(`${askUrl}`, function (err, data) {
-        if (err) throw err
-        console.log(data)
-
-        window.location.href = returnUrl && returnUrl !== 'null' ? returnUrl : '/'
-      })
-    }
-  }
-}
-</script>

+ 1 - 1
pages/product/kind/_id.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="container">
     <categroy-nav></categroy-nav>
-    <category-property  @loadCmpGoodsByBrandEvent="listemBrandFilter" @loadCmpGoodsByTypeEvent="listemProTypeFilter"></category-property>
+    <!--<category-property  @loadCmpGoodsByBrandEvent="listemBrandFilter" @loadCmpGoodsByTypeEvent="listemProTypeFilter"></category-property>-->
     <component-goods :brandid="brandid" :propertyJSON="propertyJSON"></component-goods>
   </div>
 </template>

+ 40 - 0
pages/searchStore/_keyword.vue

@@ -0,0 +1,40 @@
+<template>
+  <div class="container" id="searchResult">
+    <search-title :keyword="key" @showAction="showAction" @typeAction="onTypeChanged"></search-title>
+    <store-content v-show="show" @pageAction="onPageChanged"></store-content>
+  </div>
+</template>
+<script>
+  import { SearchTitle, StoreContent } from '~components/searchStore'
+  export default {
+    layout: 'main',
+    components: {
+      SearchTitle,
+      StoreContent
+    },
+    data () {
+      return {
+        key: this.$route.query.w,
+        show: true,
+        type: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+      }
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('searchStore/searchStoreDetail', {page: 1, count: 8, keyword: route.query.w, types: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY', op: 'pageByType'})
+      ])
+    },
+    methods: {
+      showAction: function (show) {
+        this.show = show
+      },
+      onPageChanged: function (page) {
+        this.$store.dispatch('searchStore/searchStoreDetail', {page: page, count: 8, keyword: this.$route.query.w, types: this.type, op: 'pageByType'})
+      },
+      onTypeChanged: function (type) {
+        this.type = type
+      }
+    }
+  }
+</script>
+

+ 16 - 0
post.sh

@@ -0,0 +1,16 @@
+#!/bin/sh
+
+groupId=com.uas.platform
+artifactId=mall-ssr
+packaging=tgz
+version=1.0.0
+repo_uri='http://10.10.100.23:23004/v1/artifact'
+
+basepath=$(cd `dirname $0`; pwd)
+buildfile=$basepath/dist.tgz
+
+cnpm install
+npm run build
+tar -czf $buildfile .
+curl -H "Expect:" -F "groupId=$groupId" -F "artifactId=$artifactId" -F "packaging=$packaging"  -F "version=$version" -F "file=@$buildfile" $repo_uri
+rm -rf $buildfile

BIN
static/images/404.png


BIN
static/images/all/xiala.png


+ 2 - 1
store/index.js

@@ -40,7 +40,8 @@ export const actions = {
     }
     return Promise.all([
       // 全局数据
-      store.dispatch('loadUserInfo')
+      store.dispatch('loadUserInfo'),
+      store.dispatch('loadProductCounts', { _status: 'actived' })
     ])
   },
   // 获取用户信息

+ 15 - 0
store/searchStore.js

@@ -0,0 +1,15 @@
+import axios from '~plugins/axios'
+
+export const actions = {
+  // 获取搜索店铺数据
+  searchStoreDetail ({ commit }, params = {}) {
+    commit('searchStoreDetail/REQUEST_STORE', params)
+    return axios.get(`/search/stores`, {params})
+      .then(response => {
+        commit('searchStoreDetail/GET_STORE_SUCCESS', response.data)
+      }, err => {
+        commit('searchStoreDetail/GET_STORE_FAILURE', err)
+      })
+  }
+}
+

+ 19 - 0
store/searchStore/searchStoreDetail.js

@@ -0,0 +1,19 @@
+export const state = () => ({
+  detail: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_STORE (state) {
+    state.detail.fetching = true
+  },
+  GET_STORE_FAILURE (state) {
+    state.detail.fetching = false
+  },
+  GET_STORE_SUCCESS (state, result) {
+    state.detail.fetching = false
+    state.detail.data = result
+  }
+}