immediatelyList.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115
  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. <view class="list-details-image">
  55. <image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
  56. <view class="list-details-type" v-if="pros.productType == 2">医疗器械</view>
  57. </view>
  58. <view class="list-details-info">
  59. <text class="list-details-title">{{ isInterceptHtmlFn(pros.name) }}</text>
  60. <text class="list-details-specs">规格:{{ pros.unit ? pros.unit : '' }}</text>
  61. <text class="list-details-miniQuantity list-details-specs"
  62. >起订量:{{ pros.minBuyNumber }}</text
  63. >
  64. <view class="list-details-specs" v-if="pros.code != '' && pros.code != null">
  65. <view>商品编码:{{ pros.code }}</view>
  66. </view>
  67. <view class="list-details-price">
  68. <template v-if="priceLoading">
  69. <view class="list-price-loding">正在获取价格...</view>
  70. </template>
  71. <template v-else>
  72. <view class="list-shop">
  73. <view class="list-price">
  74. <text
  75. class="price-larger"
  76. :class="
  77. PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  78. ? 'none'
  79. : ''
  80. "
  81. >
  82. ¥{{
  83. (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  84. ? pros.originalPrice
  85. : pros.price) | NumFormat
  86. }}
  87. </text>
  88. </view>
  89. </view>
  90. <button class="add-cart-btn" @click.stop="operationHanld(pros)">数量</button>
  91. </template>
  92. </view>
  93. <view class="list-details-price">
  94. <view class="floor-item-act">
  95. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  96. <template v-if="pros.actStatus == 1">
  97. <view class="floor-tags" v-if="PromotionsFormat(pros.promotions)">
  98. {{ pros.promotions.name }}<text>:¥{{ pros.price | NumFormat }}</text>
  99. </view>
  100. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  101. </template>
  102. <template v-if="pros.svipProductFlag == 1">
  103. <view class="svip-tags">
  104. <view class="tags">SVIP</view>
  105. <view class="price">{{ pros.svipPriceTag }}</view>
  106. </view>
  107. </template>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <view v-if="showLoading && listData.length > 4 && !showRegularBtn">
  113. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow"
  114. >{{ loadingText }}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view
  115. >
  116. <view class="loading-wrapper loading-wrapper-btm" v-else
  117. >———<text class="btm-text">已至底部</text>———</view
  118. >
  119. </view>
  120. </scroll-view>
  121. </view>
  122. <!-- 组合商品 -->
  123. <view :class="tabIndex" v-if="tabIndex === 1">
  124. <scroll-view
  125. :style="{ height: scrollHeight + 'px', paddingTop: searchStatus ? '112rpx' : '' }"
  126. @scrolltolower="scrolltolower(tabIndex)"
  127. scroll-y
  128. >
  129. <view class="all-zuhe-list" v-for="(item, index) in combinationProduct" :key="index" :id="item.id">
  130. <view class="zuhe_title" :class="index % 2 == 0 ? 'active' : ''">{{ item.name }}</view>
  131. <view
  132. v-for="(pros, proIndex) in item.combinationProductList"
  133. :class="index % 2 == 0 ? 'stylecontent' : ''"
  134. :key="proIndex"
  135. :id="pros.productId"
  136. class="zuhe-list-content commodity-list"
  137. >
  138. <view class="list-details-info">
  139. <text class="list-details-title zuhe_list_text">商品编码:{{ pros.code }}</text>
  140. <text
  141. class="list-details-specs zuhe_list_text"
  142. @click.stop="navToDetailPage(pros.productId)"
  143. >{{ pros.name }}</text
  144. >
  145. <view class="list-details-price zuhe_list_price">
  146. <view class="list-shop com">
  147. <view class="list-price zuhe_list_price">
  148. <view class="zuhe_price-larger zuhe_list_text">
  149. <view class="list-price-none" v-if="pros.repurchaseFlag == 1">
  150. <text class="price-none">价格:¥{{ pros.originalPrice }}</text>
  151. <text
  152. class="iconfont icon-wenhao"
  153. @click.stop="repurchModel"
  154. ></text>
  155. </view>
  156. <view class="price-larger">价格:¥{{ pros.price | NumFormat }}</view>
  157. </view>
  158. <view class="zuhe_price-larger zuhe_list_text">
  159. <view class="floor-item-act">
  160. <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
  161. <template v-if="pros.actStatus == 1">
  162. <view
  163. class="floor-tags"
  164. v-if="PromotionsFormat(pros.promotions)"
  165. >
  166. {{ pros.promotions.name
  167. }}<text>:¥{{ pros.price | NumFormat }}</text>
  168. </view>
  169. <view class="floor-tags" v-else>{{
  170. pros.promotions.name
  171. }}</view>
  172. </template>
  173. <template v-if="pros.svipProductFlag == 1">
  174. <view class="svip-tags">
  175. <view class="tags">SVIP</view>
  176. <view class="price">{{ pros.svipPriceTag }}</view>
  177. </view>
  178. </template>
  179. </view>
  180. <view class="count">
  181. <view class="number-box">
  182. <view
  183. class="iconfont icon-jianhao"
  184. @click.stop="changeCountSub(item, pros)"
  185. ></view>
  186. <input
  187. class="btn-input"
  188. type="number"
  189. maxlength="6"
  190. v-model="pros.initProductNum"
  191. @blur="changeNnmber($event, item, pros)"
  192. />
  193. <view
  194. class="iconfont icon-jiahao"
  195. @click.stop="changeCountAdd(item, pros)"
  196. ></view>
  197. </view>
  198. </view>
  199. </view>
  200. <view class="list-price-all" :style="{ overflow: 'hidden' }">
  201. <view class="price-two zuhe_list_text"
  202. >总价:<text class="zuhe_list_zj"
  203. >¥ {{ pros.totalPrice | NumFormat }}</text
  204. ></view
  205. >
  206. </view>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. <view class="foot_conten">
  213. <view class="zuhe_foot-box">
  214. <view class="">
  215. <text>种类:{{ item.productKind }}</text>
  216. <text>总数:{{ item.productTotalNum }}</text>
  217. </view>
  218. <text
  219. >总额:<text class="foot_text">{{
  220. item.productTotalAmount | NumFormat
  221. }}</text></text
  222. >
  223. </view>
  224. <button type="default" class="buycart" @click.stop="operationHanld(item)">
  225. 加入购物车
  226. </button>
  227. </view>
  228. </view>
  229. <view v-if="showLoading && combinationProduct.length > 4 && !showRegularBtn">
  230. <view class="loading-wrapper loading-wrapper-now" v-if="loadingNow"
  231. >{{ loadingText }}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view
  232. >
  233. <view class="loading-wrapper loading-wrapper-btm" v-else
  234. >———<text class="btm-text">已至底部</text>———</view
  235. >
  236. </view>
  237. </scroll-view>
  238. </view>
  239. </view>
  240. <!-- 可拖动悬浮按钮 -->
  241. <cm-drag
  242. :cartNum="cartQuantity"
  243. :isDock="true"
  244. :existTabBar="true"
  245. @btnClick="btnClick"
  246. @btnTouchstart="btnTouchstart"
  247. @btnTouchend="btnTouchend"
  248. >
  249. </cm-drag>
  250. <!-- 透明模态层 -->
  251. <modal-layer v-if="isModallayer"></modal-layer>
  252. </view>
  253. </template>
  254. <script>
  255. import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
  256. import modalLayer from '@/components/modal-layer'
  257. import uniStars from '@/components/uni-stars/uni-stars.vue'
  258. import cmDrag from '@/components/cm-custom/cm-drag.vue'
  259. import { mapState, mapMutations } from 'vuex'
  260. export default {
  261. name: 'productList',
  262. components: {
  263. listSkeleton,
  264. modalLayer,
  265. uniStars,
  266. cmDrag
  267. },
  268. props: {
  269. searchStatus: {
  270. type: Boolean,
  271. default: false
  272. }
  273. },
  274. data() {
  275. return {
  276. isShowClose: false,
  277. searchInputVal: '',
  278. isModallayer: false,
  279. windowHeight: '',
  280. showSkeleton: false,
  281. priceLoading: true,
  282. isShowEmpty: false,
  283. isShowEmptyText: '搜索相关商品',
  284. userId:0,
  285. clubUserId: '',
  286. identity: 0,
  287. isFocus: false,
  288. scrollHeight: '',
  289. listData: [],
  290. combinationProduct: [],
  291. zuheProductList: [], //组合商品列表
  292. showLoading: false,
  293. loadingNow: true,
  294. loadingText: '上拉加载更多',
  295. pageSize: 20,
  296. zuhepageSize: 5,
  297. pageNum: 1,
  298. totalPage: 1,
  299. hasNextPage: false,
  300. pullFlag: true,
  301. fromRegularPurchasePage: false,
  302. cartQuantity: 0,
  303. showRegularBtn: false,
  304. isPrecedence: false,
  305. ladderPriceList: [], //是否 阶梯,
  306. tabIndex: 0,
  307. goodsList: [],
  308. tabBars: [{ name: '单一', id: 'danyi' }, { name: '组合', id: 'zuhe' }],
  309. isShow: false
  310. }
  311. },
  312. created() {
  313. this.setScrollHeight()
  314. this.initGetStotage()
  315. this.isFocus = true
  316. },
  317. filters: {
  318. NumFormat: function(text) {
  319. //处理金额
  320. return Number(text).toFixed(2)
  321. }
  322. },
  323. computed: {
  324. ...mapState(['hasLogin', 'userInfo'])
  325. },
  326. methods: {
  327. async initGetStotage() {// 初始化
  328. const userInfo = await this.$api.getStorage()
  329. const clubInfo = await this.$api.getComStorage('orderUserInfo')
  330. this.userId = userInfo.userId ? userInfo.userId : 0
  331. this.identity = userInfo.userIdentity ? userInfo.userIdentity : 0
  332. this.clubUserId = clubInfo.userId ? clubInfo.userId : 0
  333. this.getProductAgainInfo()
  334. },
  335. scrolltolower(tabIndex) {
  336. if (tabIndex == 0) {
  337. if (this.totalPage > this.listData.length && this.pullFlag) {
  338. this.getProductAgainInfo(true)
  339. }
  340. } else if (tabIndex == 1) {
  341. if (this.hasNextPage && this.pullFlag) {
  342. this.getcombinationProduct(true)
  343. }
  344. }
  345. },
  346. setScrollHeight() {
  347. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  348. this.windowHeight = windowHeight - 1
  349. this.scrollHeight = windowHeight - 1
  350. },
  351. getProductAgainInfo(loadMore) {
  352. this.showLoading = true
  353. this.priceLoading = true
  354. this.loadingNow = true
  355. this.loadingText = '加载中'
  356. this.isShowEmpty = false
  357. if (loadMore) {
  358. this.pageNum += 1
  359. }
  360. this.ProductService.GetProductSearchList({
  361. identity: this.identity,
  362. keyword: this.searchInputVal,
  363. pageNum: this.pageNum,
  364. pageSize: this.pageSize,
  365. sortField: '',
  366. sortType: ''
  367. })
  368. .then(response => {
  369. this.isShowWrapper = true
  370. const resData = JSON.parse(response.data)
  371. const resList = resData.items
  372. if (resList && resList.length > 0) {
  373. this.totalPage = resData.total
  374. this.showEmpty = false
  375. if (loadMore) {
  376. this.listData = [...this.listData, ...resList]
  377. this.getProductPrice()
  378. } else {
  379. this.listData = [...resList]
  380. this.getProductPrice()
  381. this.showSkeleton = false
  382. }
  383. // 防上拉暴滑
  384. this.pullFlag = false
  385. setTimeout(() => {
  386. this.pullFlag = true
  387. }, 500)
  388. // 底部提示文案
  389. if (this.totalPage > this.listData.length) {
  390. this.loadingText = '上拉加载更多'
  391. } else {
  392. this.showLoading = true
  393. this.loadingNow = false
  394. }
  395. } else {
  396. if (!loadMore) {
  397. this.isShowEmpty = true
  398. this.isShowEmptyText = '暂无相关商品'
  399. }
  400. }
  401. })
  402. .catch(error => {
  403. this.$util.msg(error.msg, 2000)
  404. })
  405. },
  406. getProductPrice() {
  407. //获取商品或者活动价格
  408. let productIdArr = []
  409. let productIds = ''
  410. this.listData.map(item => {
  411. // 0公开价格 1不公开价格 2仅对资质机构公开
  412. productIdArr.push(item.productId)
  413. })
  414. productIds = productIdArr.join(',')
  415. this.ProductService.querySearchProductPrice({
  416. flag:this.identity, //查询促销标记 1协销 2机构 3供应商
  417. userId: this.userId,
  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-details-image{
  862. width: 218rpx;
  863. height: 218rpx !important;
  864. margin-right: 26rpx;
  865. border-radius: 10rpx;
  866. border: 2rpx solid #f3f3f3;
  867. position: relative;
  868. .list-img {
  869. width: 218rpx;
  870. height: 218rpx !important;
  871. }
  872. .list-details-type{
  873. width: 64rpx;
  874. height: 64rpx;
  875. text-align: justify;
  876. box-sizing: border-box;
  877. padding: 10rpx;
  878. border-radius: 0 0 8rpx 8rpx;
  879. background-color: #33CCBF;
  880. font-size: $font-size-22;
  881. color: #FFFFFF;
  882. line-height: 25rpx;
  883. position: absolute;
  884. top: 0;
  885. right: 10rpx;
  886. }
  887. }
  888. }
  889. .zuhe-list-content {
  890. width: 655rpx;
  891. // height: 214rpx;
  892. background: #fff;
  893. border: 2rpx solid #def4ff;
  894. display: flex;
  895. flex-direction: row;
  896. box-sizing: content-box;
  897. margin-top: 10rpx;
  898. border-radius: 14rpx;
  899. margin: 10rpx auto;
  900. padding: 20rpx;
  901. &.stylecontent {
  902. border: 2rpx solid #fff0de;
  903. }
  904. }
  905. .list-details-info {
  906. width: 100%;
  907. flex-direction: column;
  908. font-size: 26rpx;
  909. position: relative;
  910. .list-details-title {
  911. line-height: 38rpx;
  912. text-overflow: ellipsis;
  913. overflow: hidden;
  914. display: -webkit-box;
  915. -webkit-line-clamp: 2;
  916. line-clamp: 2;
  917. -webkit-box-orient: vertical;
  918. }
  919. .list-details-specs {
  920. width: 100%;
  921. display: inline-block;
  922. margin: 5rpx 0;
  923. color: #666666;
  924. }
  925. .list-details-miniQuantity {
  926. width: 100%;
  927. display: inline-block;
  928. margin-top: 7rpx;
  929. }
  930. }
  931. .list-details-price {
  932. width: 100%;
  933. .floor-item-act {
  934. height: 54rpx;
  935. text-align: center;
  936. box-sizing: border-box;
  937. float: left;
  938. padding: 11rpx 0;
  939. }
  940. .price-icon {
  941. width: 22rpx;
  942. height: 28rpx;
  943. vertical-align: middle;
  944. margin-right: 10rpx;
  945. }
  946. .price-icon + text {
  947. font-size: 25rpx;
  948. vertical-align: middle;
  949. }
  950. .list-login-now {
  951. width: 375rpx;
  952. color: #f8c499;
  953. .p-no {
  954. float: left;
  955. font-size: $font-size-24;
  956. color: $color-system;
  957. margin-right: 10rpx;
  958. }
  959. }
  960. .login-now {
  961. padding: 10rpx 10rpx 10rpx 0;
  962. }
  963. .list-none {
  964. margin-top: 15rpx;
  965. .price-small {
  966. font-size: $font-size-24;
  967. line-height: 40rpx;
  968. color: #ff2a2a;
  969. }
  970. }
  971. .list-price-loding {
  972. font-size: $font-size-24;
  973. line-height: 54rpx;
  974. color: #ff2a2a;
  975. }
  976. .list-shop {
  977. float: left;
  978. overflow: hidden;
  979. &.com {
  980. width: 100%;
  981. }
  982. .list-price {
  983. color: #ff2a2a;
  984. float: left;
  985. line-height: 54rpx;
  986. align-items: center;
  987. justify-content: center;
  988. .price-larger {
  989. font-size: $font-size-26;
  990. display: inline-block;
  991. &.none {
  992. text-decoration: line-through;
  993. color: #999999;
  994. }
  995. }
  996. .list-price-all {
  997. width: 100%;
  998. float: left;
  999. }
  1000. .zuhe_price-larger {
  1001. width: 100%;
  1002. float: left;
  1003. height: 54rpx;
  1004. color: #666666;
  1005. .price-larger {
  1006. float: left;
  1007. margin-right: 20rpx;
  1008. }
  1009. }
  1010. .price-two {
  1011. color: #666666;
  1012. float: left;
  1013. }
  1014. .zuhe_list_zj {
  1015. color: #ff2a2a;
  1016. }
  1017. .price-view {
  1018. display: inline-block;
  1019. width: 40rpx;
  1020. border-radius: 10rpx;
  1021. font-size: $font-size-22;
  1022. text-align: center;
  1023. color: #ffffff;
  1024. height: 36rpx;
  1025. line-height: 36rpx;
  1026. margin-right: 8rpx;
  1027. &.ladder {
  1028. background: linear-gradient(135deg, rgba(255, 0, 0, 1) 0%, rgba(242, 143, 49, 1) 100%);
  1029. }
  1030. &.activity {
  1031. background: linear-gradient(135deg, rgba(128, 0, 255, 1) 0%, rgba(242, 49, 153, 1) 100%);
  1032. }
  1033. }
  1034. }
  1035. .zuhe_list_price .price-view {
  1036. margin-left: 20rpx;
  1037. float: left;
  1038. margin-top: 5rpx;
  1039. }
  1040. .zuhe_list_price {
  1041. width: 100%;
  1042. overflow: hidden;
  1043. margin-top: 10rpx;
  1044. }
  1045. .count {
  1046. float: right;
  1047. border: 1px solid #eeeeee;
  1048. border-radius: 10rpx;
  1049. .number-box {
  1050. display: flex;
  1051. justify-content: center;
  1052. align-items: center;
  1053. .iconfont {
  1054. font-size: $font-size-24;
  1055. padding: 0 16rpx;
  1056. color: $text-color;
  1057. text-align: center;
  1058. line-height: 48rpx;
  1059. font-weight: bold;
  1060. }
  1061. .btn-input {
  1062. width: 100rpx;
  1063. height: 48rpx;
  1064. line-height: 48rpx;
  1065. background: #f8f8f8;
  1066. border-radius: 4rpx;
  1067. text-align: center;
  1068. font-size: $font-size-24;
  1069. border-right: 1px solid #eeeeee;
  1070. border-left: 1px solid #eeeeee;
  1071. }
  1072. }
  1073. }
  1074. .list-price-none {
  1075. width: 100%;
  1076. .price-none {
  1077. text-decoration: line-through;
  1078. color: #999999;
  1079. display: inline-block;
  1080. }
  1081. .icon-wenhao {
  1082. font-size: $font-size-32;
  1083. color: #0091ff;
  1084. margin-left: 6rpx;
  1085. }
  1086. }
  1087. }
  1088. .add-cart-btn {
  1089. flex: 4;
  1090. width: 140rpx;
  1091. height: 54rpx;
  1092. line-height: 54rpx;
  1093. border-radius: 27rpx;
  1094. color: #fff;
  1095. font-size: 24rpx;
  1096. margin-right: 0;
  1097. background: #ffffff;
  1098. border: 1px solid #c9c9c9;
  1099. color: $text-color;
  1100. }
  1101. .zuhe_btn {
  1102. float: right;
  1103. }
  1104. }
  1105. .zuhe_list_price {
  1106. display: block !important;
  1107. }
  1108. .zuhe_list_text {
  1109. margin-top: 0;
  1110. }
  1111. </style>