duanshenglang 2 days ago
parent
commit
d6ab285c2d

+ 44 - 5
lottery/WeCom.html

@@ -886,7 +886,7 @@
               <img src="./img/qw/reach_tools.png" alt="">
               <span>触达工具</span>
             </div>
-            <div class="tools_box">
+            <div class="tools_box" @click="handleAiCall">
               <img src="./img/qw/ai_call.png" alt="">
               <div class="tools_box_info">
                 <div>AI外呼</div>
@@ -975,6 +975,7 @@
         checkedClientIds: [],
         // 勾选的客户列表(包含 id + externalUserid 等信息)
         selectedClients: [],
+        aiCallToken: null, // AI外呼token
       }
     },
     created() {
@@ -1340,6 +1341,47 @@
       handlePyqMass() {
         window.location.href = `qw/pyqMassList.html?bId=${this.bId}&env=${this.env}&memberId=${this.memberId}`
       },
+      handleAiCall () {
+        // 获取顾问手机号
+        fetch(this.httpUrl + `/call/api/user/p/getPhone?memberId=${this.memberId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              // this.taskList = data.records || []
+              if (data) {
+                this.wxcpLoginRegister(data)
+              }
+            } else {
+              vant.Toast.fail(msg)
+            }
+          })
+      },
+      wxcpLoginRegister (phone) {
+        fetch(this.httpUrl + '/call/api/user/p/wxcpLoginRegister', {
+          method: 'post',
+          body: JSON.stringify({
+            memberId: this.memberId,
+            phone: phone,
+          }),
+          headers: {
+            'Content-Type': 'application/json',
+          }
+        }).then(res => {
+          const resHeader = res.headers
+          this.aiCallToken = resHeader.get("token")
+          return res.json()
+        }).then(result => {
+          let { data, code, msg } = result
+          if (code === 1) {
+          } else {
+            vant.Toast.fail(msg)
+          }
+        }).finally(() => {
+          console.log('this.aiCallToken', this.aiCallToken)
+        })
+      },
       // 勾选客户变更
       onChangeChecked (value) {
         // value 为当前勾选的 name 数组(即 id 集合)
@@ -1432,10 +1474,7 @@
             });
 
           } else {
-            this.$message({
-              message: msg,
-              type: 'warning'
-            })
+            vant.Toast.fail(msg)
           }
         })
       },

+ 224 - 0
lottery/chatClue.html

@@ -0,0 +1,224 @@
+<!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_list {
+    padding: 15px 10px;
+    height: 100%;
+    overflow: auto;
+    box-sizing: border-box;
+  }
+
+  .client_item {
+    width: 100%;
+    border-radius: 10px;
+    padding: 20px 10px;
+    box-sizing: border-box;
+    margin-bottom: 15px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    background: #FFFFFF;
+  }
+
+  .client_head {
+    font-weight: 400;
+    font-size: 14px;
+    color: #222222;
+  }
+
+  .client_right {
+    display: flex;
+    align-items: center;
+    font-weight: 400;
+    font-size: 14px;
+    color: #999999;
+    margin-right: 8px;
+  }
+
+  .intention_tag1 {
+    width: 68px;
+    border-radius: 5px;
+    color: #136DFB;
+    padding: 4px 0;
+    text-align: center;
+    font-weight: 400;
+    font-size: 12px;
+    background: rgba(186, 215, 255, 0.1);
+    margin-left: 8px;
+  }
+
+  .intention_tag2 {
+    width: 68px;
+    border-radius: 5px;
+    color: #5DD565;
+    padding: 4px 0;
+    text-align: center;
+    font-weight: 400;
+    font-size: 12px;
+    background: rgba(93, 213, 101, 0.05);
+    margin-left: 8px;
+  }
+
+  .to_iocn {
+    width: 14px;
+    height: 14px;
+    margin-left: 5px;
+  }
+</style>
+
+<body>
+  <div id="box" class="box">
+    <!-- 数据查看 -->
+    <div class="page4">
+      <div class="client_list">
+        <div class="client_item" v-for="(item, index) in intentionList" :key="index" @click="handleTimeOut(item)">
+          <div class="client_head">{{item.clientName}}</div>
+          <div class="client_right">
+            <span class="intention_tag1">{{item.category}}</span>
+            <span class="intention_tag1">{{item.subCategory}}</span>
+            <img class="to_iocn" src="./img/to-icon.png" alt="">
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        memberId: null,
+        intentionList: [],
+      }
+    },
+    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'
+      }
+      if (this.getQueryParam('memberId')) {
+        if (this.isUnknownType(this.getQueryParam('memberId'))) {
+          this.$message({
+            message: '员工未激活',
+            type: 'warning'
+          })
+        } else {
+          // 已授权
+          this.memberId = this.getQueryParam('memberId')
+          this.executeDetail()
+        }
+      } else {
+        // 授权
+        this.getAuth()
+      }
+    },
+    methods: {
+      getAuth() {
+        fetch(this.httpUrl + `/p/insuite/p/getRedirectUri?env=${this.env}&bId=${this.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'
+              })
+            }
+          })
+      },
+      executeDetail() {
+        fetch(this.httpUrl + `/wxcp/sessionClue/p/member/list?memberId=${this.memberId}`, {
+          method: 'post',
+          body: JSON.stringify({
+          }),
+          headers: {
+            'Content-Type': 'application/json'
+          }
+        }).then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.intentionList = data || []
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      handleTimeOut(item) {
+        window.location.href = `chatClueDetail.html?clueId=${item.id}&clientExternalUserId=${item.clientExternalUserId}&env=${this.env}`
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+      isUnknownType(value) {
+        // 1. 先检查是否为字符串类型
+        // 2. 再检查是否以"unknown"开头(区分大小写)
+        return typeof value === 'string' && value.startsWith('unknown');
+      }
+    }
+  })   
+</script>
+
+</html>

+ 737 - 0
lottery/chatClueDetail.html

