search.vue 46 KB

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