Browse Source

Merge branch 'yc-imReplace-0420'

# Conflicts:
#	components/applyPurchase/ApplyInfo.vue
#	utils/baseUtils.js
yangc 7 years ago
parent
commit
593b1cc163

+ 19 - 6
components/applyPurchase/ApplyInfo.vue

@@ -160,9 +160,6 @@ export default {
       Timer: {}
     }
   },
-  phone: function(str) {
-    return str ? str.substring(0, 3) + '****' + str.substring(7, 11) : '-'
-  },
   filters: {
     date: function(date) {
       const d = new Date(Number(date))
@@ -208,8 +205,7 @@ export default {
       return this.$store.state.shop.storeInfo.store.data
     },
     purchaseManList() {
-      return this.$store.state.applyPurchase.purchaseManList.purchaseManList
-        .data
+      return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
     },
     totalCount() {
       return this.purchaseManList.totalElements
@@ -667,7 +663,7 @@ export default {
               width: 248px;
               height: 207px;
               top: 115px;
-              right: 0px;
+              right: 0;
               z-index: 98;
               display: none;
               line-height: 14px;
@@ -821,4 +817,21 @@ export default {
     }
   }
 }
+      .empty{
+        text-align: center;
+        height: 200px;
+        line-height: 200px;
+        border: 1px solid #e8e8e8;
+        margin-bottom: 10px;
+        span {
+          color: #999;
+          margin-left: 10px;
+        }
+      }
+    }
+    .page-wrap {
+      text-align: right;
+      float: none;
+    }
+  }
 </style>

+ 68 - 0
components/common/LinkSalerBox.vue

