search.vue 42 KB

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