search.vue 41 KB

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