complaint.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
  8. <title>投诉客户列表</title>
  9. <!--引入 element-ui 的样式,-->
  10. <link rel="stylesheet"
  11. href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742018383195/element-ui.css">
  12. <!-- 必须先引入vue, 后使用element-ui -->
  13. <script
  14. src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
  15. <!-- 引入element 的组件库-->
  16. <script
  17. src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017747738/element-ui.js"></script>
  18. <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
  19. <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
  20. <!-- <script src="js/vconsole.min.js"></script>
  21. <script>
  22. var vConsole = new window.VConsole();
  23. </script> -->
  24. </head>
  25. <style>
  26. body {
  27. margin: 0;
  28. padding: 0;
  29. }
  30. .box {
  31. width: 100vw;
  32. height: 100vh;
  33. box-sizing: border-box;
  34. background: #FAFAFA;
  35. }
  36. .page4 {
  37. width: 100vw;
  38. height: 100vh;
  39. box-sizing: border-box;
  40. }
  41. .client_list {
  42. padding: 15px 10px;
  43. height: 100%;
  44. overflow: auto;
  45. box-sizing: border-box;
  46. }
  47. .client_item {
  48. width: 100%;
  49. background: #FFFFFF;
  50. border-radius: 10px;
  51. padding: 10px;
  52. box-sizing: border-box;
  53. margin-bottom: 15px;
  54. }
  55. .client_head {
  56. display: flex;
  57. align-items: center;
  58. justify-content: space-between;
  59. margin-bottom: 10px;
  60. font-weight: 500;
  61. font-size: 14px;
  62. color: #222222;
  63. }
  64. .client_status {
  65. font-weight: 400;
  66. font-size: 12px;
  67. }
  68. .client_content {
  69. background: #FAFAFA;
  70. border-radius: 10px;
  71. padding: 10px;
  72. font-weight: 400;
  73. font-size: 12px;
  74. color: #999999;
  75. line-height: 23px;
  76. text-overflow: -o-ellipsis-lastline;
  77. display: -webkit-box;
  78. -webkit-box-orient: vertical;
  79. -webkit-line-clamp: 2;
  80. overflow: hidden;
  81. box-sizing: border-box;
  82. height: 60px;
  83. }
  84. </style>
  85. <body>
  86. <div id="box" class="box">
  87. <!-- 数据查看 -->
  88. <div class="page4">
  89. <div class="client_list">
  90. <div class="client_item" v-for="(item, index) in complaintList" :key="index" @click="handleComplaint(item)">
  91. <div class="client_head">
  92. <div>{{item.clientName}}</div>
  93. <div class="client_status" :style="{color: item.notifyStatus === 2 ? '#CCCCCC' : '#FF4E4E'}">{{item.notifyStatus === 2 ? '已读' : '未处理'}}</div>
  94. </div>
  95. <div class="client_content">{{item.sentimentReason}}</div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </body>
  101. <script>
  102. new Vue({
  103. el: '#box',
  104. data() {
  105. return {
  106. httpUrl: '',
  107. bId: null,
  108. env: '',
  109. memberId: null,
  110. corpId: null,
  111. complaintList: [],
  112. }
  113. },
  114. created() {
  115. this.bId = this.getQueryParam('bId')
  116. this.env = this.getQueryParam('env')
  117. if (!this.env || this.env === 'prod') {
  118. this.httpUrl = 'https://wlapi.wefanbot.com'
  119. } else {
  120. this.httpUrl = 'http://test.wefanbot.com:18993'
  121. }
  122. if (this.getQueryParam('memberId')) {
  123. if (this.isUnknownType(this.getQueryParam('memberId'))) {
  124. this.$message({
  125. message: '员工未激活',
  126. type: 'warning'
  127. })
  128. } else {
  129. // 已授权
  130. this.memberId = this.getQueryParam('memberId')
  131. this.corpId = this.getQueryParam('corpId')
  132. this.executeDetail()
  133. }
  134. } else {
  135. // 授权
  136. this.getAuth()
  137. }
  138. },
  139. methods: {
  140. getAuth() {
  141. fetch(this.httpUrl + `/p/insuite/p/getRedirectUri?env=${this.env}&bId=${this.bId}`)
  142. .then(res => {
  143. return res.json()
  144. }).then(result => {
  145. let { data, code, msg } = result
  146. if (code === 1) {
  147. window.location.replace(data)
  148. } else {
  149. this.$message({
  150. message: msg,
  151. type: 'warning'
  152. })
  153. }
  154. })
  155. },
  156. executeDetail() {
  157. fetch(this.httpUrl + `/scrm/v1/wxc-sentiment-session/p/findTouSuListByPage`, {
  158. method: 'post',
  159. body: JSON.stringify({
  160. memberId: this.memberId,
  161. corpId: this.corpId,
  162. page: 1,
  163. pageCount: 1000,
  164. }),
  165. headers: {
  166. 'Content-Type': 'application/json'
  167. }
  168. })
  169. .then(res => {
  170. return res.json()
  171. }).then(result => {
  172. let { data, code, msg } = result
  173. if (code === 1) {
  174. this.complaintList = data.records
  175. } else {
  176. this.$message({
  177. message: msg,
  178. type: 'warning'
  179. })
  180. }
  181. })
  182. },
  183. handleComplaint(item) {
  184. const data = {
  185. httpUrl: this.httpUrl,
  186. corpId: this.corpId,
  187. bId: this.bId,
  188. id: item.id,
  189. externalUserid: item.externalUseridOuter,
  190. clientName: item.clientName,
  191. sentimentReason: item.sentimentReason,
  192. type: item.type,
  193. chatId: item.type ? item.chatId : '',
  194. notifyStatus: item.notifyStatus
  195. }
  196. window.name = JSON.stringify(data)
  197. window.location.href = `complaintContent.html`
  198. },
  199. // 截取url中的数据
  200. getQueryParam(paramName) {
  201. // 获取当前URL的查询字符串部分
  202. const queryString = window.location.search;
  203. // 创建一个URLSearchParams对象
  204. const urlParams = new URLSearchParams(queryString);
  205. // 返回指定参数的值,如果不存在则返回null
  206. return urlParams.get(paramName);
  207. },
  208. isUnknownType(value) {
  209. // 1. 先检查是否为字符串类型
  210. // 2. 再检查是否以"unknown"开头(区分大小写)
  211. return typeof value === 'string' && value.startsWith('unknown');
  212. }
  213. }
  214. })
  215. </script>
  216. </html>