search.vue 47 KB

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