1 |
- webpackJsonp([21],{Jwa7:function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var i=e("mvHQ"),a=e.n(i),n={components:{makeContent:e("dw1s").a},data:function(){return{index:0,editTagList:[],limit:"0",auto_tag:[],tags:[],editIng:!1,addInput:"",showTag:!1,auto_response:!0,tagName:"",eidtList:[],delay:"",tag:"",tagList:"",id:"",name:"",editItem:{},loadingNews:!1,send_identity:"",send_identityList:[{value:1,label:"公众号"}],filter:0,filterList:[{value:1,label:"按标签过滤"},{value:0,label:"不过滤"}],type:"subscribe",typeList:[{value:"subscribe",label:"关注"},{value:"text",label:"消息(含关键词)"},{value:"menu",label:"菜单点击"},{value:"qrcode",label:"参数二维码"}]}},created:function(){this.id=this.$route.query.id,this.id?this.init():this.getTag()},methods:{addIng:function(){var t=this;this.editTagList.push({name:this.addInput}),this.editIng=!1,this.loadingEdit=!0,this.$axios.post(this.URL.BASEURL+this.URL.createTag,{name:this.addInput}).then(function(s){t.loadingEdit=!1,(s=s.data)&&0==s.errno?(t.$message({message:"创建成功",type:"success"}),t.addInput="",t.getTag()):t.$message({message:s.err,type:"warning"})}).catch(function(s){t.loadingEdit=!1})},addTag:function(){var t=this;this.tagList.forEach(function(s){t.tags==s.id&&(t.tagName=s.name)}),this.showTag=!1},deleteFun:function(t){var s=this.eidtList[t];s.isAdd?this.eidtList.splice(t,1):(s.operate="del",this.$set(this.eidtList,t,s))},editFun:function(t){this.index=t;var s=this.eidtList[t];s.operate="del",this.editItem=s},replaceFun:function(t,s){if(s>0)var e=t,i=t-s;else e=t-s,i=t;return i<0||e==this.eidtList.length?(this.$message({message:-1==s?"已经是最后一位了":"已经是第一位了",type:"error"}),!1):(this.eidtList[e]=this.eidtList.splice(i,1,this.eidtList[e])[0],this.eidtList)},compare:function(t){return function(s,e){return s[t]-e[t]}},init:function(){var t=this;this.loadingNews=!0,this.$axios.post(this.URL.BASEURL+this.URL.qrCodeDetail,{qid:Number(this.id)}).then(function(s){if(t.loadingNews=!1,(s=s.data)&&0==s.errno){var e=s.rst.data;t.name=e.name,t.type=e.type,t.filter=e.filter,t.send_identity=e.send_identity,e.auto_tag&&(t.tags=[].concat(Number(e.auto_tag))),t.tag=e.auto_tag,t.auto_response=1==e.auto_response,t.limit=e.rule.limit.toString(),t.eidtList=e.rule&&e.rule.msg?e.rule.msg:[],t.delay=e.delay,t.eidtList.length>0&&t.eidtList.sort(t.compare("sort")),t.getTag()}else t.$message({message:s.err,type:"warning"})}).catch(function(s){console.log(s),t.loadingNews=!1})},cancel:function(){this.$router.push("/delayNews")},getTag:function(){var t=this;this.loadingNews=!0,this.$axios.get(this.URL.BASEURL+this.URL.tagList).then(function(s){t.loadingNews=!1,(s=s.data)&&0==s.errno?(t.tagList=s.rst.data.tags,t.tagList.forEach(function(s){s.id==t.tag&&(t.tagName=s.name)})):t.$message({message:s.err,type:"warning"})}).catch(function(s){t.loadingNews=!1})},toBack:function(){this.$router.push("/qrcode")},addReply:function(t){var s=this.eidtList[this.index];if(t.isAdd=!0,this.eidtList.length>0&&this.eidtList[this.index].hasOwnProperty("operate")&&"del"==this.eidtList[this.index].operate){this.eidtList[this.index]=t,this.eidtList[this.index].id=s.id;s=this.eidtList[this.index];this.eidtList.splice(this.index,1),this.eidtList.push(s)}else this.eidtList=this.eidtList.concat(t);this.editItem={response_type:"image",message:""}},edit:function(){var t=this,s=JSON.parse(a()(this.eidtList));s.forEach(function(t,s){delete t.isAdd,t.sort=s,t.message=JSON.parse(t.message)}),this.loadingNews=!0,this.$axios.post(this.URL.BASEURL+this.URL.qrCodeCreat,{id:this.id,auto_response:this.auto_response?1:2,name:this.name,limit:Number(this.limit),auto_tag:this.tags.join(","),msg_info:a()(s)}).then(function(s){t.loadingNews=!1,(s=s.data)&&0==s.errno?(t.$message({message:"添加成功",type:"success"}),setTimeout(function(){t.$router.push("/qrcode")},500)):t.$message({message:s.err,type:"warning"})}).catch(function(s){t.loadingNews=!1})}},watch:{tags:function(){var t=this;if(this.tags.length>1){var s=this.tags[this.tags.length-1];this.tags=[],this.tags.push(s),this.tagList.forEach(function(s){s.id==t.tags&&(t.tagName=s.name)})}}}},l={render:function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loadingNews,expression:"loadingNews"}],staticClass:"addNews",attrs:{"element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading"}},[i("div",{staticClass:"mainCon"},[i("div",{staticClass:"topMain"},[i("div",{staticClass:"back",on:{click:t.toBack}},[i("img",{attrs:{src:e("i2Ii"),alt:""}}),t._v("\n 返回上一级")]),t._v(" "),i("wxItem")],1),t._v(" "),i("div",{staticClass:"editBox mainBorder toast"},[i("h4",[t._v("二维码信息")]),t._v(" "),i("div",{staticClass:"inputItem"},[i("label",{attrs:{for:""}},[t._v("二维码名称:")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],attrs:{maxlength:"20",type:"text",autocomplete:"off",placeholder:"填写二维码名称,不要超过20字"},domProps:{value:t.name},on:{input:function(s){s.target.composing||(t.name=s.target.value)}}})]),t._v(" "),i("div",{staticClass:"inputItem"},[i("label",{attrs:{for:""}},[t._v("自动打标签:")]),t._v(" "),t.tagName?i("div",{staticClass:"tagBox"},[i("span",[t._v(t._s(t.tagName))])]):t._e(),t._v(" "),t.tagName?t._e():i("span",{staticClass:"desc"},[t._v("还未设置标签")]),t._v(" "),i("span",{staticClass:"btn",staticStyle:{color:"#2d8cf0"},on:{click:function(s){t.showTag=!0}}},[t._v("添加")])]),t._v(" "),i("h4",[t._v("扫码后自动回复\n "),i("div",{class:["alert",t.auto_response?"":"error"]},[i("span",[t._v("您已开启扫码回复设置,可点击右侧开关,操作关闭")]),t._v(" "),i("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:t.auto_response,callback:function(s){t.auto_response=s},expression:"auto_response"}})],1)]),t._v(" "),t.auto_response?i("div",{staticClass:"inputItem"},[i("div",{staticClass:"boxItem"},[i("label",[t._v("回复内容:")]),t._v(" "),i("div",{staticClass:"rightInfo"},[t._l(t.eidtList,function(s,a){return s.operate||"del"==s.operate?t._e():i("div",{staticClass:"item"},["text"==s.response_type?i("div",{staticClass:"text"},[t._v(t._s(JSON.parse(s.message).content))]):t._e(),t._v(" "),"image"==s.response_type||"voice"==s.response_type||"video"==s.response_type?i("div",{staticClass:"pictBox"},["image"==s.response_type?i("img",{staticClass:"postUrl",attrs:{src:JSON.parse(s.message).url,alt:""}}):t._e(),t._v(" "),"voice"==s.response_type?i("img",{staticClass:"postUrl",attrs:{src:e("u6Hf"),alt:""}}):t._e(),t._v(" "),"video"==s.response_type?i("img",{staticClass:"postUrl",attrs:{src:e("+vEQ"),alt:""}}):t._e(),t._v(" "),i("div",{staticClass:"btmInfo"},[i("div",{staticClass:"name",staticStyle:{"text-align":"center",width:"100%"}},[t._v(t._s(JSON.parse(s.message).title?JSON.parse(s.message).title:"-"))])])]):t._e(),t._v(" "),"mpnews"==s.response_type||"news"==s.response_type?i("div",{staticClass:"mainBox"},[i("div",{staticClass:"wxList",staticStyle:{padding:"0px 30px 10px"}},[i("div",{staticClass:"wxItem moreBox",staticStyle:{position:"relative"}},[JSON.parse(s.message).length>0?i("div",[i("div",{staticClass:"infoImg",staticStyle:{position:"relative"}},[i("div",{staticClass:"topTitle"},[t._v("\n "+t._s(JSON.parse(s.message)[0].title)+"\n ")]),t._v(" "),i("div",{staticStyle:{height:"150px",position:"relative"}},[i("img",{staticClass:"postUrl",attrs:{src:JSON.parse(s.message)[0].picurl,alt:""}})]),t._v(" "),i("div",{staticClass:"bottomTitle"},[t._v("\n "+t._s(JSON.parse(s.message)[0].digest)+"\n ")])]),t._v(" "),t._l(JSON.parse(s.message),function(e,a){return JSON.parse(s.message).length>1&&a>0?i("div",{staticClass:"other"},[i("div",{staticClass:"infoImg"},[i("div",{staticClass:"otherTitle",staticStyle:{width:"calc(100% - 60px)"}},[t._v("\n "+t._s(e.title)+"\n ")]),t._v(" "),i("div",{staticStyle:{"text-align":"right"}},[i("img",{staticClass:"iconSmall",attrs:{src:e.picurl,alt:""}})])])]):t._e()})],2):t._e()]),t._v(" "),JSON.parse(s.message).length>1?i("span",{staticClass:"more"},[t._v("多图文区域")]):t._e()])]):t._e(),t._v(" "),i("ul",{staticClass:"doList"},[i("li",{on:{click:function(s){return t.replaceFun(a,1)}}},[i("img",{staticClass:"icon1",attrs:{src:e("rOIf"),alt:""}})]),t._v(" "),i("li",{on:{click:function(s){return t.replaceFun(a,-1)}}},[i("img",{staticClass:"icon1",attrs:{src:e("XCu6"),alt:""}})]),t._v(" "),i("li",{on:{click:function(s){return t.editFun(a,1)}}},[i("img",{staticClass:"icon1",attrs:{src:e("KzIr"),alt:""}})]),t._v(" "),i("li",{on:{click:function(s){return t.deleteFun(a)}}},[i("img",{staticClass:"icon1",attrs:{src:e("vmxF"),alt:""}})])])])}),t._v(" "),i("div",{staticClass:"item",staticStyle:{border:"none","text-align":"center"}},[i("make-content",{attrs:{item:t.editItem},on:{addReply:t.addReply}})],1)],2)])]):i("div",{staticClass:"nullText"},[t._v("\n 还未设置扫码后自动回复,针对扫参数二维码的用户不会回复内容,建议开启设置\n ")]),t._v(" "),i("div",{staticClass:"btnList"},[i("div",{staticStyle:{margin:"15px 0"}},[i("label",[t._v("回复方式:")]),t._v(" "),i("el-radio",{attrs:{label:"0"},model:{value:t.limit,callback:function(s){t.limit=s},expression:"limit"}},[t._v("回复全部")]),t._v(" "),i("el-radio",{attrs:{label:"1"},model:{value:t.limit,callback:function(s){t.limit=s},expression:"limit"}},[t._v("随机回复一条")])],1),t._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.edit}},[t._v("保存")]),t._v(" "),i("el-button",{attrs:{size:"small"},on:{click:t.cancel}},[t._v("取消")])],1)]),t._v(" "),i("my-dialog",{attrs:{visible:t.showTag,width:"30%",minWidth:"500px"},on:{"update:visible":function(s){t.showTag=s}}},[i("div",{staticClass:"toast"},[i("div",{staticClass:"toastMain",staticStyle:{padding:"40px 20px"}},[i("el-checkbox-group",{model:{value:t.tags,callback:function(s){t.tags=s},expression:"tags"}},t._l(t.tagList,function(s){return i("el-checkbox",{key:s.id,attrs:{label:s.id}},[i("span",{staticClass:"tagName"},[t._v(t._s(s.name))])])}),1),t._v(" "),i("span",{staticClass:"add",staticStyle:{"padding-left":"20px"},on:{click:function(s){t.editIng=!0}}},[t._v("新建标签")]),t._v(" "),t.editIng?i("div",{staticClass:"editBox"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.addInput,expression:"addInput"}],staticClass:"input",staticStyle:{height:"26px","line-height":"26px"},attrs:{type:"text"},domProps:{value:t.addInput},on:{input:function(s){s.target.composing||(t.addInput=s.target.value)}}}),t._v(" "),i("span",{staticClass:"button",on:{click:t.addIng}},[t._v("添加")]),t._v(" "),i("span",{staticClass:"button",on:{click:function(s){t.editIng=!1}}},[t._v("取消")])]):t._e()],1),t._v(" "),i("div",{staticClass:"toastBtn"},[i("el-button",{attrs:{size:"mini"},on:{click:function(s){t.showTag=!1}}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(s){return t.addTag()}}},[t._v("确定")])],1)])])],1)])},staticRenderFns:[]};var o=e("VU/8")(n,l,!1,function(t){e("QyHV"),e("l6Od")},"data-v-7d7049fe",null);s.default=o.exports},QyHV:function(t,s){},l6Od:function(t,s){}});
|