search.vue 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884
  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="handleSearchQuery"
  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="handleSearchQuery">搜索</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 ? '#FF5B00' : '#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 ? '#FF5B00' : '#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 ? '#FF5B00' : '#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="hasLogin && ((userIdentity === 4 && pros.priceFlag === 0) || (userIdentity === 2 && pros.priceFlag !== 1))">
  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. <!-- ross弹窗 -->
  486. <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml"></cmRossPopup>
  487. <!-- 透明模态层 -->
  488. <modal-layer v-if="isModallayer"></modal-layer>
  489. </view>
  490. </template>
  491. <script>
  492. import { mapState } from 'vuex'
  493. import modalLayer from '@/components/modal-layer'
  494. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  495. import cmRossPopup from '@/components/cm-module/cm-ross/cm-ross-popup'
  496. import wxLogin from '@/common/config/wxLogin.js'
  497. import { debounce } from '@/common/config/common.js'
  498. import cmSrsMixins from '@/utils/cmSrsMixins.js'
  499. const myDebounce = fn => debounce(fn, 500, false)
  500. export default {
  501. components: {
  502. modalLayer,
  503. uniGrader,
  504. cmRossPopup
  505. },
  506. mixins: [cmSrsMixins],
  507. data() {
  508. return {
  509. CustomBar: this.CustomBar, // 顶部导航栏高度
  510. isIphoneX: this.$store.state.isIphoneX,
  511. shopId: 0,
  512. userId: 0,
  513. tabValue: '产品',
  514. themeClass: 'block',
  515. showBubblePopup: false,
  516. vipFlag: 0,
  517. userIdentity: 0,
  518. firstClubType: 0,
  519. searchKeyType: 1,
  520. tabIndex: 0,
  521. rightDrawer: false,
  522. isShowAllBrands: false,
  523. isSearchSalesFirst: true,
  524. isSearchMoodFirst: true,
  525. isSearchPriceFirst: true,
  526. isSearchSales: true,
  527. isSearchMood: true,
  528. isSearchPrice: true,
  529. isChoiceNewType: false,
  530. isChoiceActiType: false,
  531. isAllcheckedBrand: false,
  532. isShowClose: false, //是否显示清空输入框图标
  533. isSearchHistory: false, //是都显示搜索历史
  534. serachRecordList: [], //历史搜索记录
  535. instrumentHotSearch: [],
  536. productHotSearch: [],
  537. isShowWrapper: false,
  538. isModallayer: false,
  539. isFocus: false,
  540. priceLoading: true,
  541. windowHeight: '',
  542. showEmpty: false,
  543. scrollHeight: '',
  544. listData: [],
  545. brandLists: [],
  546. defaultBrandLists: [],
  547. checkedBrandList: [],
  548. checkedBrandLength: 0,
  549. productIds: '', //查询价格的商品ID
  550. showLoading: false,
  551. loadingNow: true,
  552. loadingText: '上拉加载更多',
  553. pullFlag: true,
  554. listQuery: {
  555. identity: 0,
  556. keyword: '',
  557. pageNum: 1,
  558. pageSize: 20,
  559. sortField: '',
  560. sortType: 1,
  561. newType: 1,
  562. actiType: 1,
  563. brandIds: '', // 品牌Id
  564. newFlag: 0, // 查询新品标记,默认0,新品1
  565. promotionFlag: 0, // 查询促销标记,默认0,促销1
  566. productFlag: 1, // 是否统计关键词 1 统计 0 不统计
  567. linkageFlag: 0 // 关键词来源是否为用户搜索 0 是 1 不是
  568. },
  569. brandParam: {
  570. keyword: '',
  571. id: '',
  572. idType: '',
  573. identity: 0
  574. },
  575. total: 0,
  576. height: 0,
  577. drawerH: 0, // 抽屉内部scrollview高度
  578. showLibaray: false,
  579. libraryWordList: []
  580. }
  581. },
  582. computed: {
  583. ...mapState(['hasLogin', 'userInfo', 'clubType', 'identity'])
  584. },
  585. onLoad(option) {
  586. console.log(option)
  587. if (option.type == 'share') {
  588. wxLogin.wxLoginAuthorize()
  589. }
  590. this.initGetStotage(option)
  591. },
  592. filters: {
  593. NumFormat: function(text) {
  594. //处理金额
  595. return Number(text).toFixed(2)
  596. }
  597. },
  598. methods: {
  599. // 搜素关键词库
  600. fetchLibraryWordList: myDebounce(async function() {
  601. try {
  602. const keyword = this.listQuery.keyword
  603. const res = await this.LibraryService.GetSearchKeywordList({ keyword })
  604. if (!res.data) {
  605. this.libraryWordList = []
  606. }
  607. this.libraryWordList = res.data.map(item => {
  608. item.text = item.keyword.replace(keyword, `<span style="color:#FF5B00;">${keyword}</span>`)
  609. return item
  610. })
  611. if (this.libraryWordList.length <= 0) return
  612. this.showLibaray = true
  613. } catch (e) {
  614. console.log(e)
  615. }
  616. }),
  617. // 关键词点击
  618. onLibraryClick(item) {
  619. this.showLibaray = false
  620. uni.navigateTo({
  621. url: `/pages/search/search-library?keyword=${item.keyword}`
  622. })
  623. },
  624. // 失去焦点
  625. onBlur() {
  626. // setTimeout(() => {
  627. // this.showLibaray = false
  628. // }, 200)
  629. },
  630. async initGetStotage(option) {
  631. const userInfo = await this.$api.getStorage()
  632. this.userId = userInfo.userId ? userInfo.userId : 0
  633. this.shopId = userInfo.shopId ? userInfo.shopId : 0
  634. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  635. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  636. this.listQuery.identity = this.identity
  637. this.firstClubType = this.clubType
  638. if (option.keyWord) {
  639. this.listQuery.keyword = option.keyWord
  640. this.setSearchHistoryAdd()
  641. this.getListFromServer()
  642. this.isFocus = false
  643. } else {
  644. this.isFocus = true
  645. this.initGetSerachRecord()
  646. }
  647. },
  648. GetHomeHotSearchTerms() {
  649. //金刚区分类
  650. this.CommonService.GetHomeHotSearchTerms({})
  651. .then(response => {
  652. let data = response.data
  653. console.log(data)
  654. this.instrumentHotSearch = data.instrumentHotSearch
  655. this.productHotSearch = data.productHotSearch
  656. })
  657. .catch(error => {
  658. this.$util.msg(error.msg, 2000)
  659. })
  660. },
  661. initGetSerachRecord() {
  662. //查询搜索历史记录
  663. this.ProductService.GetProductSearchHistory({ userId: this.userId }).then(response => {
  664. if (response.code == 0) {
  665. this.serachRecordList = response.data
  666. }
  667. })
  668. },
  669. getCommoditySearchQUeryBrand() {
  670. // 查询筛选项品牌
  671. this.ProductService.getCommoditySearchQUeryBrand(this.brandParam)
  672. .then(response => {
  673. const data = response.data
  674. this.defaultBrandLists = data.map((el, index) => {
  675. el.isChecked = false
  676. return el
  677. })
  678. if (this.defaultBrandLists.length > 11) {
  679. this.isShowAllBrands = false
  680. } else {
  681. this.isShowAllBrands = true
  682. }
  683. this.brandLists = this.defaultBrandLists.slice(0, 11)
  684. console.log('品牌=============>', this.brandLists)
  685. })
  686. .catch(error => {
  687. console.log('查询品牌列表异常')
  688. })
  689. },
  690. handleSearchQuery() {
  691. this.showLibaray = false
  692. this.listQuery.productFlag = 1
  693. this.listQuery.linkageFlag = 0
  694. //搜索
  695. if (this.listQuery.keyword == '') {
  696. this.$util.msg('请输入搜索关键词', 2000)
  697. } else {
  698. switch (this.searchKeyType) {
  699. case 1:
  700. this.listData = []
  701. this.brandParam.keyword = this.handleProsKey = this.listQuery.keyword
  702. uni.setStorageSync('pageLabel',this.listQuery.keyword)
  703. this.checkedIsRossSet() //判断是否弹窗ross广告
  704. this.setSearchHistoryAdd()
  705. this.getCommoditySearchQUeryBrand()
  706. this.getListFromServer()
  707. this.isFocus = false
  708. // 友盟埋点商品搜索点击
  709. if (process.env.NODE_ENV != 'development') {
  710. this.$uma.trackEvent('Um_Event_SearchProductSubmit', {
  711. Um_Key_Keyword: `${this.listQuery.keyword}`,
  712. Um_Key_PageName: '商品',
  713. Um_Key_SourcePage: '搜索商品'
  714. })
  715. }
  716. break
  717. case 2:
  718. this.setSearchHistoryAdd()
  719. this.$api.navigateTo(`/pages/search/search-supplier?keyWord=${this.listQuery.keyword}`)
  720. break
  721. case 3:
  722. this.setSearchHistoryAdd()
  723. this.$api.navigateTo(`/pages/search/search-instrument?keyWord=${this.listQuery.keyword}`)
  724. break
  725. }
  726. }
  727. },
  728. handSearchList() {
  729. //确定筛选
  730. this.rightDrawer = false
  731. this.listQuery.pageNum = 1
  732. this.getListFromServer(false)
  733. },
  734. scrolltolower() {
  735. if (this.total > this.listData.length && this.pullFlag) {
  736. this.getListFromServer(true)
  737. }
  738. },
  739. getListFromServer(loadMore) {
  740. this.showLoading = true
  741. this.loadingNow = true
  742. this.loadingText = '加载中'
  743. this.showEmpty = false
  744. if (loadMore) {
  745. this.listQuery.pageNum += 1
  746. }
  747. this.ProductService.GetProductSearchList(this.listQuery)
  748. .then(response => {
  749. this.isShowWrapper = true
  750. let resData = {}
  751. if (response.data) {
  752. resData = JSON.parse(response.data)
  753. }
  754. const resList = resData.items
  755. if (resList && resList.length > 0) {
  756. this.total = resData.total
  757. this.showEmpty = false
  758. if (loadMore) {
  759. this.listData = [...this.listData, ...resList]
  760. this.getProductPrice()
  761. } else {
  762. this.listData = [...resList]
  763. this.getProductPrice()
  764. }
  765. // 防上拉暴滑
  766. this.pullFlag = false
  767. setTimeout(() => {
  768. this.pullFlag = true
  769. }, 500)
  770. // 底部提示文案
  771. if (this.totalPage > this.listData.length) {
  772. this.loadingText = '上拉加载更多'
  773. } else {
  774. this.showLoading = true
  775. this.loadingNow = false
  776. }
  777. } else {
  778. if (!loadMore) {
  779. this.showEmpty = true
  780. }
  781. }
  782. })
  783. .catch(error => {
  784. console.log('商品搜索异常', error.msg)
  785. })
  786. },
  787. setSearchHistoryAdd() {
  788. //添加搜索记录
  789. if (!this.hasLogin) {
  790. return false
  791. }
  792. this.ProductService.GetAddProductSearchHistory({ userId: this.userId, keyword: this.listQuery.keyword })
  793. .then(response => {
  794. //此为每次搜索同时添加用户的搜索记录
  795. })
  796. .catch(error => {
  797. this.$util.msg(error.msg, 2000)
  798. })
  799. },
  800. getProductPrice() {
  801. //获取价格
  802. let productIdArr = []
  803. this.listData.map(item => {
  804. // 0公开价格 1不公开价格 2仅对资质机构公开
  805. productIdArr.push(item.productId)
  806. })
  807. this.priceLoading = true
  808. this.productIds = productIdArr.join(',')
  809. this.ProductService.querySearchProductPrice({
  810. userId: this.userId,
  811. productIds: this.productIds,
  812. source: 2 // 来源 1 WWW 2 小程序
  813. })
  814. .then(response => {
  815. if (response.data) {
  816. this.listData = this.ReturnNewProducts(this.listData, response.data)
  817. }
  818. this.priceLoading = false
  819. })
  820. .catch(error => {
  821. this.$util.msg(error.msg, 2000)
  822. })
  823. },
  824. ReturnNewProducts(Array, list) {
  825. //处理对应商品ID的商品价格
  826. let NewArray = []
  827. Array.map(item => {
  828. for (let i = 0; i < list.length; i++) {
  829. if (item.productId == list[i].productId) {
  830. NewArray.push(Object.assign(item, list[i]))
  831. }
  832. }
  833. })
  834. return NewArray
  835. },
  836. handleScreen(e) {
  837. let index = e.currentTarget.dataset.index
  838. if (index == 0) {
  839. this.tabIndex = 0
  840. this.isSearchSalesFirst = true
  841. this.isSearchMoodFirst = true
  842. this.isSearchPriceFirst = true
  843. this.listQuery.sortType = 1
  844. this.listQuery.sortField = ''
  845. this.getListFromServer()
  846. } else if (index == 1) {
  847. this.tabIndex = 1
  848. this.isSearchSalesFirst = false
  849. this.isSearchMoodFirst = true
  850. this.isSearchPriceFirst = true
  851. this.isSearchSales = !this.isSearchSales
  852. if (this.isSearchSales) {
  853. this.listQuery.sortType = 1
  854. } else {
  855. this.listQuery.sortType = 0
  856. }
  857. this.listQuery.sortField = 'sales'
  858. this.getListFromServer()
  859. } else if (index == 2) {
  860. this.tabIndex = 2
  861. this.isSearchSalesFirst = true
  862. this.isSearchPriceFirst = true
  863. this.isSearchMoodFirst = false
  864. this.isSearchMood = !this.isSearchMood
  865. if (this.isSearchMood) {
  866. this.listQuery.sortType = 1
  867. } else {
  868. this.listQuery.sortType = 0
  869. }
  870. this.listQuery.sortField = 'favorite'
  871. this.getListFromServer()
  872. } else if (index == 3) {
  873. this.tabIndex = 3
  874. this.isSearchSalesFirst = true
  875. this.isSearchMoodFirst = true
  876. this.isSearchPriceFirst = false
  877. this.isSearchPrice = !this.isSearchPrice
  878. if (this.isSearchPrice) {
  879. this.listQuery.sortType = 1
  880. } else {
  881. this.listQuery.sortType = 0
  882. }
  883. this.listQuery.sortField = 'price'
  884. this.getListFromServer()
  885. } else if (index == 4) {
  886. this.brandParam.keyword = this.listQuery.keyword
  887. this.showRightDrawer()
  888. }
  889. },
  890. showRightDrawer() {
  891. //弹出右侧抽屉
  892. this.rightDrawer = true
  893. },
  894. closeDrawer(e) {
  895. //关闭抽屉
  896. this.rightDrawer = false
  897. },
  898. PromotionsFormat(promo) {
  899. //促销活动类型数据处理
  900. if (promo != null) {
  901. if (promo.type == 1 && promo.mode == 1) {
  902. return true
  903. } else {
  904. return false
  905. }
  906. }
  907. return false
  908. },
  909. isShowVipFlag(pros) {
  910. /**
  911. *显示SVIP和超级会员价格:
  912. * 个人机构(不是超级会员,但价格所有机构可见),
  913. * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
  914. * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
  915. *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
  916. * 普通机构
  917. * 超级会员 && priceFlag === 0
  918. * 资质机构
  919. * priceFlag !== 1 ||
  920. * 超级会员
  921. * 商品priceFlag === 3 && 是否是医美机构
  922. */
  923. // 未登录 || 非会员
  924. if (!this.hasLogin || !this.vipFlag === 1) return false
  925. // 商品所有机构可见
  926. if (pros.priceFlag === 0) return true
  927. // 商品价格仅资质机构可见
  928. if (pros.priceFlag === 2 && this.userIdentity === 2) return true
  929. // 商品价格仅医美机构可见
  930. if (pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) return true
  931. // 其它
  932. return false
  933. },
  934. onShowClose() {
  935. //输入框输入时触发
  936. this.inputEmpty(this.listQuery.keyword)
  937. this.fetchLibraryWordList()
  938. },
  939. onFocus() {
  940. //输入框获取焦点时触发
  941. this.inputEmpty(this.listQuery.keyword)
  942. this.initGetSerachRecord()
  943. },
  944. delInputText() {
  945. //清除输入框内容
  946. this.listQuery.keyword = ''
  947. this.isShowClose = false
  948. this.isShowWrapper = false
  949. this.inputEmpty(this.listQuery.keyword)
  950. this.initGetSerachRecord()
  951. this.showLibaray = false
  952. },
  953. keywordsClick(item) {
  954. //关键词搜索与历史搜索
  955. this.listQuery.keyword = item
  956. this.isShowClose = true
  957. this.isFocus = false
  958. this.handleSearchQuery()
  959. },
  960. keywordsClickPath(item) {
  961. this.$api.FlooryNavigateTo(item)
  962. },
  963. confirmDetele() {
  964. //清空历史记录
  965. this.$util.modal('提示', '确定删除历史记录?', '确定', '取消', true, () => {
  966. this.ProductService.GetDeleteProductSearchHistory({ userId: this.userId })
  967. .then(response => {
  968. this.$util.msg('删除成功', 2000, true, 'success')
  969. this.serachRecordList = []
  970. })
  971. .catch(error => {
  972. this.$util.msg(error.msg, 2000)
  973. })
  974. })
  975. },
  976. inputEmpty(val) {
  977. this.isShowWrapper = false
  978. if (val != '') {
  979. this.isShowClose = true
  980. this.isFocus = true
  981. } else {
  982. this.isShowClose = false
  983. this.isFocus = true
  984. }
  985. },
  986. isInterceptHtmlFn(text) {
  987. let name = this.$reg.interceptHtmlFn(text)
  988. return name
  989. },
  990. navToDetailPage(id) {
  991. this.isModallayer = true
  992. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  993. this.isModallayer = false
  994. },
  995. setScrollHeight() {
  996. let obj = {}
  997. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  998. uni.getSystemInfo({
  999. success: res => {
  1000. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  1001. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  1002. }
  1003. })
  1004. this.windowHeight = windowHeight - 1
  1005. this.scrollHeight = windowHeight - 1
  1006. },
  1007. toLoginPage() {
  1008. let searchLoginType = 'search'
  1009. uni.navigateTo({
  1010. url: `/pages/login/login?type=${searchLoginType}`
  1011. })
  1012. },
  1013. selectTabs(index) {
  1014. //选择搜索项
  1015. this.showBubblePopup = false
  1016. this.searchKeyType = index
  1017. switch (index) {
  1018. case 1:
  1019. this.tabValue = '产品'
  1020. break
  1021. case 2:
  1022. this.tabValue = '供应商'
  1023. break
  1024. case 3:
  1025. this.tabValue = '项目仪器'
  1026. break
  1027. }
  1028. },
  1029. showAllBrands() {
  1030. // 显示全部品牌
  1031. this.isShowAllBrands = true
  1032. this.brandLists = this.defaultBrandLists
  1033. },
  1034. choiceBrand(brand, index) {
  1035. // 选择品牌
  1036. brand.isChecked = !brand.isChecked
  1037. if (brand.isChecked) {
  1038. if(!this.contains(this.checkedBrandList,brand.id)){
  1039. this.checkedBrandList.push(brand.id)
  1040. }
  1041. } else {
  1042. this.checkedBrandList.splice(this.checkedBrandList.indexOf(brand.id),1)
  1043. }
  1044. this.isAllcheckedBrand = false
  1045. this.checkedBrandLength = this.checkedBrandList.length
  1046. console.log('checkedBrandList', this.checkedBrandList)
  1047. this.listQuery.brandIds = this.checkedBrandList.join(',')
  1048. console.log('this.listQuery.brandIds', this.listQuery.brandIds)
  1049. },
  1050. contains(arr, val) {// 校验
  1051. return arr.some(item => item === val)
  1052. },
  1053. choiceBrandAll() {
  1054. // 点击选择全部品牌
  1055. this.isAllcheckedBrand = true
  1056. this.listQuery.brandIds = ''
  1057. this.brandLists.forEach(el => {
  1058. el.isChecked = false
  1059. })
  1060. },
  1061. choiceNewType() {
  1062. // 选择筛选项新品
  1063. this.isChoiceNewType = !this.isChoiceNewType
  1064. if (this.isChoiceNewType) {
  1065. this.listQuery.newFlag = 1
  1066. } else {
  1067. this.listQuery.newFlag = 0
  1068. }
  1069. },
  1070. choiceActiType() {
  1071. // 选择筛选项促销商品
  1072. this.isChoiceActiType = !this.isChoiceActiType
  1073. if (this.isChoiceNewType) {
  1074. this.listQuery.promotionFlag = 1
  1075. } else {
  1076. this.listQuery.promotionFlag = 0
  1077. }
  1078. },
  1079. topBubble() {
  1080. console.log('1111111111')
  1081. //显隐搜索项
  1082. this.showBubblePopup = !this.showBubblePopup
  1083. }
  1084. },
  1085. onShareAppMessage(res) {
  1086. //分享转发
  1087. if (res.from === 'button') {
  1088. // 来自页面内转发按钮
  1089. }
  1090. return {
  1091. title: `点击查看“${this.listQuery.keyword}”相关的商品`,
  1092. path: `pages/search/search?type=share&keyWord=${this.listQuery.keyword}`
  1093. }
  1094. },
  1095. onShow() {
  1096. this.setScrollHeight()
  1097. this.GetHomeHotSearchTerms()
  1098. }
  1099. }
  1100. </script>
  1101. <style lang="scss">
  1102. @import '@/uni.scss';
  1103. page {
  1104. background-color: #f7f7f7 !important;
  1105. }
  1106. .search-main-bubble {
  1107. width: 100%;
  1108. height: 88rpx;
  1109. position: fixed;
  1110. top: 30rpx;
  1111. left: 0;
  1112. z-index: 1200;
  1113. box-sizing: border-box;
  1114. line-height: 70rpx;
  1115. color: #666666;
  1116. font-size: $font-size-24;
  1117. text-align: center;
  1118. }
  1119. .search-main {
  1120. width: 100%;
  1121. height: 88rpx;
  1122. position: fixed;
  1123. top: 0;
  1124. left: 0;
  1125. background: #ffffff;
  1126. z-index: 990;
  1127. box-sizing: border-box;
  1128. .tui-header-tab {
  1129. height: 88rpx;
  1130. box-sizing: border-box;
  1131. padding: 9rpx 0;
  1132. float: left;
  1133. .search-tab {
  1134. width: 160rpx;
  1135. height: 70rpx;
  1136. line-height: 70rpx;
  1137. color: #666666;
  1138. font-size: 30rpx;
  1139. text-align: center;
  1140. float: left;
  1141. position: relative;
  1142. .icon-xiangxiajiantou {
  1143. margin-left: 10rpx;
  1144. font-size: $font-size-30;
  1145. }
  1146. }
  1147. .gosearch-btn {
  1148. width: 470rpx;
  1149. height: 100%;
  1150. float: left;
  1151. border-radius: 40rpx;
  1152. background: #f0f0f0;
  1153. margin: 0 auto;
  1154. padding: 0 20rpx;
  1155. font-size: 28rpx;
  1156. line-height: 70rpx;
  1157. padding-left: 70rpx;
  1158. color: #8a8a8a;
  1159. background: #f7f7f7;
  1160. position: relative;
  1161. box-sizing: border-box;
  1162. .icon-sousuo {
  1163. width: 70rpx;
  1164. height: 70rpx;
  1165. line-height: 70rpx;
  1166. text-align: center;
  1167. display: block;
  1168. position: absolute;
  1169. left: 0;
  1170. top: 0;
  1171. font-size: 34rpx;
  1172. color: #8a8a8a;
  1173. z-index: 10;
  1174. }
  1175. .icon-shanchu1 {
  1176. font-size: 36rpx;
  1177. color: #8a8a8a;
  1178. position: absolute;
  1179. right: 10rpx;
  1180. top: 0;
  1181. padding: 0 10rpx;
  1182. z-index: 100;
  1183. }
  1184. .input {
  1185. width: 400rpx;
  1186. height: 100%;
  1187. float: left;
  1188. font-size: $font-size-24;
  1189. box-sizing: border-box;
  1190. padding-right: 66rpx;
  1191. }
  1192. }
  1193. .search-btn {
  1194. width: 120rpx;
  1195. height: 70rpx;
  1196. line-height: 70rpx;
  1197. float: right;
  1198. text-align: center;
  1199. color: #FF5B00;
  1200. font-size: 30rpx;
  1201. }
  1202. }
  1203. }
  1204. .search-container {
  1205. padding-top: 89rpx;
  1206. &.unScorll {
  1207. height: 100vh;
  1208. overflow: hidden;
  1209. box-sizing: border-box;
  1210. }
  1211. }
  1212. /*screen*/
  1213. .tui-header-screen {
  1214. width: 100%;
  1215. height: 88rpx;
  1216. float: left;
  1217. box-sizing: border-box;
  1218. background: #fff;
  1219. }
  1220. .tui-screen-top,
  1221. .tui-screen-bottom {
  1222. display: flex;
  1223. align-items: center;
  1224. justify-content: space-between;
  1225. font-size: 28rpx;
  1226. color: #999999;
  1227. }
  1228. .tui-screen-top {
  1229. height: 88rpx;
  1230. position: relative;
  1231. background: #fff;
  1232. border-bottom: 1px solid #efefef;
  1233. }
  1234. .tui-top-item {
  1235. height: 28rpx;
  1236. line-height: 28rpx;
  1237. flex: 1;
  1238. display: flex;
  1239. align-items: center;
  1240. justify-content: center;
  1241. }
  1242. .icon-shangxiajiantou {
  1243. font-size: 20rpx;
  1244. color: #999999;
  1245. margin-left: 8rpx;
  1246. }
  1247. .tui-topitem-active {
  1248. color: #FF5B00;
  1249. }
  1250. .tui-screen-bottom {
  1251. height: 100rpx;
  1252. padding: 0 30rpx;
  1253. box-sizing: border-box;
  1254. font-size: 24rpx;
  1255. align-items: center;
  1256. overflow: hidden;
  1257. }
  1258. .tui-bottom-text {
  1259. line-height: 26rpx;
  1260. max-width: 82%;
  1261. white-space: nowrap;
  1262. overflow: hidden;
  1263. text-overflow: ellipsis;
  1264. }
  1265. .tui-bottom-item {
  1266. flex: 1;
  1267. width: 0;
  1268. display: flex;
  1269. align-items: center;
  1270. justify-content: center;
  1271. padding: 0 12rpx;
  1272. box-sizing: border-box;
  1273. background: #f7f7f7;
  1274. margin-right: 20rpx;
  1275. white-space: nowrap;
  1276. height: 60rpx;
  1277. border-radius: 40rpx;
  1278. }
  1279. .tui-bottom-item:last-child {
  1280. margin-right: 0;
  1281. }
  1282. .tui-btmItem-active {
  1283. background: #fcedea !important;
  1284. color: #FF5B00;
  1285. font-weight: bold;
  1286. position: relative;
  1287. }
  1288. .tui-btmItem-active::after {
  1289. content: '';
  1290. position: absolute;
  1291. border: 1rpx solid #FF5B00;
  1292. width: 100%;
  1293. height: 100%;
  1294. border-radius: 40rpx;
  1295. left: 0;
  1296. top: 0;
  1297. }
  1298. .tui-btmItem-tap {
  1299. position: relative;
  1300. border-bottom-left-radius: 0;
  1301. border-bottom-right-radius: 0;
  1302. }
  1303. .tui-btmItem-tap::after {
  1304. content: '';
  1305. position: absolute;
  1306. width: 100%;
  1307. height: 22rpx;
  1308. background: #f7f7f7;
  1309. left: 0;
  1310. top: 58rpx;
  1311. }
  1312. .tui-active {
  1313. color: #FF5B00;
  1314. }
  1315. .tui-icon-ml .tui-icon-class {
  1316. margin-left: 6rpx;
  1317. }
  1318. .tui-ml {
  1319. margin-left: 6rpx;
  1320. }
  1321. .tui-seizeaseat-20 {
  1322. height: 20rpx;
  1323. }
  1324. .tui-seizeaseat-30 {
  1325. height: 30rpx;
  1326. }
  1327. .tui-icon-middle .tui-icon-class {
  1328. vertical-align: middle;
  1329. }
  1330. .tui-middle {
  1331. vertical-align: middle;
  1332. }
  1333. .search-container-history {
  1334. width: 100%;
  1335. min-height: 300rpx;
  1336. position: fixed;
  1337. top: 88rpx;
  1338. left: 0;
  1339. z-index: 999;
  1340. }
  1341. .s-block {
  1342. background: #ffffff;
  1343. .header {
  1344. font-size: 32rpx;
  1345. padding: 40rpx 24rpx 22rpx 24rpx;
  1346. line-height: 42rpx;
  1347. font-size: 30rpx;
  1348. font-weight: bold;
  1349. position: relative;
  1350. width: 100%;
  1351. float: left;
  1352. box-sizing: border-box;
  1353. .icon-shanchu {
  1354. font-size: 36rpx;
  1355. color: #333333;
  1356. float: right;
  1357. padding: 0 10rpx;
  1358. z-index: 10;
  1359. font-weight: normal;
  1360. }
  1361. }
  1362. .list {
  1363. width: 100%;
  1364. height: auot;
  1365. float: left;
  1366. padding: 0 24rpx 30rpx 24rpx;
  1367. box-sizing: border-box;
  1368. .list-title {
  1369. width: 100%;
  1370. height: 40rpx;
  1371. font-size: $font-size-26;
  1372. color: #333;
  1373. }
  1374. .list-main {
  1375. width: 100%;
  1376. float: left;
  1377. display: flex;
  1378. flex-wrap: wrap;
  1379. view {
  1380. color: #8a8a8a;
  1381. font-size: 24rpx;
  1382. box-sizing: border-box;
  1383. text-align: center;
  1384. height: 48rpx;
  1385. line-height: 48rpx;
  1386. border-radius: 24rpx;
  1387. margin: 12rpx 12rpx 12rpx 0;
  1388. padding: 0 20rpx;
  1389. white-space: nowrap;
  1390. text-overflow: ellipsis;
  1391. background-color: #f3f3f3;
  1392. .iconfont {
  1393. font-size: $font-size-30;
  1394. color: #FF5B00;
  1395. margin-left: 12rpx;
  1396. }
  1397. &.list-active {
  1398. background-color: #fef6f3;
  1399. color: #FF5B00;
  1400. }
  1401. }
  1402. }
  1403. }
  1404. }
  1405. .s-circle {
  1406. margin-top: 30rpx;
  1407. .header {
  1408. font-size: 32rpx;
  1409. padding: 30rpx;
  1410. border-bottom: 2rpx solid #f9f9f9;
  1411. position: relative;
  1412. image {
  1413. width: 36rpx;
  1414. height: 36rpx;
  1415. padding: 10rpx;
  1416. position: absolute;
  1417. right: 40rpx;
  1418. top: 24rpx;
  1419. }
  1420. }
  1421. .list {
  1422. display: flex;
  1423. flex-wrap: wrap;
  1424. padding: 0 30rpx 20rpx;
  1425. view {
  1426. padding: 8rpx 30rpx;
  1427. margin: 20rpx 30rpx 0 0;
  1428. font-size: 28rpx;
  1429. color: #8a8a8a;
  1430. background-color: #f7f7f7;
  1431. box-sizing: border-box;
  1432. text-align: center;
  1433. border-radius: 20rpx;
  1434. }
  1435. }
  1436. }
  1437. .wanted-block {
  1438. margin-top: 30rpx;
  1439. .header {
  1440. font-size: 32rpx;
  1441. padding: 30rpx;
  1442. }
  1443. .list {
  1444. display: flex;
  1445. flex-wrap: wrap;
  1446. view {
  1447. width: 50%;
  1448. color: #8a8a8a;
  1449. font-size: 28rpx;
  1450. box-sizing: border-box;
  1451. text-align: center;
  1452. padding: 20rpx 0;
  1453. border-top: 2rpx solid #fff;
  1454. border-left: 2rpx solid #fff;
  1455. background-color: #f7f7f7;
  1456. overflow: hidden;
  1457. white-space: nowrap;
  1458. text-overflow: ellipsis;
  1459. }
  1460. }
  1461. }
  1462. .wanted-circle {
  1463. margin-top: 30rpx;
  1464. .header {
  1465. font-size: 32rpx;
  1466. padding: 30rpx;
  1467. }
  1468. .list {
  1469. display: flex;
  1470. flex-wrap: wrap;
  1471. padding: 0 30rpx 20rpx;
  1472. view {
  1473. padding: 8rpx 30rpx;
  1474. margin: 20rpx 30rpx 0 0;
  1475. font-size: 28rpx;
  1476. color: #8a8a8a;
  1477. background-color: #f7f7f7;
  1478. box-sizing: border-box;
  1479. text-align: center;
  1480. border-radius: 20rpx;
  1481. }
  1482. }
  1483. }
  1484. .commodity-list-wrapper {
  1485. padding-top: 88rpx;
  1486. scroll-view {
  1487. height: 100%;
  1488. overflow: scroll;
  1489. }
  1490. .empty-container-image {
  1491. margin-top: -300rpx;
  1492. }
  1493. .toIndexPage {
  1494. bottom: 390rpx;
  1495. }
  1496. .show-more-btn {
  1497. width: 276rpx;
  1498. height: 52rpx;
  1499. line-height: 52rpx;
  1500. border: 2rpx solid #d8d8d8;
  1501. background: #f7f7f7;
  1502. font-size: 26rpx;
  1503. margin: 26rpx 0;
  1504. position: absolute;
  1505. left: 50%;
  1506. margin-left: -138rpx;
  1507. }
  1508. }
  1509. .all-type-list-content {
  1510. height: 216rpx;
  1511. padding: 24rpx;
  1512. background: #fff;
  1513. margin-bottom: 2rpx;
  1514. display: flex;
  1515. flex-direction: row;
  1516. box-sizing: content-box;
  1517. .list-details-image {
  1518. width: 218rpx;
  1519. height: 218rpx !important;
  1520. margin-right: 26rpx;
  1521. border-radius: 10rpx;
  1522. border: 2rpx solid #f3f3f3;
  1523. position: relative;
  1524. .list-img {
  1525. width: 218rpx;
  1526. height: 218rpx !important;
  1527. }
  1528. .list-details-type {
  1529. width: 64rpx;
  1530. height: 64rpx;
  1531. text-align: justify;
  1532. box-sizing: border-box;
  1533. padding: 10rpx;
  1534. border-radius: 0 0 8rpx 8rpx;
  1535. background-color: #33ccbf;
  1536. font-size: $font-size-22;
  1537. color: #ffffff;
  1538. line-height: 25rpx;
  1539. position: absolute;
  1540. top: 0;
  1541. right: 10rpx;
  1542. }
  1543. }
  1544. }
  1545. .list-details-info {
  1546. width: 466rpx;
  1547. display: flex;
  1548. flex-direction: column;
  1549. font-size: 26rpx;
  1550. position: relative;
  1551. .list-details-title {
  1552. position: relative;
  1553. .mclap {
  1554. line-height: 38rpx;
  1555. text-overflow: ellipsis;
  1556. overflow: hidden;
  1557. display: -webkit-box;
  1558. -webkit-line-clamp: 2;
  1559. line-clamp: 2;
  1560. -webkit-box-orient: vertical;
  1561. &.indent {
  1562. text-indent: 95rpx;
  1563. }
  1564. }
  1565. .mclap-tag {
  1566. display: block;
  1567. width: 84rpx;
  1568. height: 32rpx;
  1569. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1570. border-radius: 4rpx 48rpx 4px 4px;
  1571. line-height: 32rpx;
  1572. font-size: $font-size-22;
  1573. color: #ffffff;
  1574. text-align: center;
  1575. position: absolute;
  1576. left: 0;
  1577. top: 0;
  1578. }
  1579. }
  1580. .list-details-specs {
  1581. margin-top: 8rpx;
  1582. color: #666666;
  1583. }
  1584. .list-details-miniQuantity {
  1585. margin-top: 7rpx;
  1586. }
  1587. }
  1588. .list-details-price {
  1589. width: 100%;
  1590. height: 54rpx;
  1591. line-height: 54rpx;
  1592. position: absolute;
  1593. bottom: -10rpx;
  1594. right: 0;
  1595. .floor-item-act {
  1596. height: 54rpx;
  1597. text-align: center;
  1598. box-sizing: border-box;
  1599. float: right;
  1600. padding: 11rpx 0;
  1601. }
  1602. .price-icon {
  1603. width: 22rpx;
  1604. height: 28rpx;
  1605. vertical-align: middle;
  1606. margin-right: 10rpx;
  1607. }
  1608. .price-icon + text {
  1609. font-size: 25rpx;
  1610. vertical-align: middle;
  1611. }
  1612. .list-login-now {
  1613. color: #f8c499;
  1614. float: left;
  1615. line-height: 54rpx;
  1616. .p-no {
  1617. float: left;
  1618. font-size: $font-size-24;
  1619. color: $text-color;
  1620. }
  1621. }
  1622. .login-now {
  1623. padding: 10rpx 10rpx 10rpx 0;
  1624. }
  1625. .list-price {
  1626. color: #ff2a2a;
  1627. height: 44rpx;
  1628. float: left;
  1629. .price-larger {
  1630. width: 100%;
  1631. font-size: 32rpx;
  1632. &.none {
  1633. text-decoration: line-through;
  1634. color: #999999;
  1635. }
  1636. &.small {
  1637. font-size: $font-size-24;
  1638. }
  1639. .txt {
  1640. font-size: $font-size-24;
  1641. display: inline-block;
  1642. line-height: 44rpx;
  1643. text-align: left;
  1644. float: left;
  1645. }
  1646. }
  1647. }
  1648. }
  1649. // 筛选抽屉样式
  1650. .drawer-title {
  1651. width: 580rpx;
  1652. height: 72rpx;
  1653. line-height: 72rpx;
  1654. box-sizing: border-box;
  1655. padding: 0 30rpx;
  1656. background-color: #f7f7f7;
  1657. position: fixed;
  1658. top: 0;
  1659. left: 0;
  1660. z-index: 99;
  1661. .drawer-title-h1 {
  1662. font-size: $font-size-26;
  1663. color: #FF5B00;
  1664. font-weight: bold;
  1665. text-align: left;
  1666. float: left;
  1667. }
  1668. .drawer-title-p {
  1669. font-size: $font-size-24;
  1670. float: right;
  1671. color: #333333;
  1672. .text {
  1673. color: #FF5B00;
  1674. }
  1675. }
  1676. }
  1677. .drawer-container {
  1678. width: 580rpx;
  1679. height: 100%;
  1680. box-sizing: border-box;
  1681. background-color: #f7f7f7;
  1682. overflow: hidden;
  1683. position: relative;
  1684. padding-top: 72rpx;
  1685. .drawer-main {
  1686. width: 100%;
  1687. height: auto;
  1688. box-sizing: border-box;
  1689. .drawer-main-brand {
  1690. width: 100%;
  1691. height: auto;
  1692. box-sizing: border-box;
  1693. padding: 12rpx 24rpx 24rpx 24rpx;
  1694. background-color: #ffffff;
  1695. .drawer-brand-list {
  1696. width: 160rpx;
  1697. height: 56rpx;
  1698. line-height: 56rpx;
  1699. text-align: center;
  1700. font-size: 26rpx;
  1701. background-color: #f7f7f7;
  1702. color: #999999;
  1703. border-radius: 30rpx;
  1704. box-sizing: border-box;
  1705. padding: 0 15rpx;
  1706. float: left;
  1707. margin: 12rpx 24rpx 12rpx 0;
  1708. text-overflow: ellipsis;
  1709. overflow: hidden;
  1710. display: -webkit-box;
  1711. -webkit-line-clamp: 1;
  1712. line-clamp: 1;
  1713. -webkit-box-orient: vertical;
  1714. &.checked {
  1715. background-color: #fef6f3;
  1716. color: #FF5B00;
  1717. }
  1718. &:nth-child(3n) {
  1719. margin-right: 0;
  1720. }
  1721. }
  1722. .drawer-brand-more {
  1723. width: 100%;
  1724. height: 42rpx;
  1725. line-height: 42rpx;
  1726. float: left;
  1727. font-size: $font-size-24;
  1728. color: #999999;
  1729. text-align: center;
  1730. }
  1731. }
  1732. .drawer-main-radio {
  1733. width: 100%;
  1734. height: 72rpx;
  1735. background-color: #ffffff;
  1736. margin-top: 20rpx;
  1737. box-sizing: border-box;
  1738. padding: 0 24rpx;
  1739. .drawer-radio-name {
  1740. float: left;
  1741. line-height: 72rpx;
  1742. font-size: $font-size-26;
  1743. color: #333333;
  1744. }
  1745. .drawer-radio-input {
  1746. width: 72rpx;
  1747. height: 72rpx;
  1748. float: right;
  1749. line-height: 72rpx;
  1750. text-align: right;
  1751. .iconfont {
  1752. font-size: $font-size-36;
  1753. &.icon-weixuanze {
  1754. color: #b2b2b2;
  1755. }
  1756. &.icon-yixuanze {
  1757. color: #FF5B00;
  1758. }
  1759. }
  1760. }
  1761. }
  1762. }
  1763. .drawer-input {
  1764. width: 100%;
  1765. float: left;
  1766. box-sizing: border-box;
  1767. padding: 24rpx 10rpx 0 10rpx;
  1768. border: 1px solid rgba(0, 0, 0, 0.2);
  1769. border-radius: 4rpx;
  1770. position: relative;
  1771. background-color: #ffffff;
  1772. &.btn {
  1773. border: none;
  1774. display: flex;
  1775. position: fixed;
  1776. left: 0;
  1777. bottom: 0;
  1778. }
  1779. .drawer-btn {
  1780. width: 210rpx;
  1781. height: 84rpx;
  1782. border-radius: 42rpx;
  1783. background: $btn-confirm;
  1784. line-height: 84rpx;
  1785. text-align: center;
  1786. font-size: $font-size-26;
  1787. color: #ffffff;
  1788. flex: 1;
  1789. margin: 0 10rpx;
  1790. &.comfrim {
  1791. background: $btn-confirm;
  1792. }
  1793. &.clear {
  1794. background: #ffe6dc;
  1795. color: #FF5B00;
  1796. }
  1797. }
  1798. }
  1799. }
  1800. // 搜索关键词库样式
  1801. .search-library {
  1802. position: fixed;
  1803. top: 88rpx;
  1804. left: 0;
  1805. z-index: 1000;
  1806. width: 100vw;
  1807. height: calc(100vh - 88rpx);
  1808. background: #f5f5f5;
  1809. .search-library-scroll {
  1810. height: 95%;
  1811. }
  1812. .search-library-wrapper {
  1813. background: #fff;
  1814. padding-top: 40rpx;
  1815. box-sizing: border-box;
  1816. max-height: calc(100vh - 88rpx);
  1817. overflow-y: auto;
  1818. .keyword-item {
  1819. width: 100%;
  1820. display: flex;
  1821. justify-content: space-between;
  1822. height: 90rpx;
  1823. line-height: 90rpx;
  1824. box-sizing: border-box;
  1825. padding: 0 48rpx 0 32rpx;
  1826. border-top: 1rpx solid #e1e1e1;
  1827. &:last-child {
  1828. border-bottom: 1rpx solid #e1e1e1;
  1829. }
  1830. .iconfont {
  1831. display: block;
  1832. width: 34rpx;
  1833. margin-right: 26rpx;
  1834. flex-shrink: 0;
  1835. font-size: 34rpx;
  1836. color: #999;
  1837. }
  1838. .content {
  1839. flex: 1;
  1840. flex-shrink: 0;
  1841. overflow: hidden;
  1842. text-overflow: ellipsis;
  1843. display: -webkit-box;
  1844. -webkit-line-clamp: 1; // 这里控制几行显示省略号
  1845. -webkit-box-orient: vertical;
  1846. font-size: 28rpx;
  1847. color: #333;
  1848. text {
  1849. color: #FF5B00;
  1850. }
  1851. }
  1852. }
  1853. }
  1854. }
  1855. </style>