search.vue 66 KB

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