Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-24dbc7da.8c1503f8.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
7.9 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-24dbc7da"],{1614:function(o,e,n){"use strict";n.r(e);var t=function(){var o=this,e=o._self._c;return e("div",[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:3}},[e("el-card",{staticClass:"list-selector"},[e("ul",{staticClass:"list-selector-list"},[e("li",{class:{selected:""===o.userCouponInfo.conditions.couponId},on:{click:function(e){o.switchCoupon({couponName:o.$t("common.all"),couponId:""})}}},[o._v(" "+o._s(o.$t("common.all"))+" ")]),o._l(o.userCouponInfo.coupons,(function(n,t){return e("li",{key:t,class:{selected:o.userCouponInfo.conditions.couponId==n.couponId},on:{click:function(e){return o.switchCoupon(n)}}},[o._v(" "+o._s(n.couponName)+" ")])}))],2)])],1),e("el-col",{attrs:{span:21}},[e("el-card",[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[o._v(o._s(o.$t("couponManage.queryCondition")))])]),e("el-form",{staticClass:"demo-form-inline text-left",attrs:{inline:!0}},[e("el-form-item",[e("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:o.$t("couponManage.userName"),clearable:""},model:{value:o.userCouponInfo.conditions.userName,callback:function(e){o.$set(o.userCouponInfo.conditions,"userName",e)},expression:"userCouponInfo.conditions.userName"}})],1),e("el-form-item",[e("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:o.$t("couponManage.phoneNumber"),clearable:""},model:{value:o.userCouponInfo.conditions.tel,callback:function(e){o.$set(o.userCouponInfo.conditions,"tel",e)},expression:"userCouponInfo.conditions.tel"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return o._queryUserCouponMethod()}}},[e("i",{staticClass:"el-icon-search"}),o._v(" "+o._s(o.$t("couponManage.query"))+" ")]),e("el-button",{on:{click:function(e){return o._resetUserCouponMethod()}}},[e("i",{staticClass:"el-icon-refresh"}),o._v(" "+o._s(o.$t("common.reset"))+" ")])],1)],1)],1),e("el-card",{staticStyle:{"margin-top":"20px"}},[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[o._v(o._s(o.$t("couponManage.userCoupons")))])]),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:o.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:o.userCouponInfo.userCoupons,border:""}},[e("el-table-column",{attrs:{prop:"userCouponId",label:o.$t("couponManage.id"),align:"center"}}),e("el-table-column",{attrs:{prop:"couponName",label:o.$t("couponManage.couponName"),align:"center"}}),e("el-table-column",{attrs:{prop:"personName",label:o.$t("couponManage.userName"),align:"center"}}),e("el-table-column",{attrs:{prop:"tel",label:o.$t("couponManage.phoneNumber"),align:"center"}}),e("el-table-column",{attrs:{prop:"couponType",label:o.$t("couponManage.couponType"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v(" "+o._s("01"===e.row.couponType?o.$t("couponManage.fullReduction"):o.$t("couponManage.discount"))+" ")]}}])}),e("el-table-column",{attrs:{label:o.$t("couponManage.discountInfo"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(n){return["01"===n.row.couponType?e("span",[o._v(" "+o._s(o.$t("couponManage.reduce"))+"¥"+o._s(n.row.discountAmount)+" ")]):e("span",[o._v(" "+o._s(n.row.discountPercent)+"%"+o._s(o.$t("couponManage.off"))+" ")])]}}])}),e("el-table-column",{attrs:{prop:"status",label:o.$t("couponManage.status"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v(" "+o._s("0"===e.row.status?o.$t("couponManage.unused"):"1"===e.row.status?o.$t("couponManage.used"):o.$t("couponManage.expired"))+" ")]}}])}),e("el-table-column",{attrs:{label:o.$t("couponManage.validTime"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v(" "+o._s(e.row.startTime)+"~"+o._s(e.row.endTime)+" ")]}}])}),e("el-table-column",{attrs:{prop:"createTime",label:o.$t("couponManage.receiveTime"),align:"center"}})],1),e("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":o.userCouponInfo.conditions.page,"page-size":o.userCouponInfo.conditions.row,layout:"total, prev, pager, next",total:o.userCouponInfo.total},on:{"current-change":o.handleCurrentChange,"update:currentPage":function(e){return o.$set(o.userCouponInfo.conditions,"page",e)},"update:current-page":function(e){return o.$set(o.userCouponInfo.conditions,"page",e)}}})],1)],1)],1)],1)},s=[],a=n("6c49"),u=n("7323"),r={name:"UserCouponManage",data(){return{loading:!1,userCouponInfo:{userCoupons:[],coupons:[],total:0,conditions:{userName:"",tel:"",couponId:"",shopId:"",page:1,row:10}}}},created(){this.userCouponInfo.conditions.shopId=Object(u["f"])(),this._listCoupons(),this._listUserCoupons()},methods:{async _listCoupons(){try{const o=await Object(a["f"])({shopId:Object(u["f"])(),page:1,row:100});this.userCouponInfo.coupons=o.data||[]}catch(o){console.error("获取优惠券列表失败:",o)}},async _listUserCoupons(){this.loading=!0;try{const o=await Object(a["g"])(this.userCouponInfo.conditions);this.userCouponInfo.userCoupons=o.data,this.userCouponInfo.total=o.total}catch(o){console.error("获取用户优惠券列表失败:",o)}finally{this.loading=!1}},_queryUserCouponMethod(){this.userCouponInfo.conditions.page=1,this._listUserCoupons()},_resetUserCouponMethod(){this.userCouponInfo.conditions.userName="",this.userCouponInfo.conditions.tel="",this.userCouponInfo.conditions.page=1,this._listUserCoupons()},handleCurrentChange(o){this.userCouponInfo.conditions.page=o,this._listUserCoupons()},switchCoupon(o){this.userCouponInfo.conditions.couponId=o.couponId||"",this.userCouponInfo.conditions.page=1,this._listUserCoupons()}}},c=r,i=(n("a70d"),n("2877")),p=Object(i["a"])(c,t,s,!1,null,"090e12e6",null);e["default"]=p.exports},"6c49":function(o,e,n){"use strict";n.d(e,"f",(function(){return a})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return r})),n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return i})),n.d(e,"g",(function(){return p})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return d})),n.d(e,"e",(function(){return f}));var t=n("b775"),s=n("7323");function a(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.queryShopCoupon",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function u(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.saveShopCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function r(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.updateShopCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function c(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.deleteShopCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function i(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.giveCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function p(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.queryUserCoupon",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function l(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.queryCouponGiveLog",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function d(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.queryCouponReceiveLog",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function f(o){return new Promise((e,n)=>{o.shopId=Object(s["f"])(),Object(t["a"])({url:"/coupon.queryCouponUseLog",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}},a70d:function(o,e,n){"use strict";n("ed92")},ed92:function(o,e,n){}}]);
//# sourceMappingURL=chunk-24dbc7da.8c1503f8.js.map