1 line
19 KiB
Plaintext
1 line
19 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/chenq/chen/hengmei/hengmei/pagesB/searchPage/searchPage.vue?f794","webpack:///D:/chenq/chen/hengmei/hengmei/pagesB/searchPage/searchPage.vue?41bc","webpack:///D:/chenq/chen/hengmei/hengmei/pagesB/searchPage/searchPage.vue?cb52","webpack:///D:/chenq/chen/hengmei/hengmei/pagesB/searchPage/searchPage.vue?97ed","uni-app:///pagesB/searchPage/searchPage.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;AACA;AACA,6G,6FAFmBA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC;AAGnBC,UAAU,CAACC,mBAAD,CAAV,C;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAuH;AACvH;AAC8D;AACL;;;AAGzD;AACmL;AACnL,gBAAgB,uLAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,qFAAM;AACR,EAAE,8FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,yFAAU;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;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAurB,CAAgB,sqBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0C3sB,sE;AACA;AACA;AACA,kBADA,EADA;;AAIA,MAJA,kBAIA;AACA;AACA,0DADA;AAEA,mBAFA,EAEA;AACA,oDAHA,EAGA;AACA;AACA;AACA,qBADA;AAEA,0CAFA;AAGA,gBAHA,EADA;;AAMA;AACA,qBADA;AAEA,eAFA;AAGA;AACA;AACA;AACA;AACA;AACA;AALA,SAHA,EANA,CAJA;;;AAsBA,oBAtBA,EAsBA;AACA,kBAvBA,EAuBA;AACA;AAAA,OAxBA;;AA2BA;AAAA,OA3BA;;AA8BA,oBA9BA,EA8BA;AACA,mBA/BA;AAgCA,aAhCA;AAiCA,cAjCA;AAkCA,eAlCA,EAkCA;AACA,kBAnCA;AAoCA,qBApCA,CAoCA;AApCA;AAsCA,GA3CA;AA4CA,cA5CA,wBA4CA,CA5CA,EA4CA;AACA;AACA,GA9CA;AA+CA,eA/CA,2BA+CA;AACA;AACA;AACA,sBAFA,CAEA;AACA,KAHA,MAGA;AACA;AACA;AACA;AACA,GAvDA;AAwDA,UAxDA,sBAwDA;AACA;AACA,GA1DA;AA2DA,QA3DA,kBA2DA,OA3DA,EA2DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GApEA;AAqEA,QArEA,oBAqEA;AACA;AACA;AACA;AACA;AACA,GA1EA;AA2EA;AACA,YADA,sBACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BADA;AAEA,qCAFA;;AAIA;AACA,aANA;AAOA;AACA,SAVA,MAUA;AACA,OAbA,EAaA,6DAbA;AAcA,KAhBA;AAiBA,cAjBA,sBAiBA,CAjBA,EAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAzBA;AA0BA,YA1BA,oBA0BA,CA1BA,EA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAnCA;AAoCA,cApCA,sBAoCA,CApCA,EAoCA;AACA;AACA;AACA;AACA;AACA;AACA,KA1CA;AA2CA,sBA3CA,gCA2CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BADA;AAEA,uCAFA;;AAIA;AACA;AACA,aARA;AASA;AACA,SAZA,MAYA;AACA,OAfA,EAeA,8DAfA;AAgBA,KA5DA;AA6DA,YA7DA,sBA6DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CADA;;AAGA,SANA,MAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCADA,EACA;AACA,uCAFA,EAEA;AACA,yCAHA,EAGA;AACA,6CAJA,EAIA;AACA,iDALA,EAKA;AACA,qCANA;;AAQA;AACA,mBAVA;AAWA;AACA;AACA,eAfA,MAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDADA,EACA;AACA,+BAFA;AAGA,mDAHA,EAGA;AACA,2CAJA,EAIA;AACA,qCALA,EAKA;AACA,uDANA,EAMA;AACA,oDAPA,EAOA;AACA,qCARA,EAQA;AACA,0CATA,EASA;AACA,iEAVA,EAUA;AACA,qDAXA,EAWA;AACA,wDAZA,EAYA;AACA,qCAbA,EAaA;AACA,2CAdA,CAcA;AAdA;AAgBA;AACA;AACA;AACA;AACA;AACA,iBAxBA;AAyBA;AACA;AACA,yCADA;;AAGA;AACA;AACA;AACA,WA3DA;AA4DA;AACA,OAtEA;AAuEA,KAxIA;AAyIA,SAzIA,mBAyIA;AACA;AACA,KA3IA;AA4IA,aA5IA,uBA4IA;AACA;AACA;AACA;AACA;AACA,2CAFA,CAEA;AACA,SAHA,MAGA;AACA,OALA,EAKA,8DALA;AAMA,KApJA;AAqJA,YArJA,sBAqJA;AACA;AACA,KAvJA;AAwJA,aAxJA,qBAwJA,KAxJA,EAwJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KA/JA;AAgKA,WAhKA,qBAgKA;AACA;AACA,oBADA;AAEA,qBAFA;;AAIA,KArKA,EA3EA,E","file":"pagesB/searchPage/searchPage.js","sourcesContent":["import 'uni-pages';wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pagesB/searchPage/searchPage.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./searchPage.vue?vue&type=template&id=44fcb64c&\"\nvar renderjs\nimport script from \"./searchPage.vue?vue&type=script&lang=js&\"\nexport * from \"./searchPage.vue?vue&type=script&lang=js&\"\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 null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pagesB/searchPage/searchPage.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!./searchPage.vue?vue&type=template&id=44fcb64c&\"","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!./searchPage.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!./searchPage.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view>\r\n\t\t<!-- 状态栏 -->\r\n\t\t<status-nav :titleVal=\"'搜索'\" :statusTitle=\"true\"></status-nav>\r\n\t\t<!-- 输入框 -->\r\n\t\t<view class=\"search-input-box bacf\" :style=\"{paddingTop: statusHNH+'px'}\">\r\n\t\t\t<view class=\"disac pad-zy30 mar-s20\">\r\n\t\t\t\t<!-- 输入框 -->\r\n\t\t\t\t<input @confirm=\"searchEv\" style=\"border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;\" class=\"width100 fon34 radius10\" type=\"text\" v-model=\"searchVal\" placeholder=\"请输入问题/病种/医生姓名\"/>\r\n\t\t\t\t<!-- 搜索 -->\r\n\t\t\t\t<view @tap=\"searchEv\" class=\"flexs mar-z30 radius10 pad-zy40 fon34 colf\" style=\"height: 80rpx;line-height: 80rpx;\" :style=\"{background:publicColor}\">搜索</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 自定义二级分类 -->\r\n\t\t\t<view class=\" pad-zy20 mar-s40\" v-if=\"!isList\">\r\n\t\t\t\t<cate-pu :newCurrent=\"newCurrent*1\" :activeb=\"publicColor\" :isCenter=\"false\" :newbmo=\"'#E0E0E0'\" @choosecateEv=\"chooseTwo\" :newcateList=\"cateList\"></cate-pu>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 历史搜索和热门搜索 -->\r\n\t\t<view class=\"pad-z30 mar-s30\" v-if=\"isList\">\r\n\t\t\t<cate-tu :list=\"reSearchList\" @delev='delev'></cate-tu>\r\n\t\t</view>\r\n\t\t<view v-else class=\"pad-zy20 mar-s20\">\r\n\t\t\t<!-- 列表 -->\r\n\t\t\t<view v-if=\"dataList.length!=0\">\r\n\t\t\t\t<list-pu @chooseLike=\"chooseLike\" @praise=\"praiseEv\" @comfirmev=\"comfirmevl\" :list=\"dataList\"></list-pu>\r\n\t\t\t</view>\r\n\t\t\t<view v-else class=\"disjcac fc\" style=\"margin-top: 40%;\">\r\n\t\t\t\t<image class=\"zanw-img\" src=\"/static/public/nothing.png\" mode=\"aspectFill\"></image>\r\n\t\t\t\t<view class=\"fon24 col3\">您搜索的内容暂无结果,换个关键词试试吧</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 弹框 -->\r\n\t\t<pu-po :isShowT=\"isShowT\" @comfirmev=\"comfirmev\" @cancleev=\"cancleev\"></pu-po>\r\n\t\t<!-- 返回顶部 -->\r\n\t\t<!-- <back-top :showTop=\"showTop\" @backTop=\"backTop\"></back-top> -->\r\n\t\t<!-- 用户信息授权,手机号授权 -->\r\n\t\t<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\timport cateTu from '@/components/cate-items/cate-tu.vue';\r\n\timport {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';\r\n\texport default {\r\n\t\tcomponents:{\r\n\t\t\tcateTu\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tstatusHNH:uni.getStorageSync('electric_nav_height'),\r\n\t\t\t\tsearchVal:'',//输入框的值\r\n\t\t\t\tpublicColor:uni.getStorageSync('publicColor'),//主题颜色\r\n\t\t\t\treSearchList:[//历史记录列表\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttitle:'历史搜索',\r\n\t\t\t\t\t\tsrc:'/static/public/del-icon.png',\r\n\t\t\t\t\t\tlist:[]\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttitle:'热门搜索',\r\n\t\t\t\t\t\tsrc:'',\r\n\t\t\t\t\t\tlist:[\r\n\t\t\t\t\t\t\t// {content:'秃顶种植需要的条件'},\r\n\t\t\t\t\t\t\t// {content:'眉毛种植的是什么'},\r\n\t\t\t\t\t\t\t// {content:'那些人能种植'},\r\n\t\t\t\t\t\t\t// {content:'眉毛种植需要多少钱'},\r\n\t\t\t\t\t\t\t// {content:'那些人能种植'},\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\tisShowT:false,//是否显示弹框\r\n\t\t\t\tisList:true,//是否显示默认显示\r\n\t\t\t\tcateList:[//所以二级分类\r\n\t\t\t\t\t\r\n\t\t\t\t],\r\n\t\t\t\tdataList:[//小课堂数据列表\r\n\t\t\t\t\t\r\n\t\t\t\t],\r\n\t\t\t\tshowTop:false,//是否显示返回顶部\r\n\t\t\t\tnewCurrent:0,\r\n\t\t\t\tpage:1,\r\n\t\t\t\tsize:10,\r\n\t\t\t\ttotal:'',//总数\r\n\t\t\t\tisZanw:true,\r\n\t\t\t\tcategory_id:'',//栏目ID\r\n\t\t\t}\r\n\t\t},\r\n\t\tonPageScroll(e) {\r\n\t\t e.scrollTop > 360 ? this.showTop = true : this.showTop = false\r\n\t\t},\r\n\t\tonReachBottom() {//触底事件\r\n\t\t\tif(this.total!=this.dataList.length){\r\n\t\t\t\tthis.page++\r\n\t\t\t\tthis.searchEv()//调用自主预约列表事件\r\n\t\t\t} else {\r\n\t\t\t\tif(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)\r\n\t\t\t\tthis.isZanw = false\r\n\t\t\t}\r\n\t\t},\r\n\t\tonUnload() {\r\n\t\t\tuni.removeStorageSync('cateList')\r\n\t\t},\r\n\t\tonLoad(options) {\r\n\t\t\tif(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){\r\n\t\t\t\tif(options.keyWorld!=undefined && options.keyWorld!='') {\r\n\t\t\t\t\tthis.searchVal = options.keyWorld\r\n\t\t\t\t\tthis.searchEv()\r\n\t\t\t\t}\r\n\t\t\t\tthis.checkSearchHistory()\r\n\t\t\t\tthis.checkKey()\r\n\t\t\t}\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\tthis.$toolAll.tools.isLogin()\r\n\t\t\tif(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){\r\n\t\t\t\tif(this.searchVal!=undefined && this.searchVal!='') this.searchEv()\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tcheckKey(){//查询热搜关键词事件\r\n\t\t\t\tthis.$requst.get('index/hot-keywords').then(res=>{\r\n\t\t\t\t\t// console.log('关键词列表:',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\tres.data.forEach(item=>{\r\n\t\t\t\t\t\t\t\tlet reObj = {\r\n\t\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\t\tcontent:item.keyword\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tthis.reSearchList[1].list.push(reObj)\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else this.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t},error=>{this.$toolAll.tools.showToast(error.msg);})\r\n\t\t\t},\r\n\t\t\tchooseLike(e){//收藏事件\r\n\t\t\t\t// console.log(this.dataList[e].is_collected);\r\n\t\t\t\tif(this.dataList[e].is_collected==0){\r\n\t\t\t\t\tthis.dataList[e].is_collected = 1;\r\n\t\t\t\t\tthis.dataList[e].collects++;\r\n\t\t\t\t\t// 调用收藏事件\r\n\t\t\t\t\tcollectionEV({action:'collect',archive_id:this.dataList[e].id})\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tpraiseEv(e){ // 点赞事件\r\n\t\t\t\t// console.log(this.dataList[e].is_collected);\r\n\t\t\t\tif(this.dataList[e].is_liked==0){\r\n\t\t\t\t\tthis.dataList[e].is_liked = 1;\r\n\t\t\t\t\tthis.dataList[e].likes++;\r\n\t\t\t\t\tif(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'\r\n\t\t\t\t\t// 调用收藏事件\r\n\t\t\t\t\tcollectionEV({action:'like',archive_id:this.dataList[e].id})\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcomfirmevl(e){//确认取消收藏事件\r\n\t\t\t\tthis.dataList[e].is_collected = 0\r\n\t\t\t\tthis.$toolAll.tools.showToast('正在取消...','loading');\r\n\t\t\t\tthis.dataList[e].collects--;\r\n\t\t\t\t// 调用取消收藏事件\r\n\t\t\t\tcancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})\t\r\n\t\t\t},\r\n\t\t\tcheckSearchHistory(){//查询历史搜索的搜索记录\r\n\t\t\t\tthis.$requst.post('user/search-history',{page:this.page,size:this.size}).then(res=>{\r\n\t\t\t\t\t// console.log(res);\r\n\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\tif(res.data.list.length!=0){\r\n\t\t\t\t\t\t\tres.data.list.forEach(item=>{\r\n\t\t\t\t\t\t\t\tif(item.keyword!=null){\r\n\t\t\t\t\t\t\t\t\tlet searchObj = {\r\n\t\t\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\t\t\tcontent:item.keyword\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tthis.reSearchList[0].list.push(searchObj)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else this.$toolAll.tools.showToast(ers.msg);\r\n\t\t\t\t},error=>{this.$toolAll.tools.showToast(error.msg);})\r\n\t\t\t},\r\n\t\t\tsearchEv(){//搜索事件\r\n\t\t\t\t// console.log('栏目ID:',this.category_id,'关键词:',this.searchVal);\r\n\t\t\t\tthis.$toolAll.tools.showToast('搜索中...')\r\n\t\t\t\t// 检测是否完全匹配关键词\r\n\t\t\t\tthis.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{\r\n\t\t\t\t\tif(res.data.has) {\r\n\t\t\t\t\t\tthis.searchVal = '';\r\n\t\t\t\t\t\t// 完全匹配,跳转匹配路径\r\n\t\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\t\turl:`/${res.data.target}`\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// 不匹配时进行搜索接口调用\r\n\t\t\t\t\t\tthis.$requst.post('archives/category',{page:this.page,size:this.size,category_id:this.category_id,keyword:this.searchVal}).then(res=>{\r\n\t\t\t\t\t\t\t// console.log('搜索提交:',res);\r\n\t\t\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\t\t\tuni.hideToast()\r\n\t\t\t\t\t\t\t\tif(uni.getStorageSync('cateList')==''){//首次渲染栏目\r\n\t\t\t\t\t\t\t\t\tif(res.data.category.length!=0){\r\n\t\t\t\t\t\t\t\t\t\tres.data.category.forEach((item,index)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tlet cateObj = {\r\n\t\t\t\t\t\t\t\t\t\t\t\tid:item.id,//栏目ID \r\n\t\t\t\t\t\t\t\t\t\t\t\ttitle:item.title,//栏目名称\r\n\t\t\t\t\t\t\t\t\t\t\t\tactive:item.active,//是否选中\r\n\t\t\t\t\t\t\t\t\t\t\t\tmodel_id:item.model_id,//模型ID\r\n\t\t\t\t\t\t\t\t\t\t\t\tmodel_name:item.model_name,//模型标识\r\n\t\t\t\t\t\t\t\t\t\t\t\tsort:item.sort\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tthis.cateList.push(cateObj)\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\tuni.setStorageSync('cateList',this.cateList)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t//获取缓存中的栏目\r\n\t\t\t\t\t\t\t\t\tthis.cateList = uni.getStorageSync('cateList')\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// 获取列表\r\n\t\t\t\t\t\t\t\tif(this.page==1) this.dataList = []\r\n\t\t\t\t\t\t\t\tthis.total = res.data.list.total\r\n\t\t\t\t\t\t\t\tif(res.data.list.list.length!=0){\r\n\t\t\t\t\t\t\t\t\tres.data.list.list.forEach(item=>{\r\n\t\t\t\t\t\t\t\t\t\tlet fabImg = '';\r\n\t\t\t\t\t\t\t\t\t\tif(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;\r\n\t\t\t\t\t\t\t\t\t\tlet tObj = {\r\n\t\t\t\t\t\t\t\t\t\t\tcategory_id:item.category_id,//栏目ID\r\n\t\t\t\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\t\t\t\tis_collected:item.is_collected,//是否已收藏\r\n\t\t\t\t\t\t\t\t\t\t\tcollects:item.collects,//收藏量\r\n\t\t\t\t\t\t\t\t\t\t\tviews:item.views,//查看量\r\n\t\t\t\t\t\t\t\t\t\t\tmain_img:this.$http + item.cover,//封面图\r\n\t\t\t\t\t\t\t\t\t\t\tvideo:this.$http + item.video,//视频地址\r\n\t\t\t\t\t\t\t\t\t\t\ttitle:item.title,//标题\r\n\t\t\t\t\t\t\t\t\t\t\tcontent:item.subtitle,//副标题\r\n\t\t\t\t\t\t\t\t\t\t\thead_img: fabImg || '/static/public/logo.png',//发布者头像\r\n\t\t\t\t\t\t\t\t\t\t\tname:item.published_by || '恒美植发',//发布者昵称\r\n\t\t\t\t\t\t\t\t\t\t\tisVideo:item.video.includes(\".mp4\"),//是否是视频\r\n\t\t\t\t\t\t\t\t\t\t\tlikes:item.likes,//点赞数量\r\n\t\t\t\t\t\t\t\t\t\t\tis_liked:item.is_liked//是否已点赞\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tthis.dataList.push(tObj);\r\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)\r\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)\r\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)\r\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj)\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tlet obj = {\r\n\t\t\t\t\t\t\t\t\tcontent:this.searchVal\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tthis.reSearchList[0].list.push(obj)\r\n\t\t\t\t\t\t\t\tthis.isList = false\r\n\t\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\tdelev(){//删除事件\r\n\t\t\t\tthis.isShowT = true\r\n\t\t\t},\r\n\t\t\tcomfirmev(){//清空历史搜索确认事件\r\n\t\t\t\tthis.isShowT = false\r\n\t\t\t\tthis.$requst.post('user/clear-search').then(res=>{\r\n\t\t\t\t\tif(res.code==0){\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('已清空')\r\n\t\t\t\t\t\tthis.reSearchList[0].list = []//清空搜索历史\r\n\t\t\t\t\t} else this.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t},error=>{this.$toolAll.tools.showToast(error.msg);})\r\n\t\t\t},\r\n\t\t\tcancleev(){//取消事件\r\n\t\t\t\tthis.isShowT = false\r\n\t\t\t},\r\n\t\t\tchooseTwo(index){//二级分类选择\r\n\t\t\t\t// console.log('二级分类:',index);\r\n\t\t\t\tthis.isZanw = true\r\n\t\t\t\tthis.page = 1\r\n\t\t\t\tthis.newCurrent = index\r\n\t\t\t\tthis.category_id = this.cateList[index].id\r\n\t\t\t\tthis.searchEv()\r\n\t\t\t},\r\n\t\t\tbackTop(){//回到顶部事件\r\n\t\t\t uni.pageScrollTo({\r\n\t\t\t scrollTop: 0,\r\n\t\t\t duration: 300\r\n\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\r\n</style>\r\n"],"sourceRoot":""} |