1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/cate/cate.vue?f826","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/cate/cate.vue?a0ff","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/cate/cate.vue?9845","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/cate/cate.vue?7831","uni-app:///pages/tabbar/cate/cate.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;;;AAGA;AACA,gG,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,aAAD,CAAV,C;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAAiH;AACjH;AACwD;AACL;;;AAGnD;AACuL;AACvL,gBAAgB,2LAAU;AAC1B,EAAE,0EAAM;AACR,EAAE,+EAAM;AACR,EAAE,wFAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,mFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,0PAEN;AACP,KAAK;AACL;AACA,aAAa,8OAEN;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAqsB,CAAgB,orBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwCztB;AACA,gD,4kEAAA;eACA;AACA;AACA,wBADA;A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;AACA;AACA;AACA;AACA,OAjBA;AAkBA,KAzEA;AA0EA;AACA,iBA3EA,yBA2EA,KA3EA,EA2EA;AACA;AACA;AACA,OAFA,MAEA;AACA;AACA;AACA,KAjFA;AAkFA;AACA,UAnFA,kBAmFA,EAnFA,EAmFA;AACA;AACA,iGADA;;AAGA,KAvFA,EA3CA,E","file":"pages/tabbar/cate/cate.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pages/tabbar/cate/cate.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./cate.vue?vue&type=template&id=70658717&\"\nvar renderjs\nimport script from \"./cate.vue?vue&type=script&lang=js&\"\nexport * from \"./cate.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../HBuilderX-app开发版/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 null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/tabbar/cate/cate.vue\"\nexport default component.exports","export * from \"-!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./cate.vue?vue&type=template&id=70658717&\"","var components\ntry {\n components = {\n enterCart: function() {\n return import(\n /* webpackChunkName: \"components/enter-cart/enter-cart\" */ \"@/components/enter-cart/enter-cart.vue\"\n )\n },\n footTab: function() {\n return import(\n /* webpackChunkName: \"components/foot-tab/foot-tab\" */ \"@/components/foot-tab/foot-tab.vue\"\n )\n }\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\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-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./cate.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./cate.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"pad-b150\">\r\n\t\t<status-nav :ifReturn=\"false\" navBarTitle=\"分类\" :marginBottom=\"0\"></status-nav>\r\n\t\t<!-- 选择厂家 -->\r\n\t\t<view class=\"pull-all-bg\" v-show=\"isShow\" @tap=\"closeMore\"></view>\r\n\t\t<view class=\"company-top\" v-if=\"businessId==0\"></view>\r\n\t\t<view class=\"company\" :style=\"{'top':topHieght+'px'}\" v-if=\"businessId==0\">\r\n\t\t\t<input type=\"text\" :value=\"companyList[companyIndex].name?'工厂选择:'+ companyList[companyIndex].name:''\" @tap=\"openMore\">\r\n\t\t\t<view class=\"company-list\" v-if=\"isShow\">\r\n\t\t\t\t<view @tap=\"checkValue(index,item.id)\" class=\"company-item\" :class=\"companyIndex == index?'cur':''\" v-for=\"(item,index) in companyList\">{{item.name}}</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 一级分类列表 -->\r\n\t\t<view class=\"cate-nav-bg\" :style=\"{'height':scrollHeight+'px','top':topHieght+'px'}\" :class=\"businessId==0?'':'to-top'\">\r\n\t\t\t<view class=\"cate-nav\">\r\n\t\t\t\t<view class=\"cate-nav-item\" :class=\"cateIndex == index?'active':''\" @tap=\"changeCate(index,item.id)\" v-for=\"(item,index) in cateList\" :key=\"index\">{{item.title}}</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 二级分类列表 -->\r\n\t\t<scroll-view class=\"shop-list-bg\" :class=\"businessId==0?'':'to-top'\">\r\n\t\t\t<view class=\"shop-list flex\">\r\n\t\t\t\t<view class=\"shop-item\" @tap=\"toShop(item.id)\" v-for=\"(item,index) in secondList\" :key=\"index\">\r\n\t\t\t\t\t<view class=\"img flex\"><image :src=\"item.cover\" mode=\"widthFix\"></image></view>\r\n\t\t\t\t\t<view class=\"txt clips1\">{{item.title}}</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"tips\" v-if=\"isTips\">---没有更多分类---</view>\r\n\t\t</scroll-view>\r\n\t\t<!-- 购物车btn -->\r\n\t\t<enter-cart></enter-cart>\r\n\t\t<!-- 底部tab -->\r\n\t\t<foot-tab current=\"1\"></foot-tab>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\timport statusNav from '@/components/status-navs/status-nav';\r\n\timport enterCart from '@/components/enter-cart/enter-cart.vue';\r\n\t// 底部组件\r\n\timport footTab from '@/components/foot-tab/foot-tab.vue';\r\n\timport {getCartNum} from '@/jsFile/public-api.js';\r\n\timport { mapState } from 'vuex'//引入mapState\r\n\texport default {\r\n\t\tcomponents:{\r\n\t\t\tstatusNav,\r\n\t\t\tenterCart,\r\n\t\t\tfootTab\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tscrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50,\r\n\t\t\t\tnewWidth:uni.getSystemInfoSync().windowWidth,\r\n\t\t\t\ttopHieght: uni.getSystemInfoSync().statusBarHeight + 50,\r\n\t\t\t\tcompanyList:[], //工厂列表\r\n\t\t\t\tcompanyIndex: 0, //当前厂家\r\n\t\t\t\tisShow: false, //显示弹窗\r\n\t\t\t\tcateList:[], //一级分类列表\r\n\t\t\t\tcateIndex:0,\r\n\t\t\t\tsecondList:[], //二级分类列表\r\n\t\t\t\ttotal:0,\r\n\t\t\t\tflag:true,\r\n\t\t\t\tifLoading:false,\r\n\t\t\t\tbusinessId:0, //分类id\r\n\t\t\t\tisTips:false, //是否提示\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed:{\r\n\t\t\t...mapState({\r\n\t\t\t\tfootHeight: state => state.moduleA.footHeight,\r\n\t\t\t}),\r\n\t\t},\r\n\t\tonLoad(op) {\r\n\t\t\tthis.getCompanyList(); //查询商户\r\n\t\t},\r\n\t\tonReachBottom(e) {\r\n\t\t\t\r\n\t\t},\r\n\t\t// 分享到微信\r\n\t\tonShareAppMessage() {\r\n\t\t\t\r\n\t\t},\r\n\t\t// 分享到朋友圈\r\n\t\tonShareTimeline(){\r\n\t\t\t\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 获取用户信息\r\n\t\t\tgetUserInfo(){\r\n\t\t\t\tuni.showLoading();\r\n\t\t\t\tthis.$requst.get('/api/user/info').then(res=>{\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tthis.businessId = res.data.business_id;\r\n\t\t\t\t\t\tthis.getCateList(res.data.business_id); //查询一级分类\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\topenMore(){\r\n\t\t\t\tif(!this.isShow){\r\n\t\t\t\t\tthis.isShow = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.isShow = false;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 关闭厂家选择\r\n\t\t\tcloseMore(){\r\n\t\t\t\tthis.isShow = false;\r\n\t\t\t},\r\n\t\t\t// 选择厂家\r\n\t\t\tcheckValue(index,id){\r\n\t\t\t\tthis.companyIndex = index;\r\n\t\t\t\tthis.getCateList(id); //查询一级分类\r\n\t\t\t\t// 关闭厂家选择\r\n\t\t\t\tthis.closeMore();\r\n\t\t\t},\r\n\t\t\t// 选择分类 \r\n\t\t\tchangeCate(index,id){\r\n\t\t\t\tthis.cateIndex = index;\r\n\t\t\t\t// 查询二级\r\n\t\t\t\tthis.isTips = false;\r\n\t\t\t\tthis.secondList=[];\r\n\t\t\t\tthis.getSecondList(this.cateIndex);\r\n\t\t\t},\r\n\t\t\t// 查询工厂列表\r\n\t\t\tgetCompanyList(){\r\n\t\t\t\tthis.$requst.get('/api/spu/business').then(res=>{\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tthis.companyList = res.data; //商户列表\r\n\t\t\t\t\t\t// 查询一级分类\r\n\t\t\t\t\t\tif(this.companyList.length>0){\r\n\t\t\t\t\t\t\tthis.getCateList(this.companyList[0].id);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.getCateList(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\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\tgetCateList(pid){\r\n\t\t\t\tthis.$requst.get('/api/spu/category',{business_id:pid}).then(res=>{\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tif(res.data.length>0){\r\n\t\t\t\t\t\t\tuni.setStorageSync('companyIndex',this.companyIndex); //工厂index\r\n\t\t\t\t\t\t\tuni.setStorageSync('businessId',this.businessId); //工厂id\r\n\t\t\t\t\t\t\tthis.cateIndex = 0;\r\n\t\t\t\t\t\t\tthis.cateList = [];\r\n\t\t\t\t\t\t\tthis.cateList = res.data; //一级分类\r\n\t\t\t\t\t\t\t// 查询二级\r\n\t\t\t\t\t\t\tthis.getSecondList(this.cateIndex);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.$toolAll.tools.showToast('该商户不能选择');\r\n\t\t\t\t\t\t\tthis.companyIndex = uni.getStorageSync('companyIndex'); //还原工厂index\r\n\t\t\t\t\t\t\tthis.businessId = uni.getStorageSync('businessId'); //还原工厂id\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tuni.hideLoading();\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 查询二级分类\r\n\t\t\tgetSecondList(index){\r\n\t\t\t\tif(this.cateList[index].has_children){\r\n\t\t\t\t\tthis.secondList = this.cateList[index].children;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.isTips = true;\r\n\t\t\t\t}\r\n\t\t\t},\t\t\t\r\n\t\t\t// 跳转详情页\r\n\t\t\ttoShop(id) {\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl:`/pagesA/shop/shop?category_id=${id}&business_id=${this.businessId}`\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t\r\n</style>\r\n"],"sourceRoot":""} |