Commit d2961911 by zhouzy

3

1 parent a430e983
......@@ -23,17 +23,19 @@
<div class="groups-item-top">
<div class="imgBox">
<div class="itemsBox">
<!-- <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.imgs.length > 4 ? 'head-img-five' : item.imgs.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="img in item.imgs" :key="img.id">
<img :src="img.url" alt="" />
</div>
<template v-if="item.imgs">
<!-- <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.imgs.length > 4 ? 'head-img-five' : item.imgs.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="img in item.imgs" :key="img.id">
<img :src="img.url" alt="" />
</div>
</template>
</div>
</div>
<div class="textBox">
<div class="title">{{ item.orgName }}</div>
<div class="wechatNumber">{{ item.groupName }}</div>
</div>
<van-button @click="showDialog" style="margin-left: auto" size="small" color="#5850FF">{{ item.chatId ? '加入群聊' : '创建群聊' }}</van-button>
<van-button @click="showDialog(item.imgs)" style="margin-left: auto" size="small" color="#5850FF">{{ item.chatId ? '加入群聊' : '创建群聊' }}</van-button>
</div>
<div class="groups-item-bottom">
<div class="welcomeTitle">入群欢迎语</div>
......@@ -49,12 +51,11 @@
并新建一个
</div>
<div>外部客户群聊</div>
<div class="imgBox">
<div class="imgBox" style="margin-left:93px;width:132px;height:132px;">
<div class="itemsBox">
<!-- <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.imgs.length > 4 ? 'head-img-five' : item.imgs.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="img in item.imgs" :key="img.id">
<img :src="img.url" alt="" />
</div>
<div :class="[dialogImgs.length > 4 ? 'head-img-five' : dialogImgs.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="img in dialogImgs" :key="img.id">
<img :src="img.url" alt="" />
</div>
</div>
</div>
</van-dialog>
......@@ -63,8 +64,8 @@
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { groupChat, wx_config } from '@/api'
export default {
name: '',
data() {
......@@ -81,6 +82,14 @@ export default {
// 8: 14.67,
// 9: 14.67,
// },
dialogImgs: [],
selectListParams: {
id: '',
status: '',
orgName: '',
pageSize: '',
pageNum: ''
},
businessCard: {
name: 'songshu',
wechatNumber: '18207493352',
......@@ -102,7 +111,7 @@ export default {
hasgroup: '1'
},
{
id: '0',
id: '1',
orgName: 'songshu1',
groupName: '@songshu1',
welcome: '欢迎songshu2',
......@@ -116,7 +125,7 @@ export default {
hasgroup: '1'
},
{
id: '0',
id: '2',
orgName: 'songshu1',
groupName: '@songshu1',
welcome: '欢迎songshu2',
......@@ -130,7 +139,7 @@ export default {
hasgroup: '1'
},
{
id: '0',
id: '3',
orgName: 'songshu1',
groupName: '@songshu1',
welcome: '欢迎songshu2',
......@@ -144,7 +153,7 @@ export default {
hasgroup: '1'
},
{
id: '0',
id: '4',
orgName: 'songshu1',
groupName: '@songshu1',
welcome: '欢迎songshu2',
......@@ -158,7 +167,7 @@ export default {
hasgroup: '1'
},
{
id: '0',
id: '5',
orgName: 'songshu1',
groupName: '@songshu1',
welcome: '欢迎songshu2',
......@@ -168,10 +177,10 @@ export default {
{ id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 3, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }
{ id: 5, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 6, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 7, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
{ id: 8, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }
],
hasgroup: '1'
}
......@@ -189,42 +198,49 @@ export default {
activated() {},
deactivated() {},
mounted() {
//获取userId
wx.invoke('getCurExternalContact', {
}, function(res){
if(res.err_msg == "getCurExternalContact:ok"){
userId = res.userId ; //返回当前外部联系人userId
//获取列表信息
}else {
//错误处理
}
});
//获取列表信息
chatApi
.getList({
})
.then(res => {
})
//配置wx接口
window.$wx = new wx_config(['getCurExternalContact'])
console.log(window.$wx,'111111');
// 获取userId
// window.$wx.getCurExternalContact({}).then(res => {
// console.log(res);
// if (res.data.userId) {
// let userId = res.data.userId
// //获取列表信息
// groupChat.getDetail({ userId }).then(res => {
// if (res.data.chatId) {
// //跳转到会话界面
// wx_config.getList(this.selectListParams).then(res => {
// this.groupList = res.data
// })
// } else {
// //渲染名片
// this.businessCard = res.data
// this.selectListParams = res.data
// //加载群列表
// groupChat.getList(this.selectListParams).then(res => {
// this.groupList = res.data
// })
// }
// })
// } else {
// console.log('用户id不存在')
// }
// })
},
methods: {
showDialog() {
showDialog(imgs) {
this.dialogImgs = imgs
this.show = true
console.log(this.dialogImgs, '111111')
},
// 加入会话
joinCaht(){
},
joinCaht() {},
//创建群聊
addChat(){
}
addChat() {}
}
}
</script>
<style scoped lang='scss'>
</style>
<style>
......@@ -264,8 +280,8 @@ export default {
display: flex;
justify-content: center;
align-items: center;
width: 44px;
height: 44px;
width: 44.01px;
height: 44.01px;
text-align: center;
background: #e1e1e1;
}
......@@ -273,6 +289,7 @@ export default {
display: flex;
justify-content: center;
flex-wrap: wrap-reverse;
text-align: center;
}
.head-img {
display: inline-block;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!