search.vue 39 KB

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