search.vue 47 KB

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