search.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <template>
  2. <view class="search-container">
  3. <view class="search-main">
  4. <view class="gosearch-btn">
  5. <text class="iconfont icon-sousuo"></text>
  6. <input class="input" maxlength="20" :focus="isFocus" type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入搜索关键字" v-model.trim="listQuery.keyword"/>
  7. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click.stop="delInputText()"></text>
  8. </view>
  9. <view class="search-btn" @click="SubMitSearch()">搜索</view>
  10. </view>
  11. <view class="search-container-history clearfix" v-if="!isShowWrapper">
  12. <view :class="'s-' + themeClass" v-if="serachRecordList.length>0">
  13. <view class="header">搜索历史<text class="iconfont icon-shanchu" @click="confirmDetele"></text></view>
  14. <view class="list">
  15. <view class="list-main">
  16. <view v-for="(item,index) in serachRecordList" :key="index" @click="keywordsClick(item.searchWord)">{{item.searchWord}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view v-else class="commodity-list-wrapper" :style="{'overflow':'auto','height':(productList.length>4? windowHeight + 'px' : 'auto')}">
  22. <scroll-view :style="{'height':(productList.length>4? scrollHeight+'px' : 'auto')}" @scrolltolower="scrolltolower" scroll-y v-if="!showEmpty">
  23. <view v-for="(pro,index) in productList" :key="index" :id="pro.id" class="product-list-type commodity-list" @click.stop="navToDetailPage(pro.productId)">
  24. <view class="product-list-image">
  25. <image class="product-image" :src="pro.image" mode=""></image>
  26. </view>
  27. <view class="product-list-msgs">
  28. <view class="product-name">{{ pro.name }}</view>
  29. <view class="product-unit">规格:10ml/盒</view>
  30. <view class="product-tags" v-if="pro.activistatus == 1"><text class="tag">活动价</text></view>
  31. <view class="product-pric">
  32. <view class="price">¥{{ pro.price | PriceFormat }}</view>
  33. <view class="carts" @click.stop="handAddCarts">
  34. <view class="carts-add">
  35. <text class="iconfont icon-gouwuche"></text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view v-if="showLoading && productList.length > 4">
  42. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow">{{loadingText}}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view>
  43. <view class="loading-wrapper loading-wrapper-btm" v-else>———<text class="btm-text">已至底部</text>———</view>
  44. </view>
  45. </scroll-view>
  46. <view class="empty-container" v-if="showEmpty">
  47. <image class="empty-container-image" :src="StaticUrl+'icon-empty-search.png'"></image>
  48. <text class="error-text">暂无搜索结果~</text>
  49. </view>
  50. </view>
  51. <!-- 操作弹窗 -->
  52. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
  53. <!-- 透明模态层 -->
  54. <modal-layer v-if='isModallayer'></modal-layer>
  55. </view>
  56. </template>
  57. <script>
  58. import { mapState,mapMutations } from 'vuex'
  59. import modalLayer from "@/components/modal-layer"
  60. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  61. import authorize from '@/common/config/authorize.js'
  62. import wxLogin from "@/common/config/wxLogin.js"
  63. export default {
  64. components: {
  65. modalLayer,
  66. uniGrader
  67. },
  68. data() {
  69. return {
  70. StaticUrl:this.$Static,
  71. shopId:0,
  72. userID:0,
  73. themeClass: 'block',
  74. show:false,
  75. userIdentity:'',
  76. searchKeyType:1,
  77. isShowClose:false, //是否显示清空输入框图标
  78. isSearchHistory:false,//是都显示搜索历史
  79. serachRecordList:[
  80. {searchWord:'奥术大师大所打'},
  81. {searchWord:'奥术大师大所打'},
  82. {searchWord:'奥术大师大所打'},
  83. {searchWord:'奥术大师大所打'},
  84. {searchWord:'奥术大师大所打'},
  85. {searchWord:'奥术大师大所打'},
  86. ],//历史搜索记录
  87. isShowWrapper:true,
  88. isModallayer:false,
  89. isFocus:false,
  90. priceLoading:true,
  91. windowHeight: '',
  92. showEmpty: false,
  93. scrollHeight: '',
  94. productList:[
  95. {
  96. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  97. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  98. activistatus:1,
  99. price:888,
  100. },
  101. {
  102. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  103. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  104. activistatus:2,
  105. price:888,
  106. },
  107. {
  108. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  109. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  110. activistatus:1,
  111. price:888,
  112. },
  113. {
  114. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  115. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  116. activistatus:2,
  117. price:888,
  118. },
  119. {
  120. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  121. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  122. activistatus:2,
  123. price:888,
  124. },
  125. {
  126. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  127. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  128. activistatus:1,
  129. price:888,
  130. },
  131. {
  132. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  133. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  134. activistatus:2,
  135. price:888,
  136. },
  137. {
  138. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  139. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  140. activistatus:1,
  141. price:888,
  142. },
  143. {
  144. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  145. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  146. activistatus:2,
  147. price:888,
  148. },
  149. {
  150. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  151. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  152. activistatus:1,
  153. price:888,
  154. },
  155. {
  156. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  157. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  158. activistatus:2,
  159. price:888,
  160. },
  161. {
  162. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  163. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  164. activistatus:1,
  165. price:888,
  166. },
  167. {
  168. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  169. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  170. activistatus:2,
  171. price:888,
  172. },
  173. {
  174. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  175. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  176. activistatus:1,
  177. price:888,
  178. },
  179. {
  180. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  181. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  182. activistatus:2,
  183. price:888,
  184. },
  185. {
  186. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  187. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  188. activistatus:1,
  189. price:888,
  190. },
  191. {
  192. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  193. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  194. activistatus:2,
  195. price:888,
  196. },
  197. {
  198. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  199. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  200. activistatus:1,
  201. price:888,
  202. },
  203. {
  204. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  205. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  206. activistatus:2,
  207. price:888,
  208. },
  209. {
  210. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  211. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  212. activistatus:1,
  213. price:888,
  214. },
  215. {
  216. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  217. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  218. activistatus:2,
  219. price:888,
  220. },
  221. {
  222. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  223. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  224. activistatus:1,
  225. price:888,
  226. },
  227. {
  228. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  229. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  230. activistatus:2,
  231. price:888,
  232. },
  233. {
  234. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  235. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  236. activistatus:1,
  237. price:888,
  238. },
  239. {
  240. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  241. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  242. activistatus:2,
  243. price:888,
  244. },
  245. {
  246. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  247. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  248. activistatus:1,
  249. price:888,
  250. },
  251. {
  252. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  253. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  254. activistatus:2,
  255. price:888,
  256. },
  257. {
  258. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  259. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  260. activistatus:1,
  261. price:888,
  262. },
  263. {
  264. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  265. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  266. activistatus:2,
  267. price:888,
  268. },
  269. {
  270. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  271. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  272. activistatus:1,
  273. price:888,
  274. },
  275. {
  276. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  277. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  278. activistatus:2,
  279. price:888,
  280. },
  281. {
  282. image:'https://img.caimei365.com/group1/M00/03/E7/Cmis21__-MOABqnlAAJUIFDLc8U188.jpg',
  283. name:'小气泡水氧嫩肤仪小气泡水氧嫩肤仪',
  284. activistatus:1,
  285. price:888,
  286. },
  287. ],//商品列表 productIds:'',//查询价格的商品ID
  288. showLoading: false,
  289. loadingNow: true,
  290. loadingText: '上拉加载更多',
  291. pullFlag: true,
  292. listQuery:{
  293. identity:0,
  294. keyword:'',
  295. sortField:'',
  296. sortType:'',
  297. pageNum: 1,
  298. pageSize: 20,
  299. },
  300. total:0,
  301. modal:false,
  302. contentModalText:'确定删除历史记录?'
  303. }
  304. },
  305. onLoad(option) {
  306. console.log(option)
  307. if(option.type =='share'){
  308. authorize.checkLogin().then(res => {
  309. wxLogin.wxLoginAuthorize()
  310. })
  311. .catch(err => {
  312. console.log(new Date +'用户未授权微信信息')
  313. })
  314. }
  315. // this.$api.getStorage().then((resolve) =>{
  316. // this.userID = resolve.userId ? resolve.userId : 0;
  317. // this.shopId = resolve.shopId ? resolve.shopId : 0;
  318. // this.userIdentity = resolve.userIdentity;
  319. // this.listQuery.identity = this.identity;
  320. // if(option.keyWord){
  321. // this.listQuery.keyword = option.keyWord
  322. // this.setSearchHistoryAdd()
  323. // this.getListFromServer()
  324. // this.isFocus = false
  325. // }else{
  326. // this.isFocus = true
  327. // this.InitGetSerachRecord()
  328. // }
  329. // })
  330. },
  331. filters: {
  332. PriceFormat:function(text) {//处理金额
  333. return Number(text).toFixed(2);
  334. },
  335. },
  336. computed: {
  337. ...mapState(['hasLogin','userInfo','identity'])
  338. },
  339. methods:{
  340. InitGetSerachRecord(){//查询搜索历史记录
  341. this.ProductService.GetProductSearchHistory({userId:this.userID}).then(response =>{
  342. if(response.code == 0){
  343. this.serachRecordList = response.data
  344. }
  345. })
  346. },
  347. SubMitSearch() {//搜索
  348. if (this.listQuery.keyword == '') {
  349. this.$util.msg('请输入搜索关键词',2000);
  350. }else{
  351. this.productList =[]
  352. this.SetSearchHistoryAdd()
  353. this.getListFromServer()
  354. this.isFocus = false
  355. }
  356. },
  357. scrolltolower() {
  358. if(this.total>this.productList.length && this.pullFlag) {
  359. this.getListFromServer(true);
  360. }
  361. },
  362. getListFromServer(loadMore) {
  363. this.showLoading = true;
  364. this.loadingNow = true;
  365. this.loadingText = '加载中';
  366. this.showEmpty = false;
  367. if(loadMore) {
  368. this.listQuery.pageNum += 1;
  369. }
  370. this.ProductService.GetProductSearchList(this.listQuery).then(response =>{
  371. this.isShowWrapper = true
  372. const resData = JSON.parse(response.data);
  373. const resList = resData.items;
  374. if(resList && resList.length > 0){
  375. this.total = resData.total;
  376. this.showEmpty = false;
  377. if(loadMore) {
  378. this.productList = [...this.productList,...resList];
  379. } else {
  380. this.productList = [...resList];
  381. }
  382. // 防上拉暴滑
  383. this.pullFlag = false;
  384. setTimeout(()=>{ this.pullFlag = true; },500)
  385. // 底部提示文案
  386. if(this.totalPage>this.productList.length) {
  387. this.loadingText = '上拉加载更多';
  388. } else {
  389. this.showLoading = true;
  390. this.loadingNow = false;
  391. }
  392. } else {
  393. if(!loadMore) {
  394. this.showEmpty = true;
  395. }
  396. }
  397. }).catch(error =>{
  398. this.$util.msg(error.msg,2000);
  399. })
  400. },
  401. SetSearchHistoryAdd(){//添加搜索记录
  402. if (!this.hasLogin) {return false;}
  403. this.ProductService.GetAddProductSearchHistory({userId: this.userID,keyword:this.listQuery.keyword}).then(response =>{
  404. //此为每次搜索同时添加用户的搜索记录
  405. }).catch(error =>{
  406. this.$util.msg(error.msg,2000);
  407. })
  408. },
  409. onShowClose () {//输入框输入时触发
  410. this.inputEmpty(this.listQuery.keyword)
  411. },
  412. onFocus () { //输入框获取焦点时触发
  413. this.inputEmpty(this.listQuery.keyword)
  414. this.InitGetSerachRecord()
  415. },
  416. delInputText () { //清除输入框内容
  417. this.listQuery.keyword = ''
  418. this.isShowClose = false
  419. this.isShowWrapper = false
  420. this.inputEmpty(this.listQuery.keyword)
  421. this.InitGetSerachRecord()
  422. },
  423. keywordsClick (item) {//关键词搜索与历史搜索
  424. this.listQuery.keyword = item;
  425. this.isShowClose = true;
  426. this.isFocus = false
  427. this.SubMitSearch();
  428. },
  429. keywordsClickPath(item){
  430. this.$api.FlooryNavigateTo(item)
  431. },
  432. confirmDetele() {//清空历史记录
  433. this.modal = true;
  434. },
  435. handleClick(e) {//用户操作订单
  436. let index = e.index;
  437. if(index == 1){
  438. this.ProductService.GetDeleteProductSearchHistory({userId:this.userID}).then(response =>{
  439. this.$util.msg('删除成功',2000,true,'success')
  440. this.serachRecordList=[];
  441. }).catch(error =>{
  442. this.$util.msg(error.msg,2000)
  443. })
  444. }
  445. this.modal = false;
  446. },
  447. hideMobel(){
  448. this.modal = false;
  449. },
  450. inputEmpty(val){
  451. this.isShowWrapper = false
  452. if(val != ''){
  453. this.isShowClose = true
  454. this.isFocus = true
  455. }else{
  456. this.isShowClose = false
  457. this.isFocus = true
  458. }
  459. },
  460. isInterceptHtmlFn(text){
  461. let name = this.$reg.interceptHtmlFn(text)
  462. return name
  463. },
  464. navToDetailPage(id) {
  465. this.isModallayer = true;
  466. this.$api.navigateTo(`/pages/goods/product?id=${id}`);
  467. this.isModallayer = false;
  468. },
  469. setScrollHeight() {
  470. const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
  471. this.windowHeight = windowHeight - 1;
  472. this.scrollHeight = windowHeight - 1;
  473. },
  474. toLoginPage() {
  475. let searchLoginType = 'search'
  476. uni.navigateTo({
  477. url:`/pages/login/login?type=${searchLoginType}`
  478. })
  479. },
  480. topBubble() {//显隐搜索项
  481. this.show = !this.show;
  482. },
  483. },
  484. onShareAppMessage(res){//分享转发
  485. if (res.from === 'button') {
  486. // 来自页面内转发按钮
  487. }
  488. return {
  489. title: `点击查看“${this.listQuery.keyword}”相关的商品`,
  490. path: `search/pages/search/search?type=share&keyWord=${this.listQuery.keyword}`
  491. }
  492. },
  493. onShow() {
  494. this.setScrollHeight();
  495. }
  496. }
  497. </script>
  498. <style lang="scss">
  499. @import "@/uni.scss";
  500. page{
  501. background-color: #F7F7F7 !important;
  502. }
  503. .search-main{
  504. width: 100%;
  505. height: 88rpx;
  506. position: fixed;
  507. top: 0;
  508. left: 0;
  509. background: #FFFFFF;
  510. z-index: 1001;
  511. box-sizing: border-box;
  512. padding: 9rpx 24rpx;
  513. .gosearch-btn{
  514. width: 604rpx;
  515. height: 100%;
  516. float: left;
  517. border-radius: 40rpx;
  518. background: #F0F0F0;
  519. margin: 0 auto;
  520. padding:0 20rpx;
  521. font-size: 28rpx;
  522. line-height: 66rpx;
  523. padding-left: 66rpx;
  524. color: #8A8A8A;
  525. background: #F7F7F7;
  526. position: relative;
  527. box-sizing: border-box;
  528. .icon-sousuo{
  529. width: 66rpx;
  530. height: 66rpx;
  531. line-height: 66rpx;
  532. text-align: center;
  533. display: block;
  534. position: absolute;
  535. left: 0;
  536. top: 0;
  537. font-size: 34rpx;
  538. color: #8A8A8A;
  539. z-index: 10;
  540. }
  541. .icon-shanchu1{
  542. font-size: 36rpx;
  543. color: #8A8A8A;
  544. position: absolute;
  545. right: 10rpx;
  546. top: 0;
  547. padding: 0 10rpx;
  548. z-index: 100;
  549. }
  550. .input{
  551. width: 400rpx;
  552. height: 100%;
  553. float: left;
  554. font-size: $font-size-24;
  555. box-sizing: border-box;
  556. padding-right: 66rpx;
  557. }
  558. }
  559. .search-btn{
  560. width: 90rpx;
  561. height: 66rpx;
  562. line-height: 66rpx;
  563. float: right;
  564. text-align: center;
  565. color: #666666;
  566. font-size: $font-size-24;
  567. }
  568. }
  569. .search-container{
  570. padding-top: 91rpx;
  571. }
  572. .search-container-history{
  573. width: 100%;
  574. height: auto;
  575. background-color: #FFFFFF;
  576. }
  577. .s-block{
  578. background: #FFFFFF;
  579. &.hot{
  580. border-top: 20rpx solid #F7F7F7;
  581. }
  582. .header{
  583. font-size: 32rpx;
  584. padding:40rpx 24rpx 22rpx 24rpx;
  585. line-height: 42rpx;
  586. font-size: 30rpx;
  587. font-weight: bold;
  588. position: relative;
  589. width: 100%;
  590. float: left;
  591. box-sizing: border-box;
  592. .icon-shanchu{
  593. font-size: 36rpx;
  594. color: #333333;
  595. float: right;
  596. padding: 0 10rpx;
  597. z-index: 10;
  598. font-weight: normal;
  599. }
  600. }
  601. .list{
  602. width: 100%;
  603. height: auot;
  604. float: left;
  605. padding: 0 24rpx 30rpx 24rpx;
  606. box-sizing: border-box;
  607. .list-title{
  608. width: 100%;
  609. height: 40rpx;
  610. font-size: $font-size-26;
  611. color: #333;
  612. }
  613. .list-main{
  614. width: 100%;
  615. float: left;
  616. display: flex;
  617. flex-wrap: wrap;
  618. view{
  619. color: #8A8A8A;
  620. font-size: 24rpx;
  621. box-sizing: border-box;
  622. text-align: center;
  623. height: 48rpx;
  624. line-height: 48rpx;
  625. border-radius: 24rpx;
  626. margin:12rpx 12rpx 12rpx 0;
  627. padding:.0 20rpx;
  628. white-space: nowrap;
  629. text-overflow: ellipsis;
  630. background-color: #F3F3F3;
  631. .iconfont{
  632. font-size: $font-size-30;
  633. color: #e15616;
  634. margin-left: 12rpx;
  635. }
  636. &.list-active{
  637. background-color: #fef6f3;
  638. color: #e15616;
  639. }
  640. }
  641. }
  642. }
  643. }
  644. .commodity-list-wrapper {
  645. box-sizing: border-box;
  646. padding: 0 24rpx;
  647. background: #FFFFFF;
  648. scroll-view {
  649. height: 100%;
  650. overflow: scroll;
  651. }
  652. .empty-container-image {
  653. margin-top: -300rpx;
  654. }
  655. .toIndexPage {
  656. bottom: 390rpx;
  657. }
  658. .show-more-btn {
  659. width: 276rpx;
  660. height: 52rpx;
  661. line-height: 52rpx;
  662. border: 2rpx solid #D8D8D8;
  663. background: #F7F7F7;
  664. font-size: 26rpx;
  665. margin: 26rpx 0;
  666. position: absolute;
  667. left: 50%;
  668. margin-left: -138rpx;
  669. }
  670. }
  671. .product-list-type {
  672. height: 246rpx;
  673. padding: 32rpx 0;
  674. box-sizing: border-box;
  675. border-bottom: 1px solid #e1e1e1;
  676. .product-list-image{
  677. width: 182rpx;
  678. height: 182rpx;
  679. box-sizing: border-box;
  680. border-radius: 8rpx;
  681. border: 1px solid #e1e1e1;
  682. float: left;
  683. .product-image{
  684. width: 180rpx;
  685. height: 180rpx;
  686. display: block;
  687. border-radius: 8rpx;
  688. }
  689. }
  690. .product-list-msgs{
  691. width: 495rpx;
  692. height: 100%;
  693. float: right;
  694. position: relative;
  695. .product-name{
  696. width: 100%;
  697. height: auto;
  698. line-height: 36rpx;
  699. text-overflow: ellipsis;
  700. overflow: hidden;
  701. display: -webkit-box;
  702. -webkit-line-clamp: 2;
  703. line-clamp: 2;
  704. -webkit-box-orient: vertical;
  705. font-size: $font-size-26;
  706. color: #333333;
  707. text-align: justify;
  708. float: left;
  709. }
  710. .product-unit{
  711. width: 100%;
  712. height: 28rpx;
  713. float: left;
  714. margin-top: 4rpx;
  715. text-align: left;
  716. line-height: 28rpx;
  717. font-size: $font-size-20;
  718. color: #999999;
  719. }
  720. .product-tags{
  721. width: 100%;
  722. height: 30rpx;
  723. margin-top: 8rpx;
  724. float: left;
  725. .tag{
  726. display: inline-block;
  727. width: 80rpx;
  728. height: 30rpx;
  729. background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png)top center no-repeat;
  730. background-size: contain;
  731. font-size: 22rpx;
  732. line-height: 30rpx;
  733. text-align: center;
  734. color: #f83c6c;
  735. float: left;
  736. }
  737. }
  738. .product-pric{
  739. width: 100%;
  740. height: 44rpx;
  741. float: left;
  742. position: absolute;
  743. bottom: -10rpx;
  744. left: 0;
  745. .price{
  746. float: left;
  747. font-size:$font-size-26;
  748. color: #f83c6c;
  749. font-weight: bold;
  750. line-height: 44rpx;
  751. }
  752. .carts{
  753. float: right;
  754. .carts-add{
  755. width: 44rpx;
  756. height: 44rpx;
  757. text-align: center;
  758. line-height: 44rpx;
  759. background-color: #ff457b;
  760. border-radius: 50%;
  761. .iconfont{
  762. font-size: 32rpx;
  763. color: #FFFFFF;
  764. }
  765. }
  766. }
  767. }
  768. }
  769. }
  770. </style>