1 line
19 KiB
Plaintext
1 line
19 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/index/index.vue?85fd","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/index/index.vue?2524","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/index/index.vue?70a1","webpack:///D:/鲁班家具小程序/luban-mall/pages/tabbar/index/index.vue?3dfd","uni-app:///pages/tabbar/index/index.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;;;AAGA;AACA,mG,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,cAAD,CAAV,C;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAA8H;AAC9H;AACyD;AACL;;;AAGpD;AACuL;AACvL,gBAAgB,2LAAU;AAC1B,EAAE,2EAAM;AACR,EAAE,4FAAM;AACR,EAAE,qGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,gGAAU;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,gNAEN;AACP,KAAK;AACL;AACA,aAAa,kLAEN;AACP,KAAK;AACL;AACA,aAAa,8LAEN;AACP,KAAK;AACL;AACA,aAAa,oMAEN;AACP,KAAK;AACL;AACA,aAAa,wLAEN;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;;;;;;;;;;;;;;ACrDA;AAAA;AAAA;AAAA;AAAssB,CAAgB,qrBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0D1tB;AACA,gD,0tGAAA;eACA;AACA;AACA,wBADA;AAEA,sBAFA;AAGA,4BAHA;AAIA,kBAJA;AAKA,sBALA;AAMA,oBANA;AAOA,wBAPA,EADA;;AAUA,MAVA,kBAUA;AACA;AACA,wDADA;AAEA,oBAFA,EAEA;AACA,iBAHA,EAGA;AACA,oBAJA,EAIA;AACA,mBALA,EAKA;AACA,qBANA,EAMA;AACA,uBAPA,EAOA;AACA,qBARA,EAQA;AACA,sBATA,EASA;AACA,iBAVA,EAUA;AACA,qBAXA,EAWA;AACA,oBAZA,EAYA;AACA,qBAbA;AAcA,oBAdA,EAcA;AACA,yBAfA,EAeA;AACA,sBAhBA;AAiBA,kBAjBA,CAiBA;AAjBA;AAmBA,GA9BA;AA+BA;AACA;AACA,iEADA,GADA,CA/BA;;;AAoCA,QApCA,kBAoCA,EApCA,EAoCA;AACA;AACA;AACA;AACA,GAxCA;AAyCA,QAzCA,oBAyCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OANA;AAOA,KARA,MAQA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAFA,EAEA,IAFA;AAGA,GA3DA;AA4DA,SA5DA,qBA4DA;;AAEA,GA9DA;AA+DA;AACA,mBAhEA,+BAgEA;AACA;AACA;AACA,gBADA;;AAGA,GArEA;AAsEA;AACA,iBAvEA,2BAuEA,GAvEA,EAuEA;AACA;AACA;AACA,gBADA;;AAGA,GA5EA;AA6EA,eA7EA,yBA6EA,CA7EA,EA6EA;AACA;AACA;AACA;AACA;AACA,GAlFA;AAmFA,QAnFA,oBAmFA;AACA;AACA;AACA,GAtFA;AAuFA;AACA;AACA,cAFA,wBAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OANA;AAOA,KAVA;AAWA;AACA,kBAZA,0BAYA,WAZA,EAYA;AACA;AACA;AACA;AACA;AACA,OAJA;AAKA,KAlBA;AAmBA;AACA,eApBA,yBAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BADA;AAEA,2BAFA;AAGA,8BAHA;;AAKA;AACA,WAPA;AAQA;AACA;AACA;AACA;AACA;AACA,OAjBA;AAkBA,KAvCA;AAwCA;AACA,iBAzCA,2BAyCA;AACA;AACA;AACA;AACA;AACA;AACA,yBADA;AAEA,8BAFA;;AAIA;AACA,WANA;AAOA;AACA;AACA;AACA;AACA;AACA,OAfA;AAgBA,KA1DA;AA2DA;AACA,YA5DA,oBA4DA,KA5DA,EA4DA,EA5DA,EA4DA;AACA;AACA;AACA;AACA,KAhEA;AAiEA;AACA,cAlEA,wBAkEA;AACA;AACA,oBADA;;AAGA;AACA;AACA,uBADA;AAEA,uBAFA;AAGA,0CAHA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,yBADA;AAEA,+BAFA;AAGA,2EAHA;AAIA,6BAJA;;AAMA;AACA,WARA;AASA;AACA;AACA;AACA;AACA,OAjBA;AAkBA,KA9FA;;AAgGA;AACA,kBAjGA,4BAiGA;AACA;AACA,oBADA;;AAGA;AACA;AACA,uBADA;AAEA,uBAFA;AAGA,0CAHA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,yBADA;AAEA,+BAFA;AAGA,2EAHA;AAIA,6BAJA;;AAMA;AACA,WARA;AASA;AACA;AACA;AACA;AACA,OAjBA;AAkBA,KA7HA;AA8HA;AACA,cA/HA,sBA+HA,QA/HA,EA+HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAxIA;;AA0IA;AACA,UA3IA,oBA2IA;AACA;AACA,sCADA;;AAGA,KA/IA;AAgJA;AACA,UAjJA,kBAiJA,GAjJA,EAiJA;AACA;AACA;AACA,8BADA;;AAGA;AACA,KAvJA;AAwJA;AACA,gBAzJA,wBAyJA,EAzJA,EAyJA;AACA;AACA,oEADA;;AAGA,KA7JA;AA8JA;AACA,mBA/JA,2BA+JA,EA/JA,EA+JA;AACA;AACA,0DADA;;AAGA,KAnKA;AAoKA;AACA,YArKA,sBAqKA;AACA;AACA;AACA,oEADA;;AAGA;AACA,KA3KA,EAvFA,E","file":"pages/tabbar/index/index.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/index/index.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./index.vue?vue&type=template&id=6b1f4146&scoped=true&\"\nvar renderjs\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.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 \"6b1f4146\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/tabbar/index/index.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!./index.vue?vue&type=template&id=6b1f4146&scoped=true&\"","var components\ntry {\n components = {\n productList: function() {\n return import(\n /* webpackChunkName: \"components/product-list/product-list\" */ \"@/components/product-list/product-list.vue\"\n )\n },\n navTab: function() {\n return import(\n /* webpackChunkName: \"components/nav-tab/nav-tab\" */ \"@/components/nav-tab/nav-tab.vue\"\n )\n },\n pullList: function() {\n return import(\n /* webpackChunkName: \"components/pull-list/pull-list\" */ \"@/components/pull-list/pull-list.vue\"\n )\n },\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!./index.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!./index.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"pad-b150\" v-if=\"!ifLoading\">\r\n\t\t<status-nav :ifReturn=\"false\" :navBarTitle=\"indexTitle\" :marginBottom=\"0\"></status-nav>\r\n\t\t<!-- 搜索 -->\r\n\t\t<view class=\"search-bg\">\r\n\t\t\t<view class=\"search flex\">\r\n\t\t\t\t<image class=\"search-img\" src=\"/static/public/icon-search.png\" mode=\"widthFix\"></image>\r\n\t\t\t\t<input class=\"search-input\" v-model=\"keyword\" type=\"text\" placeholder=\"请输入关键词\" placeholder-style=\"color: #666666\">\r\n\t\t\t\t<view class=\"search-line\"></view>\r\n\t\t\t\t<view class=\"search-btn flex\" @tap=\"toSearch\">搜索</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 轮播图 -->\r\n\t\t<view class=\"banner\">\r\n\t\t\t<swiper-pu newRadius=\"0\" :bannerList=\"bannerList\" newHeight=\"372rpx\" newBottom=\"20rpx\" :isplay='isplay'></swiper-pu>\r\n\t\t</view>\r\n\t\t<!-- 推荐列表 -->\r\n\t\t<view class=\"flag-list flex\">\r\n\t\t\t<view class=\"flag-item\" @tap=\"toLink(item.url)\" v-for=\"(item,index) in recommendList\" :key=\"index\">\r\n\t\t\t\t<view class=\"flag-img\"><image class=\"search-img\" :src=\"item.src\" mode=\"widthFix\"></image></view>\r\n\t\t\t\t<view class=\"flag-txt clips1\">{{item.title}}</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 推荐商品 -->\r\n\t\t<view class=\"index-product-list\" v-for=\"(item,index) in productList\" :key=\"index\">\r\n\t\t\t<view class=\"product-list-title flex\">\r\n\t\t\t\t<view class=\"txt\">\r\n\t\t\t\t\t<text>{{item.title}}</text>\r\n\t\t\t\t\t<view class=\"line\"></view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"more\" @tap=\"toMore\">\r\n\t\t\t\t\t<image src=\"/static/public/icon-more.png\" mode=\"widthFix\"></image>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<product-list :list=\"item.goods\" :newWidth=\"item.goods.length*460-490+'rpx'\" @toDetail=\"toShopDetail\"></product-list>\r\n\t\t</view>\r\n\t\t\r\n\t\t<!-- 疑难解答&行业资讯 -->\r\n\t\t<view class=\"index-news\">\r\n\t\t\t<nav-tab :list=\"navTabList\" :maxNum=\"1\" @chooseEv=\"chooseEv\"></nav-tab>\r\n\t\t\t<pull-list :list=\"askList\" @toDetail=\"toArticleDetail\" v-if=\"isLoading && showIndex==0\"></pull-list>\r\n\t\t\t<pull-list :list=\"articleList\" @toDetail=\"toArticleDetail\" v-if=\"isLoading && showIndex==1\"></pull-list>\r\n\t\t</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></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 swiperPu from '@/components/swipers/swiper-pu'; \r\n\timport enterCart from '@/components/enter-cart/enter-cart.vue';\r\n\timport footTab from '@/components/foot-tab/foot-tab.vue';\r\n\timport productList from '@/components/product-list/product-list.vue';\r\n\timport navTab from '@/components/nav-tab/nav-tab.vue';\r\n\timport pullList from '@/components/pull-list/pull-list.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\tswiperPu,\r\n\t\t\tproductList,\r\n\t\t\tnavTab,\r\n\t\t\tpullList,\r\n\t\t\tfootTab,\r\n\t\t\tenterCart,\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tpadt:uni.getSystemInfoSync().statusBarHeight + 50,\r\n\t\t\t\theadHeight:'',//头部导航高\r\n\t\t\t\tkeyword:'', //关键词\r\n\t\t\t\tbannerList:[], //轮播图列表\r\n\t\t\t\tisplay:false, //是否自动轮播\r\n\t\t\t\tplayTimer:null, //间隔时间\r\n\t\t\t\trecommendList:[], //推荐列表\r\n\t\t\t\tproductList:[],// 产品列表\r\n\t\t\t\tarticleNavId:'',//文章导航id\r\n\t\t\t\taskList:[], //疑难解答列表\r\n\t\t\t\tarticleList:[], //文章列表\r\n\t\t\t\tnavTabList:[],//导航列表\r\n\t\t\t\tifLoading:true,\r\n\t\t\t\tindexTitle:'',//标题\r\n\t\t\t\tcacheBusinessId:-1, //商户id\r\n\t\t\t\tisLoading:false,\r\n\t\t\t\tshowIndex:0, //文章显示位置\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed:{\r\n\t\t\t...mapState({\r\n\t\t\t\tgeList: state => state.moduleA.geList,\r\n\t\t\t}),\r\n\t\t},\r\n\t\tonLoad(op) {\r\n\t\t\tif(op.business_id){\r\n\t\t\t\tthis.cacheBusinessId = op.business_id;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\tif(this.cacheBusinessId !== -1){\r\n\t\t\t\tthis.$requst.post('/api/index/change-business',{business_id:this.cacheBusinessId}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tthis.getHomeData();\r\n\t\t\t\t\t\tthis.getArticleNav();\r\n\t\t\t\t\t\tthis.userInfoEv();\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t}else{\r\n\t\t\t\tthis.getHomeData();\r\n\t\t\t\tthis.getArticleNav();\r\n\t\t\t\tthis.userInfoEv();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.playTimer = setTimeout(()=>{\r\n\t\t\t\tthis.isplay = true;\r\n\t\t\t},2000)\r\n\t\t},\r\n\t\tonReady() {\r\n\t\t\t\r\n\t\t},\r\n\t\t// 分享到微信\r\n\t\tonShareAppMessage() {\r\n\t\t\tlet path = uni.getStorageSync('page-path-options')+'?business_id='+uni.getStorageSync('business_id');\r\n\t\t\treturn {\r\n\t\t\t\tpath:path\r\n\t\t\t}\r\n\t\t},\r\n\t\t// 分享到朋友圈\r\n\t\tonShareTimeline(res){\r\n\t\t\tlet path = uni.getStorageSync('page-path-options')+'?business_id='+uni.getStorageSync('business_id');\r\n\t\t\treturn {\r\n\t\t\t\tpath:path\r\n\t\t\t}\r\n\t\t},\r\n\t\tonReachBottom(e) {\r\n\t\t\tif(this.articleList.length<this.total){\r\n\t\t\t\tthis.page++;\r\n\t\t\t\tthis.getArticleList();\r\n\t\t\t}\r\n\t\t},\r\n\t\tonHide() {\r\n\t\t\tclearTimeout(this.playTimer);\r\n\t\t\tthis.isplay =false;\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 查询用户信息\r\n\t\t\tuserInfoEv(){\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\tuni.setStorageSync('business_id',res.data.business_id);\r\n\t\t\t\t\t\tuni.setStorageSync('business_code',res.data.business_code);\r\n\t\t\t\t\t\tthis.getCompanyList(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\tgetCompanyList(business_id){\r\n\t\t\t\tthis.$requst.post('/api/business/info',{business_id:business_id}).then(res=>{\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tthis.indexTitle = res.data.alias;\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\tgetHomeData(){\r\n\t\t\t\tthis.$requst.get('/api/index/home').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tlet bannerArr = [];\r\n\t\t\t\t\t\tlet isVideo = false\r\n\t\t\t\t\t\tres.data.banner.forEach(item=>{\r\n\t\t\t\t\t\t\tlet obj = {\r\n\t\t\t\t\t\t\t\timgSrc:item.src,\r\n\t\t\t\t\t\t\t\turl:item.url,\r\n\t\t\t\t\t\t\t\tisVideo:isVideo,\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbannerArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.bannerList = bannerArr;\r\n\t\t\t\t\t\tthis.recommendList =res.data['banner-next-2'];\r\n\t\t\t\t\t\tthis.productList = res.data.spu;\r\n\t\t\t\t\t\tthis.ifLoading = false;\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\tgetArticleNav(){\r\n\t\t\t\tthis.$requst.get('/api/archives/category').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tlet newArr = [];\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\tnewArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.navTabList = newArr;\r\n\t\t\t\t\t\t// 获取文章列表\r\n\t\t\t\t\t\tthis.getAskList();\r\n\t\t\t\t\t\tthis.getArticleList();\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\tchooseEv(index,id){\r\n\t\t\t\tif(this.showIndex !== index){\r\n\t\t\t\t\tthis.showIndex = index;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 获取疑难解答列表\r\n\t\t\tgetAskList(){ \r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: '加载中'\r\n\t\t\t\t});\r\n\t\t\t\tthis.isLoading = false;\r\n\t\t\t\tlet params = {\r\n\t\t\t\t\tpage:this.page,\r\n\t\t\t\t\tsize:this.size,\r\n\t\t\t\t\tcategory_id:this.navTabList[0].id\r\n\t\t\t\t}\r\n\t\t\t\tthis.$requst.get('/api/archives/list',params).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tthis.total = res.data.total;\r\n\t\t\t\t\t\tlet newArr = [];\r\n\t\t\t\t\t\tres.data.list.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\ttitle:item.title,\r\n\t\t\t\t\t\t\t\ttime:this.dateFormat(item.published_at.replace(/-/g,'/')),\r\n\t\t\t\t\t\t\t\tsrc:item.cover\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tnewArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.askList = newArr;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tuni.hideLoading();\r\n\t\t\t\t\tthis.isLoading = true;\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\tgetArticleList(){ \r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: '加载中'\r\n\t\t\t\t});\r\n\t\t\t\tthis.isLoading = false;\r\n\t\t\t\tlet params = {\r\n\t\t\t\t\tpage:this.page,\r\n\t\t\t\t\tsize:this.size,\r\n\t\t\t\t\tcategory_id:this.navTabList[1].id\r\n\t\t\t\t}\r\n\t\t\t\tthis.$requst.get('/api/archives/list',params).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tthis.total = res.data.total;\r\n\t\t\t\t\t\tlet newArr = [];\r\n\t\t\t\t\t\tres.data.list.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\ttitle:item.title,\r\n\t\t\t\t\t\t\t\ttime:this.dateFormat(item.published_at.replace(/-/g,'/')),\r\n\t\t\t\t\t\t\t\tsrc:item.cover\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tnewArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.articleList = newArr;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tuni.hideLoading();\r\n\t\t\t\t\tthis.isLoading = true;\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 时间格式转换\r\n\t\t\tdateFormat (dateData) {\r\n\t\t\t var date = new Date(dateData)\r\n\t\t\t var y = date.getFullYear()\r\n\t\t\t var m = date.getMonth() + 1\r\n\t\t\t m = m < 10 ? '0' + m : m\r\n\t\t\t var d = date.getDate()\r\n\t\t\t d = d < 10 ? '0' + d : d\r\n\t\t\t const time = y + '.' + m + '.' + d\r\n\t\t\t return time\r\n\t\t\t},\r\n\r\n\t\t\t// 去商品列表\r\n\t\t\ttoMore(){\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl:`/pages/tabbar/cate/cate`\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t//去推荐详情页\r\n\t\t\ttoLink(url){\r\n\t\t\t\tif(url !== ''){\r\n\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\turl: `/${url}`\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\ttoShopDetail(id){\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl:`/pagesA/shop/detail?id=${id.id}&source=shop`\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t//去文章详情\r\n\t\t\ttoArticleDetail(id){\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl:`/pages/tabbar/news/detail?id=${id.id}`\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 去搜索页面\r\n\t\t\ttoSearch(){\r\n\t\t\t\tif(this.keyword !== ''){\r\n\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\turl:`/pagesB/search/search?keyword=${this.keyword}`\r\n\t\t\t\t\t})\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 scoped>\r\n\t\r\n</style>\r\n"],"sourceRoot":""} |