immediatelyList.vue 27 KB

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