123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/product/listSearch" ], {
- 266: function(e, n, t) {
- (function(e) {
- function n(e) {
- return e && e.__esModule ? e : {
- default: e
- };
- }
- t(4), n(t(2)), e(n(t(267)).default);
- }).call(this, t(1).createPage);
- },
- 267: function(e, n, t) {
- t.r(n);
- var o = t(268), r = t(270);
- for (var a in r) "default" !== a && function(e) {
- t.d(n, e, function() {
- return r[e];
- });
- }(a);
- t(273);
- var i = t(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/listSearch.vue", n.default = c.exports;
- },
- 268: function(e, n, t) {
- t.r(n);
- var o = t(269);
- t.d(n, "render", function() {
- return o.render;
- }), t.d(n, "staticRenderFns", function() {
- return o.staticRenderFns;
- }), t.d(n, "recyclableRender", function() {
- return o.recyclableRender;
- }), t.d(n, "components", function() {
- return o.components;
- });
- },
- 269: function(e, n, t) {
- var o;
- t.r(n), t.d(n, "render", function() {
- return r;
- }), t.d(n, "staticRenderFns", function() {
- return i;
- }), t.d(n, "recyclableRender", function() {
- return a;
- }), t.d(n, "components", function() {
- return o;
- });
- try {
- o = {
- uniLoadMore: function() {
- return t.e("components/uni-load-more/uni-load-more").then(t.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;
- },
- 270: function(e, n, t) {
- t.r(n);
- var o = t(271), r = t.n(o);
- for (var a in o) "default" !== a && function(e) {
- t.d(n, e, function() {
- return o[e];
- });
- }(a);
- n.default = r.a;
- },
- 271: function(e, n, t) {
- (function(e) {
- function o(e, n, t, o, r, a, i) {
- try {
- var c = e[a](i), d = c.value;
- } catch (e) {
- return void t(e);
- }
- c.done ? n(d) : Promise.resolve(d).then(o, r);
- }
- function r(e) {
- return function() {
- var n = this, t = 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(n, t);
- i(void 0);
- });
- };
- }
- Object.defineProperty(n, "__esModule", {
- value: !0
- }), n.default = void 0;
- var a = function(e) {
- return e && e.__esModule ? e : {
- default: e
- };
- }(t(23)), i = t(28), c = t(272), d = {
- components: {
- uniLoadMore: function() {
- t.e("components/uni-load-more/uni-load-more").then(function() {
- return resolve(t(413));
- }.bind(null, t)).catch(t.oe);
- }
- },
- data: function() {
- return {
- cateMaskState: 0,
- headerPosition: "fixed",
- headerTop: "0px",
- loadingType: "more",
- filterIndex: 0,
- numberOrder: 0,
- limit: 6,
- page: 1,
- 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() {
- console.log("下拉刷新"), this.loadData("refresh");
- },
- onReachBottom: function() {
- this.loadData();
- },
- methods: {
- loadCateList: function(e, n) {
- var t = this;
- return r(a.default.mark(function n() {
- var o;
- return a.default.wrap(function(n) {
- for (;;) switch (n.prev = n.next) {
- case 0:
- o = t, (0, c.getList)({}).then(function(n) {
- console.log(n), n.data.forEach(function(n) {
- n.id != e || (o.cateList = n.children);
- }), console.log(o.cateList);
- });
- case 2:
- case "end":
- return n.stop();
- }
- }, n);
- }))();
- },
- loadData: function() {
- var n = arguments, t = 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 = n.length > 0 && void 0 !== n[0] ? n[0] : "add", c = n.length > 1 ? n[1] : void 0,
- d = t, 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:
- 1 == t.filterIndex && (console.log(d.salesOrder), s.salesOrder = 1 == d.numberOrder ? "asc" : "desc"),
- 2 == t.filterIndex && (console.log(d.priceOrder), s.priceOrder = 1 == d.priceOrder ? "asc" : "desc"),
- (0, i.getProducts)(s).then(function(n) {
- "refresh" === r && (console.log("jinru"), d.goodsList = []), console.log(n.data),
- d.goodsList = d.goodsList.concat(n.data), d.limit == n.data.length ? (d.page++,
- d.loadingType = "more") : d.loadingType = "nomore", "refresh" === r && (1 == c ? e.hideLoading() : e.stopPullDownRefresh());
- });
- case 14:
- case "end":
- return o.stop();
- }
- }, o);
- }))();
- },
- tabClick: function(n) {
- 0 === this.filterIndex && this.filterIndex === n || (this.filterIndex = n, 1 === n && (this.numberOrder = 1 === this.numberOrder ? 2 : 1),
- 2 === n && (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 n = this, t = "show" === e ? 10 : 300, o = "show" === e ? 1 : 0;
- this.cateMaskState = 2, setTimeout(function() {
- n.cateMaskState = o;
- }, t);
- },
- changeCate: function(n) {
- this.cateId = n.id, this.toggleCateMask(), e.pageScrollTo({
- duration: 300,
- scrollTop: 0
- }), this.loadData("refresh", 1), e.showLoading({
- title: "正在加载"
- });
- },
- navToDetailPage: function(n) {
- var t = n.id;
- e.navigateTo({
- url: "/pages/product/product?id=".concat(t)
- });
- },
- stopPrevent: function() {}
- }
- };
- n.default = d;
- }).call(this, t(1).default);
- },
- 273: function(e, n, t) {
- t.r(n);
- var o = t(274), r = t.n(o);
- for (var a in o) "default" !== a && function(e) {
- t.d(n, e, function() {
- return o[e];
- });
- }(a);
- n.default = r.a;
- },
- 274: function(e, n, t) {}
- }, [ [ 266, "common/runtime", "common/vendor" ] ] ]);
|