search.vue 46 KB

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