immediatelyList.vue 28 KB

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