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