search.vue 43 KB

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