3 lines
18 KiB
JavaScript
3 lines
18 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-496fa9da"],{"09a8":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"push-task-page"},[r("scope-panel",{attrs:{title:"推送详情"}},[r("div",{staticClass:"task-message"},[t._v("管理员提醒你在"+t._s(t.taskTime)+"给"+t._s(t.taskTypeName)+"推送以下信息")]),r("p",{staticClass:"task-name"},[t._v(t._s(t.taskName))]),t.taskContent.length>0?r("div",{staticClass:"task-content"},t._l(t.taskContent,(function(e,n){return r("div",{key:n},["text"==e.type?r("div",{staticClass:"text-box task-box"},[t._v(t._s(e.news))]):t._e(),"image"==e.type?r("div",{staticClass:"img-box task-box"},[r("img",{staticClass:"image",attrs:{src:e.link_img,alt:""},on:{click:function(r){return t.previewImg(e.link_img)}}})]):t._e(),"video"==e.type?r("div",{staticClass:"img-box task-box"},[r("video",{staticClass:"task-video",attrs:{width:"320",height:"240",controls:""}},[r("source",{attrs:{src:e.link_video}}),t._v(" 您的浏览器不支持 video 标签。 ")])]):t._e(),"link"==e.type?r("div",{staticClass:"link-box task-box"},[r("div",{staticClass:"link-title"},[t._v(t._s(e.title))]),r("p",{staticClass:"link-url"},[t._v(t._s(e.link))]),r("p",[t._v(t._s(e.describe))]),r("img",{staticClass:"image",attrs:{src:e.link_img,alt:""},on:{click:function(r){return t.previewImg(e.link_img)}}})]):t._e(),"applet"==e.type?r("div",{staticClass:"link-box task-box"},[r("div",{staticClass:"link-title"},[t._v(t._s(e.title))]),r("p",{staticClass:"link-url"},[t._v(t._s(e.appid))]),r("p",{staticClass:"link-url"},[t._v(t._s(e.page))]),r("img",{staticClass:"image",attrs:{src:e.link_img,alt:""},on:{click:function(r){return t.previewImg(e.link_img)}}})]):t._e(),"file"==e.type?r("div",{staticClass:"file-box task-box"},[r("div",{staticClass:"file-name"},[t._v("文件名称")])]):t._e()])})),0):r("van-empty",{attrs:{description:"没有任务内容了"}})],1),r("scope-panel",{attrs:{title:"推送方法"}},[r("ol",{staticClass:"rules"},[r("li",[t._v("1、点击任意客户边上的“去聊天”打开客户聊天会话窗口。")]),r("li",[t._v("2、通过聊天侧边栏打开“sop”侧边栏页面。")]),r("li",[t._v("3、点击发送“去发送”,快递将素材分享到当前会话,按下Enter键即可完成任务。")])]),[t.chatList&&t.chatList.length>0?r("div",{staticClass:"customer-list"},t._l(t.chatList,(function(e,n){return r("div",{key:n,staticClass:"customer-box"},[r("img",{staticClass:"avatar",attrs:{src:e.avatar,alt:""}}),r("div",{staticStyle:{"margin-left":"0.5rem"}},[r("div",{staticClass:"customer-info"},[r("div",{staticClass:"nickname overflow"},[t._v(t._s(4==t.taskType?e.group_name:e.name))]),r("div",{staticClass:"source"},[t._v("@微信")])]),r("div",{staticClass:"chat-btn",on:{click:function(r){return t.openEnterpriseChat(e)}}},[t._v("去聊天")])])])})),0):r("van-empty",{attrs:{description:4==t.taskType?"当前没有群聊":"当前没有客户"}})]],2)],1)},a=[],i=r("5530"),o=(r("4662"),r("28a2")),s=(r("d3b7"),r("159b"),r("caad"),r("d76c")),c=r("e944"),l={mixins:[s["a"]],data:function(){return{taskId:"",taskType:"",taskTypeName:"客户",taskTime:"",taskName:"",taskContent:"",chatList:[]}},created:function(){this.taskId=this.fun.getKey("taskId"),this.appjsApiList=["selectExternalContact","openEnterpriseChat"],this.agentConfigUrl="plugin.sop-task.frontend.controller.member.login.getConfig"},activated:function(){this.getPageData()},methods:{getPageData:function(){var t=this;$http.get("plugin.sop-task.frontend.controller.member.member.getTaskInfo",{task_id:this.taskId},"loading").then((function(e){var r;if(1!==e.result)return t.$toast(e.msg);var n,a=e.data;if(t.taskType=a.task_type,4===t.taskType)t.taskTypeName="群聊",t.chatList=null!==(n=a.group_chat_list)&&void 0!==n?n:[],t.chatList.forEach((function(t){t.avatar=a.group_chat_avatar}));else if([1,2,3].includes(t.taskType)){var i;t.taskTypeName="客户",t.chatList=null!==(i=a.customer_list)&&void 0!==i?i:[]}t.taskTime=a.date,t.taskType=a.task_type,t.taskName=a.task_name,t.taskContent=null!==(r=a.content_list)&&void 0!==r?r:[]}))},previewImg:function(t){Object(o["a"])([t])},openEnterpriseChat:function(t){if(!this.isSignWorkApp)return this.$dialog.confirm({title:"提示",message:"企业应用未授权!"});var e={};4===this.taskType?e.chatId=t.chat_id:[1,2,3].includes(this.taskType)&&(e.externalUserIds=t.external_userid),wx.openEnterpriseChat(Object(i["a"])(Object(i["a"])({},e),{},{success:function(t){wx.closeWindow()},fail:function(t){t.errMsg.indexOf("function not exist")>-1&&alert("版本过低请升级")}}))}},components:{scopePanel:c["a"]}},u=l,d=(r("9613"),r("2877")),p=Object(d["a"])(u,n,a,!1,null,"5c555dcd",null);e["default"]=p.exports},"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));r("d3b7");function n(t,e,r,n,a,i,o){try{var s=t[i](o),c=s.value}catch(l){return void r(l)}s.done?e(c):Promise.resolve(c).then(n,a)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(a,i){var o=t.apply(e,r);function s(t){n(o,a,i,s,c,"next",t)}function c(t){n(o,a,i,s,c,"throw",t)}s(void 0)}))}}},"1e09d":function(t,e,r){var n=r("24fb");e=n(!1),e.push([t.i,".push-task-page[data-v-5c555dcd]{text-align:left;padding:.63rem;background-color:#f6f6f6}.push-task-page .task-message[data-v-5c555dcd]{font-size:12px;color:#727272;margin-top:.63rem}.push-task-page .task-name[data-v-5c555dcd]{font-size:14px;color:#666;margin:.59rem 0}.push-task-page .task-content .task-box[data-v-5c555dcd]{margin-top:.63rem;padding:.63rem;background-color:#f9f9f9;border-radius:.31rem;word-break:break-all}.push-task-page .task-content .image[data-v-5c555dcd]{height:4.28rem;border-radius:.31rem}.push-task-page .task-content .task-video[data-v-5c555dcd]{height:10rem;border-radius:.31rem}.push-task-page .task-content .link-box .link-url[data-v-5c555dcd]{color:#727272}.push-task-page .task-content .link-box div[data-v-5c555dcd],.push-task-page .task-content .link-box p[data-v-5c555dcd]{margin:.3rem 0}.push-task-page .task-content .link-title[data-v-5c555dcd]{font-size:.85rem;font-weight:600}.push-task-page .task-content .file-name[data-v-5c555dcd]{max-width:6rem;padding:.5rem;font-size:.85rem;text-align:center;border-radius:.3rem;background-color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.push-task-page .rules li[data-v-5c555dcd]{font-size:12px;color:#727272;margin:.55rem 0}.push-task-page .customer-list[data-v-5c555dcd]{margin-bottom:1rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:left;white-space:nowrap}.push-task-page .customer-list .customer-box[data-v-5c555dcd]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;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}.push-task-page .customer-list .customer-box .avatar[data-v-5c555dcd]{width:2.38rem;height:2.38rem;margin:0;border-radius:.13rem}.push-task-page .customer-list .customer-box .customer-info[data-v-5c555dcd]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.push-task-page .customer-list .customer-box .nickname[data-v-5c555dcd]{max-width:4rem}.push-task-page .customer-list .customer-box .source[data-v-5c555dcd]{margin-left:.3rem;color:#2db755}.push-task-page .customer-list .customer-box .chat-btn[data-v-5c555dcd]{display:inline-block;margin-top:.3rem;padding:.1rem .5rem;color:#f05152;text-align:center;border-radius:1rem;font-size:12px;border:1px solid #f05152;cursor:pointer}.push-task-page .flex-aj-c[data-v-5c555dcd]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}",""]),t.exports=e},2923:function(t,e,r){var n=r("1e09d");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=r("499e").default;a("1143bfd5",n,!0,{sourceMap:!1,shadowMode:!1})},"2b64":function(t,e,r){var n=r("ec8b");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=r("499e").default;a("7eee1d86",n,!0,{sourceMap:!1,shadowMode:!1})},9613:function(t,e,r){"use strict";r("2923")},b389:function(t,e,r){"use strict";r("2b64")},c7eb:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("d9e2"),r("3410"),r("159b"),r("b0c0"),r("131a"),r("fb6a");var n=r("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,r=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(S){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof f?e:f,i=Object.create(a.prototype),o=new L(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return j()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var s=w(o,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,o),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=u;var p={};function f(){}function h(){}function g(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,k=v&&v(v(E([])));k&&k!==e&&r.call(k,o)&&(m=k);var b=g.prototype=f.prototype=Object.create(m);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(n["a"])(p)&&r.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,r){function n(){return new e((function(e,n){a(t,r,e,n)}))}return i=i?i.then(n,n):n()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){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 n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var a=n.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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function E(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 n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:j}}function j(){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,r,n,a,i){void 0===i&&(i=Promise);var o=new x(u(e,r,n,a),i);return t.isGeneratorFunction(r)?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 r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,L.prototype={constructor:L,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(C),!t)for(var e in this)"t"===e.charAt(0)&&r.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 n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}},d76c:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r("c7eb"),a=r("1da1"),i=(r("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(n["a"])().mark((function e(){var r,a,i,o,s;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=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){r.$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 r=this;wx.agentConfig({debug:!1,corpid:t.appId,agentid:this.agentData.agentid,timestamp:t.timestamp,nonceStr:t.nonceStr,signature:e,jsApiList:r.appjsApiList,success:function(){r.isSignWorkApp=!0,r.appSignSuccess&&r.appSignSuccess()},fail:function(t){r.appSignError&&r.appSignError(),t.errMsg.indexOf("function not exist")>-1?r.$toast("版本过低请升级"):r.$toast("企业应用授权失败,请联系管理员重新配置!")}})}}})},e944:function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"scope-panel"},[t._t("header-box"),""!==t.title?r("div",{staticClass:"panel-title"},[r("div",{staticClass:"mini-col"}),r("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=(r("b389"),r("2877")),c=Object(s["a"])(o,n,a,!1,null,"78d65230",null);e["a"]=c.exports},ec8b:function(t,e,r){var n=r("24fb");e=n(!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}}]); |