| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
- <title>投诉内容</title>
- <!--引入 element-ui 的样式,-->
- <link rel="stylesheet"
- href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742018383195/element-ui.css">
- <!-- 必须先引入vue, 后使用element-ui -->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
- <!-- 引入element 的组件库-->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017747738/element-ui.js"></script>
- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
- <!-- <script src="js/vconsole.min.js"></script>
- <script>
- var vConsole = new window.VConsole();
- </script> -->
- </head>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- .box {
- width: 100vw;
- height: 100vh;
- box-sizing: border-box;
- background: #FAFAFA;
- }
- .page4 {
- width: 100vw;
- height: 100vh;
- box-sizing: border-box;
- }
- .client_data {
- padding: 15px;
- box-sizing: border-box;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- overflow: auto;
- }
- .client_head {
- font-weight: 500;
- font-size: 14px;
- color: #222222;
- line-height: 20px;
- margin-bottom: 10px;
- }
- .client_content {
- background: #FFFFFF;
- border-radius: 10px;
- padding: 12px 10px;
- font-weight: 400;
- font-size: 14px;
- color: #999999;
- max-height: 100%;
- min-height: 300px;
- margin-bottom: 10px;
- line-height: 24px;
- }
- .follow_btn {
- background: #1677FF;
- border-radius: 15px;
- font-weight: 500;
- font-size: 14px;
- color: #FFFFFF;
- padding: 15px 0;
- text-align: center;
- }
- </style>
- <body>
- <div id="box" class="box">
- <!-- 数据查看 -->
- <div class="page4">
- <div class="client_data">
- <div>
- <div class="client_head">{{clientName}}</div>
- <div class="client_content">{{sentimentReason}}</div>
- </div>
- <div class="follow_btn" @click="toComfirm">去处理</div>
- </div>
- </div>
- </div>
- </body>
- <script>
- new Vue({
- el: '#box',
- data() {
- return {
- httpUrl: '',
- bId: null,
- corpId: null,
- id: null,
- externalUserid: null,
- clientName: null,
- sentimentReason: null,
- type: null,
- chatId: null,
- notifyStatus: null
- }
- },
- created() {
- const data = JSON.parse(window.name)
- this.httpUrl = data.httpUrl,
- this.corpId = data.corpId,
- this.bId = data.bId,
- this.id = data.id,
- this.externalUserid = data.externalUserid,
- this.clientName = data.clientName,
- this.sentimentReason = data.sentimentReason,
- this.type = Number(data.type),
- this.chatId = Number(data.type) ? data.chatId : '',
- this.notifyStatus = Number(data.notifyStatus)
- this.getQyWxSign()
- },
- methods: {
- toComfirm() {
- if (this.notifyStatus === 2) {
- if (this.type === 1) {
- this.toFollowGroup()
- } else {
- this.toFollowClient()
- }
- } else {
- fetch(this.httpUrl + `/scrm/v1/wxc-sentiment-session/p/tousuReadComfirm`, {
- method: 'post',
- body: JSON.stringify({
- id: this.id,
- corpId: this.corpId,
- }),
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- if (this.type === 1) {
- this.toFollowGroup()
- } else {
- this.toFollowClient()
- }
- } else {
- this.$message({
- message: msg,
- type: 'warning'
- })
- }
- })
- }
- },
- getQyWxSign() {
- fetch(this.httpUrl + '/scrm/v1/wxcp-corp/p/getAgentConfig', {
- method: 'post',
- body: JSON.stringify({
- bid: this.bId,
- url: window.location.href,
- }),
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- wx.config({
- beta: true,
- debug: false,
- appId: data.corpid, // 必填,企业号的唯一标识,此处填写企业号corpid
- timestamp: data.timestamp, // 必填,生成签名的时间戳
- nonceStr: data.nonceStr, // 必填,生成签名的随机串
- signature: data.agentSignature, // 必填,签名,见附录1
- jsApiList: ['checkJsApi', 'openEnterpriseChat'] // 必填,需要使用的JS接口列表
- })
- wx.agentConfig({
- corpid: data.corpid,
- agentid: data.agentId,
- timestamp: data.timestamp, // 必填,生成签名的时间戳
- nonceStr: data.nonceStr, // 必填,生成签名的随机串
- signature: data.agentSignature, // 必填,签名,见附录1
- jsApiList: ['openEnterpriseChat'], // 必填,需要使用的JS接口列表
- success: function (res) {
- // 回调
- console.log('agentConfig成功', res);
- },
- fail: function (res) {
- if (res.errMsg.indexOf('function not exist') > -1) {
- alert('版本过低请升级');
- }
- },
- complete: function (res) {
- // 回调
- console.log('complete', res);
- }
- });
- } else {
- this.$message({
- message: msg,
- type: 'warning'
- })
- }
- })
- },
- toFollowClient() {
- wx.openEnterpriseChat({
- externalUserIds: this.externalUserid, // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
- groupName: "", // 会话名称。单聊时该参数传入空字符串""即可。
- chatId: "",
- success: function (res) {
- var chatId = res.chatId; //返回当前群聊ID,仅当使用agentConfig注入该接口权限时才返回chatId
- // 回调
- console.log('打开客户成功', res)
- },
- fail: function (res) {
- // 回调
- if (res.errMsg.indexOf('function not exist') > -1) {
- alert('版本过低请升级');
- }
- console.log('失败', res);
- },
- complete: function (res) {
- // 回调
- console.log('完成', res);
- }
- })
- },
- toFollowGroup() {
- wx.openEnterpriseChat({
- groupName: "", // 会话名称。单聊时该参数传入空字符串""即可。
- chatId: this.chatId,
- success: function (res) {
- var chatId = res.chatId; //返回当前群聊ID,仅当使用agentConfig注入该接口权限时才返回chatId
- // 回调
- console.log('打开客户群聊成功', res)
- },
- fail: function (res) {
- // 回调
- if (res.errMsg.indexOf('function not exist') > -1) {
- alert('版本过低请升级');
- }
- console.log('失败', res);
- },
- complete: function (res) {
- // 回调
- console.log('完成', res);
- }
- });
- },
- }
- })
- </script>
- </html>
|