search.vue 41 KB

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