1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-00e4d015"],{"05d9":function(e,t,a){},"4f18":function(e,t,a){"use strict";var i=a("05d9"),n=a.n(i);n.a},9493:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),a("div",{staticClass:"flex-bet pad_l_20"},[a("div",{staticClass:"coupon-item"},[e._m(1),a("el-button",{staticClass:"mar_t10",attrs:{type:"primary",size:"medium"},on:{click:function(t){return e.handleEdit("1")}}},[e._v("立即创建")])],1),a("div",{staticClass:"coupon-item"},[e._m(2),a("el-button",{staticClass:"mar_t10",attrs:{type:"primary",size:"medium"},on:{click:function(t){return e.handleEdit("2")}}},[e._v("立即创建")])],1),a("div",{staticClass:"coupon-item"},[e._m(3),a("el-button",{staticClass:"mar_t10",attrs:{type:"primary",size:"medium"},on:{click:function(t){return e.handleEdit("3")}}},[e._v("立即创建")])],1)]),a("div",{staticClass:"pad_20 flex-bet flex-y-top"},[a("el-form",{staticClass:"demo-form-inline searchform",attrs:{inline:!0,model:e.formInline}},[a("el-form-item",{attrs:{label:"优惠券名称"}},[a("el-input",{attrs:{size:"medium",placeholder:"请输入优惠券名称"},on:{input:e.onSearch},model:{value:e.formInline.name,callback:function(t){e.$set(e.formInline,"name",t)},expression:"formInline.name"}})],1),a("el-form-item",{attrs:{label:"优惠券类型"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:e.onSearch},model:{value:e.formInline.type,callback:function(t){e.$set(e.formInline,"type",t)},expression:"formInline.type"}},e._l(e.labelOptions,(function(e){return a("el-option",{key:e.label,attrs:{label:e.value,value:e.label}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.onSearch}},[e._v("搜索")])],1)],1)],1),a("div",{staticClass:"tabledata mar_t20"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"tablecenter",staticStyle:{width:"100%"},attrs:{data:e.list,"element-loading-text":e.elementLoadingText,stripe:""}},[a("el-table-column",{attrs:{prop:"name",label:"优惠券名称",width:"300"}}),a("el-table-column",{attrs:{prop:"type",label:"优惠券类型"},scopedSlots:e._u([{key:"default",fn:function(t){return["1"==t.row.type?a("div",[a("el-tag",{attrs:{size:"mini",type:"success"}},[e._v("满减券")])],1):e._e(),"2"==t.row.type?a("div",[a("el-tag",{attrs:{size:"mini"}},[e._v("折扣券")])],1):e._e(),"3"==t.row.type?a("div",[a("el-tag",{attrs:{size:"mini",type:"warning"}},[e._v("商品兑换券")])],1):e._e()]}}])}),a("el-table-column",{attrs:{prop:"isFull",label:"优惠内容"},scopedSlots:e._u([{key:"default",fn:function(t){return["3"==t.row.type?a("div",[e._v("兑换商品:"),a("div",[e._v(e._s(t.row.discount))])]):e._e(),"1"==t.row.isFull&&"1"==t.row.type?a("div",[e._v("无门槛 减"+e._s(t.row.money))]):e._e(),"1"==t.row.isFull&&"2"==t.row.type?a("div",[e._v("无门槛 打"+e._s(t.row.discount)+"折")]):e._e(),"2"==t.row.isFull&&"1"==t.row.type?a("div",[e._v("满"+e._s(t.row.fullMoney)+" 减"+e._s(t.row.money))]):e._e(),"2"==t.row.isFull&&"2"==t.row.type?a("div",[e._v("满"+e._s(t.row.fullMoney)+" 打"+e._s(t.row.discount)+"折")]):e._e()]}}])}),a("el-table-column",{attrs:{prop:"time",label:"领取条件",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{},[a("div",{staticClass:"flex"},[e._v("适用门店: "),a("div",{staticClass:"mar_l10 flex"},["1"==t.row.storeType?a("div",[e._v("仅本店可用")]):e._e(),"2"==t.row.storeType?a("div",[e._v("全店通用")]):e._e(),"3"==t.row.storeType?a("div",[e._v("指定门店可用")]):e._e()])]),a("div",{staticClass:"flex"},[e._v("适用场景: "),a("div",{staticClass:"mar_l10 flex"},[t.row.useType.indexOf("1")>-1?a("div",[e._v("外卖,")]):e._e(),t.row.useType.indexOf("2")>-1?a("div",[e._v("堂食,")]):e._e(),t.row.useType.indexOf("3")>-1?a("div",[e._v("快餐")]):e._e()])]),a("div",{staticClass:"flex"},[e._v("领取人限制: "),a("div",{staticClass:"mar_l10 flex"},["1"==t.row.memberType?a("div",[e._v("所有人均可领取")]):e._e(),"2"==t.row.memberType?a("div",[e._v("会员可领")]):e._e(),"3"==t.row.memberType?a("div",[e._v("指定标签用户可领")]):e._e()])]),a("div",{staticClass:"flex"},[e._v("每人限领次数: "),a("div",{staticClass:"mar_l10 flex"},["1"==t.row.isMax?a("div",[e._v("不限次数")]):e._e(),"2"==t.row.isMax?a("div",[e._v("每人限领"+e._s(t.row.maxNum)+"张")]):e._e()])])])]}}])}),a("el-table-column",{attrs:{prop:"stock",label:"已使用/使用率"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex-center"},[a("span",{staticClass:"subjectcolor2"},[e._v(e._s(t.row.cardUse))]),e._v(" / "+e._s(t.row.cardLv)+" ")])]}}])}),a("el-table-column",{attrs:{prop:"stock",label:"已领取/优惠券总量"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex-center"},[a("span",{staticClass:"subjectcolor2"},[e._v(e._s(t.row.receiveNum))]),e._v(" / "+e._s(t.row.stock)+" ")])]}}])}),a("el-table-column",{attrs:{prop:"state",label:"活动状态"},scopedSlots:e._u([{key:"default",fn:function(t){return["1"==t.row.state?a("div",[a("el-tag",{attrs:{size:"mini",effect:"dark"}},[e._v("未开始")])],1):e._e(),"2"==t.row.state?a("div",[a("el-tag",{attrs:{size:"mini",type:"success",effect:"dark"}},[e._v("进行中")])],1):e._e(),"3"==t.row.state?a("div",[a("el-tag",{attrs:{size:"mini",type:"danger",effect:"dark"}},[e._v("已结束")])],1):e._e()]}}])}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex-center"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit3(t.row)}}},[e._v("推广")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit2(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])],1)]}}])})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}})],1),a("el-dialog",{attrs:{title:"查看小程序推广码",visible:e.dialogFormVisible,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("div",{staticClass:"t_c"},[a("div",{staticClass:"pad_20"},[a("img",{staticStyle:{width:"200px",height:"200px"},attrs:{src:e.codeimg}})]),a("div",{staticClass:"flex-center mar_l20"},[a("div",[e._v("小程序链接:yb_wm/my/coupon/coupon-dl?id="+e._s(e.codeimgId))]),a("div",{staticClass:"mar_l10"},[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.copyText("yb_wm/my/coupon/coupon-dl")}}},[e._v("复制")])],1)])])]),a("el-dialog",{attrs:{title:"删除优惠券",visible:e.dialogFormVisible2,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible2=t}}},[a("div",{staticClass:"t_c"},[a("el-radio-group",{model:{value:e.selectDel,callback:function(t){e.selectDel=t},expression:"selectDel"}},[a("el-radio",{attrs:{label:"2"}},[e._v("用户已领取的优惠券可正常使用")]),a("el-radio",{attrs:{label:"3"}},[e._v("一并删除")])],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogFormVisible2=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.handleDelete2}},[e._v("确 定")])],1)])],1)},n=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("优惠券")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"fon_16 color_3"},[e._v("满减券")]),a("div",{staticClass:"fon_12 color_6 lh22 pad_t_10"},[a("p",[e._v(" 例:满100元减20元 "),a("br"),e._v("便于合理控制活动成本 ")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"fon_16 color_3"},[e._v("折扣券")]),a("div",{staticClass:"fon_12 color_6 lh22 pad_t_10"},[a("p",[e._v(" 例:满100元打9折 "),a("br"),e._v("提高店铺销量和客单价 ")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"fon_16 color_3"},[e._v("商品兑换券")]),a("div",{staticClass:"fon_12 color_6 lh22 pad_t_10"},[a("p",[e._v("用于兑换指定商品"),a("br"),e._v("吸引顾客消费")])])])}],s=(a("99af"),a("b0c0"),a("96cf"),a("1da1")),l=a("7cb7"),r=a("294d"),o={created:function(){this.fetchData()},data:function(){return{formInline:{name:"",type:""},list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1},labelOptions:[{label:1,value:"优惠券"},{label:2,value:"折扣券"},{label:3,value:"商品兑换券"}],codeimg:"",codeimgId:"",dialogFormVisible:!1,dialogFormVisible2:!1,selectDel:"2",selectId:""}},methods:{fetchData:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(l["n"])({page:e.page.currentPage,name:e.formInline.name,type:e.formInline.type});case 3:a=t.sent,i=a.data,n=a.count,e.list=i,e.page.total=n,e.listLoading=!1;case 9:case"end":return t.stop()}}),t)})))()},handleCurrentChange:function(e){this.page.currentPage=e,this.fetchData()},onSearch:function(){this.fetchData()},changeSwitch:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var i,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(l["sb"])({id:e.id,display:e.display,type:1});case 2:i=a.sent,n=i.msg,t.$baseMessage(n,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)})))()},handleDelete:function(e){this.dialogFormVisible2=!0,this.selectId=e.id},handleDelete2:function(){var e=this;this.selectId&&this.$baseConfirm("你确定要删除此券吗?",null,Object(s["a"])(regeneratorRuntime.mark((function t(){var a,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(l["sb"])({id:e.selectId,type:e.selectDel});case 2:a=t.sent,i=a.msg,e.$baseMessage(i,"success"),e.dialogFormVisible2=!1,e.fetchData();case 7:case"end":return t.stop()}}),t)}))))},copyText:function(e){var t=e,a=document.createElement("input");a.value=t,console.log(a.value),document.body.appendChild(a),a.select(),document.execCommand("Copy"),a.className="oInput",a.style.display="none",this.$message({message:"复制成功",type:"success"})},handleEdit3:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var i,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t.dialogFormVisible=!0,a.next=3,Object(r["n"])({ident:"couponCenterDl",page:"yb_wm/my/coupon/coupon-dl?id=".concat(e.id),id:e.id});case 3:i=a.sent,n=i.data,t.codeimg=n||"",t.codeimgId=e.id;case 7:case"end":return a.stop()}}),a)})))()},handletj:function(){this.$router.push({path:"deliverytongji"})},handleEdit:function(e){e?this.$router.push("/couponAdd?type=".concat(e)):this.$router.push({path:"couponAdd"})},handleEdit2:function(e){e.id?this.$router.push("/couponAdd?id=".concat(e.id,"&type=").concat(e.type)):this.$router.push({path:"couponAdd"})}}},c=o,d=(a("4f18"),a("2877")),u=Object(d["a"])(c,i,n,!1,null,"37534ea4",null);t["default"]=u.exports}}]); |