@@ -0,0 +1,68 @@
+<template>
+  <div class="com-del-box link-saler-box">
+    <div class="title">
+      <i @click="cancel()"></i>
+    </div>
+    <div class="content">
+      <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与{{target == 'saler' ? '卖' : '买'}}家在线沟通!</p>
+      <p>{{target == 'saler' ? '卖' : '买'}}家联系电话:<span v-text="tel"></span></p>
+      <div>
+        <a @click="cancel()">我知道了</a>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    props: {
+      tel: {
+        default: '',
+        type: String
+      },
+      target: {
+        default: 'saler',
+        type: String
+      }
+    },
+    methods: {
+      cancel: function () {
+        this.$emit('cancelAction')
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .link-saler-box {
+    width: 289px;
+    height: auto;
+    min-height: auto;
+    border-radius: 2px;
+    .title {
+      background-color: #4290f7;
+      height: 22px;
+      line-height: 22px;
+      margin-bottom: 20px;
+    }
+    .content {
+      p {
+        line-height: 20px;
+        padding-top: 0;
+        i {
+          color: #4290f7;
+          margin-right: 4px;
+        }
+        span {
+          color: #f62d37;
+        }
+      }
+      div {
+        a {
+          width: 78px;
+          background: #4290f7;
+          margin: 18px 0 13px 0;
+          border-radius: 2px;
+        }
+      }
+    }
+  }
+</style>

+ 2 - 2
components/default/RightBar.vue

@@ -32,14 +32,14 @@
             <p>周一至周五 9:00-18:00</p>
           </div>
         </li>
-        <li class="right-bar-item contact-menu">
+       <!-- <li class="right-bar-item contact-menu">
           <a href="javascript:void(0)" class="title" @click="goWebChat">
             <i class="fa fa-comments-o" aria-hidden="true" style="color: #FFFFFF;">
             </i>
             <i class="remind-point" v-if="user.logged && chatCount>0"></i>
           </a>
           <div class="sidebar-menu" title="优软互联"><a @click="goWebChat">优软互联<span v-if="user.logged">({{chatCount}})</span></a></div>
-        </li>
+        </li>-->
       </ul>
       <ul class="right-bar-bottom">
         <li class="right-bar-item" @mouseenter="loadHistorys()">

+ 16 - 3
components/searchStore/StoreContent.vue

@@ -10,7 +10,7 @@
           <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>
+							<a @click="goLink(store)" 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>
@@ -62,20 +62,30 @@
         </button>
       </div>
     </el-dialog>
+    <link-saler-box
+      :tel="tel"
+      v-if="showLinkBox"
+      @cancelAction="showLinkBox = false">
+    </link-saler-box>
   </div>
 </template>
 <script>
   import Page from '~components/common/page/pageComponent.vue'
+  import { goLinkUser } from '~utils/baseUtils'
+  import LinkSalerBox from '~components/common/LinkSalerBox.vue'
   export default {
     data () {
       return {
         dialogVisible: false,
         pageSize: 8,
-        nowPage: 1
+        nowPage: 1,
+        showLinkBox: false,
+        tel: ''
       }
     },
     components: {
-      Page
+      Page,
+      LinkSalerBox
     },
     computed: {
       user () {
@@ -130,6 +140,9 @@
       },
       goStore: function (index, compIndex) {
         window.open('/store/productDetail/' + this.componentData[index].content[compIndex].batchCode)
+      },
+      goLink: function (store) {
+        goLinkUser(this, store.enUU)
       }
     }
   }

+ 17 - 4
components/store/CommodityList.vue

@@ -27,7 +27,7 @@
               </span>
             </div>
           </div>
-          
+
         </div>
 
         <!-- 列表展示 -->
@@ -134,12 +134,17 @@
         <div class="remind-area">
           <img src="/images/store/store-remind.png" alt="">
           所有报价、库存信息的真实性及准确性均由店铺负责,如有疑问请点击
-          <a @click="goWebChat()" class="link-seller">联系卖家</a>
+          <a @click="goLink" class="link-seller">联系卖家</a>
         </div>
         <page :total="commodities.totalElements" :page-size="pageParams.count"
               :current="pageParams.page" @childEvent="handleCurrentChange"></page>
       </div>
     </div>
+    <link-saler-box
+      :tel="tel"
+      v-if="showLinkBox"
+      @cancelAction="showLinkBox = false">
+    </link-saler-box>
   </div>
 </template>
 <script>
@@ -165,12 +170,15 @@ function getAllLeafIds (kind) {
 }
 import Buy from '~components/common/buyOrCar/buyComponent.vue'
 import Page from '~components/common/page/pageComponent.vue'
+import LinkSalerBox from '~components/common/LinkSalerBox.vue'
+import { goLinkUser } from '~utils/baseUtils'
 export default {
   name: 'commodity-list',
   props: ['kinds'],
   components: {
     Buy,
-    Page
+    Page,
+    LinkSalerBox
   },
   data () {
     return {
@@ -184,7 +192,9 @@ export default {
       },
       searchCode: '',
       parentKindId: 0,
-      ids: null
+      ids: null,
+      showLinkBox: false,
+      tel: ''
     }
   },
   filters: {
@@ -384,6 +394,9 @@ export default {
       } else {
         this.$router.push('/auth/login?returnUrl=' + window.location.href)
       }
+    },
+    goLink: function () {
+      goLinkUser(this, this.storeInfo.enUU)
     }
   }
 }

+ 37 - 9
components/store/ComponentInfo.vue

@@ -13,25 +13,53 @@
         </li>
         <li v-if="!commodity.uuid || !component.properties || component.properties.length === 0" class="text-info">
           <!--<i class="fa fa-smile-o fa-lg"></i> 暂无参数信息-->
-          <span class="info">卖家上传的产品暂无参数,请 <a href="">联系卖家</a> 了解具体详情</span>
+          <span class="info">卖家上传的产品暂无参数,请 <a @click="goLink">联系卖家</a> 了解具体详情</span>
         </li>
       </ul>
     </div>
+    <link-saler-box
+      :tel="tel"
+      v-if="showLinkBox"
+      @cancelAction="showLinkBox = false">
+    </link-saler-box>
   </div>
 </template>
 <script>
 
-export default {
-  name: 'component-info',
-  computed: {
-    component () {
-      return this.$store.state.shop.storeInfo.component.data
+  import LinkSalerBox from '~components/common/LinkSalerBox.vue'
+  import { goLinkUser } from '~utils/baseUtils'
+
+  export default {
+    name: 'component-info',
+    data () {
+      return {
+        showLinkBox: false,
+        tel: ''
+      }
+    },
+    components: {
+      LinkSalerBox
+    },
+    computed: {
+      storeInfo () {
+        return this.$store.state.shop.storeInfo.store.data
+      },
+      user () {
+        return this.$store.state.option.user
+      },
+      component () {
+        return this.$store.state.shop.storeInfo.component.data
+      },
+      commodity () {
+        return this.$store.state.shop.storeInfo.commodity.data
+      }
     },
-    commodity () {
-      return this.$store.state.shop.storeInfo.commodity.data
+    methods: {
+      goLink: function () {
+        goLinkUser(this, this.storeInfo.enUU)
+      }
     }
   }
-}
 </script>
 <style scoped>
   .component-info {

+ 80 - 67
components/store/common/StoreHeader.vue

@@ -23,7 +23,7 @@
                   <span v-else-if="storeInfo.type == 'CONSIGNMENT'">&nbsp;<img src="/images/store/icon/consignment.png"/></span>
                   <span class="link-seller">
                     <img src="/images/all/songguo.png">
-							      <a @click="goWebChat()" class="contact_btn">联系卖家</a>
+							      <a @click="goLink()" class="contact_btn">联系卖家</a>
                   </span>
                   <div class="share">
                     <span @click="setShowShare(!showShare, $event)">生成手机版链接</span>
@@ -87,11 +87,18 @@
         </button>
       </div>
     </el-dialog>
+    <link-saler-box
+      :tel="tel"
+      v-if="showLinkBox"
+      @cancelAction="showLinkBox = false">
+    </link-saler-box>
   </div>
 </template>
 <script>
 import Clipboard from 'clipboard'
 import SearchBox from '~components/main/Search.vue'
+import LinkSalerBox from '~components/common/LinkSalerBox.vue'
+import { goLinkUser } from '~utils/baseUtils'
 
 let QRCode = require('qrcode')
 
@@ -102,11 +109,14 @@ export default {
       isOpen: false,
       dialogVisible: false,
       clipboard: {},
-      showShare: false
+      showShare: false,
+      showLinkBox: false,
+      tel: ''
     }
   },
   components: {
-    SearchBox
+    SearchBox,
+    LinkSalerBox
   },
   mounted () {
     let _this = this
@@ -175,71 +185,74 @@ export default {
         this.isFocus = true
       }
     },
-    goWebChat: function () {
-      if (!this.user.logged) {
-        this.$http.get('/login/page').then(response => {
-          if (response.data) {
-            this.$router.push('/auth/login')
-          }
-        })
-      } else {
-        // 获得窗口的垂直位置
-        let iTop = (window.screen.availHeight - 30 - 780) / 2
-        // 获得窗口的水平位置
-        let iLeft = (window.screen.availWidth - 10 - 1030) / 2
-        if (this.tab.close) {
-          this.tab.close()
-        }
-        let newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
-        newTab.close()
-        newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
-        this.$store.dispatch('chat/setChatTab', {tab: newTab})
-        this.$http.get('/basic/enterprise/' + this.storeInfo.enUU + '/info')
-          .then(response => {
-            let obj = {}
-            obj.userPhone = this.user.data.userTel
-            obj.userType = 'ENTERPRISE'
-            this.user.data.enterprises.forEach(function (item, index) {
-              if (item.current) {
-                obj.enUU = item.uu
-                obj.enterprise = {enUU: item.uu, name: item.enName}
-              }
-            })
-            obj.otherEnUU = response.data.uu
-            obj.otherUserType = 'STORE'
-            obj.otherEnterprise = {enUU: response.data.uu, name: response.data.enName}
-            obj.type = 'CHAT'
-            if (!(/^1\d{10}$/).test(response.data.enTel)) {
-              this.$http.get('/basic/enterprise/' + response.data.uu + '/admin').then(response => {
-                console.log(response)
-                obj.toPhone = response.data.userTel
-                console.log(obj)
-                this.openWebChat(newTab, obj)
-              }, err => {
-                console.log(err)
-                this.$message.error('暂无卖家管理员手机号!')
-              })
-            } else {
-              obj.toPhone = response.data.enTel
-              console.log(obj)
-              this.openWebChat(newTab, obj)
-            }
-          }, err => {
-            console.log(err)
-          })
-      }
-    },
-    openWebChat: function (newTab, obj) {
-      this.$http.post('https://im.ubtob.com/api/chat/infos?condition=chat_info', obj)
-        .then(response => {
-          if (response.data.success) {
-            newTab.location.href = 'https://im.ubtob.com/chat/visit?gid=' + response.data.content
-          } else {
-            newTab.close()
-            this.$message.error(response.data.message)
-          }
-        })
+    goLink: function () {
+      goLinkUser(this, this.storeInfo.enUU)
     },
+//    goWebChat: function () {
+//      if (!this.user.logged) {
+//        this.$http.get('/login/page').then(response => {
+//          if (response.data) {
+//            this.$router.push('/auth/login')
+//          }
+//        })
+//      } else {
+//        // 获得窗口的垂直位置
+//        let iTop = (window.screen.availHeight - 30 - 780) / 2
+//        // 获得窗口的水平位置
+//        let iLeft = (window.screen.availWidth - 10 - 1030) / 2
+//        if (this.tab.close) {
+//          this.tab.close()
+//        }
+//        let newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
+//        newTab.close()
+//        newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
+//        this.$store.dispatch('chat/setChatTab', {tab: newTab})
+//        this.$http.get('/basic/enterprise/' + this.storeInfo.enUU + '/info')
+//          .then(response => {
+//            let obj = {}
+//            obj.userPhone = this.user.data.userTel
+//            obj.userType = 'ENTERPRISE'
+//            this.user.data.enterprises.forEach(function (item, index) {
+//              if (item.current) {
+//                obj.enUU = item.uu
+//                obj.enterprise = {enUU: item.uu, name: item.enName}
+//              }
+//            })
+//            obj.otherEnUU = response.data.uu
+//            obj.otherUserType = 'STORE'
+//            obj.otherEnterprise = {enUU: response.data.uu, name: response.data.enName}
+//            obj.type = 'CHAT'
+//            if (!(/^1\d{10}$/).test(response.data.enTel)) {
+//              this.$http.get('/basic/enterprise/' + response.data.uu + '/admin').then(response => {
+//                console.log(response)
+//                obj.toPhone = response.data.userTel
+//                console.log(obj)
+//                this.openWebChat(newTab, obj)
+//              }, err => {
+//                console.log(err)
+//                this.$message.error('暂无卖家管理员手机号!')
+//              })
+//            } else {
+//              obj.toPhone = response.data.enTel
+//              console.log(obj)
+//              this.openWebChat(newTab, obj)
+//            }
+//          }, err => {
+//            console.log(err)
+//          })
+//      }
+//    },
+//    openWebChat: function (newTab, obj) {
+//      this.$http.post('https://im.ubtob.com/api/chat/infos?condition=chat_info', obj)
+//        .then(response => {
+//          if (response.data.success) {
+//            newTab.location.href = 'https://im.ubtob.com/chat/visit?gid=' + response.data.content
+//          } else {
+//            newTab.close()
+//            this.$message.error(response.data.message)
+//          }
+//        })
+//    },
     setShowShare: function (flag, event) {
       event.stopPropagation()
       this.loadQRcode()

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

@@ -9,7 +9,7 @@
         <!-- 店名展示 -->
         <div class="shop-banner">
           <img :src="storeInfo.bannerUrl || '/images/store/default/shop_banner.png'">
-          <div id="shop-title" v-if="storeInfo.storeShortName" v-text="storeInfo.storeShortName">店铺名称</div>
+          <div id="shop-title" v-if="storeInfo.storeName" v-text="storeInfo.storeName">店铺名称</div>
         </div>
       </div>
     </div>

+ 1 - 1
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://192.168.253.121:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://10.1.51.124:8080/platform-b2c/')
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 
 module.exports = {

+ 32 - 0
utils/baseUtils.js

@@ -131,3 +131,35 @@ export const checkNullStr = (str) => {
   })
   return flag
 }
+
+export const goLinkUser = ($this, enuu) => {
+  if ($this.user.logged) {
+    // $this.$http.get('/basic/enterprise/' + $this.storeInfo.enUU + '/info').then(response => {
+    //   if (response.data.enTel) {
+    //     $this.tel = response.data.enTel
+    //     $this.showLinkBox = true
+    //   } else {
+    //     $this.$http.get('/basic/enterprise/' + response.data.uu + '/admin').then(response => {
+    //       $this.tel = response.data.userTel
+    //       $this.showLinkBox = true
+    //     }, err => {
+    //       $this.$message.error('获取卖家联系方式失败')
+    //       console.log(err)
+    //     })
+    //   }
+    //   $this.showLinkBox = true
+    // }, err => {
+    //   $this.$message.error('获取卖家联系方式失败')
+    //   console.log(err)
+    // })
+    $this.$http.get(`/basic/enterprise/${enuu}/tels`).then(response => {
+      $this.tel = response.data.data.entel || response.data.data.adminTel
+      $this.showLinkBox = true
+    }, err => {
+      $this.$message.error('获取卖家联系方式失败')
+      throw err
+    })
+  } else {
+    $this.$router.push(`/auth/login?returnUrl=${window.location.href}`)
+  }
+}