Commit 6e010eee by zhouzy

3

2 parents d2961911 81331e7c
const url = '/rop-scrm-sso/router' const url = 'http://192.168.2.42:8064/rop-scrm-entmicro/router'
const returnAll = true const returnAll = true
export default { export default {
/**获取群聊列表 */ /**获取群聊列表 */
getList(data) { getList(data) {
data.method = 'org.ore.api.one.template.list' data.method = 'org.ore.api.one.template.list'
data.pageSize = 9999
data.pageNum = 1
return window.$HTTP({ return window.$HTTP({
url,
data, data,
returnAll returnAll
}) })
...@@ -13,14 +16,16 @@ export default { ...@@ -13,14 +16,16 @@ export default {
getDetail(data) { getDetail(data) {
data.method = 'org.ore.api.one.template.detail' data.method = 'org.ore.api.one.template.detail'
return window.$HTTP({ return window.$HTTP({
url,
data, data,
returnAll returnAll
}) })
}, },
/** 创建新的群聊 */ /** 保存新的群聊 */
addChat(data) { addChat(data) {
data.method = 'org.ore.api.group.one.insert' data.method = 'org.ore.api.group.one.insert'
return window.$HTTP({ return window.$HTTP({
url,
data, data,
returnAll returnAll
}) })
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
*/ */
import groupChat from './groupChat' import groupChat from './groupChat'
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
import wx_config from './wxConfig' import wxConfig from './wxConfig'
export { export {
ssoApi, ssoApi,
groupChat, groupChat,
wx_config wxConfig
} }
\ No newline at end of file \ No newline at end of file
import util from '@/utils/util' import util from '@/utils/util'
import { Notify } from 'vant' import { Notify } from 'vant'
class WxConfig { const WxConfig = {
constructor(jsApiList) { init(jsApiList) {
jsApiList.map(e => { return new Promise((resolve, reject) => {
if (e == 'chooseImage') jsApiList.push('getLocalImgData') jsApiList.map(e => {
}) if (e == 'chooseImage') jsApiList.push('getLocalImgData')
let [redirectUrl] = window.location.href.split('#') })
const { corpId } = util.getLocalStorage('dj_scrm_corpId') let [redirectUrl] = window.location.href.split('#')
/** 获取企微应用AgentConfig */ const { corpId } = util.getLocalStorage('dj_scrm_corpId')
let data = { /** 获取企微应用AgentConfig */
corpId, let data = {
method: 'scrm.api.work.wechat.get.agent.config', corpId,
url: redirectUrl, method: 'scrm.api.work.wechat.get.agent.config',
appCode: 'DJQWGJ' url: redirectUrl,
} appCode: 'DJQWGJ'
window.$HTTP({
url: '/rop-scrm-wechat/router',
data
}).then(obj => {
if (obj) {
console.log(obj)
wx.agentConfig({
corpid: obj.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: obj.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp: obj.timestamp, // 必填,生成签名的时间戳
nonceStr: obj.nonceStr, // 必填,生成签名的随机串
signature: obj.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法,
jsApiList,
success(res) {
console.log(res)
},
fail(err) {
console.log(err)
}
})
} else {
Notify('网络异常')
} }
window.$HTTP({
url: '/rop-scrm-wechat/router',
data
}).then(obj => {
if (obj) {
wx.agentConfig({
corpid: obj.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: obj.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp: obj.timestamp, // 必填,生成签名的时间戳
nonceStr: obj.nonceStr, // 必填,生成签名的随机串
signature: obj.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法,
jsApiList,
success(res) {
console.log(res, 'wx_config')
resolve()
},
fail(err) {
console.log(err, 'wx_config')
reject()
}
})
} else {
Notify('网络异常')
}
})
}) })
} },
getContext(callBack) { getContext(callBack) {
/** /**
* entry String 场景值 * entry String 场景值
* shareTicket String 仅当转发时设置了withShareTicket转发到会话的消息进入才返回该字段,详见私密消息 * shareTicket String 仅当转发时设置了withShareTicket转发到会话的消息进入才返回该字段,详见私密消息
**/ **/
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.invoke('getContext', {}, ({ err_msg, entry, shareTicket }) => { wx.invoke('getContext', {}, (res) => {
console.log(res)
let { err_msg, entry, shareTicket } = res
/** entry 说明 /** entry 说明
*contact_profile 从联系人详情进入 3.0.24 *contact_profile 从联系人详情进入 3.0.24
*single_chat_tools 从单聊会话的工具栏进入 3.0.24 *single_chat_tools 从单聊会话的工具栏进入 3.0.24
...@@ -65,87 +70,85 @@ class WxConfig { ...@@ -65,87 +70,85 @@ class WxConfig {
} }
}) })
}) })
} },
/**获取当前外部联系人userid */ /**获取当前外部联系人userid */
getCurExternalContact() { getCurExternalContact() {
return this.getContext((resolve, { return new Promise((resolve, reject) => {
entry,
}) => {
wx.invoke('getCurExternalContact', {}, res => { wx.invoke('getCurExternalContact', {}, res => {
if (entry == 'contact_profile' || entry == 'single_chat_tools') { if (res.err_msg == 'getCurExternalContact:ok') {
if (res.err_msg == 'getCurExternalContact:ok') { resolve(res.userId)
resolve(res.userId)
}
} else { } else {
Notify('需有配置客户联系功能权限') reject(res)
} }
})
})
},
/** 外部联系人选人接口 */
selectExternalContact() {
return new Promise((resolve) => {
wx.invoke('selectExternalContact', {
filterType: 0, //0表示展示全部外部联系人列表,1表示仅展示未曾选择过的外部联系人。默认值为0;除了0与1,其他值非法。在企业微信2.4.22及以后版本支持该参数
}, res => {
if (res.err_msg == "selectExternalContact:ok") {
resolve(res)
}
}) })
}) })
}
},
/**分享消息到当前会话 */ /**分享消息到当前会话 */
sendChatMessage(params) { sendChatMessage(params) {
return this.getContext((resolve, { console.log(params)
entry, return new Promise((resolve) => {
shareTicket
}) => {
wx.invoke('sendChatMessage', params, res => { wx.invoke('sendChatMessage', params, res => {
if (entry == 'chat_attachment') { console.log(res)
if (res.err_msg == 'sendChatMessage:ok') { if (res.err_msg == 'sendChatMessage:ok') {
resolve() resolve()
}
} else {
Notify('需有配置客户联系功能权限')
} }
}) })
}) })
} },
/**群发消息给客户 */ /**群发消息给客户 */
shareToExternalContact(params) { shareToExternalContact(params) {
return this.getContext(resolve => { return new Promise((resolve) => {
wx.invoke('shareToExternalContact', params, res => { wx.invoke('shareToExternalContact', params, res => {
if (res.err_msg == 'shareToExternalContact:ok') { if (res.err_msg == 'shareToExternalContact:ok') {
resolve() resolve()
} else {
Notify('需有配置客户联系功能权限')
} }
}) })
}) })
} },
/**群发消息到客户群 */ /**群发消息到客户群 */
shareToExternalChat(params) { shareToExternalChat(params) {
return this.getContext(resolve => { return new Promise((resolve) => {
wx.invoke('shareToExternalChat', params, res => { wx.invoke('shareToExternalChat', params, res => {
if (res.err_msg == 'shareToExternalChat:ok') { if (res.err_msg == 'shareToExternalChat:ok') {
resolve() resolve()
} else {
Notify('需有配置客户联系功能权限')
} }
}) })
}) })
} },
/**进入添加客户界面 */ /**进入添加客户界面 */
navigateToAddCustomer() { navigateToAddCustomer() {
wx.invoke('navigateToAddCustomer') wx.invoke('navigateToAddCustomer')
} },
/**发表内容到客户朋友圈 */ /**发表内容到客户朋友圈 */
shareToExternalMoments(params) { shareToExternalMoments(params) {
return this.getContext(resolve => { return new Promise((resolve) => {
wx.invoke('shareToExternalMoments', params, res => { wx.invoke('shareToExternalMoments', params, res => {
if (res.err_msg == 'shareToExternalMoments:ok') { if (res.err_msg == 'shareToExternalMoments:ok') {
resolve() resolve()
} else {
Notify('需有配置客户联系功能权限')
} }
}) })
}) })
} },
/**打开会话 */ /**打开会话 */
openEnterpriseChat({ openEnterpriseChat({
...@@ -173,7 +176,7 @@ class WxConfig { ...@@ -173,7 +176,7 @@ class WxConfig {
} }
}) })
}) })
} },
/**企业微信扫一扫 */ /**企业微信扫一扫 */
scanQRCode(needResult) { scanQRCode(needResult) {
...@@ -192,7 +195,7 @@ class WxConfig { ...@@ -192,7 +195,7 @@ class WxConfig {
} }
}) })
}) })
} },
/**获取本地图片接口 */ /**获取本地图片接口 */
getLocalImgData(localId) { getLocalImgData(localId) {
...@@ -207,7 +210,7 @@ class WxConfig { ...@@ -207,7 +210,7 @@ class WxConfig {
} }
}) })
}) })
} },
/**拍照或从手机相册中选图接口 */ /**拍照或从手机相册中选图接口 */
chooseImage(count = 1) { chooseImage(count = 1) {
...@@ -231,7 +234,7 @@ class WxConfig { ...@@ -231,7 +234,7 @@ class WxConfig {
} }
}) })
}) })
} },
/**预览图片接口 */ /**预览图片接口 */
previewImage(obj) { previewImage(obj) {
...@@ -239,7 +242,7 @@ class WxConfig { ...@@ -239,7 +242,7 @@ class WxConfig {
* urls 需要预览的图片http链接列表 * urls 需要预览的图片http链接列表
*/ */
wx.previewImage(obj) wx.previewImage(obj)
} },
/**上传图片接口 */ /**上传图片接口 */
uploadImage(localId) { uploadImage(localId) {
...@@ -253,7 +256,7 @@ class WxConfig { ...@@ -253,7 +256,7 @@ class WxConfig {
} }
}) })
}) })
} },
/**下载图片接口 */ /**下载图片接口 */
downloadImage(serverId) { downloadImage(serverId) {
...@@ -267,7 +270,7 @@ class WxConfig { ...@@ -267,7 +270,7 @@ class WxConfig {
}) })
}) })
} },
/**使用企业微信内置地图查看位置接口 */ /**使用企业微信内置地图查看位置接口 */
openLocation(obj) { openLocation(obj) {
...@@ -279,7 +282,7 @@ class WxConfig { ...@@ -279,7 +282,7 @@ class WxConfig {
scale, // 地图缩放级别,整形值,范围从1~28。默认为16 scale, // 地图缩放级别,整形值,范围从1~28。默认为16
*/ */
wx.openLocation(obj) wx.openLocation(obj)
} },
/**获取地理位置接口 */ /**获取地理位置接口 */
getLocation(type = 'wgs84') { getLocation(type = 'wgs84') {
...@@ -291,7 +294,7 @@ class WxConfig { ...@@ -291,7 +294,7 @@ class WxConfig {
} }
}) })
}) })
} },
/**自定义转发到会话 */ /**自定义转发到会话 */
shareAppMessage(obj) { shareAppMessage(obj) {
......
...@@ -23,19 +23,21 @@ ...@@ -23,19 +23,21 @@
<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.imgs"> <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.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"> <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="img.url" alt="" /> <img :src="user.avatar" alt="" />
</div> </div>
</template> </template>
</div> </div>
</div> </div>
<div class="textBox"> <div class="textBox">
<div class="title">{{ item.orgName }}</div> <div class="title">{{ item.groupName }}</div>
<div class="wechatNumber">{{ item.groupName }}</div> <div class="nameBox">
<span class="wechatNumber" v-for="user in item.userList" :key="user.id">{{ '@' + user.userName }}</span>
</div>
</div> </div>
<van-button @click="showDialog(item.imgs)" style="margin-left: auto" size="small" color="#5850FF">{{ item.chatId ? '加入群聊' : '创建群聊' }}</van-button> <van-button @click="showDialog(item)" style="margin-left: auto" size="small" color="#5850FF">{{ item.chatId ? '加入群聊' : '创建群聊' }}</van-button>
</div> </div>
<div class="groups-item-bottom"> <div class="groups-item-bottom">
<div class="welcomeTitle">入群欢迎语</div> <div class="welcomeTitle">入群欢迎语</div>
...@@ -44,18 +46,18 @@ ...@@ -44,18 +46,18 @@
</div> </div>
</div> </div>
</div> </div>
<van-dialog class="dialog" v-model="show" title="创建新群" message="邀请客户并创建一个群聊" show-cancel-button show-confirm-button confirm-button-color="black" allowHtml> <van-dialog class="dialog" v-model="show" title="创建新群" message="邀请客户并创建一个群聊" show-cancel-button show-confirm-button confirm-button-color="black" allowHtml :confirm="addGroup">
<div class="dialogMessage"> <div class="dialogMessage">
邀请客户 邀请客户
<span class="name">@{{ businessCard.name }}</span> <span class="name">@{{ businessCard.name }}</span>
并新建一个 并新建一个
</div> </div>
<div>外部客户群聊</div> <div>外部客户群聊</div>
<div class="imgBox" style="margin-left:93px;width:132px;height:132px;"> <div class="imgBox" style="margin-left: 93px; width: 132px; height: 132px">
<div class="itemsBox"> <div class="itemsBox">
<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"> <div :class="[dialogMessage.length > 4 ? 'head-img-five' : dialogMessage.length > 1 ? 'head-img-two' : 'head-img-one', 'head-img']" v-for="user in dialogMessage" :key="user.id">
<img :src="img.url" alt="" /> <img :src="user.avatar" alt="" />
</div> </div>
</div> </div>
</div> </div>
</van-dialog> </van-dialog>
...@@ -65,11 +67,12 @@ ...@@ -65,11 +67,12 @@
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { groupChat, wx_config } from '@/api' import { groupChat, wxConfig } from '@/api'
export default { export default {
name: '', name: '',
data() { data() {
return { return {
userId: '',
show: false, show: false,
// headImg: { // headImg: {
// 1: 44, // 1: 44,
...@@ -82,18 +85,17 @@ export default { ...@@ -82,18 +85,17 @@ export default {
// 8: 14.67, // 8: 14.67,
// 9: 14.67, // 9: 14.67,
// }, // },
dialogImgs: [], dialogMessage: [],
selectListParams: { addGroupParams: {
id: '', externalUserIds: [],
status: '', groupName: '',
orgName: '', userIds: [],
pageSize: '', chatId: ''
pageNum: ''
}, },
businessCard: { businessCard: {
name: 'songshu', name: '',
wechatNumber: '18207493352', wechatNumber: '',
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' url: ''
}, },
groupList: [ groupList: [
{ {
...@@ -101,8 +103,8 @@ export default { ...@@ -101,8 +103,8 @@ export default {
orgName: 'songshu1', orgName: 'songshu1',
groupName: '@songshu1', groupName: '@songshu1',
welcome: '欢迎songshu2', welcome: '欢迎songshu2',
imgs: [ userList: [
{ id: 0, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' } { id: 0, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '777' }
// { id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, // { id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
// { id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, // { id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
// { id: 3, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, // { id: 3, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
...@@ -115,9 +117,9 @@ export default { ...@@ -115,9 +117,9 @@ export default {
orgName: 'songshu1', orgName: 'songshu1',
groupName: '@songshu1', groupName: '@songshu1',
welcome: '欢迎songshu2', welcome: '欢迎songshu2',
imgs: [ userList: [
{ id: 0, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 0, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '456' },
{ id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' } { id: 1, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '879' }
// { id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, // { id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
// { id: 3, 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' },
...@@ -129,10 +131,10 @@ export default { ...@@ -129,10 +131,10 @@ export default {
orgName: 'songshu1', orgName: 'songshu1',
groupName: '@songshu1', groupName: '@songshu1',
welcome: '欢迎songshu2', welcome: '欢迎songshu2',
imgs: [ userList: [
{ id: 0, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 0, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '111' },
{ id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 1, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '222' },
{ id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' } { id: 2, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '333' }
// { id: 3, 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' },
], ],
...@@ -143,11 +145,11 @@ export default { ...@@ -143,11 +145,11 @@ export default {
orgName: 'songshu1', orgName: 'songshu1',
groupName: '@songshu1', groupName: '@songshu1',
welcome: '欢迎songshu2', welcome: '欢迎songshu2',
imgs: [ userList: [
{ id: 0, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 0, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '444' },
{ id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 1, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '555' },
{ id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 2, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '666' },
{ id: 3, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' } { id: 3, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '777' }
// { id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, // { id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
], ],
hasgroup: '1' hasgroup: '1'
...@@ -157,12 +159,12 @@ export default { ...@@ -157,12 +159,12 @@ export default {
orgName: 'songshu1', orgName: 'songshu1',
groupName: '@songshu1', groupName: '@songshu1',
welcome: '欢迎songshu2', welcome: '欢迎songshu2',
imgs: [ userList: [
{ id: 0, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 0, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '888' },
{ id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 1, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '999' },
{ id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 2, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '000' },
{ id: 3, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 3, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '123' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' } { id: 4, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '456' }
], ],
hasgroup: '1' hasgroup: '1'
}, },
...@@ -171,16 +173,16 @@ export default { ...@@ -171,16 +173,16 @@ export default {
orgName: 'songshu1', orgName: 'songshu1',
groupName: '@songshu1', groupName: '@songshu1',
welcome: '欢迎songshu2', welcome: '欢迎songshu2',
imgs: [ userList: [
{ id: 0, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 0, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '789' },
{ id: 1, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 1, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '41' },
{ id: 2, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 2, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '23' },
{ id: 3, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 3, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '23' },
{ id: 4, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 4, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '45' },
{ id: 5, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 5, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '32' },
{ id: 6, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 6, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '00' },
{ id: 7, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' }, { id: 7, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '46' },
{ id: 8, url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' } { id: 8, avatar: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', userName: '78' }
], ],
hasgroup: '1' hasgroup: '1'
} }
...@@ -198,41 +200,43 @@ export default { ...@@ -198,41 +200,43 @@ export default {
activated() {}, activated() {},
deactivated() {}, deactivated() {},
mounted() { mounted() {
//配置wx接口 this.initWx()
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: { methods: {
showDialog(imgs) { // 创建群聊
this.dialogImgs = imgs addGroup() {
let params = this.addGroupParams
window.$wx.openEnterpriseChat(params).then(res => {
let chatId = res.chatId
groupChat.addChat().then(() =>{
})
})
},
showDialog(item) {
this.dialogMessage = item.userList
this.show = true this.show = true
console.log(this.dialogImgs, '111111') this.addGroupParams = item
this.addGroupParams.userIds = item.userList.userIds
},
//初始化微信接口
initWx() {
window.$wx = wxConfig
window.$wx.init(['getCurExternalContact', 'openEnterpriseChat']).then(() => {
//获取userId
window.$wx.getCurExternalContact().then(res => {
this.userId = res
let externalUserIds = this.userId
//获取客户信息
groupChat.getDetail({ externalUserIds }).then(res => {
console.log(res, '333')
})
//获取列表信息
groupChat.getList({ externalUserIds }).then(res => {
console.log(res, '444')
// this.groupList = res
})
})
})
}, },
// 加入会话 // 加入会话
joinCaht() {}, joinCaht() {},
...@@ -335,12 +339,16 @@ export default { ...@@ -335,12 +339,16 @@ export default {
color: #333333; color: #333333;
line-height: 22px; line-height: 22px;
} }
.nameBox {
width: 176px;
}
.wechatNumber { .wechatNumber {
font-size: 12px; font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
line-height: 17px; line-height: 17px;
word-wrap: break-word;
} }
.container-top { .container-top {
border-bottom: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!