3 lines
19 KiB
JavaScript
3 lines
19 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-29fde8ae"],{"0213e":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"sop-task-list"},[n("div",{staticClass:"content"},[n("scope-panel",{attrs:{title:"当前"+t.taskTypeName+"待发消息("+t.taskCount+"条)"},scopedSlots:t._u([{key:"header-box",fn:function(){return[n("div",{staticClass:"tab-bar"},t._l(t.tabs,(function(e,r){return n("div",{key:r,staticClass:"tab",class:t.taskType==e.type?"active-tab":"",on:{click:function(n){return t.changeTab(e.type)}}},[t._v(t._s(e.name))])})),0),n("div"),n("van-divider",{staticStyle:{margin:"10px 0"}})]},proxy:!0}])},[1*t.taskCount>0?n("div",[n("div",{staticClass:"task-message"},[t._v("管理员提醒你在"+t._s(t.taskTime)+"给"+t._s(t.taskTypeName)+"推送以下信息")]),n("ul",{staticClass:"task-list"},t._l(t.currentTaskList,(function(e,r){return n("li",{key:r,staticClass:"task-item"},[n("div",{staticClass:"task-name overflow"},[t._v(t._s(r+1)+"."+t._s(e.task_name))]),n("div",{staticClass:"view-detail-btn",on:{click:function(n){return t.viewDetail(e.id)}}},[t._v("查看详情")])])})),0)]):n("div",{staticClass:"empty-tip"},[t._v("当前"+t._s(t.taskTypeName)+"无消息任务,点击去发送跳转到下一"+t._s(t.taskTypeName)+"!")])]),n("scope-panel",{staticStyle:{"margin-top":"0.5rem"},attrs:{title:"其他待发送消息"+t.taskTypeName+"("+t.otherTaskList.length+"个)"}},[n("div",{staticClass:"task-message"},[t._v("点击最下方去发送,跳转到下一个"+t._s(t.taskTypeName)+"聊天窗!")]),t.otherTaskList.length>0?n("ul",{staticClass:"customer-list"},t._l(t.otherTaskList,(function(e,r){return n("li",{key:r,staticClass:"customer-box"},[4==t.taskType?[n("img",{staticClass:"avatar",attrs:{src:e.group_chat_avatar,alt:""}}),n("div",{staticStyle:{"margin-left":"0.5rem"}},[n("div",{staticClass:"nickname overflow"},[t._v(t._s(e.group_name))]),n("div",{staticClass:"message"},[t._v(t._s(e.task_total)+"条待发消息")])])]:[n("img",{staticClass:"avatar",attrs:{src:e.avatar,alt:""}}),n("div",{staticStyle:{"margin-left":"0.5rem"}},[n("div",{staticClass:"nickname overflow"},[t._v(t._s(e.name))]),n("div",{staticClass:"message"},[t._v(t._s(e.task_total)+"条待发消息")])])]],2)})),0):n("van-empty",{attrs:{description:"暂无待发"+t.taskTypeName}}),n("div",{staticStyle:{"text-align":"center"}},[t.currentTaskList.length>0?n("div",{staticClass:"push-btn",on:{click:function(e){return t.viewDetail(!1)}}},[t._v("去发送")]):n("div",{class:["push-btn",{gray:t.otherTaskList.length<=0}],on:{click:t.toNextChat}},[t._v("下一个"+t._s(t.taskTypeName))]),n("div",{staticClass:"tip"},[t._v("点击去发送后,进入到任务详情!")])])],1)],1)])},a=[],i=n("5530"),o=(n("caad"),n("d3b7"),n("159b"),n("d76c")),s=n("e944"),c={mixins:[o["a"]],data:function(){return{tabs:[{name:"客户消息任务",type:1},{name:"群聊消息任务",type:4}],taskType:1,taskTypeName:"客户",chatId:"",userId:"",taskTime:"",taskCount:0,currentTaskList:[],otherTaskList:[]}},created:function(){var t=this;this.appjsApiList=["getCurExternalContact","getCurExternalChat","sendChatMessage","openEnterpriseChat"],this.agentConfigUrl="plugin.sop-task.frontend.controller.member.login.getConfig",this.appSignSuccess=function(){t.entryHandler()}},methods:{entryHandler:function(){var t=this;wx.invoke("getCurExternalChat",{},(function(e){"getCurExternalChat:ok"==e.err_msg&&(t.chatId=e.chatId,t.setTaskType(4),t.getCustomerTask())})),wx.invoke("getCurExternalContact",{},(function(e){"getCurExternalContact:ok"==e.err_msg&&(t.userId=e.userId,t.setTaskType(1),t.getCustomerTask())}))},setTaskType:function(t){this.taskType=void 0!=t?1*t:1,4==t?this.taskTypeName="群聊":[1,2,3].includes(t)&&(this.taskTypeName="客户")},changeTab:function(t){this.setTaskType(t),this.getCustomerTask()},getCustomerTask:function(){var t=this,e={};e.task_type=this.taskType,4==this.taskType?e.chat_id=this.chatId:e.external_userid=this.userId,$http.post("plugin.sop-task.frontend.controller.task.task.getTask",e,"loading").then((function(e){var n,r,a=e.result,i=e.msg,o=e.data;if(1!==a)return t.$toast(i);if(4==t.taskType)t.currentTaskList=null!==(n=o.group_current)&&void 0!==n?n:[],t.otherTaskList=null!==(r=o.group_othor)&&void 0!==r?r:[],t.otherTaskList.forEach((function(t){t.avatar=o.group_chat_avatar}));else if([1,2,3].includes(t.taskType)){var s,c;t.currentTaskList=null!==(s=o.current)&&void 0!==s?s:[],t.otherTaskList=null!==(c=o.othor)&&void 0!==c?c:[]}t.taskTime=o.date,t.taskCount=o.task_count,t.currentTaskList&&t.currentTaskList.length>0&&(t.task_log_id=t.currentTaskList[0].id)}))},toNextChat:function(){if(this.otherTaskList&&this.otherTaskList.length<=0)return this.$dialog.confirm({title:"提示",message:"暂无待发消息".concat(this.taskTypeName,"!")});if(!this.isSignWorkApp)return this.$dialog.confirm({title:"提示",message:"企业应用未授权!"});var t={};if(4===this.taskType){var e=this.otherTaskList[0].chat_id;t.chatId=e}else if([1,2,3].includes(this.taskType)){var n=this.otherTaskList[0].userid;t.externalUserIds=n}wx.openEnterpriseChat(Object(i["a"])(Object(i["a"])({},t),{},{success:function(t){},fail:function(t){t.errMsg.indexOf("function not exist")>-1&&alert("版本过低请升级")}}))},viewDetail:function(t){t=t||this.task_log_id,this.$router.push(this.fun.getUrl("sopTaskDetail",{taskLog:t}))}},components:{scopePanel:s["a"]}},l=c,u=(n("6c1e"),n("2877")),d=Object(u["a"])(l,r,a,!1,null,"0b2d84f8",null);e["default"]=d.exports},"1da1":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));n("d3b7");function r(t,e,n,r,a,i,o){try{var s=t[i](o),c=s.value}catch(l){return void n(l)}s.done?e(c):Promise.resolve(c).then(r,a)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(a,i){var o=t.apply(e,n);function s(t){r(o,a,i,s,c,"next",t)}function c(t){r(o,a,i,s,c,"throw",t)}s(void 0)}))}}},"2b64":function(t,e,n){var r=n("ec8b");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var a=n("499e").default;a("7eee1d86",r,!0,{sourceMap:!1,shadowMode:!1})},"6c1e":function(t,e,n){"use strict";n("7e24")},"7e24":function(t,e,n){var r=n("fc58");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var a=n("499e").default;a("d46686e6",r,!0,{sourceMap:!1,shadowMode:!1})},b389:function(t,e,n){"use strict";n("2b64")},c7eb:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("d9e2"),n("3410"),n("159b"),n("b0c0"),n("131a"),n("fb6a");var r=n("53ca");function a(){
|
||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||
a=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(S){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var a=e&&e.prototype instanceof f?e:f,i=Object.create(a.prototype),o=new C(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw i;return E()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=w(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,o),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(S){return{type:"throw",arg:S}}}t.wrap=u;var p={};function f(){}function h(){}function g(){}var v={};l(v,o,(function(){return this}));var m=Object.getPrototypeOf,k=m&&m(m(L([])));k&&k!==e&&n.call(k,o)&&(v=k);var b=g.prototype=f.prototype=Object.create(v);function y(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function a(i,o,s,c){var l=d(t[i],t,o);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==Object(r["a"])(p)&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){a("next",t,s,c)}),(function(t){a("throw",t,s,c)})):e.resolve(p).then((function(t){u.value=t,s(u)}),(function(t){return a("throw",t,s,c)}))}c(l.arg)}var i;this._invoke=function(t,n){function r(){return new e((function(e,r){a(t,n,e,r)}))}return i=i?i.then(r,r):r()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=d(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=g,l(b,"constructor",g),l(g,"constructor",h),h.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(x.prototype),l(x.prototype,s,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,a,i){void 0===i&&(i=Promise);var o=new x(u(e,n,r,a),i);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},y(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=L,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;T(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}},d76c:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("c7eb"),a=n("1da1"),i=(n("e9c4"),{data:function(){return{agentConfigUrl:null,isSignWorkApp:!1,agentData:{agent_secret:"",agentid:"",corpid:""},get_token:{},appjsApiList:[],appSignCallback:null,appSignError:null}},created:function(){if(this.fun.getKey("crop_id")){var t=this.fun.getKey("crop_id");window.localStorage.setItem("crop_id",t),this.corp_id=t}else this.corp_id=window.localStorage.getItem("crop_id")||"0"},activated:function(){this.getAgentConfig()},methods:{getAgentConfig:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var n,a,i,o,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t,a=t.agentConfigUrl||"plugin.wechat-chat-sidebar.frontend.controller.index.get-config",i="ios"===t.fun.isIosOrAndroid()?window.initUrl:document.location.href,e.prev=3,e.next=6,$http.post(a,{crop_id:t.corp_id,url:i},"loading");case 6:if(o=e.sent,1!=o.result){e.next=11;break}t.agentData=o.data,e.next=12;break;case 11:return e.abrupt("return",t.$toast(o.msg));case 12:t.get_token=t.agentData.get_token,s={debug:!1,beta:!0,jsApiList:["agentConfig","closeWindow"],openTagList:["ww-open-data"],appId:t.agentData.corpid,nonceStr:t.get_token.noncestr,timestamp:t.get_token.timestamp,signature:t.get_token.token},wx.config(s),wx.ready((function(){setTimeout((function(){t.getAgentSign(s,t.get_token.app_token)}),500)})),wx.error((function(t){n.$toast(JSON.stringify(t))})),e.next=22;break;case 19:e.prev=19,e.t0=e["catch"](3),t.$toast(e.t0);case 22:case"end":return e.stop()}}),e,null,[[3,19]])})))()},getAgentSign:function(t,e){var n=this;wx.agentConfig({debug:!1,corpid:t.appId,agentid:this.agentData.agentid,timestamp:t.timestamp,nonceStr:t.nonceStr,signature:e,jsApiList:n.appjsApiList,success:function(){n.isSignWorkApp=!0,n.appSignSuccess&&n.appSignSuccess()},fail:function(t){n.appSignError&&n.appSignError(),t.errMsg.indexOf("function not exist")>-1?n.$toast("版本过低请升级"):n.$toast("企业应用授权失败,请联系管理员重新配置!")}})}}})},e944:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"scope-panel"},[t._t("header-box"),""!==t.title?n("div",{staticClass:"panel-title"},[n("div",{staticClass:"mini-col"}),n("div",[t._v(t._s(t.title))])]):t._e(),t._t("default")],2)},a=[],i={props:{title:{type:String,default:""}},data:function(){return{}},methods:{},components:{}},o=i,s=(n("b389"),n("2877")),c=Object(s["a"])(o,r,a,!1,null,"78d65230",null);e["a"]=c.exports},ec8b:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,".scope-panel[data-v-78d65230]{padding:.8rem;margin-top:.8rem;background-color:#fff;border-radius:.45rem}.scope-panel .panel-title[data-v-78d65230]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.scope-panel .panel-title .mini-col[data-v-78d65230]{width:.21rem;height:1.05rem;margin-right:.5rem;background-color:#f05152;border-radius:.16rem}",""]),t.exports=e},fc58:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,".sop-task-list .content[data-v-0b2d84f8]{text-align:left;padding:.63rem;background-color:#f6f6f6}.sop-task-list .content .tab-bar[data-v-0b2d84f8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:default}.sop-task-list .content .tab-bar .tab[data-v-0b2d84f8]{color:#a7a6a6;padding:0 .5rem;border-right:2px solid #a7a6a6}.sop-task-list .content .tab-bar .active-tab[data-v-0b2d84f8]{color:#f05152}.sop-task-list .content .tab-bar .tab[data-v-0b2d84f8]:last-of-type{border-right:none}.sop-task-list .content .empty-tip[data-v-0b2d84f8],.sop-task-list .content .task-message[data-v-0b2d84f8]{font-size:12px;color:#727272;margin-top:.63rem}.sop-task-list .content .empty-tip[data-v-0b2d84f8]{padding-left:.8rem}.sop-task-list .content .task-list[data-v-0b2d84f8]{margin-top:1rem;color:#333;font-size:14px}.sop-task-list .content .task-list .task-item[data-v-0b2d84f8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:.8rem}.sop-task-list .content .task-list .task-name[data-v-0b2d84f8]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:0}.sop-task-list .content .task-list .view-detail-btn[data-v-0b2d84f8]{padding:.2rem .7rem;color:#f05152;text-align:center;border-radius:1rem;font-size:12px;border:1px solid #f05152;cursor:pointer}.sop-task-list .content .customer-list[data-v-0b2d84f8]{margin-top:.5rem}.sop-task-list .content .customer-list .customer-box[data-v-0b2d84f8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin-top:.8rem}.sop-task-list .content .customer-list .customer-box .avatar[data-v-0b2d84f8]{width:2.38rem;height:2.38rem;margin:0;border-radius:50%}.sop-task-list .content .customer-list .customer-box .nickname[data-v-0b2d84f8]{max-width:12rem}.sop-task-list .content .customer-list .customer-box .message[data-v-0b2d84f8]{font-size:12px;color:#666}.sop-task-list .content .push-btn[data-v-0b2d84f8]{display:inline-block;margin-top:1.5rem;color:#fff;padding:.3rem 3rem;font-size:14px;background-color:#f05152;border-radius:1rem;cursor:pointer}.sop-task-list .content .gray[data-v-0b2d84f8]{background-color:#a7a6a6}.sop-task-list .content .tip[data-v-0b2d84f8]{margin-top:.5rem;font-size:12px;color:#727272}",""]),t.exports=e}}]); |