java-mall-app/unpackage/dist/build/mp-weixin/member/member/coupon.js
2025-12-12 17:04:03 +08:00

1 line
6.5 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["member/member/coupon"],{"05f3":function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("ec76");o(n("3240"));var i=o(n("809b"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"0dc9":function(e,t,n){e.exports={theme_bg:"#f30213"}},"374f":function(e,t,n){"use strict";(function(e){var o=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("7ca3")),r=n("8f59");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a={name:"asset",data:function(){return{page:1,rows:10,tapindex:0,offison:0,voucher_state_id:1501,ispage:!0,flag:!0,is_filter:!1,rightDrawerVisible:!1,inverted:{neverused:!0,alreadyused:!0,outdated:!0},UserCoupon:[],numAllCouponed:0,numOfflined:0,numOnlined:0,numCarCouponed:0,numNeverUsed:0,numAlreadyused:0,numOutdated:0}},computed:(0,r.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin"]),components:{uniDrawer:function(){n.e("components/uni-drawer").then(function(){return resolve(n("a61f"))}.bind(null,n)).catch(n.oe)},uniTag:function(){n.e("components/uni-tag/uni-tag").then(function(){return resolve(n("120e"))}.bind(null,n)).catch(n.oe)},lxCoupon:function(){n.e("member/member/lx-coupon/lx-coupon").then(function(){return resolve(n("cde6"))}.bind(null,n)).catch(n.oe)}},onLoad:function(t){e.setNavigationBarTitle({title:this.__("优惠券")}),this.setData({UserCoupon:[]}),this.getCouponlist()},onReachBottom:function(){this.scrollbottom()},methods:s(s({},(0,r.mapMutations)(["login","logout","getPlantformInfo","forceUserInfo","getUserInfo"])),{},{allcouponed:function(){this.setType(""),this.is_filter=!1,this.setData({tapindex:0,offison:1,voucher_state_id:0,UserCoupon:[],page:1}),this.getCouponlist()},offlined:function(){this.setType(""),this.is_filter=!1,this.setData({tapindex:1,offison:2,voucher_state_id:0,UserCoupon:[],page:1}),this.getCouponlist()},onlined:function(){this.setType(""),this.is_filter=!1,this.setData({tapindex:2,offison:3,voucher_state_id:0,UserCoupon:[],page:1}),this.getCouponlist()},carcouponed:function(){},useVoucher:function(e){var t=e.currentTarget.dataset.store_id,n=e.currentTarget.dataset.item_id;this.$.redirectTo({url:"/member/product/coupon?store_id="+t+"&voucher_item_id="+n})},listCoupon:function(e){this.$.redirectTo({url:"/activity/coupon/list"})},onCloseFilter:function(){this.rightDrawerVisible=!1},onOpenFilter:function(){this.rightDrawerVisible=!0},onFilter:function(){var e=!1;this.rightDrawerVisible=!1,this.inverted.neverused||(e=!0,this.is_filter=!0,this.setData({tapindex:this.tapindex,offison:this.offison,voucher_state_id:1501,UserCoupon:[],page:1}),this.getCouponlist()),this.inverted.alreadyused||(e=!0,this.is_filter=!0,this.setData({tapindex:this.tapindex,offison:this.offison,voucher_state_id:1502,UserCoupon:[],page:1}),this.getCouponlist()),this.inverted.outdated||(e=!0,this.is_filter=!0,this.setData({tapindex:this.tapindex,offison:this.offison,voucher_state_id:1503,UserCoupon:[],page:1}),this.getCouponlist()),e||(this.$.alert("您未选中任何查询条件!"),this.is_filter=!1,this.rightDrawerVisible=!0)},setType:function(e){for(var t=["neverused","alreadyused","outdated"],n=0;n<t.length;n++)t[n]==e?this.inverted[e]=!this.inverted[e]:this.inverted[t[n]]=!0},getCouponlist:function(){var e={page:this.page,rows:this.rows,offison:this.offison,voucher_state_id:this.voucher_state_id},t=this;t.$.request({url:this.Config.URL.user.eachVoucherNum,data:e,success:function(e,n,o,i){200==n?t.setData({numAllCouponed:e.voucher_all_num,numOfflined:e.voucher_offlined_num,numOnlined:e.voucher_onlined_num,numCarCouponed:e.voucher_carcoupon_num,numNeverUsed:e.voucher_unused_num,numAlreadyused:e.voucher_used_num,numOutdated:e.voucher_timeout_num}):t.setData({numNeverUsed:-1,numAlreadyused:-1,numOutdated:-1})}}),t.$.request({url:this.Config.URL.user.voucherList,data:e,success:function(e,n,o,i){if(200==n)if(e.items.length>0){for(var r=0;r<e.items.length;r++)e.items[r]["voucher_start_date"]=t.$.dateFormat(e.items[r]["voucher_start_date"],"yyyy-MM-dd"),e.items[r]["voucher_end_date"]=t.$.dateFormat(e.items[r]["voucher_end_date"],"yyyy-MM-dd");e.page>=e.total?t.setData({UserCoupon:t.UserCoupon.concat(e.items),flag:!1,ispage:!1}):t.setData({UserCoupon:t.UserCoupon.concat(e.items),flag:!0,ispage:!0})}else t.setData({flag:!1,ispage:!1})}})},scrollbottom:function(){if(this.flag){var e=this;e.setData({flag:!1}),clearTimeout(t);var t=setTimeout((function(){e.setData({page:parseInt(e.page)+1}),e.getCouponlist()}),500)}}})};t.default=a}).call(this,n("df3c")["default"])},3848:function(e,t,n){"use strict";var o=n("0dc9"),i=n.n(o);i.a},"77d7":function(e,t,n){"use strict";n.r(t);var o=n("374f"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=i.a},"809b":function(e,t,n){"use strict";n.r(t);var o=n("86dd"),i=n("77d7");for(var r in i)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(r);n("3848");var u=n("828b"),s=Object(u["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=s.exports},"86dd":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));var o={uniDrawer:function(){return n.e("components/uni-drawer/uni-drawer").then(n.bind(null,"efd5"))},uniTag:function(){return n.e("components/uni-tag/uni-tag").then(n.bind(null,"120e"))}},i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.__("全部")),o=e.__("线下券"),i=e.__("线上券"),r=e.__("筛选"),u=e.__("优惠券状态"),s=e.__("未使用"),a=e.__("已使用"),c=e.__("已过期"),l=e.__("筛选"),d=e.UserCoupon.length,f=d>0?null:e.__("亲~什么都没有"),h=d>0?null:e.__("赶快去领券中心吧"),p=e.__("领取更多优惠券");e.$mp.data=Object.assign({},{$root:{m0:n,m1:o,m2:i,m3:null,m4:r,m5:u,m6:s,m7:a,m8:c,m9:l,g0:d,m10:f,m11:h,m12:p,g1:null,l0:null,m17:null,m18:null,m19:null,m20:null}})},r=[]}},[["05f3","common/runtime","common/vendor"]]]);