1 line
11 KiB
Plaintext
1 line
11 KiB
Plaintext
{"version":3,"sources":["webpack:///D:/Lee/leave-unused/components/goods-cate/goods-cate.vue?b799","webpack:///D:/Lee/leave-unused/components/goods-cate/goods-cate.vue?216d","webpack:///D:/Lee/leave-unused/components/goods-cate/goods-cate.vue?1e43","webpack:///D:/Lee/leave-unused/components/goods-cate/goods-cate.vue?d6aa","uni-app:///components/goods-cate/goods-cate.vue","webpack:///D:/Lee/leave-unused/components/goods-cate/goods-cate.vue?9cf4","webpack:///D:/Lee/leave-unused/components/goods-cate/goods-cate.vue?f5d0"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmI;AACnI;AAC8D;AACL;AACqC;;;AAG9F;AAC6K;AAC7K,gBAAgB,uLAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,iGAAM;AACR,EAAE,0GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,qGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAypB,CAAgB,sqBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;ACe7qB;AACA,oBADA;AAEA,MAFA,kBAEA;AACA;AACA,kBADA,EACA;AACA,sBAFA;AAGA,mBAHA;AAIA,uBAJA;;AAMA,GATA;AAUA,SAVA,qBAUA;AACA;AACA;AACA,GAbA;AAcA;AACA;AACA,eAFA,yBAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBADA;AAEA,8BAFA;;AAIA;AACA,WANA;AAOA;AACA;AACA,OAbA;AAcA,KAjBA;;AAmBA;AACA,gBApBA,wBAoBA,KApBA,EAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAFA,MAEA;AACA;AACA;AACA;AACA,KAhCA;;AAkCA;AACA,cAnCA,wBAmCA;AACA;AACA;AACA;AACA;AACA;AACA,OALA;AAMA,KA1CA;;AA4CA;AACA,WA7CA,qBA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAJA;AAKA,OAPA;AAQA,KAvDA;;AAyDA;AACA,kBA1DA,0BA0DA,EA1DA,EA0DA,QA1DA,EA0DA;AACA;AACA;AACA,OAFA;AAGA,KA9DA;;AAgEA;AACA,UAjEA,kBAiEA,CAjEA,EAiEA;AACA;AACA,KAnEA,EAdA,E;;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;AAAw9B,CAAgB,u8BAAG,EAAC,C;;;;;;;;;;;ACA5+B;AACA,OAAO,KAAU,EAAE,kBAKd","file":"components/goods-cate/goods-cate.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./goods-cate.vue?vue&type=template&id=7cd8d804&scoped=true&\"\nvar renderjs\nimport script from \"./goods-cate.vue?vue&type=script&lang=js&\"\nexport * from \"./goods-cate.vue?vue&type=script&lang=js&\"\nimport style0 from \"./goods-cate.vue?vue&type=style&index=0&id=7cd8d804&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7cd8d804\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/goods-cate/goods-cate.vue\"\nexport default component.exports","export * from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./goods-cate.vue?vue&type=template&id=7cd8d804&scoped=true&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./goods-cate.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./goods-cate.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"goods-cate\">\r\n\t\t<scroll-view scroll-x=\"true\" :scroll-left=\"tabsScrollLeft\" @scroll=\"scroll\">\r\n\t\t\t<view class=\"cate-list flex\" id=\"tab_list\">\r\n\t\t\t\t<view class=\"cate-item background-white radius10\" :class=\"currentIndex==-1?'background-blue color-ff':''\" id=\"tab_item\" @tap=\"changeCateEv(-1)\">\r\n\t\t\t\t\t<view class=\"txt font24\">全部</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"cate-item background-white radius10\" :class=\"index==currentIndex?'background-blue color-ff':''\" id=\"tab_item\" v-for=\"(item,index) in cateList\" :key=\"index\" @tap=\"changeCateEv(index)\">\r\n\t\t\t\t\t<view class=\"txt font24\">{{item.name}}</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</scroll-view>\r\n\t</view>\r\n</template>\r\n<script>\r\n export default {\r\n name:'goods-list',\r\n data() {\r\n return {\r\n\t\t\t\tcateList:[], //分类列表\r\n\t\t\t\tcurrentIndex:-1,\r\n\t\t\t\tscrollLeft:0, \r\n\t\t\t\ttabsScrollLeft:0,\r\n };\r\n },\r\n\t\tmounted() {\r\n\t\t\t// 查询分类\r\n\t\t\tthis.getCateList();\r\n\t\t},\r\n methods:{\r\n\t\t\t// 查询分类\r\n\t\t\tgetCateList(){\r\n\t\t\t\tthis.$requst.get('/api/v1/goods/category').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'物品分类列表')\r\n\t\t\t\t\t\tlet cateArr = [];\r\n\t\t\t\t\t\tres.data.forEach(item=>{\r\n\t\t\t\t\t\t\tlet obj = {\r\n\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\tname:item.title\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcateArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.cateList = cateArr;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 分类选择事件\r\n\t\t\tchangeCateEv(index) {\r\n\t\t\t\tif(index !== this.currentIndex){\r\n\t\t\t\t\tthis.currentIndex = index;\r\n\t\t\t\t\t// 传值\r\n\t\t\t\t\tthis.$emit('changeCateEv',index==-1?0:this.cateList[index].id);\r\n\t\t\t\t\t// 分类切换效果\r\n\t\t\t\t\tif(index!==-1){\r\n\t\t\t\t\t\tthis.setTabList();\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.tabsScrollLeft = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 分类切换效果\r\n\t\t\tsetTabList() {\r\n\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\tif (this.cateList.length > 0) {\r\n\t\t\t\t\t\t//计算左滑距离\r\n\t\t\t\t\t\tthis.setLeft()\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//计算左滑距离\r\n\t\t\tsetLeft() {\r\n\t\t\t\tlet lineLeft = 0;\r\n\t\t\t\tthis.getElementData('#tab_list', (data) => {\r\n\t\t\t\t\tlet list = data[0];\r\n\t\t\t\t\tthis.getElementData('#tab_item', (res) => {\r\n\t\t\t\t\t\tlet el = res[this.currentIndex]\r\n\t\t\t\t\t\tlineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft\r\n\t\t\t\t\t\tthis.tabsScrollLeft = this.scrollLeft + lineLeft\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取DOM距离\r\n\t\t\tgetElementData(el, callback) {\r\n\t\t\t\tuni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {\r\n\t\t\t\t\tcallback(data[0]);\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 滚动\r\n\t\t\tscroll(e) {\r\n\t\t\t\tthis.scrollLeft = e.detail.scrollLeft;\r\n\t\t\t}\r\n }\r\n }\r\n</script>\r\n\r\n<style scoped>\r\n\t/* 分类列表 */\r\n\t.goods-cate{\r\n\t\tpadding: 20rpx 20rpx 0;\r\n\t\tmargin: 0 auto;\r\n\t\toverflow: hidden;\r\n\t}\r\n\t.cate-list .cate-item{\r\n\t\tmargin: 0 6rpx;\r\n\t\tpadding: 10rpx 25rpx;\r\n\t\twhite-space: nowrap;\r\n\t}\r\n\t.cate-list .cate-item:first-child{\r\n\t\tmargin-left: 0;\r\n\t}\r\n\t.cate-list .cate-item:last-child{\r\n\t\tmargin-right: 0;\r\n\t}\r\n\t.cate-list .cate-item>.img{\r\n\t\twidth: 100rpx;\r\n\t\theight: 100rpx;\r\n\t}\r\n\t.cate-list .cate-item>.img image{\r\n\t\twidth: 100%;\r\n\t\tmin-height: 100%;\r\n\t}\r\n\t.cate-list .cate-item>.txt{\r\n\t\tline-height: 1.5;\r\n\t\ttext-align: center;\r\n\t}\r\n</style>\r\n","import mod from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./goods-cate.vue?vue&type=style&index=0&id=7cd8d804&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./goods-cate.vue?vue&type=style&index=0&id=7cd8d804&scoped=true&lang=css&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1670398615530\n var cssReload = require(\"D:/HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""} |