duanshenglang преди 4 месеца
родител
ревизия
1986d7f056
променени са 3 файла, в които са добавени 172 реда и са изтрити 6 реда
  1. 159 0
      lottery/article.html
  2. 4 0
      lottery/index.html
  3. 9 6
      lottery/smartTab.html

+ 159 - 0
lottery/article.html

@@ -0,0 +1,159 @@
+<!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: auto;
+    box-sizing: border-box;
+    background: linear-gradient(180deg, #FAFCFF 0%, #FAFAFA 100%);
+  }
+
+  .page6 {
+    width: 100vw;
+    height: 100vh;
+    padding: 15px;
+    box-sizing: border-box;
+  }
+  img{
+    width: 100%;
+    height: 100%;
+    object-fit: cover;
+}
+</style>
+
+<body>
+  <div id="box" class="box">
+    <div class="page6">
+      <div v-html="articleData"></div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        memberId: null,
+        externalUserId: null,
+        articleData: '',
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        this.httpUrl = 'http://test.wefanbot.com:18993'
+      }
+      this.getHttpUrl()
+    },
+    methods: {
+      getHttpUrl() {
+        // 判断业务id是否生产环境业务id
+        fetch(this.httpUrl + `/p/insuite/p/isProdId?id=${this.bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, msg } = result
+            if (typeof data === 'boolean' && data) {
+              this.httpUrl = 'https://wlapi.wefanbot.com'
+            } else {
+              this.httpUrl = 'http://test.wefanbot.com:18993'
+            }
+            if (!this.getQueryParam('externalUserid')) {
+              this.gerQwAuth(this.bId);
+            } else {
+              this.getData()
+            }
+          })
+      },
+      // 企微授权
+      gerQwAuth(bId) {
+        fetch(this.httpUrl + `/p/insuite/p/getOAUrl?bId=${bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              window.location.replace(data)
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      getData() {
+        fetch(this.httpUrl + '/scrm/v1/wxcp-chat-tool/p/remind', {
+          method: 'post',
+          body: JSON.stringify({
+            bid: this.bId,
+            memberId: this.getQueryParam('memberId') || '',
+            externalUserId: this.getQueryParam('externalUserid') || '',
+          }),
+          headers: {
+            'Content-Type': 'application/json'
+          }
+        }).then(res => {
+          return res.json()
+        }).then(result => {
+          let { data, code, msg } = result
+          if (code === 1) {
+            if (data) {
+              this.articleData = JSON.parse(JSON.stringify(data))
+            }
+          } else {
+            this.$message({
+              message: msg,
+              type: 'warning'
+            })
+          }
+        })
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })   
+</script>
+
+</html>

+ 4 - 0
lottery/index.html

@@ -172,6 +172,10 @@
 						// 智能总结
 						var currentQueryParams = window.location.search;
 						window.location.replace('smartSum.html' + currentQueryParams)
+					} else if (this.h5Type == 38) {
+						// 富文本解析(文章内容)
+						var currentQueryParams = window.location.search;
+						window.location.replace('article.html' + currentQueryParams)
 					} else if (!this.h5Type && this.bId) {
 						this.getAuth()
 					}

+ 9 - 6
lottery/smartTab.html

@@ -416,11 +416,11 @@
           // 设置定时器:每60秒刷新一次
           this.timer = setInterval(() => {
             this.getLastMsg()
-          }, 60 * 1000)
+          }, 5 * 1000)
           this.insight()
           this.secondTimer = setInterval(() => {
             this.insight()
-          }, 60 * 1000)
+          }, 5 * 1000)
           this.getCityLevel()
         } else {
           this.getQyWxSign()
@@ -492,11 +492,11 @@
                     // 设置定时器:每60秒刷新一次
                     that.timer = setInterval(() => {
                       that.getLastMsg()
-                    }, 60 * 1000)
+                    }, 5 * 1000)
                     that.insight()
                     that.secondTimer = setInterval(() => {
                       that.insight()
-                    }, 60 * 1000)
+                    }, 5 * 1000)
                     that.getCityLevel()
                   } else {
                     //错误处理
@@ -597,7 +597,7 @@
             bid: this.bId,
             externalUserId: this.externalUserId,
             memberId: this.memberId,
-            messageId: item.id,
+            endMsgId: item.id,
             problem: item.id ? '' : this.problem,
           }),
           headers: {
@@ -629,7 +629,7 @@
         let that = this
         let i = 0;
         let timer = setInterval(function () {
-          that.replyData.reply += str[i];
+          that.replyData.reply += str.charAt(i)
           i++;
           if (i >= str.length) {
             clearInterval(timer);
@@ -638,6 +638,9 @@
       },
       // 客户洞察
       insight () {
+        if (!this.externalUserId) {
+          return
+        }
         fetch(this.httpUrl + '/scrm/v1/wxcp-chat-tool/p/h5Insight', {
           method: 'post',
           body: JSON.stringify({