search.vue 66 KB

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