@@ -0,0 +1,737 @@
+<!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>
+  <!-- 引入样式文件 -->
+  <link rel="stylesheet"
+    href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012584633/vant.css" />
+  <link rel="stylesheet" href="./css/page-return.css">
+  <!-- 必须先引入vue,  后使用vant-ui -->
+  <script
+    src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
+  <!-- 引入vant的组件库-->
+  <!-- 引入 Vant 的 JS 文件 -->
+  <script
+    src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012748487/vant.min.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/page-return.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: #F7F9FC;
+  }
+
+  .page5 {
+    width: 100vw;
+    box-sizing: border-box;
+    padding: 15px 10px 39px;
+  }
+
+  .task_list {}
+
+  .task_item {
+    width: 100%;
+    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, #FFFFFF 100%);
+    border-radius: 15px;
+    border: 1px solid #FFFFFF;
+    box-sizing: border-box;
+    margin-bottom: 15px;
+  }
+
+  .task_item:last-child {
+    margin-bottom: 0;
+  }
+
+  .task_item_title {
+    display: flex;
+    align-items: center;
+    padding: 10px;
+  }
+
+  .task_item_title img {
+    width: 53px;
+    height: 53px;
+    border-radius: 10px;
+    margin-right: 10px;
+  }
+
+  .task_item_text {
+    font-weight: 500;
+    font-size: 16px;
+    color: #222222;
+    line-height: 24px;
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+  }
+
+  .client_name {
+    display: flex;
+  }
+
+  .client_remark {
+    font-size: 12px;
+    color: #999999;
+    padding-left: 5px;
+  }
+
+  .task_item_time {
+    font-size: 12px;
+    color: #999999;
+  }
+
+  .client_tag {
+    display: flex;
+    align-items: center;
+    flex-wrap: wrap;
+    padding: 0 15px 9px;
+    gap: 8px;
+  }
+
+  .client_tag_title {
+    font-size: 12px;
+    color: #999999;
+    line-height: 17px;
+    white-space: nowrap;
+    padding-right: 5px;
+  }
+
+  .client_tag span {
+    height: 21px;
+    font-size: 12px;
+    color: #1677FF;
+    line-height: 17px;
+    border-radius: 5px;
+    padding: 2px 8px;
+    background: rgba(22, 119, 255, 0.1);
+    box-sizing: border-box;
+    white-space: nowrap;
+  }
+
+  .task_item_line {
+    width: 100%;
+    height: 1px;
+    margin: 15px 0 14px;
+    background: linear-gradient(90deg, rgba(217, 219, 227, 0) 0%, #D9DBE3 49%, rgba(217, 219, 227, 0) 100%);
+  }
+
+  .task_des_title {
+    font-size: 14px;
+    color: #222222;
+    line-height: 20px;
+    padding-bottom: 17px;
+  }
+
+  .task_des {
+    font-size: 12px;
+    color: #999999;
+    line-height: 18px;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .task_detail {
+    padding: 15px 15px 20px;
+    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, #FFFFFF 100%);
+    border-radius: 15px;
+    border: 1px solid #FFFFFF;
+    margin-bottom: 15px;
+  }
+
+  .task_btn {
+    width: 100%;
+    height: 40px;
+    background: #1677FF;
+    border-radius: 22px;
+    font-weight: bold;
+    font-size: 14px;
+    color: #FFFFFF;
+    line-height: 40px;
+    text-align: center;
+    margin-top: 25px;
+  }
+
+  .task_detail_con {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+    gap: 20px;
+  }
+
+  .task_detail_con_item {
+    display: flex;
+    flex-direction: column;
+    font-size: 12px;
+    color: #666666;
+  }
+
+  .task_detail_con_data {
+    font-weight: 500;
+    font-size: 14px;
+    color: #136DFB;
+    line-height: 20px;
+    padding-top: 10px;
+  }
+
+  .inten_title {
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    line-height: 20px;
+    padding-bottom: 15px;
+    padding-left: 5px;
+    position: relative;
+    display: flex;
+    align-items: center;
+  }
+
+  .inten_title::after {
+    position: absolute;
+    left: 0;
+    content: '';
+    width: 2px;
+    height: 12px;
+    background: #FF4141;
+    border-radius: 1px;
+  }
+
+  .ai_title {
+    font-size: 12px;
+    color: #666666;
+    line-height: 17px;
+    padding-bottom: 10px;
+  }
+
+  .task_ai_des {
+    font-size: 14px;
+    color: #222222;
+    line-height: 23px;
+  }
+
+  .clue_data {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 20px;
+  }
+
+  .clue_data_item {
+    display: flex;
+    flex-direction: column;
+  }
+
+  .clue_data_time {
+    font-weight: 500;
+    font-size: 14px;
+    color: #136DFB;
+    line-height: 20px;
+  }
+
+  .followup_list {
+    width: 100%;
+    padding: 0 10px 20px;
+    background: #FFFFFF;
+    border-radius: 5px;
+    box-sizing: border-box;
+  }
+
+  .follow_time {
+    display: flex;
+    align-items: center;
+    font-weight: 400;
+    font-size: 14px;
+    color: #222222;
+    margin-bottom: 15px;
+  }
+
+  .time_dot {
+    background: #E6F0FF;
+    padding: 3px;
+    border-radius: 50%;
+    margin-right: 10px;
+    box-sizing: border-box;
+  }
+
+  .dot {
+    width: 6px;
+    height: 6px;
+    background: #1677FF;
+    border-radius: 50%;
+  }
+
+  .follow_item {
+    padding-right: 10px;
+    padding-left: 15px;
+    padding-bottom: 5px;
+  }
+
+  .follow_padding {
+    padding-top: 15px;
+    padding-bottom: 5px;
+    background: #F7F9FC;
+    border-radius: 5px;
+  }
+
+  .follow_item_time {
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    display: flex;
+    align-items: center;
+    margin-bottom: 3px;
+  }
+
+  .item_time {
+    font-weight: 400;
+    font-size: 12px;
+    color: #999999;
+    padding-right: 10px;
+  }
+
+  .item_box {
+    display: flex;
+    align-items: flex-end;
+  }
+
+  .follow_item_line {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding-left: 13px;
+    padding-right: 21px;
+  }
+
+  .line_dot {
+    width: 6px;
+    height: 6px;
+    background: #1677FF;
+    border-radius: 50%;
+    margin-bottom: 5px;
+  }
+
+  .line {
+    width: 1px;
+    height: 66px;
+    border-left: 1px dashed #1677FF;
+  }
+
+  .item_content {
+    background: #FFFFFF;
+    border-radius: 5px;
+    padding: 10px;
+    font-weight: 400;
+    font-size: 12px;
+    color: #222222;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+  }
+
+  .item_content img {
+    width: 37px;
+    height: 37px;
+    margin-right: 10px;
+  }
+
+  .item_tip {
+    font-size: 12px;
+    color: #222222;
+    line-height: 18px;
+    max-width: 120px;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .item_tip2 {
+    font-size: 12px;
+    color: #222222;
+    line-height: 17px;
+    gap: 5px;
+    max-width: 120px;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .foot_box {
+    display: flex;
+    justify-content: center;
+    padding: 0 25px;
+    margin-bottom: 10px;
+  }
+
+  .foot_btn {
+    width: 100%;
+    height: 50px;
+    background: #1677FF;
+    border-radius: 20px;
+    font-weight: 500;
+    font-size: 14px;
+    color: #FFFFFF;
+    line-height: 50px;
+    text-align: center;
+  }
+
+  /* 客户SOP任务详情 */
+
+  .top_tip {
+    background: #afdefd;
+    display: flex;
+    justify-content: center;
+    color: #FFF;
+    font-size: 14px;
+    padding: 6px 0;
+  }
+
+  .logo {
+    width: 20px;
+    height: 20px;
+    margin-right: 10px;
+  }
+
+  .content {
+    padding: 20px;
+    margin-bottom: 10px;
+    background: #FFF;
+  }
+
+  .icon_logo {
+    width: 20px;
+    vertical-align: bottom;
+  }
+
+  .sop_content {
+    background: #f1f9ff;
+    padding: 10px 20px;
+    border-radius: 10px;
+    font-size: 14px;
+  }
+
+  .font {
+    color: #1890ff;
+  }
+
+  .send_title {
+    padding: 20px;
+    background: #FFF;
+    border-bottom: 1px solid #d2d3d4;
+  }
+
+  .send_content {
+    padding: 20px;
+    background: #FFF;
+    margin-bottom: 10px;
+  }
+
+  .send_item {
+    background: #F8F8F8;
+    padding: 20px;
+    margin-bottom: 10px;
+    border-radius: 10px;
+    font-size: 14px;
+  }
+
+  .send_logo {
+    width: 100px;
+    border-radius: 10px;
+  }
+
+  .follow_client {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 20px;
+    font-size: 14px;
+    background: #FFF;
+  }
+
+  .client_msg {
+    display: flex;
+    flex-direction: column;
+  }
+
+  .avatar {
+    width: 60px;
+    height: 60px;
+    border-radius: 10px;
+  }
+
+  .follow_btn {
+    background: #f1f9ff;
+    color: #1890ff;
+    padding: 5px;
+    border-radius: 4px;
+    font-size: 12px;
+  }
+
+  /* 客户SOP任务详情结束 */
+</style>
+
+<body>
+  <div id="box" class="box">
+    <div class="page5">
+      <!-- 任务详情 -->
+      <div>
+        <div class="task_item">
+          <div class="task_item_title">
+            <img :src="taskData.clientAvatar || './img/qw/mem_icon.png'" alt="">
+            <div class="task_item_text">
+              <div class="client_name">{{taskData.clientName}}
+              </div>
+              <div class="task_item_time">建群时间: {{formatDate(taskData.createdGroupTime)}}</div>
+            </div>
+          </div>
+        </div>
+        <div class="task_detail">
+          <div class="clue_data">
+            <div class="clue_data_item">
+              <div class="ai_title">添加企微时间:</div>
+              <div class="clue_data_time">{{timeFormat(taskData.addTime)}}</div>
+            </div>
+            <div class="clue_data_item">
+              <div class="ai_title">线索分类:</div>
+              <div class="clue_data_time">
+                <span>{{taskData.category}}</span>
+                <span style="color: #CCCCCC;">—</span>
+                <span style="color: #7D97BF;">{{taskData.subCategory}}</span>
+              </div>
+            </div>
+          </div>
+          <div class="ai_title">线索依据:</div>
+          <div class="task_ai_des" style="margin-bottom: 20px;">{{taskData.clueMsg}}</div>
+          <div class="ai_title">AI分析:</div>
+          <div class="task_ai_des">{{taskData.analysisReason}}</div>
+        </div>
+      </div>
+      <div class="foot_box">
+        <div class="foot_btn" @click="toFollow">去跟进</div>
+      </div>
+    </div>
+    <!-- 底部返回栏 -->
+    <page-return></page-return>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        clueId: null,
+        taskData: {},
+        clientExternalUserId: null
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      this.clueId = this.getQueryParam('clueId')
+      this.clientExternalUserId = this.getQueryParam('clientExternalUserId')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        this.httpUrl = 'http://test.wefanbot.com:18993'
+      }
+      this.getDetail()
+      this.getQyWxSign()
+    },
+    methods: {
+      getDetail() {
+        fetch(this.httpUrl + `/wxcp/sessionClue/p/session-info?clueId=${this.clueId}`, {
+          method: 'post',
+          body: JSON.stringify({
+          }),
+          headers: {
+            'Content-Type': 'application/json'
+          }
+        }).then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.taskData = data
+            } else {
+              vant.Toast.fail(msg)
+            }
+          })
+      },
+      timeFormat(time, format = 'yyyy-MM-dd hh:mm:ss') {
+        if (time === undefined || time === '' || time === null) {
+          return '/';
+        }
+
+        const date = new Date(time);
+        const o = {
+          'M+': date.getMonth() + 1, // 月份
+          'd+': date.getDate(),      // 日
+          'h+': date.getHours(),     // 小时
+          'm+': date.getMinutes(),   // 分钟
+          's+': date.getSeconds(),   // 秒
+          'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+          'S': date.getMilliseconds() // 毫秒
+        };
+
+        // 处理年份
+        if (/(y+)/.test(format)) {
+          format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+        }
+
+        // 处理日期和时间部分
+        for (let k in o) {
+          if (new RegExp('(' + k + ')').test(format)) {
+            let value = o[k];
+            let padding = RegExp.$1.length === 1 ? '' : '00'; // 根据格式字符串中的长度决定是否补零
+            format = format.replace(RegExp.$1, ('' + value).padStart(padding.length + value.toString().length - value.toString().length, '0'));
+          }
+        }
+
+        // 如果格式只包含时间部分,移除日期部分可能的占位符
+        if (!/(M+|d+)/.test(format)) {
+          // 移除任何可能存在的日期占位符(如:'yyyy-MM-dd ')
+          format = format.replace(/(\s*-\s*){2}/g, ''); // 移除两个'-'之间的任何内容
+          format = format.replace(/^\s*yyyy-\s*/, ''); // 移除开头的'yyyy-'
+        }
+
+        // 如果格式只包含日期部分,移除时间部分可能的占位符
+        if (!/(h+|m+|s+)/.test(format)) {
+          // 移除任何可能存在的时间占位符(如:' hh:mm:ss')
+          format = format.replace(/(\s*:\s*){2}/g, ''); // 移除两个':'之间的任何内容
+          format = format.replace(/\s*hh:\s*$/, ''); // 移除结尾的' hh:'
+        }
+
+        return format;
+      },
+      formatDate(input) {
+        // 创建 Date 对象(兼容不同浏览器)
+        const date = new Date(input)
+
+        // 提取年、月、日
+        const year = date.getFullYear()
+        const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,需要+1
+        const day = String(date.getDate()).padStart(2, '0')
+
+        return `${year}-${month}-${day}`
+      },
+      toFollow() {
+        if (!this.clientExternalUserId) {
+          vant.Toast.fail('无效')
+          return
+        }
+        wx.openEnterpriseChat({
+          externalUserIds: this.clientExternalUserId, // 参与会话的外部联系人列表,格式为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);
+          }
+        });
+
+      },
+      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 {
+            vant.Toast.fail(msg)
+          }
+        })
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })   
+</script>
+
+</html>

