search.vue 65 KB

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