duanshenglang hai 2 semanas
pai
achega
3f5e37b27c
Modificáronse 4 ficheiros con 567 adicións e 26 borrados
  1. 5 1
      lottery/WeCom.html
  2. 277 14
      lottery/clientSop.html
  3. 272 11
      lottery/groupSop.html
  4. 13 0
      lottery/qw/toDoTask.html

+ 5 - 1
lottery/WeCom.html

@@ -816,7 +816,7 @@
           </div>
         </div>
         <!-- 标签筛选组件 -->
-        <select-tag :label-Filter.sync="labelFilter" :show-Client-Tag.sync="showClientTag" @add="handleAdd"></select-tag>
+        <select-tag :label-Filter.sync="labelFilter" :show-Client-Tag.sync="showClientTag" :select-Tag-List.sync="clientTags" @add="handleAdd"></select-tag>
         <!-- 客户、客户群列表 -->
         <div class="client_content" :style="activeTab === '客户' ? 'top: 144px' : 'top: 100px'">
           <div class="client_content_box">
@@ -968,6 +968,7 @@
         activeTag: '全部',
         loading: false,
         labelFilter: 0,
+        clientTags: [],
         activeTabbar: 'home',
         keyword: '',
         showClientTag: false,
@@ -1208,6 +1209,7 @@
       },
       handleAdd(tagType, tagList) {
         this.labelFilter = tagType
+        this.clientTags = tagList
         this.tagIds = tagList.length ? tagList.map(item => item.id) : []
         this.pageClient()
       },
@@ -1315,7 +1317,9 @@
         if (tag === '按客户标签筛选') {
           this.showClientTag = true
         } else {
+          this.labelFilter = 0
           this.tagIds = []
+          this.clientTags = []
           this.pageClient()
         }
       },

+ 277 - 14
lottery/clientSop.html

@@ -161,8 +161,20 @@
               {{timeFormat(item.executeTime, 'yyyy-MM-dd')}}
             </div>
             <div class="sop_item">
-              <div><span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>发送<span
-                  style="color: #999;">{{item.isSend ? '(已发送)' : ''}}</span></div>
+              <div>
+                <span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>
+                发送<span style="color: #999;">{{item.isSend ? '(已发送)' : ''}}</span>
+              </div>
+              <div class="sop_body" v-if="item.contentText">
+                <div>
+                  <div class="sop_c">
+                    <span>{{ item.contentText }}</span>
+                  </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="sendContentText(item.id, item.contentText)">发送</div>
+                  </div>
+                </div>
+              </div>
               <div class="sop_body" v-if="item.ctOthers.length > 0">
                 <div v-for="(c, cIndex) in item.ctOthers" :key="cIndex">
                   <div class="sop_c" v-if="c.matterType === 0">
@@ -181,7 +193,7 @@
                     <span>{{ c.fileName }}</span>
                   </div>
                   <div class="sop_foot">
-                    <div class="sop_btn" @click="handleSend(item.id, c)">发送</div>
+                    <div class="sop_btn" @click="handleCtOthersSend(item.id, c)">发送</div>
                   </div>
                 </div>
               </div>
@@ -220,6 +232,9 @@
                   <div v-if="m.contentType === 4" class="sop_c">
                     <span>外部链接:{{ m.title }}</span>
                   </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="handleMattersSend(item.id, m)">发送</div>
+                  </div>
                 </div>
               </div>
             </div>
@@ -245,8 +260,20 @@
               {{timeFormat(item.executeTime, 'yyyy-MM-dd')}}
             </div>
             <div class="sop_item">
-              <div><span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>发送(<span
-                  style="color: #999;">{{item.isSend ? '已发送' : ''}}</span>)</div>
+              <div>
+                <span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>
+                发送<span style="color: #999;">{{item.isSend ? '已发送' : ''}}</span>
+              </div>
+              <div class="sop_body" v-if="item.contentText">
+                <div>
+                  <div class="sop_c">
+                    <span>{{ item.contentText }}</span>
+                  </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="sendContentText(item.id, item.contentText)">发送</div>
+                  </div>
+                </div>
+              </div>
               <div class="sop_body" v-if="item.ctOthers.length > 0">
                 <div v-for="(c, cIndex) in item.ctOthers" :key="cIndex">
                   <div class="sop_c" v-if="c.matterType === 0">
@@ -265,7 +292,7 @@
                     <span>{{ c.fileName }}</span>
                   </div>
                   <div class="sop_foot">
