more.js 3.9 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/more"],{"1df3":function(t,e,i){"use strict";i.r(e);var n=i("2cf7"),r=i("20db");for(var a in r)"default"!==a&&function(t){i.d(e,t,(function(){return r[t]}))}(a);i("b18f");var o,s=i("f0c5"),c=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],o);e["default"]=c.exports},"20db":function(t,e,i){"use strict";i.r(e);var n=i("3e5b"),r=i.n(n);for(var a in n)"default"!==a&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=r.a},"2cf7":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement;t._self._c},a=[]},"3e5b":function(t,e,i){"use strict";(function(t){function i(t){return o(t)||a(t)||r(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"===typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function a(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function o(t){if(Array.isArray(t))return s(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c={data:function(){return{i:0,page:1,pages:0,price:"",sort:"",list:[{name:"新品",type:0},{name:"综合",type:0},{name:"价格",type:0},{name:"筛选",type:0}],boxList:[],isShow:!1,selectPrice:-1,minPrice:"",maxPrice:"",priceList:[]}},methods:{goMessage:function(e,i){t.navigateTo({url:"/pages/index/details?id="+e.box_id+"&type="+i})},reset:function(t){0==t?(this.minPrice="",this.maxPrice="",this.selectPrice=-1):(this.price=(0==this.minPrice||this.minPrice)&&this.maxPrice?this.minPrice+"-"+this.maxPrice:"",this.isShow=!1,this.list[3].type=0,this.getBoxListByCategory())},selectprice:function(t){this.selectPrice=t==this.selectPrice?-1:t,-1!=this.selectPrice&&(this.minPrice=this.priceList[t].split("-")[0],this.maxPrice=this.priceList[t].split("-")[1])},changeHead:function(t){this.page=1,this.i=t,this.getBoxListByCategory(this.list[t].category_id)},returnTop:function(){t.navigateBack()},getBoxListByCategory:function(t){var e=this;this.$api.search({page:this.page,msg:"数据加载中",sort:this.sort,price:this.price,category_id:t}).then((function(t){1===t.code&&(t.data.data.forEach((function(t){t.image=t.goods_images[0],t.right=[],t.bot=[],t.goods_images.forEach((function(e,i){i>0&&i<3&&t.right.push(e),i>2&&t.bot.push(e)}))})),e.boxList=1==e.page?t.data.data:[].concat(i(rhis.boxList),i(t.data.data)),e.pages=t.data.last_page)}))},getPriceList:function(){var t=this;this.$api.priceRange().then((function(e){1===e.code&&(t.priceList=e.data.range)}))},navTo:function(e){t.navigateTo({url:e,fail:function(){t.switchTab({url:e})}})},classify:function(){var t=this;this.$api.categoryList({page:1,limit:1e3}).then((function(e){var i=e.data;i.unshift({category_id:0,name:"全部"}),t.list=i,t.getBoxListByCategory(t.list[0].category_id)}))}},onLoad:function(){this.classify(),this.getPriceList()},onPullDownRefresh:function(){this.page=1,this.getBoxListByCategory()},onReachBottom:function(){this.page<this.pages&&(this.page++,this.getBoxListByCategory())}};e.default=c}).call(this,i("543d")["default"])},b18f:function(t,e,i){"use strict";var n=i("f699"),r=i.n(n);r.a},ca07:function(t,e,i){"use strict";(function(t){i("a940");n(i("66fd"));var e=n(i("1df3"));function n(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=i,t(e.default)}).call(this,i("543d")["createPage"])},f699:function(t,e,i){}},[["ca07","common/runtime","common/vendor"]]]);