Commit 8d6bbfc3 by 王志慧

--no commit message

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