-                    <div class="sop_btn" @click="handleSend(item.id, c)">发送</div>
+                    <div class="sop_btn" @click="handleCtOthersSend(item.id, c)">发送</div>
                   </div>
                 </div>
               </div>
@@ -304,6 +331,9 @@
                   <div v-if="m.contentType === 4" class="sop_c">
                     <span>外部链接:{{ m.title }}</span>
                   </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="handleMattersSend(item.id, m)">发送</div>
+                  </div>
                 </div>
               </div>
             </div>
@@ -347,8 +377,8 @@
         // 授权
         this.getAuth()
       }
-      // this.memberId = "woU17nDAAAnoSca19vZVKiNEKdc9tyYQ"
-      // this.externalUserId = "wmU17nDAAAGT2PF6G8PUHdSx2DY1ljpg"
+      // this.memberId = "woU17nDAAAd2m75dFfnjeg_x_egmMkIQ"
+      // this.externalUserId = "wmU17nDAAARtlDBF2x_WFHAM5i360zAg"
       // this.executeSopList()
     },
     methods: {
@@ -439,7 +469,9 @@
       },
       //获取执行中的sop计划
       executeSopList (status) {
-        this.externalUserId = ''
+        if (!this.externalUserId) {
+          return
+        }
         fetch(this.httpUrl + `/scrm/v1/wxcp-sop/p/executeSopList?externalUserId=${this.externalUserId}&memberId=${this.memberId}&bId=${this.bId}&status=${status || 0}`)
           .then(res => {
             return res.json()
@@ -489,7 +521,237 @@
             }
           })
       },
-      handleSend (historyId, c) {
+      // 发送话术(contentText)
+      sendContentText(historyId, contentText) {
+        this.historyId = historyId
+        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) {
+            let that = this
+            wx.agentConfig({
+              corpid: data.corpid,
+              agentid: data.agentId,
+              timestamp: data.timestamp, // 必填,生成签名的时间戳
+              nonceStr: data.nonceStr, // 必填,生成签名的随机串
+              signature: data.agentSignature, // 必填,签名,见附录1
+              jsApiList: ['sendChatMessage'], // 必填,需要使用的JS接口列表
+              success: function (res) {
+                // 发送话术(contentText)
+                wx.invoke('sendChatMessage', {
+                  msgtype: "text", //消息类型,必填
+                  enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                  text: {
+                    content: contentText, //文本内容
+                  },
+                }, function (res) {
+                  if (res.err_msg == 'sendChatMessage:ok') {
+                    that.updateSop()
+                    //发送成功
+                    that.$message({
+                      message: '发送成功',
+                      type: 'success'
+                    })
+                  }
+                })
+              },
+              fail: function (res) {
+                if (res.errMsg.indexOf('function not exist') > -1) {
+                  alert('版本过低请升级');
+                }
+              },
+              complete: function (res) {
+                // 回调
+                console.log('complete', res);
+              }
+            });
+          } else {
+            this.$message({
+              message: msg,
+              type: 'warning'
+            })
+          }
+        })
+      },
+      // 获取Matters mediaId
+      handleMattersSend(historyId, m) {
+        this.historyId = historyId
+        if (m.contentType === 1 || m.contentType === 3  || m.contentType === 15 || m.contentType === 19 || m.contentType === 31) {
+          fetch(this.httpUrl + `/scrm/v1/wxcp-sop/p/getMedia?planContentId=${m.id}`)
+            .then(res => {
+              return res.json()
+            }).then(result => {
+              let { data, code, msg } = result
+              if (code === 1) {
+                this.sendMattersData(m, data.mediaId)
+              } else {
+                this.$message({
+                  message: msg,
+                  type: 'warning'
+                })
+              }
+            })
+        } else {
+          this.sendMattersData(m)
+        }
+      },
+      // 发送素材库素材(ctOthers)
+      sendMattersData(m, mediaId) {
+        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) {
+            let that = this
+            wx.agentConfig({
+              corpid: data.corpid,
+              agentid: data.agentId,
+              timestamp: data.timestamp, // 必填,生成签名的时间戳
+              nonceStr: data.nonceStr, // 必填,生成签名的随机串
+              signature: data.agentSignature, // 必填,签名,见附录1
+              jsApiList: ['sendChatMessage'], // 必填,需要使用的JS接口列表
+              success: function (res) {
+                // 发送素材库数据
+                // 文章,表单,外部链接,视频,图集
+                if (m.contentType === 0 || m.contentType === 2 || m.contentType === 4 || m.contentType === 16 || m.contentType === 17) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "news", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    news: {
+                      link: m.sendUrl, //H5消息页面url 必填
+                      title: m.title || m.name || '', //H5消息标题.
+                      desc: m.abs || '', //H5消息摘要
+                      imgUrl: m.cover || '', //H5消息封面图片URL
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 图片
+                } else if (m.contentType === 1 || m.contentType === 31) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "image", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    image:
+                    {
+                      mediaid: mediaId, //视频的素材id
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 文件
+                } else if (m.contentType === 3) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "file", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    file:
+                    {
+                      mediaid: mediaId, //视频的素材id
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 原生视频格式
+                } else if (m.contentType === 15) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "video", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    video:
+                    {
+                      mediaid: mediaId, //视频的素材id
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 小程序
+                } else if (m.contentType === 33) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "miniprogram", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    miniprogram: {
+                      appid: m.wxId, //H5消息页面url 必填
+                      title: m.title || m.name || '', //H5消息标题.
+                      imgUrl: m.headImg || '', //H5消息封面图片URL
+                      page: m.enterPoint || '', //H5消息摘要
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                }
+              },
+              fail: function (res) {
+                if (res.errMsg.indexOf('function not exist') > -1) {
+                  alert('版本过低请升级');
+                }
+              },
+              complete: function (res) {
+                // 回调
+                console.log('complete', res);
+              }
+            });
+          } else {
+            this.$message({
+              message: msg,
+              type: 'warning'
+            })
+          }
+        })
+      },
+      // 获取CtOthers mediaId
+      handleCtOthersSend (historyId, c) {
         this.historyId = historyId
         if (c.matterType === 1 || c.matterType === 2 || c.matterType === 4) {
           fetch(this.httpUrl + `/scrm/v1/wxcp-sop/p/getMedia?planContentId=${c.id}`)
@@ -498,7 +760,7 @@
             }).then(result => {
               let { data, code, msg } = result
               if (code === 1) {
-                this.sendData(c, data.mediaId)
+                this.sendCtOthersData(c, data.mediaId)
               } else {
                 this.$message({
                   message: msg,
@@ -507,10 +769,11 @@
               }
             })
         } else {
-          this.sendData(c)
+          this.sendCtOthersData(c)
         }
       },
