search.vue 47 KB

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