+ 224 - 0
lottery/clientDynamics.html

@@ -0,0 +1,224 @@
+<!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_list {
+    padding: 15px 10px;
+    height: 100%;
+    overflow: auto;
+    box-sizing: border-box;
+  }
+
+  .client_item {
+    width: 100%;
+    border-radius: 10px;
+    padding: 20px 10px;
+    box-sizing: border-box;
+    margin-bottom: 15px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    background: #FFFFFF;
+  }
+
+  .client_head {
+    font-weight: 400;
+    font-size: 14px;
+    color: #222222;
+  }
+
+  .client_right {
+    display: flex;
+    align-items: center;
+    font-weight: 400;
+    font-size: 14px;
+    color: #999999;
+    margin-right: 8px;
+  }
+
+  .intention_tag1 {
+    width: 68px;
+    border-radius: 5px;
+    color: #136DFB;
+    padding: 4px 0;
+    text-align: center;
+    font-weight: 400;
+    font-size: 12px;
+    background: rgba(186, 215, 255, 0.1);
+    margin-left: 8px;
+  }
+
+  .intention_tag2 {
+    width: 68px;
+    border-radius: 5px;
+    color: #5DD565;
+    padding: 4px 0;
+    text-align: center;
+    font-weight: 400;
+    font-size: 12px;
+    background: rgba(93, 213, 101, 0.05);
+    margin-left: 8px;
+  }
+
+  .to_iocn {
+    width: 14px;
+    height: 14px;
+    margin-left: 5px;
+  }
+</style>
+
+<body>
+  <div id="box" class="box">
+    <!-- 数据查看 -->
+    <div class="page4">
+      <div class="client_list">
+        <div class="client_item" v-for="(item, index) in intentionList" :key="index" @click="handleTimeOut(item)">
+          <div class="client_head">{{item.clientName}}</div>
+          <div class="client_right" v-if="item.bizCodesList.length > 0">
+            <span v-for="(k, kIndex) in item.bizCodesList.slice(0, 2)" :key="kIndex"
+              :class="k === 'READ' ? 'intention_tag1' : 'intention_tag2'">{{k === 'READ' ? '阅读' : '留资'}}</span>
+            <img class="to_iocn" src="./img/to-icon.png" alt="">
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        memberId: null,
+        intentionList: [],
+      }
+    },
+    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'
+      }
+      if (this.getQueryParam('memberId')) {
+        if (this.isUnknownType(this.getQueryParam('memberId'))) {
+          this.$message({
+            message: '员工未激活',
+            type: 'warning'
+          })
+        } else {
+          // 已授权
+          this.memberId = this.getQueryParam('memberId')
+          this.executeDetail()
+        }
+      } else {
+        // 授权
+        this.getAuth()
+      }
+    },
+    methods: {
+      getAuth() {
+        fetch(this.httpUrl + `/p/insuite/p/getRedirectUri?env=${this.env}&bId=${this.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'
+              })
+            }
+          })
+      },
+      executeDetail() {
+        fetch(this.httpUrl + `/scrm/v1/client-log/p/member/page?memberId=${this.memberId}&page=1&pageCount=1000`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.intentionList = data || []
+              this.intentionList = this.intentionList.map(item => {
+                return {
+                  ...item,
+                  bizCodesList: item.bizCodes ? item.bizCodes.split(',') : []
+                }
+              })
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      handleTimeOut(item) {
+        window.location.href = `clientDynamicsDetail.html?clientId=${item.clientId}&clientName=${item.clientName}&clientExternalUserId=${item.clientExternalUserId}&env=${this.env}`
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+      isUnknownType(value) {
+        // 1. 先检查是否为字符串类型
+        // 2. 再检查是否以"unknown"开头(区分大小写)
+        return typeof value === 'string' && value.startsWith('unknown');
+      }
+    }
+  })   
+</script>
+
+</html>

+ 734 - 0
lottery/clientDynamicsDetail.html

@@ -0,0 +1,734 @@
+<!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>
+  <!-- 引入样式文件 -->
+  <link rel="stylesheet"
+    href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012584633/vant.css" />
+  <link rel="stylesheet" href="./css/page-return.css">
+  <!-- 必须先引入vue,  后使用vant-ui -->
+  <script
+    src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
+  <!-- 引入vant的组件库-->
+  <!-- 引入 Vant 的 JS 文件 -->
+  <script
+    src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012748487/vant.min.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/page-return.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: #F7F9FC;
+  }
+
+  .page5 {
+    width: 100vw;
+    box-sizing: border-box;
+    padding: 15px 10px 39px;
+  }
+
+  .task_list {}
+
+  .task_item {
+    width: 100%;
+    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, #FFFFFF 100%);
+    border-radius: 15px;
+    border: 1px solid #FFFFFF;
+    box-sizing: border-box;
+    margin-bottom: 15px;
+  }
+
+  .task_item:last-child {
+    margin-bottom: 0;
+  }
+
+  .task_item_title {
+    display: flex;
+    align-items: center;
+    padding: 10px;
+  }
+
+  .task_item_title img {
+    width: 53px;
+    height: 53px;
+    border-radius: 10px;
+    margin-right: 10px;
+  }
+
+  .task_item_text {
+    font-weight: 500;
+    font-size: 16px;
+    color: #222222;
+    line-height: 24px;
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+  }
+
+  .client_name {
+    display: flex;
+  }
+
+  .client_remark {
+    font-size: 12px;
+    color: #999999;
+    padding-left: 5px;
+  }
+
+  .task_item_time {
+    font-size: 12px;
+    color: #999999;
+  }
+
+  .client_tag {
+    display: flex;
+    align-items: center;
+    flex-wrap: wrap;
+    padding: 0 15px 9px;
+    gap: 8px;
+  }
+
+  .client_tag_title {
+    font-size: 12px;
+    color: #999999;
+    line-height: 17px;
+    white-space: nowrap;
+    padding-right: 5px;
+  }
+
+  .client_tag span {
+    height: 21px;
+    font-size: 12px;
+    color: #1677FF;
+    line-height: 17px;
+    border-radius: 5px;
+    padding: 2px 8px;
+    background: rgba(22, 119, 255, 0.1);
+    box-sizing: border-box;
+    white-space: nowrap;
+  }
+
+  .task_item_line {
+    width: 100%;
+    height: 1px;
+    margin: 15px 0 14px;
+    background: linear-gradient(90deg, rgba(217, 219, 227, 0) 0%, #D9DBE3 49%, rgba(217, 219, 227, 0) 100%);
+  }
+
+  .task_des_title {
+    font-size: 14px;
+    color: #222222;
+    line-height: 20px;
+    padding-bottom: 17px;
+  }
+
+  .task_des {
+    font-size: 12px;
+    color: #999999;
+    line-height: 18px;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .task_detail {
+    padding: 15px 15px 20px;
+    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, #FFFFFF 100%);
+    border-radius: 15px;
+    border: 1px solid #FFFFFF;
+    margin-bottom: 15px;
+  }
+
+  .task_btn {
+    width: 100%;
+    height: 40px;
+    background: #1677FF;
+    border-radius: 22px;
+    font-weight: bold;
+    font-size: 14px;
+    color: #FFFFFF;
+    line-height: 40px;
+    text-align: center;
+    margin-top: 25px;
+  }
+
+  .task_detail_con {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+    gap: 20px;
+  }
+
+  .task_detail_con_item {
+    display: flex;
+    flex-direction: column;
+    font-size: 12px;
+    color: #666666;
+  }
+
+  .task_detail_con_data {
+    font-weight: 500;
+    font-size: 14px;
+    color: #136DFB;
+    line-height: 20px;
+    padding-top: 10px;
+  }
+
+  .inten_title {
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    line-height: 20px;
+    padding-bottom: 15px;
+    padding-left: 5px;
+    position: relative;
+    display: flex;
+    align-items: center;
+  }
+
+  .inten_title::after {
+    position: absolute;
+    left: 0;
+    content: '';
+    width: 2px;
+    height: 12px;
+    background: #FF4141;
+    border-radius: 1px;
+  }
+
+  .ai_title {
+    font-size: 12px;
+    color: #666666;
+    line-height: 17px;
+    padding-bottom: 10px;
+  }
+
+  .task_ai_des {
+    font-size: 14px;
+    color: #222222;
+    line-height: 23px;
+  }
+
+  .clue_data {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 20px;
+  }
+
+  .clue_data_item {
+    display: flex;
+    flex-direction: column;
+  }
+
+  .clue_data_time {
+    font-weight: 500;
+    font-size: 14px;
+    color: #136DFB;
+    line-height: 20px;
+  }
+
+  .followup_list {
+    width: 100%;
+    padding: 0 10px 20px;
+    background: #FFFFFF;
+    border-radius: 5px;
+    box-sizing: border-box;
+  }
+
+  .follow_time {
+    display: flex;
+    align-items: center;
+    font-weight: 400;
+    font-size: 14px;
+    color: #222222;
+    margin-bottom: 15px;
+  }
+
+  .time_dot {
+    background: #E6F0FF;
+    padding: 3px;
+    border-radius: 50%;
+    margin-right: 10px;
+    box-sizing: border-box;
+  }
+
+  .dot {
+    width: 6px;
+    height: 6px;
+    background: #1677FF;
+    border-radius: 50%;
+  }
+
+  .follow_item {
+    padding-right: 10px;
+    padding-left: 15px;
+    padding-bottom: 5px;
+  }
+
+  .follow_padding {
+    padding-top: 15px;
+    padding-bottom: 5px;
+    background: #F7F9FC;
+    border-radius: 5px;
+  }
+
+  .follow_item_time {
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    display: flex;
+    align-items: center;
+    margin-bottom: 3px;
+  }
+
+  .item_time {
+    font-weight: 400;
+    font-size: 12px;
+    color: #999999;
+    padding-right: 10px;
+  }
+
+  .item_box {
+    display: flex;
+    align-items: flex-end;
+  }
+
+  .follow_item_line {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding-left: 13px;
+    padding-right: 21px;
+  }
+
+  .line_dot {
+    width: 6px;
+    height: 6px;
+    background: #1677FF;
+    border-radius: 50%;
+    margin-bottom: 5px;
+  }
+
+  .line {
+    width: 1px;
+    height: 66px;
+    border-left: 1px dashed #1677FF;
+  }
+
+  .item_content {
+    background: #FFFFFF;
+    border-radius: 5px;
+    padding: 10px;
+    font-weight: 400;
+    font-size: 12px;
+    color: #222222;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+  }
+
+  .item_content img {
+    width: 37px;
+    height: 37px;
+    margin-right: 10px;
+  }
+
+  .item_tip {
+    font-size: 12px;
+    color: #222222;
+    line-height: 18px;
+    max-width: 120px;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .item_tip2 {
+    font-size: 12px;
+    color: #222222;
+    line-height: 17px;
+    gap: 5px;
+    max-width: 120px;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+
+  .foot_box {
+    display: flex;
+    justify-content: center;
+    padding: 0 25px;
+    margin-bottom: 10px;
+  }
+
+  .foot_btn {
+    width: 100%;
+    height: 50px;
+    background: #1677FF;
+    border-radius: 20px;
+    font-weight: 500;
+    font-size: 14px;
+    color: #FFFFFF;
+    line-height: 50px;
+    text-align: center;
+  }
+
+  /* 客户SOP任务详情 */
+
+  .top_tip {
+    background: #afdefd;
+    display: flex;
+    justify-content: center;
+    color: #FFF;
+    font-size: 14px;
+    padding: 6px 0;
+  }
+
+  .logo {
+    width: 20px;
+    height: 20px;
+    margin-right: 10px;
+  }
+
+  .content {
+    padding: 20px;
+    margin-bottom: 10px;
+    background: #FFF;
+  }
+
+  .icon_logo {
+    width: 20px;
+    vertical-align: bottom;
+  }
+
+  .sop_content {
+    background: #f1f9ff;
+    padding: 10px 20px;
+    border-radius: 10px;
+    font-size: 14px;
+  }
+
+  .font {
+    color: #1890ff;
+  }
+
+  .send_title {
+    padding: 20px;
+    background: #FFF;
+    border-bottom: 1px solid #d2d3d4;
+  }
+
+  .send_content {
+    padding: 20px;
+    background: #FFF;
+    margin-bottom: 10px;
+  }
+
+  .send_item {
+    background: #F8F8F8;
+    padding: 20px;
+    margin-bottom: 10px;
+    border-radius: 10px;
+    font-size: 14px;
+  }
+
+  .send_logo {
+    width: 100px;
+    border-radius: 10px;
+  }
+
+  .follow_client {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 20px;
+    font-size: 14px;
+    background: #FFF;
+  }
+
+  .client_msg {
+    display: flex;
+    flex-direction: column;
+  }
+
+  .avatar {
+    width: 60px;
+    height: 60px;
+    border-radius: 10px;
+  }
+
+  .follow_btn {
+    background: #f1f9ff;
+    color: #1890ff;
+    padding: 5px;
+    border-radius: 4px;
+    font-size: 12px;
+  }
+
+  /* 客户SOP任务详情结束 */
+</style>
+
+<body>
+  <div id="box" class="box">
+    <div class="page5">
+      <!-- 任务详情 -->
+      <div>
+        <div class="task_item">
+          <div class="task_item_title">
+            <img src="./img/qw/mem_icon.png" alt="">
+            <div class="task_item_text">
+              <div class="client_name">{{clientName}}
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="task_detail" style="padding: 20px 10px;">
+          <div class="followup_list" v-for="(item, key) in taskData" :key="key">
+            <div class="follow_time">
+              <div class="time_dot">
+                <div class="dot"></div>
+              </div>
+              <span>{{item.createdTime}}</span>
+            </div>
+            <div class="follow_padding">
+              <div class="follow_item">
+                <div class="follow_item_time">
+                  <span class="item_time">{{timeFormat(item.createdTime, 'hh:mm')}}</span>
+                  <span v-if="item.bizCode === 'READ'">客户动态</span>
+                  <span v-else-if="item.bizCode === 'SUBMIT'">留资</span>
+                </div>
+                <div class="item_box">
+                  <div class="follow_item_line">
+                    <div class="line_dot"></div>
+                    <div class="line"></div>
+                  </div>
+                  <div class="item_content">
+                    <img :src="item.cover || './img/qw/mem_icon.png'" alt="">
+                    <div class="item_tip" v-if="item.bizCode === 'READ'">{{item.title}}</div>
+                    <div class="item_tip2" v-else-if="item.bizCode === 'SUBMIT'">
+                      <div>{{item.name}}</div>
+                      <div>{{item.phone}}</div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="foot_box">
+        <div class="foot_btn" @click="toFollow">去跟进</div>
+      </div>
+    </div>
+    <!-- 底部返回栏 -->
+    <page-return></page-return>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        clientId: null,
+        clientName: null,
+        clientExternalUserId: null,
+        taskData: {}
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      this.clientId = this.getQueryParam('clientId')
+      this.clientName = this.getQueryParam('clientName')
+      this.clientExternalUserId = this.getQueryParam('clientExternalUserId')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        this.httpUrl = 'http://test.wefanbot.com:18993'
+      }
+      this.getDetail()
+      this.getQyWxSign()
+    },
+    methods: {
+      getDetail() {
+        fetch(this.httpUrl + `/scrm/v1/client-log/p/list?clientId=${this.clientId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.taskData = data
+            } else {
+              vant.Toast.fail(msg)
+            }
+          })
+      },
+      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 {
+            vant.Toast.fail(msg)
+          }
+        })
+      },
+      toFollow() {
+        if (!this.clientExternalUserId) {
+          vant.Toast.fail('无效')
+          return
+        }
+        wx.openEnterpriseChat({
+          externalUserIds: this.clientExternalUserId, // 参与会话的外部联系人列表,格式为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);
+          }
+        });
+
+      },
+      timeFormat(time, format = 'yyyy-MM-dd hh:mm:ss') {
+        if (time === undefined || time === '' || time === null) {
+          return '/';
+        }
+
+        const date = new Date(time);
+        const o = {
+          'M+': date.getMonth() + 1, // 月份
+          'd+': date.getDate(),      // 日
+          'h+': date.getHours(),     // 小时
+          'm+': date.getMinutes(),   // 分钟
+          's+': date.getSeconds(),   // 秒
+          'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+          'S': date.getMilliseconds() // 毫秒
+        };
+
+        // 处理年份
+        if (/(y+)/.test(format)) {
+          format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+        }
+
+        // 处理日期和时间部分
+        for (let k in o) {
+          if (new RegExp('(' + k + ')').test(format)) {
+            let value = o[k];
+            let padding = RegExp.$1.length === 1 ? '' : '00'; // 根据格式字符串中的长度决定是否补零
+            format = format.replace(RegExp.$1, ('' + value).padStart(padding.length + value.toString().length - value.toString().length, '0'));
+          }
+        }
+
+        // 如果格式只包含时间部分,移除日期部分可能的占位符
+        if (!/(M+|d+)/.test(format)) {
+          // 移除任何可能存在的日期占位符(如:'yyyy-MM-dd ')
+          format = format.replace(/(\s*-\s*){2}/g, ''); // 移除两个'-'之间的任何内容
+          format = format.replace(/^\s*yyyy-\s*/, ''); // 移除开头的'yyyy-'
+        }
+
+        // 如果格式只包含日期部分,移除时间部分可能的占位符
+        if (!/(h+|m+|s+)/.test(format)) {
+          // 移除任何可能存在的时间占位符(如:' hh:mm:ss')
+          format = format.replace(/(\s*:\s*){2}/g, ''); // 移除两个':'之间的任何内容
+          format = format.replace(/\s*hh:\s*$/, ''); // 移除结尾的' hh:'
+        }
+
+        return format;
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })   
+</script>
+
+</html>

