search.vue 66 KB

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