123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/product/list" ], {
- 258: function(e, t, n) {
- (function(e) {
- function t(e) {
- return e && e.__esModule ? e : {
- default: e
- };
- }
- n(4), t(n(2)), e(t(n(259)).default);
- }).call(this, n(1).createPage);
- },
- 259: function(e, t, n) {
- n.r(t);
- var o = n(260), r = n(262);
- for (var a in r) "default" !== a && function(e) {
- n.d(t, e, function() {
- return r[e];
- });
- }(a);
- n(264);
- var i = n(13), c = Object(i.default)(r.default, o.render, o.staticRenderFns, !1, null, null, null, !1, o.components, void 0);
- c.options.__file = "pages/product/list.vue", t.default = c.exports;
- },
- 260: function(e, t, n) {
- n.r(t);
- var o = n(261);
- n.d(t, "render", function() {
- return o.render;
- }), n.d(t, "staticRenderFns", function() {
- return o.staticRenderFns;
- }), n.d(t, "recyclableRender", function() {
- return o.recyclableRender;
- }), n.d(t, "components", function() {
- return o.components;
- });
- },
- 261: function(e, t, n) {
- var o;
- n.r(t), n.d(t, "render", function() {
- return r;
- }), n.d(t, "staticRenderFns", function() {
- return i;
- }), n.d(t, "recyclableRender", function() {
- return a;
- }), n.d(t, "components", function() {
- return o;
- });
- try {
- o = {
- uniLoadMore: function() {
- return n.e("components/uni-load-more/uni-load-more").then(n.bind(null, 413));
- }
- };
- } catch (e) {
- if (-1 === e.message.indexOf("Cannot find module") || -1 === e.message.indexOf(".vue")) throw e;
- console.error(e.message), console.error("1. 排查组件名称拼写是否正确"), console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),
- console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件");
- }
- var r = function() {
- var e = this;
- e.$createElement;
- e._self._c;
- }, a = !1, i = [];
- r._withStripped = !0;
- },
- 262: function(e, t, n) {
- n.r(t);
- var o = n(263), r = n.n(o);
- for (var a in o) "default" !== a && function(e) {
- n.d(t, e, function() {
- return o[e];
- });
- }(a);
- t.default = r.a;
- },
- 263: function(e, t, n) {
- (function(e) {
- function o(e, t, n, o, r, a, i) {
- try {
- var c = e[a](i), d = c.value;
- } catch (e) {
- return void n(e);
- }
- c.done ? t(d) : Promise.resolve(d).then(o, r);
- }
- function r(e) {
- return function() {
- var t = this, n = arguments;
- return new Promise(function(r, a) {
- function i(e) {
- o(d, r, a, i, c, "next", e);
- }
- function c(e) {
- o(d, r, a, i, c, "throw", e);
- }
- var d = e.apply(t, n);
- i(void 0);
- });
- };
- }
- Object.defineProperty(t, "__esModule", {
- value: !0
- }), t.default = void 0;
- var a = function(e) {
- return e && e.__esModule ? e : {
- default: e
- };
- }(n(23)), i = n(28), c = {
- components: {
- uniLoadMore: function() {
- n.e("components/uni-load-more/uni-load-more").then(function() {
- return resolve(n(413));
- }.bind(null, n)).catch(n.oe);
- }
- },
- data: function() {
- return {
- cateMaskState: 0,
- headerPosition: "fixed",
- headerTop: "0px",
- loadingType: "more",
- filterIndex: 0,
- numberOrder: 0,
- limit: 6,
- page: 0,
- cateId: 0,
- priceOrder: 0,
- cateList: [],
- goodsList: []
- };
- },
- onLoad: function(e) {
- this.cateId = e.tid, this.loadCateList(e.fid, e.sid), this.loadData();
- },
- onPageScroll: function(e) {
- e.scrollTop >= 0 ? this.headerPosition = "fixed" : this.headerPosition = "absolute";
- },
- onPullDownRefresh: function() {
- this.loadData("refresh");
- },
- onReachBottom: function() {
- this.loadData();
- },
- methods: {
- loadCateList: function(e, t) {
- var n = this;
- return r(a.default.mark(function t() {
- var o;
- return a.default.wrap(function(t) {
- for (;;) switch (t.prev = t.next) {
- case 0:
- o = n, (0, i.getCategoryList)({}).then(function(t) {
- console.log(t), t.data.forEach(function(t) {
- t.id != e || (o.cateList = t.children);
- }), console.log(o.cateList);
- });
- case 2:
- case "end":
- return t.stop();
- }
- }, t);
- }))();
- },
- loadData: function() {
- var t = arguments, n = this;
- return r(a.default.mark(function o() {
- var r, c, d, s;
- return a.default.wrap(function(o) {
- for (;;) switch (o.prev = o.next) {
- case 0:
- if (r = t.length > 0 && void 0 !== t[0] ? t[0] : "add", c = t.length > 1 ? t[1] : void 0,
- d = n, s = {
- page: d.page,
- limit: d.limit,
- sid: d.cateId
- }, "add" !== r) {
- o.next = 10;
- break;
- }
- if ("nomore" !== d.loadingType) {
- o.next = 7;
- break;
- }
- return o.abrupt("return");
- case 7:
- d.loadingType = "loading", o.next = 11;
- break;
- case 10:
- d.loadingType = "more";
- case 11:
- "refresh" === r && (d.goodsList = [], d.page = 1), 1 == n.filterIndex && (console.log(d.salesOrder),
- s.salesOrder = 1 == d.numberOrder ? "asc" : "desc"), 2 == n.filterIndex && (console.log(d.priceOrder),
- s.priceOrder = 1 == d.priceOrder ? "asc" : "desc"), (0, i.getProducts)(s).then(function(t) {
- console.log(t.data), d.goodsList = d.goodsList.concat(t.data), d.limit == t.data.length ? (d.page++,
- d.loadingType = "more") : d.loadingType = "nomore", "refresh" === r && (1 == c ? e.hideLoading() : e.stopPullDownRefresh());
- });
- case 15:
- case "end":
- return o.stop();
- }
- }, o);
- }))();
- },
- tabClick: function(t) {
- 0 === this.filterIndex && this.filterIndex === t || (this.filterIndex = t, 1 === t && (this.numberOrder = 1 === this.numberOrder ? 2 : 1),
- 2 === t && (this.priceOrder = 1 === this.priceOrder ? 2 : 1), this.page = 1, e.pageScrollTo({
- duration: 300,
- scrollTop: 0
- }), this.loadData("refresh", 1), e.showLoading({
- title: "正在加载"
- }));
- },
- toggleCateMask: function(e) {
- var t = this, n = "show" === e ? 10 : 300, o = "show" === e ? 1 : 0;
- this.cateMaskState = 2, setTimeout(function() {
- t.cateMaskState = o;
- }, n);
- },
- changeCate: function(t) {
- this.cateId = t.id, this.toggleCateMask(), e.pageScrollTo({
- duration: 300,
- scrollTop: 0
- }), this.page = 1, this.loadData("refresh", 1), e.showLoading({
- title: "正在加载"
- });
- },
- navToDetailPage: function(t) {
- var n = t.id;
- e.navigateTo({
- url: "/pages/product/product?id=".concat(n)
- });
- },
- stopPrevent: function() {}
- }
- };
- t.default = c;
- }).call(this, n(1).default);
- },
- 264: function(e, t, n) {
- n.r(t);
- var o = n(265), r = n.n(o);
- for (var a in o) "default" !== a && function(e) {
- n.d(t, e, function() {
- return o[e];
- });
- }(a);
- t.default = r.a;
- },
- 265: function(e, t, n) {}
- }, [ [ 258, "common/runtime", "common/vendor" ] ] ]);
|