search.vue 42 KB

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