search.vue 25 KB

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