search.vue 67 KB

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