Commit 4087b6e4 by 王志慧

1.2.1版本修改

1 parent 374f7ff0
// const url = 'http://192.168.2.42:8064/rop-scrm-entmicro/router' // const url = 'http://192.168.1.64:8064/rop-scrm-entmicro/router'
const url = '/rop-scrm-entmicro/router' const url = '/rop-scrm-entmicro/router'
export default { export default {
/**获取群聊列表 */ /**获取群聊列表 */
// getList(data) {
// data.method = 'entmicro.api.one.template.list'
// data.pageSize = 9999
// data.pageNum = 1
// return window.$HTTP({
// url,
// data
// })
// },
// /** 根据userid获取客户详情 */
// getDetail(data) {
// data.method = 'entmicro.api.customer.detail'
// return window.$HTTP({
// url,
// data
// })
// },
/**获取群聊列表 */
getList(data) { getList(data) {
data.method = 'entmicro.api.one.template.list' data.method = 'entmicro.api.one.template.list.qyclient'
data.pageSize = 9999 data.pageSize = 9999
data.pageNum = 1 data.pageNum = 1
return window.$HTTP({ return window.$HTTP({
...@@ -13,7 +32,7 @@ export default { ...@@ -13,7 +32,7 @@ export default {
}, },
/** 根据userid获取客户详情 */ /** 根据userid获取客户详情 */
getDetail(data) { getDetail(data) {
data.method = 'entmicro.api.customer.detail' data.method = 'entmicro.api.customer.externalUserId'
return window.$HTTP({ return window.$HTTP({
url, url,
data data
......
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
<img class="img" :src="businessCard.avatar" alt="" /> <img class="img" :src="businessCard.avatar" alt="" />
</div> </div>
<div class="customerTextBox"> <div class="customerTextBox">
<div class="title text-hide">{{ businessCard.customerName }}</div> <div class="title text-hide">
{{ businessCard.customerName }}
<span v-if="remark">({{ remark }})</span>
</div>
<div class="icons" v-if="businessCard.customerSex == 0 ? false : true"> <div class="icons" v-if="businessCard.customerSex == 0 ? false : true">
<!-- <img :src='businessCard.customerSex == 1 ? "@/assets/images/icon/manIcon.png" : "@/assets/images/icon/womanIcon.png"' alt="" /> --> <!-- <img :src='businessCard.customerSex == 1 ? "@/assets/images/icon/manIcon.png" : "@/assets/images/icon/womanIcon.png"' alt="" /> -->
<img class="customerIcon" v-if="businessCard.customerSex == 1 ? false : true" src="@/assets/images/icon/womanIcon.png" alt="" /> <img class="customerIcon" v-if="businessCard.customerSex == 1 ? false : true" src="@/assets/images/icon/womanIcon.png" alt="" />
...@@ -106,6 +109,7 @@ export default { ...@@ -106,6 +109,7 @@ export default {
customerSex: '', customerSex: '',
avatar: '' avatar: ''
}, },
remark: '',
vehicleInfoList: [], vehicleInfoList: [],
groupList: [], groupList: [],
flag: false flag: false
...@@ -114,7 +118,7 @@ export default { ...@@ -114,7 +118,7 @@ export default {
activated() {}, activated() {},
deactivated() {}, deactivated() {},
mounted() { mounted() {
this.initWx() this.initData()
}, },
methods: { methods: {
// 创建群聊or进入群聊 // 创建群聊or进入群聊
...@@ -168,10 +172,99 @@ export default { ...@@ -168,10 +172,99 @@ export default {
this.show = true this.show = true
} else { } else {
this.addGroupParams.chatId = item.chatId this.addGroupParams.chatId = item.chatId
console.log(this.addGroupParams.chatId, ' this.addGroupParams.chatId')
wxConfig.openExistedChatWithMsg({ chatId: this.addGroupParams.chatId }).then(res => {}) wxConfig.openExistedChatWithMsg({ chatId: this.addGroupParams.chatId }).then(res => {})
} }
// console.log(this.addGroupParams) // console.log(this.addGroupParams)
}, },
getCustomerInfo(externalUserId) {
//获取客户信息
groupChat.getDetail({ userId: externalUserId }).then(res => {
console.log(res, 'data')
this.hideLoading()
this.flag = true
this.businessCard = res.info
this.vehicleInfoList = res.vehicleInfoList
if (res.staffFollows && res.staffFollows.length > 0 && res.staffFollows[0].remark) {
this.remark = res.staffFollows[0].remark
}
groupChat.getList({ externalUserId: externalUserId }).then(res => {
this.groupList = res || []
this.showRemark = res && res.length ? false : true
if (res) {
for (var a = 0; a < this.groupList.length; a++) {
if (!this.vehicleInfoList) {
if (this.groupList[a].groupNameRule == 1) {
this.groupList[a].groupName = this.businessCard.customerName + this.groupList[a].groupName
}
if (this.groupList[a].groupNameRule == 0) {
this.groupList[a].groupName = this.groupList[a].groupName
}
if (this.groupList[a].groupNameRule == 2) {
this.groupList[a].groupName = this.groupList[a].groupName
}
} else {
if (this.groupList[a].groupNameRule == 0) {
this.groupList[a].groupName = this.groupList[a].groupName
}
if (this.groupList[a].groupNameRule == 1) {
if (!this.vehicleInfoList[0].vehicleTrain) {
this.vehicleInfoList[0].vehicleTrain = ''
}
// this.groupList[a].groupName = `${this.businessCard.customerName}${this.groupList[a].groupName}`
this.groupList[a].groupName = this.vehicleInfoList[0].vehicleTrain + this.businessCard.customerName + this.groupList[a].groupName
}
if (this.groupList[a].groupNameRule == 2) {
if (!this.vehicleInfoList[0].vehicleTrain) {
this.vehicleInfoList[0].vehicleTrain = ''
}
if (!this.vehicleInfoList[0].vehicleNo) {
this.vehicleInfoList[0].vehicleNo = ''
}
this.groupList[a].groupName = this.vehicleInfoList[0].vehicleTrain + this.vehicleInfoList[0].vehicleNo + this.groupList[a].groupName
}
}
}
}
})
})
},
initData() {
let { id } = this.getQuery()
console.log(id)
this.showLoading()
if (id) {
this.userId = id
let externalUserId = id
this.addGroupParams.externalUserIds.push(id)
this.getCustomerInfo(externalUserId)
} else {
wxConfig.init(['getCurExternalContact', 'openEnterpriseChat', 'openExistedChatWithMsg']).then(() => {
//获取userId
wxConfig
.getCurExternalContact()
.then(userId => {
console.log(userId, '11111')
this.userId = userId
let externalUserId = userId
this.addGroupParams.externalUserIds.push(userId)
this.getCustomerInfo(externalUserId)
})
.catch(e => {
this.hideLoading()
Dialog.alert({
title: '提示',
message: '该功能暂不支持在群侧边栏打开',
confirmButtonText: '知道了',
confirmButtonColor: '#3975c6'
}).then(() => {
wx.closeWindow()
})
})
})
}
},
//初始化微信接口
//初始化微信接口 //初始化微信接口
initWx() { initWx() {
this.showLoading() this.showLoading()
...@@ -204,7 +297,7 @@ export default { ...@@ -204,7 +297,7 @@ export default {
if (this.groupList[a].groupNameRule == 0) { if (this.groupList[a].groupNameRule == 0) {
this.groupList[a].groupName = this.groupList[a].groupName this.groupList[a].groupName = this.groupList[a].groupName
} }
if(this.groupList[a].groupNameRule == 2){ if (this.groupList[a].groupNameRule == 2) {
this.groupList[a].groupName = this.groupList[a].groupName this.groupList[a].groupName = this.groupList[a].groupName
} }
} else { } else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!