1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/gift/list/list"],{"2b49":function(t,e,n){"use strict";var o,r=function(){var t=this,e=t.$createElement;t._self._c},i=[];n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},3254:function(t,e,n){},"44c6":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("4795")),r=n("2f62");function i(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e,n,o,r,i,s){try{var u=t[i](s),a=u.value}catch(c){return void n(c)}u.done?e(a):Promise.resolve(a).then(o,r)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(o,r){var i=t.apply(e,n);function s(t){c(i,o,r,s,u,"next",t)}function u(t){c(i,o,r,s,u,"throw",t)}s(void 0)}))}}var f=function(){n.e("components/page-component/app-sort-rule/app-sort-rule").then(function(){return resolve(n("4421"))}.bind(null,n)).catch(n.oe)},p=function(){n.e("components/page-component/app-product-list/app-product-list").then(function(){return resolve(n("69c0"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("components/page-component/app-no-goods/app-no-goods").then(function(){return resolve(n("23a6"))}.bind(null,n)).catch(n.oe)},g=function(){n.e("plugins/gift/components/list/search").then(function(){return resolve(n("43897"))}.bind(null,n)).catch(n.oe)},h={name:"list",data:function(){return{goods_list:[],page:1,page_count:1,sort:1,sort_type:-1,loading:!1}},onLoad:function(){var t=this;this.$store.dispatch("gift/getConfig",this.$api.gift.config),this.request().then((function(e){t.dataProcessing(e),t.loading=!0}))},onReachBottom:function(){var t=this;this.page<this.page_count&&(this.page++,this.request().then((function(e){t.dataProcessing(e)})))},methods:{request:function(){var e=this;return l(o.default.mark((function n(){var r;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.$utils.showLoading(),n.prev=1,n.next=4,e.$request({url:e.$api.gift.list,method:"get",data:{sort:e.sort,page:e.page,sort_type:e.sort_type}});case 4:if(r=n.sent,e.$utils.hideLoading(),0!==r.code){n.next=10;break}return n.abrupt("return",r.data);case 10:t.showModal({title:"提示",content:r.msg});case 11:n.next=17;break;case 13:throw n.prev=13,n.t0=n["catch"](1),e.$utils.hideLoading(),new Error(n.t0);case 17:case"end":return n.stop()}}),n,null,[[1,13]])})))()},dataProcessing:function(t){for(var e=0;e<t.list.length;e+=2)e+1!==t.list.length?this.goods_list.push([t.list[e],t.list[e+1]]):this.goods_list.push([t.list[e]]);this.page_count=t.pagination.page_count},set_sort:function(t,e){var n=this;this.sort=t,this.goods_list=[],this.page=1,this.sort_type=e,this.request().then((function(t){n.dataProcessing(t)}))},routeGo:function(e){console.log(e),e.video_url&&1==this.getVideo?t.navigateTo({url:"/pages/goods/video?goods_id=".concat(e.id,"&sign=gift")}):t.navigateTo({url:"/plugins/gift/goods/goods?".concat(e.page_url.split("?")[1])})}},computed:u({},(0,r.mapState)("gift",{theme:function(t){return t.theme}}),{},(0,r.mapGetters)("mallConfig",{getVideo:"getVideo"})),components:{"app-sort-rule":f,"product-list":p,"app-no-goods":d,search:g}};e.default=h}).call(this,n("543d")["default"])},"591a":function(t,e,n){"use strict";var o=n("3254"),r=n.n(o);r.a},"64fe":function(t,e,n){"use strict";n.r(e);var o=n("2b49"),r=n("eb23");for(var i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n("591a");var s,u=n("f0c5"),a=Object(u["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],s);e["default"]=a.exports},8075:function(t,e,n){"use strict";(function(t){n("8748");o(n("66fd"));var e=o(n("64fe"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},eb23:function(t,e,n){"use strict";n.r(e);var o=n("44c6"),r=n.n(o);for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e["default"]=r.a}},[["8075","common/runtime","common/vendor"]]]);
|