123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860 |
- ;(function () {
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
- try {
- var info = gen[key](arg)
- var value = info.value
- } catch (error) {
- reject(error)
- return
- }
- if (info.done) {
- resolve(value)
- } else {
- Promise.resolve(value).then(_next, _throw)
- }
- }
- function _asyncToGenerator(fn) {
- return function () {
- var self = this,
- args = arguments
- return new Promise(function (resolve, reject) {
- var gen = fn.apply(self, args)
- function _next(value) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value)
- }
- function _throw(err) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err)
- }
- _next(undefined)
- })
- }
- }
- var __vite_style__ = document.createElement('style')
- __vite_style__.innerHTML =
- '._filter-top_1vale_1{height:.98667rem;font-size:.37333rem;color:#666;transition:color cubic-bezier(.075,.82,.165,1);background:#ffffff}._filter-top_1vale_1 .van-col{display:flex;align-items:center;justify-content:center}._filter-top_1vale_1 ._active_1vale_13{color:#333;font-weight:500}._filter-top_1vale_1 ._filterBtn_1vale_17{color:#333}._filterTagWrap_1vale_20{display:flex;padding:.16rem 0 0 .37333rem;flex-wrap:wrap}._filterTagWrap_1vale_20 ._filterTag_1vale_20{border:.02667rem solid var(--van-primary-color)!important;color:var(--van-primary-color)!important;border-radius:.32rem;font-size:.32rem;background-color:#f7f8f9;padding:.10667rem .26667rem;margin-right:.21333rem;margin-bottom:.21333rem;font-weight:500}._filter-productCategory_1vale_36{font-size:.37333rem;color:#666}._filter-productCategory_1vale_36 .van-tab{padding:0}._filter-productCategory_1vale_36 .van-tabs__line{display:none!important}._filter-productCategory_1vale_36 .van-col{height:.98667rem;display:flex;align-items:center;justify-content:center}._filter-productCategory_1vale_36 ._filter-tag_1vale_52{padding:.13333rem .26667rem;height:80%;border-radius:.53333rem;display:flex;justify-content:center;align-items:center;margin:0 .13333rem;min-width:1.33333rem}._filter-productCategory_1vale_36 ._filter-tag-checked_1vale_62{background:var(--van-primary);color:#fff}._filterSort_1vale_66{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-left:.13333rem}._filterSort_1vale_66 ._icon-active_1vale_73{color:#01C1B5}._filterSort_1vale_66 ._iconSort_1vale_76{margin-top:-.13333rem;margin-left:-.02667rem}._loading_1wy15_1{height:.8rem;display:flex;justify-content:center;align-items:center}._titlePopup_1wy15_7{padding:.48rem;text-align:center;color:#000;font-weight:500;font-size:.48rem}._title_1wy15_7{color:#333;font-size:.37333rem;line-height:.53333rem;padding-left:.42667rem;font-weight:500}._radio-group_1wy15_21{display:flex;flex-wrap:wrap;margin-top:.37333rem}._radio_1wy15_21{margin-right:.26667rem;margin-bottom:.21333rem}._radio_1wy15_21 .van-radio__icon{display:none}._radio_1wy15_21 .van-tag{box-sizing:border-box;font-size:.37333rem;display:flex;align-items:center;justify-content:center;border-radius:.42667rem;padding:.16rem .32rem;border:.02667rem solid transparent;height:.85333rem;line-height:.85333rem;min-width:2.13333rem}._radio_1wy15_21 .van-tag--default{color:#999}._radio_1wy15_21 .van-tag--primary{background-color:#f7f8f9;border:.02667rem solid var(--van-primary);color:var(--van-primary)}._radio_1wy15_21 .van-radio__label{margin-left:0}._filterAction_1wy15_57{padding:.29333rem .42667rem;display:flex;align-items:center}._filterAction_1wy15_57 .van-button{flex:1;height:1.12rem;line-height:1.12rem}\n'
- document.head.appendChild(__vite_style__)
- System.register(
- [
- './vendor-legacy.09f20d09.js',
- './index-legacy.637f35563.js',
- './index-legacy.f25f109a10.js',
- './index-legacy.f25f109a3.js',
- './index-legacy.637f3556.js',
- './index-legacy.637f35562.js',
- './index-legacy.7eb04225.js',
- './index-legacy.f72eae88.js',
- './index-legacy.595c24c3.js',
- './index-legacy.f25f109a.js',
- './index-legacy.637f35565.js',
- './index-legacy.f25f109a14.js',
- './index-legacy.f25f109a17.js',
- './index-legacy.f25f109a6.js',
- './index-legacy.b67c6e0d.js',
- './index-legacy.f25f109a2.js',
- './index-legacy.f25f109a12.js',
- './icon-sell-out-legacy.ae9d997a.js',
- './shop-mall-legacy.42d570fe.js',
- './index-legacy.f25f109a5.js'
- ],
- function (exports) {
- 'use strict'
- var defineComponent,
- createVNode,
- Loading,
- createTextVNode,
- Cell,
- RadioGroup,
- Radio,
- Tag,
- isVNode,
- Divider,
- Button,
- Sticky,
- Row,
- Col,
- Icon,
- Tabs,
- Tab,
- Popup,
- TabList,
- ColSearch,
- iconFilter,
- request
- return {
- setters: [
- function (module) {
- defineComponent = module.d
- createVNode = module.a
- Loading = module.L
- createTextVNode = module.j
- Cell = module.C
- RadioGroup = module.ac
- Radio = module.ad
- Tag = module.U
- isVNode = module.x
- Divider = module.aw
- Button = module.B
- Sticky = module.S
- Row = module.z
- Col = module.A
- Icon = module.K
- Tabs = module.v
- Tab = module.w
- Popup = module.P
- },
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function (module) {
- TabList = module.T
- },
- function (module) {
- ColSearch = module.C
- iconFilter = module.i
- },
- function (module) {
- request = module.r
- },
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {}
- ],
- execute: function execute() {
- var active = '_active_1vale_13'
- var filterBtn = '_filterBtn_1vale_17'
- var filterTagWrap = '_filterTagWrap_1vale_20'
- var filterTag = '_filterTag_1vale_20'
- var filterSort = '_filterSort_1vale_66'
- var iconSort = '_iconSort_1vale_76'
- var styles$1 = {
- 'filter-top': '_filter-top_1vale_1',
- active: active,
- filterBtn: filterBtn,
- filterTagWrap: filterTagWrap,
- filterTag: filterTag,
- 'filter-productCategory': '_filter-productCategory_1vale_36',
- 'filter-tag': '_filter-tag_1vale_52',
- 'filter-tag-checked': '_filter-tag-checked_1vale_62',
- filterSort: filterSort,
- 'icon-active': '_icon-active_1vale_73',
- iconSort: iconSort
- }
- var loading = '_loading_1wy15_1'
- var titlePopup = '_titlePopup_1wy15_7'
- var title = '_title_1wy15_7'
- var radio = '_radio_1wy15_21'
- var filterAction = '_filterAction_1wy15_57'
- var styles = {
- loading: loading,
- titlePopup: titlePopup,
- title: title,
- 'radio-group': '_radio-group_1wy15_21',
- radio: radio,
- filterAction: filterAction
- }
- function _isSlot(s) {
- return (
- typeof s === 'function' ||
- (Object.prototype.toString.call(s) === '[object Object]' &&
- !isVNode(s))
- )
- }
- var init = function init() {
- return {
- productCategorySmallVoList: null,
- productAttributeCategoryList: null,
- brandList: null
- }
- }
- var GoodsFilterList = defineComponent({
- name: 'goods-filter-list',
- props: {
- setFilter: {
- type: Function,
- default: function _default(item) {}
- },
- cateGoryId: { type: Number, default: 0 }
- },
- data: function data() {
- return {
- dataShow: true, // 判断是否有数据
- loading: false,
- brandList: [],
- productAttributeCategoryList: [],
- productCategorySmallVoList: [],
- params: init()
- }
- },
- mounted: function mounted() {
- this.getFilterList()
- },
- methods: {
- getFilterList: function getFilterList() {
- var _this = this
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
- var res,
- _ref,
- _ref$brandList,
- brandList,
- _ref$productAttribute,
- productAttributeCategoryList,
- _ref$productCategoryS,
- productCategorySmallVoList,
- i
- return regeneratorRuntime.wrap(
- function _callee$(_context) {
- while (1) {
- switch ((_context.prev = _context.next)) {
- case 0:
- _this.loading = true
- _context.prev = 1
- _context.next = 4
- return request.get(
- '/api-mall-portal/product/search/condition'
- )
- case 4:
- res = _context.sent
- _this.dataShow = res.code === 200
- ;(_ref = res.data || {}),
- (_ref$brandList = _ref.brandList),
- (brandList =
- _ref$brandList === void 0
- ? []
- : _ref$brandList),
- (_ref$productAttribute =
- _ref.productAttributeCategoryList),
- (productAttributeCategoryList =
- _ref$productAttribute === void 0
- ? []
- : _ref$productAttribute),
- (_ref$productCategoryS =
- _ref.productCategorySmallVoList),
- (productCategorySmallVoList =
- _ref$productCategoryS === void 0
- ? []
- : _ref$productCategoryS)
- _this.brandList = brandList
- _this.productAttributeCategoryList =
- productAttributeCategoryList
- _this.productCategorySmallVoList =
- productCategorySmallVoList
- if (_this.cateGoryId) {
- i = productCategorySmallVoList.findIndex(
- function (n) {
- return n.id == _this.cateGoryId
- }
- )
- _this.params.productCategorySmallVoList =
- i > -1 ? i : null
- }
- _context.next = 16
- break
- case 13:
- _context.prev = 13
- _context.t0 = _context['catch'](1)
- _this.dataShow = false
- case 16:
- _this.loading = false
- case 17:
- case 'end':
- return _context.stop()
- }
- }
- },
- _callee,
- null,
- [[1, 13]]
- )
- })
- )()
- }, // 筛选条件
- onFilterClick: function onFilterClick() {
- this.setFilter({
- productCategory:
- this.productCategorySmallVoList[
- this.params.productCategorySmallVoList
- ],
- productAttributeCategory:
- this.productAttributeCategoryList[
- this.params.productAttributeCategoryList
- ],
- brand: this.brandList[this.params.brandList]
- })
- },
- setParams: function setParams(key) {
- this.params[key] = null
- }
- },
- render: function render() {
- var _this2 = this
- return createVNode('div', null, [
- this.loading &&
- createVNode('div', { class: styles.loading }, [
- createVNode(Loading, { color: 'var(--van-primary)' }, null)
- ]),
- createVNode('div', { class: styles.filterWrap }, [
- createVNode('div', { class: styles.titlePopup }, [
- createTextVNode('\u7B5B\u9009')
- ]),
- Object.keys(this.params).map(function (key) {
- return createVNode(
- Cell,
- { border: false },
- {
- title: function title() {
- return createVNode('div', null, [
- key === 'productCategorySmallVoList'
- ? '商品分类'
- : key === 'productAttributeCategoryList'
- ? '商品类型'
- : '品牌'
- ])
- },
- label: function label() {
- var _slot
- return createVNode(
- RadioGroup,
- {
- class: styles['radio-group'],
- modelValue: _this2.params[key],
- 'onUpdate:modelValue':
- function onUpdateModelValue(val) {
- return (_this2.params[key] = val)
- }
- },
- _isSlot(
- (_slot = _this2[key].map(function (item, index) {
- var isActive = index === _this2.params[key]
- var type = isActive ? 'primary' : 'default'
- return createVNode(
- Radio,
- {
- class: styles.radio,
- name: index,
- onClick: function onClick() {}
- },
- {
- default: function _default() {
- return [
- createVNode(
- Tag,
- { size: 'large', type: type },
- {
- default: function _default() {
- return [item.name]
- }
- }
- )
- ]
- }
- }
- )
- }))
- )
- ? _slot
- : {
- default: function _default() {
- return [_slot]
- }
- }
- )
- }
- }
- )
- }),
- createVNode(Divider, { style: { margin: '0' } }, null),
- createVNode('div', { class: styles.filterAction }, [
- createVNode(
- Button,
- {
- round: true,
- style: { marginRight: '8px' },
- onClick: function onClick() {
- return (_this2.params = init())
- }
- },
- {
- default: function _default() {
- return [createTextVNode('\u91CD\u7F6E')]
- }
- }
- ),
- createVNode(
- Button,
- {
- round: true,
- type: 'primary',
- style: { marginLeft: '8px' },
- onClick: function onClick() {
- return _this2.onFilterClick()
- }
- },
- {
- default: function _default() {
- return [createTextVNode('\u786E\u8BA4')]
- }
- }
- )
- ])
- ])
- ])
- }
- })
- var index = exports(
- 'default',
- defineComponent({
- name: 'goods-list',
- data: function data() {
- var query = this.$route.query
- return {
- tabListShow: query.id ? false : true,
- typeId: 0,
- filterActive: 0,
- filterListShow: false,
- productCategory: {
- active: 0,
- name: query.tag || '',
- id: Number(query.id) || 0,
- children: []
- },
- productAttributeCategory: { children: [], name: '', id: 0 },
- brand: { name: '', id: 0 },
- keyword: '',
- autofocus: false
- }
- },
- computed: {
- getProductAttributeCategory:
- function getProductAttributeCategory() {
- if (this.productCategory.id) {
- if (this.productCategory.children) {
- var child =
- this.productCategory.children[
- this.productCategory.active
- ] || {}
- return child.id || ''
- }
- this.productCategory.id
- }
- return 0
- }
- },
- mounted: function mounted() {
- var _this3 = this
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() {
- var res
- return regeneratorRuntime.wrap(
- function _callee2$(_context2) {
- while (1) {
- switch ((_context2.prev = _context2.next)) {
- case 0:
- _this3.$nextTick(function () {
- if (_this3.$route.query.input === 'focus') {
- var input = document.querySelector(
- '.van-field__control'
- )
- input.focus()
- }
- })
- if (!_this3.productCategory.id) {
- _context2.next = 11
- break
- }
- _context2.prev = 2
- _context2.next = 5
- return request.get(
- '/api-mall-portal/product/search/condition'
- )
- case 5:
- res = _context2.sent
- if (res.code === 200) {
- _this3.setFilter({
- productCategory:
- res.data.productCategorySmallVoList.find(
- function (n) {
- return (
- n.id === _this3.productCategory.id
- )
- }
- ),
- productAttributeCategory: undefined,
- brand: undefined
- })
- }
- _context2.next = 11
- break
- case 9:
- _context2.prev = 9
- _context2.t0 = _context2['catch'](2)
- case 11:
- _this3.tabListShow = true
- case 12:
- case 'end':
- return _context2.stop()
- }
- }
- },
- _callee2,
- null,
- [[2, 9]]
- )
- })
- )()
- },
- methods: {
- onFilter: function onFilter(n) {
- var _this4 = this
- if (this.filterActive === 3 && n === 3) n = 4
- if (this.filterActive === 4 && n === 3) n = 3
- if (this.filterActive === n) return
- this.filterActive = n
- this.$nextTick(function () {
- _this4.onSearch()
- })
- },
- setFilter: function setFilter(_ref2) {
- var _this5 = this
- var productCategory = _ref2.productCategory,
- productAttributeCategory = _ref2.productAttributeCategory,
- brand = _ref2.brand // console.log(productCategory.active)
- if (productCategory && productCategory.active === undefined) {
- productCategory.active = 0
- }
- this.productCategory = productCategory
- ? productCategory
- : { id: 0, name: '' }
- this.productAttributeCategory = productAttributeCategory
- ? productAttributeCategory
- : { id: 0, name: '' }
- this.brand = brand ? brand : { id: 0, name: '' }
- this.$nextTick(function () {
- _this5.onSearch()
- _this5.filterListShow = false
- })
- },
- onToggleTag: function onToggleTag() {
- var _this6 = this
- var tabList = this.$refs.tabList
- if (tabList.loading) return // this.productCategory.active = i
- this.$nextTick(function () {
- _this6.onSearch()
- })
- },
- onClearTag: function onClearTag(key) {
- var _this7 = this
- this[key] = { id: 0, name: '' }
- var goodsFilter = this.$refs.goodsFilter
- if (goodsFilter) {
- if (key === 'productCategory') {
- goodsFilter.setParams('productCategorySmallVoList')
- } else if (key === 'productAttributeCategory') {
- goodsFilter.setParams('productAttributeCategoryList')
- } else {
- goodsFilter.setParams('brandList')
- }
- }
- this.$nextTick(function () {
- _this7.onSearch()
- })
- },
- onSearch: function onSearch() {
- var tabList = this.$refs.tabList
- tabList.onSearch()
- },
- searchBtn: function searchBtn(keyword) {
- var _this8 = this
- this.keyword = keyword
- console.log(this.keyword)
- this.$nextTick(function () {
- _this8.onSearch()
- })
- }
- },
- render: function render() {
- var _this9 = this
- return createVNode('div', null, [
- createVNode(Sticky, null, {
- default: function _default() {
- return [
- createVNode(
- ColSearch,
- {
- modelValue: _this9.keyword,
- onSearch: _this9.searchBtn
- },
- null
- ),
- createVNode(
- Row,
- { class: styles$1['filter-top'], align: 'center' },
- {
- default: function _default() {
- return [
- createVNode(
- Col,
- {
- span: 6,
- class:
- _this9.filterActive === 0
- ? styles$1.active
- : '',
- onClick: function onClick() {
- return _this9.onFilter(0)
- }
- },
- {
- default: function _default() {
- return [
- createTextVNode(
- '\u7EFC\u5408\u6392\u5E8F'
- )
- ]
- }
- }
- ),
- createVNode(
- Col,
- {
- span: 6,
- class:
- _this9.filterActive === 3 ||
- _this9.filterActive === 4
- ? styles$1.active
- : '',
- onClick: function onClick() {
- return _this9.onFilter(3)
- }
- },
- {
- default: function _default() {
- return [
- createTextVNode('\u4EF7\u683C'),
- createVNode(
- 'div',
- { class: styles$1.filterSort },
- [
- createVNode(
- Icon,
- {
- class:
- _this9.filterActive === 3
- ? styles$1['icon-active']
- : '',
- style: {
- transform: 'rotate(-90deg)'
- },
- name: 'play',
- size: 12
- },
- null
- ),
- createVNode(
- Icon,
- {
- class: [
- styles$1.iconSort,
- _this9.filterActive === 4
- ? [styles$1['icon-active']]
- : ''
- ],
- style: {
- transform: 'rotate(90deg)'
- },
- name: 'play',
- size: 12
- },
- null
- )
- ]
- )
- ]
- }
- }
- ),
- createVNode(
- Col,
- {
- style: { marginLeft: 'auto' },
- span: 6,
- class: styles$1.filterBtn,
- onClick: function onClick() {
- return (_this9.filterListShow = true)
- }
- },
- {
- default: function _default() {
- return [
- createTextVNode('\u7B5B\u9009'),
- createVNode(
- Icon,
- { name: iconFilter, size: 18 },
- null
- )
- ]
- }
- }
- )
- ]
- }
- }
- ),
- _this9.productCategory.id &&
- _this9.productCategory.children &&
- _this9.productCategory.children.length
- ? createVNode(
- Tabs,
- {
- class: styles$1['filter-productCategory'],
- shrink: true,
- ellipsis: false,
- active: _this9.productCategory.active,
- 'onUpdate:active': function onUpdateActive(
- $event
- ) {
- return (_this9.productCategory.active =
- $event)
- },
- onChange: function onChange() {
- return _this9.onToggleTag()
- }
- },
- {
- default: function _default() {
- return [
- _this9.productCategory &&
- _this9.productCategory.children.map(
- function (n, i) {
- return createVNode(
- Tab,
- { name: i, title: n.name },
- {
- title: function title() {
- return createVNode(
- 'div',
- {
- class: [
- styles$1['filter-tag'],
- _this9.productCategory
- .active === i
- ? styles$1[
- 'filter-tag-checked'
- ]
- : ''
- ]
- },
- [n.name]
- )
- }
- }
- )
- }
- )
- ]
- }
- }
- )
- : null
- ]
- }
- }),
- createVNode('div', { class: styles$1.filterTagWrap }, [
- this.productAttributeCategory.id
- ? createVNode(
- Tag,
- {
- class: styles$1.filterTag,
- closeable: true,
- onClose: function onClose() {
- return _this9.onClearTag(
- 'productAttributeCategory'
- )
- }
- },
- {
- default: function _default() {
- return [_this9.productAttributeCategory.name]
- }
- }
- )
- : '',
- this.brand.id
- ? createVNode(
- Tag,
- {
- class: styles$1.filterTag,
- closeable: true,
- onClose: function onClose() {
- return _this9.onClearTag('brand')
- }
- },
- {
- default: function _default() {
- return [_this9.brand.name]
- }
- }
- )
- : ''
- ]),
- this.tabListShow
- ? createVNode(
- TabList,
- {
- ref: 'tabList',
- typeId: Number(this.getProductAttributeCategory),
- productAttributeCategoryId:
- this.productAttributeCategory.id,
- brandId: this.brand.id,
- sort: this.filterActive,
- keyword: this.keyword
- },
- null
- )
- : null,
- createVNode(
- Popup,
- {
- show: this.filterListShow,
- closeable: true,
- position: 'bottom',
- round: true,
- onClose: function onClose() {
- _this9.filterListShow = false
- }
- },
- {
- default: function _default() {
- return [
- createVNode(
- GoodsFilterList,
- {
- cateGoryId: _this9.productCategory.id,
- ref: 'goodsFilter',
- setFilter: _this9.setFilter
- },
- null
- )
- ]
- }
- }
- )
- ])
- }
- })
- )
- }
- }
- }
- )
- })()
|