search.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711
  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. uni.setStorageSync('pageLabel',item.name)
  867. this.$api.FlooryNavigateTo(item)
  868. },
  869. confirmDetele() {
  870. //清空历史记录
  871. this.$util.modal('提示', '确定删除历史记录?', '确定', '取消', true, () => {
  872. this.ProductService.GetDeleteProductSearchHistory({ userId: this.userId })
  873. .then(response => {
  874. this.$util.msg('删除成功', 2000, true, 'success')
  875. this.serachRecordList = []
  876. })
  877. .catch(error => {
  878. this.$util.msg(error.msg, 2000)
  879. })
  880. })
  881. },
  882. inputEmpty(val) {
  883. this.isShowWrapper = false
  884. if (val != '') {
  885. this.isShowClose = true
  886. this.isFocus = true
  887. } else {
  888. this.isShowClose = false
  889. this.isFocus = true
  890. }
  891. },
  892. isInterceptHtmlFn(text) {
  893. let name = this.$reg.interceptHtmlFn(text)
  894. return name
  895. },
  896. navToDetailPage(id) {
  897. this.isModallayer = true
  898. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  899. this.isModallayer = false
  900. },
  901. setScrollHeight() {
  902. let obj = {}
  903. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  904. uni.getSystemInfo({
  905. success: res => {
  906. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  907. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  908. }
  909. })
  910. this.windowHeight = windowHeight - 1
  911. this.scrollHeight = windowHeight - 1
  912. },
  913. toLoginPage() {
  914. let searchLoginType = 'search'
  915. uni.navigateTo({
  916. url: `/pages/login/login?type=${searchLoginType}`
  917. })
  918. },
  919. selectTabs(index) {
  920. //选择搜索项
  921. this.showBubblePopup = false
  922. this.searchKeyType = index
  923. switch (index) {
  924. case 1:
  925. this.tabValue = '产品'
  926. break
  927. case 2:
  928. this.tabValue = '供应商'
  929. break
  930. case 3:
  931. this.tabValue = '项目仪器'
  932. break
  933. }
  934. },
  935. showAllBrands() {
  936. // 显示全部品牌
  937. this.isShowAllBrands = true
  938. this.brandLists = this.defaultBrandLists
  939. },
  940. choiceBrand(brand, index) {
  941. // 选择品牌
  942. brand.isChecked = !brand.isChecked
  943. if (brand.isChecked) {
  944. this.checkedBrandList.push(brand.id)
  945. } else {
  946. this.checkedBrandList.splice(index, 1)
  947. }
  948. this.isAllcheckedBrand = false
  949. this.checkedBrandLength = this.checkedBrandList.length
  950. console.log('checkedBrandList', this.checkedBrandList)
  951. this.listQuery.brandIds = this.checkedBrandList.join(',')
  952. console.log('this.listQuery.brandIds', this.listQuery.brandIds)
  953. },
  954. choiceBrandAll(){
  955. // 点击选择全部品牌
  956. this.isAllcheckedBrand = true
  957. this.listQuery.brandIds = ''
  958. this.brandLists.forEach(el=>{
  959. el.isChecked = false
  960. })
  961. },
  962. choiceNewType() {
  963. // 选择筛选项新品
  964. this.isChoiceNewType = !this.isChoiceNewType
  965. if(this.isChoiceNewType){
  966. this.listQuery.newFlag = 1
  967. }else{
  968. this.listQuery.newFlag = 0
  969. }
  970. },
  971. choiceActiType() {
  972. // 选择筛选项促销商品
  973. this.isChoiceActiType = !this.isChoiceActiType
  974. if(this.isChoiceNewType){
  975. this.listQuery.promotionFlag = 1
  976. }else{
  977. this.listQuery.promotionFlag = 0
  978. }
  979. },
  980. topBubble() {
  981. console.log('1111111111')
  982. //显隐搜索项
  983. this.showBubblePopup = !this.showBubblePopup
  984. }
  985. },
  986. onShareAppMessage(res) {
  987. //分享转发
  988. if (res.from === 'button') {
  989. // 来自页面内转发按钮
  990. }
  991. return {
  992. title: `点击查看“${this.listQuery.keyword}”相关的商品`,
  993. path: `pages/search/search?type=share&keyWord=${this.listQuery.keyword}`
  994. }
  995. },
  996. onShow() {
  997. this.setScrollHeight()
  998. this.GetHomeHotSearchTerms()
  999. }
  1000. }
  1001. </script>
  1002. <style lang="scss">
  1003. @import '@/uni.scss';
  1004. page {
  1005. background-color: #f7f7f7 !important;
  1006. }
  1007. .search-main-bubble{
  1008. width: 100%;
  1009. height: 88rpx;
  1010. position: fixed;
  1011. top: 30rpx;
  1012. left: 0;
  1013. z-index: 1200;
  1014. box-sizing: border-box;
  1015. line-height: 70rpx;
  1016. color: #666666;
  1017. font-size: $font-size-24;
  1018. text-align: center;
  1019. }
  1020. .search-main {
  1021. width: 100%;
  1022. height: 88rpx;
  1023. position: fixed;
  1024. top: 0;
  1025. left: 0;
  1026. background: #ffffff;
  1027. z-index: 990;
  1028. box-sizing: border-box;
  1029. .tui-header-tab {
  1030. height: 88rpx;
  1031. box-sizing: border-box;
  1032. padding: 9rpx 0;
  1033. float: left;
  1034. .search-tab {
  1035. width: 160rpx;
  1036. height: 70rpx;
  1037. line-height: 70rpx;
  1038. color: #666666;
  1039. font-size: $font-size-24;
  1040. text-align: center;
  1041. float: left;
  1042. position: relative;
  1043. .icon-xiangxiajiantou {
  1044. margin-left: 10rpx;
  1045. font-size: $font-size-30;
  1046. }
  1047. }
  1048. .gosearch-btn {
  1049. width: 470rpx;
  1050. height: 100%;
  1051. float: left;
  1052. border-radius: 40rpx;
  1053. background: #f0f0f0;
  1054. margin: 0 auto;
  1055. padding: 0 20rpx;
  1056. font-size: 28rpx;
  1057. line-height: 70rpx;
  1058. padding-left: 70rpx;
  1059. color: #8a8a8a;
  1060. background: #f7f7f7;
  1061. position: relative;
  1062. box-sizing: border-box;
  1063. .icon-sousuo {
  1064. width: 70rpx;
  1065. height: 70rpx;
  1066. line-height: 70rpx;
  1067. text-align: center;
  1068. display: block;
  1069. position: absolute;
  1070. left: 0;
  1071. top: 0;
  1072. font-size: 34rpx;
  1073. color: #8a8a8a;
  1074. z-index: 10;
  1075. }
  1076. .icon-shanchu1 {
  1077. font-size: 36rpx;
  1078. color: #8a8a8a;
  1079. position: absolute;
  1080. right: 10rpx;
  1081. top: 0;
  1082. padding: 0 10rpx;
  1083. z-index: 100;
  1084. }
  1085. .input {
  1086. width: 400rpx;
  1087. height: 100%;
  1088. float: left;
  1089. font-size: $font-size-24;
  1090. box-sizing: border-box;
  1091. padding-right: 66rpx;
  1092. }
  1093. }
  1094. .search-btn {
  1095. width: 120rpx;
  1096. height: 70rpx;
  1097. line-height: 70rpx;
  1098. float: right;
  1099. text-align: center;
  1100. color: #666666;
  1101. font-size: $font-size-24;
  1102. }
  1103. }
  1104. }
  1105. .search-container {
  1106. padding-top: 89rpx;
  1107. }
  1108. /*screen*/
  1109. .tui-header-screen {
  1110. width: 100%;
  1111. height: 88rpx;
  1112. float: left;
  1113. box-sizing: border-box;
  1114. background: #fff;
  1115. }
  1116. .tui-screen-top,
  1117. .tui-screen-bottom {
  1118. display: flex;
  1119. align-items: center;
  1120. justify-content: space-between;
  1121. font-size: 28rpx;
  1122. color: #999999;
  1123. }
  1124. .tui-screen-top {
  1125. height: 88rpx;
  1126. position: relative;
  1127. background: #fff;
  1128. border-bottom: 1px solid #efefef;
  1129. }
  1130. .tui-top-item {
  1131. height: 28rpx;
  1132. line-height: 28rpx;
  1133. flex: 1;
  1134. display: flex;
  1135. align-items: center;
  1136. justify-content: center;
  1137. }
  1138. .icon-shangxiajiantou {
  1139. font-size: 20rpx;
  1140. color: #999999;
  1141. margin-left: 8rpx;
  1142. }
  1143. .tui-topitem-active {
  1144. color: #e15616;
  1145. }
  1146. .tui-screen-bottom {
  1147. height: 100rpx;
  1148. padding: 0 30rpx;
  1149. box-sizing: border-box;
  1150. font-size: 24rpx;
  1151. align-items: center;
  1152. overflow: hidden;
  1153. }
  1154. .tui-bottom-text {
  1155. line-height: 26rpx;
  1156. max-width: 82%;
  1157. white-space: nowrap;
  1158. overflow: hidden;
  1159. text-overflow: ellipsis;
  1160. }
  1161. .tui-bottom-item {
  1162. flex: 1;
  1163. width: 0;
  1164. display: flex;
  1165. align-items: center;
  1166. justify-content: center;
  1167. padding: 0 12rpx;
  1168. box-sizing: border-box;
  1169. background: #f7f7f7;
  1170. margin-right: 20rpx;
  1171. white-space: nowrap;
  1172. height: 60rpx;
  1173. border-radius: 40rpx;
  1174. }
  1175. .tui-bottom-item:last-child {
  1176. margin-right: 0;
  1177. }
  1178. .tui-btmItem-active {
  1179. background: #fcedea !important;
  1180. color: #e15616;
  1181. font-weight: bold;
  1182. position: relative;
  1183. }
  1184. .tui-btmItem-active::after {
  1185. content: '';
  1186. position: absolute;
  1187. border: 1rpx solid #e15616;
  1188. width: 100%;
  1189. height: 100%;
  1190. border-radius: 40rpx;
  1191. left: 0;
  1192. top: 0;
  1193. }
  1194. .tui-btmItem-tap {
  1195. position: relative;
  1196. border-bottom-left-radius: 0;
  1197. border-bottom-right-radius: 0;
  1198. }
  1199. .tui-btmItem-tap::after {
  1200. content: '';
  1201. position: absolute;
  1202. width: 100%;
  1203. height: 22rpx;
  1204. background: #f7f7f7;
  1205. left: 0;
  1206. top: 58rpx;
  1207. }
  1208. .tui-active {
  1209. color: #e15616;
  1210. }
  1211. .tui-icon-ml .tui-icon-class {
  1212. margin-left: 6rpx;
  1213. }
  1214. .tui-ml {
  1215. margin-left: 6rpx;
  1216. }
  1217. .tui-seizeaseat-20 {
  1218. height: 20rpx;
  1219. }
  1220. .tui-seizeaseat-30 {
  1221. height: 30rpx;
  1222. }
  1223. .tui-icon-middle .tui-icon-class {
  1224. vertical-align: middle;
  1225. }
  1226. .tui-middle {
  1227. vertical-align: middle;
  1228. }
  1229. .search-container-history {
  1230. width: 100%;
  1231. min-height: 300rpx;
  1232. position: fixed;
  1233. top: 88rpx;
  1234. left: 0;
  1235. z-index: 999;
  1236. }
  1237. .s-block {
  1238. background: #ffffff;
  1239. .header {
  1240. font-size: 32rpx;
  1241. padding: 40rpx 24rpx 22rpx 24rpx;
  1242. line-height: 42rpx;
  1243. font-size: 30rpx;
  1244. font-weight: bold;
  1245. position: relative;
  1246. width: 100%;
  1247. float: left;
  1248. box-sizing: border-box;
  1249. .icon-shanchu {
  1250. font-size: 36rpx;
  1251. color: #333333;
  1252. float: right;
  1253. padding: 0 10rpx;
  1254. z-index: 10;
  1255. font-weight: normal;
  1256. }
  1257. }
  1258. .list {
  1259. width: 100%;
  1260. height: auot;
  1261. float: left;
  1262. padding: 0 24rpx 30rpx 24rpx;
  1263. box-sizing: border-box;
  1264. .list-title {
  1265. width: 100%;
  1266. height: 40rpx;
  1267. font-size: $font-size-26;
  1268. color: #333;
  1269. }
  1270. .list-main {
  1271. width: 100%;
  1272. float: left;
  1273. display: flex;
  1274. flex-wrap: wrap;
  1275. view {
  1276. color: #8a8a8a;
  1277. font-size: 24rpx;
  1278. box-sizing: border-box;
  1279. text-align: center;
  1280. height: 48rpx;
  1281. line-height: 48rpx;
  1282. border-radius: 24rpx;
  1283. margin: 12rpx 12rpx 12rpx 0;
  1284. padding: 0 20rpx;
  1285. white-space: nowrap;
  1286. text-overflow: ellipsis;
  1287. background-color: #f3f3f3;
  1288. .iconfont {
  1289. font-size: $font-size-30;
  1290. color: #e15616;
  1291. margin-left: 12rpx;
  1292. }
  1293. &.list-active {
  1294. background-color: #fef6f3;
  1295. color: #e15616;
  1296. }
  1297. }
  1298. }
  1299. }
  1300. }
  1301. .s-circle {
  1302. margin-top: 30rpx;
  1303. .header {
  1304. font-size: 32rpx;
  1305. padding: 30rpx;
  1306. border-bottom: 2rpx solid #f9f9f9;
  1307. position: relative;
  1308. image {
  1309. width: 36rpx;
  1310. height: 36rpx;
  1311. padding: 10rpx;
  1312. position: absolute;
  1313. right: 40rpx;
  1314. top: 24rpx;
  1315. }
  1316. }
  1317. .list {
  1318. display: flex;
  1319. flex-wrap: wrap;
  1320. padding: 0 30rpx 20rpx;
  1321. view {
  1322. padding: 8rpx 30rpx;
  1323. margin: 20rpx 30rpx 0 0;
  1324. font-size: 28rpx;
  1325. color: #8a8a8a;
  1326. background-color: #f7f7f7;
  1327. box-sizing: border-box;
  1328. text-align: center;
  1329. border-radius: 20rpx;
  1330. }
  1331. }
  1332. }
  1333. .wanted-block {
  1334. margin-top: 30rpx;
  1335. .header {
  1336. font-size: 32rpx;
  1337. padding: 30rpx;
  1338. }
  1339. .list {
  1340. display: flex;
  1341. flex-wrap: wrap;
  1342. view {
  1343. width: 50%;
  1344. color: #8a8a8a;
  1345. font-size: 28rpx;
  1346. box-sizing: border-box;
  1347. text-align: center;
  1348. padding: 20rpx 0;
  1349. border-top: 2rpx solid #fff;
  1350. border-left: 2rpx solid #fff;
  1351. background-color: #f7f7f7;
  1352. overflow: hidden;
  1353. white-space: nowrap;
  1354. text-overflow: ellipsis;
  1355. }
  1356. }
  1357. }
  1358. .wanted-circle {
  1359. margin-top: 30rpx;
  1360. .header {
  1361. font-size: 32rpx;
  1362. padding: 30rpx;
  1363. }
  1364. .list {
  1365. display: flex;
  1366. flex-wrap: wrap;
  1367. padding: 0 30rpx 20rpx;
  1368. view {
  1369. padding: 8rpx 30rpx;
  1370. margin: 20rpx 30rpx 0 0;
  1371. font-size: 28rpx;
  1372. color: #8a8a8a;
  1373. background-color: #f7f7f7;
  1374. box-sizing: border-box;
  1375. text-align: center;
  1376. border-radius: 20rpx;
  1377. }
  1378. }
  1379. }
  1380. .commodity-list-wrapper {
  1381. padding-top: 88rpx;
  1382. scroll-view {
  1383. height: 100%;
  1384. overflow: scroll;
  1385. }
  1386. .empty-container-image {
  1387. margin-top: -300rpx;
  1388. }
  1389. .toIndexPage {
  1390. bottom: 390rpx;
  1391. }
  1392. .show-more-btn {
  1393. width: 276rpx;
  1394. height: 52rpx;
  1395. line-height: 52rpx;
  1396. border: 2rpx solid #d8d8d8;
  1397. background: #f7f7f7;
  1398. font-size: 26rpx;
  1399. margin: 26rpx 0;
  1400. position: absolute;
  1401. left: 50%;
  1402. margin-left: -138rpx;
  1403. }
  1404. }
  1405. .all-type-list-content {
  1406. height: 216rpx;
  1407. padding: 24rpx;
  1408. background: #fff;
  1409. margin-bottom: 2rpx;
  1410. display: flex;
  1411. flex-direction: row;
  1412. box-sizing: content-box;
  1413. .list-details-image{
  1414. width: 218rpx;
  1415. height: 218rpx !important;
  1416. margin-right: 26rpx;
  1417. border-radius: 10rpx;
  1418. border: 2rpx solid #f3f3f3;
  1419. position: relative;
  1420. .list-img {
  1421. width: 218rpx;
  1422. height: 218rpx !important;
  1423. }
  1424. .list-details-type{
  1425. width: 64rpx;
  1426. height: 64rpx;
  1427. text-align: justify;
  1428. box-sizing: border-box;
  1429. padding: 10rpx;
  1430. border-radius: 0 0 8rpx 8rpx;
  1431. background-color: #33CCBF;
  1432. font-size: $font-size-22;
  1433. color: #FFFFFF;
  1434. line-height: 25rpx;
  1435. position: absolute;
  1436. top: 0;
  1437. right: 10rpx;
  1438. }
  1439. }
  1440. }
  1441. .list-details-info {
  1442. width: 466rpx;
  1443. display: flex;
  1444. flex-direction: column;
  1445. font-size: 26rpx;
  1446. position: relative;
  1447. .list-details-title {
  1448. position: relative;
  1449. .mclap {
  1450. line-height: 38rpx;
  1451. text-overflow: ellipsis;
  1452. overflow: hidden;
  1453. display: -webkit-box;
  1454. -webkit-line-clamp: 2;
  1455. line-clamp: 2;
  1456. -webkit-box-orient: vertical;
  1457. &.indent {
  1458. text-indent: 95rpx;
  1459. }
  1460. }
  1461. .mclap-tag {
  1462. display: block;
  1463. width: 84rpx;
  1464. height: 32rpx;
  1465. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1466. border-radius: 4rpx 48rpx 4px 4px;
  1467. line-height: 32rpx;
  1468. font-size: $font-size-22;
  1469. color: #ffffff;
  1470. text-align: center;
  1471. position: absolute;
  1472. left: 0;
  1473. top: 0;
  1474. }
  1475. }
  1476. .list-details-specs {
  1477. margin-top: 8rpx;
  1478. color: #666666;
  1479. }
  1480. .list-details-miniQuantity {
  1481. margin-top: 7rpx;
  1482. }
  1483. }
  1484. .list-details-price {
  1485. width: 100%;
  1486. height: 54rpx;
  1487. line-height: 54rpx;
  1488. position: absolute;
  1489. bottom: -10rpx;
  1490. right: 0;
  1491. .floor-item-act {
  1492. height: 54rpx;
  1493. text-align: center;
  1494. box-sizing: border-box;
  1495. float: right;
  1496. padding: 11rpx 0;
  1497. }
  1498. .price-icon {
  1499. width: 22rpx;
  1500. height: 28rpx;
  1501. vertical-align: middle;
  1502. margin-right: 10rpx;
  1503. }
  1504. .price-icon + text {
  1505. font-size: 25rpx;
  1506. vertical-align: middle;
  1507. }
  1508. .list-login-now {
  1509. color: #f8c499;
  1510. float: left;
  1511. line-height: 54rpx;
  1512. .p-no {
  1513. float: left;
  1514. font-size: $font-size-24;
  1515. color: $text-color;
  1516. }
  1517. }
  1518. .login-now {
  1519. padding: 10rpx 10rpx 10rpx 0;
  1520. }
  1521. .list-price {
  1522. color: #ff2a2a;
  1523. height: 44rpx;
  1524. float: left;
  1525. .price-larger {
  1526. width: 100%;
  1527. font-size: 32rpx;
  1528. &.none {
  1529. text-decoration: line-through;
  1530. color: #999999;
  1531. }
  1532. &.small {
  1533. font-size: $font-size-24;
  1534. }
  1535. .txt {
  1536. font-size: $font-size-24;
  1537. display: inline-block;
  1538. line-height: 44rpx;
  1539. text-align: left;
  1540. float: left;
  1541. }
  1542. }
  1543. }
  1544. }
  1545. // 筛选抽屉样式
  1546. .drawer-title {
  1547. width: 580rpx;
  1548. height: 72rpx;
  1549. line-height: 72rpx;
  1550. box-sizing: border-box;
  1551. padding: 0 30rpx;
  1552. background-color: #f7f7f7;
  1553. position: fixed;
  1554. top: 0;
  1555. left: 0;
  1556. z-index: 99;
  1557. .drawer-title-h1 {
  1558. font-size: $font-size-26;
  1559. color: #e15616;
  1560. font-weight: bold;
  1561. text-align: left;
  1562. float: left;
  1563. }
  1564. .drawer-title-p {
  1565. font-size: $font-size-24;
  1566. float: right;
  1567. color: #333333;
  1568. .text {
  1569. color: #e15616;
  1570. }
  1571. }
  1572. }
  1573. .drawer-container {
  1574. width: 580rpx;
  1575. height: 100%;
  1576. box-sizing: border-box;
  1577. background-color: #f7f7f7;
  1578. overflow: hidden;
  1579. position: relative;
  1580. padding-top: 72rpx;
  1581. .drawer-main {
  1582. width: 100%;
  1583. height: auto;
  1584. box-sizing: border-box;
  1585. .drawer-main-brand {
  1586. width: 100%;
  1587. height: auto;
  1588. box-sizing: border-box;
  1589. padding: 12rpx 24rpx 24rpx 24rpx;
  1590. background-color: #ffffff;
  1591. .drawer-brand-list {
  1592. width: 160rpx;
  1593. height: 56rpx;
  1594. line-height: 56rpx;
  1595. text-align: center;
  1596. font-size: 26rpx;
  1597. background-color: #f7f7f7;
  1598. color: #999999;
  1599. border-radius: 30rpx;
  1600. box-sizing: border-box;
  1601. padding: 0 15rpx;
  1602. float: left;
  1603. margin: 12rpx 24rpx 12rpx 0;
  1604. text-overflow: ellipsis;
  1605. overflow: hidden;
  1606. display: -webkit-box;
  1607. -webkit-line-clamp: 1;
  1608. line-clamp: 1;
  1609. -webkit-box-orient: vertical;
  1610. &.checked {
  1611. background-color: #fef6f3;
  1612. color: #e15616;
  1613. }
  1614. &:nth-child(3n) {
  1615. margin-right: 0;
  1616. }
  1617. }
  1618. .drawer-brand-more {
  1619. width: 100%;
  1620. height: 42rpx;
  1621. line-height: 42rpx;
  1622. float: left;
  1623. font-size: $font-size-24;
  1624. color: #999999;
  1625. text-align: center;
  1626. }
  1627. }
  1628. .drawer-main-radio {
  1629. width: 100%;
  1630. height: 72rpx;
  1631. background-color: #ffffff;
  1632. margin-top: 20rpx;
  1633. box-sizing: border-box;
  1634. padding: 0 24rpx;
  1635. .drawer-radio-name {
  1636. float: left;
  1637. line-height: 72rpx;
  1638. font-size: $font-size-26;
  1639. color: #333333;
  1640. }
  1641. .drawer-radio-input {
  1642. width: 72rpx;
  1643. height: 72rpx;
  1644. float: right;
  1645. line-height: 72rpx;
  1646. text-align: right;
  1647. .iconfont {
  1648. font-size: $font-size-36;
  1649. &.icon-weixuanze {
  1650. color: #b2b2b2;
  1651. }
  1652. &.icon-yixuanze {
  1653. color: #e15616;
  1654. }
  1655. }
  1656. }
  1657. }
  1658. }
  1659. .drawer-input {
  1660. width: 100%;
  1661. float: left;
  1662. box-sizing: border-box;
  1663. padding: 24rpx 10rpx 0 10rpx;
  1664. border: 1px solid rgba(0, 0, 0, 0.2);
  1665. border-radius: 4rpx;
  1666. position: relative;
  1667. background-color: #ffffff;
  1668. &.btn {
  1669. border: none;
  1670. display: flex;
  1671. position: fixed;
  1672. left: 0;
  1673. bottom: 0;
  1674. }
  1675. .drawer-btn {
  1676. width: 210rpx;
  1677. height: 84rpx;
  1678. border-radius: 42rpx;
  1679. background: $btn-confirm;
  1680. line-height: 84rpx;
  1681. text-align: center;
  1682. font-size: $font-size-26;
  1683. color: #ffffff;
  1684. flex: 1;
  1685. margin: 0 10rpx;
  1686. &.comfrim {
  1687. background: $btn-confirm;
  1688. }
  1689. &.clear {
  1690. background: #ffe6dc;
  1691. color: #e15616;
  1692. }
  1693. }
  1694. }
  1695. }
  1696. </style>