Commit 32be64e4 by zhouzy

1

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