luban-mall/unpackage/dist/dev/.sourcemap/mp-weixin/pagesB/search/search.js.map

1 line
14 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"version":3,"sources":["uni-app:///main.js","webpack:///D:/鲁班家具小程序/luban-mall/pagesB/search/search.vue?8a8b","webpack:///D:/鲁班家具小程序/luban-mall/pagesB/search/search.vue?0239","webpack:///D:/鲁班家具小程序/luban-mall/pagesB/search/search.vue?9295","webpack:///D:/鲁班家具小程序/luban-mall/pagesB/search/search.vue?f3f5","uni-app:///pagesB/search/search.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;;;AAGA;AACA,iG,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,eAAD,CAAV,C;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAAmH;AACnH;AAC0D;AACL;;;AAGrD;AACoL;AACpL,gBAAgB,2LAAU;AAC1B,EAAE,4EAAM;AACR,EAAE,iFAAM;AACR,EAAE,0FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,qFAAU;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,kLAEN;AACP,KAAK;AACL;AACA,aAAa,8LAEN;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;AAAwrB,CAAgB,srBA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBADA;AAEA,6BAFA;AAGA,uDAHA;AAIA,0DAJA;AAKA,oGALA;AAMA,oDANA;;AAQA;AACA,WAVA;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,OArBA;AAsBA;AACA,KAlGA;;AAoGA;AACA,cArGA,sBAqGA,QArGA,EAqGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KA9GA;;AAgHA;AACA,YAjHA,oBAiHA,EAjHA,EAiHA;AACA;AACA;AACA,yCADA;;AAGA,KAtHA,EA3CA,E","file":"pagesB/search/search.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pagesB/search/search.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./search.vue?vue&type=template&id=23d62ba8&\"\nvar renderjs\nimport script from \"./search.vue?vue&type=script&lang=js&\"\nexport * from \"./search.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 = \"pagesB/search/search.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!./search.vue?vue&type=template&id=23d62ba8&\"","var components\ntry {\n components = {\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 }\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!./search.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!./search.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view>\r\n\t\t<status-nav :ifReturn=\"true\" navBarTitle=\"搜索\" :marginBottom=\"0\"></status-nav>\r\n\t\t<!-- 搜索 -->\r\n\t\t<view class=\"search-bg\" style=\"padding-bottom: 0rpx;\">\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=\"nav-list-bg\" :style=\"{top:newTop+'px'}\">\r\n\t\t\t<nav-tab :list=\"navTabList\" @chooseEv=\"chooseEv\" :type=\"'radio'\"></nav-tab>\r\n\t\t</view>\r\n\t\t<!-- 历史搜索 -->\r\n\t\t<view class=\"search-history flex\" v-if=\"historyData.length>0 && total==0\">\r\n\t\t\t<view class=\"title flex\">\r\n\t\t\t\t<text>历史搜索</text>\r\n\t\t\t\t<image class=\"search-img\" src=\"/static/public/icon-clear.png\" mode=\"widthFix\" @tap=\"clearHistory\"></image>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item clips1\" @tap=\"changeKeyword(item.keyword)\" v-for=\"(item,index) in historyData\" :key=\"index\">{{item.keyword}}</view>\r\n\t\t</view>\r\n\t\t<view class=\"search-keyword\" v-if=\"total !== 0\">关键词:<text>{{keywords}}</text>(<text>{{total}}</text>)</view>\r\n\t\t<!-- 列表 -->\r\n\t\t<view class=\"news-list-bg\">\r\n\t\t\t<pull-list :list=\"searchList\" :isShop=\"isShop\" :isKit=\"isKit\" @toDetail=\"toDetail\"></pull-list>\r\n\t\t</view>\r\n\t\t<!-- 暂无更多内容 -->\r\n\t\t<view class=\"more-txt more-txt-other\" v-if=\"totalAll == total\">暂无更多内容</view>\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 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\tnavTab,\r\n\t\t\tpullList\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tnewTop:uni.getSystemInfoSync().statusBarHeight + 50,\r\n\t\t\t\tsearchList:[], //解答&资讯列表\r\n\t\t\t\tnavTabList:[ //导航列表\r\n\t\t\t\t\t{name:'产品'},\r\n\t\t\t\t\t{name:'套件'},\r\n\t\t\t\t\t{name:'资讯'},\r\n\t\t\t\t],\r\n\t\t\t\tcurrentIndex:0, //当前位置\r\n\t\t\t\tpage:1, //第几页\r\n\t\t\t\tsize:5, //查询条数\r\n\t\t\t\ttotal:0, //总数\r\n\t\t\t\tisShop:true, //是否商品\r\n\t\t\t\ttotalAll:-1, //判断总数\r\n\t\t\t\thistoryData:[], //历史搜索列表\r\n\t\t\t\tkeyword:'',//搜索关键词\r\n\t\t\t\tkeywords:'', //历史关键词\r\n\t\t\t\tisKit: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.keywords = op.keyword;\r\n\t\t\tthis.getSearchList(this.currentIndex);\r\n\t\t\tthis.getHistory(this.currentIndex);\r\n\t\t},\r\n\t\tonReachBottom(e) {\r\n\t\t\tif(this.searchList.length<this.total){\r\n\t\t\t\tthis.page++;\r\n\t\t\t\tthis.getSearchList(this.currentIndex);\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 切换事件\r\n\t\t\tchooseEv(type){\r\n\t\t\t\tif(type == 2){\r\n\t\t\t\t\tthis.isShop = false;\r\n\t\t\t\t\tthis.isKit =false;\r\n\t\t\t\t}else if(type == 1){\r\n\t\t\t\t\tthis.isShop = false;\r\n\t\t\t\t\tthis.isKit =true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.isShop = true;\r\n\t\t\t\t\tthis.isKit =false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentIndex !== type){\r\n\t\t\t\t\tthis.page = 1;\r\n\t\t\t\t\tthis.currentIndex = type;\r\n\t\t\t\t\tthis.getSearchList(this.currentIndex);\r\n\t\t\t\t\tthis.getHistory(this.currentIndex);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 获取历史搜索结果\r\n\t\t\tgetHistory(index){\r\n\t\t\t\tlet historyType = ['spu','spu','article'];\r\n\t\t\t\tthis.$requst.get('/api/index/keyword-history',{type:historyType[index]}).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\tkeyword:item.keyword,\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.historyData = newArr;\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\ttoSearch(){\r\n\t\t\t\tif(this.keyword !== ''){\r\n\t\t\t\t\tthis.keywords = this.keyword;\r\n\t\t\t\t\tthis.getSearchList(this.currentIndex);\r\n\t\t\t\t\tthis.getHistory(this.currentIndex);\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\tchangeKeyword(keyword){\r\n\t\t\t\tthis.keywords =keyword;\r\n\t\t\t\tthis.getSearchList(this.currentIndex);\r\n\t\t\t\tthis.getHistory(this.currentIndex);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 清空历史搜索\r\n\t\t\tclearHistory(){\r\n\t\t\t\tlet historyType = ['spu','spu','article'];\r\n\t\t\t\tthis.$requst.get('/api/index/clear-keyword-history',{type:historyType[this.currentIndex]}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tthis.historyData = [];\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\tgetSearchList(index){\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\tlet params = [\r\n\t\t\t\t\t{keyword:this.keywords,is_series:0},\r\n\t\t\t\t\t{keyword:this.keywords,is_series:1},\r\n\t\t\t\t\t{keyword:this.keywords}\r\n\t\t\t\t];\r\n\t\t\t\tlet searchApi = ['/api/spu/list','/api/spu/series','/api/archives/list'];\r\n\t\t\t\tthis.$requst.get(searchApi[index],params[index]).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\tsrc:item.cover,\r\n\t\t\t\t\t\t\t\ttitle:item.name?item.name:item.title,\r\n\t\t\t\t\t\t\t\tsubtitle:item.subtitle?item.subtitle:'',\r\n\t\t\t\t\t\t\t\ttime:item.published_at?this.dateFormat(item.published_at.replace(/-/g,'/')):'',\r\n\t\t\t\t\t\t\t\tseries:item.series?item.series:''\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.searchList = newArr;\r\n\t\t\t\t\t\tthis.keyword = '';\r\n\t\t\t\t\t\tif(this.searchList.length == this.total){\r\n\t\t\t\t\t\t\tthis.totalAll = this.total;\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\tuni.hideLoading();\r\n\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\t\t\t\r\n\t\t\t// 跳转详情页\r\n\t\t\ttoDetail(id){\r\n\t\t\t\tlet detailUrl=[`/pagesA/shop/detail?id=${id.id}&source=shop`,`/pages/tabbar/kit/detail?id=${id.id}`,`/pages/tabbar/news/detail?id=${id.id}`];\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl:detailUrl[this.currentIndex]\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":""}