immediatelyList.vue 27 KB

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