search.vue 41 KB

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