search.vue 67 KB

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