1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4225dffc"],{"061f":function(e,t,a){"use strict";a.r(t);var n=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:"请选择"},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("el-tabs",{on:{"tab-click":e.handleTabClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"门店优惠券",name:"1"}}),a("el-tab-pane",{attrs:{label:"平台优惠券",name:"2"}})],1),a("div",{staticClass:"tabledata mar_t20"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,"element-loading-text":e.elementLoadingText,stripe:""}},[a("el-table-column",{attrs:{prop:"name",label:"优惠券名称",width:"240"}}),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:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(t.row.startTime))]),a("div",[e._v(e._s(t.row.endTime))])]}}])}),a("el-table-column",{attrs:{prop:"stock",label:"已使用/使用率"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[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",[a("span",{staticClass:"subjectcolor2"},[e._v(e._s(t.row.receiveNum))]),e._v("/"+e._s(t.row.stock))])]}}])}),"2"!=e.activeName?a("el-table-column",{attrs:{prop:"display",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(a){return e.changeSwitch(t.row)}},model:{value:t.row.display,callback:function(a){e.$set(t.row,"display",a)},expression:"scope.row.display"}})]}}],null,!1,1591604254)}):e._e(),"2"!=e.activeName?a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[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)]}}],null,!1,685355703)}):e._e()],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)},i=[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("吸引顾客消费")])])])}],l=(a("99af"),a("b0c0"),a("96cf"),a("1da1")),o=a("5530"),s=a("7cb7"),r=a("2f62"),c=a("294d"),u={created:function(){this.fetchData()},computed:Object(o["a"])({},Object(r["d"])(["storeId"])),data:function(){return{formInline:{name:"",type:""},activeName:"1",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(l["a"])(regeneratorRuntime.mark((function t(){var a,n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(s["n"])({page:e.page.currentPage,name:e.formInline.name,type:e.formInline.type,storeId:e.storeId,couponType:e.activeName});case 3:a=t.sent,n=a.data,i=a.count,e.list=n,e.page.total=i,e.listLoading=!1;case 9:case"end":return t.stop()}}),t)})))()},handleTabClick:function(){var e=this;return Object(l["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.fetchData();case 1: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(l["a"])(regeneratorRuntime.mark((function a(){var n,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(s["sb"])({id:e.id,display:e.display,type:1,storeId:t.storeId});case 2:n=a.sent,i=n.msg,t.$baseMessage(i,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)})))()},handleDelete:function(e){this.dialogFormVisible2=!0,this.selectId=e.id},handleEdit:function(e){e?this.$router.push("/storecouponAdd?type=".concat(e)):this.$router.push({path:"storecouponAdd"})},handleEdit2:function(e){e.id?this.$router.push("/storecouponAdd?id=".concat(e.id,"&type=").concat(e.type)):this.$router.push({path:"storecouponAdd"})},handleDelete2:function(){var e=this;this.selectId&&this.$baseConfirm("你确定要删除此券吗?",null,Object(l["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["sb"])({id:e.selectId,type:e.selectDel,storeId:e.storeId});case 2:a=t.sent,n=a.msg,e.$baseMessage(n,"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(l["a"])(regeneratorRuntime.mark((function a(){var n,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t.dialogFormVisible=!0,a.next=3,Object(c["n"])({ident:"couponCenterDl",page:"yb_wm/my/coupon/coupon-dl?id=".concat(e.id),id:e.id});case 3:n=a.sent,i=n.data,t.codeimg=i||"",t.codeimgId=e.id;case 7:case"end":return a.stop()}}),a)})))()}}},d=u,p=(a("1e65"),a("2877")),m=Object(p["a"])(d,n,i,!1,null,"4ace6e8c",null);t["default"]=m.exports},"1e65":function(e,t,a){"use strict";var n=a("3fb0"),i=a.n(n);i.a},"3fb0":function(e,t,a){}}]); |