|
|
@@ -23,7 +23,7 @@
|
|
|
<span v-else-if="storeInfo.type == 'CONSIGNMENT'"> <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>
|
|
|
@@ -78,11 +78,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')
|
|
|
|
|
|
@@ -93,11 +100,14 @@ export default {
|
|
|
isOpen: false,
|
|
|
dialogVisible: false,
|
|
|
clipboard: {},
|
|
|
- showShare: false
|
|
|
+ showShare: false,
|
|
|
+ showLinkBox: false,
|
|
|
+ tel: ''
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- SearchBox
|
|
|
+ SearchBox,
|
|
|
+ LinkSalerBox
|
|
|
},
|
|
|
mounted () {
|
|
|
let _this = this
|
|
|
@@ -166,71 +176,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)
|
|
|
},
|
|
|
+// 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()
|