(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77aa9a94"],{"125f":function(t,e,a){"use strict";a("41a8")},"24e8":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"app-form margin-top"},[a("div",{staticClass:"app-form-group"},[a("div",{staticClass:"app-form-ti"},[t._v("基础配置")]),a("form-generator",{ref:"basicForm",attrs:{"form-config":t.formConfig,"show-footer":!0,showCancel:!0,cancelText:"返回"},on:{submit:t.handleBasicSubmit,cancel:t.handleCancel},scopedSlots:t._u([{key:"buy_rule",fn:function(e){e.form;return[a("el-form-item",{attrs:{label:"次数规则"}},[a("div",{staticClass:"rule-list"},[t._l(t.formData.buy_rule,(function(e,o){return a("div",{key:o,staticClass:"rule-row"},[a("el-input",{staticStyle:{width:"150px"},attrs:{type:"number",placeholder:"金额"},model:{value:e.money,callback:function(a){t.$set(e,"money",a)},expression:"item.money"}},[a("template",{slot:"append"},[t._v("元")])],2),a("span",{staticClass:"rule-sep"},[t._v("可检测")]),a("el-input",{staticStyle:{width:"150px"},attrs:{type:"number",placeholder:"次数"},model:{value:e.count,callback:function(a){t.$set(e,"count",a)},expression:"item.count"}},[a("template",{slot:"append"},[t._v("次")])],2),a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"danger",plain:"",icon:"el-icon-delete"},on:{click:function(e){return t.removeRule(o)}}})],1)})),a("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"small"},on:{click:t.addRule}},[t._v("添加规则")])],2)])]}}]),model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}},[a("div",{attrs:{slot:"appcode_tip"},slot:"appcode_tip"},[a("a",{staticStyle:{"margin-left":"10px",color:"#409EFF"},attrs:{href:"https://market.aliyun.com/detail/cmapi00066970?spm=5176.30275541.J_ZGek9Blx07Hclc3Ddt9dg.1.60802f3dTAbMl7&scm=20140722.S_market@@???API@@cmapi00066970._.ID_market@@???API@@cmapi00066970-RL_??-LOC_2024SPAllResult-OR_ser-PAR1_213e055b17655518574764543e6bb5-V_4-PAR3_o-RE_new7-P0_0-P1_0#sku=yuncode6097000002",target:"_blank"}},[t._v("前往获取")]),t._v("appCode ")])])],1)])])},i=[],n=a("7f70"),s=(a("e688"),a("792e"),a("9ca6"),a("e8d6"),a("baf6"),a("5c41"),a("23bf"),a("0c43"),a("6994"),a("3882"),a("8327")),l={name:"TongueDiagnosisSet",data:function(){return{formData:{status:1,appcode:"",huoqu_num_method:[],buy_rule:[{money:"",count:""}],instructions:""},goodsList:[]}},computed:Object(n["a"])(Object(n["a"])({},Object(s["b"])(["config"])),{},{formConfig:function(){var t=[{type:"radio",label:"状态",prop:"status",width:"400px",options:[{label:"启用",value:1},{label:"禁用",value:0}]},{type:"input",label:"阿里云AppCode",prop:"appcode",width:"400px",placeholder:"请输入阿里云AppCode",tipType:"warning"},{type:"checkbox",label:"获取次数方式",prop:"huoqu_num_method",options:[{label:"购买商品",value:1},{label:"购买次数",value:2}]},{type:"select",label:"主推商品",prop:"main_recommendation_goods",width:"400px",options:this.goodsList,show:this.hasGetWay(1)},{type:"slot",label:"次数规则",prop:"buy_rule",show:this.hasGetWay(2)},{type:"editor",label:"使用说明",prop:"instructions",height:"400px"}];return t}}),created:function(){this.init()},watch:{config:{handler:function(t){this.init()},deep:!0,immediate:!0}},methods:{hasGetWay:function(t){var e=this.formData.huoqu_num_method||[];return e.includes(t)||e.includes(t+"")},init:function(){var t=this;this.config.tongue_diagnosis&&(this.formData=Object.assign({},this.formData,this.$util.restJson(this.config.tongue_diagnosis)),Array.isArray(this.formData.buy_rule)&&0!=this.formData.buy_rule.length||(this.formData.buy_rule=[{money:"",count:""}]),Array.isArray(this.formData.huoqu_num_method)||(this.formData.huoqu_num_method=[])),this.api.get("tongue_diagnosis/config/getGoodsList",{},!1).then((function(e){1==e.code&&(t.goodsList=e.data.list.map((function(t){return{label:t.title,value:t.id+""}})))}))},handleBasicSubmit:function(t){var e=this;Array.isArray(t.buy_rule)&&(t.buy_rule=t.buy_rule.filter((function(t){return""!==t.money&&null!=t.money&&""!==t.count&&null!=t.count}))),this.api.post("tongue_diagnosis/config/set",t).then((function(t){1==t.code?(e.$util.success(t.message),e.$store.dispatch("settings/getSetting")):e.$util.error(t.message)}))},addRule:function(){this.formData.buy_rule.push({money:"",count:""})},removeRule:function(t){this.formData.buy_rule.splice(t,1)},handleCancel:function(){this.$router.back()}}},r=l,u=(a("125f"),a("3d7a")),c=Object(u["a"])(r,o,i,!1,null,"fe6a4f54",null);e["default"]=c.exports},"41a8":function(t,e,a){}}]);