search.vue 40 KB

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