-      sendData (c, mediaId) {
+      // 发送自定义素材(ctOthers)
+      sendCtOthersData (c, mediaId) {
         fetch(this.httpUrl + '/scrm/v1/wxcp-corp/p/getAgentConfig', {
           method: 'post',
           body: JSON.stringify({
@@ -534,7 +797,7 @@
               signature: data.agentSignature, // 必填,签名,见附录1
               jsApiList: ['sendChatMessage'], // 必填,需要使用的JS接口列表
               success: function(res) {
-                // 回调
+                // 发送自定义数据
                 if (c.matterType === 0) {
                   wx.invoke('sendChatMessage', {
                     msgtype: "text", //消息类型,必填

+ 272 - 11
lottery/groupSop.html

@@ -161,8 +161,20 @@
               {{timeFormat(item.executeTime, 'yyyy-MM-dd')}}
             </div>
             <div class="sop_item">
-              <div><span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>发送<span
-                  style="color: #999;">{{item.isSend ? '(已发送)' : ''}}</span></div>
+              <div>
+                <span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>
+                发送<span style="color: #999;">{{item.isSend ? '(已发送)' : ''}}</span>
+              </div>
+              <div class="sop_body" v-if="item.contentText">
+                <div>
+                  <div class="sop_c">
+                    <span>{{ item.contentText }}</span>
+                  </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="sendContentText(item.id, item.contentText)">发送</div>
+                  </div>
+                </div>
+              </div>
               <div class="sop_body" v-if="item.ctOthers.length > 0">
                 <div v-for="(c, cIndex) in item.ctOthers" :key="cIndex">
                   <div class="sop_c" v-if="c.matterType === 0">
@@ -181,7 +193,7 @@
                     <span>{{ c.fileName }}</span>
                   </div>
                   <div class="sop_foot">
-                    <div class="sop_btn" @click="handleSend(item.id, c)">发送</div>
+                    <div class="sop_btn" @click="handleCtOthersSend(item.id, c)">发送</div>
                   </div>
                 </div>
               </div>
@@ -220,6 +232,9 @@
                   <div v-if="m.contentType === 4" class="sop_c">
                     <span>外部链接:{{ m.title }}</span>
                   </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="handleMattersSend(item.id, m)">发送</div>
+                  </div>
                 </div>
               </div>
             </div>
@@ -245,8 +260,20 @@
               {{timeFormat(item.executeTime, 'yyyy-MM-dd')}}
             </div>
             <div class="sop_item">
-              <div><span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>发送<span
-                  style="color: #999;">{{item.isSend ? '(已发送)' : ''}}</span></div>
+              <div>
+                <span style="color: #1890ff;">{{timeFormat(item.executeTime, 'hh:mm:ss')}}</span>
+                发送<span style="color: #999;">{{item.isSend ? '(已发送)' : ''}}</span>
+              </div>
+              <div class="sop_body" v-if="item.contentText">
+                <div>
+                  <div class="sop_c">
+                    <span>{{ item.contentText }}</span>
+                  </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="sendContentText(item.id, item.contentText)">发送</div>
+                  </div>
+                </div>
+              </div>
               <div class="sop_body" v-if="item.ctOthers.length > 0">
                 <div v-for="(c, cIndex) in item.ctOthers" :key="cIndex">
                   <div class="sop_c" v-if="c.matterType === 0">
@@ -265,7 +292,7 @@
                     <span>{{ c.fileName }}</span>
                   </div>
                   <div class="sop_foot">
-                    <div class="sop_btn" @click="handleSend(item.id, c)">发送</div>
+                    <div class="sop_btn" @click="handleCtOthersSend(item.id, c)">发送</div>
                   </div>
                 </div>
               </div>
@@ -304,6 +331,9 @@
                   <div v-if="m.contentType === 4" class="sop_c">
                     <span>外部链接:{{ m.title }}</span>
                   </div>
+                  <div class="sop_foot">
+                    <div class="sop_btn" @click="handleMattersSend(item.id, m)">发送</div>
+                  </div>
                 </div>
               </div>
             </div>
@@ -490,7 +520,237 @@
             }
           })
       },
-      handleSend (historyId, c) {
+      // 发送话术(contentText)
+      sendContentText(historyId, contentText) {
+        this.historyId = historyId
+        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) {
+            let that = this
+            wx.agentConfig({
+              corpid: data.corpid,
+              agentid: data.agentId,
+              timestamp: data.timestamp, // 必填,生成签名的时间戳
+              nonceStr: data.nonceStr, // 必填,生成签名的随机串
+              signature: data.agentSignature, // 必填,签名,见附录1
+              jsApiList: ['sendChatMessage'], // 必填,需要使用的JS接口列表
+              success: function (res) {
+                // 发送话术(contentText)
+                wx.invoke('sendChatMessage', {
+                  msgtype: "text", //消息类型,必填
+                  enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                  text: {
+                    content: contentText, //文本内容
+                  },
+                }, function (res) {
+                  if (res.err_msg == 'sendChatMessage:ok') {
+                    that.updateSop()
+                    //发送成功
+                    that.$message({
+                      message: '发送成功',
+                      type: 'success'
+                    })
+                  }
+                })
+              },
+              fail: function (res) {
+                if (res.errMsg.indexOf('function not exist') > -1) {
+                  alert('版本过低请升级');
+                }
+              },
+              complete: function (res) {
+                // 回调
+                console.log('complete', res);
+              }
+            });
+          } else {
+            this.$message({
+              message: msg,
+              type: 'warning'
+            })
+          }
+        })
+      },
+      // 获取Matters mediaId
+      handleMattersSend(historyId, m) {
+        this.historyId = historyId
+        if (m.contentType === 1 || m.contentType === 3 || m.contentType === 15 || m.contentType === 19 || m.contentType === 31) {
+          fetch(this.httpUrl + `/scrm/v1/wxcp-sop/p/getMedia?planContentId=${m.id}`)
+            .then(res => {
+              return res.json()
+            }).then(result => {
+              let { data, code, msg } = result
+              if (code === 1) {
+                this.sendMattersData(m, data.mediaId)
+              } else {
+                this.$message({
+                  message: msg,
+                  type: 'warning'
+                })
+              }
+            })
+        } else {
+          this.sendMattersData(m)
+        }
+      },
+      // 发送素材库素材(ctOthers)
+      sendMattersData(m, mediaId) {
+        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) {
+            let that = this
+            wx.agentConfig({
+              corpid: data.corpid,
+              agentid: data.agentId,
+              timestamp: data.timestamp, // 必填,生成签名的时间戳
+              nonceStr: data.nonceStr, // 必填,生成签名的随机串
+              signature: data.agentSignature, // 必填,签名,见附录1
+              jsApiList: ['sendChatMessage'], // 必填,需要使用的JS接口列表
+              success: function (res) {
+                // 发送素材库数据
+                // 文章,表单,外部链接,视频,图集
+                if (m.contentType === 0 || m.contentType === 2 || m.contentType === 4 || m.contentType === 16 || m.contentType === 17) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "news", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    news: {
+                      link: m.sendUrl, //H5消息页面url 必填
+                      title: m.title || m.name || '', //H5消息标题.
+                      desc: m.abs || '', //H5消息摘要
+                      imgUrl: m.cover || '', //H5消息封面图片URL
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 图片
+                } else if (m.contentType === 1 || m.contentType === 31) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "image", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    image:
+                    {
+                      mediaid: mediaId, //视频的素材id
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 文件
+                } else if (m.contentType === 3) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "file", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    file:
+                    {
+                      mediaid: mediaId, //视频的素材id
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 原生视频格式
+                } else if (m.contentType === 15) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "video", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    video:
+                    {
+                      mediaid: mediaId, //视频的素材id
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                  // 小程序
+                } else if (m.contentType === 33) {
+                  wx.invoke('sendChatMessage', {
+                    msgtype: "miniprogram", //消息类型,必填
+                    enterChat: false, //为true时表示发送完成之后顺便进入会话,仅移动端3.1.10及以上版本支持该字段
+                    miniprogram: {
+                      appid: m.wxId, //H5消息页面url 必填
+                      title: m.title || m.name || '', //H5消息标题.
+                      imgUrl: m.headImg || '', //H5消息封面图片URL
+                      page: m.enterPoint || '', //H5消息摘要
+                    },
+                  }, function (res) {
+                    if (res.err_msg == 'sendChatMessage:ok') {
+                      that.updateSop()
+                      //发送成功
+                      that.$message({
+                        message: '发送成功',
+                        type: 'success'
+                      })
+                    }
+                  })
+                }
+              },
+              fail: function (res) {
+                if (res.errMsg.indexOf('function not exist') > -1) {
+                  alert('版本过低请升级');
+                }
+              },
+              complete: function (res) {
+                // 回调
+                console.log('complete', res);
+              }
+            });
+          } else {
+            this.$message({
+              message: msg,
+              type: 'warning'
+            })
+          }
+        })
+      },
+      // 获取CtOthers mediaId
+      handleCtOthersSend (historyId, c) {
         this.historyId = historyId
         if (c.matterType === 1 || c.matterType === 2 || c.matterType === 4) {
           fetch(this.httpUrl + `/scrm/v1/wxcp-group-sop/p/getMedia?planContentId=${c.id}`)
@@ -499,7 +759,7 @@
             }).then(result => {
               let { data, code, msg } = result
               if (code === 1) {
-                this.sendData(c, data.mediaId)
+                this.sendCtOthersData(c, data.mediaId)
               } else {
                 this.$message({
                   message: msg,
@@ -508,10 +768,11 @@
               }
             })
         } else {
-          this.sendData(c)
+          this.sendCtOthersData(c)
         }
       },
-      sendData (c, mediaId) {
+      // 发送自定义素材(ctOthers)
+      sendCtOthersData (c, mediaId) {
         fetch(this.httpUrl + '/scrm/v1/wxcp-corp/p/getAgentConfig', {
           method: 'post',
           body: JSON.stringify({
@@ -535,7 +796,7 @@
               signature: data.agentSignature, // 必填,签名,见附录1
               jsApiList: ['sendChatMessage'], // 必填,需要使用的JS接口列表
               success: function(res) {
-                // 回调
+                // 发送自定义数据
                 if (c.matterType === 0) {
                   wx.invoke('sendChatMessage', {
                     msgtype: "text", //消息类型,必填

+ 13 - 0
lottery/qw/toDoTask.html

@@ -253,12 +253,25 @@
             }
           })
       },
+      toRead(taskId) {
+        fetch(this.httpUrl + `/scrm/v1/wxcp-member-todo-task/p/read?taskId=${taskId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+            } else {
+              vant.Toast.fail(msg)
+            }
+          })
+      },
       handleTaskDetail(item) {
         if (this.taskType === 'MONITORED_MESSAGE') {
           if (!item.clientExternalUserId) {
             vant.Toast.fail('无效')
             return
           }
+          this.toRead(item.todoTaskId)
           wx.openEnterpriseChat({
             externalUserIds: item.clientExternalUserId, // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
             groupName: "",  // 会话名称。单聊时该参数传入空字符串""即可。