Files
Smart-Farm/front/mine/pages/coupon/list.js
2025-12-22 17:13:05 +08:00

1 line
4.3 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["mine/pages/coupon/list"],{2622:function(t,e,a){"use strict";(function(t){var n=a("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(a("2eee")),s=n(a("c973")),r=a("26cb"),o={components:{},data:function(){return{options:{},activeIndex:0,tabList:[{title:"待使用",id:1},{title:"已使用",id:2},{title:"已过期",id:3}],statusType:{1:"去使用",2:"已使用",3:"删除"},useType:{is_land:"土地租赁",is_claim:"认养服务",is_shop:"商城"},param:{page:1},list:{data:[]},loading:!0,lockTap:!1}},computed:(0,r.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},userInfo:function(t){return t.user.userInfo}}),onLoad:function(t){this.$util.showLoading(),this.options=t;var e=t.tab,a=void 0===e?0:e;this.activeIndex=a,this.initIndex()},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:{initIndex:function(){this.getList()},initRefresh:function(){this.param.page=1,this.initIndex()},getList:function(){var t=this;return(0,s.default)(i.default.mark((function e(){var a,n,s,r,o,u;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.list,n=t.param,s=t.useType,r=t.tabList,o=t.activeIndex,n.status=r[o].id,e.next=4,t.$api.mine.userCouponList(n);case 4:u=e.sent,u.data.map((function(t){t.is_show=!1;var e="";for(var a in s)t[a]&&(e+="".concat(s[a],"、"));t.use_range=e.substring(0,e.length-1)})),1==t.param.page||(u.data=a.data.concat(u.data)),t.list=u,t.loading=!1,t.$util.hideAll();case 9:case"end":return e.stop()}}),e)})))()},handerTabChange:function(t){this.activeIndex=t,this.$util.showLoading(),this.param.page=1,this.list.data=[],this.getList()},goDetail:function(t){var e=this;return(0,s.default)(i.default.mark((function a(){var n,s,r,o,u,c;return i.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=e.activeIndex,a.t0=n,a.next=0===a.t0?4:1===a.t0?8:2===a.t0?9:27;break;case 4:return s=e.list.data[t],r=s.goods,o=s.shop_goods,u=r.length>0?"/pages/service":o.length>0?"/pages/shop":"/pages/restaurant",e.$util.goUrl({url:u,openType:"switchTab"}),a.abrupt("break",27);case 8:return a.abrupt("break",27);case 9:if(c=e.list.data[t].id,!e.lockTap){a.next=12;break}return a.abrupt("return");case 12:return e.lockTap=!0,e.$util.showLoading(),a.prev=14,a.next=17,e.$api.mine.couponDel({coupon_id:c});case 17:e.$util.hideAll(),e.$util.showToast({title:"删除成功"}),e.list.data.splice(t,1),e.lockTap=!1,a.next=26;break;case 23:a.prev=23,a.t1=a["catch"](14),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 26:return a.abrupt("break",27);case 27:case"end":return a.stop()}}),a,null,[[14,23]])})))()}}};e.default=o}).call(this,a("543d")["default"])},"60b3":function(t,e,a){"use strict";(function(t,e){var n=a("4ea4");a("b03e");n(a("66fd"));var i=n(a("9afb"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(i.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},"61b2":function(t,e,a){"use strict";a.r(e);var n=a("2622"),i=a.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(s);e["default"]=i.a},9124:function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=(t._self._c,t.tabList.length),n=t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,i=!t.loading&&t.list.data.length<=0&&1==t.list.current_page;t._isMounted||(t.e0=function(t,e){var a=arguments[arguments.length-1].currentTarget.dataset,n=a.eventParams||a["event-params"];e=n.index;t.stopPropagation(),this.list.data[e].is_show=!this.list.data[e].is_show}),t.$mp.data=Object.assign({},{$root:{g0:a,g1:n,g2:i}})},i=[]},"9afb":function(t,e,a){"use strict";a.r(e);var n=a("9124"),i=a("61b2");for(var s in i)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(s);a("de2b");var r=a("f0c5"),o=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=o.exports},a94f:function(t,e,a){},de2b:function(t,e,a){"use strict";var n=a("a94f"),i=a.n(n);i.a}},[["60b3","common/runtime","common/vendor"]]]);