Эх сурвалжийг харах

1.关注店铺和收藏商品登录验证
2.首页floorBar bug解决

yangc 8 жил өмнө
parent
commit
7f8b4ea769

+ 22 - 9
components/home/floor/FloorBar.vue

@@ -22,7 +22,8 @@
     data () {
       return {
         visible: false,
-        activeFloor: -1
+        activeFloor: -1,
+        floor_scrollTop: 777
       }
     },
     methods: {
@@ -30,6 +31,26 @@
         let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
         let floors = document.querySelectorAll('.floor')
         let barOffset = document.querySelector('.floor-bar').offsetTop
+       // console.log(floors[floors.length - 1].offsetTop)
+        if (floors[0].offsetTop === 0) {
+          this.visible = scrolled >= floors[0].offsetTop + this.floor_scrollTop - 285 && scrolled <= floors[floors.length - 1].offsetTop + this.floor_scrollTop
+          if (this.visible) {
+            for (let i = 0; i < floors.length; i++) {
+              if (barOffset >= floors[i].offsetTop + this.floor_scrollTop - scrolled + 60) {
+                this.activeFloor = i
+              }
+            }
+          }
+        } else {
+          this.visible = scrolled >= floors[0].offsetTop - 285 && scrolled <= floors[floors.length - 1].offsetTop
+          if (this.visible) {
+            for (let i = 0; i < floors.length; i++) {
+              if (barOffset >= floors[i].offsetTop - scrolled + 60) {
+                this.activeFloor = i
+              }
+            }
+          }
+        }
     /*    let barOffset2 = 0
         this.visible = (barOffset >= floors[0].offsetTop - scrolled &&
           barOffset2 <= floors[floors.length - 1].offsetTop - scrolled + floors[floors.length - 1].clientHeight)
@@ -40,14 +61,6 @@
             }
           }
         } */
-        this.visible = scrolled >= floors[0].offsetTop - 285 && scrolled <= floors[floors.length - 1].offsetTop
-        if (this.visible) {
-          for (let i = 0; i < floors.length; i++) {
-            if (barOffset >= floors[i].offsetTop - scrolled + 60) {
-              this.activeFloor = i
-            }
-          }
-        }
       },
       jumpFloor (index) {
         if (this.visible) {

+ 13 - 13
components/messageBoard/MessageBoard.vue

@@ -141,6 +141,7 @@
 <script>
   import ImageUpload from '~components/common/image-upload/imageUpload.vue'
   import PageComponent from '~components/common/page/pageComponent.vue'
+  import {Message} from 'element-ui'
   export default {
     name: 'messageBoard',
     data () {
@@ -166,7 +167,6 @@
     },
     computed: {
       messageBoard () {
-        console.log('messageBoard', this.$store.state.messageBoard.information.data)
         return this.$store.state.messageBoard.information.data
       },
 //      user () {
@@ -220,19 +220,19 @@
         this.isEmail = (/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/).test(this.messageBoard.email)
       },
       confirm () {
+        console.log('messageBoard', this.$store.state.messageBoard.information.data)
         this.$store.dispatch('uploadMessageBoardInformation', {question: this.messageBoard.question, role: this.messageBoard.role, submitTitle: '【优软商城】IC电子元器件现货采购交易平台商城', submitUrl: window.location.href, type: this.messageBoard.type, imgs: this.dialogImageUrl, userTel: '13333333333'})
-        if (!this.messageBoard.question) {
-          alert('您还没有填写反馈内容')
-        }
-        if (!this.messageBoard.role) {
-          alert('请选择您的身份信息')
-        }
-        if (!this.messageBoard.type) {
-          alert('请选择一种反馈类型')
-        }
-        if (!this.user) {
-          if (!this.messageBoard.userTel && !this.messageBoard.email) {
-            alert('请填写任意一种联系方式')
+        if (this.messageBoard) {
+          if (!this.messageBoard.question) {
+            Message.error('您还没有填写反馈内容')
+          } else if (!this.messageBoard.role) {
+            Message.error('请选择您的身份信息')
+          } else if (!this.messageBoard.type) {
+            Message.error('请选择一种反馈类型')
+          } else if (!this.user) {
+            if (!this.messageBoard.userTel && !this.messageBoard.email) {
+              Message.error('请填写任意一种联系方式')
+            }
           }
         }
       }

+ 17 - 5
components/product/component/ComponentDetail.vue

@@ -41,7 +41,7 @@
             </div>
             <div class="form-group">
              <!-- <button class="btn btn-default btn-stroe">加入收藏</button>-->
-              <el-button type="text" v-if="!isShow && collectList" @click="dialogVisible = true,collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</el-button>
+              <el-button type="text" v-if="!isShow && collectList" @click="collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</el-button>
                <button class="btn btn-default btn-stroe" v-if="isShow && collectList" disabled="disabled">已收藏</button>
             </div>
           </div>
@@ -57,7 +57,7 @@
       <div class="focus modal-body">
         <button type="button" @click="dialogVisible = false" class="btn" style="margin-left:25px;">关&nbsp;&nbsp;闭</button>
         <button type="button" class="focus-btn btn btn btn-info" style="margin-left:35px;">
-          <a href="/user#/browsingHistory" target="_blank">查看我的产品收藏</a>
+          <a href="/user#/home/componentcol" target="_blank">查看我的产品收藏</a>
         </button>
       </div>
     </el-dialog>
@@ -81,6 +81,9 @@
       list () {
         return this.lists.data
       },
+      user () {
+        return this.$store.state.option.user
+      },
       collectList () {
         let id = this.lists.data.properties[0].componentId
        // console.log(this.lists.data)
@@ -109,9 +112,18 @@
         this.$store.dispatch('product/saveStores')
       },
       collect (id) {
-        let kind = 2
-        this.$store.dispatch('product/saveEntity', {componentid: id, kind: kind})
-        this.isShow = true
+        if (this.user.logged) {
+          this.dialogVisible = true
+          let kind = 2
+          this.$store.dispatch('product/saveEntity', {componentid: id, kind: kind})
+          this.isShow = true
+        } else {
+          this.$http.get('/login/page').then(response => {
+            if (response.data) {
+              this.$router.push('/auth/login')
+            }
+          })
+        }
       }
     }
   }

+ 1 - 1
components/store/CommodityInfo.vue

@@ -75,7 +75,7 @@
               <span class="money">
                  <span v-if="fragment.currency == 'RMB'">¥</span>
                  <span v-if="fragment.currency == 'USD'">$</span>
-                 <span>{{(calculate || 0) | currency('', 2)}}</span>
+                 <span>{{(calculate || 0)}}</span>
               </span>
             </div>
             <div class="button" ng-controller="GoodsPickUpCtrl">

+ 19 - 7
components/store/common/StoreHeader.vue

@@ -15,7 +15,7 @@
                 </div>
                 <div class="icon-style">
                   <!--<button class="btn btn-xs btn-danger btn-nav" v-if="!isFocus"><span class="watch">关注</span></button>-->
-                  <span v-if="!isFocus"><el-button type="text" @click="dialogVisible = true,focus(storeInfo.id, storeInfo.storeName)" class="btn btn-xs btn-danger btn-nav"><span class="watch">关注</span></el-button></span>
+                  <span v-if="!isFocus"><el-button type="text" @click="focus(storeInfo.id, storeInfo.storeName)" class="btn btn-xs btn-danger btn-nav"><span class="watch">关注</span></el-button></span>
                   <span v-if="isFocus" ><button class="btn btn-xs btn-default btn-nav" style="width:50px"><span>已关注</span></button></span>
                   <span v-if="storeInfo.type == 'ORIGINAL_FACTORY'">&nbsp;<img src="/images/store/icon/icon-factory.png"/></span>
                   <span v-else-if="storeInfo.type == 'AGENCY'">&nbsp;<img src="/images/store/icon/icon-agent.png"/></span>
@@ -27,13 +27,13 @@
             </div>
             <div style="background: #FFFFFF;" v-if="isOpen">
               <ul class = "shop-contact list-unstyled" style="padding: 15px 0; margin-bottom: 0; border-top: #e8e8e8 1px solid; margin-top: 20px;">
-                <li ng-if="storeInfo.enterprise.enTel.length > 0">
+                <li v-if="storeInfo.enterprise.enTel.length > 0">
                   <span>电话:</span><span v-text="storeInfo.enterprise.enTel"></span>
                 </li>
-                <li ng-if="storeInfo.enterprise.enFax.length > 0">
+                <li v-if="storeInfo.enterprise.enFax.length > 0">
                   <span>传真:</span><span v-text="storeInfo.enterprise.enFax"></span>
                 </li>
-                <li ng-if="storeInfo.enterprise.enAddress.length > 0">
+                <li v-if="storeInfo.enterprise.enAddress.length > 0">
                   <span>地址:</span><span v-text="storeInfo.enterprise.enAddress"></span>
                 </li>
                 <li class="text-right">
@@ -59,7 +59,7 @@
       <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#/browsingHistory" target="_blank">查看我的店铺关注</a>
+          <a href="/user#/storeFocus" target="_blank">查看我的店铺关注</a>
         </button>
       </div>
     </el-dialog>
@@ -83,6 +83,9 @@ export default {
     storeInfo () {
       return this.$store.state.shop.storeInfo.store.data
     },
+    user () {
+      return this.$store.state.option.user
+    },
     isFocus () {
       const foucusList = this.$store.state.shop.storeInfo.focusList.data
       return foucusList === 'true'
@@ -104,8 +107,17 @@ export default {
       this.isOpen = true
     },
     focus (id, name) {
-      this.$store.dispatch('shop/StoreFocus', {storeName: name, storeid: id})
-      this.isFocus = true
+      if (!this.user.logged) {
+        this.$http.get('/login/page').then(response => {
+          if (response.data) {
+            this.$router.push('/auth/login')
+          }
+        })
+      } else {
+        this.dialogVisible = true
+        this.$store.dispatch('shop/StoreFocus', {storeName: name, storeid: id})
+        this.isFocus = true
+      }
     }
   }
 }

+ 2 - 0
nuxt.config.js

@@ -14,6 +14,8 @@ module.exports = {
     title: '【优软商城】IC电子元器件现货采购交易平台商城',
     meta: [
       { charset: 'utf-8' },
+      { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge,chrome=1' },
+      { name: 'render', content: 'webkit' },
       { name: 'viewport', content: 'width=device-width, initial-scale=1' },
       { hid: 'description', name: 'description', content: '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!' }
     ],

+ 0 - 2
package.json

@@ -6,7 +6,6 @@
   "private": true,
   "dependencies": {
     "axios": "^0.15.3",
-    "babel-polyfill": "^6.23.0",
     "bezier-easing": "^2.0.3",
     "bootstrap": "^3.3.7",
     "cross-env": "^3.1.4",
@@ -14,7 +13,6 @@
     "express": "^4.14.1",
     "font-awesome": "^4.7.0",
     "http-proxy-middleware": "^0.17.4",
-    "iview": "^2.0.0-rc.19",
     "jsonp": "^0.2.1",
     "nuxt": "0.10.6",
     "vue-awesome-swiper": "^2.5.4",