1 line
37 KiB
JavaScript
1 line
37 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bc25b800","chunk-2d0d83d6"],{"029f":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,".content-main[data-v-4722827c]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:.625rem 0}.content-main .content-item[data-v-4722827c]{padding:.5rem;background:#fff;margin-bottom:.63rem;border-radius:.47rem;width:100%}.content-main .content-item .content-item-left[data-v-4722827c]{width:4.06rem;height:4.06rem;margin:0;border-radius:5px;margin-right:.47rem}.content-main .content-item .content-item-right[data-v-4722827c]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;height:4.06rem;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.content-main .content-item .content-item-right .f-14[data-v-4722827c]{width:100%;font-size:.81rem;line-height:.75rem;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.content-main .content-item .content-item-right .content-item-right_price[data-v-4722827c]{font-size:.63rem;font-weight:400;color:#f14e4e;line-height:.75rem}.content-main .content-item .content-item-right .flex-j-sb[data-v-4722827c]{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end}.content-main .content-item .content-item-right .flex-j-sb .stock[data-v-4722827c]{color:#999;font-size:.63rem}.content-main .content-item .content-item-right .flex-j-sb .videoUser[data-v-4722827c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.content-main .content-item .content-item-right .flex-j-sb .videoUser .videoUserImg[data-v-4722827c],.content-main .content-item .content-item-right .flex-j-sb .videoUser .videoUserImg img[data-v-4722827c]{width:1rem;height:1rem;border-radius:100%}.content-main .content-item .content-item-right .flex-j-sb .btn[data-v-4722827c]{padding:.34rem .63rem;background:#f78b00;border-radius:.13rem}.content-main .content-item .content-item-right .flex-j-sb .btn .send_btn[data-v-4722827c]{color:#fff;font-size:.63rem;cursor:pointer}.content-item_message_base[data-v-4722827c]{padding:.5rem;background:#fff;margin-bottom:.63rem;border-radius:.47rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;text-align:left}.content-item_message_base .item_message_base_title[data-v-4722827c]{font-size:.81rem;color:#202020}.content-item_message_base .item_message_base_author[data-v-4722827c]{font-size:.69rem;font-weight:400;color:#5ab79c;padding:.5rem 0}.content-item_message_base .item_message_base_author .ad[data-v-4722827c]{color:#333}.content-item_message_base .item_message_base_time[data-v-4722827c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.content-item_message_base .item_message_base_time .time[data-v-4722827c]{font-size:.63rem;color:#999}.content-item_message_base .btn[data-v-4722827c]{padding:.34rem .63rem;background:#f78b00;border-radius:.13rem}.content-item_message_base .btn .send_btn[data-v-4722827c]{color:#fff;font-size:.63rem}.content-item_communities[data-v-4722827c]{padding:.5rem;background:#fff;margin-bottom:.63rem;border-radius:.47rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.content-item_communities .communities[data-v-4722827c]{width:100%;margin-top:.91rem}.content-item_communities .communities .communitiestitle[data-v-4722827c]{text-align:left;font-size:.75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333}.content-item_communities .communities .communitiesImg[data-v-4722827c]{width:2.66rem;height:2.66rem;border-radius:.13rem;margin-top:.59rem}.content-item_communities .communities .communitiesImg img[data-v-4722827c]{width:100%;height:100%;border-radius:.13rem}.content-item_communities .content-item_communities_user[data-v-4722827c]{width:100%}.content-item_communities .content-item_communities_user[data-v-4722827c],.content-item_communities .content-item_communities_user .content-item_left_communities[data-v-4722827c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.content-item_communities .content-item_communities_user .content-item_left_communities .item_left_communities_top[data-v-4722827c]{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}.content-item_communities .content-item_communities_user .content-item_left_communities .item_left_communities_img[data-v-4722827c]{width:1.41rem;height:1.41rem;margin-right:.28rem;border-radius:100%}.content-item_communities .content-item_communities_user .content-item_left_communities .item_left_communities_img img[data-v-4722827c]{width:100%;height:100%;border-radius:100%}.content-item_communities .content-item_communities_user .content-item_right_communities .btn[data-v-4722827c]{padding:.34rem .63rem;background:#f78b00;border-radius:.13rem}.content-item_communities .content-item_communities_user .content-item_right_communities .btn .send_btn[data-v-4722827c]{color:#fff;font-size:.63rem}",""]),t.exports=e},"79db":function(t,e,i){t.exports=i.p+"static/app/img/empty-image-search.ef236a93.png"},93407:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"speech-lib-wrap"},[i("van-tabs",{ref:"tabsPlu",on:{click:t.clickTabs},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},t._l(t.pluginTab,(function(t){return i("van-tab",{key:t.value,attrs:{title:t.name,name:t.value}})})),1),i("van-divider",{staticStyle:{margin:"0"},attrs:{hairline:""}}),i("div",{staticClass:"search-box"},[i("van-search",{attrs:{shape:"round",background:"#ffffff",placeholder:"请输入搜索关键词","show-action":""},on:{search:t.searchMaterial},scopedSlots:t._u([{key:"action",fn:function(){return[i("div",{staticClass:"search-btn",on:{click:t.searchMaterial}},[t._v("搜索")])]},proxy:!0}]),model:{value:t.wordKey,callback:function(e){t.wordKey=e},expression:"wordKey"}},[i("template",{slot:"left-icon"},[t.searchShow?i("van-icon",{attrs:{name:"arrow-left"},on:{click:t.closeSearchShow}}):t._e()],1)],2)],1),i("div",{staticClass:"contain"},[t.groupData.length>0&&!t.searchShow?i("div",{staticClass:"left-sidebar-box"},t._l(t.groupData,(function(e,a){return i("div",{key:a,class:["side-item",{active:t.groupId==e.id}],on:{click:function(i){return t.changeGroup(e.id)}}},[t._v(t._s(e.group_name||e.name))])})),0):t._e(),i("div",{staticClass:"right-content"},["speechcraft-library"==t.activeName&&0!==t.groupId&&t.child_group&&0!==t.child_group.length?i("div",{staticClass:"child-category"},[i("van-tabs",{attrs:{"title-active-color":"#fff",background:"#f6f6f6",ellipsis:!1},model:{value:t.child_active,callback:function(e){t.child_active=e},expression:"child_active"}},t._l(t.child_group,(function(e,a){return i("van-tab",{key:a,scopedSlots:t._u([{key:"title",fn:function(){return[i("div",{class:a==t.child_active?"child-category-item-c":"child-category-item",on:{click:function(i){return t.change_child(e)}}},[t._v(" "+t._s(e.group_name))])]},proxy:!0}],null,!0)})})),1)],1):t._e(),"goods"!=t.activeName&&"communities"!=t.activeName||t.searchShow?t._e():i("div",{staticClass:"childSidebar_box",class:t.showMoreClass?"childSidebar_box-postion":"childSidebar_box-sticky"},[i("div",{staticClass:"childSidebar",class:t.showMoreClass?"childSidebarWarp":"childSidebarScroll"},t._l(t.groupTwoData,(function(e,a){return i("div",{key:a,staticClass:"childSidebar_nav",class:{defultVal:e.id==t.groupTwoId,childSidebar_nav_Warp:t.showMoreClass},on:{click:function(i){return t.changeTwoGroup(e.id)}}},[t._v(t._s(e.name))])})),0),t.groupThrData.length>0&&t.showMoreClass&&"goods"==t.activeName?i("div",{staticClass:"childSideBar-thr"},[i("div",{staticClass:"twoSpan"},[t._v(t._s(t.TwoName()))]),i("div",{staticClass:"childSidebar_nav-thr"},t._l(t.groupThrData,(function(e,a){return i("div",{key:a,staticClass:"navthr",class:{"defultVal-thr":e.id==t.groupThrId},on:{click:function(i){return t.changeThrGroup(e.id)}}},[t._v(t._s(e.name))])})),0)]):t._e(),!t.showMoreClass&&(t.groupTwoData.length>2||t.groupThrData.length>0)?i("van-icon",{attrs:{name:"arrow-down"},on:{click:function(e){t.showMoreClass=!0}}}):t._e(),i("div",{staticStyle:{height:"2rem"}}),t.showMoreClass?i("div",{staticClass:"closeThr",on:{click:function(e){t.showMoreClass=!1}}},[t._v("点击收起"),i("van-icon",{attrs:{name:"arrow-up"}})],1):t._e()],1),t.materialList.length>0&&"speechcraft-library"==t.activeName?i("div",{staticClass:"material-box"},t._l(t.materialList,(function(e){return i("div",{key:e.id,staticClass:"material-item"},[i("div",{staticClass:"top"},[i("div",{staticClass:"material-name"},[i("span",[t._v(t._s(e.material_name))]),i("span",[t._v("("+t._s(e.content_list.length)+")")])]),t.fun.isPc()?i("div",{staticClass:"btn sendAll-btn",on:{click:function(i){return t.batchSendMessage(e.id)}}},[t._v("一键发送")]):t._e()]),t._l(e.content_list,(function(a,n){return i("div",{key:n,staticClass:"message-list"},[a.content?i("div",{staticClass:"message-item"},[i("div",{staticClass:"message-content"},["text"==a.content.type?i("div",{staticClass:"message-text",domProps:{innerHTML:t._s(a.content.news)}}):t._e(),"image"==a.content.type?i("div",{staticClass:"img-box",on:{click:function(e){return t.imagePreview(a.content.link_img)}}},[i("img",{attrs:{src:a.content.link_img,alt:""}})]):t._e(),"link"==a.content.type?i("div",{staticClass:"h5-box"},[i("img",{staticClass:"h5-img",attrs:{src:a.content.link_img,alt:""}}),i("div",{staticClass:"h5-text"},[i("p",{staticClass:"h5-title"},[t._v(t._s(a.content.title))]),i("span",{staticClass:"desc"},[t._v(t._s(a.content.describe))])])]):t._e(),"applet"==a.content.type?i("div",{staticClass:"min-pro-box"},[i("div",{staticClass:"min-title"},[t._v(t._s(a.content.title))]),i("img",{staticClass:"min-img",attrs:{src:a.content.link_img,alt:""}}),t._m(0,!0)]):t._e(),"video"==a.content.type?i("div",{staticClass:"video-box"},[i("video",{attrs:{controls:""}},[i("source",{attrs:{src:a.content.link_video}}),t._v(" 您的浏览器不支持 video 标签。 ")])]):t._e(),"file"==a.content.type?i("div",{staticClass:"file-box"},[i("van-icon",{attrs:{name:"description"}}),i("span",[t._v(t._s(a.condition))])],1):t._e()]),1==t.agentConfigLoading?i("div",{staticClass:"btn send-btn",on:{click:function(i){return t.sendMessage(e.id,n,a.id)}}},[t._v("发送")]):0==t.agentConfigLoading?i("div",{staticClass:"btn send-btn"},[t._v("加载中")]):t._e()]):t._e()])}))],2)})),0):t._e(),"speechcraft-library"!=t.activeName?i("otherList",{ref:"otherList",attrs:{isSignWorkApp:t.isSignWorkApp,loading:t.loading,finished:t.finished,contextList:t.contextList,activeName:t.activeName},on:{sendMsgChild:t.sendChatMessageChildList,onLoad:t.onLoad}}):t._e(),"speechcraft-library"==t.activeName?i("yz-blank",{attrs:{datas:t.materialList,text:"空空如也"}}):i("yz-blank",{attrs:{datas:t.contextList,text:"空空如也"}})],1)])],1)},n=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"min-icon"},[i("i",{staticClass:"iconfont icon-all_smallprogram"}),t._v(" 小程序 ")])}],s=(i("4662"),i("28a2")),o=(i("e7e5"),i("d399")),r=(i("99af"),i("b0c0"),i("3c65"),i("14d9"),i("a9e3"),i("4de4"),i("d3b7"),i("c740"),i("159b"),i("9911"),i("eb17")),c=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.contextList.length>0?i("div",{staticClass:"content-main flex"},[i("van-list",{attrs:{finished:t.finished,"finished-text":"","loading-text":""},on:{load:t.onLoad},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},["goods"==t.activeName||"article"==t.activeName||"video"==t.activeName?t._l(t.contextList,(function(e){return i("div",{key:e.id,staticClass:"content-item flex-a-c"},["video"==t.activeName?i("img",{staticClass:"content-item-left",attrs:{src:e.cover,alt:""}}):i("img",{staticClass:"content-item-left",attrs:{src:e.thumb,alt:""}}),i("div",{staticClass:"content-item-right"},[i("div",{staticClass:"f-14"},[t._v(t._s(e.title))]),"goods"==t.activeName?i("div",{staticClass:"content-item-right_price"},[t._v("¥"+t._s(e.price))]):t._e(),i("div",{staticClass:"flex-j-sb"},["goods"==t.activeName?i("div",{staticClass:"stock"},[t._v("库存"+t._s(e.stock))]):t._e(),"article"==t.activeName?i("div",{staticClass:"stock"},[t._v(t._s(e.author))]):t._e(),"video"==t.activeName?i("div",{staticClass:"videoUser"},[e.head?i("div",{staticClass:"videoUserImg"},[i("img",{attrs:{src:e.head,alt:""}})]):t._e(),i("div",{staticClass:"name"},[t._v(t._s(e.author))])]):t._e(),i("div",{staticClass:"btn"},[i("div",{staticClass:"send_btn",on:{click:function(i){return t.sendMessage(e)}}},[t._v("发送")])])])])])})):t._e(),"communities"==t.activeName?t._l(t.contextList,(function(e){return i("div",{key:e.id,staticClass:"content-item_communities flex-a-c"},[i("div",{staticClass:"content-item_communities_user"},[i("div",{staticClass:"content-item_left_communities"},[i("div",{staticClass:"item_left_communities_top"},[i("div",{staticClass:"item_left_communities_img"},[i("img",{attrs:{src:e.head,alt:""}})]),i("div",{staticClass:"item_left_communities_name"},[t._v(t._s(e.uname))])])]),i("div",{staticClass:"content-item_right_communities"},[i("div",{staticClass:"btn"},[i("div",{staticClass:"send_btn",on:{click:function(i){return t.sendMessage(e)}}},[t._v("发送")])])])]),i("div",{staticClass:"communities"},[i("div",{staticClass:"communitiestitle"},[t._v(t._s(e.title))]),i("div",{staticClass:"communitiesImg"},[i("img",{attrs:{src:e.thumb,alt:""}})])])])})):t._e(),"message_base"==t.activeName?t._l(t.contextList,(function(e){return i("div",{key:e.id,staticClass:"content-item_message_base"},[i("div",{staticClass:"item_message_base_title"},[t._v(t._s(e.article_name))]),i("div",{staticClass:"item_message_base_author"},[i("span",{staticClass:"ad"},[t._v(t._s(e.creater_name))]),t._v(" 发布于 "+t._s(e.base_name)+" ")]),i("div",{staticClass:"item_message_base_time"},[i("div",{staticClass:"time"},[t._v(t._s(e.created_at))]),i("div",{staticClass:"btn"},[i("div",{staticClass:"send_btn",on:{click:function(i){return t.sendMessage(e)}}},[t._v("发送")])])])])})):t._e()],2)],1):t._e()},l=[],d=i("d76c"),m={mixins:[d["a"]],props:{loading:{type:Boolean,default:!1},finished:{type:Boolean,default:!1},contextList:{type:null,default:[]},activeName:{type:String,default:""},isSignWorkApp:{type:null,default:""}},data:function(){return{cateId:""}},watch:{isSignWorkApp:function(t){}},methods:{sendMessage:function(t){this.getMediaId(t.id)},getMediaId:function(t){var e=this;return $http.get("plugin.speechcraft-library.frontend.controller.member.Material.getHeadContent",{option_id:t,type:this.activeName},"加载中").then((function(t){if(1!=t.result)return e.$toast(t.msg);e.$emit("sendMsgChild",t.data)}))},sendChatMessage_childList:function(t,e){var i=this.messageConfig(t);wx.invoke("sendChatMessage",i,(function(t){"sendChatMessage:ok"==t.err_msg?index===contentList.length-1&&(Loading.close(),o["a"].success("话术已生成,请点击聊天框发送按钮!")):(Loading.close(),o["a"].fail("话术发送失败"))}))},onLoad:function(){this.$emit("onLoad",this.cateId,this.finished)}}},g=m,p=(i("d8c6"),i("2877")),h=Object(p["a"])(g,c,l,!1,null,"4722827c",null),f=h.exports,u={mixins:[d["a"]],data:function(){return{child_group:[],child_active:0,wordKey:"",activeName:"speechcraft-library",pluginTab:[{name:"话术库",value:"speechcraft-library"}],groupData:[],groupId:0,userId:"",groupTwoId:"",groupTwoData:[],groupThrId:"",groupThrData:[],level:"",showMoreClass:!1,searchShow:!1,page:1,loading:!1,finished:!1,materialList:[],contextList:[]}},created:function(){var t=this;this.appjsApiList=["getCurExternalContact","sendChatMessage"],this.agentConfigUrl="plugin.speechcraft-library.frontend.controller.member.login.getConfig",this.appSignSuccess=function(){wx.invoke("getCurExternalContact",{},(function(e){"getCurExternalContact:ok"==e.err_msg&&(t.userId=e.userId)}))}},activated:function(){this.getGroupData(),this.getPluginSetting()},methods:{change_child:function(t){var e=this;this.page=1;var i={page:1,group_id:t.id,search:{material_name:this.wordKey}};$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getGroupMaterialList",i,"loading").then((function(t){if(1!==t.result)return e.$toast(t.msg);var i=t.data;e.materialList=i.data,(e.page>=i.last_page||i.data.length<i.per_page)&&(e.finished=!0),e.page++}))},closeSearchShow:function(){this.searchShow=!1,this.page=1,this.groupData=[],this.groupId=0,this.groupTwoId=0,this.groupThrId=0,this.groupTwoData=[],this.groupThrData=[],this.loading=!1,this.finished=!1,this.wordKey="",this.clickTabs()},onLoad:function(t){var e=this;this.finished||$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getContent",{cate_type:this.activeName,cate_id:t,keyword:this.wordKey,page:this.page},"loading").then((function(t){if(1!==t.result)return e.$toast(t.msg);e.contextList=e.contextList.concat(t.data.data),e.page>=t.data.last_page?e.finished=!0:e.page++}))},TwoName:function(){if(this.groupTwoData.length>0)for(var t=0;t<this.groupTwoData.length;t++)if(this.groupTwoData[t].id==this.groupTwoId)return this.groupTwoData[t].name},getGroupData:function(){var t=this;$http.get("plugin.speechcraft-library.frontend.controller.member.Material.getGroupList").then((function(e){if(1!==e.result)return t.$toast(e.msg);t.groupData=e.data,t.groupData.unshift({id:0,group_name:"全部分组"}),t.groupId=0,"speechcraft-library"==t.activeName&&t.getMaterialData()}))},getMaterialData:function(){var t=this;if(this.finished)return!1;var e={page:this.page,group_id:this.groupId,search:{material_name:this.wordKey}};$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getGroupMaterialList",e,"loading").then((function(e){if(1!==e.result)return t.$toast(e.msg);var i=e.data;t.materialList=t.page>1?t.materialList.concat(i.data):i.data,(t.page>=i.last_page||i.data.length<i.per_page)&&(t.finished=!0),t.page++}))},getPluginSetting:function(){var t=this;$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getSetting",{},"loading").then((function(e){if(1!==e.result)return t.$toast(e.msg);if(1==t.pluginTab.length){var i=e.data,a=i.goods,n=i.article,s=i.communities,o=i.video,r=i.message_base;a&&t.pluginTab.push({name:"商品",value:"goods"}),n&&t.pluginTab.push({name:"文章",value:"article"}),s&&t.pluginTab.push({name:"微社区",value:"communities"}),o&&t.pluginTab.push({name:"短视频",value:"video"}),r&&t.pluginTab.push({name:"知识库",value:"message_base"}),t.$nextTick((function(){t.$refs.tabsPlu.resize()}))}}))},clickTabs:function(){var t=this;if("speechcraft-library"==this.activeName)return this.getGroupData();this.contextList=[],this.searchShow=!1,this.wordKey="",$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getCategory",{cate_type:this.activeName,parent_id:0,level:1,per_page:100},"loading").then((function(e){if(1!==e.result)return t.$toast(e.msg);t.groupData=e.data.data,t.groupId=e.data.data[0].id,t.level=e.data.level,t.page=1,Number(e.data.level)>1&&"goods"==t.activeName?t.getNextChildTwo():("communities"==t.activeName&&t.getNextChildTwo(),t.getPluContent(t.groupId))}))},getNextChildTwo:function(){var t=this;$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getCategory",{cate_type:this.activeName,parent_id:this.groupId,level:2,per_page:100},"loading").then((function(e){if(1!==e.result)return t.$toast(e.msg);t.groupTwoData=e.data.data;var i={id:t.groupId,level:2,name:"全部",parent_id:0};t.groupTwoData.unshift(i),t.groupTwoId=e.data.data[0].id,("communities"==t.activeName||Number(e.data.level)>1)&&("全部"==e.data.data[0].name?t.getPluContent(t.groupId):t.getPluContent(t.groupTwoId))}))},getNextChildThr:function(){var t=this;$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getCategory",{cate_type:this.activeName,parent_id:this.groupTwoId,level:3,per_page:100},"loading").then((function(e){if(1!==e.result)return t.$toast(e.msg);if(e.data.data.length>0){t.groupThrData=e.data.data;var i={id:t.groupTwoId,level:3,name:"全部",parent_id:0};t.groupThrData.unshift(i),t.groupThrId=e.data.data[0].id,t.getPluContent(t.groupThrId)}else t.getPluContent(t.groupTwoId)}))},getPluContent:function(t){var e=this;this.finished=!1,this.$refs.otherList.cateId=t||"0",this.loading=!0,this.showMoreClass=!1,$http.post("plugin.speechcraft-library.frontend.controller.member.Material.getContent",{cate_type:this.activeName,cate_id:t,keyword:this.wordKey,page:this.page},"loading").then((function(t){if(1!==t.result)return e.$toast(t.msg);e.contextList=t.data.data,e.loading=!1,e.page>=t.data.last_page?e.finished=!0:e.page++}))},changeTwoGroup:function(t){if(this.page=1,"goods"==this.activeName)return this.groupTwoId=0==t?this.groupId:t,Number(this.level>2)?(this.groupThrData=[],void this.getNextChildThr()):void this.getPluContent(this.groupTwoId);"communities"==this.activeName&&(this.groupTwoId=t,this.getNextChildThr())},changeThrGroup:function(t){this.page=1,this.groupThrId=t,this.getPluContent(this.groupThrId)},changeGroup:function(t){if("speechcraft-library"!=this.activeName){if(this.groupId==t)return!1;if(this.page=1,Number(this.level>1)&&"goods"==this.activeName)return this.groupId=t,this.contextList=[],this.groupTwoData=[],this.groupThrData=[],void this.getNextChildTwo();if("communities"==this.activeName)return this.groupId=t,this.contextList=[],this.groupTwoData=[],void this.getNextChildTwo();this.contextList=[],this.groupId=t,this.getPluContent(this.groupId)}if(this.groupId==t)return!1;this.groupId=t,this.page=1,this.finished=!1,this.child_group=[];var e=this.groupData.filter((function(e){return e.id==t}));if(e&&0!==e.length&&e[0].child&&0!==e[0].child.length){var i=e[0].child;-1==i.findIndex((function(t){return"全部"==t.group_name}))&&i.unshift({id:e[0].id,group_name:"全部"}),this.child_group=i,this.groupId=e[0].id}this.getMaterialData()},searchMaterial:function(){this.page=1,this.finished=!1,"speechcraft-library"==this.activeName?this.getMaterialData():(this.searchShow=!0,this.getPluContent())},getFileNameByPath:function(t){var e=t.lastIndexOf("/"),i=t.substr(e+1);return i},batchSendMessage:function(t){var e=this;if(!this.isSignWorkApp)return this.$dialog.confirm({title:"提示",message:"企业应用未授权成功!"});this.$dialog.confirm({title:"提示",message:"该操作将发送当前素材的全部话术,确认全部发送吗?"}).then((function(){e.getMediaId(t)}))},sendMessage:function(t,e,i){if(!this.isSignWorkApp)return this.$dialog.confirm({title:"提示",message:"企业应用未授权成功!"});this.getMediaId(t,e,i)},getMediaId:function(t,e,i){var a=this;return $http.get("plugin.speechcraft-library.frontend.controller.member.Material.getMaterialContent",{material_id:t,external_userid:this.userId},"加载中").then((function(t){if(1!=t.result)return a.$toast(t.msg);a.sendChatMessage(t.data,e,i)}))},sendChatMessageChildList:function(t){this.sendChatMessage_childList(t)},sendChatMessage_childList:function(t){var e=o["a"].loading(),i=this.messageConfig(t);wx.invoke("sendChatMessage",i,(function(t){"sendChatMessage:ok"==t.err_msg?o["a"].success("话术已生成,请点击聊天框发送按钮!"):o["a"].fail("话术发送失败"),e.close()}))},sendChatMessage:function(t,e,i){var a=this,n=o["a"].loading();if(void 0!==i&&""!==i&&"number"==typeof i){var s=null;t.forEach((function(e,a){e.id==i&&(s=t[a])}));var r=this.messageConfig(s);wx.invoke("sendChatMessage",r,(function(t){"sendChatMessage:ok"==t.err_msg?o["a"].success("话术已生成,请点击聊天框发送按钮!"):o["a"].fail("话术发送失败"),n.close()}))}else t.forEach((function(t,e){var i=a.messageConfig(t);wx.invoke("sendChatMessage",i,(function(t){"sendChatMessage:ok"==t.err_msg?e===contentList.length-1&&(n.close(),o["a"].success("话术已生成,请点击聊天框发送按钮!")):(n.close(),o["a"].fail("话术发送失败"))}))}))},messageConfig:function(t){var e={},i=t.content||t;return"text"==i.type?e={msgtype:"text",text:{content:i.news}}:"link"==i.type?e={msgtype:"news",news:{link:i.link||i.type,title:i.title?i.title:"",desc:i.describe,imgUrl:i.link_img}}:"applet"==i.type?e={msgtype:"miniprogram",miniprogram:{appid:i.appid,title:i.title,imgUrl:i.link_img,page:i.page}}:"image"==i.type?e={msgtype:"image",image:{mediaid:i.media_id}}:"video"==i.type?e={msgtype:"video",video:{mediaid:i.media_id}}:"file"==i.type&&(e={msgtype:"file",file:{mediaid:i.media_id}}),e},imagePreview:function(t){Object(s["a"])([t])}},components:{yzBlank:r["default"],otherList:f}},b=u,v=(i("d38e"),Object(p["a"])(b,a,n,!1,null,"65d93d8f",null));e["default"]=v.exports},9561:function(t,e,i){var a=i("f740");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("499e").default;n("2fa67920",a,!0,{sourceMap:!1,shadowMode:!1})},d38e:function(t,e,i){"use strict";i("9561")},d76c:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var a=i("c7eb"),n=i("1da1"),s=(i("e9c4"),{data:function(){return{agentConfigUrl:null,isSignWorkApp:!1,agentData:{agent_secret:"",agentid:"",corpid:""},get_token:{},appjsApiList:[],appSignCallback:null,appSignError:null,agentConfigLoading:0}},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(){("work"===this.fun.getKey("client")||window.localStorage.getItem("client"))&&this.getAgentConfig()},methods:{getAgentConfig:function(){var t=this;return Object(n["a"])(Object(a["a"])().mark((function e(){var i,n,s,o,r;return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t,n=t.agentConfigUrl||"plugin.wechat-chat-sidebar.frontend.controller.index.get-config",s="ios"===t.fun.isIosOrAndroid()?window.initUrl:document.location.href,e.prev=3,e.next=6,$http.post(n,{crop_id:t.corp_id,url:s},"loading");case 6:if(o=e.sent,1!=o.result){e.next=11;break}t.agentData=o.data,e.next=13;break;case 11:return t.agentConfigLoading=-1,e.abrupt("return",t.$toast(o.msg));case 13:t.agentConfigLoading=0,t.get_token=t.agentData.get_token,r={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(r),wx.ready((function(){setTimeout((function(){t.getAgentSign(r,t.get_token.app_token)}),500)})),wx.error((function(t){i.$toast(JSON.stringify(t))})),e.next=24;break;case 21:e.prev=21,e.t0=e["catch"](3),t.$toast(e.t0);case 24:case"end":return e.stop()}}),e,null,[[3,21]])})))()},getAgentSign:function(t,e){var i=this;wx.agentConfig({debug:!1,corpid:t.appId,agentid:this.agentData.agentid,timestamp:t.timestamp,nonceStr:t.nonceStr,signature:e,jsApiList:i.appjsApiList,success:function(){i.isSignWorkApp=!0,i.agentConfigLoading=1,i.appSignSuccess&&i.appSignSuccess()},fail:function(t){i.agentConfigLoading=-1,i.appSignError&&i.appSignError(),t.errMsg.indexOf("function not exist")>-1?i.$toast("版本过低请升级"):i.$toast("企业应用授权失败,请联系管理员重新配置!")}})}}})},d8c6:function(t,e,i){"use strict";i("ee92")},ee92:function(t,e,i){var a=i("029f");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("499e").default;n("4bb66bf4",a,!0,{sourceMap:!1,shadowMode:!1})},f740:function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'.child-category[data-v-65d93d8f] .van-tab{color:#000;text-align:center;border-radius:.625rem}.child-category[data-v-65d93d8f] .van-tabs__line{display:none}.speech-lib-wrap[data-v-65d93d8f]{background-color:#fff}.speech-lib-wrap .child-category[data-v-65d93d8f]{padding:.8rem 0}.speech-lib-wrap .child-category-item-c[data-v-65d93d8f]{background:#ef3532!important;color:#fff!important;padding:.3125rem .9375rem;border-radius:.625rem}.speech-lib-wrap .child-category-item[data-v-65d93d8f]{padding:.3125rem .9375rem;color:#000;background:#cac7c3;text-align:center;border-radius:.625rem}.speech-lib-wrap .search-box[data-v-65d93d8f] .van-search{padding:.84rem}.speech-lib-wrap .search-box .search-btn[data-v-65d93d8f]{color:#f15353;cursor:default}.speech-lib-wrap .btn[data-v-65d93d8f]{cursor:pointer}.speech-lib-wrap .send-btn[data-v-65d93d8f]{padding:.34rem .66rem;background-color:#f14e4e;border-radius:.13rem;font-size:.63rem;color:#fff}.speech-lib-wrap .contain[data-v-65d93d8f]{font-size:12px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:calc(100vh - 99px)}.speech-lib-wrap .contain .left-sidebar-box[data-v-65d93d8f]{width:5rem;height:100%;overflow-x:hidden;overflow-y:auto;text-align:center}.speech-lib-wrap .contain .left-sidebar-box .active[data-v-65d93d8f]{color:#f15353}.speech-lib-wrap .contain .left-sidebar-box .side-item[data-v-65d93d8f]{cursor:default;padding:1rem 0;word-break:break-all}.speech-lib-wrap .contain .right-content[data-v-65d93d8f]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;height:100%;padding:0 .5rem;background-color:#f6f6f6;overflow-y:auto;overflow-x:hidden;position:relative}.speech-lib-wrap .contain .right-content .childSidebar_box-sticky[data-v-65d93d8f]{position:-webkit-sticky;position:sticky;top:-1px;left:0;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.speech-lib-wrap .contain .right-content .childSidebar_box-postion[data-v-65d93d8f]{position:absolute;top:0;left:.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%}.speech-lib-wrap .contain .right-content .closeThr[data-v-65d93d8f]{color:#929292;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:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.speech-lib-wrap .contain .right-content .closeThr .van-icon[data-v-65d93d8f]{margin-left:0!important}.speech-lib-wrap .contain .right-content .childSidebar_box[data-v-65d93d8f]{padding-top:.81rem;padding-bottom:.84rem;-webkit-box-sizing:border-box;box-sizing:border-box;background:#f6f6f6}.speech-lib-wrap .contain .right-content .childSidebar_box .van-icon[data-v-65d93d8f]{margin-left:1.25rem}.speech-lib-wrap .contain .right-content .childSidebar_box .childSideBar-thr[data-v-65d93d8f]{padding-left:.5rem;margin-top:1rem}.speech-lib-wrap .contain .right-content .childSidebar_box .childSideBar-thr .twoSpan[data-v-65d93d8f]{text-align:left;font-size:.4375rem;font-weight:400;padding:0 .55rem;margin-bottom:.44rem}.speech-lib-wrap .contain .right-content .childSidebar_box .childSideBar-thr .childSidebar_nav-thr[data-v-65d93d8f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.speech-lib-wrap .contain .right-content .childSidebar_box .childSideBar-thr .childSidebar_nav-thr .navthr[data-v-65d93d8f]{padding:.44rem .55rem;font-size:.3438rem}.speech-lib-wrap .contain .right-content .childSidebar_box .childSideBar-thr .childSidebar_nav-thr .defultVal-thr[data-v-65d93d8f]{color:#df5a55;border:1px solid #df5a55}.speech-lib-wrap .contain .right-content .childSidebar_box .childSidebar[data-v-65d93d8f]::-webkit-scrollbar{display:none}.speech-lib-wrap .contain .right-content .childSidebar_box .childSidebarScroll[data-v-65d93d8f]{overflow-x:scroll}.speech-lib-wrap .contain .right-content .childSidebar_box .childSidebarWarp[data-v-65d93d8f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.speech-lib-wrap .contain .right-content .childSidebar_box .childSidebar[data-v-65d93d8f]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;padding-left:.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;scrollbar-width:none;-ms-overflow-style:none}.speech-lib-wrap .contain .right-content .childSidebar_box .defultVal[data-v-65d93d8f]{background:#f14e4e!important}.speech-lib-wrap .contain .right-content .childSidebar_box .childSidebar_nav_Warp[data-v-65d93d8f]{margin-bottom:.63rem}.speech-lib-wrap .contain .right-content .childSidebar_box .childSidebar_nav[data-v-65d93d8f]{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;padding:.5rem 1rem;font-weight:400;color:#fff;font-size:.69rem;background:#e5e5e5;border-radius:.84rem;margin-right:.63rem}.speech-lib-wrap .contain .right-content .material-box .material-item[data-v-65d93d8f]{margin:1rem 0}.speech-lib-wrap .contain .right-content .material-box .top[data-v-65d93d8f]{margin-bottom:.8rem;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}.speech-lib-wrap .contain .right-content .material-box .sendAll-btn[data-v-65d93d8f]{padding:.41rem .63rem;font-size:.63rem;color:#fff;background-color:#5ab79c;border-radius:.13rem}.speech-lib-wrap .contain .right-content .material-box .message-list[data-v-65d93d8f]{background-color:#fff;border-radius:.13rem;border-bottom:1px solid #efefef}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item[data-v-65d93d8f]{position:relative;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;padding:.63rem;color:#242424}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .message-content[data-v-65d93d8f]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;max-width:11rem;text-align:left}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .img-box[data-v-65d93d8f]{width:4.5rem;height:4.5rem;overflow:hidden;background-color:#ccc;border-radius:.13rem}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .img-box img[data-v-65d93d8f]{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .h5-box[data-v-65d93d8f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .h5-box .h5-img[data-v-65d93d8f]{width:2.81rem;height:2.81rem;background-color:#ccc;border-radius:.13rem;-o-object-fit:cover;object-fit:cover}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .h5-box .h5-text[data-v-65d93d8f]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-left:.5rem;font-size:.75rem;color:#242424}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .h5-box .desc[data-v-65d93d8f]{margin-top:.5rem;font-size:.69rem;color:#666}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .min-pro-box .min-img[data-v-65d93d8f]{margin-top:.3rem;width:4.97rem;height:4.97rem;background-color:#b8b8b8;border-radius:.13rem}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .min-pro-box .icon-all_smallprogram[data-v-65d93d8f]{color:#7879f0}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .video-box[data-v-65d93d8f]{width:10.97rem;height:6.97rem;background-color:#b8b8b8;border-radius:.13rem}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .video-box video[data-v-65d93d8f]{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item .file-box[data-v-65d93d8f]{color:#606266;word-break:break-all}.speech-lib-wrap .contain .right-content .material-box .message-list .message-item[data-v-65d93d8f]:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:1px;-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#f6f6f6}',""]),t.exports=e}}]); |