search.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. <template>
  2. <view class="search-container">
  3. <view class="search-main">
  4. <view class="search-tab">
  5. <view class="search-tab-btn" @click="topBubble">
  6. <text>{{ tabValue }}</text> <text class="iconfont icon-xiangxiajiantou"></text>
  7. </view>
  8. <tui-bubble-popup
  9. :show="show"
  10. :mask="true"
  11. position="absolute"
  12. direction="top"
  13. @close="topBubble"
  14. width="140rpx"
  15. left="10rpx"
  16. bottom="0rpx"
  17. translateY="100%"
  18. triangleRight="60rpx"
  19. triangleTop="-22rpx"
  20. :maskBgColor="maskBgColor"
  21. >
  22. <view class="tui-menu-item" @tap="selectTabs(1)">产品</view>
  23. <!-- <view class="tui-menu-item" @tap="selectTabs(2)">供应商</view> -->
  24. <view class="tui-menu-item" @tap="selectTabs(3)">项目仪器</view>
  25. </tui-bubble-popup>
  26. </view>
  27. <view class="gosearch-btn">
  28. <text class="iconfont icon-sousuo"></text>
  29. <input
  30. class="input"
  31. maxlength="20"
  32. :focus="isFocus"
  33. type="text"
  34. value=""
  35. confirm-type="search"
  36. @focus="onFocus"
  37. @input="onShowClose"
  38. @confirm="subMitSearch()"
  39. placeholder="请输入搜索关键字"
  40. v-model.trim="listQuery.keyword"
  41. />
  42. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click.stop="delInputText()"></text>
  43. </view>
  44. <view class="search-btn" @click="subMitSearch()">搜索</view>
  45. </view>
  46. <view class="search-container-history" v-if="!isShowWrapper">
  47. <view :class="'s-' + themeClass" v-if="serachRecordList.length > 0">
  48. <view class="header"> 搜索历史<text class="iconfont icon-shanchu" @click="confirmDetele"></text> </view>
  49. <view class="list">
  50. <view class="list-main">
  51. <view
  52. v-for="(item, index) in serachRecordList"
  53. :key="index"
  54. @click="keywordsClick(item.searchWord)"
  55. >{{ item.searchWord }}</view
  56. >
  57. </view>
  58. </view>
  59. </view>
  60. <view class="s-block hot clearfix">
  61. <view class="header">热门搜索</view>
  62. <view class="list">
  63. <view class="list-title">产品</view>
  64. <view class="list-main">
  65. <view
  66. v-for="(item, index) in productHotSearch"
  67. :key="index"
  68. @click="keywordsClickPath(item)"
  69. :class="item.isHot == '1' ? 'list-active' : ''"
  70. >
  71. {{ item.name }} <text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="list">
  76. <view class="list-title">仪器</view>
  77. <view class="list-main">
  78. <view
  79. v-for="(item, index) in instrumentHotSearch"
  80. :key="index"
  81. @click="keywordsClickPath(item)"
  82. :class="item.isHot == '1' ? 'list-active' : ''"
  83. >
  84. {{ item.name }} <text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view
  91. v-else
  92. class="commodity-list-wrapper"
  93. :style="{ overflow: 'auto', height: listData.length > 4 ? windowHeight + 'px' : 'auto' }"
  94. >
  95. <scroll-view
  96. :style="{ height: listData.length > 4 ? scrollHeight + 'px' : 'auto' }"
  97. @scrolltolower="scrolltolower"
  98. scroll-y
  99. v-if="!showEmpty"
  100. >
  101. <view
  102. v-for="(item, index) in listData"
  103. :key="index"
  104. :id="item.id"
  105. class="all-type-list-content commodity-list"
  106. @click.stop="navToDetailPage(item.productId)"
  107. >
  108. <image mode="widthFix" :src="item.image" class="list-img" alt="list-img"></image>
  109. <view class="list-details-info">
  110. <view class="list-details-title">
  111. <text class="mclap-tag" v-if="item.beautyActFlag == 1">美博会</text>
  112. <text class="mclap" :class="item.beautyActFlag == 1 ? 'indent' : ''">{{
  113. isInterceptHtmlFn(item.name)
  114. }}</text>
  115. </view>
  116. <text class="list-details-specs">规格:{{ item.unit }}</text>
  117. <view class="list-details-specs" v-if="item.code != '' && item.code != null">
  118. <view>商品编码:{{ item.code }}</view>
  119. </view>
  120. <view class="list-details-price">
  121. <template v-if="userIdentity == 3">
  122. <view class="floor-item-act" v-if="item.actStatus == 1">
  123. <view class="coupon-tags" v-if="item.couponsLogo">优惠券</view>
  124. <template>
  125. <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
  126. {{ item.promotions.name }}
  127. <text v-if="hasLogin && userIdentity == 2 && item.priceFlag != 1"
  128. >:¥{{ item.price | NumFormat }}</text
  129. >
  130. </view>
  131. <view class="floor-tags" v-else>{{ item.promotions.name }}</view>
  132. </template>
  133. </view>
  134. </template>
  135. <template v-else>
  136. <view class="floor-item-act" v-if="item.actStatus == 1">
  137. <view class="coupon-tags" v-if="item.couponsLogo">优惠券</view>
  138. <template>
  139. <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
  140. {{ item.promotions.name }}
  141. <text v-if="hasLogin && userIdentity == 2 && item.priceFlag != 1"
  142. >:¥{{ item.price | NumFormat }}</text
  143. >
  144. </view>
  145. <view class="floor-tags" v-else>{{ item.promotions.name }}</view>
  146. </template>
  147. </view>
  148. </template>
  149. <view v-if="hasLogin" class="list-price">
  150. <template v-if="userIdentity == 1">
  151. <text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
  152. <text
  153. v-else
  154. class="price-larger"
  155. :class="PromotionsFormat(item.promotions) ? 'none' : ''"
  156. >
  157. ¥{{
  158. (PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
  159. | NumFormat
  160. }}
  161. </text>
  162. </template>
  163. <template v-if="userIdentity == 4">
  164. <view class="price-larger" v-if="item.priceFlag == 1">
  165. <text class="txt">¥未公开价格</text>
  166. </view>
  167. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  168. <template v-else>
  169. <view class="price-larger" v-if="item.priceFlag == 2">
  170. <text class="txt">¥价格仅会员可见</text>
  171. </view>
  172. <text
  173. v-else
  174. class="price-larger"
  175. :class="PromotionsFormat(item.promotions) ? 'none' : ''"
  176. >
  177. ¥{{
  178. (PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
  179. | NumFormat
  180. }}
  181. </text>
  182. </template>
  183. </template>
  184. <template v-if="userIdentity == 3">
  185. <template v-if="item.supplierId == shopId">
  186. <view class="price-larger" v-if="item.priceFlag == 1">
  187. <text class="txt">¥未公开价格</text>
  188. </view>
  189. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  190. <text
  191. v-else
  192. class="price-larger"
  193. :class="PromotionsFormat(item.promotions) ? 'none' : ''"
  194. >
  195. ¥{{
  196. (PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
  197. | NumFormat
  198. }}
  199. </text>
  200. </template>
  201. <template v-else>
  202. <view class="list-login-now">
  203. <text class="p-no">¥</text>
  204. <uni-grader :grade="Number(item.priceGrade)"></uni-grader>
  205. </view>
  206. </template>
  207. </template>
  208. <template v-if="userIdentity == 2">
  209. <view class="price-larger" v-if="item.priceFlag == 1">
  210. <text class="txt">¥未公开价格</text>
  211. </view>
  212. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  213. <text
  214. v-else
  215. class="price-larger"
  216. :class="PromotionsFormat(item.promotions) ? 'none' : ''"
  217. >
  218. ¥{{
  219. (PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
  220. | NumFormat
  221. }}
  222. </text>
  223. </template>
  224. </view>
  225. <view v-else class="list-login-now">
  226. <text class="p-no">¥</text>
  227. <uni-grader :grade="Number(item.priceGrade)"></uni-grader>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. <view v-if="showLoading && listData.length > 4">
  233. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow"
  234. >{{ loadingText }}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view
  235. >
  236. <view class="loading-wrapper loading-wrapper-btm" v-else
  237. >———<text class="btm-text">已至底部</text>———</view
  238. >
  239. </view>
  240. </scroll-view>
  241. <view class="empty-container" v-if="showEmpty">
  242. <image
  243. class="empty-container-image"
  244. src="https://img.caimei365.com/group1/M00/03/8D/Cmis215XHXWAHCoqAAELHadZ9Xg365.png"
  245. ></image>
  246. <text class="error-text">抱歉,没有相关商品!</text>
  247. </view>
  248. </view>
  249. <!-- 透明模态层 -->
  250. <modal-layer v-if="isModallayer"></modal-layer>
  251. </view>
  252. </template>
  253. <script>
  254. import { mapState, mapMutations } from 'vuex'
  255. import modalLayer from '@/components/modal-layer'
  256. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  257. import authorize from '@/common/config/authorize.js'
  258. import wxLogin from '@/common/config/wxLogin.js'
  259. export default {
  260. components: {
  261. modalLayer,
  262. uniGrader
  263. },
  264. data() {
  265. return {
  266. shopId: 0,
  267. userId: 0,
  268. tabValue: '产品',
  269. themeClass: 'block',
  270. show: false,
  271. userIdentity: '',
  272. searchKeyType: 1,
  273. isShowClose: false, //是否显示清空输入框图标
  274. isSearchHistory: false, //是都显示搜索历史
  275. serachRecordList: [], //历史搜索记录
  276. instrumentHotSearch: [],
  277. productHotSearch: [],
  278. isShowWrapper: false,
  279. isModallayer: false,
  280. isFocus: false,
  281. priceLoading: true,
  282. windowHeight: '',
  283. showEmpty: false,
  284. scrollHeight: '',
  285. listData: [],
  286. productIds: '', //查询价格的商品ID
  287. showLoading: false,
  288. loadingNow: true,
  289. loadingText: '上拉加载更多',
  290. pullFlag: true,
  291. listQuery: {
  292. identity: 0,
  293. keyword: '',
  294. sortField: '',
  295. sortType: '',
  296. pageNum: 1,
  297. pageSize: 20
  298. },
  299. total: 0
  300. }
  301. },
  302. computed: {
  303. ...mapState(['hasLogin', 'userInfo', 'isWxAuthorize', 'hasLogin', 'userInfo', 'identity'])
  304. },
  305. onLoad(option) {
  306. console.log(option)
  307. if (option.type == 'share') {
  308. wxLogin.wxLoginAuthorize()
  309. }
  310. this.$api.getStorage().then(resolve => {
  311. this.userId = resolve.userId ? resolve.userId : 0
  312. this.shopId = resolve.shopId ? resolve.shopId : 0
  313. this.userIdentity = resolve.userIdentity
  314. this.listQuery.identity = this.identity
  315. if (option.keyWord) {
  316. this.listQuery.keyword = option.keyWord
  317. this.setSearchHistoryAdd()
  318. this.getListFromServer()
  319. this.isFocus = false
  320. } else {
  321. this.isFocus = true
  322. this.initGetSerachRecord()
  323. }
  324. })
  325. },
  326. filters: {
  327. NumFormat: function(text) {
  328. //处理金额
  329. return Number(text).toFixed(2)
  330. }
  331. },
  332. methods: {
  333. GetHomeHotSearchTerms() {
  334. //金刚区分类
  335. this.CommonService.GetHomeHotSearchTerms({})
  336. .then(response => {
  337. let data = response.data
  338. console.log(data)
  339. this.instrumentHotSearch = data.instrumentHotSearch
  340. this.productHotSearch = data.productHotSearch
  341. })
  342. .catch(error => {
  343. this.$util.msg(error.msg, 2000)
  344. })
  345. },
  346. initGetSerachRecord() {
  347. //查询搜索历史记录
  348. this.ProductService.GetProductSearchHistory({ userId: this.userId }).then(response => {
  349. if (response.code == 0) {
  350. this.serachRecordList = response.data
  351. }
  352. })
  353. },
  354. subMitSearch() {
  355. //搜索
  356. if (this.listQuery.keyword == '') {
  357. this.$util.msg('请输入搜索关键词', 2000)
  358. } else {
  359. switch (this.searchKeyType) {
  360. case 1:
  361. this.listData = []
  362. this.setSearchHistoryAdd()
  363. this.getListFromServer()
  364. this.isFocus = false
  365. // 友盟埋点商品搜索点击
  366. if (process.env.NODE_ENV != 'development') {
  367. this.$uma.trackEvent('Um_Event_SearchProductSubmit', {
  368. Um_Key_Keyword: `${this.listQuery.keyword}`,
  369. Um_Key_PageName: '商品',
  370. Um_Key_SourcePage: '搜索商品'
  371. })
  372. }
  373. break
  374. case 2:
  375. this.setSearchHistoryAdd()
  376. this.$api.navigateTo(`/pages/search/search-supplier?keyWord=${this.listQuery.keyword}`)
  377. break
  378. case 3:
  379. this.setSearchHistoryAdd()
  380. this.$api.navigateTo(`/pages/search/search-instrument?keyWord=${this.listQuery.keyword}`)
  381. break
  382. }
  383. }
  384. },
  385. scrolltolower() {
  386. if (this.total > this.listData.length && this.pullFlag) {
  387. this.getListFromServer(true)
  388. }
  389. },
  390. getListFromServer(loadMore) {
  391. this.showLoading = true
  392. this.loadingNow = true
  393. this.loadingText = '加载中'
  394. this.showEmpty = false
  395. if (loadMore) {
  396. this.listQuery.pageNum += 1
  397. }
  398. this.ProductService.GetProductSearchList(this.listQuery)
  399. .then(response => {
  400. this.isShowWrapper = true
  401. const resData = JSON.parse(response.data)
  402. const resList = resData.items
  403. console.log(resList)
  404. if (resList && resList.length > 0) {
  405. this.total = resData.total
  406. this.showEmpty = false
  407. if (loadMore) {
  408. this.listData = [...this.listData, ...resList]
  409. this.getProductPrice()
  410. } else {
  411. this.listData = [...resList]
  412. this.getProductPrice()
  413. }
  414. // 防上拉暴滑
  415. this.pullFlag = false
  416. setTimeout(() => {
  417. this.pullFlag = true
  418. }, 500)
  419. // 底部提示文案
  420. if (this.totalPage > this.listData.length) {
  421. this.loadingText = '上拉加载更多'
  422. } else {
  423. this.showLoading = true
  424. this.loadingNow = false
  425. }
  426. } else {
  427. if (!loadMore) {
  428. this.showEmpty = true
  429. }
  430. }
  431. })
  432. .catch(error => {
  433. this.$util.msg(error.msg, 2000)
  434. })
  435. },
  436. setSearchHistoryAdd() {
  437. //添加搜索记录
  438. if (!this.hasLogin) {
  439. return false
  440. }
  441. this.ProductService.GetAddProductSearchHistory({ userId: this.userId, keyword: this.listQuery.keyword })
  442. .then(response => {
  443. //此为每次搜索同时添加用户的搜索记录
  444. })
  445. .catch(error => {
  446. this.$util.msg(error.msg, 2000)
  447. })
  448. },
  449. getProductPrice() {
  450. //获取价格
  451. let productIdArr = []
  452. this.listData.map(item => {
  453. // 0公开价格 1不公开价格 2仅对资质机构公开
  454. productIdArr.push(item.productId)
  455. })
  456. this.productIds = productIdArr.join(',')
  457. this.ProductService.querySearchProductPrice({
  458. userId: this.userId,
  459. productIds: this.productIds,
  460. source: 2 // 来源 1 WWW 2 小程序
  461. })
  462. .then(response => {
  463. if (response.data) {
  464. this.listData = this.ReturnNewProducts(this.listData, response.data)
  465. }
  466. this.priceLoading = false
  467. })
  468. .catch(error => {
  469. this.$util.msg(error.msg, 2000)
  470. })
  471. },
  472. ReturnNewProducts(Array, list) {
  473. //处理对应商品ID的商品价格
  474. let NewArray = []
  475. Array.map(item => {
  476. for (let i = 0; i < list.length; i++) {
  477. if (item.productId == list[i].productId) {
  478. NewArray.push(Object.assign(item, list[i]))
  479. }
  480. }
  481. })
  482. return NewArray
  483. },
  484. PromotionsFormat(promo) {
  485. //促销活动类型数据处理
  486. if (promo != null) {
  487. if (promo.type == 1 && promo.mode == 1) {
  488. return true
  489. } else {
  490. return false
  491. }
  492. }
  493. return false
  494. },
  495. onShowClose() {
  496. //输入框输入时触发
  497. this.inputEmpty(this.listQuery.keyword)
  498. },
  499. onFocus() {
  500. //输入框获取焦点时触发
  501. this.inputEmpty(this.listQuery.keyword)
  502. this.initGetSerachRecord()
  503. },
  504. delInputText() {
  505. //清除输入框内容
  506. this.listQuery.keyword = ''
  507. this.isShowClose = false
  508. this.isShowWrapper = false
  509. this.inputEmpty(this.listQuery.keyword)
  510. this.initGetSerachRecord()
  511. },
  512. keywordsClick(item) {
  513. //关键词搜索与历史搜索
  514. this.listQuery.keyword = item
  515. this.isShowClose = true
  516. this.isFocus = false
  517. this.subMitSearch()
  518. },
  519. keywordsClickPath(item) {
  520. this.$api.FlooryNavigateTo(item)
  521. },
  522. confirmDetele() {
  523. //清空历史记录
  524. this.$util.modal('提示', '确定删除历史记录?', '确定', '取消', true, () => {
  525. this.ProductService.GetDeleteProductSearchHistory({ userId: this.userId })
  526. .then(response => {
  527. this.$util.msg('删除成功', 2000, true, 'success')
  528. this.serachRecordList = []
  529. })
  530. .catch(error => {
  531. this.$util.msg(error.msg, 2000)
  532. })
  533. })
  534. },
  535. inputEmpty(val) {
  536. this.isShowWrapper = false
  537. if (val != '') {
  538. this.isShowClose = true
  539. this.isFocus = true
  540. } else {
  541. this.isShowClose = false
  542. this.isFocus = true
  543. }
  544. },
  545. isInterceptHtmlFn(text) {
  546. let name = this.$reg.interceptHtmlFn(text)
  547. return name
  548. },
  549. navToDetailPage(id) {
  550. this.isModallayer = true
  551. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  552. this.isModallayer = false
  553. },
  554. setScrollHeight() {
  555. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  556. this.windowHeight = windowHeight - 1
  557. this.scrollHeight = windowHeight - 1
  558. },
  559. toLoginPage() {
  560. let searchLoginType = 'search'
  561. uni.navigateTo({
  562. url: `/pages/login/login?type=${searchLoginType}`
  563. })
  564. },
  565. selectTabs(index) {
  566. //选择搜索项
  567. this.show = false
  568. this.searchKeyType = index
  569. switch (index) {
  570. case 1:
  571. this.tabValue = '产品'
  572. break
  573. case 2:
  574. this.tabValue = '供应商'
  575. break
  576. case 3:
  577. this.tabValue = '项目仪器'
  578. break
  579. }
  580. },
  581. topBubble() {
  582. //显隐搜索项
  583. this.show = !this.show
  584. }
  585. },
  586. onShareAppMessage(res) {
  587. //分享转发
  588. if (res.from === 'button') {
  589. // 来自页面内转发按钮
  590. }
  591. return {
  592. title: `点击查看“${this.listQuery.keyword}”相关的商品`,
  593. path: `pages/search/search?type=share&keyWord=${this.listQuery.keyword}`
  594. }
  595. },
  596. onShow() {
  597. this.setScrollHeight()
  598. this.GetHomeHotSearchTerms()
  599. }
  600. }
  601. </script>
  602. <style lang="scss">
  603. @import '@/uni.scss';
  604. page {
  605. background-color: #f7f7f7 !important;
  606. }
  607. .search-main {
  608. width: 100%;
  609. height: 88rpx;
  610. position: fixed;
  611. top: 0;
  612. left: 0;
  613. background: #ffffff;
  614. z-index: 1001;
  615. box-sizing: border-box;
  616. padding: 9rpx 0;
  617. .search-tab {
  618. width: 160rpx;
  619. height: 70rpx;
  620. line-height: 70rpx;
  621. color: #666666;
  622. font-size: $font-size-24;
  623. text-align: center;
  624. float: left;
  625. position: relative;
  626. .icon-xiangxiajiantou {
  627. margin-left: 10rpx;
  628. font-size: $font-size-30;
  629. }
  630. }
  631. .gosearch-btn {
  632. width: 470rpx;
  633. height: 100%;
  634. float: left;
  635. border-radius: 40rpx;
  636. background: #f0f0f0;
  637. margin: 0 auto;
  638. padding: 0 20rpx;
  639. font-size: 28rpx;
  640. line-height: 70rpx;
  641. padding-left: 70rpx;
  642. color: #8a8a8a;
  643. background: #f7f7f7;
  644. position: relative;
  645. box-sizing: border-box;
  646. .icon-sousuo {
  647. width: 70rpx;
  648. height: 70rpx;
  649. line-height: 70rpx;
  650. text-align: center;
  651. display: block;
  652. position: absolute;
  653. left: 0;
  654. top: 0;
  655. font-size: 34rpx;
  656. color: #8a8a8a;
  657. z-index: 10;
  658. }
  659. .icon-shanchu1 {
  660. font-size: 36rpx;
  661. color: #8a8a8a;
  662. position: absolute;
  663. right: 10rpx;
  664. top: 0;
  665. padding: 0 10rpx;
  666. z-index: 100;
  667. }
  668. .input {
  669. width: 400rpx;
  670. height: 100%;
  671. float: left;
  672. font-size: $font-size-24;
  673. box-sizing: border-box;
  674. padding-right: 66rpx;
  675. }
  676. }
  677. .search-btn {
  678. width: 120rpx;
  679. height: 70rpx;
  680. line-height: 70rpx;
  681. float: right;
  682. text-align: center;
  683. color: #666666;
  684. font-size: $font-size-24;
  685. }
  686. }
  687. .search-container {
  688. padding-top: 96rpx;
  689. }
  690. .s-block {
  691. background: #ffffff;
  692. &.hot {
  693. border-top: 20rpx solid #f7f7f7;
  694. }
  695. .header {
  696. font-size: 32rpx;
  697. padding: 40rpx 24rpx 22rpx 24rpx;
  698. line-height: 42rpx;
  699. font-size: 30rpx;
  700. font-weight: bold;
  701. position: relative;
  702. width: 100%;
  703. float: left;
  704. box-sizing: border-box;
  705. .icon-shanchu {
  706. font-size: 36rpx;
  707. color: #333333;
  708. float: right;
  709. padding: 0 10rpx;
  710. z-index: 10;
  711. font-weight: normal;
  712. }
  713. }
  714. .list {
  715. width: 100%;
  716. height: auot;
  717. float: left;
  718. padding: 0 24rpx 30rpx 24rpx;
  719. box-sizing: border-box;
  720. .list-title {
  721. width: 100%;
  722. height: 40rpx;
  723. font-size: $font-size-26;
  724. color: #333;
  725. }
  726. .list-main {
  727. width: 100%;
  728. float: left;
  729. display: flex;
  730. flex-wrap: wrap;
  731. view {
  732. color: #8a8a8a;
  733. font-size: 24rpx;
  734. box-sizing: border-box;
  735. text-align: center;
  736. height: 48rpx;
  737. line-height: 48rpx;
  738. border-radius: 24rpx;
  739. margin: 12rpx 12rpx 12rpx 0;
  740. padding: 0 20rpx;
  741. white-space: nowrap;
  742. text-overflow: ellipsis;
  743. background-color: #f3f3f3;
  744. .iconfont {
  745. font-size: $font-size-30;
  746. color: #e15616;
  747. margin-left: 12rpx;
  748. }
  749. &.list-active {
  750. background-color: #fef6f3;
  751. color: #e15616;
  752. }
  753. }
  754. }
  755. }
  756. }
  757. .s-circle {
  758. margin-top: 30rpx;
  759. .header {
  760. font-size: 32rpx;
  761. padding: 30rpx;
  762. border-bottom: 2rpx solid #f9f9f9;
  763. position: relative;
  764. image {
  765. width: 36rpx;
  766. height: 36rpx;
  767. padding: 10rpx;
  768. position: absolute;
  769. right: 40rpx;
  770. top: 24rpx;
  771. }
  772. }
  773. .list {
  774. display: flex;
  775. flex-wrap: wrap;
  776. padding: 0 30rpx 20rpx;
  777. view {
  778. padding: 8rpx 30rpx;
  779. margin: 20rpx 30rpx 0 0;
  780. font-size: 28rpx;
  781. color: #8a8a8a;
  782. background-color: #f7f7f7;
  783. box-sizing: border-box;
  784. text-align: center;
  785. border-radius: 20rpx;
  786. }
  787. }
  788. }
  789. .wanted-block {
  790. margin-top: 30rpx;
  791. .header {
  792. font-size: 32rpx;
  793. padding: 30rpx;
  794. }
  795. .list {
  796. display: flex;
  797. flex-wrap: wrap;
  798. view {
  799. width: 50%;
  800. color: #8a8a8a;
  801. font-size: 28rpx;
  802. box-sizing: border-box;
  803. text-align: center;
  804. padding: 20rpx 0;
  805. border-top: 2rpx solid #fff;
  806. border-left: 2rpx solid #fff;
  807. background-color: #f7f7f7;
  808. overflow: hidden;
  809. white-space: nowrap;
  810. text-overflow: ellipsis;
  811. }
  812. }
  813. }
  814. .wanted-circle {
  815. margin-top: 30rpx;
  816. .header {
  817. font-size: 32rpx;
  818. padding: 30rpx;
  819. }
  820. .list {
  821. display: flex;
  822. flex-wrap: wrap;
  823. padding: 0 30rpx 20rpx;
  824. view {
  825. padding: 8rpx 30rpx;
  826. margin: 20rpx 30rpx 0 0;
  827. font-size: 28rpx;
  828. color: #8a8a8a;
  829. background-color: #f7f7f7;
  830. box-sizing: border-box;
  831. text-align: center;
  832. border-radius: 20rpx;
  833. }
  834. }
  835. }
  836. .commodity-list-wrapper {
  837. scroll-view {
  838. height: 100%;
  839. overflow: scroll;
  840. }
  841. .empty-container-image {
  842. margin-top: -300rpx;
  843. }
  844. .toIndexPage {
  845. bottom: 390rpx;
  846. }
  847. .show-more-btn {
  848. width: 276rpx;
  849. height: 52rpx;
  850. line-height: 52rpx;
  851. border: 2rpx solid #d8d8d8;
  852. background: #f7f7f7;
  853. font-size: 26rpx;
  854. margin: 26rpx 0;
  855. position: absolute;
  856. left: 50%;
  857. margin-left: -138rpx;
  858. }
  859. }
  860. .all-type-list-content {
  861. height: 216rpx;
  862. padding: 24rpx;
  863. background: #fff;
  864. margin-bottom: 2rpx;
  865. display: flex;
  866. flex-direction: row;
  867. box-sizing: content-box;
  868. .list-img {
  869. width: 210rpx;
  870. height: 218rpx !important;
  871. margin-right: 26rpx;
  872. border-radius: 10rpx;
  873. border: 2rpx solid #f3f3f3;
  874. }
  875. }
  876. .list-details-info {
  877. width: 466rpx;
  878. display: flex;
  879. flex-direction: column;
  880. font-size: 26rpx;
  881. position: relative;
  882. .list-details-title {
  883. position: relative;
  884. .mclap {
  885. line-height: 38rpx;
  886. text-overflow: ellipsis;
  887. overflow: hidden;
  888. display: -webkit-box;
  889. -webkit-line-clamp: 2;
  890. line-clamp: 2;
  891. -webkit-box-orient: vertical;
  892. &.indent {
  893. text-indent: 95rpx;
  894. }
  895. }
  896. .mclap-tag {
  897. display: block;
  898. width: 84rpx;
  899. height: 32rpx;
  900. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  901. border-radius: 4rpx 48rpx 4px 4px;
  902. line-height: 32rpx;
  903. font-size: $font-size-22;
  904. color: #ffffff;
  905. text-align: center;
  906. position: absolute;
  907. left: 0;
  908. top: 0;
  909. }
  910. }
  911. .list-details-specs {
  912. margin-top: 8rpx;
  913. color: #666666;
  914. }
  915. .list-details-miniQuantity {
  916. margin-top: 7rpx;
  917. }
  918. }
  919. .list-details-price {
  920. width: 100%;
  921. height: 54rpx;
  922. line-height: 54rpx;
  923. position: absolute;
  924. bottom: -10rpx;
  925. right: 0;
  926. .floor-item-act {
  927. height: 54rpx;
  928. text-align: center;
  929. box-sizing: border-box;
  930. float: right;
  931. padding: 11rpx 0;
  932. }
  933. .price-icon {
  934. width: 22rpx;
  935. height: 28rpx;
  936. vertical-align: middle;
  937. margin-right: 10rpx;
  938. }
  939. .price-icon + text {
  940. font-size: 25rpx;
  941. vertical-align: middle;
  942. }
  943. .list-login-now {
  944. color: #f8c499;
  945. float: left;
  946. line-height: 54rpx;
  947. .p-no {
  948. float: left;
  949. font-size: $font-size-24;
  950. color: $text-color;
  951. }
  952. }
  953. .login-now {
  954. padding: 10rpx 10rpx 10rpx 0;
  955. }
  956. .list-price {
  957. color: #ff2a2a;
  958. height: 44rpx;
  959. float: left;
  960. .price-larger {
  961. width: 100%;
  962. font-size: 32rpx;
  963. &.none {
  964. text-decoration: line-through;
  965. color: #999999;
  966. }
  967. &.small {
  968. font-size: $font-size-24;
  969. }
  970. .txt {
  971. font-size: $font-size-24;
  972. display: inline-block;
  973. line-height: 44rpx;
  974. text-align: left;
  975. float: left;
  976. }
  977. }
  978. }
  979. }
  980. </style>