1 line
19 KiB
Plaintext
1 line
19 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:////Users/Ian/dnmp/www/frontend/hengmei-mp/pagesB/searchPage/searchPage.vue?df14","webpack:////Users/Ian/dnmp/www/frontend/hengmei-mp/pagesB/searchPage/searchPage.vue?0ae1","webpack:////Users/Ian/dnmp/www/frontend/hengmei-mp/pagesB/searchPage/searchPage.vue?13f4","webpack:////Users/Ian/dnmp/www/frontend/hengmei-mp/pagesB/searchPage/searchPage.vue?e994","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;AACmN;AACnN,gBAAgB,iNAAU;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;AAAu1B,CAAgB,wyBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0C32B,sE;AACA;AACA;AACA,kBADA,EADA;;AAIA,MAJA,kBAIA;AACA;AACA,mBADA,EACA;AACA;AACA;AACA,qBADA;AAEA,0CAFA;AAGA,gBAHA,EADA;;AAMA;AACA,qBADA;AAEA,eAFA;AAGA;AACA;AACA;AACA;AACA;AACA;AALA,SAHA,EANA,CAFA;;;AAoBA,oBApBA,EAoBA;AACA,kBArBA,EAqBA;AACA;AAAA,OAtBA;;AAyBA;AAAA,OAzBA;;AA4BA,oBA5BA,EA4BA;AACA,mBA7BA;AA8BA,aA9BA;AA+BA,cA/BA;AAgCA,eAhCA,EAgCA;AACA,kBAjCA;AAkCA,qBAlCA,CAkCA;AAlCA;AAoCA,GAzCA;AA0CA;AACA;AACA,eAFA,yBAEA;AACA;AACA,KAJA;AAKA,gBALA,0BAKA;AACA;AACA,KAPA,EA1CA;;AAmDA,cAnDA,wBAmDA,CAnDA,EAmDA;AACA;AACA,GArDA;AAsDA,eAtDA,2BAsDA;AACA;AACA;AACA,sBAFA,CAEA;AACA,KAHA,MAGA;AACA;AACA;AACA;AACA,GA9DA;AA+DA,UA/DA,sBA+DA;AACA;AACA,GAjEA;AAkEA,QAlEA,kBAkEA,OAlEA,EAkEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GA3EA;AA4EA,QA5EA,oBA4EA;AACA;AACA;AACA;AACA,GAhFA;AAiFA;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,EAjFA,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 \"!../../../../../../../../Applications/HBuilderX.app/Contents/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 \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/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 \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/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 \"-!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./searchPage.vue?vue&type=script&lang=js&\"","<template>\n\t<view>\n\t\t<!-- 状态栏 -->\n\t\t<status-nav :titleVal=\"'搜索'\" :statusTitle=\"true\"></status-nav>\n\t\t<!-- 输入框 -->\n\t\t<view class=\"search-input-box bacf\" :style=\"{paddingTop: statusHeight+'px'}\">\n\t\t\t<view class=\"disac pad-zy30 mar-s20\">\n\t\t\t\t<!-- 输入框 -->\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=\"请输入问题/病种/医生姓名\"/>\n\t\t\t\t<!-- 搜索 -->\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>\n\t\t\t</view>\n\t\t\t<!-- 自定义二级分类 -->\n\t\t\t<view class=\" pad-zy20 mar-s40\" v-if=\"!isList\">\n\t\t\t\t<cate-pu :newCurrent=\"newCurrent*1\" :activeb=\"publicColor\" :isCenter=\"false\" :newbmo=\"'#E0E0E0'\" @choosecateEv=\"chooseTwo\" :newcateList=\"cateList\"></cate-pu>\n\t\t\t</view>\n\t\t</view>\n\t\t<!-- 历史搜索和热门搜索 -->\n\t\t<view class=\"pad-z30 mar-s30\" v-if=\"isList\">\n\t\t\t<cate-tu :list=\"reSearchList\" @delev='delev'></cate-tu>\n\t\t</view>\n\t\t<view v-else class=\"pad-zy20 mar-s20\">\n\t\t\t<!-- 列表 -->\n\t\t\t<view v-if=\"dataList.length!=0\">\n\t\t\t\t<list-pu @chooseLike=\"chooseLike\" @praise=\"praiseEv\" @comfirmev=\"comfirmevl\" :list=\"dataList\"></list-pu>\n\t\t\t</view>\n\t\t\t<view v-else class=\"disjcac fc\" style=\"margin-top: 40%;\">\n\t\t\t\t<image class=\"zanw-img\" src=\"/static/public/nothing.png\" mode=\"aspectFill\"></image>\n\t\t\t\t<view class=\"fon24 col3\">您搜索的内容暂无结果,换个关键词试试吧</view>\n\t\t\t</view>\n\t\t</view>\n\t\t<!-- 弹框 -->\n\t\t<pu-po :isShowT=\"isShowT\" @comfirmev=\"comfirmev\" @cancleev=\"cancleev\"></pu-po>\n\t\t<!-- 返回顶部 -->\n\t\t<!-- <back-top :showTop=\"showTop\" @backTop=\"backTop\"></back-top> -->\n\t\t<!-- 用户信息授权,手机号授权 -->\n\t\t<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>\n\t</view>\n</template>\n\n<script>\n\timport cateTu from '@/components/cate-items/cate-tu.vue';\n\timport {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';\n\texport default {\n\t\tcomponents:{\n\t\t\tcateTu\n\t\t},\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tsearchVal:'',//输入框的值\n\t\t\t\treSearchList:[//历史记录列表\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle:'历史搜索',\n\t\t\t\t\t\tsrc:'/static/public/del-icon.png',\n\t\t\t\t\t\tlist:[]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle:'热门搜索',\n\t\t\t\t\t\tsrc:'',\n\t\t\t\t\t\tlist:[\n\t\t\t\t\t\t\t// {content:'秃顶种植需要的条件'},\n\t\t\t\t\t\t\t// {content:'眉毛种植的是什么'},\n\t\t\t\t\t\t\t// {content:'那些人能种植'},\n\t\t\t\t\t\t\t// {content:'眉毛种植需要多少钱'},\n\t\t\t\t\t\t\t// {content:'那些人能种植'},\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tisShowT:false,//是否显示弹框\n\t\t\t\tisList:true,//是否显示默认显示\n\t\t\t\tcateList:[//所以二级分类\n\t\t\t\t\t\n\t\t\t\t],\n\t\t\t\tdataList:[//小课堂数据列表\n\t\t\t\t\t\n\t\t\t\t],\n\t\t\t\tshowTop:false,//是否显示返回顶部\n\t\t\t\tnewCurrent:0,\n\t\t\t\tpage:1,\n\t\t\t\tsize:10,\n\t\t\t\ttotal:'',//总数\n\t\t\t\tisZanw:true,\n\t\t\t\tcategory_id:'',//栏目ID\n\t\t\t}\n\t\t},\n\t\tcomputed: {\n\t\t\t// 主题颜色\n\t\t\tpublicColor() {\n\t\t\t\treturn this.$store.state.publicColor\n\t\t\t},\n\t\t\tstatusHeight() {\n\t\t\t\treturn this.$store.state.statusHeight\n\t\t\t}\n\t\t},\n\t\tonPageScroll(e) {\n\t\t e.scrollTop > 360 ? this.showTop = true : this.showTop = false\n\t\t},\n\t\tonReachBottom() {//触底事件\n\t\t\tif(this.total!=this.dataList.length){\n\t\t\t\tthis.page++\n\t\t\t\tthis.searchEv()//调用自主预约列表事件\n\t\t\t} else {\n\t\t\t\tif(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)\n\t\t\t\tthis.isZanw = false\n\t\t\t}\n\t\t},\n\t\tonUnload() {\n\t\t\tuni.removeStorageSync('cateList')\n\t\t},\n\t\tonLoad(options) {\n\t\t\tif(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){\n\t\t\t\tif(options.keyWorld!=undefined && options.keyWorld!='') {\n\t\t\t\t\tthis.searchVal = options.keyWorld\n\t\t\t\t\tthis.searchEv()\n\t\t\t\t}\n\t\t\t\tthis.checkSearchHistory()\n\t\t\t\tthis.checkKey()\n\t\t\t}\n\t\t},\n\t\tonShow() {\n\t\t\tif(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){\n\t\t\t\tif(this.searchVal!=undefined && this.searchVal!='') this.searchEv()\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tcheckKey(){//查询热搜关键词事件\n\t\t\t\tthis.$requst.get('index/hot-keywords').then(res=>{\n\t\t\t\t\t// console.log('关键词列表:',res);\n\t\t\t\t\tif(res.code==0){\n\t\t\t\t\t\tif(res.data.length!=0){\n\t\t\t\t\t\t\tres.data.forEach(item=>{\n\t\t\t\t\t\t\t\tlet reObj = {\n\t\t\t\t\t\t\t\t\tid:item.id,\n\t\t\t\t\t\t\t\t\tcontent:item.keyword\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.reSearchList[1].list.push(reObj)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t} else this.$toolAll.tools.showToast(res.msg);\n\t\t\t\t},error=>{this.$toolAll.tools.showToast(error.msg);})\n\t\t\t},\n\t\t\tchooseLike(e){//收藏事件\n\t\t\t\t// console.log(this.dataList[e].is_collected);\n\t\t\t\tif(this.dataList[e].is_collected==0){\n\t\t\t\t\tthis.dataList[e].is_collected = 1;\n\t\t\t\t\tthis.dataList[e].collects++;\n\t\t\t\t\t// 调用收藏事件\n\t\t\t\t\tcollectionEV({action:'collect',archive_id:this.dataList[e].id})\n\t\t\t\t}\n\t\t\t},\n\t\t\tpraiseEv(e){ // 点赞事件\n\t\t\t\t// console.log(this.dataList[e].is_collected);\n\t\t\t\tif(this.dataList[e].is_liked==0){\n\t\t\t\t\tthis.dataList[e].is_liked = 1;\n\t\t\t\t\tthis.dataList[e].likes++;\n\t\t\t\t\tif(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'\n\t\t\t\t\t// 调用收藏事件\n\t\t\t\t\tcollectionEV({action:'like',archive_id:this.dataList[e].id})\n\t\t\t\t}\n\t\t\t},\n\t\t\tcomfirmevl(e){//确认取消收藏事件\n\t\t\t\tthis.dataList[e].is_collected = 0\n\t\t\t\tthis.$toolAll.tools.showToast('正在取消...','loading');\n\t\t\t\tthis.dataList[e].collects--;\n\t\t\t\t// 调用取消收藏事件\n\t\t\t\tcancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})\t\n\t\t\t},\n\t\t\tcheckSearchHistory(){//查询历史搜索的搜索记录\n\t\t\t\tthis.$requst.post('user/search-history',{page:this.page,size:this.size}).then(res=>{\n\t\t\t\t\t// console.log(res);\n\t\t\t\t\tif(res.code==0){\n\t\t\t\t\t\tif(res.data.list.length!=0){\n\t\t\t\t\t\t\tres.data.list.forEach(item=>{\n\t\t\t\t\t\t\t\tif(item.keyword!=null){\n\t\t\t\t\t\t\t\t\tlet searchObj = {\n\t\t\t\t\t\t\t\t\t\tid:item.id,\n\t\t\t\t\t\t\t\t\t\tcontent:item.keyword\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthis.reSearchList[0].list.push(searchObj)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t} else this.$toolAll.tools.showToast(ers.msg);\n\t\t\t\t},error=>{this.$toolAll.tools.showToast(error.msg);})\n\t\t\t},\n\t\t\tsearchEv(){//搜索事件\n\t\t\t\t// console.log('栏目ID:',this.category_id,'关键词:',this.searchVal);\n\t\t\t\tthis.$toolAll.tools.showToast('搜索中...')\n\t\t\t\t// 检测是否完全匹配关键词\n\t\t\t\tthis.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{\n\t\t\t\t\tif(res.data.has) {\n\t\t\t\t\t\tthis.searchVal = '';\n\t\t\t\t\t\t// 完全匹配,跳转匹配路径\n\t\t\t\t\t\tuni.navigateTo({\n\t\t\t\t\t\t\turl:`/${res.data.target}`\n\t\t\t\t\t\t})\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// 不匹配时进行搜索接口调用\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=>{\n\t\t\t\t\t\t\t// console.log('搜索提交:',res);\n\t\t\t\t\t\t\tif(res.code==0){\n\t\t\t\t\t\t\t\tuni.hideToast()\n\t\t\t\t\t\t\t\tif(uni.getStorageSync('cateList')==''){//首次渲染栏目\n\t\t\t\t\t\t\t\t\tif(res.data.category.length!=0){\n\t\t\t\t\t\t\t\t\t\tres.data.category.forEach((item,index)=>{\n\t\t\t\t\t\t\t\t\t\t\tlet cateObj = {\n\t\t\t\t\t\t\t\t\t\t\t\tid:item.id,//栏目ID \n\t\t\t\t\t\t\t\t\t\t\t\ttitle:item.title,//栏目名称\n\t\t\t\t\t\t\t\t\t\t\t\tactive:item.active,//是否选中\n\t\t\t\t\t\t\t\t\t\t\t\tmodel_id:item.model_id,//模型ID\n\t\t\t\t\t\t\t\t\t\t\t\tmodel_name:item.model_name,//模型标识\n\t\t\t\t\t\t\t\t\t\t\t\tsort:item.sort\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tthis.cateList.push(cateObj)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\tuni.setStorageSync('cateList',this.cateList)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//获取缓存中的栏目\n\t\t\t\t\t\t\t\t\tthis.cateList = uni.getStorageSync('cateList')\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// 获取列表\n\t\t\t\t\t\t\t\tif(this.page==1) this.dataList = []\n\t\t\t\t\t\t\t\tthis.total = res.data.list.total\n\t\t\t\t\t\t\t\tif(res.data.list.list.length!=0){\n\t\t\t\t\t\t\t\t\tres.data.list.list.forEach(item=>{\n\t\t\t\t\t\t\t\t\t\tlet fabImg = '';\n\t\t\t\t\t\t\t\t\t\tif(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;\n\t\t\t\t\t\t\t\t\t\tlet tObj = {\n\t\t\t\t\t\t\t\t\t\t\tcategory_id:item.category_id,//栏目ID\n\t\t\t\t\t\t\t\t\t\t\tid:item.id,\n\t\t\t\t\t\t\t\t\t\t\tis_collected:item.is_collected,//是否已收藏\n\t\t\t\t\t\t\t\t\t\t\tcollects:item.collects,//收藏量\n\t\t\t\t\t\t\t\t\t\t\tviews:item.views,//查看量\n\t\t\t\t\t\t\t\t\t\t\tmain_img:this.$http + item.cover,//封面图\n\t\t\t\t\t\t\t\t\t\t\tvideo:this.$http + item.video,//视频地址\n\t\t\t\t\t\t\t\t\t\t\ttitle:item.title,//标题\n\t\t\t\t\t\t\t\t\t\t\tcontent:item.subtitle,//副标题\n\t\t\t\t\t\t\t\t\t\t\thead_img: fabImg || '/static/public/logo.png',//发布者头像\n\t\t\t\t\t\t\t\t\t\t\tname:item.published_by || '恒美植发',//发布者昵称\n\t\t\t\t\t\t\t\t\t\t\tisVideo:item.video.includes(\".mp4\"),//是否是视频\n\t\t\t\t\t\t\t\t\t\t\tlikes:item.likes,//点赞数量\n\t\t\t\t\t\t\t\t\t\t\tis_liked:item.is_liked//是否已点赞\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tthis.dataList.push(tObj);\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)\n\t\t\t\t\t\t\t\t\t\t// if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj)\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlet obj = {\n\t\t\t\t\t\t\t\t\tcontent:this.searchVal\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.reSearchList[0].list.push(obj)\n\t\t\t\t\t\t\t\tthis.isList = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\tdelev(){//删除事件\n\t\t\t\tthis.isShowT = true\n\t\t\t},\n\t\t\tcomfirmev(){//清空历史搜索确认事件\n\t\t\t\tthis.isShowT = false\n\t\t\t\tthis.$requst.post('user/clear-search').then(res=>{\n\t\t\t\t\tif(res.code==0){\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('已清空')\n\t\t\t\t\t\tthis.reSearchList[0].list = []//清空搜索历史\n\t\t\t\t\t} else this.$toolAll.tools.showToast(res.msg);\n\t\t\t\t},error=>{this.$toolAll.tools.showToast(error.msg);})\n\t\t\t},\n\t\t\tcancleev(){//取消事件\n\t\t\t\tthis.isShowT = false\n\t\t\t},\n\t\t\tchooseTwo(index){//二级分类选择\n\t\t\t\t// console.log('二级分类:',index);\n\t\t\t\tthis.isZanw = true\n\t\t\t\tthis.page = 1\n\t\t\t\tthis.newCurrent = index\n\t\t\t\tthis.category_id = this.cateList[index].id\n\t\t\t\tthis.searchEv()\n\t\t\t},\n\t\t\tbackTop(){//回到顶部事件\n\t\t\t uni.pageScrollTo({\n\t\t\t scrollTop: 0,\n\t\t\t duration: 300\n\t\t\t });\n\t\t\t},\n\t\t}\n\t}\n</script>\n\n<style>\n\n</style>\n"],"sourceRoot":""} |