search.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867
  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. <view v-for="item in highLight(isInterceptHtmlFn(pros.name),listQuery.keyword)" :key="item" style="float:left;">
  206. <text v-if="item.type==1" decode="true" space="true" style='color: #ff5b00;'>{{ myReplace(item.text) }} </text>
  207. <text v-else decode="true" space="true">{{myReplace(item.text)}}</text>
  208. </view>
  209. </view>
  210. </view>
  211. <text class="list-details-specs">规格:{{ pros.unit }}</text>
  212. <view class="list-details-specs" v-if="pros.code != '' && pros.code != null">
  213. <view>商品编码:{{ pros.code }}</view>
  214. </view>
  215. <view class="list-details-price">
  216. <template v-if="userIdentity == 3">
  217. <view class="floor-item-act">
  218. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  219. <template v-if="pros.actStatus == 1">
  220. <view class="floor-tags" v-if="PromotionsFormat(pros.promotions)">
  221. {{ pros.promotions.name }}
  222. <text v-if="hasLogin && pros.shopId == shopId && pros.priceFlag != 1">
  223. :¥{{ pros.price | NumFormat }}
  224. </text>
  225. </view>
  226. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  227. </template>
  228. <template v-if="pros.svipProductFlag == 1">
  229. <view class="svip-tags">
  230. <view class="tags">SVIP</view>
  231. <view
  232. class="price"
  233. v-if="hasLogin && pros.shopId == shopId && pros.priceFlag != 1"
  234. >
  235. {{ pros.svipPriceTag }}
  236. </view>
  237. </view>
  238. </template>
  239. </view>
  240. </template>
  241. <template v-else-if="userIdentity == 1">
  242. <view class="floor-item-act">
  243. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  244. <template v-if="pros.actStatus == 1">
  245. <view
  246. class="floor-tags"
  247. v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
  248. >
  249. {{ pros.promotions.name }} <text>:¥{{ pros.price | NumFormat }}</text>
  250. </view>
  251. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  252. </template>
  253. <template v-if="pros.svipProductFlag == 1">
  254. <view class="svip-tags"><view class="tags none">SVIP</view></view>
  255. </template>
  256. </view>
  257. </template>
  258. <template v-else>
  259. <view class="floor-item-act">
  260. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  261. <template v-if="pros.actStatus == 1">
  262. <view
  263. class="floor-tags"
  264. v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
  265. >
  266. {{ pros.promotions.name }}
  267. <text
  268. v-if="
  269. hasLogin &&
  270. ((userIdentity === 4 && pros.priceFlag === 0) ||
  271. (userIdentity === 2 && pros.priceFlag !== 1))
  272. "
  273. >
  274. :¥{{ pros.price | NumFormat }}
  275. </text>
  276. </view>
  277. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  278. </template>
  279. <template v-if="pros.svipProductFlag == 1">
  280. <view class="svip-tags">
  281. <view class="tags" :class="{ none: !isShowVipFlag(pros) }">SVIP</view>
  282. <view class="price" v-if="isShowVipFlag(pros)">
  283. {{ pros.svipPriceTag }}
  284. </view>
  285. </view>
  286. </template>
  287. </view>
  288. </template>
  289. <view v-if="hasLogin" class="list-price">
  290. <!-- 协销 -->
  291. <template v-if="userIdentity == 1">
  292. <text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
  293. <text
  294. v-else
  295. class="price-larger"
  296. :class="
  297. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'none' : ''
  298. "
  299. >
  300. ¥{{
  301. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  302. | NumFormat
  303. }}
  304. </text>
  305. </template>
  306. <!-- 普通机构且不是超级会员 -->
  307. <template v-if="userIdentity == 4 && vipFlag != 1">
  308. <view class="price-larger" v-if="pros.priceFlag == 1">
  309. <text class="txt">¥未公开价格</text>
  310. </view>
  311. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  312. <template v-else>
  313. <view class="price-larger" v-if="pros.priceFlag == 2">
  314. <text class="txt">¥价格仅会员可见</text>
  315. </view>
  316. <view class="price-larger" v-else-if="pros.priceFlag == 3">
  317. <text class="txt">¥仅医美机构可见</text>
  318. </view>
  319. <text
  320. v-else
  321. class="price-larger"
  322. :class="
  323. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  324. ? 'none'
  325. : ''
  326. "
  327. >
  328. ¥{{
  329. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  330. | NumFormat
  331. }}
  332. </text>
  333. </template>
  334. </template>
  335. <!-- 供应商 -->
  336. <template v-if="userIdentity == 3">
  337. <template v-if="pros.supplierId == shopId">
  338. <view class="price-larger" v-if="pros.priceFlag == 1">
  339. <text class="txt">¥未公开价格</text>
  340. </view>
  341. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  342. <text
  343. v-else
  344. class="price-larger"
  345. :class="
  346. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  347. ? 'none'
  348. : ''
  349. "
  350. >
  351. ¥{{
  352. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  353. | NumFormat
  354. }}
  355. </text>
  356. </template>
  357. <template v-else>
  358. <view class="list-login-now">
  359. <text class="p-no">¥</text>
  360. <uni-grader :grade="Number(pros.priceGrade)"></uni-grader>
  361. </view>
  362. </template>
  363. </template>
  364. <!-- 会员机构 && 普通机构且是超级会员 -->
  365. <template v-if="userIdentity == 2 || (userIdentity == 4 && vipFlag == 1)">
  366. <view class="price-larger" v-if="pros.priceFlag == 1">
  367. <text class="txt">¥未公开价格</text>
  368. </view>
  369. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  370. <template v-else>
  371. <view class="price-larger" v-if="pros.priceFlag == 3 && firstClubType != 1">
  372. <text class="txt">¥仅医美机构可见</text>
  373. </view>
  374. <text
  375. v-else
  376. class="price-larger"
  377. :class="
  378. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  379. ? 'none'
  380. : ''
  381. "
  382. >
  383. ¥{{
  384. (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
  385. | NumFormat
  386. }}
  387. </text>
  388. </template>
  389. </template>
  390. </view>
  391. <view v-else class="list-login-now">
  392. <text class="p-no">¥</text>
  393. <uni-grader :grade="Number(pros.priceGrade)"></uni-grader>
  394. </view>
  395. </view>
  396. </view>
  397. </view>
  398. <view v-if="showLoading && listData.length > 4">
  399. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow">
  400. {{ loadingText }} <text v-if="loadingText === '已至底部'">‧ ‧ ‧</text>
  401. </view>
  402. <view class="loading-wrapper loading-wrapper-btm" v-else>
  403. ——— <text class="btm-text">已至底部</text> ———
  404. </view>
  405. </view>
  406. </scroll-view>
  407. <view class="empty-container" v-if="showEmpty">
  408. <image
  409. class="empty-container-image"
  410. src="https://img.caimei365.com/group1/M00/03/8D/Cmis215XHXWAHCoqAAELHadZ9Xg365.png"
  411. ></image>
  412. <text class="error-text">抱歉,没有相关商品!</text>
  413. </view>
  414. </view>
  415. <!--筛选条件右抽屉-->
  416. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  417. <view class="drawer-title">
  418. <view class="drawer-title-h1">品牌</view>
  419. <view class="drawer-title-p">
  420. 已选中 <text class="text">{{ checkedBrandLength }}</text> 个品牌
  421. </view>
  422. </view>
  423. <view
  424. class="drawer-container clearfix"
  425. scroll-y
  426. :style="{ paddingBottom: isIphoneX ? '180rpx' : '146rpx' }"
  427. @scroll="drawerScroll(event)"
  428. >
  429. <scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
  430. <view class="drawer-main">
  431. <view class="drawer-main-brand clearfix">
  432. <view
  433. class="drawer-brand-list"
  434. :class="isAllcheckedBrand ? 'checked' : ''"
  435. @click="choiceBrandAll"
  436. >
  437. 全部
  438. </view>
  439. <view
  440. class="drawer-brand-list"
  441. :class="brand.isChecked ? 'checked' : ''"
  442. v-for="(brand, index) in brandLists"
  443. :key="index"
  444. @click="choiceBrand(brand, index)"
  445. >
  446. {{ brand.name }}
  447. </view>
  448. <view class="drawer-brand-more" v-if="!isShowAllBrands" @click="showAllBrands">
  449. 查看全部 <text class="iconfont icon-xiangxiajiantou"></text>
  450. </view>
  451. </view>
  452. <view class="drawer-main-radio">
  453. <view class="drawer-radio-name">新品</view>
  454. <view class="drawer-radio-input" @click="choiceNewType">
  455. <text
  456. class="iconfont"
  457. :class="isChoiceNewType ? 'icon-yixuanze' : 'icon-weixuanze'"
  458. ></text>
  459. </view>
  460. </view>
  461. <view class="drawer-main-radio">
  462. <view class="drawer-radio-name">促销商品</view>
  463. <view class="drawer-radio-input" @click="choiceActiType">
  464. <text
  465. class="iconfont"
  466. :class="isChoiceActiType ? 'icon-yixuanze' : 'icon-weixuanze'"
  467. ></text>
  468. </view>
  469. </view>
  470. </view>
  471. </scroll-view>
  472. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  473. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  474. <view class="drawer-btn comfrim" @click="handSearchList">确定</view>
  475. </view>
  476. </view>
  477. </tui-drawer>
  478. <!-- 供应商收集用户信息弹窗 -->
  479. <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml" :advertisement="advertisement" />
  480. <!-- 透明模态层 -->
  481. <modal-layer v-if="isModallayer"></modal-layer>
  482. </view>
  483. </template>
  484. <script>
  485. import { mapState } from 'vuex'
  486. import modalLayer from '@/components/modal-layer'
  487. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  488. import cmRossPopup from '@/components/cm-module/cm-ross/cm-ross-popup'
  489. import wxLogin from '@/common/config/wxLogin.js'
  490. import { debounce } from '@/common/config/common.js'
  491. import cmSrsMixins from '@/utils/cmSrsMixins.js'
  492. import searchMixins from './mixins/searchMixins.js'
  493. const myDebounce = fn => debounce(fn, 500, false)
  494. export default {
  495. components: {
  496. modalLayer,
  497. uniGrader,
  498. cmRossPopup
  499. },
  500. mixins: [cmSrsMixins,searchMixins],
  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:#FF5B00;">${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. handleSearchQuery() {
  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.handleProsKey = this.listQuery.keyword
  696. uni.setStorageSync('pageLabel', this.listQuery.keyword)
  697. this.checkedIsRossSet() //判断是否弹窗ross广告
  698. this.setSearchHistoryAdd()
  699. this.getCommoditySearchQUeryBrand()
  700. this.getListFromServer()
  701. this.isFocus = false
  702. // 友盟埋点商品搜索点击
  703. if (process.env.NODE_ENV != 'development') {
  704. this.$uma.trackEvent('Um_Event_SearchProductSubmit', {
  705. Um_Key_Keyword: `${this.listQuery.keyword}`,
  706. Um_Key_PageName: '商品',
  707. Um_Key_SourcePage: '搜索商品'
  708. })
  709. }
  710. break
  711. case 2:
  712. this.setSearchHistoryAdd()
  713. this.$api.navigateTo(`/pages/search/search-supplier?keyWord=${this.listQuery.keyword}`)
  714. break
  715. case 3:
  716. this.setSearchHistoryAdd()
  717. this.$api.navigateTo(`/pages/search/search-instrument?keyWord=${this.listQuery.keyword}`)
  718. break
  719. }
  720. }
  721. },
  722. handSearchList() {
  723. //确定筛选
  724. this.rightDrawer = false
  725. this.listQuery.pageNum = 1
  726. this.getListFromServer(false)
  727. },
  728. scrolltolower() {
  729. if (this.total > this.listData.length && this.pullFlag) {
  730. this.getListFromServer(true)
  731. }
  732. },
  733. async getListFromServer(loadMore) {
  734. this.showLoading = true
  735. this.loadingNow = true
  736. this.loadingText = '加载中'
  737. this.showEmpty = false
  738. if (loadMore) {
  739. this.listQuery.pageNum += 1
  740. }
  741. try {
  742. const res = await this.ProductService.GetProductSearchList(this.listQuery)
  743. const data = JSON.parse(res.data)
  744. const dataList = data.items
  745. if (dataList && dataList.length > 0) {
  746. this.total = data.total
  747. this.showEmpty = false
  748. if (loadMore) {
  749. this.listData = [...this.listData, ...dataList]
  750. this.getProductPrice()
  751. } else {
  752. this.listData = [...dataList]
  753. this.getProductPrice()
  754. }
  755. // 防上拉暴滑
  756. this.pullFlag = false
  757. setTimeout(() => {
  758. this.pullFlag = true
  759. }, 500)
  760. // 底部提示文案
  761. if (this.total > this.listData.length) {
  762. this.loadingText = '上拉加载更多'
  763. } else {
  764. this.showLoading = true
  765. this.loadingNow = false
  766. }
  767. } else {
  768. if (!loadMore) {
  769. this.showEmpty = true
  770. }
  771. }
  772. this.isShowWrapper = true
  773. } catch (error) {
  774. console.log('商品搜索异常:', error.msg)
  775. }
  776. },
  777. async setSearchHistoryAdd() {
  778. //此为每次搜索同时添加用户的搜索记录
  779. if (!this.hasLogin) {
  780. return false
  781. }
  782. try{
  783. await this.ProductService.GetAddProductSearchHistory({ userId: this.userId, keyword: this.listQuery.keyword })
  784. }catch(error){
  785. console.log('添加用户搜索记录异常:', error.msg)
  786. }
  787. },
  788. async getProductPrice() {
  789. //获取价格
  790. let productIdArr = []
  791. this.listData.map(item => {
  792. // 0公开价格 1不公开价格 2仅对资质机构公开
  793. productIdArr.push(item.productId)
  794. })
  795. this.priceLoading = true
  796. this.productIds = productIdArr.join(',')
  797. try{
  798. const res = await this.ProductService.querySearchProductPrice({ userId: this.userId,productIds: this.productIds,source: 2 })
  799. const data = res.data
  800. this.listData = this.ReturnNewProducts(this.listData, data)
  801. this.priceLoading = false
  802. }catch(error){
  803. console.log('获取商品价格异常:', error.msg)
  804. }
  805. },
  806. ReturnNewProducts(Array, list) {
  807. //处理对应商品ID的商品价格
  808. let NewArray = []
  809. Array.map(item => {
  810. for (let i = 0; i < list.length; i++) {
  811. if (item.productId == list[i].productId) {
  812. NewArray.push(Object.assign(item, list[i]))
  813. }
  814. }
  815. })
  816. return NewArray
  817. },
  818. handleScreen(e) {
  819. let index = e.currentTarget.dataset.index
  820. if (index == 0) {
  821. this.tabIndex = 0
  822. this.isSearchSalesFirst = true
  823. this.isSearchMoodFirst = true
  824. this.isSearchPriceFirst = true
  825. this.listQuery.sortType = 1
  826. this.listQuery.sortField = ''
  827. this.getListFromServer()
  828. } else if (index == 1) {
  829. this.tabIndex = 1
  830. this.isSearchSalesFirst = false
  831. this.isSearchMoodFirst = true
  832. this.isSearchPriceFirst = true
  833. this.isSearchSales = !this.isSearchSales
  834. if (this.isSearchSales) {
  835. this.listQuery.sortType = 1
  836. } else {
  837. this.listQuery.sortType = 0
  838. }
  839. this.listQuery.sortField = 'sales'
  840. this.getListFromServer()
  841. } else if (index == 2) {
  842. this.tabIndex = 2
  843. this.isSearchSalesFirst = true
  844. this.isSearchPriceFirst = true
  845. this.isSearchMoodFirst = false
  846. this.isSearchMood = !this.isSearchMood
  847. if (this.isSearchMood) {
  848. this.listQuery.sortType = 1
  849. } else {
  850. this.listQuery.sortType = 0
  851. }
  852. this.listQuery.sortField = 'favorite'
  853. this.getListFromServer()
  854. } else if (index == 3) {
  855. this.tabIndex = 3
  856. this.isSearchSalesFirst = true
  857. this.isSearchMoodFirst = true
  858. this.isSearchPriceFirst = false
  859. this.isSearchPrice = !this.isSearchPrice
  860. if (this.isSearchPrice) {
  861. this.listQuery.sortType = 1
  862. } else {
  863. this.listQuery.sortType = 0
  864. }
  865. this.listQuery.sortField = 'price'
  866. this.getListFromServer()
  867. } else if (index == 4) {
  868. this.brandParam.keyword = this.listQuery.keyword
  869. this.showRightDrawer()
  870. }
  871. },
  872. showRightDrawer() {
  873. //弹出右侧抽屉
  874. this.rightDrawer = true
  875. },
  876. closeDrawer(e) {
  877. //关闭抽屉
  878. this.rightDrawer = false
  879. },
  880. PromotionsFormat(promo) {
  881. //促销活动类型数据处理
  882. if (promo != null) {
  883. if (promo.type == 1 && promo.mode == 1) {
  884. return true
  885. } else {
  886. return false
  887. }
  888. }
  889. return false
  890. },
  891. isShowVipFlag(pros) {
  892. /**
  893. *显示SVIP和超级会员价格:
  894. * 个人机构(不是超级会员,但价格所有机构可见),
  895. * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
  896. * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
  897. *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
  898. * 普通机构
  899. * 超级会员 && priceFlag === 0
  900. * 资质机构
  901. * priceFlag !== 1 ||
  902. * 超级会员
  903. * 商品priceFlag === 3 && 是否是医美机构
  904. */
  905. // 未登录 || 非会员
  906. if (!this.hasLogin || !this.vipFlag === 1) return false
  907. // 商品所有机构可见
  908. if (pros.priceFlag === 0) return true
  909. // 商品价格仅资质机构可见
  910. if (pros.priceFlag === 2 && this.userIdentity === 2) return true
  911. // 商品价格仅医美机构可见
  912. if (pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) return true
  913. // 其它
  914. return false
  915. },
  916. onShowClose() {
  917. //输入框输入时触发
  918. this.inputEmpty(this.listQuery.keyword)
  919. this.fetchLibraryWordList()
  920. },
  921. onFocus() {
  922. //输入框获取焦点时触发
  923. this.inputEmpty(this.listQuery.keyword)
  924. this.initGetSerachRecord()
  925. },
  926. delInputText() {
  927. //清除输入框内容
  928. this.listQuery.keyword = ''
  929. this.isShowClose = false
  930. this.isShowWrapper = false
  931. this.inputEmpty(this.listQuery.keyword)
  932. this.initGetSerachRecord()
  933. this.showLibaray = false
  934. },
  935. keywordsClick(item) {
  936. //关键词搜索与历史搜索
  937. this.listQuery.keyword = item
  938. this.isShowClose = true
  939. this.isFocus = false
  940. this.handleSearchQuery()
  941. },
  942. keywordsClickPath(item) {
  943. this.$api.FlooryNavigateTo(item)
  944. },
  945. confirmDetele() {
  946. //清空历史记录
  947. this.$util.modal('提示', '确定删除历史记录?', '确定', '取消', true, () => {
  948. this.ProductService.GetDeleteProductSearchHistory({ userId: this.userId })
  949. .then(response => {
  950. this.$util.msg('删除成功', 2000, true, 'success')
  951. this.serachRecordList = []
  952. })
  953. .catch(error => {
  954. this.$util.msg(error.msg, 2000)
  955. })
  956. })
  957. },
  958. inputEmpty(val) {
  959. this.isShowWrapper = false
  960. if (val != '') {
  961. this.isShowClose = true
  962. this.isFocus = true
  963. } else {
  964. this.isShowClose = false
  965. this.isFocus = true
  966. }
  967. },
  968. isInterceptHtmlFn(text) {
  969. let name = this.$reg.interceptHtmlFn(text)
  970. return name
  971. },
  972. navToDetailPage(id) {
  973. this.isModallayer = true
  974. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  975. this.isModallayer = false
  976. },
  977. setScrollHeight() {
  978. let obj = {}
  979. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  980. uni.getSystemInfo({
  981. success: res => {
  982. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  983. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  984. }
  985. })
  986. this.windowHeight = windowHeight - 1
  987. this.scrollHeight = windowHeight - 1
  988. },
  989. toLoginPage() {
  990. let searchLoginType = 'search'
  991. uni.navigateTo({
  992. url: `/pages/login/login?type=${searchLoginType}`
  993. })
  994. },
  995. selectTabs(index) {
  996. //选择搜索项
  997. this.showBubblePopup = false
  998. this.searchKeyType = index
  999. switch (index) {
  1000. case 1:
  1001. this.tabValue = '商品'
  1002. break
  1003. case 2:
  1004. this.tabValue = '供应商'
  1005. break
  1006. case 3:
  1007. this.tabValue = '项目仪器'
  1008. break
  1009. }
  1010. },
  1011. showAllBrands() {
  1012. // 显示全部品牌
  1013. this.isShowAllBrands = true
  1014. this.brandLists = this.defaultBrandLists
  1015. },
  1016. choiceBrand(brand, index) {
  1017. // 选择品牌
  1018. brand.isChecked = !brand.isChecked
  1019. if (brand.isChecked) {
  1020. if (!this.contains(this.checkedBrandList, brand.id)) {
  1021. this.checkedBrandList.push(brand.id)
  1022. }
  1023. } else {
  1024. this.checkedBrandList.splice(this.checkedBrandList.indexOf(brand.id), 1)
  1025. }
  1026. this.isAllcheckedBrand = false
  1027. this.checkedBrandLength = this.checkedBrandList.length
  1028. console.log('checkedBrandList', this.checkedBrandList)
  1029. this.listQuery.brandIds = this.checkedBrandList.join(',')
  1030. console.log('this.listQuery.brandIds', this.listQuery.brandIds)
  1031. },
  1032. contains(arr, val) {
  1033. // 校验
  1034. return arr.some(item => item === val)
  1035. },
  1036. choiceBrandAll() {
  1037. // 点击选择全部品牌
  1038. this.isAllcheckedBrand = true
  1039. this.listQuery.brandIds = ''
  1040. this.brandLists.forEach(el => {
  1041. el.isChecked = false
  1042. })
  1043. },
  1044. choiceNewType() {
  1045. // 选择筛选项新品
  1046. this.isChoiceNewType = !this.isChoiceNewType
  1047. if (this.isChoiceNewType) {
  1048. this.listQuery.newFlag = 1
  1049. } else {
  1050. this.listQuery.newFlag = 0
  1051. }
  1052. },
  1053. choiceActiType() {
  1054. // 选择筛选项促销商品
  1055. this.isChoiceActiType = !this.isChoiceActiType
  1056. if (this.isChoiceNewType) {
  1057. this.listQuery.promotionFlag = 1
  1058. } else {
  1059. this.listQuery.promotionFlag = 0
  1060. }
  1061. },
  1062. topBubble() {
  1063. console.log('1111111111')
  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>