immediatelyList.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. <template>
  2. <view
  3. class="container commodity-list-wrapper"
  4. :style="{ overflow: showSkeleton ? 'hidden' : 'auto', height: showSkeleton ? windowHeight + 'px' : 'auto' }"
  5. >
  6. <view class="good-search clearfix" v-if="searchStatus">
  7. <view class="nav-tab-bar u-f-ajc">
  8. <block v-for="(tab, index) in tabBars" :key="tab.id" :class="{ current: tabIndex === index }">
  9. <view class="tabstyle u-f-ajc" :class="{ addstyle: tabIndex == index }" @tap="changeTab(index)">
  10. {{ tab.name }}<i v-if="tabIndex == index" class="nav-tab-line iconfont icon-gou"></i>
  11. </view>
  12. </block>
  13. </view>
  14. <view class="search-from name">
  15. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  16. <input
  17. class="input"
  18. type="text"
  19. :focus="isFocus"
  20. confirm-type="search"
  21. v-model="searchInputVal"
  22. placeholder="请输入商品关键词"
  23. @input="onShowClose"
  24. @confirm="searchOpertor(tabIndex)"
  25. maxlength="20"
  26. />
  27. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText(tabIndex)"></text>
  28. </view>
  29. </view>
  30. <list-skeleton v-if="showSkeleton"></list-skeleton>
  31. <view class="empty-container" v-if="isShowEmpty">
  32. <image
  33. class="empty-container-image"
  34. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
  35. ></image>
  36. <text class="error-text">{{ isShowEmptyText }}</text>
  37. </view>
  38. <!-- 单一商品 -->
  39. <view class="product-container" v-else>
  40. <view :class="tabIndex" v-if="tabIndex === 0" :style="{ paddingTop: searchStatus ? '128rpx' : '' }">
  41. <scroll-view
  42. :style="{ height: scrollHeight + 'px' }"
  43. @scrolltolower="scrolltolower(tabIndex)"
  44. scroll-y
  45. v-if="listData.length > 0"
  46. >
  47. <view
  48. v-for="(pros, index) in listData"
  49. :key="index"
  50. :id="pros.productId"
  51. class="all-type-list-content commodity-list"
  52. @click.stop="navToDetailPage(pros.productId)"
  53. >
  54. <image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
  55. <view class="list-details-info">
  56. <text class="list-details-title">{{ isInterceptHtmlFn(pros.name) }}</text>
  57. <text class="list-details-specs">规格:{{ pros.unit ? pros.unit : '' }}</text>
  58. <text class="list-details-miniQuantity list-details-specs"
  59. >起订量:{{ pros.minBuyNumber }}</text
  60. >
  61. <view class="list-details-specs" v-if="pros.code != '' && pros.code != null">
  62. <view>商品编码:{{ pros.code }}</view>
  63. </view>
  64. <view class="list-details-price">
  65. <template v-if="priceLoading">
  66. <view class="list-price-loding">正在获取价格...</view>
  67. </template>
  68. <template v-else>
  69. <view class="list-shop">
  70. <view class="list-price">
  71. <text
  72. class="price-larger"
  73. :class="PromotionsFormat(pros.promotions) ? 'none' : ''"
  74. >
  75. ¥{{
  76. (PromotionsFormat(pros.promotions)
  77. ? pros.originalPrice
  78. : pros.price) | NumFormat
  79. }}
  80. </text>
  81. </view>
  82. </view>
  83. <button class="add-cart-btn" @click.stop="operationHanld(pros)">数量</button>
  84. </template>
  85. </view>
  86. <view class="list-details-price">
  87. <view class="floor-item-act" v-if="pros.actStatus == 1">
  88. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  89. <template>
  90. <view class="floor-tags" v-if="PromotionsFormat(pros.promotions)">
  91. {{ pros.promotions.name }}<text>:¥{{ pros.price | NumFormat }}</text>
  92. </view>
  93. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  94. </template>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view v-if="showLoading && listData.length > 4 && !showRegularBtn">
  100. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow"
  101. >{{ loadingText }}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view
  102. >
  103. <view class="loading-wrapper loading-wrapper-btm" v-else
  104. >———<text class="btm-text">已至底部</text>———</view
  105. >
  106. </view>
  107. </scroll-view>
  108. </view>
  109. <!-- 组合商品 -->
  110. <view :class="tabIndex" v-if="tabIndex === 1">
  111. <scroll-view
  112. :style="{ height: scrollHeight + 'px', paddingTop: searchStatus ? '112rpx' : '' }"
  113. @scrolltolower="scrolltolower(tabIndex)"
  114. scroll-y
  115. >
  116. <view class="all-zuhe-list" v-for="(item, index) in combinationProduct" :key="index" :id="item.id">
  117. <view class="zuhe_title" :class="index % 2 == 0 ? 'active' : ''">{{ item.name }}</view>
  118. <view
  119. v-for="(pros, proIndex) in item.combinationProductList"
  120. :class="index % 2 == 0 ? 'stylecontent' : ''"
  121. :key="proIndex"
  122. :id="pros.productId"
  123. class="zuhe-list-content commodity-list"
  124. >
  125. <view class="list-details-info">
  126. <text class="list-details-title zuhe_list_text">商品编码:{{ pros.code }}</text>
  127. <text
  128. class="list-details-specs zuhe_list_text"
  129. @click.stop="navToDetailPage(pros.productId)"
  130. >{{ pros.name }}</text
  131. >
  132. <view class="list-details-price zuhe_list_price">
  133. <view class="list-shop com">
  134. <view class="list-price zuhe_list_price">
  135. <view class="zuhe_price-larger zuhe_list_text">
  136. <view class="list-price-none" v-if="pros.repurchaseFlag == 1">
  137. <text class="price-none">价格:¥{{ pros.originalPrice }}</text>
  138. <text
  139. class="iconfont icon-wenhao"
  140. @click.stop="repurchModel"
  141. ></text>
  142. </view>
  143. <view class="price-larger">价格:¥{{ pros.price | NumFormat }}</view>
  144. </view>
  145. <view class="zuhe_price-larger zuhe_list_text">
  146. <view class="floor-item-act" v-if="pros.actStatus == 1">
  147. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  148. <template>
  149. <view
  150. class="floor-tags"
  151. v-if="PromotionsFormat(pros.promotions)"
  152. >
  153. {{ pros.promotions.name
  154. }}<text>:¥{{ pros.price | NumFormat }}</text>
  155. </view>
  156. <view class="floor-tags" v-else>{{
  157. pros.promotions.name
  158. }}</view>
  159. </template>
  160. </view>
  161. <view class="count">
  162. <view class="number-box">
  163. <view
  164. class="iconfont icon-jianhao"
  165. @click.stop="changeCountSub(item, pros)"
  166. ></view>
  167. <input
  168. class="btn-input"
  169. type="number"
  170. maxlength="6"
  171. v-model="pros.initProductNum"
  172. @blur="changeNnmber($event, item, pros)"
  173. />
  174. <view
  175. class="iconfont icon-jiahao"
  176. @click.stop="changeCountAdd(item, pros)"
  177. ></view>
  178. </view>
  179. </view>
  180. </view>
  181. <view class="list-price-all" :style="{ overflow: 'hidden' }">
  182. <view class="price-two zuhe_list_text"
  183. >总价:<text class="zuhe_list_zj"
  184. >¥ {{ pros.totalPrice | NumFormat }}</text
  185. ></view
  186. >
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </view>
  192. </view>
  193. <view class="foot_conten">
  194. <view class="zuhe_foot-box">
  195. <view class="">
  196. <text>种类:{{ item.productKind }}</text>
  197. <text>总数:{{ item.productTotalNum }}</text>
  198. </view>
  199. <text
  200. >总额:<text class="foot_text">{{
  201. item.productTotalAmount | NumFormat
  202. }}</text></text
  203. >
  204. </view>
  205. <button type="default" class="buycart" @click.stop="operationHanld(item)">
  206. 加入购物车
  207. </button>
  208. </view>
  209. </view>
  210. <view v-if="showLoading && combinationProduct.length > 4 && !showRegularBtn">
  211. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow"
  212. >{{ loadingText }}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view
  213. >
  214. <view class="loading-wrapper loading-wrapper-btm" v-else
  215. >———<text class="btm-text">已至底部</text>———</view
  216. >
  217. </view>
  218. </scroll-view>
  219. </view>
  220. </view>
  221. <!-- 可拖动悬浮按钮 -->
  222. <cm-drag
  223. :cartNum="cartQuantity"
  224. :isDock="true"
  225. :existTabBar="true"
  226. @btnClick="btnClick"
  227. @btnTouchstart="btnTouchstart"
  228. @btnTouchend="btnTouchend"
  229. >
  230. </cm-drag>
  231. <!-- 透明模态层 -->
  232. <modal-layer v-if="isModallayer"></modal-layer>
  233. </view>
  234. </template>
  235. <script>
  236. import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
  237. import modalLayer from '@/components/modal-layer'
  238. import uniStars from '@/components/uni-stars/uni-stars.vue'
  239. import cmDrag from '@/components/cm-custom/cm-drag.vue'
  240. import { mapState, mapMutations } from 'vuex'
  241. export default {
  242. name: 'productList',
  243. components: {
  244. listSkeleton,
  245. modalLayer,
  246. uniStars,
  247. cmDrag
  248. },
  249. props: {
  250. searchStatus: {
  251. type: Boolean,
  252. default: false
  253. }
  254. },
  255. data() {
  256. return {
  257. isShowClose: false,
  258. searchInputVal: '',
  259. isModallayer: false,
  260. windowHeight: '',
  261. showSkeleton: false,
  262. priceLoading: true,
  263. isShowEmpty: false,
  264. isShowEmptyText: '搜索相关商品',
  265. clubUserId: '',
  266. identity: '',
  267. isFocus: false,
  268. scrollHeight: '',
  269. listData: [],
  270. combinationProduct: [],
  271. zuheProductList: [], //组合商品列表
  272. showLoading: false,
  273. loadingNow: true,
  274. loadingText: '上拉加载更多',
  275. pageSize: 20,
  276. zuhepageSize: 5,
  277. pageNum: 1,
  278. totalPage: 1,
  279. hasNextPage: false,
  280. pullFlag: true,
  281. fromRegularPurchasePage: false,
  282. cartQuantity: 0,
  283. showRegularBtn: false,
  284. isPrecedence: false,
  285. ladderPriceList: [], //是否 阶梯,
  286. tabIndex: 0,
  287. goodsList: [],
  288. tabBars: [{ name: '单一', id: 'danyi' }, { name: '组合', id: 'zuhe' }],
  289. isShow: false
  290. }
  291. },
  292. created() {
  293. this.setScrollHeight()
  294. this.$api
  295. .getComStorage('userInfo')
  296. .then(resolve => {
  297. if (resolve.userIdentity == 1) {
  298. this.identity = 1
  299. }
  300. })
  301. .catch(error => {
  302. console.log(error)
  303. })
  304. this.$api.getComStorage('orderUserInfo').then(resolve => {
  305. this.clubUserId = resolve.userID
  306. })
  307. this.getProductAgainInfo()
  308. this.isFocus = true
  309. },
  310. filters: {
  311. NumFormat: function(text) {
  312. //处理金额
  313. return Number(text).toFixed(2)
  314. }
  315. },
  316. computed: {
  317. ...mapState(['hasLogin', 'userInfo'])
  318. },
  319. methods: {
  320. scrolltolower(tabIndex) {
  321. if (tabIndex == 0) {
  322. if (this.totalPage > this.listData.length && this.pullFlag) {
  323. this.getProductAgainInfo(true)
  324. }
  325. } else if (tabIndex == 1) {
  326. if (this.hasNextPage && this.pullFlag) {
  327. this.getcombinationProduct(true)
  328. }
  329. }
  330. },
  331. setScrollHeight() {
  332. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  333. this.windowHeight = windowHeight - 1
  334. this.scrollHeight = windowHeight - 1
  335. },
  336. getProductAgainInfo(loadMore) {
  337. this.showLoading = true
  338. this.priceLoading = true
  339. this.loadingNow = true
  340. this.loadingText = '加载中'
  341. this.isShowEmpty = false
  342. if (loadMore) {
  343. this.pageNum += 1
  344. }
  345. this.ProductService.GetProductSearchList({
  346. identity: this.identity,
  347. keyword: this.searchInputVal,
  348. pageNum: this.pageNum,
  349. pageSize: this.pageSize,
  350. sortField: '',
  351. sortType: ''
  352. })
  353. .then(response => {
  354. this.isShowWrapper = true
  355. const resData = JSON.parse(response.data)
  356. const resList = resData.items
  357. if (resList && resList.length > 0) {
  358. this.totalPage = resData.total
  359. this.showEmpty = false
  360. if (loadMore) {
  361. this.listData = [...this.listData, ...resList]
  362. this.getProductPrice()
  363. } else {
  364. this.listData = [...resList]
  365. this.getProductPrice()
  366. this.showSkeleton = false
  367. }
  368. // 防上拉暴滑
  369. this.pullFlag = false
  370. setTimeout(() => {
  371. this.pullFlag = true
  372. }, 500)
  373. // 底部提示文案
  374. if (this.totalPage > this.listData.length) {
  375. this.loadingText = '上拉加载更多'
  376. } else {
  377. this.showLoading = true
  378. this.loadingNow = false
  379. }
  380. } else {
  381. if (!loadMore) {
  382. this.isShowEmpty = true
  383. this.isShowEmptyText = '暂无相关商品'
  384. }
  385. }
  386. })
  387. .catch(error => {
  388. this.$util.msg(error.msg, 2000)
  389. })
  390. },
  391. getProductPrice() {
  392. //获取商品或者活动价格
  393. let productIdArr = []
  394. let productIds = ''
  395. this.listData.map(item => {
  396. // 0公开价格 1不公开价格 2仅对资质机构公开
  397. productIdArr.push(item.productId)
  398. })
  399. productIds = productIdArr.join(',')
  400. this.ProductService.querySearchProductPrice({
  401. userId: this.clubUserId,
  402. productIds: productIds,
  403. source: 2
  404. })
  405. .then(response => {
  406. this.listData = this.ReturnNewProducts(this.listData, response.data)
  407. this.priceLoading = false
  408. })
  409. .catch(error => {
  410. this.$util.msg(error.msg, 2000)
  411. })
  412. },
  413. ReturnNewProducts(Array, list) {
  414. //合并字段
  415. let NewArray = []
  416. Array.map(item => {
  417. for (let i = 0; i < list.length; i++) {
  418. if (item.productId == list[i].productId) {
  419. NewArray.push(Object.assign(item, list[i]))
  420. }
  421. }
  422. })
  423. return NewArray
  424. },
  425. searchOpertor(tabIndex) {
  426. //搜索商品
  427. if (tabIndex == 0) {
  428. if (this.searchInputVal == '') {
  429. this.$util.msg('请输入商品关键词', 2000)
  430. } else {
  431. this.pageNum = 1
  432. this.showSkeleton = true
  433. this.getProductAgainInfo()
  434. this.isFocus = false
  435. }
  436. } else {
  437. this.pageNum = 1
  438. this.showSkeleton = true
  439. this.getcombinationProduct()
  440. this.isFocus = false
  441. }
  442. },
  443. getcombinationProduct(loadMore) {
  444. //组合搜索商品
  445. this.showLoading = true
  446. this.loadingNow = true
  447. this.loadingText = '加载中'
  448. this.isShowEmpty = false
  449. if (loadMore) {
  450. this.pageNum += 1
  451. }
  452. this.ProductService.GetSearchCombinationProduct({
  453. clubUserId: this.clubUserId,
  454. pageNum: this.pageNum,
  455. pageSize: this.zuhepageSize,
  456. searchWord: this.searchInputVal
  457. })
  458. .then(response => {
  459. this.isShowWrapper = true
  460. const responseData = response.data
  461. console.log(responseData)
  462. if (responseData.results && responseData.results.length > 0) {
  463. this.hasNextPage = responseData.hasNextPage
  464. this.isShowEmpty = false
  465. if (loadMore) {
  466. this.combinationProduct = [...this.combinationProduct, ...responseData.results]
  467. } else {
  468. this.combinationProduct = [...responseData.results]
  469. this.showSkeleton = false
  470. }
  471. // 防上拉暴滑
  472. this.pullFlag = false
  473. setTimeout(() => {
  474. this.pullFlag = true
  475. }, 500)
  476. // 底部提示文案
  477. if (this.hasNextPage) {
  478. this.loadingText = '上拉加载更多'
  479. } else {
  480. this.showLoading = true
  481. this.loadingNow = false
  482. }
  483. } else {
  484. this.isShowEmpty = true
  485. this.isShowEmptyText = '暂无相关商品'
  486. }
  487. })
  488. .catch(error => {
  489. this.$util.msg(error.msg, 2000)
  490. })
  491. },
  492. changeCountAdd(item, pros) {
  493. //商品数量加加
  494. if (pros.initProductNum == 0) {
  495. pros.initProductNum = pros.minBuyNumber
  496. this.processActivityPrice(pros)
  497. } else if (pros.initProductNum >= pros.minBuyNumber) {
  498. pros.initProductNum++
  499. this.processActivityPrice(pros)
  500. }
  501. this.totalPeice(item)
  502. this.totalCount(item)
  503. this.totalKind(item)
  504. },
  505. changeCountSub(item, pros) {
  506. //商品数量减减
  507. if (pros.initProductNum == 0) {
  508. this.$util.msg('采购数量不能小于0', 2000)
  509. return
  510. } else if (pros.initProductNum == pros.minBuyNumber) {
  511. pros.initProductNum = 0
  512. this.processActivityPrice(pros)
  513. } else {
  514. pros.initProductNum--
  515. this.processActivityPrice(pros)
  516. }
  517. this.totalPeice(item)
  518. this.totalCount(item)
  519. this.totalKind(item)
  520. },
  521. changeNnmber(e, item, pros) {
  522. //输入商品数量更新
  523. let _value = e.detail.value
  524. if (!this.$api.isNumber(_value)) {
  525. pros.initProductNum = pros.minBuyNumber
  526. } else if (_value < pros.minBuyNumber) {
  527. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`, 2000)
  528. pros.initProductNum = pros.minBuyNumber
  529. } else {
  530. pros.initProductNum = parseInt(e.detail.value)
  531. this.processActivityPrice(pros)
  532. }
  533. this.totalPeice(item)
  534. this.totalCount(item)
  535. this.totalKind(item)
  536. },
  537. totalPeice(item) {
  538. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  539. let prosPrice = 0
  540. let productsList = []
  541. productsList = item.combinationProductList
  542. productsList.forEach(pros => {
  543. prosPrice += pros.price * pros.initProductNum
  544. item.productTotalAmount = prosPrice
  545. })
  546. // console.log(prosPrice)
  547. },
  548. totalCount(item) {
  549. //计算总数量
  550. let prosAllCount = 0
  551. let productsList = []
  552. productsList = item.combinationProductList
  553. productsList.forEach(pros => {
  554. prosAllCount += parseInt(pros.initProductNum)
  555. item.productTotalNum = prosAllCount
  556. })
  557. // console.log(prosAllCount)
  558. },
  559. totalKind(item) {
  560. //计算商品种类
  561. let productsList = []
  562. let checkList = []
  563. productsList = item.combinationProductList
  564. productsList.forEach(pros => {
  565. if (pros.initProductNum > 0) {
  566. checkList.push(pros)
  567. item.productKind = checkList.length
  568. } else {
  569. item.productKind = checkList.length
  570. }
  571. })
  572. },
  573. processActivityPrice(pros) {
  574. //单独处理活动价格和阶梯价格
  575. let ladderPriceList = pros.ladderPrices
  576. if (pros.ladderPriceFlag == '0' || pros.actStatus == 1) {
  577. pros.totalPrice = pros.initProductNum * pros.price
  578. } else {
  579. ladderPriceList.forEach((item, index) => {
  580. if (pros.initProductNum >= item.buyNum) {
  581. pros.price = item.buyPrice
  582. pros.totalPrice = pros.initProductNum * item.buyPrice
  583. }
  584. })
  585. }
  586. },
  587. operationHanld(prop) {
  588. this.$emit('operationConfim', prop)
  589. },
  590. alertjieti(pros) {
  591. this.$emit('alertjietiConfim', pros)
  592. },
  593. changeTab(index) {
  594. this.tabIndex = index
  595. if (index == 0) {
  596. this.pageNum = 1
  597. this.getProductAgainInfo()
  598. } else {
  599. this.getcombinationProduct()
  600. }
  601. // this.$emit('changetab',index);
  602. },
  603. navToDetailPage(id) {
  604. this.isModallayer = true
  605. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  606. this.isModallayer = false
  607. },
  608. repurchModel() {
  609. this.$util.modal('', '此商品的价格有变化,原来的购买价已不适用', '知道了', '', false, () => {})
  610. },
  611. onShowClose() {
  612. //输入框失去焦点时触发
  613. if (this.searchInputVal != '') {
  614. this.isShowClose = true
  615. } else {
  616. this.isShowClose = false
  617. }
  618. },
  619. delInputText(tabIndex) {
  620. //清除输入框内容
  621. if (tabIndex == 0) {
  622. this.searchInputVal = ''
  623. this.listData = []
  624. this.isFocus = true
  625. this.isShowClose = false
  626. this.loadingNow = false
  627. this.isShowEmpty = true
  628. this.isShowEmptyText = '暂无相关商品'
  629. } else {
  630. this.searchInputVal = ''
  631. this.isShowClose = false
  632. this.isFocus = true
  633. this.getcombinationProduct()
  634. }
  635. },
  636. isInterceptHtmlFn(text) {
  637. let name = this.$reg.interceptHtmlFn(text)
  638. return name
  639. },
  640. PromotionsFormat(promo) {
  641. //促销活动类型数据处理
  642. if (promo != null) {
  643. if (promo.type == 1 && promo.mode == 1) {
  644. return true
  645. } else {
  646. return false
  647. }
  648. }
  649. return false
  650. },
  651. btnClick() {
  652. this.$emit('goCartPage')
  653. },
  654. btnTouchstart() {
  655. // console.log('btnTouchstart');
  656. },
  657. btnTouchend() {
  658. // console.log('btnTouchend');
  659. }
  660. }
  661. }
  662. </script>
  663. <style lang="scss">
  664. .all-zuhe-list {
  665. background: #ffffff;
  666. }
  667. .foot_conten {
  668. width: 655rpx;
  669. background: #fff;
  670. font-size: 28rpx;
  671. height: 80rpx;
  672. // line-height: 80rpx;
  673. display: inherit;
  674. padding: 10px;
  675. overflow: hidden;
  676. margin: 20rpx auto;
  677. }
  678. .zuhe_foot-box {
  679. float: left;
  680. overflow: hidden;
  681. white-space: nowrap;
  682. // text-overflow: ellipsis;
  683. width: 490rpx;
  684. }
  685. .zuhe_foot-box text {
  686. margin-right: 36rpx;
  687. }
  688. .foot_text {
  689. color: #ff2a2a;
  690. }
  691. .foot_conten .buycart {
  692. width: 162rpx;
  693. height: 64rpx;
  694. background: #efaf00 !important;
  695. color: #fff;
  696. font-size: 26rpx;
  697. border-radius: 36rpx;
  698. text-align: center;
  699. line-height: 64rpx;
  700. float: right;
  701. }
  702. .price-none {
  703. font-size: 24rpx;
  704. color: #666666;
  705. }
  706. .zuhe_title {
  707. background: #ffffff;
  708. height: 76rpx;
  709. font-size: 28rpx;
  710. color: #1675e1;
  711. border-bottom: 4rpx solid #1675e1;
  712. line-height: 76rpx;
  713. padding-left: 30rpx;
  714. &.active {
  715. color: #e15616;
  716. border-bottom: 4rpx solid #e15616;
  717. }
  718. }
  719. .tabstyle {
  720. width: 128rpx;
  721. height: 76rpx;
  722. font-size: 26rpx;
  723. display: inline-block;
  724. border-radius: 10rpx;
  725. text-align: center;
  726. line-height: 76rpx;
  727. border: 2rpx solid #eeeeee;
  728. position: relative;
  729. margin-right: 12rpx;
  730. &.addstyle {
  731. background: $btn-confirm;
  732. color: #ffffff;
  733. &::before {
  734. content: '';
  735. width: 0;
  736. height: 0;
  737. border-top: 20rpx solid transparent;
  738. border-right: 20rpx solid #ffffff;
  739. border-left: 20rpx solid transparent;
  740. border-bottom: 20rpx solid #ffffff;
  741. position: absolute;
  742. right: 0;
  743. bottom: 0;
  744. }
  745. }
  746. .icon-gou {
  747. width: 36rpx;
  748. height: 36rpx;
  749. line-height: 36rpx;
  750. text-align: center;
  751. color: #e15616;
  752. position: absolute;
  753. bottom: -5rpx;
  754. right: -5rpx;
  755. font-weight: bold;
  756. font-size: $font-size-28;
  757. }
  758. }
  759. .commodity-list-wrapper {
  760. scroll-view {
  761. height: 100%;
  762. }
  763. .show-more-btn {
  764. width: 276rpx;
  765. height: 52rpx;
  766. line-height: 52rpx;
  767. border: 2rpx solid #d8d8d8;
  768. background: #f7f7f7;
  769. font-size: 26rpx;
  770. margin: 26rpx 0;
  771. position: absolute;
  772. left: 50%;
  773. margin-left: -138rpx;
  774. }
  775. }
  776. .good-search {
  777. height: 80rpx;
  778. width: 100%;
  779. padding: 24rpx;
  780. background: #ffffff;
  781. display: flex;
  782. align-items: center;
  783. margin-bottom: 20rpx;
  784. position: fixed;
  785. top: 0;
  786. left: 0;
  787. z-index: 19;
  788. .search-from {
  789. width: 420rpx;
  790. height: 80rpx;
  791. background: #f7f7f7;
  792. border-radius: 40rpx;
  793. float: left;
  794. position: relative;
  795. .input {
  796. width: 340rpx;
  797. height: 80rpx;
  798. float: left;
  799. line-height: 80rpx;
  800. color: $text-color;
  801. font-size: $font-size-24;
  802. }
  803. .icon-iconfonticonfontsousuo1 {
  804. width: 64rpx;
  805. height: 80rpx;
  806. line-height: 80rpx;
  807. text-align: center;
  808. display: block;
  809. font-size: $font-size-38;
  810. float: left;
  811. color: #999999;
  812. }
  813. .icon-shanchu1 {
  814. font-size: $font-size-32;
  815. color: #999999;
  816. position: absolute;
  817. width: 120rpx;
  818. height: 80rpx;
  819. line-height: 80rpx;
  820. top: 0;
  821. right: 0;
  822. text-align: center;
  823. z-index: 10;
  824. }
  825. }
  826. .search-btn {
  827. // width: 120rpx;
  828. line-height: 64rpx;
  829. text-align: center;
  830. font-size: $font-size-28;
  831. color: $color-system;
  832. float: left;
  833. background: #ffffff;
  834. margin-left: 10rpx;
  835. }
  836. }
  837. .all-type-list-content {
  838. // height: 240rpx;
  839. padding: 24rpx;
  840. background: #fff;
  841. margin-bottom: 2rpx;
  842. display: flex;
  843. flex-direction: row;
  844. box-sizing: content-box;
  845. .list-img {
  846. width: 312rpx;
  847. height: 207rpx !important;
  848. margin-right: 26rpx;
  849. border-radius: 10rpx;
  850. border: 2rpx solid #f3f3f3;
  851. }
  852. }
  853. .zuhe-list-content {
  854. width: 655rpx;
  855. // height: 214rpx;
  856. background: #fff;
  857. border: 2rpx solid #def4ff;
  858. display: flex;
  859. flex-direction: row;
  860. box-sizing: content-box;
  861. margin-top: 10rpx;
  862. border-radius: 14rpx;
  863. margin: 10rpx auto;
  864. padding: 20rpx;
  865. &.stylecontent {
  866. border: 2rpx solid #fff0de;
  867. }
  868. }
  869. .list-details-info {
  870. width: 100%;
  871. flex-direction: column;
  872. font-size: 26rpx;
  873. position: relative;
  874. .list-details-title {
  875. line-height: 38rpx;
  876. text-overflow: ellipsis;
  877. overflow: hidden;
  878. display: -webkit-box;
  879. -webkit-line-clamp: 2;
  880. line-clamp: 2;
  881. -webkit-box-orient: vertical;
  882. }
  883. .list-details-specs {
  884. width: 100%;
  885. display: inline-block;
  886. margin: 5rpx 0;
  887. color: #666666;
  888. }
  889. .list-details-miniQuantity {
  890. width: 100%;
  891. display: inline-block;
  892. margin-top: 7rpx;
  893. }
  894. }
  895. .list-details-price {
  896. width: 100%;
  897. .floor-item-act {
  898. height: 54rpx;
  899. text-align: center;
  900. box-sizing: border-box;
  901. float: left;
  902. padding: 11rpx 0;
  903. .floor-tags {
  904. height: 32rpx;
  905. box-sizing: border-box;
  906. border-radius: 8rpx;
  907. background-color: #ffffff;
  908. line-height: 28rpx;
  909. color: $color-system;
  910. text-align: center;
  911. display: inline-block;
  912. padding: 0 16rpx;
  913. font-size: $font-size-20;
  914. border: 1px solid #e15616;
  915. float: left;
  916. }
  917. }
  918. .price-icon {
  919. width: 22rpx;
  920. height: 28rpx;
  921. vertical-align: middle;
  922. margin-right: 10rpx;
  923. }
  924. .price-icon + text {
  925. font-size: 25rpx;
  926. vertical-align: middle;
  927. }
  928. .list-login-now {
  929. width: 375rpx;
  930. color: #f8c499;
  931. .p-no {
  932. float: left;
  933. font-size: $font-size-24;
  934. color: $color-system;
  935. margin-right: 10rpx;
  936. }
  937. }
  938. .login-now {
  939. padding: 10rpx 10rpx 10rpx 0;
  940. }
  941. .list-none {
  942. margin-top: 15rpx;
  943. .price-small {
  944. font-size: $font-size-24;
  945. line-height: 40rpx;
  946. color: #ff2a2a;
  947. }
  948. }
  949. .list-price-loding {
  950. font-size: $font-size-24;
  951. line-height: 54rpx;
  952. color: #ff2a2a;
  953. }
  954. .list-shop {
  955. float: left;
  956. overflow: hidden;
  957. &.com {
  958. width: 100%;
  959. }
  960. .list-price {
  961. color: #ff2a2a;
  962. float: left;
  963. line-height: 54rpx;
  964. align-items: center;
  965. justify-content: center;
  966. .price-larger {
  967. font-size: $font-size-26;
  968. display: inline-block;
  969. &.none {
  970. text-decoration: line-through;
  971. color: #999999;
  972. }
  973. }
  974. .list-price-all {
  975. width: 100%;
  976. float: left;
  977. }
  978. .zuhe_price-larger {
  979. width: 100%;
  980. float: left;
  981. height: 54rpx;
  982. color: #666666;
  983. .price-larger {
  984. float: left;
  985. margin-right: 20rpx;
  986. }
  987. }
  988. .price-two {
  989. color: #666666;
  990. float: left;
  991. }
  992. .zuhe_list_zj {
  993. color: #ff2a2a;
  994. }
  995. .price-view {
  996. display: inline-block;
  997. width: 40rpx;
  998. border-radius: 10rpx;
  999. font-size: $font-size-22;
  1000. text-align: center;
  1001. color: #ffffff;
  1002. height: 36rpx;
  1003. line-height: 36rpx;
  1004. margin-right: 8rpx;
  1005. &.ladder {
  1006. background: linear-gradient(135deg, rgba(255, 0, 0, 1) 0%, rgba(242, 143, 49, 1) 100%);
  1007. }
  1008. &.activity {
  1009. background: linear-gradient(135deg, rgba(128, 0, 255, 1) 0%, rgba(242, 49, 153, 1) 100%);
  1010. }
  1011. }
  1012. }
  1013. .zuhe_list_price .price-view {
  1014. margin-left: 20rpx;
  1015. float: left;
  1016. margin-top: 5rpx;
  1017. }
  1018. .zuhe_list_price {
  1019. width: 100%;
  1020. overflow: hidden;
  1021. margin-top: 10rpx;
  1022. }
  1023. .count {
  1024. float: right;
  1025. border: 1px solid #eeeeee;
  1026. border-radius: 10rpx;
  1027. .number-box {
  1028. display: flex;
  1029. justify-content: center;
  1030. align-items: center;
  1031. .iconfont {
  1032. font-size: $font-size-24;
  1033. padding: 0 16rpx;
  1034. color: $text-color;
  1035. text-align: center;
  1036. line-height: 48rpx;
  1037. font-weight: bold;
  1038. }
  1039. .btn-input {
  1040. width: 100rpx;
  1041. height: 48rpx;
  1042. line-height: 48rpx;
  1043. background: #f8f8f8;
  1044. border-radius: 4rpx;
  1045. text-align: center;
  1046. font-size: $font-size-24;
  1047. border-right: 1px solid #eeeeee;
  1048. border-left: 1px solid #eeeeee;
  1049. }
  1050. }
  1051. }
  1052. .list-price-none {
  1053. width: 100%;
  1054. .price-none {
  1055. text-decoration: line-through;
  1056. color: #999999;
  1057. display: inline-block;
  1058. }
  1059. .icon-wenhao {
  1060. font-size: $font-size-32;
  1061. color: #0091ff;
  1062. margin-left: 6rpx;
  1063. }
  1064. }
  1065. }
  1066. .add-cart-btn {
  1067. flex: 4;
  1068. width: 140rpx;
  1069. height: 54rpx;
  1070. line-height: 54rpx;
  1071. border-radius: 27rpx;
  1072. color: #fff;
  1073. font-size: 24rpx;
  1074. margin-right: 0;
  1075. background: #ffffff;
  1076. border: 1px solid #c9c9c9;
  1077. color: $text-color;
  1078. }
  1079. .zuhe_btn {
  1080. float: right;
  1081. }
  1082. }
  1083. .zuhe_list_price {
  1084. display: block !important;
  1085. }
  1086. .zuhe_list_text {
  1087. margin-top: 0;
  1088. }
  1089. </style>