immediatelyList.vue 27 KB

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