hengmei-two/unpackage/dist/dev/.sourcemap/mp-weixin/pagesB/searchPage/searchPage.js.map

1 line
19 KiB
Plaintext
Raw Permalink 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:/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","components","cateTu","data","searchVal","reSearchList","title","src","list","isShowT","isList","cateList","dataList","showTop","newCurrent","page","size","total","isZanw","category_id","computed","publicColor","statusHeight","onPageScroll","e","onReachBottom","onUnload","uni","onLoad","onShow","methods","checkKey","res","id","content","chooseLike","action","archive_id","praiseEv","comfirmevl","checkSearchHistory","searchEv","keyword","url","active","model_id","model_name","sort","is_collected","collects","views","main_img","video","head_img","name","isVideo","likes","is_liked","delev","comfirmev","cancleev","chooseTwo","backTop","scrollTop","duration"],"mappings":";;;;;;;;;;;;;AAAA;AAGA;AACA;AAHA;AACAA,EAAE,CAACC,iCAAiC,GAAGC,mBAAmB;AAG1DC,UAAU,CAACC,mBAAI,CAAC,C;;;;;;;;;;;;;ACLhB;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;AAAA;EAAA;IAAA;EAAA;AAAA;AAAA,eACA;EACAC;IACAC;EACA;EACAC;IACA;MACAC;MAAA;MACAC;MAAA;MACA;QACAC;QACAC;QACAC;MACA,GACA;QACAF;QACAC;QACAC;UACA;UACA;UACA;UACA;UACA;QAAA;MAEA,EACA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA,CAEA;MACAC;MAAA,CAEA;MACAC;MAAA;MACAC;MACAC;MACAC;MACAC;MAAA;MACAC;MACAC;IACA;EACA;;EACAC;IACA;IACAC;MACA;IACA;IACAC;MACA;IACA;EACA;EACAC;IACAC;EACA;EACAC;IAAA;IACA;MACA;MACA;IACA;MACA;MACA;IACA;EACA;EACAC;IACAC;EACA;EACAC;IACA;MACA;QACA;QACA;MACA;MACA;MACA;IACA;EACA;EACAC;IACA;MACA;IACA;EACA;EACAC;IACAC;MAAA;MAAA;MACA;QACA;QACA;UACA;YACAC;cACA;gBACAC;gBACAC;cACA;cACA;YACA;UACA;QACA;MACA;QAAA;MAAA;IACA;IACAC;MAAA;MACA;MACA;QACA;QACA;QACA;QACA;UAAAC;UAAAC;QAAA;MACA;IACA;IACAC;MAAA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;QAAAF;QAAAC;MAAA;MACA;IACA;IACAE;MAAA;MACA;MACA;MACA;MACA;MACA;QAAAH;QAAAC;MAAA;IACA;IACAG;MAAA;MAAA;MACA;QAAAzB;QAAAC;MAAA;QACA;QACA;UACA;YACAgB;cACA;gBACA;kBACAC;kBACAC;gBACA;gBACA;cACA;YACA;UACA;QACA;MACA;QAAA;MAAA;IACA;IACAO;MAAA;MAAA;MACA;MACA;MACA;MACA;QAAAC;MAAA;QACA;UACA;UACA;UACAf;YACAgB;UACA;QACA;UACA;UACA;YAAA5B;YAAAC;YAAAG;YAAAuB;UAAA;YACA;YACA;cACAf;cACA;gBAAA;gBACA;kBACAK;oBACA;sBACAC;sBAAA;sBACA3B;sBAAA;sBACAsC;sBAAA;sBACAC;sBAAA;sBACAC;sBAAA;sBACAC;oBACA;oBACA;kBACA;kBACApB;gBACA;cACA;gBACA;gBACA;cACA;cACA;cACA;cACA;cACA;gBACAK;kBACA;kBACA;kBACA;oBACAb;oBAAA;oBACAc;oBACAe;oBAAA;oBACAC;oBAAA;oBACAC;oBAAA;oBACAC;oBAAA;oBACAC;oBAAA;oBACA9C;oBAAA;oBACA4B;oBAAA;oBACAmB;oBAAA;oBACAC;oBAAA;oBACAC;oBAAA;oBACAC;oBAAA;oBACAC;kBACA;;kBACA;kBACA;kBACA;kBACA;kBACA;gBACA;cACA;;cACA;gBACAvB;cACA;cACA;cACA;YACA;UACA;QACA;MACA;IACA;IACAwB;MAAA;MACA;IACA;IACAC;MAAA;MAAA;MACA;MACA;QACA;UACA;UACA;QACA;MACA;QAAA;MAAA;IACA;IACAC;MAAA;MACA;IACA;IACAC;MAAA;MACA;MACA;MACA;MACA;MACA;MACA;IACA;IACAC;MAAA;MACAnC;QACAoC;QACAC;MACA;IACA;EACA;AACA;AAAA,2B","file":"pagesB/searchPage/searchPage.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__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: statusHeight+'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\tsearchVal:'',//输入框的值\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\tcomputed: {\r\n\t\t\t// 主题颜色\r\n\t\t\tpublicColor() {\r\n\t\t\t\treturn this.$store.state.publicColor\r\n\t\t\t},\r\n\t\t\tstatusHeight() {\r\n\t\t\t\treturn this.$store.state.statusHeight\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\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\t// if(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\t// if(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":""}