immediatelyList.vue 27 KB

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