search.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578
  1. <template>
  2. <view class="search-container">
  3. <view class="search-main">
  4. <view class="tui-header-tab">
  5. <view class="search-tab">
  6. <view class="search-tab-btn" @click="topBubble">
  7. <text>{{ tabValue }}</text> <text class="iconfont icon-xiangxiajiantou"></text>
  8. </view>
  9. <tui-bubble-popup
  10. :show="show"
  11. :mask="true"
  12. position="absolute"
  13. direction="top"
  14. @close="topBubble"
  15. width="140rpx"
  16. left="10rpx"
  17. bottom="0rpx"
  18. translateY="100%"
  19. triangleRight="60rpx"
  20. triangleTop="-22rpx"
  21. :maskBgColor="maskBgColor"
  22. >
  23. <view class="tui-menu-item" @tap="selectTabs(1)">产品</view>
  24. <!-- <view class="tui-menu-item" @tap="selectTabs(2)">供应商</view> -->
  25. <view class="tui-menu-item" @tap="selectTabs(3)">项目仪器</view>
  26. </tui-bubble-popup>
  27. </view>
  28. <view class="gosearch-btn">
  29. <text class="iconfont icon-sousuo"></text>
  30. <input
  31. class="input"
  32. maxlength="20"
  33. :focus="isFocus"
  34. type="text"
  35. value=""
  36. confirm-type="search"
  37. @focus="onFocus"
  38. @input="onShowClose"
  39. @confirm="subMitSearch()"
  40. placeholder="请输入搜索关键字"
  41. v-model.trim="listQuery.keyword"
  42. />
  43. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click.stop="delInputText()"></text>
  44. </view>
  45. <view class="search-btn" @click="subMitSearch()">搜索</view>
  46. </view>
  47. <!-- 筛选条件排序 -->
  48. <view class="tui-header-screen">
  49. <view class="tui-screen-top">
  50. <view
  51. class="tui-top-item"
  52. :class="[tabIndex == 0 ? 'tui-active' : '']"
  53. @tap="handleScreen"
  54. data-index="0"
  55. >综合</view
  56. >
  57. <view
  58. class="tui-top-item tui-icon-ml"
  59. :class="[tabIndex == 1 ? 'tui-active' : '']"
  60. data-index="1"
  61. @tap="handleScreen"
  62. >
  63. <view>销量</view> <text class="iconfont icon-shangxiajiantou" v-if="isSearchSalesFirst"></text>
  64. <template v-else>
  65. <tui-icon
  66. :name="isSearchSales ? 'turningdown' : 'turningup'"
  67. :size="18"
  68. :color="tabIndex == 1 ? '#e15616' : '#999'"
  69. tui-icon-class="tui-ml"
  70. ></tui-icon>
  71. </template>
  72. </view>
  73. <view
  74. class="tui-top-item tui-icon-ml"
  75. :class="[tabIndex == 2 ? 'tui-active' : '']"
  76. data-index="2"
  77. @tap="handleScreen"
  78. >
  79. <view>人气</view> <text class="iconfont icon-shangxiajiantou" v-if="isSearchMoodFirst"></text>
  80. <template v-else>
  81. <tui-icon
  82. :name="isSearchMood ? 'turningdown' : 'turningup'"
  83. :size="18"
  84. :color="tabIndex == 2 ? '#e15616' : '#999'"
  85. tui-icon-class="tui-ml"
  86. ></tui-icon>
  87. </template>
  88. </view>
  89. <view
  90. class="tui-top-item tui-icon-ml"
  91. :class="[tabIndex == 3 ? 'tui-active' : '']"
  92. data-index="3"
  93. @tap="handleScreen"
  94. >
  95. <view>价格</view> <text class="iconfont icon-shangxiajiantou" v-if="isSearchPriceFirst"></text>
  96. <template v-else>
  97. <tui-icon
  98. :name="isSearchPrice ? 'turningdown' : 'turningup'"
  99. :size="18"
  100. :color="tabIndex == 3 ? '#e15616' : '#999'"
  101. tui-icon-class="tui-ml"
  102. ></tui-icon>
  103. </template>
  104. </view>
  105. <view class="tui-top-item" @tap="handleScreen" data-index="4">
  106. <view>筛选</view> <text class="iconfont icon-shaixuan"></text>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <!-- 搜索历史记录 -->
  112. <view class="search-container-history" v-if="!isShowWrapper">
  113. <view :class="'s-' + themeClass" v-if="serachRecordList.length > 0">
  114. <view class="header"> 搜索历史<text class="iconfont icon-shanchu" @click="confirmDetele"></text> </view>
  115. <view class="list">
  116. <view class="list-main">
  117. <view
  118. v-for="(item, index) in serachRecordList"
  119. :key="index"
  120. @click="keywordsClick(item.searchWord)"
  121. >{{ item.searchWord }}</view
  122. >
  123. </view>
  124. </view>
  125. </view>
  126. <view class="s-block clearfix">
  127. <view class="header">热门搜索</view>
  128. <view class="list">
  129. <view class="list-title">产品</view>
  130. <view class="list-main">
  131. <view
  132. v-for="(item, index) in productHotSearch"
  133. :key="index"
  134. @click="keywordsClickPath(item)"
  135. :class="item.isHot == '1' ? 'list-active' : ''"
  136. >
  137. {{ item.name }} <text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="list">
  142. <view class="list-title">仪器</view>
  143. <view class="list-main">
  144. <view
  145. v-for="(item, index) in instrumentHotSearch"
  146. :key="index"
  147. @click="keywordsClickPath(item)"
  148. :class="item.isHot == '1' ? 'list-active' : ''"
  149. >
  150. {{ item.name }} <text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <view
  157. v-else
  158. class="commodity-list-wrapper"
  159. :style="{ overflow: 'auto', height: listData.length > 4 ? windowHeight + 'px' : 'auto' }"
  160. >
  161. <scroll-view
  162. :style="{ height: listData.length > 4 ? scrollHeight + 'px' : 'auto' }"
  163. @scrolltolower="scrolltolower"
  164. scroll-y
  165. v-if="!showEmpty"
  166. >
  167. <view
  168. v-for="(pros, index) in listData"
  169. :key="index"
  170. :id="pros.id"
  171. class="all-type-list-content commodity-list"
  172. @click.stop="navToDetailPage(pros.productId)"
  173. >
  174. <image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
  175. <view class="list-details-info">
  176. <view class="list-details-title">
  177. <text class="mclap-tag" v-if="pros.beautyActFlag == 1">美博会</text>
  178. <text class="mclap" :class="pros.beautyActFlag == 1 ? 'indent' : ''">{{
  179. isInterceptHtmlFn(pros.name)
  180. }}</text>
  181. </view>
  182. <text class="list-details-specs">规格:{{ pros.unit }}</text>
  183. <view class="list-details-specs" v-if="pros.code != '' && pros.code != null">
  184. <view>商品编码:{{ pros.code }}</view>
  185. </view>
  186. <view class="list-details-price">
  187. <template v-if="userIdentity == 3">
  188. <view class="floor-item-act">
  189. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  190. <template v-if="pros.actStatus == 1">
  191. <view class="floor-tags" v-if="PromotionsFormat(pros.promotions)">
  192. {{ pros.promotions.name }}
  193. <text v-if="hasLogin && pros.shopId == shopId && pros.priceFlag != 1"
  194. >:¥{{ pros.price | NumFormat }}</text
  195. >
  196. </view>
  197. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  198. </template>
  199. <template v-if="pros.svipProductFlag == 1">
  200. <view class="svip-tags">
  201. <view class="tags">SVIP</view>
  202. <view
  203. class="price"
  204. v-if="hasLogin && pros.shopId == shopId && pros.priceFlag != 1"
  205. >{{ pros.svipPriceTag }}</view
  206. >
  207. </view>
  208. </template>
  209. </view>
  210. </template>
  211. <template v-else-if="userIdentity == 1">
  212. <view class="floor-item-act">
  213. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  214. <template v-if="pros.actStatus == 1">
  215. <view
  216. class="floor-tags"
  217. v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
  218. >
  219. {{ pros.promotions.name }} <text>:¥{{ pros.price | NumFormat }}</text>
  220. </view>
  221. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  222. </template>
  223. <template v-if="pros.svipProductFlag == 1">
  224. <view class="svip-tags"><view class="tags none">SVIP</view> </view>
  225. </template>
  226. </view>
  227. </template>
  228. <template v-else>
  229. <view class="floor-item-act">
  230. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  231. <template v-if="pros.actStatus == 1">
  232. <view
  233. class="floor-tags"
  234. v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
  235. >
  236. {{ pros.promotions.name }}
  237. <text v-if="pros.priceFlag != 1 && hasLogin && userIdentity == 2"
  238. >:¥{{ pros.price | NumFormat }}</text
  239. >
  240. </view>
  241. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  242. </template>
  243. <template v-if="pros.svipProductFlag == 1">
  244. <view class="svip-tags">
  245. <view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
  246. <view class="price" v-if="isShowVipFlag(pros)">{{
  247. pros.svipPriceTag
  248. }}</view>
  249. </view>
  250. </template>
  251. </view>
  252. </template>
  253. <view v-if="hasLogin" class="list-price">
  254. <template v-if="userIdentity == 1">
  255. <text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
  256. <text
  257. v-else
  258. class="price-larger"
  259. :class="
  260. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'none' : ''
  261. "
  262. >
  263. ¥{{
  264. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  265. | NumFormat
  266. }}
  267. </text>
  268. </template>
  269. <template v-if="userIdentity == 4 && vipFlag != 1">
  270. <view class="price-larger" v-if="pros.priceFlag == 1">
  271. <text class="txt">¥未公开价格</text>
  272. </view>
  273. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  274. <template v-else>
  275. <view class="price-larger" v-if="pros.priceFlag == 2">
  276. <text class="txt">¥价格仅会员可见</text>
  277. </view>
  278. <text
  279. v-else
  280. class="price-larger"
  281. :class="
  282. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  283. ? 'none'
  284. : ''
  285. "
  286. >
  287. ¥{{
  288. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  289. | NumFormat
  290. }}
  291. </text>
  292. </template>
  293. </template>
  294. <template v-if="userIdentity == 3">
  295. <template v-if="pros.supplierId == shopId">
  296. <view class="price-larger" v-if="pros.priceFlag == 1">
  297. <text class="txt">¥未公开价格</text>
  298. </view>
  299. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  300. <text
  301. v-else
  302. class="price-larger"
  303. :class="
  304. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  305. ? 'none'
  306. : ''
  307. "
  308. >
  309. ¥{{
  310. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  311. | NumFormat
  312. }}
  313. </text>
  314. </template>
  315. <template v-else>
  316. <view class="list-login-now">
  317. <text class="p-no">¥</text>
  318. <uni-grader :grade="Number(pros.priceGrade)"></uni-grader>
  319. </view>
  320. </template>
  321. </template>
  322. <template v-if="userIdentity == 2 || (userIdentity == 4 && vipFlag == 1)">
  323. <view class="price-larger" v-if="pros.priceFlag == 1">
  324. <text class="txt">¥未公开价格</text>
  325. </view>
  326. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  327. <text
  328. v-else
  329. class="price-larger"
  330. :class="
  331. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'none' : ''
  332. "
  333. >
  334. ¥{{
  335. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  336. | NumFormat
  337. }}
  338. </text>
  339. </template>
  340. </view>
  341. <view v-else class="list-login-now">
  342. <text class="p-no">¥</text>
  343. <uni-grader :grade="Number(pros.priceGrade)"></uni-grader>
  344. </view>
  345. </view>
  346. </view>
  347. </view>
  348. <view v-if="showLoading && listData.length > 4">
  349. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow"
  350. >{{ loadingText }}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view
  351. >
  352. <view class="loading-wrapper loading-wrapper-btm" v-else
  353. >———<text class="btm-text">已至底部</text>———</view
  354. >
  355. </view>
  356. </scroll-view>
  357. <view class="empty-container" v-if="showEmpty">
  358. <image
  359. class="empty-container-image"
  360. src="https://img.caimei365.com/group1/M00/03/8D/Cmis215XHXWAHCoqAAELHadZ9Xg365.png"
  361. ></image>
  362. <text class="error-text">抱歉,没有相关商品!</text>
  363. </view>
  364. </view>
  365. <!--筛选条件右抽屉-->
  366. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  367. <view class="drawer-title">
  368. <view class="drawer-title-h1">品牌</view>
  369. <view class="drawer-title-p">已选中<text class="text">{{ checkedBrandLength }}</text>个品牌</view>
  370. </view>
  371. <view
  372. class="drawer-container clearfix"
  373. scroll-y
  374. :style="{ paddingBottom: isIphoneX ? '180rpx' : '146rpx' }"
  375. @scroll="drawerScroll(event)"
  376. >
  377. <scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
  378. <view class="drawer-main">
  379. <view class="drawer-main-brand clearfix">
  380. <view class="drawer-brand-list">全部</view>
  381. <view
  382. class="drawer-brand-list"
  383. :class="brand.isChecked ? 'checked':''"
  384. v-for="(brand, index) in brandLists"
  385. :key="index"
  386. @click="choiceBrand(brand,index)"
  387. >
  388. {{ brand.name }}
  389. </view>
  390. <view class="drawer-brand-more" v-if="!isShowAllBrands" @click="showAllBrands"
  391. >查看全部<text class="iconfont icon-xiangxiajiantou"></text
  392. ></view>
  393. </view>
  394. <view class="drawer-main-radio">
  395. <view class="drawer-radio-name">新品</view>
  396. <view class="drawer-radio-input" @click="choiceNewType">
  397. <text class="iconfont" :class="isChoiceNewType ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
  398. </view>
  399. </view>
  400. <view class="drawer-main-radio">
  401. <view class="drawer-radio-name">促销商品</view>
  402. <view class="drawer-radio-input" @click="choiceActiType">
  403. <text
  404. class="iconfont"
  405. :class="isChoiceActiType ? 'icon-yixuanze' : 'icon-weixuanze'"
  406. ></text>
  407. </view>
  408. </view>
  409. </view>
  410. </scroll-view>
  411. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  412. <view class="drawer-btn clear" @click="closeDrawer">重置</view>
  413. <view class="drawer-btn comfrim" @click="handSearchList">确定</view>
  414. </view>
  415. </view>
  416. </tui-drawer>
  417. <!-- 透明模态层 -->
  418. <modal-layer v-if="isModallayer"></modal-layer>
  419. </view>
  420. </template>
  421. <script>
  422. import { mapState, mapMutations } from 'vuex'
  423. import modalLayer from '@/components/modal-layer'
  424. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  425. import authorize from '@/common/config/authorize.js'
  426. import wxLogin from '@/common/config/wxLogin.js'
  427. export default {
  428. components: {
  429. modalLayer,
  430. uniGrader
  431. },
  432. data() {
  433. return {
  434. CustomBar: this.CustomBar, // 顶部导航栏高度
  435. isIphoneX: this.$store.state.isIphoneX,
  436. shopId: 0,
  437. userId: 0,
  438. tabValue: '产品',
  439. themeClass: 'block',
  440. show: false,
  441. vipFlag: 0,
  442. userIdentity: 0,
  443. searchKeyType: 1,
  444. tabIndex: 0,
  445. rightDrawer: false,
  446. isShowAllBrands: false,
  447. isSearchSalesFirst: true,
  448. isSearchMoodFirst: true,
  449. isSearchPriceFirst: true,
  450. isSearchSales: true,
  451. isSearchMood: true,
  452. isSearchPrice: true,
  453. isChoiceNewType: false,
  454. isChoiceActiType: false,
  455. isShowClose: false, //是否显示清空输入框图标
  456. isSearchHistory: false, //是都显示搜索历史
  457. serachRecordList: [], //历史搜索记录
  458. instrumentHotSearch: [],
  459. productHotSearch: [],
  460. isShowWrapper: false,
  461. isModallayer: false,
  462. isFocus: false,
  463. priceLoading: true,
  464. windowHeight: '',
  465. showEmpty: false,
  466. scrollHeight: '',
  467. listData: [],
  468. brandLists: [
  469. { name: '斯蒂芬斯',isChecked:false },
  470. { name: 'Beautsecre',isChecked:false },
  471. { name: '意大利DEP',isChecked:false },
  472. { name: '美生美',isChecked:false },
  473. { name: '三诺激光',isChecked:false },
  474. { name: '三诺激光',isChecked:false },
  475. { name: '三诺激光三诺激光',isChecked:false },
  476. { name: '三诺激光三诺激光三诺激光',isChecked:false }
  477. ],
  478. checkedBrandList:[],
  479. checkedBrandLength:0,
  480. productIds: '', //查询价格的商品ID
  481. showLoading: false,
  482. loadingNow: true,
  483. loadingText: '上拉加载更多',
  484. pullFlag: true,
  485. listQuery: {
  486. identity: 0,
  487. keyword: '',
  488. pageNum: 1,
  489. pageSize: 20,
  490. sortField: '',
  491. sortType: 1,
  492. newType: 1,
  493. actiType: 1
  494. },
  495. total: 0,
  496. height:0,
  497. drawerH:0 // 抽屉内部scrollview高度
  498. }
  499. },
  500. computed: {
  501. ...mapState(['hasLogin', 'userInfo', 'isWxAuthorize', 'hasLogin', 'userInfo', 'identity']),
  502. },
  503. onLoad(option) {
  504. console.log(option)
  505. if (option.type == 'share') {
  506. wxLogin.wxLoginAuthorize()
  507. }
  508. this.initGetStotage(option)
  509. },
  510. filters: {
  511. NumFormat: function(text) {
  512. //处理金额
  513. return Number(text).toFixed(2)
  514. }
  515. },
  516. methods: {
  517. async initGetStotage(option) {
  518. const userInfo = await this.$api.getStorage()
  519. this.userId = userInfo.userId ? userInfo.userId : 0
  520. this.shopId = userInfo.shopId ? userInfo.shopId : 0
  521. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  522. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  523. this.listQuery.identity = this.identity
  524. if (option.keyWord) {
  525. this.listQuery.keyword = option.keyWord
  526. this.setSearchHistoryAdd()
  527. this.getListFromServer()
  528. this.isFocus = false
  529. } else {
  530. this.isFocus = true
  531. this.initGetSerachRecord()
  532. }
  533. },
  534. GetHomeHotSearchTerms() {
  535. //金刚区分类
  536. this.CommonService.GetHomeHotSearchTerms({})
  537. .then(response => {
  538. let data = response.data
  539. console.log(data)
  540. this.instrumentHotSearch = data.instrumentHotSearch
  541. this.productHotSearch = data.productHotSearch
  542. })
  543. .catch(error => {
  544. this.$util.msg(error.msg, 2000)
  545. })
  546. },
  547. initGetSerachRecord() {
  548. //查询搜索历史记录
  549. this.ProductService.GetProductSearchHistory({ userId: this.userId }).then(response => {
  550. if (response.code == 0) {
  551. this.serachRecordList = response.data
  552. }
  553. })
  554. },
  555. subMitSearch() {
  556. //搜索
  557. if (this.listQuery.keyword == '') {
  558. this.$util.msg('请输入搜索关键词', 2000)
  559. } else {
  560. switch (this.searchKeyType) {
  561. case 1:
  562. this.listData = []
  563. this.setSearchHistoryAdd()
  564. this.getListFromServer()
  565. this.isFocus = false
  566. // 友盟埋点商品搜索点击
  567. if (process.env.NODE_ENV != 'development') {
  568. this.$uma.trackEvent('Um_Event_SearchProductSubmit', {
  569. Um_Key_Keyword: `${this.listQuery.keyword}`,
  570. Um_Key_PageName: '商品',
  571. Um_Key_SourcePage: '搜索商品'
  572. })
  573. }
  574. break
  575. case 2:
  576. this.setSearchHistoryAdd()
  577. this.$api.navigateTo(`/pages/search/search-supplier?keyWord=${this.listQuery.keyword}`)
  578. break
  579. case 3:
  580. this.setSearchHistoryAdd()
  581. this.$api.navigateTo(`/pages/search/search-instrument?keyWord=${this.listQuery.keyword}`)
  582. break
  583. }
  584. }
  585. },
  586. scrolltolower() {
  587. if (this.total > this.listData.length && this.pullFlag) {
  588. this.getListFromServer(true)
  589. }
  590. },
  591. getListFromServer(loadMore) {
  592. this.showLoading = true
  593. this.loadingNow = true
  594. this.loadingText = '加载中'
  595. this.showEmpty = false
  596. if (loadMore) {
  597. this.listQuery.pageNum += 1
  598. }
  599. this.ProductService.GetProductSearchList(this.listQuery)
  600. .then(response => {
  601. this.isShowWrapper = true
  602. const resData = JSON.parse(response.data)
  603. const resList = resData.items
  604. if (resList && resList.length > 0) {
  605. this.total = resData.total
  606. this.showEmpty = false
  607. if (loadMore) {
  608. this.listData = [...this.listData, ...resList]
  609. this.getProductPrice()
  610. } else {
  611. this.listData = [...resList]
  612. this.getProductPrice()
  613. }
  614. // 防上拉暴滑
  615. this.pullFlag = false
  616. setTimeout(() => {
  617. this.pullFlag = true
  618. }, 500)
  619. // 底部提示文案
  620. if (this.totalPage > this.listData.length) {
  621. this.loadingText = '上拉加载更多'
  622. } else {
  623. this.showLoading = true
  624. this.loadingNow = false
  625. }
  626. } else {
  627. if (!loadMore) {
  628. this.showEmpty = true
  629. }
  630. }
  631. })
  632. .catch(error => {
  633. this.$util.msg(error.msg, 2000)
  634. })
  635. },
  636. setSearchHistoryAdd() {
  637. //添加搜索记录
  638. if (!this.hasLogin) {
  639. return false
  640. }
  641. this.ProductService.GetAddProductSearchHistory({ userId: this.userId, keyword: this.listQuery.keyword })
  642. .then(response => {
  643. //此为每次搜索同时添加用户的搜索记录
  644. })
  645. .catch(error => {
  646. this.$util.msg(error.msg, 2000)
  647. })
  648. },
  649. getProductPrice() {
  650. //获取价格
  651. let productIdArr = []
  652. this.listData.map(item => {
  653. // 0公开价格 1不公开价格 2仅对资质机构公开
  654. productIdArr.push(item.productId)
  655. })
  656. this.productIds = productIdArr.join(',')
  657. this.ProductService.querySearchProductPrice({
  658. userId: this.userId,
  659. productIds: this.productIds,
  660. source: 2 // 来源 1 WWW 2 小程序
  661. })
  662. .then(response => {
  663. if (response.data) {
  664. this.listData = this.ReturnNewProducts(this.listData, response.data)
  665. }
  666. this.priceLoading = false
  667. })
  668. .catch(error => {
  669. this.$util.msg(error.msg, 2000)
  670. })
  671. },
  672. ReturnNewProducts(Array, list) {
  673. //处理对应商品ID的商品价格
  674. let NewArray = []
  675. Array.map(item => {
  676. for (let i = 0; i < list.length; i++) {
  677. if (item.productId == list[i].productId) {
  678. NewArray.push(Object.assign(item, list[i]))
  679. }
  680. }
  681. })
  682. return NewArray
  683. },
  684. handleScreen(e) {
  685. let index = e.currentTarget.dataset.index
  686. console.log(index)
  687. if (index == 0) {
  688. this.tabIndex = 0
  689. this.isSearchSalesFirst = true
  690. this.isSearchMoodFirst = true
  691. this.isSearchPriceFirst = true
  692. this.listQuery.sortType = 1
  693. this.listQuery.sortField = ''
  694. } else if (index == 1) {
  695. this.tabIndex = 1
  696. this.isSearchSalesFirst = false
  697. this.isSearchMoodFirst = true
  698. this.isSearchPriceFirst = true
  699. this.isSearchSales = !this.isSearchSales
  700. if (this.isSearchSales) {
  701. this.listQuery.sortType = 1
  702. } else {
  703. this.listQuery.sortType = 0
  704. }
  705. this.listQuery.sortField = 'p_sales'
  706. } else if (index == 2) {
  707. this.tabIndex = 2
  708. this.isSearchSalesFirst = true
  709. this.isSearchPriceFirst = true
  710. this.isSearchMoodFirst = false
  711. this.isSearchMood = !this.isSearchMood
  712. if (this.isSearchMood) {
  713. this.listQuery.sortType = 1
  714. } else {
  715. this.listQuery.sortType = 0
  716. }
  717. this.listQuery.sortField = 'p_favorite'
  718. } else if (index == 3) {
  719. this.tabIndex = 3
  720. this.isSearchSalesFirst = true
  721. this.isSearchMoodFirst = true
  722. this.isSearchPriceFirst = false
  723. this.isSearchPrice = !this.isSearchPrice
  724. if (this.isSearchPrice) {
  725. this.listQuery.sortType = 1
  726. } else {
  727. this.listQuery.sortType = 0
  728. }
  729. this.listQuery.sortField = 'p_price'
  730. } else if (index == 4) {
  731. this.showRightDrawer()
  732. }
  733. this.getListFromServer()
  734. },
  735. showRightDrawer() {
  736. //弹出右侧抽屉
  737. this.rightDrawer = true
  738. },
  739. closeDrawer(e) {
  740. //关闭抽屉
  741. this.rightDrawer = false
  742. },
  743. PromotionsFormat(promo) {
  744. //促销活动类型数据处理
  745. if (promo != null) {
  746. if (promo.type == 1 && promo.mode == 1) {
  747. return true
  748. } else {
  749. return false
  750. }
  751. }
  752. return false
  753. },
  754. isShowVipFlag(pros) {
  755. // 超级会员价格显示控制
  756. if (this.hasLogin && pros.priceFlag != 1) {
  757. if (this.userIdentity == 4 && this.vipFlag == 1) {
  758. return true
  759. } else if (this.userIdentity == 2) {
  760. return true
  761. }
  762. }
  763. },
  764. onShowClose() {
  765. //输入框输入时触发
  766. this.inputEmpty(this.listQuery.keyword)
  767. },
  768. onFocus() {
  769. //输入框获取焦点时触发
  770. this.inputEmpty(this.listQuery.keyword)
  771. this.initGetSerachRecord()
  772. },
  773. delInputText() {
  774. //清除输入框内容
  775. this.listQuery.keyword = ''
  776. this.isShowClose = false
  777. this.isShowWrapper = false
  778. this.inputEmpty(this.listQuery.keyword)
  779. this.initGetSerachRecord()
  780. },
  781. keywordsClick(item) {
  782. //关键词搜索与历史搜索
  783. this.listQuery.keyword = item
  784. this.isShowClose = true
  785. this.isFocus = false
  786. this.subMitSearch()
  787. },
  788. keywordsClickPath(item) {
  789. this.$api.FlooryNavigateTo(item)
  790. },
  791. confirmDetele() {
  792. //清空历史记录
  793. this.$util.modal('提示', '确定删除历史记录?', '确定', '取消', true, () => {
  794. this.ProductService.GetDeleteProductSearchHistory({ userId: this.userId })
  795. .then(response => {
  796. this.$util.msg('删除成功', 2000, true, 'success')
  797. this.serachRecordList = []
  798. })
  799. .catch(error => {
  800. this.$util.msg(error.msg, 2000)
  801. })
  802. })
  803. },
  804. inputEmpty(val) {
  805. this.isShowWrapper = false
  806. if (val != '') {
  807. this.isShowClose = true
  808. this.isFocus = true
  809. } else {
  810. this.isShowClose = false
  811. this.isFocus = true
  812. }
  813. },
  814. isInterceptHtmlFn(text) {
  815. let name = this.$reg.interceptHtmlFn(text)
  816. return name
  817. },
  818. navToDetailPage(id) {
  819. this.isModallayer = true
  820. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  821. this.isModallayer = false
  822. },
  823. setScrollHeight() {
  824. let obj = {}
  825. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  826. uni.getSystemInfo({
  827. success: res => {
  828. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  829. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  830. }
  831. })
  832. this.windowHeight = windowHeight - 1
  833. this.scrollHeight = windowHeight - 1
  834. },
  835. toLoginPage() {
  836. let searchLoginType = 'search'
  837. uni.navigateTo({
  838. url: `/pages/login/login?type=${searchLoginType}`
  839. })
  840. },
  841. selectTabs(index) {
  842. //选择搜索项
  843. this.show = false
  844. this.searchKeyType = index
  845. switch (index) {
  846. case 1:
  847. this.tabValue = '产品'
  848. break
  849. case 2:
  850. this.tabValue = '供应商'
  851. break
  852. case 3:
  853. this.tabValue = '项目仪器'
  854. break
  855. }
  856. },
  857. showAllBrands() {
  858. // 查看全部品牌
  859. this.isShowAllBrands = true
  860. },
  861. choiceBrand(brand,index) {
  862. // 选择品牌
  863. brand.isChecked = !brand.isChecked
  864. if(brand.isChecked){
  865. this.checkedBrandList.push(brand)
  866. }else{
  867. this.checkedBrandList.splice(index,1)
  868. }
  869. this.checkedBrandLength = this.checkedBrandList.length
  870. console.log('checkedBrandList',this.checkedBrandList)
  871. },
  872. choiceNewType() {
  873. // 选择筛选项新品
  874. this.isChoiceNewType = !this.isChoiceNewType
  875. },
  876. choiceActiType() {
  877. // 选择筛选项促销商品
  878. this.isChoiceActiType = !this.isChoiceActiType
  879. },
  880. topBubble() {
  881. //显隐搜索项
  882. this.show = !this.show
  883. }
  884. },
  885. onShareAppMessage(res) {
  886. //分享转发
  887. if (res.from === 'button') {
  888. // 来自页面内转发按钮
  889. }
  890. return {
  891. title: `点击查看“${this.listQuery.keyword}”相关的商品`,
  892. path: `pages/search/search?type=share&keyWord=${this.listQuery.keyword}`
  893. }
  894. },
  895. onShow() {
  896. this.setScrollHeight()
  897. this.GetHomeHotSearchTerms()
  898. }
  899. }
  900. </script>
  901. <style lang="scss">
  902. @import '@/uni.scss';
  903. page {
  904. background-color: #f7f7f7 !important;
  905. }
  906. .search-main {
  907. width: 100%;
  908. height: 88rpx;
  909. position: fixed;
  910. top: 0;
  911. left: 0;
  912. background: #ffffff;
  913. z-index: 1001;
  914. box-sizing: border-box;
  915. .tui-header-tab {
  916. height: 88rpx;
  917. box-sizing: border-box;
  918. padding: 9rpx 0;
  919. float: left;
  920. .search-tab {
  921. width: 160rpx;
  922. height: 70rpx;
  923. line-height: 70rpx;
  924. color: #666666;
  925. font-size: $font-size-24;
  926. text-align: center;
  927. float: left;
  928. position: relative;
  929. .icon-xiangxiajiantou {
  930. margin-left: 10rpx;
  931. font-size: $font-size-30;
  932. }
  933. }
  934. .gosearch-btn {
  935. width: 470rpx;
  936. height: 100%;
  937. float: left;
  938. border-radius: 40rpx;
  939. background: #f0f0f0;
  940. margin: 0 auto;
  941. padding: 0 20rpx;
  942. font-size: 28rpx;
  943. line-height: 70rpx;
  944. padding-left: 70rpx;
  945. color: #8a8a8a;
  946. background: #f7f7f7;
  947. position: relative;
  948. box-sizing: border-box;
  949. .icon-sousuo {
  950. width: 70rpx;
  951. height: 70rpx;
  952. line-height: 70rpx;
  953. text-align: center;
  954. display: block;
  955. position: absolute;
  956. left: 0;
  957. top: 0;
  958. font-size: 34rpx;
  959. color: #8a8a8a;
  960. z-index: 10;
  961. }
  962. .icon-shanchu1 {
  963. font-size: 36rpx;
  964. color: #8a8a8a;
  965. position: absolute;
  966. right: 10rpx;
  967. top: 0;
  968. padding: 0 10rpx;
  969. z-index: 100;
  970. }
  971. .input {
  972. width: 400rpx;
  973. height: 100%;
  974. float: left;
  975. font-size: $font-size-24;
  976. box-sizing: border-box;
  977. padding-right: 66rpx;
  978. }
  979. }
  980. .search-btn {
  981. width: 120rpx;
  982. height: 70rpx;
  983. line-height: 70rpx;
  984. float: right;
  985. text-align: center;
  986. color: #666666;
  987. font-size: $font-size-24;
  988. }
  989. }
  990. }
  991. .search-container {
  992. padding-top: 89rpx;
  993. }
  994. /*screen*/
  995. .tui-header-screen {
  996. width: 100%;
  997. height: 88rpx;
  998. float: left;
  999. box-sizing: border-box;
  1000. background: #fff;
  1001. }
  1002. .tui-screen-top,
  1003. .tui-screen-bottom {
  1004. display: flex;
  1005. align-items: center;
  1006. justify-content: space-between;
  1007. font-size: 28rpx;
  1008. color: #999999;
  1009. }
  1010. .tui-screen-top {
  1011. height: 88rpx;
  1012. position: relative;
  1013. background: #fff;
  1014. border-bottom: 1px solid #efefef;
  1015. }
  1016. .tui-top-item {
  1017. height: 28rpx;
  1018. line-height: 28rpx;
  1019. flex: 1;
  1020. display: flex;
  1021. align-items: center;
  1022. justify-content: center;
  1023. }
  1024. .icon-shangxiajiantou {
  1025. font-size: 20rpx;
  1026. color: #999999;
  1027. margin-left: 8rpx;
  1028. }
  1029. .tui-topitem-active {
  1030. color: #e15616;
  1031. }
  1032. .tui-screen-bottom {
  1033. height: 100rpx;
  1034. padding: 0 30rpx;
  1035. box-sizing: border-box;
  1036. font-size: 24rpx;
  1037. align-items: center;
  1038. overflow: hidden;
  1039. }
  1040. .tui-bottom-text {
  1041. line-height: 26rpx;
  1042. max-width: 82%;
  1043. white-space: nowrap;
  1044. overflow: hidden;
  1045. text-overflow: ellipsis;
  1046. }
  1047. .tui-bottom-item {
  1048. flex: 1;
  1049. width: 0;
  1050. display: flex;
  1051. align-items: center;
  1052. justify-content: center;
  1053. padding: 0 12rpx;
  1054. box-sizing: border-box;
  1055. background: #f7f7f7;
  1056. margin-right: 20rpx;
  1057. white-space: nowrap;
  1058. height: 60rpx;
  1059. border-radius: 40rpx;
  1060. }
  1061. .tui-bottom-item:last-child {
  1062. margin-right: 0;
  1063. }
  1064. .tui-btmItem-active {
  1065. background: #fcedea !important;
  1066. color: #e15616;
  1067. font-weight: bold;
  1068. position: relative;
  1069. }
  1070. .tui-btmItem-active::after {
  1071. content: '';
  1072. position: absolute;
  1073. border: 1rpx solid #e15616;
  1074. width: 100%;
  1075. height: 100%;
  1076. border-radius: 40rpx;
  1077. left: 0;
  1078. top: 0;
  1079. }
  1080. .tui-btmItem-tap {
  1081. position: relative;
  1082. border-bottom-left-radius: 0;
  1083. border-bottom-right-radius: 0;
  1084. }
  1085. .tui-btmItem-tap::after {
  1086. content: '';
  1087. position: absolute;
  1088. width: 100%;
  1089. height: 22rpx;
  1090. background: #f7f7f7;
  1091. left: 0;
  1092. top: 58rpx;
  1093. }
  1094. .tui-active {
  1095. color: #e15616;
  1096. }
  1097. .tui-icon-ml .tui-icon-class {
  1098. margin-left: 6rpx;
  1099. }
  1100. .tui-ml {
  1101. margin-left: 6rpx;
  1102. }
  1103. .tui-seizeaseat-20 {
  1104. height: 20rpx;
  1105. }
  1106. .tui-seizeaseat-30 {
  1107. height: 30rpx;
  1108. }
  1109. .tui-icon-middle .tui-icon-class {
  1110. vertical-align: middle;
  1111. }
  1112. .tui-middle {
  1113. vertical-align: middle;
  1114. }
  1115. .search-container-history {
  1116. width: 100%;
  1117. min-height: 300rpx;
  1118. position: fixed;
  1119. top: 88rpx;
  1120. left: 0;
  1121. z-index: 9999;
  1122. }
  1123. .s-block {
  1124. background: #ffffff;
  1125. .header {
  1126. font-size: 32rpx;
  1127. padding: 40rpx 24rpx 22rpx 24rpx;
  1128. line-height: 42rpx;
  1129. font-size: 30rpx;
  1130. font-weight: bold;
  1131. position: relative;
  1132. width: 100%;
  1133. float: left;
  1134. box-sizing: border-box;
  1135. .icon-shanchu {
  1136. font-size: 36rpx;
  1137. color: #333333;
  1138. float: right;
  1139. padding: 0 10rpx;
  1140. z-index: 10;
  1141. font-weight: normal;
  1142. }
  1143. }
  1144. .list {
  1145. width: 100%;
  1146. height: auot;
  1147. float: left;
  1148. padding: 0 24rpx 30rpx 24rpx;
  1149. box-sizing: border-box;
  1150. .list-title {
  1151. width: 100%;
  1152. height: 40rpx;
  1153. font-size: $font-size-26;
  1154. color: #333;
  1155. }
  1156. .list-main {
  1157. width: 100%;
  1158. float: left;
  1159. display: flex;
  1160. flex-wrap: wrap;
  1161. view {
  1162. color: #8a8a8a;
  1163. font-size: 24rpx;
  1164. box-sizing: border-box;
  1165. text-align: center;
  1166. height: 48rpx;
  1167. line-height: 48rpx;
  1168. border-radius: 24rpx;
  1169. margin: 12rpx 12rpx 12rpx 0;
  1170. padding: 0 20rpx;
  1171. white-space: nowrap;
  1172. text-overflow: ellipsis;
  1173. background-color: #f3f3f3;
  1174. .iconfont {
  1175. font-size: $font-size-30;
  1176. color: #e15616;
  1177. margin-left: 12rpx;
  1178. }
  1179. &.list-active {
  1180. background-color: #fef6f3;
  1181. color: #e15616;
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187. .s-circle {
  1188. margin-top: 30rpx;
  1189. .header {
  1190. font-size: 32rpx;
  1191. padding: 30rpx;
  1192. border-bottom: 2rpx solid #f9f9f9;
  1193. position: relative;
  1194. image {
  1195. width: 36rpx;
  1196. height: 36rpx;
  1197. padding: 10rpx;
  1198. position: absolute;
  1199. right: 40rpx;
  1200. top: 24rpx;
  1201. }
  1202. }
  1203. .list {
  1204. display: flex;
  1205. flex-wrap: wrap;
  1206. padding: 0 30rpx 20rpx;
  1207. view {
  1208. padding: 8rpx 30rpx;
  1209. margin: 20rpx 30rpx 0 0;
  1210. font-size: 28rpx;
  1211. color: #8a8a8a;
  1212. background-color: #f7f7f7;
  1213. box-sizing: border-box;
  1214. text-align: center;
  1215. border-radius: 20rpx;
  1216. }
  1217. }
  1218. }
  1219. .wanted-block {
  1220. margin-top: 30rpx;
  1221. .header {
  1222. font-size: 32rpx;
  1223. padding: 30rpx;
  1224. }
  1225. .list {
  1226. display: flex;
  1227. flex-wrap: wrap;
  1228. view {
  1229. width: 50%;
  1230. color: #8a8a8a;
  1231. font-size: 28rpx;
  1232. box-sizing: border-box;
  1233. text-align: center;
  1234. padding: 20rpx 0;
  1235. border-top: 2rpx solid #fff;
  1236. border-left: 2rpx solid #fff;
  1237. background-color: #f7f7f7;
  1238. overflow: hidden;
  1239. white-space: nowrap;
  1240. text-overflow: ellipsis;
  1241. }
  1242. }
  1243. }
  1244. .wanted-circle {
  1245. margin-top: 30rpx;
  1246. .header {
  1247. font-size: 32rpx;
  1248. padding: 30rpx;
  1249. }
  1250. .list {
  1251. display: flex;
  1252. flex-wrap: wrap;
  1253. padding: 0 30rpx 20rpx;
  1254. view {
  1255. padding: 8rpx 30rpx;
  1256. margin: 20rpx 30rpx 0 0;
  1257. font-size: 28rpx;
  1258. color: #8a8a8a;
  1259. background-color: #f7f7f7;
  1260. box-sizing: border-box;
  1261. text-align: center;
  1262. border-radius: 20rpx;
  1263. }
  1264. }
  1265. }
  1266. .commodity-list-wrapper {
  1267. padding-top: 88rpx;
  1268. scroll-view {
  1269. height: 100%;
  1270. overflow: scroll;
  1271. }
  1272. .empty-container-image {
  1273. margin-top: -300rpx;
  1274. }
  1275. .toIndexPage {
  1276. bottom: 390rpx;
  1277. }
  1278. .show-more-btn {
  1279. width: 276rpx;
  1280. height: 52rpx;
  1281. line-height: 52rpx;
  1282. border: 2rpx solid #d8d8d8;
  1283. background: #f7f7f7;
  1284. font-size: 26rpx;
  1285. margin: 26rpx 0;
  1286. position: absolute;
  1287. left: 50%;
  1288. margin-left: -138rpx;
  1289. }
  1290. }
  1291. .all-type-list-content {
  1292. height: 216rpx;
  1293. padding: 24rpx;
  1294. background: #fff;
  1295. margin-bottom: 2rpx;
  1296. display: flex;
  1297. flex-direction: row;
  1298. box-sizing: content-box;
  1299. .list-img {
  1300. width: 210rpx;
  1301. height: 218rpx !important;
  1302. margin-right: 26rpx;
  1303. border-radius: 10rpx;
  1304. border: 2rpx solid #f3f3f3;
  1305. }
  1306. }
  1307. .list-details-info {
  1308. width: 466rpx;
  1309. display: flex;
  1310. flex-direction: column;
  1311. font-size: 26rpx;
  1312. position: relative;
  1313. .list-details-title {
  1314. position: relative;
  1315. .mclap {
  1316. line-height: 38rpx;
  1317. text-overflow: ellipsis;
  1318. overflow: hidden;
  1319. display: -webkit-box;
  1320. -webkit-line-clamp: 2;
  1321. line-clamp: 2;
  1322. -webkit-box-orient: vertical;
  1323. &.indent {
  1324. text-indent: 95rpx;
  1325. }
  1326. }
  1327. .mclap-tag {
  1328. display: block;
  1329. width: 84rpx;
  1330. height: 32rpx;
  1331. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1332. border-radius: 4rpx 48rpx 4px 4px;
  1333. line-height: 32rpx;
  1334. font-size: $font-size-22;
  1335. color: #ffffff;
  1336. text-align: center;
  1337. position: absolute;
  1338. left: 0;
  1339. top: 0;
  1340. }
  1341. }
  1342. .list-details-specs {
  1343. margin-top: 8rpx;
  1344. color: #666666;
  1345. }
  1346. .list-details-miniQuantity {
  1347. margin-top: 7rpx;
  1348. }
  1349. }
  1350. .list-details-price {
  1351. width: 100%;
  1352. height: 54rpx;
  1353. line-height: 54rpx;
  1354. position: absolute;
  1355. bottom: -10rpx;
  1356. right: 0;
  1357. .floor-item-act {
  1358. height: 54rpx;
  1359. text-align: center;
  1360. box-sizing: border-box;
  1361. float: right;
  1362. padding: 11rpx 0;
  1363. }
  1364. .price-icon {
  1365. width: 22rpx;
  1366. height: 28rpx;
  1367. vertical-align: middle;
  1368. margin-right: 10rpx;
  1369. }
  1370. .price-icon + text {
  1371. font-size: 25rpx;
  1372. vertical-align: middle;
  1373. }
  1374. .list-login-now {
  1375. color: #f8c499;
  1376. float: left;
  1377. line-height: 54rpx;
  1378. .p-no {
  1379. float: left;
  1380. font-size: $font-size-24;
  1381. color: $text-color;
  1382. }
  1383. }
  1384. .login-now {
  1385. padding: 10rpx 10rpx 10rpx 0;
  1386. }
  1387. .list-price {
  1388. color: #ff2a2a;
  1389. height: 44rpx;
  1390. float: left;
  1391. .price-larger {
  1392. width: 100%;
  1393. font-size: 32rpx;
  1394. &.none {
  1395. text-decoration: line-through;
  1396. color: #999999;
  1397. }
  1398. &.small {
  1399. font-size: $font-size-24;
  1400. }
  1401. .txt {
  1402. font-size: $font-size-24;
  1403. display: inline-block;
  1404. line-height: 44rpx;
  1405. text-align: left;
  1406. float: left;
  1407. }
  1408. }
  1409. }
  1410. }
  1411. // 筛选抽屉样式
  1412. .drawer-title {
  1413. width: 580rpx;
  1414. height: 72rpx;
  1415. line-height: 72rpx;
  1416. box-sizing: border-box;
  1417. padding: 0 30rpx;
  1418. background-color: #f7f7f7;
  1419. position: fixed;
  1420. top: 0;
  1421. left: 0;
  1422. z-index: 99;
  1423. .drawer-title-h1 {
  1424. font-size: $font-size-26;
  1425. color: #e15616;
  1426. font-weight: bold;
  1427. text-align: left;
  1428. float: left;
  1429. }
  1430. .drawer-title-p {
  1431. font-size: $font-size-24;
  1432. float: right;
  1433. color: #333333;
  1434. .text {
  1435. color: #e15616;
  1436. }
  1437. }
  1438. }
  1439. .drawer-container {
  1440. width: 580rpx;
  1441. height: 100%;
  1442. box-sizing: border-box;
  1443. background-color: #f7f7f7;
  1444. overflow: hidden;
  1445. position: relative;
  1446. padding-top: 72rpx;
  1447. .drawer-main {
  1448. width: 100%;
  1449. height: auto;
  1450. box-sizing: border-box;
  1451. .drawer-main-brand {
  1452. width: 100%;
  1453. height: auto;
  1454. box-sizing: border-box;
  1455. padding: 12rpx 24rpx 24rpx 24rpx;
  1456. background-color: #ffffff;
  1457. .drawer-brand-list {
  1458. width: 160rpx;
  1459. height: 56rpx;
  1460. line-height: 56rpx;
  1461. text-align: center;
  1462. font-size: 26rpx;
  1463. background-color: #f7f7f7;
  1464. color: #999999;
  1465. border-radius: 30rpx;
  1466. box-sizing: border-box;
  1467. padding: 0 15rpx;
  1468. float: left;
  1469. margin: 12rpx 24rpx 12rpx 0;
  1470. text-overflow: ellipsis;
  1471. overflow: hidden;
  1472. display: -webkit-box;
  1473. -webkit-line-clamp: 1;
  1474. line-clamp: 1;
  1475. -webkit-box-orient: vertical;
  1476. &.checked{
  1477. background-color: #FEF6F3;
  1478. color: #E15616;
  1479. }
  1480. &:nth-child(3n) {
  1481. margin-right: 0;
  1482. }
  1483. }
  1484. .drawer-brand-more {
  1485. width: 100%;
  1486. height: 42rpx;
  1487. line-height: 42rpx;
  1488. float: left;
  1489. font-size: $font-size-24;
  1490. color: #999999;
  1491. text-align: center;
  1492. }
  1493. }
  1494. .drawer-main-radio {
  1495. width: 100%;
  1496. height: 72rpx;
  1497. background-color: #ffffff;
  1498. margin-top: 20rpx;
  1499. box-sizing: border-box;
  1500. padding: 0 24rpx;
  1501. .drawer-radio-name {
  1502. float: left;
  1503. line-height: 72rpx;
  1504. font-size: $font-size-26;
  1505. color: #333333;
  1506. }
  1507. .drawer-radio-input {
  1508. width: 72rpx;
  1509. height: 72rpx;
  1510. float: right;
  1511. line-height: 72rpx;
  1512. text-align: right;
  1513. .iconfont {
  1514. font-size: $font-size-36;
  1515. &.icon-weixuanze {
  1516. color: #b2b2b2;
  1517. }
  1518. &.icon-yixuanze {
  1519. color: #e15616;
  1520. }
  1521. }
  1522. }
  1523. }
  1524. }
  1525. .drawer-input {
  1526. width: 100%;
  1527. float: left;
  1528. box-sizing: border-box;
  1529. padding: 24rpx 10rpx 0 10rpx;
  1530. border: 1px solid rgba(0, 0, 0, 0.2);
  1531. border-radius: 4rpx;
  1532. position: relative;
  1533. background-color: #ffffff;
  1534. &.btn {
  1535. border: none;
  1536. display: flex;
  1537. position: fixed;
  1538. left: 0;
  1539. bottom: 0;
  1540. }
  1541. .drawer-btn {
  1542. width: 210rpx;
  1543. height: 84rpx;
  1544. border-radius: 42rpx;
  1545. background: $btn-confirm;
  1546. line-height: 84rpx;
  1547. text-align: center;
  1548. font-size: $font-size-26;
  1549. color: #ffffff;
  1550. flex: 1;
  1551. margin: 0 10rpx;
  1552. &.comfrim {
  1553. background: $btn-confirm;
  1554. }
  1555. &.clear {
  1556. background: #ffe6dc;
  1557. color: #e15616;
  1558. }
  1559. }
  1560. }
  1561. }
  1562. </style>