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'
export default {
/**获取群聊列表 */
getList(data) {
data.method = 'entmicro.api.one.template.list'
// 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) {
data.method = 'entmicro.api.one.template.list.qyclient'
data.pageSize = 9999
data.pageNum = 1
return window.$HTTP({
......@@ -11,14 +30,14 @@ export default {
data
})
},
/** 根据userid获取客户详情 */
getDetail(data) {
data.method = 'entmicro.api.customer.detail'
return window.$HTTP({
url,
data
})
},
/** 根据userid获取客户详情 */
getDetail(data) {
data.method = 'entmicro.api.customer.externalUserId'
return window.$HTTP({
url,
data
})
},
/** 保存新的群聊 */
addChat(data) {
data.method = 'entmicro.api.group.one.insert'
......
......@@ -9,7 +9,10 @@
<img class="img" :src="businessCard.avatar" alt="" />
</div>
<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">
<!-- <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="" />
......@@ -106,6 +109,7 @@ export default {
customerSex: '',
avatar: ''
},
remark: '',
vehicleInfoList: [],
groupList: [],
flag: false
......@@ -114,7 +118,7 @@ export default {
activated() {},
deactivated() {},
mounted() {
this.initWx()
this.initData()
},
methods: {
// 创建群聊or进入群聊
......@@ -168,10 +172,99 @@ export default {
this.show = true
} else {
this.addGroupParams.chatId = item.chatId
console.log(this.addGroupParams.chatId, ' this.addGroupParams.chatId')
wxConfig.openExistedChatWithMsg({ chatId: this.addGroupParams.chatId }).then(res => {})
}
// 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() {
this.showLoading()
......@@ -204,7 +297,7 @@ export default {
if (this.groupList[a].groupNameRule == 0) {
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
}
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!