BIN
lottery/img/qw/fresh.png


+ 9 - 1
lottery/index.html

@@ -209,9 +209,17 @@
 						var currentQueryParams = window.location.search;
 						window.location.replace('intentionClient.html' + currentQueryParams)
 					} else if (this.h5Type == 45) {
-						// 意向客户列表
+						// 企微
 						var currentQueryParams = window.location.search;
 						window.location.replace('WeCom.html' + currentQueryParams)
+					} else if (this.h5Type == 46) {
+						// 客户动态列表
+						var currentQueryParams = window.location.search;
+						window.location.replace('clientDynamics.html' + currentQueryParams)
+					} else if (this.h5Type == 47) {	
+						// 会话线索列表
+						var currentQueryParams = window.location.search;
+						window.location.replace('chatClue.html' + currentQueryParams)
 					} else if (!this.h5Type && this.bId) {
 						this.getAuth()
 					}

+ 10 - 0
lottery/qw/clientGroupMass.html

@@ -1654,6 +1654,16 @@
         if (this.formValidate.type === 1) {
           this.formValidate.sendTime = ''
         }
+        if (this.formValidate.matters && this.formValidate.matters.length) {
+          this.formValidate.matter = this.formValidate.matters.map(matter => {
+            return {
+              contentId: matter.id,
+              contentType: matter.contentType,
+              headUrl: matter.cover || '',
+              title: matter.title || matter.name,
+            }
+          })
+        }
         fetch(this.httpUrl + '/scrm/v1/wxcp-group-send/m/add', {
           method: 'post',
           body: JSON.stringify({

+ 46 - 4
lottery/qw/clientGroupMassDetail.html

@@ -325,12 +325,24 @@
   .send_num_data {
     display: flex;
     align-items: center;
+    justify-content: space-between;
+    flex-wrap: wrap;
     padding: 15px 5px 10px;
     font-size: 12px;
     color: #222222;
     line-height: 17px;
   }
-
+  .fresh_data {
+    display: flex;
+    font-weight: 400;
+    font-size: 12px;
+    color: #136DFB;
+  }
+  .fresh_data img {
+    width: 16px;
+    height: 16px;
+    margin-right: 2px;
+  }
   .color1 {
     color: #1677FF;
     padding-right: 20px;
@@ -474,9 +486,17 @@
             <span :class="filterIndex === -1 ? 'active' : 'filter_span'" @click="handleFilter(-1)">无客户可发送</span>
           </div>
           <div class="send_num_data">
-            已发送群主:<span class="color1">{{memberExtra.sendSuccess}}</span>
-            未发送群主:<span class="color2">{{memberExtra.unSend}}</span>
-            已发送客户群:<span class="color3">{{memberExtra.sendGroup}}</span>
+            <div>
+              已发送群主:<span class="color1">{{memberExtra.sendSuccess}}</span>
+              未发送群主:<span class="color2">{{memberExtra.unSend}}</span>
+            </div>
+            <div class="fresh_data" @click="freshClientData">
+              <img src="../img/qw/fresh.png" alt="">
+              <span>刷新</span>
+            </div>
+            <div>
+              已发送客户群:<span class="color3">{{memberExtra.sendGroup}}</span>
+            </div>
           </div>
           <div class="send_mem_list">
             <div class="send_mem_item" v-for="(item, index) in sendMemberList" :key="index">
@@ -570,6 +590,8 @@
       },
       // 群发内容
       getDetail() {
+        this.matterImgList = []
+        this.matterOthersList = []
         const headers = new Headers()
         headers.append('token', this.token)
         headers.append('tenancyId', this.tenancyId)
@@ -618,6 +640,26 @@
         }
         this.handleMember()
       },
+      freshClientData() {
+        const headers = new Headers()
+        headers.append('token', this.token)
+        headers.append('tenancyId', this.tenancyId)
+        headers.append('userId', this.userId)
+        fetch(this.httpUrl + `/scrm/v1/wxcp-group-send/m/refresh?id=${this.taskId}`, {
+          method: 'GET',
+          headers: headers
+        }).then(res => {
+          return res.json()
+        }).then(result => {
+          let { data, code, msg } = result
+          if (code === 1) {
+            vant.Toast.success('刷新成功')
+            this.handleMember()
+          } else {
+            vant.Toast.fail(msg)
+          }
+        })
+      },
       handleMember() {
         const headers = new Headers()
         headers.append('token', this.token)

+ 10 - 0
lottery/qw/clientMass.html

@@ -1882,6 +1882,16 @@
         if (this.formValidate.type === 1) {
           this.formValidate.sendTime = ''
         }
+        if (this.formValidate.matters && this.formValidate.matters.length) {
+          this.formValidate.matter = this.formValidate.matters.map(matter => {
+            return {
+              contentId: matter.id,
+              contentType: matter.contentType,
+              headUrl: matter.cover || '',
+              title: matter.title || matter.name,
+            }
+          })
+        }
         this.formValidate.tagReq.tagPackageList = this.processData(this.formValidate.tagReq.tagPackageList)
         fetch(this.httpUrl + '/scrm/v1/wxcp-send/m/add2', {
           method: 'post',

+ 65 - 8
lottery/qw/clientMassDetail.html

@@ -288,11 +288,24 @@
   .send_num_data {
     display: flex;
     align-items: center;
+    justify-content: space-between;
+    flex-wrap: wrap;
     padding: 15px 5px 10px;
     font-size: 12px;
     color: #222222;
     line-height: 17px;
   }
+  .fresh_data {
+    display: flex;
+    font-weight: 400;
+    font-size: 12px;
+    color: #136DFB;
+  }
+  .fresh_data img {
+    width: 16px;
+    height: 16px;
+    margin-right: 2px;
+  }
   .color1 {
     color: #1677FF;
     padding-right: 20px;
@@ -432,9 +445,15 @@
             <span :class="filterIndex === -1 ? 'active' : 'filter_span'" @click="handleFilter(-1)">无客户可发送</span>
           </div>
           <div class="send_num_data">
-            已发送:<span class="color1">{{memberExtra.sendSuccess}}</span>
-            未发送:<span class="color2">{{memberExtra.unSend}}</span>
-            发送失败:<span class="color3">{{memberExtra.sendFail}}</span>
+            <div>
+              已发送:<span class="color1">{{memberExtra.sendSuccess}}</span>
+              未发送:<span class="color2">{{memberExtra.unSend}}</span>
+              发送失败:<span class="color3">{{memberExtra.sendFail}}</span>
+            </div>
+            <div class="fresh_data" @click="freshClientData">
+              <img src="../img/qw/fresh.png" alt="">
+              <span>刷新</span>
+            </div>
           </div>
           <div class="send_mem_list">
             <div class="send_mem_item" v-for="(item, index) in sendMemberList" :key="index">
@@ -459,9 +478,17 @@
             <span :class="filterIndex === -1 ? 'active' : 'filter_span'" @click="handleFilter(-1)">无客户可发送</span>
           </div>
           <div class="send_num_data">
-            已接收客户:<span class="color1">{{clientExtra.sendSuccess}}</span>
-            未接收客户:<span class="color2">{{clientExtra.unSend}}</span>
-            接收失败客户:<span class="color3">{{clientExtra.sendFail}}</span>
+            <div>
+              已接收客户:<span class="color1">{{clientExtra.sendSuccess}}</span>
+              未接收客户:<span class="color2">{{clientExtra.unSend}}</span>
+            </div>
+            <div class="fresh_data" @click="freshClientData">
+              <img src="../img/qw/fresh.png" alt="">
+              <span>刷新</span>
+            </div>
+            <div>
+              接收失败客户:<span class="color3">{{clientExtra.sendFail}}</span>
+            </div>
           </div>
           <div class="send_mem_list">
             <div class="send_mem_item" v-for="(item, index) in clientList" :key="index">
@@ -473,7 +500,7 @@
                 <span class="color1" v-if="item.sendStatus === 1">已发送</span>
                 <span class="color3" v-if="item.sendStatus === 2">发送失败</span>
               </div>
-              <div class="send_mem_time">接收时间:<span style="color: #666666;">{{item.recvTime}}</span></div>
+              <div class="send_mem_time">接收时间:<span style="color: #666666;">{{timeFormat(item.recvTime)}}</span></div>
             </div>
           </div>
         </div>
@@ -564,6 +591,8 @@
       },
       // 群发内容
       getDetail() {
+        this.matterImgList = []
+        this.matterOthersList = []
         const headers = new Headers()
         headers.append('token', this.token)
         headers.append('tenancyId', this.tenancyId)
@@ -593,6 +622,30 @@
           }
         })
       },
+      freshClientData () {
+        const headers = new Headers()
+        headers.append('token', this.token)
+        headers.append('tenancyId', this.tenancyId)
+        headers.append('userId', this.userId)
+        fetch(this.httpUrl + `/scrm/v1/wxcp-send/m/refresh?id=${this.taskId}`, {
+          method: 'GET',
+          headers: headers
+        }).then(res => {
+          return res.json()
+        }).then(result => {
+          let { data, code, msg } = result
+          if (code === 1) {
+            vant.Toast.success('刷新成功')
+            if (this.activeTab === '客户详情') {
+              this.handleClient()
+            } else if (this.activeTab === '成员详情') {
+              this.handleMember()
+            }
+          } else {
+            vant.Toast.fail(msg)
+          }
+        })
+      },
       // 播放暂停视频
       playPause() {
         const video = document.getElementById('myVideo')
@@ -610,7 +663,11 @@
         } else {
           this.filterIndex = index
         }
-        this.handleMember()
+        if (this.activeTab === '成员详情') {
+          this.handleMember()
+        } else if (this.activeTab === '客户详情') {
+          this.handleClient()
+        }
       },
       handleMember() {
         const headers = new Headers()

+ 10 - 0
lottery/qw/pyqMass.html

@@ -1685,6 +1685,16 @@
         if (this.formValidate.type === 1) {
           this.formValidate.sendTime = ''
         }
+        if (this.formValidate.matters && this.formValidate.matters.length) {
+          this.formValidate.matter = this.formValidate.matters.map(matter => {
+            return {
+              contentId: matter.id,
+              contentType: matter.contentType,
+              headUrl: matter.cover || '',
+              title: matter.title || matter.name,
+            }
+          })
+        }
         fetch(this.httpUrl + '/scrm/v1/wxcp-moment/m/add', {
           method: 'post',
           body: JSON.stringify({

+ 1 - 4
lottery/qw/toDoTask.html

@@ -333,10 +333,7 @@
             });
 
           } else {
-            this.$message({
-              message: msg,
-              type: 'warning'
-            })
+            vant.Toast.fail(msg)
           }
         })
       },