article.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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: auto;
  33. box-sizing: border-box;
  34. background: linear-gradient(180deg, #FAFCFF 0%, #FAFAFA 100%);
  35. }
  36. .page6 {
  37. width: 100vw;
  38. height: 100vh;
  39. padding: 15px;
  40. box-sizing: border-box;
  41. }
  42. img{
  43. width: 100%;
  44. height: 100%;
  45. object-fit: cover;
  46. }
  47. </style>
  48. <body>
  49. <div id="box" class="box">
  50. <div class="page6">
  51. <div v-html="articleData"></div>
  52. </div>
  53. </div>
  54. </body>
  55. <script>
  56. new Vue({
  57. el: '#box',
  58. data() {
  59. return {
  60. httpUrl: '',
  61. bId: null,
  62. env: '',
  63. memberId: null,
  64. externalUserId: null,
  65. articleData: '',
  66. }
  67. },
  68. created() {
  69. this.bId = this.getQueryParam('bId')
  70. this.env = this.getQueryParam('env')
  71. if (!this.env || this.env === 'prod') {
  72. this.httpUrl = 'https://wlapi.wefanbot.com'
  73. } else {
  74. this.httpUrl = 'http://test.wefanbot.com:18993'
  75. }
  76. this.getHttpUrl()
  77. },
  78. methods: {
  79. getHttpUrl() {
  80. // 判断业务id是否生产环境业务id
  81. fetch(this.httpUrl + `/p/insuite/p/isProdId?id=${this.bId}`)
  82. .then(res => {
  83. return res.json()
  84. }).then(result => {
  85. let { data, msg } = result
  86. if (typeof data === 'boolean' && data) {
  87. this.httpUrl = 'https://wlapi.wefanbot.com'
  88. } else {
  89. this.httpUrl = 'http://test.wefanbot.com:18993'
  90. }
  91. if (!this.getQueryParam('externalUserid')) {
  92. this.gerQwAuth(this.bId);
  93. } else {
  94. this.getData()
  95. }
  96. })
  97. },
  98. // 企微授权
  99. gerQwAuth(bId) {
  100. fetch(this.httpUrl + `/p/insuite/p/getOAUrl?bId=${bId}`)
  101. .then(res => {
  102. return res.json()
  103. }).then(result => {
  104. let { data, code, msg } = result
  105. if (code === 1) {
  106. window.location.replace(data)
  107. } else {
  108. this.$message({
  109. message: msg,
  110. type: 'warning'
  111. })
  112. }
  113. })
  114. },
  115. getData() {
  116. fetch(this.httpUrl + '/scrm/v1/wxcp-chat-tool/p/remind', {
  117. method: 'post',
  118. body: JSON.stringify({
  119. bid: this.bId,
  120. memberId: this.getQueryParam('memberId') || '',
  121. externalUserId: this.getQueryParam('externalUserid') || '',
  122. }),
  123. headers: {
  124. 'Content-Type': 'application/json'
  125. }
  126. }).then(res => {
  127. return res.json()
  128. }).then(result => {
  129. let { data, code, msg } = result
  130. if (code === 1) {
  131. if (data) {
  132. this.articleData = JSON.parse(JSON.stringify(data))
  133. }
  134. } else {
  135. this.$message({
  136. message: msg,
  137. type: 'warning'
  138. })
  139. }
  140. })
  141. },
  142. // 截取url中的数据
  143. getQueryParam(paramName) {
  144. // 获取当前URL的查询字符串部分
  145. const queryString = window.location.search;
  146. // 创建一个URLSearchParams对象
  147. const urlParams = new URLSearchParams(queryString);
  148. // 返回指定参数的值,如果不存在则返回null
  149. return urlParams.get(paramName);
  150. },
  151. }
  152. })
  153. </script>
  154. </html>