Browse Source

修改联系电话获取方式

yangc 7 years ago
parent
commit
78074b2cf1

+ 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)
       }
     }
   }

+ 1 - 1
components/store/CommodityList.vue

@@ -396,7 +396,7 @@ export default {
       }
     },
     goLink: function () {
-      goLinkUser(this)
+      goLinkUser(this, this.storeInfo.enUU)
     }
   }
 }

+ 1 - 1
components/store/ComponentInfo.vue

@@ -56,7 +56,7 @@
     },
     methods: {
       goLink: function () {
-        goLinkUser(this)
+        goLinkUser(this, this.storeInfo.enUU)
       }
     }
   }

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

@@ -177,7 +177,7 @@ export default {
       }
     },
     goLink: function () {
-      goLinkUser(this)
+      goLinkUser(this, this.storeInfo.enUU)
     },
 //    goWebChat: function () {
 //      if (!this.user.logged) {

+ 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://10.1.51.124:8888/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 = {

+ 22 - 15
utils/baseUtils.js

@@ -121,25 +121,32 @@ export const formatDate = (date, fmt) => {
   return fmt
 }
 
-export const goLinkUser = ($this) => {
+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.$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('获取卖家联系方式失败')
-      console.log(err)
+      throw err
     })
   } else {
     $this.$router.push(`/auth/login?returnUrl=${window.location.href}`)