index.js 3.6 KB

1
  1. require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/user_get_coupon/index"],{"007e":function(t,n,o){"use strict";o.d(n,"b",(function(){return e})),o.d(n,"c",(function(){return i})),o.d(n,"a",(function(){}));var e=function(){var t=this,n=t.$createElement,o=(t._self._c,t.couponsList.length),e=o?t.__map(t.couponsList,(function(n,o){var e=t.__get_orig(n),i=n.products.length>1||0==n.products.length,u=i?n.products.length:null,s=1!=n.coupon_type?parseFloat(n.coupon_price):null;return{$orig:e,g1:i,g2:u,m0:s}})):null,i=t.couponsList.length,u=i?null:!t.couponsList.length&&2===t.page;t.$mp.data=Object.assign({},{$root:{g0:o,l0:e,g3:i,g4:u}})},i=[]},"0525":function(t,n,o){"use strict";(function(t,n){var e=o("4ea4");o("59a4");e(o("66fd"));var i=e(o("6e2d"));t.__webpack_require_UNI_MP_PLUGIN__=o,n(i.default)}).call(this,o("bc2e")["default"],o("543d")["createPage"])},"432c":function(t,n,o){},"6e2d":function(t,n,o){"use strict";o.r(n);var e=o("007e"),i=o("d788");for(var u in i)["default"].indexOf(u)<0&&function(t){o.d(n,t,(function(){return i[t]}))}(u);o("a29d");var s=o("f0c5"),a=Object(s["a"])(i["default"],e["b"],e["c"],!1,null,"bb052d8c",null,!1,e["a"],void 0);n["default"]=a.exports},7292:function(t,n,o){"use strict";(function(t){var e=o("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o("3c98"),u=o("8e8a"),s=o("26cb"),a=e(o("5c3b")),c=o("865e"),l={components:{home:function(){Promise.all([o.e("common/vendor"),o.e("components/home/index")]).then(function(){return resolve(o("377d"))}.bind(null,o)).catch(o.oe)}},mixins:[a.default],data:function(){return{couponsList:[],loading:!1,loadend:!1,loadTitle:"加载更多",page:1,limit:20,isAuto:!1,isShowAuth:!1,type:0,navList:[{name:"通用券",count:0},{name:"品类券",count:0},{name:"商品券",count:0},{name:"品牌券",count:0}],count:0,imgHost:c.HTTP_REQUEST_URL}},computed:(0,s.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,n){t&&this.getUseCoupons(1)},deep:!0}},onLoad:function(){this.isLogin?this.getUseCoupons(1):(0,u.toLogin)()},onShow:function(){t.removeStorageSync("form_type_cart")},onReachBottom:function(){this.getUseCoupons()},methods:{goDetails:function(n){t.navigateTo({url:"/pages/goods_details/index?id="+n.id})},onLoadFun:function(){this.getUseCoupons(),this.isShowAuth=!1},authColse:function(t){this.isShowAuth=t},getCoupon:function(t,n){var o=this,e=o.couponsList;(0,i.setCouponReceive)(t).then((function(t){e[n].is_use=!0,o.$set(o,"couponsList",e),o.$util.Tips({title:"领取成功"})})).catch((function(t){return o.$util.Tips({title:t})}))},getUseCoupons:function(t){var n=this;return!this.loadend&&(!this.loading&&(n.loading=!0,n.loadTitle="加载更多",void(0,i.getCoupons)({type:n.type,page:n.page,limit:n.limit}).then((function(o){var e=o.data.list,i=e.length<n.limit,u=[],s=n.$util.SplitArray(e,n.couponsList);o.data.count.forEach((function(t,o){n.navList[o].count=t,t&&(n.count++,u.push(o))})),t&&(n.type=u[0]),n.$set(n,"couponsList",s),n.loadend=i,n.loading=!1,n.loadTitle=i?"没有更多内容啦~":"加载更多",n.page=n.page+1})).catch((function(t){n.loading=!1,n.loadTitle="加载更多"}))))},setType:function(t){this.type!==t&&(this.type=t,this.couponsList=[],this.page=1,this.loadend=!1,this.getUseCoupons())}}};n.default=l}).call(this,o("543d")["default"])},a29d:function(t,n,o){"use strict";var e=o("432c"),i=o.n(e);i.a},d788:function(t,n,o){"use strict";o.r(n);var e=o("7292"),i=o.n(e);for(var u in e)["default"].indexOf(u)<0&&function(t){o.d(n,t,(function(){return e[t]}))}(u);n["default"]=i.a}},[["0525","common/runtime","common/vendor"]]]);