Commit 32be64e4 by zhouzy

1

1 parent 6d2c0b6c
...@@ -271,7 +271,16 @@ const WxConfig = { ...@@ -271,7 +271,16 @@ const WxConfig = {
}) })
}, },
/**打开已有群聊 */
openExistedChatWithMsg(params) {
return new Promise((resolve) => {
wx.invoke('openExistedChatWithMsg', params, res => {
if (res.err_msg == "openExistedChatWithMsg:ok") {
resolve(res)
}
})
})
},
/**使用企业微信内置地图查看位置接口 */ /**使用企业微信内置地图查看位置接口 */
openLocation(obj) { openLocation(obj) {
/** /**
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="business-card"> <div class="business-card">
<div class="business-card-top"> <div class="business-card-top">
<div class="imgBox"> <div class="imgBox">
<!-- <img :src="businessCard.avatar" alt="" /> --> <img :src="businessCard.avatar" alt="" />
</div> </div>
<div class="textBox"> <div class="textBox">
<div class="title">{{ businessCard.customerName }}</div> <div class="title">{{ businessCard.customerName }}</div>
...@@ -23,25 +23,25 @@ ...@@ -23,25 +23,25 @@
<div class="groups-item-top"> <div class="groups-item-top">
<div class="imgBox"> <div class="imgBox">
<div class="itemsBox"> <div class="itemsBox">
<!-- <template v-if="item.userList"> --> <template v-if="item.userList">
<!-- <div :style="{ 'width': item.imgs.length > 4 ? 14.67 : (item.imgs.length > 1 ? 22 : 44) + 'px', 'height': item.imgs.length > 4 ? 14.67 : (item.imgs.length > 1 ? 22 : 44) + 'px' }" v-for="img in item.imgs" :key='img.id'> --> <!-- <div :style="{ 'width': item.imgs.length > 4 ? 14.67 : (item.imgs.length > 1 ? 22 : 44) + 'px', 'height': item.imgs.length > 4 ? 14.67 : (item.imgs.length > 1 ? 22 : 44) + 'px' }" v-for="img in item.imgs" :key='img.id'> -->
<!-- <div :class="[item.userList.length > 4 ? 'head-img-five' : item.userList.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="user in item.userList" :key="user.id"> --> <div :class="[item.userList.length > 4 ? 'head-img-five' : item.userList.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="user in item.userList" :key="user.id">
<img src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" alt="" /> <img src=".\imgs\user.png" alt="" />
<!-- </div> --> </div>
<!-- </template> --> </template>
</div> </div>
</div> </div>
<div class="textBox"> <div class="textBox">
<div class="title">{{ item.groupName }}</div> <div class="title">{{ item.groupName }}{{ '(' + item.userList.length + ')' }}</div>
<div class="nameBox"> <div class="nameBox">
<span class="wechatNumber" v-for="user in item.userList" :key="user.id">{{ '@' + user.userName }}</span> <span class="wechatNumber" v-for="user in item.userList" :key="user.id">{{ '@' + user.staffName }}</span>
</div> </div>
</div> </div>
<van-button @click="showDialog(item)" style="margin-left: auto" size="small" color="#5850FF">{{ item.chatId == null ? '创建群聊' : '加入群聊' }}</van-button> <van-button @click="showDialog(item)" style="margin-left: auto" size="small" color="#5850FF">{{ item.chatId == null ? '创建群聊' : '加入群聊' }}</van-button>
</div> </div>
<div class="groups-item-bottom"> <div class="groups-item-bottom">
<div class="welcomeTitle">入群欢迎语</div> <div class="welcomeTitle">入群欢迎语</div>
<div class="welcomeWords" v-for="content in item.attachmentList" :key="content.index">{{content.attType==1? content.attContent:''}}</div> <div class="welcomeWords" v-for="content in item.attachmentList" :key="content.index">{{ content.attType == 1 ? content.attContent : '' }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
<div>外部客户群聊</div> <div>外部客户群聊</div>
<div class="imgBox" style="margin-left: 93px; width: 132px; height: 132px; margin-top: 16px; margin-bottom: 34px"> <div class="imgBox" style="margin-left: 93px; width: 132px; height: 132px; margin-top: 16px; margin-bottom: 34px">
<div class="itemsBox"> <div class="itemsBox">
<!-- <div <div
:class="[dialogMessage.length > 4 ? 'head-img-five-dialog' : dialogMessage.length > 1 ? 'head-img-two-dialog' : 'head-img-one-dialog', 'head-img']" :class="[dialogMessage.length > 4 ? 'head-img-five-dialog' : dialogMessage.length > 1 ? 'head-img-two-dialog' : 'head-img-one-dialog', 'head-img']"
v-for="user in dialogMessage" v-for="user in dialogMessage"
:key="user.id" :key="user.id"
> --> >
<img src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" alt="" /> <img src=".\imgs\user.png" alt="" />
<!-- </div> --> </div>
</div> </div>
</div> </div>
</van-dialog> </van-dialog>
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
name: 'index', name: 'index',
data() { data() {
return { return {
templateId:'', templateId: '',
userId: '', userId: '',
show: false, show: false,
// headImg: { // headImg: {
...@@ -93,9 +93,9 @@ export default { ...@@ -93,9 +93,9 @@ export default {
dialogMessage: [], dialogMessage: [],
insertParams: { insertParams: {
templateId: '', templateId: '',
serialVersionUID:'', serialVersionUID: '',
chatId: '', chatId: '',
userId:'' userId: ''
}, },
addGroupParams: { addGroupParams: {
externalUserIds: [], externalUserIds: [],
...@@ -117,15 +117,18 @@ export default { ...@@ -117,15 +117,18 @@ export default {
this.initWx() this.initWx()
}, },
methods: { methods: {
// 创建群聊 // 创建群聊or进入群聊
addGroup() { addGroup() {
window.$wx.openEnterpriseChat(this.addGroupParams).then(res => { window.$wx.openEnterpriseChat(this.addGroupParams).then(res => {
this.insertParams.chatId = res.chatId this.insertParams.chatId = res.chatId
this.insertParams.userId = this.userId this.insertParams.userId = this.userId
this.insertParams.templateId = this.templateId this.insertParams.templateId = this.templateId
console.log(this.insertParams,'99999999'); console.log(this.insertParams, '99999999')
//打开已有群聊
groupChat.openExistedChatWithMsg({ chatId: this.insertParams.chatId }).then(res => {})
//保存新群
groupChat.addChat(this.insertParams).then(res => { groupChat.addChat(this.insertParams).then(res => {
console.log(res,'???'); console.log(res, '???')
}) })
}) })
}, },
...@@ -133,41 +136,41 @@ export default { ...@@ -133,41 +136,41 @@ export default {
this.dialogMessage = item.userList this.dialogMessage = item.userList
this.show = true this.show = true
this.addGroupParams.externalUserIds.push(this.userId) this.addGroupParams.externalUserIds.push(this.userId)
for(var i=0;i<item.userList.length;i++){ for (var i = 0; i < item.userList.length; i++) {
this.addGroupParams.userIds.push(item.userList[i].id) this.addGroupParams.userIds.push(item.userList[i].id)
} }
this.addGroupParams.groupName = item.groupName this.addGroupParams.groupName = item.groupName
if(item.chatId == null){ if (item.chatId == null) {
this.addGroupParams.chatId = '' this.addGroupParams.chatId = ''
}else{ } else {
this.addGroupParams.chatId = item.chatId this.addGroupParams.chatId = item.chatId
} }
this.templateId = item.id this.templateId = item.id
console.log(this.addGroupParams); console.log(this.addGroupParams)
}, },
//初始化微信接口 //初始化微信接口
initWx() { initWx() {
window.$wx = wxConfig window.$wx = wxConfig
window.$wx.init(['getCurExternalContact', 'openEnterpriseChat']).then(() => { window.$wx.init(['getCurExternalContact', 'openEnterpriseChat', 'openExistedChatWithMsg']).then(() => {
//获取userId //获取userId
window.$wx.getCurExternalContact().then(res => { window.$wx.getCurExternalContact().then(res => {
console.log(res,'11111'); console.log(res, '11111')
this.userId = res this.userId = res
let externalUserId = this.userId let externalUserId = this.userId
let merchantId = 1 let merchantId = 1
//获取客户信息 //获取客户信息
groupChat.getDetail({ externalUserId,merchantId }).then(res => { groupChat.getDetail({ externalUserId, merchantId }).then(res => {
console.log(res, '333') console.log(res, '333')
}) })
//获取列表信息 //获取列表信息
groupChat.getList({ externalUserId,merchantId }).then(res => { groupChat.getList({ externalUserId, merchantId }).then(res => {
console.log(res, '444') console.log(res, '444')
// this.groupList = res // this.groupList = res
this.groupList = res.data this.groupList = res.data
}) })
}) })
}) })
}, }
} }
} }
</script> </script>
...@@ -185,6 +188,7 @@ export default { ...@@ -185,6 +188,7 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
overflow-y: auto; overflow-y: auto;
overflow: hidden;
} }
.business-card { .business-card {
margin: 0; margin: 0;
...@@ -199,6 +203,7 @@ export default { ...@@ -199,6 +203,7 @@ export default {
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
width: 232px; width: 232px;
margin-left: 55px; margin-left: 55px;
margin-top: 10px;
} }
.business-card-top { .business-card-top {
display: flex; display: flex;
...@@ -374,4 +379,11 @@ export default { ...@@ -374,4 +379,11 @@ export default {
.name { .name {
color: #5850ff; color: #5850ff;
} }
.container-top-title {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #3a3a3a;
line-height: 22px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="top"> <div class="top">
<div class="top-title">{{ massTitle }}直播活动</div> <div class="top-title">{{ massTitle }}直播活动</div>
<div class="iconBox" @click="copyMessage(this.massMessage)"> <div class="iconBox" @click="copyMessage(this.massMessage)">
<img src=".\imgs\copy.png" alt=""> <img src=".\imgs\copy.png" alt="" />
</div> </div>
</div> </div>
<div class="mass-message">{{ massMessage }}</div> <div class="mass-message">{{ massMessage }}</div>
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
<div class="imgBox"> <div class="imgBox">
<img src="" alt="" /> <img src="" alt="" />
</div> </div>
<div class="fixedButtom"> </div>
<div class="fixedButtom">
<div class="line-container">
<div class="buttomLine"></div> <div class="buttomLine"></div>
</div> </div>
</div> </div>
...@@ -45,21 +47,34 @@ export default { ...@@ -45,21 +47,34 @@ export default {
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
bottom: 0; bottom: 0;
background: #241f1f; background: #fff;
opacity: 1; opacity: 1;
z-index: 99; z-index: 99;
align-items: center; align-items: center;
height: 5px;
width: 100%; width: 100%;
padding: 21px 0px 8px 0px; padding: 21px 0px 0px 0px;
}
.buttomLine {
width: 134px;
height: 5px;
background: #000000;
border-radius: 100px;
margin-top: 21px;
}
.line-container {
display: flex;
height: 34px;
border-top: 1px solid #f7f7f7;
margin-left: 120px;
} }
.container { .container {
background: #f7f7f7; background: #f7f7f7;
padding: 16px 16px 0px 16px; padding: 16px 16px 0px 16px;
height: 100px;
} }
.box { .box {
margin: 0; margin: 0;
padding: 14px 10px 0px 10px; padding: 14px 10px 103px 10px;
border: 0; border: 0;
outline: 0; outline: 0;
font-size: 100%; font-size: 100%;
...@@ -68,12 +83,13 @@ export default { ...@@ -68,12 +83,13 @@ export default {
background: #fff; background: #fff;
-webkit-box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); -webkit-box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
margin-bottom: 24px;
} }
.top{ .top {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding-bottom: 15px; padding-bottom: 15px;
border-bottom: 1px solid #eee ; border-bottom: 1px solid #eee;
} }
.top-title { .top-title {
font-size: 14px; font-size: 14px;
...@@ -82,17 +98,29 @@ export default { ...@@ -82,17 +98,29 @@ export default {
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
} }
.iconBox{ .iconBox {
width: 18px; width: 18px;
height: 20px; height: 20px;
margin-left: auto margin-left: auto;
}
.mass-message {
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 16px;
word-wrap: break-word;
margin-top: 13px;
}
.imgBox {
width: 169px;
height: 300px;
margin-top: 10px;
} }
.mass-message{ .mass-time {
font-family: PingFangSC-Regular, PingFang SC; font-size: 12px;
font-weight: 400; font-family: PingFangSC-Regular, PingFang SC;
color: #666666; font-weight: 400;
line-height: 16px; color: #666666;
word-wrap:break-word; line-height: 16px;
margin-top: 13px;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!