Commit 8d6bbfc3 by 王志慧

--no commit message

1 parent e0701f78
...@@ -11,7 +11,7 @@ module.exports = { ...@@ -11,7 +11,7 @@ module.exports = {
envVersion: "develop", envVersion: "develop",
title: '嘀加企微管家', title: '嘀加企微管家',
request: { request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -124,14 +124,14 @@ export default { ...@@ -124,14 +124,14 @@ export default {
methods: { methods: {
//初始化微信接口 //初始化微信接口
initWx() { initWx() {
wxConfig.init(['openEnterpriseChat','openExistedChatWithMsg']).then(() => {}) wxConfig.init(['openEnterpriseChat', 'openExistedChatWithMsg']).then(() => {})
}, },
// 创建群聊or进入群聊 // 创建群聊or进入群聊
addGroup() { addGroup() {
console.log(this.addGroupParams, '-----') console.log(this.addGroupParams, '-----')
if (this.addGroupParams.chatId == '') { if (this.addGroupParams.chatId == '') {
wxConfig.openEnterpriseChat(this.addGroupParams).then(res => { wxConfig.openEnterpriseChat(this.addGroupParams).then(res => {
console.log(res,'res') console.log(res, 'res')
this.insertParams.chatId = res.chatId this.insertParams.chatId = res.chatId
this.insertParams.externalUserId = this.userId this.insertParams.externalUserId = this.userId
this.insertParams.templateId = this.templateId this.insertParams.templateId = this.templateId
...@@ -201,8 +201,12 @@ export default { ...@@ -201,8 +201,12 @@ export default {
for (var a = 0; a < this.groupList.length; a++) { for (var a = 0; a < this.groupList.length; a++) {
if (!this.vehicleInfoList) { if (!this.vehicleInfoList) {
if (this.groupList[a].groupNameRule == 1) { if (this.groupList[a].groupNameRule == 1) {
if (this.remark) {
this.groupList[a].groupName = this.remark + this.groupList[a].groupName
} else {
this.groupList[a].groupName = this.businessCard.customerName + this.groupList[a].groupName this.groupList[a].groupName = this.businessCard.customerName + this.groupList[a].groupName
} }
}
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
} }
...@@ -244,8 +248,7 @@ export default { ...@@ -244,8 +248,7 @@ export default {
let externalUserId = id let externalUserId = id
this.addGroupParams.externalUserIds.push(id) this.addGroupParams.externalUserIds.push(id)
this.getCustomerInfo(externalUserId) this.getCustomerInfo(externalUserId)
} } else {
else {
wxConfig.init(['getCurExternalContact', 'openEnterpriseChat', 'openExistedChatWithMsg']).then(() => { wxConfig.init(['getCurExternalContact', 'openEnterpriseChat', 'openExistedChatWithMsg']).then(() => {
//获取userId //获取userId
wxConfig wxConfig
...@@ -273,79 +276,79 @@ export default { ...@@ -273,79 +276,79 @@ export default {
}, },
//初始化微信接口 //初始化微信接口
//初始化微信接口 //初始化微信接口
initWx() { // initWx() {
this.showLoading() // this.showLoading()
wxConfig.init(['getCurExternalContact', 'openEnterpriseChat', 'openExistedChatWithMsg']).then(() => { // wxConfig.init(['getCurExternalContact', 'openEnterpriseChat', 'openExistedChatWithMsg']).then(() => {
//获取userId // //获取userId
wxConfig // wxConfig
.getCurExternalContact() // .getCurExternalContact()
.then(userId => { // .then(userId => {
console.log(userId, '11111') // console.log(userId, '11111')
this.userId = userId // this.userId = userId
let externalUserId = userId // let externalUserId = userId
this.addGroupParams.externalUserIds.push(userId) // this.addGroupParams.externalUserIds.push(userId)
//获取客户信息 // //获取客户信息
groupChat.getDetail({ userId: externalUserId }).then(res => { // groupChat.getDetail({ userId: externalUserId }).then(res => {
console.log(res, 'data') // console.log(res, 'data')
this.hideLoading() // this.hideLoading()
this.flag = true // this.flag = true
this.businessCard = res.info // this.businessCard = res.info
this.vehicleInfoList = res.vehicleInfoList // this.vehicleInfoList = res.vehicleInfoList
groupChat.getList({ externalUserId: externalUserId }).then(res => { // groupChat.getList({ externalUserId: externalUserId }).then(res => {
console.log(res, '444') // console.log(res, '444')
this.groupList = res || [] // this.groupList = res || []
this.showRemark = res && res.length ? false : true // this.showRemark = res && res.length ? false : true
if (res) { // if (res) {
for (var a = 0; a < this.groupList.length; a++) { // for (var a = 0; a < this.groupList.length; a++) {
if (!this.vehicleInfoList) { // if (!this.vehicleInfoList) {
if (this.groupList[a].groupNameRule == 1) { // if (this.groupList[a].groupNameRule == 1) {
this.groupList[a].groupName = this.businessCard.customerName + this.groupList[a].groupName // this.groupList[a].groupName = this.businessCard.customerName + this.groupList[a].groupName
} // }
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 {
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 == 1) { // if (this.groupList[a].groupNameRule == 1) {
if (!this.vehicleInfoList[0].vehicleTrain) { // if (!this.vehicleInfoList[0].vehicleTrain) {
this.vehicleInfoList[0].vehicleTrain = '' // this.vehicleInfoList[0].vehicleTrain = ''
} // }
// this.groupList[a].groupName = `${this.businessCard.customerName}${this.groupList[a].groupName}` // // 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 // this.groupList[a].groupName = this.vehicleInfoList[0].vehicleTrain + this.businessCard.customerName + this.groupList[a].groupName
} // }
if (this.groupList[a].groupNameRule == 2) { // if (this.groupList[a].groupNameRule == 2) {
if (!this.vehicleInfoList[0].vehicleTrain) { // if (!this.vehicleInfoList[0].vehicleTrain) {
this.vehicleInfoList[0].vehicleTrain = '' // this.vehicleInfoList[0].vehicleTrain = ''
} // }
if (!this.vehicleInfoList[0].vehicleNo) { // if (!this.vehicleInfoList[0].vehicleNo) {
this.vehicleInfoList[0].vehicleNo = '' // this.vehicleInfoList[0].vehicleNo = ''
} // }
this.groupList[a].groupName = this.vehicleInfoList[0].vehicleTrain + this.vehicleInfoList[0].vehicleNo + this.groupList[a].groupName // this.groupList[a].groupName = this.vehicleInfoList[0].vehicleTrain + this.vehicleInfoList[0].vehicleNo + this.groupList[a].groupName
} // }
} // }
} // }
} // }
}) // })
}) // })
}) // })
.catch(e => { // .catch(e => {
this.hideLoading() // this.hideLoading()
Dialog.alert({ // Dialog.alert({
title: '提示', // title: '提示',
message: '该功能暂不支持在群侧边栏打开', // message: '该功能暂不支持在群侧边栏打开',
confirmButtonText: '知道了', // confirmButtonText: '知道了',
confirmButtonColor: '#3975c6' // confirmButtonColor: '#3975c6'
}).then(() => { // }).then(() => {
wx.closeWindow() // wx.closeWindow()
}) // })
}) // })
}) // })
} // }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!