|
|
@@ -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>
|