search.vue 66 KB

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