cart.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length > 0" :style="{ top: CustomBar + 'px' }">
  11. <view class="foot-text"
  12. >共<text>{{ kindCount }}</text
  13. >件商品</view
  14. >
  15. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  16. </view>
  17. <view class="container-cart-main tui-skeleton" :style="{ paddingTop: isshowDelbtn ? '0rpx' : '80rpx' }">
  18. <view v-if="!isEmpty" class="container-cart">
  19. <scroll-view class="cart-content" scroll-y @scrolltolower="toLower">
  20. <view class="goods-list">
  21. <view v-for="(item, index) in goodsList" :key="index" class="goods-item">
  22. <view class="shoptitle">
  23. <!--选择商店的全部商品 :disabled="isNnder"-->
  24. <view class="checkbox-box" @click.stop="handleCheckShop(item)">
  25. <view
  26. class="checkbox iconfont"
  27. :class="[item.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  28. ></view>
  29. </view>
  30. <view v-if="item.promotions" class="floor-item-act">
  31. <view class="floor-tags" @click.stop="clickPopupShow(item, 2)">{{
  32. item.promotions.name
  33. }}</view>
  34. </view>
  35. <view class="text">{{ item.shopName }}</view>
  36. </view>
  37. <view class="productlist">
  38. <view class="goods-pros" v-for="(pros, idx) in item.cartList" :key="idx">
  39. <view class="goods-pros-t">
  40. <!--选择商品-->
  41. <view class="checkbox-box" @click.stop="handlsCkecdPros(item, pros, idx)">
  42. <view
  43. class="checkbox iconfont"
  44. :class="[pros.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  45. ></view>
  46. </view>
  47. <view class="pros-img" @click.stop="navToListPage(pros.productId)">
  48. <image :src="pros.image ? pros.image : ''" alt="" />
  49. <view class="pros-type" v-if="pros.productType == 2">医疗器械</view>
  50. </view>
  51. <view class="pros-product">
  52. <view class="producttitle" @click.stop="navToListPage(pros.productId)">
  53. {{ pros.name }}
  54. </view>
  55. <view class="productspec">规格:{{ pros.unit ? pros.unit : '' }}</view>
  56. <view
  57. class="productspec"
  58. v-if="pros.productCode != '' && pros.productCode != null"
  59. >
  60. <view bgcolor="#666666">商品编码:{{ pros.productCode }}</view>
  61. </view>
  62. <template v-if="pros.number > pros.stock || pros.stock === 0">
  63. <view class="cart-sku-temp" @click.stop="handleShouUnitPopup(pros)">
  64. <view class="cart-sku-text">重新选择商品规格</view>
  65. <view class="cart-sku-btn">重选</view>
  66. </view>
  67. </template>
  68. <template v-else>
  69. <view class="productprice">
  70. <!--使用过滤器对总价改变-->
  71. <view
  72. class="price"
  73. :class="
  74. PromotionsFormat(pros.promotions) ||
  75. (pros.svipProductFlag == 1 && vipFlag == 1)
  76. ? 'disabled'
  77. : ''
  78. "
  79. >
  80. <text>¥</text>
  81. {{
  82. (PromotionsFormat(pros.promotions) ||
  83. pros.svipProductFlag == 1
  84. ? pros.originalPrice
  85. : pros.price) | NumFormat
  86. }}
  87. </view>
  88. <view class="count" :class="[isshowDelbtn ? 'none' : 'show']">
  89. <text class="count-tips" v-if="pros.number < pros.min"
  90. >起订量:{{ pros.min }}</text
  91. >
  92. <text class="count-tips step" v-if="pros.isStep"
  93. >购买量必须为起订量的整数倍</text
  94. >
  95. <view class="number-box">
  96. <view
  97. class="iconfont icon-jianhao"
  98. @click="changeCountSub(item, pros)"
  99. ></view>
  100. <input
  101. class="btn-input"
  102. type="number"
  103. maxlength="6"
  104. v-model="pros.number"
  105. @blur="changeNnmber($event, item, pros)"
  106. />
  107. <view
  108. class="iconfont icon-jiahao"
  109. @click="changeCountAdd(item, pros)"
  110. ></view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="floor-item-act">
  115. <template v-if="pros.actStatus == 1 && pros.promotions">
  116. <view
  117. v-if="PromotionsFormat(pros.promotions)"
  118. class="floor-tags"
  119. @click.stop="clickPopupShow(pros, 1)"
  120. >
  121. {{ pros.promotions.name }}
  122. <text
  123. v-if="
  124. pros.promotions != null && pros.promotions.type != 3
  125. "
  126. >
  127. :¥{{
  128. pros.promotions == null
  129. ? '0.00'
  130. : pros.promotions.touchPrice | NumFormat
  131. }}
  132. </text>
  133. </view>
  134. <view
  135. v-else-if="pros.promotions.type != 3"
  136. class="floor-tags"
  137. @click.stop="clickPopupShow(pros, 2)"
  138. >
  139. {{ pros.promotions.name }}
  140. </view>
  141. </template>
  142. <template v-if="pros.actStatus == null && pros.ladderFlag == 1">
  143. <view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
  144. >阶梯价格</view
  145. >
  146. </template>
  147. <template v-if="pros.svipProductFlag == 1">
  148. <view class="svip-tags">
  149. <view class="tags" :class="{ none: vipFlag != 1 }"
  150. >SVIP</view
  151. >
  152. <view class="price" v-if="isShowVipFlag(pros)">{{
  153. pros.svipPriceTag
  154. }}</view>
  155. </view>
  156. </template>
  157. </view>
  158. </template>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none' : 'show']">
  164. <view class="sum-none" v-if="item.reducedPrice > 0">
  165. <text class="money-sign">¥</text>
  166. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  167. <text class="money-reduced"
  168. >减<text>¥{{ item.reducedPrice | NumFormat }}</text></text
  169. >
  170. </view>
  171. <view class="sum"
  172. >合计:<text class="money"
  173. ><text class="money-sign">¥</text>{{ item.totalPrice | NumFormat }}</text
  174. ></view
  175. >
  176. </view>
  177. </view>
  178. </view>
  179. <view class="failure-list" v-if="failureList.length > 0">
  180. <view class="failure-title">
  181. <view class="title-txt"
  182. >失效商品<text>{{ failureList.length }}件</text></view
  183. >
  184. <view class="title-btn" @click.stop="handleDeletefailures"
  185. ><text class="butto">清空失效商品</text></view
  186. >
  187. </view>
  188. <view class="productlist">
  189. <view class="goods-pros" v-for="(failure, failureIdx) in failureList" :key="failureIdx">
  190. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  191. <!--选择商品-->
  192. <view
  193. class="checkbox-box"
  194. @click.stop="handleCheckFailure(failure)"
  195. v-if="isshowDelbtn"
  196. >
  197. <button
  198. class="checkbox iconfont"
  199. :class="[failure.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  200. ></button>
  201. </view>
  202. <text class="img-tip">失效</text>
  203. <view class="pros-img">
  204. <image :src="failure.mainImage ? failure.mainImage : ''" alt="" />
  205. <view class="pros-type" v-if="failure.productType == 2">医疗器械</view>
  206. </view>
  207. <view class="pros-product">
  208. <view class="producttitle">{{ failure.name }}</view>
  209. <view class="productspec">规格:{{ failure.unit ? failure.unit : '' }}</view>
  210. <view class="productstate">{{ failureStateText(failure.validFlag) }}</view>
  211. </view>
  212. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  213. <!--</view>-->
  214. </view>
  215. </view>
  216. </view>
  217. </view>
  218. <!--加载loadding-->
  219. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  220. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  221. <!--加载loadding-->
  222. </scroll-view>
  223. <!-- 脚部菜单 -->
  224. <view class="footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  225. <view class="footer-le">
  226. <view class="foot-check checkbox-box" @tap.stop="handleCheckAll">
  227. <button
  228. class="checkbox iconfont"
  229. :class="[isCheckAll ? 'icon-yixuanze' : 'icon-weixuanze']"
  230. ></button>
  231. <view class="text">全选</view>
  232. </view>
  233. <view class="sum">
  234. <view class="sum-none" v-if="reducedPrice > 0">
  235. <text class="money-sign">¥</text>
  236. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  237. <text class="money-reduced"
  238. >减<text>¥{{ reducedPrice | NumFormat }}</text></text
  239. >
  240. </view>
  241. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  242. 总价:<text class="money-sign">¥</text
  243. ><text class="money">{{ allPrice | NumFormat }}</text>
  244. </view>
  245. </view>
  246. </view>
  247. <view v-if="!isshowDelbtn" class="footer-ri">
  248. <view class="btn hanld-btn" @tap="hanldlerToConfirm">去结算({{ allCount }})</view>
  249. </view>
  250. <view v-else class="footer-del">
  251. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  252. <view class="btn btn-confirm" @tap.stop="handleDeleteCart">删除</view>
  253. </view>
  254. </view>
  255. </view>
  256. <view v-if="isEmpty" class="cart-content empty">
  257. <view class="empty-container">
  258. <image
  259. class="empty-container-image"
  260. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png"
  261. mode="aspectFit"
  262. ></image>
  263. <text class="error-text">购物车空空如也~</text>
  264. </view>
  265. </view>
  266. </view>
  267. <!-- 选择规格弹窗 -->
  268. <cm-unit-popup
  269. v-if="popupShow"
  270. :popupShow="popupShow"
  271. :skuProduct="handlePros"
  272. @skuBtnConfirm="handleBtnConfirm"
  273. @handleFuction="handleFuctionData"
  274. ></cm-unit-popup>
  275. <!-- 促销活动弹窗 -->
  276. <activi-popup :product="handlerPros" :popupShow="popupShow1"></activi-popup>
  277. <!-- 透明模态层 -->
  278. <modal-layer v-if="modallayer"></modal-layer>
  279. </view>
  280. </template>
  281. <script>
  282. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  283. import tuiNomore from '@/components/tui-components/nomore/nomore'
  284. import activiPopup from './components/cm-activipopu'
  285. import modalLayer from '@/components/modal-layer'
  286. import cmUnitPopup from './components/cm-unit-cart-popup'
  287. import cartMixins from './mixins/cartMixins.js'
  288. import apisMixins from './mixins/apisMixins.js'
  289. import { mapState, mapMutations } from 'vuex'
  290. const defaultListQuery = {
  291. clubId: 0, // 机构Id
  292. serviceProviderId: 0, //协销Id
  293. againBuyProductIds: '', // 再次购买商品ids
  294. pageNum: 1, // 页码
  295. pageSize: 10 // 条数
  296. }
  297. export default {
  298. mixins: [apisMixins, cartMixins],
  299. components: {
  300. tuiLoadmore,
  301. tuiNomore,
  302. activiPopup,
  303. cmUnitPopup,
  304. modalLayer
  305. },
  306. data() {
  307. return {
  308. kindCount: 0,
  309. isStock: '',
  310. popupShow: false,
  311. popupShow1: false,
  312. handlePros: {},
  313. listQuery: Object.assign({}, defaultListQuery), // 购物车立即结算确认订单参数
  314. handlerPros: {}, //监听单挑促销商品
  315. promotionsList: [], //促销活动列表
  316. failureList: [], //失效商品列表
  317. goodsList: [], //购物车的商品
  318. delGoodsList: '', //要删除的商品
  319. setGoodData: '', //确认订单的商品
  320. isCheckAll: false, //是否全选
  321. totalOriginalPrice: 0, //所有原价价
  322. reducedPrice: 0, //满减
  323. allPrice: 0, //所有价格
  324. allCount: 0, //被选中的产品数量
  325. isModallayer: false,
  326. skeletonShow: true,
  327. isshowDelbtn: false,
  328. isDisabled: false, // 供应商/店铺全选是否禁用状态
  329. isEmpty: false, //显示空购物车
  330. scrollHeight: 'auto',
  331. nomoreText: '上拉显示更多',
  332. hasNextPage: false,
  333. loadding: false,
  334. pullUpOn: true,
  335. pullFlag: true,
  336. submitIds: [],
  337. checkenProsList: [],
  338. depositIds: [6060, 6061, 6062, 6063, 6064], //定金商品ID
  339. rechargeIds: [6065, 6066, 6067, 6068, 6069], //充值余额商品ID
  340. isIphoneX: this.$store.state.isIphoneX,
  341. vipFlag: 0,
  342. userIdentity: 0,
  343. isCheckedProductStatus: false
  344. }
  345. },
  346. onLoad() {
  347. this.setScrollHeight()
  348. },
  349. computed: {
  350. ...mapState(['hasLogin', 'userInfo'])
  351. },
  352. watch: {
  353. //深度监听所有数据,每次改变重新计算总价和总数
  354. goodsList: {
  355. deep: true,
  356. handler(val, oldval) {
  357. this.totalPeice()
  358. this.totalCount()
  359. }
  360. }
  361. },
  362. filters: {
  363. NumFormat(value) {
  364. //处理金额
  365. return Number(value).toFixed(2)
  366. },
  367. totalprice(val, count) {
  368. //单件商品的价格 × 数量
  369. return (val * count).toFixed(2)
  370. }
  371. },
  372. methods: {
  373. async initGetStotage() {
  374. const clubInfo = await this.$api.getComStorage('orderUserInfo')
  375. const userInfo = await this.$api.getStorage()
  376. this.isModallayer = false //遮罩层 防止多次点击
  377. this.skeletonShow = true //预加载圆圈
  378. this.isCheckAll = false //是否全选
  379. this.submitIds = []
  380. this.vipFlag = clubInfo.vipFlag ? clubInfo.vipFlag : 0
  381. this.userIdentity = clubInfo.userIdentity ? clubInfo.userIdentity : 0
  382. console.log('userIdentity', this.userIdentity)
  383. console.log('vipFlag', this.vipFlag)
  384. this.listQuery.clubId = clubInfo.clubId ? clubInfo.clubId : 0
  385. this.listQuery.againBuyProductIds = clubInfo.againBuyProductIds ? clubInfo.againBuyProductIds : ''
  386. this.listQuery.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  387. this.initGetCartGoodsList()
  388. this.getClubProductNum()
  389. },
  390. initLogin() {
  391. this.$api.redirectTo('/pages/login/login?type=4')
  392. },
  393. clickPopupShow(pros, type) {
  394. //显示活动弹窗
  395. this.popupShow1 = true
  396. this.handlerPros = pros
  397. },
  398. failureToProduct(failure) {
  399. if (failure.status == 1) {
  400. this.$util.msg('商品已丢失,不能查看', 2000)
  401. return
  402. } else if (failure.status == 2) {
  403. this.$util.msg('商品已停售,不能查看', 2000)
  404. return
  405. } else {
  406. this.isModallayer = true
  407. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  408. }
  409. },
  410. failureStateText(state) {
  411. let stateText = '',
  412. stateTextObject = {
  413. 0: '商品已停售',
  414. 10: '商品已丢失'
  415. }
  416. Object.keys(stateTextObject).forEach(key => {
  417. if (key == state) {
  418. stateText = stateTextObject[key]
  419. }
  420. })
  421. return stateText
  422. },
  423. setScrollHeight() {
  424. // 窗口高度-footer高度
  425. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  426. setTimeout(() => {
  427. const query = uni.createSelectorQuery().in(this)
  428. query.selectAll('.footer').boundingClientRect()
  429. query.exec(res => {
  430. this.windowHeight = windowHeight
  431. if (res[0][0]) {
  432. this.scrollHeight = windowHeight - res[0][0].height
  433. }
  434. })
  435. }, 500)
  436. },
  437. initGetCartGoodsList() {
  438. //初始化购物车 index:1
  439. this.SellerService.GetSellerShoppingInfo(this.listQuery)
  440. .then(response => {
  441. this.skeletonShow = false
  442. let data = response.data
  443. let dataPage = data.pageDate
  444. this.promotionsList = data.promotionsList
  445. if (dataPage.list.length > 0 || data.invalidProductList.length > 0) {
  446. this.isEmpty = false
  447. } else {
  448. this.isEmpty = true
  449. }
  450. if (dataPage.list && dataPage.list.length > 0) {
  451. this.hasNextPage = dataPage.hasNextPage
  452. this.goodsList = dataPage.list
  453. this.goodsList.forEach((supplier, index) => {
  454. let cartListLength = supplier.cartList.length,
  455. invalidLength = 0
  456. supplier.cartList.forEach(pros => {
  457. pros.shopId = supplier.shopId
  458. pros.isStep = false
  459. if (pros.stock === 0 || pros.number > pros.stock) {
  460. supplier.isDisable = true
  461. pros.isDisable = true
  462. } else {
  463. pros.isDisable = false
  464. }
  465. if (pros.step === 2) {
  466. if (pros.number % pros.min != 0) {
  467. pros.number = pros.min
  468. this.totalShopPeice()
  469. this.updateShoppogNum(pros)
  470. }
  471. }
  472. })
  473. })
  474. this.totalShopPeice()
  475. this.pullFlag = false
  476. setTimeout(() => {
  477. this.pullFlag = true
  478. }, 500)
  479. if (this.hasNextPage) {
  480. this.pullUpOn = false
  481. this.nomoreText = '上拉显示更多'
  482. } else {
  483. if (this.goodsList.length < 4) {
  484. this.pullUpOn = true
  485. } else {
  486. this.pullUpOn = false
  487. this.nomoreText = '已至底部'
  488. }
  489. }
  490. } else {
  491. this.goodsList = []
  492. }
  493. if (response.data.invalidProductList && response.data.invalidProductList.length > 0) {
  494. let newFailureList = [],
  495. isFailureLayer
  496. response.data.invalidProductList.forEach((failure, index) => {
  497. if (failure.validFlag == 0 || failure.validFlag == 10) {
  498. isFailureLayer = true
  499. } else {
  500. isFailureLayer = false
  501. }
  502. newFailureList.push(Object.assign({}, failure, { isFailureLayer: isFailureLayer }))
  503. })
  504. this.failureList = newFailureList
  505. console.log(this.failureList)
  506. } else {
  507. this.failureList = []
  508. }
  509. })
  510. .catch(error => {
  511. this.$util.msg(error.msg, 2000)
  512. })
  513. },
  514. getOnReachBottomData() {
  515. //上拉加载
  516. this.listQuery.pageNum += 1
  517. this.SellerService.GetSellerShoppingInfo(this.listQuery)
  518. .then(response => {
  519. let resultsData = response.data.pageDate
  520. this.promotionsList = response.data.promotionsList
  521. this.hasNextPage = resultsData.hasNextPage
  522. this.goodsList = this.goodsList.concat(resultsData.results)
  523. this.goodsList.forEach((supplier, index) => {
  524. let productsListLength = supplier.cartList.length,
  525. invalidLength = 0
  526. supplier.cartList.forEach(pros => {
  527. pros.shopId = supplier.shopId
  528. pros.isStep = false
  529. if (pros.stock === 0 || pros.number > pros.stock) {
  530. supplier.isDisable = true
  531. pros.isDisable = true
  532. } else {
  533. pros.isDisable = false
  534. }
  535. if (pros.step === 2) {
  536. if (pros.number % pros.min != 0) {
  537. pros.number = pros.min
  538. this.totalShopPeice()
  539. this.updateShoppogNum(pros)
  540. }
  541. }
  542. })
  543. })
  544. this.totalShopPeice()
  545. this.pullFlag = false // 防上拉暴滑
  546. setTimeout(() => {
  547. this.pullFlag = true
  548. }, 500)
  549. if (this.hasNextPage) {
  550. this.pullUpOn = false
  551. this.nomoreText = '上拉显示更多'
  552. } else {
  553. this.loadding = false
  554. this.pullUpOn = false
  555. this.nomoreText = '已至底部'
  556. }
  557. })
  558. .catch(error => {
  559. this.$util.msg(error.msg, 2000)
  560. })
  561. },
  562. getClubProductNum() {
  563. // 获取协销下机构购物车数量
  564. this.SellerService.GetSellerProductNum({
  565. clubId: this.listQuery.clubId,
  566. serviceProviderId: this.listQuery.serviceProviderId
  567. }).then(response => {
  568. this.kindCount = response.data
  569. })
  570. },
  571. handleCheckFailure(failure) {
  572. // 选择失效商品
  573. failure.isChecked = !failure.isChecked
  574. this.updateCheckAllBtn()
  575. },
  576. handlsCkecdPros(item, pro) {
  577. //为未选中的时候改变为true,反之为true
  578. if (!this.isshowDelbtn) {
  579. if (pro.isDisable) { return }
  580. }
  581. pro.isChecked = !pro.isChecked
  582. if (pro.isChecked) {
  583. if (!this.submitIds.includes(pro.skuId * 1)) {
  584. this.submitIds.push(pro.skuId)
  585. this.checkenProsList.push(pro)
  586. }
  587. this.isCheckedProductStatus = true
  588. } else {
  589. var lent = this.submitIds.indexOf(pro.skuId * 1)
  590. if (lent >= 0) {
  591. this.submitIds.splice(lent, 1)
  592. this.checkenProsList.splice(lent, 1)
  593. }
  594. }
  595. this.updateProductCheckedAllBtn(item)
  596. this.updateCheckAllBtn()
  597. },
  598. updateProductCheckedAllBtn(item) {
  599. // 单独每个供应商的勾选判断
  600. let productsList = item.cartList,
  601. productsCheckedLength = 0,
  602. disabledLength = 0
  603. if (this.isshowDelbtn) {
  604. productsList.forEach(pros => {
  605. if (pros.isChecked) {
  606. productsCheckedLength++
  607. }
  608. })
  609. } else {
  610. productsList.forEach(pros => {
  611. if (pros.isChecked) {
  612. productsCheckedLength++
  613. }
  614. })
  615. }
  616. item.isChecked = productsCheckedLength === productsList.length - disabledLength
  617. },
  618. updateCheckAllBtn() {
  619. // 全选勾选判断
  620. let goodsCheckedLength = 0,
  621. disabledListLength = 0,
  622. goodsList = this.goodsList
  623. goodsList.forEach(item => {
  624. if (item.isChecked) {
  625. goodsCheckedLength++
  626. }
  627. })
  628. this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength
  629. },
  630. handleCheckShop(supplier) {
  631. //与单选商品类似
  632. if (!this.isshowDelbtn) {
  633. if (supplier.isDisable) {
  634. return
  635. }
  636. }
  637. supplier.isChecked = !supplier.isChecked
  638. this.setProductChecked(supplier)
  639. this.updateCheckAllBtn()
  640. },
  641. setProductChecked(supplier) {
  642. supplier.cartList.forEach(pros => {
  643. if (this.isshowDelbtn) {
  644. if (supplier.isChecked) {
  645. pros.isChecked = true
  646. if (!this.submitIds.includes(pros.skuId * 1)) {
  647. this.submitIds.push(pros.skuId)
  648. this.checkenProsList.push(pros)
  649. }
  650. } else {
  651. pros.isChecked = false
  652. let lent = this.submitIds.indexOf(pros.skuId * 1)
  653. if (lent >= 0) {
  654. this.submitIds.splice(lent, 1)
  655. this.checkenProsList.splice(lent, 1)
  656. }
  657. }
  658. } else {
  659. if (supplier.isChecked && (pros.stock !== 0 || pros.number < pros.stock)) {
  660. pros.isChecked = true
  661. if (!this.submitIds.includes(pros.skuId * 1)) {
  662. this.submitIds.push(pros.skuId)
  663. this.checkenProsList.push(pros)
  664. }
  665. } else {
  666. pros.isChecked = false
  667. let lent = this.submitIds.indexOf(pros.skuId * 1)
  668. if (lent >= 0) {
  669. this.submitIds.splice(lent, 1)
  670. this.checkenProsList.splice(lent, 1)
  671. }
  672. }
  673. }
  674. })
  675. },
  676. updateBothCheckBtn() {
  677. if (this.isshowDelbtn) {
  678. // 当管理删除按钮出现时,失效的商品可被选择
  679. this.goodsList.forEach(supplier => {
  680. supplier.isChecked = this.isCheckAll
  681. this.setProductChecked(supplier)
  682. })
  683. //删除按钮 全选包括失效商品勾选
  684. this.failureList.forEach(failureItem => {
  685. failureItem.isChecked = this.isCheckAll
  686. })
  687. } else {
  688. this.goodsList.forEach(supplier => {
  689. if(supplier.isDisable){
  690. supplier.isChecked = false
  691. }else{
  692. supplier.isChecked = this.isCheckAll && !supplier.isDisabled
  693. }
  694. this.setProductChecked(supplier)
  695. })
  696. }
  697. },
  698. handleCheckAll() {
  699. //全选方法内调用方法
  700. this.isCheckAll = !this.isCheckAll
  701. this.updateBothCheckBtn()
  702. },
  703. totalShopPeice() {
  704. //每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  705. let touchPrice = 0
  706. let reducedPrice = 0 //商铺合计满减价
  707. this.goodsList.map((item, index) => {
  708. //计算店铺满减后店铺合计
  709. if (item.promotions && item.promotions.mode == 2) {
  710. let prosPrice = 0 // 店铺价格合计
  711. let prosDiscountNum = 0 // 店铺促销叠加次数
  712. let totalOriginalPrice = 0 //店铺原价合计
  713. item.cartList.forEach(pros => {
  714. prosPrice += pros.price * pros.number
  715. totalOriginalPrice += pros.price * pros.number
  716. })
  717. if (item.promotions.discount == 1) {
  718. // 支持促销叠加条件的店铺满减 执行
  719. prosDiscountNum = parseInt(prosPrice / item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
  720. console.log('店铺满减促销叠加通道叠加次数', `${prosDiscountNum}次`)
  721. if (prosPrice >= item.promotions.touchPrice) {
  722. // 满足店铺满减条件下执行
  723. item.totalPrice = prosPrice - item.promotions.reducedPrice * prosDiscountNum
  724. item.reducedPrice = item.promotions.reducedPrice * prosDiscountNum
  725. item.totalOriginalPrice = totalOriginalPrice
  726. } else {
  727. item.reducedPrice = 0 //统计合计价格
  728. item.totalPrice = prosPrice
  729. }
  730. } else {
  731. console.log('店铺满减非促销叠加通道')
  732. if (prosPrice >= item.promotions.touchPrice) {
  733. // 满足店铺满减条件下执行
  734. item.totalPrice = prosPrice - item.promotions.reducedPrice
  735. item.reducedPrice = item.promotions.reducedPrice
  736. item.totalOriginalPrice = totalOriginalPrice
  737. } else {
  738. item.reducedPrice = 0 //统计合计价格
  739. item.totalPrice = prosPrice
  740. }
  741. }
  742. } else {
  743. //以下为计算除店铺满减以外的单品满减以及正常商品合计
  744. let _totalPrice = 0
  745. let _reducedPrice = 0
  746. let discountNum = 0
  747. let _totalOriginalPrice = 0
  748. item.cartList.forEach(pros => {
  749. let _price = pros.price * pros.number
  750. _totalOriginalPrice += pros.price * pros.number
  751. if (pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2) {
  752. if (pros.promotions.discount == 1) {
  753. discountNum = parseInt(_price / pros.promotions.touchPrice)
  754. console.log('单品满减促销叠加通道叠加次数', `${discountNum}次`)
  755. if (_price >= pros.promotions.touchPrice) {
  756. _price = _price - pros.promotions.reducedPrice * discountNum
  757. _reducedPrice += pros.promotions.reducedPrice * discountNum
  758. }
  759. _totalPrice += _price
  760. } else {
  761. console.log('单品满减非促销叠加通道')
  762. if (_price >= pros.promotions.touchPrice) {
  763. _price = _price - pros.promotions.reducedPrice
  764. _reducedPrice += pros.promotions.reducedPrice
  765. }
  766. _totalPrice += _price
  767. }
  768. } else {
  769. _reducedPrice = 0
  770. _totalPrice += pros.price * pros.number
  771. }
  772. })
  773. item.reducedPrice = _reducedPrice
  774. item.totalOriginalPrice = _totalOriginalPrice
  775. item.totalPrice = _totalPrice
  776. }
  777. })
  778. },
  779. totalPeice() {
  780. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  781. let totalPrice = 0
  782. let reducedPrice = 0
  783. let originalPrice = 0
  784. this.goodsList.forEach((item, index) => {
  785. let supplierPrice = 0
  786. let supplierReducedPrice = 0
  787. item.totalprice = 0
  788. item.reducedprice = 0
  789. item.originalprice = 0
  790. item.cartList.forEach(pros => {
  791. if (pros.isChecked) {
  792. this.isCheckedProductStatus = true
  793. supplierPrice += pros.price * pros.number
  794. // 单品满减
  795. if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
  796. // 单品满减-重新计算供应商总价/满减金额
  797. let _price = pros.price * pros.number
  798. if (pros.promotions.discount == 1) {
  799. let discountNum = parseInt(_price / pros.promotions.touchPrice)
  800. console.log('单品满减促销叠加通道叠加次数', `${discountNum}次`)
  801. // 单品满减-重新计算供应商总价/满减金额
  802. if (_price >= pros.promotions.touchPrice) {
  803. supplierPrice -= pros.promotions.reducedPrice * discountNum
  804. supplierReducedPrice += pros.promotions.reducedPrice * discountNum
  805. }
  806. } else {
  807. console.log('非促销叠加通道')
  808. // 单品满减-重新计算供应商总价/满减金额
  809. if (_price >= pros.promotions.touchPrice) {
  810. supplierPrice -= pros.promotions.reducedPrice
  811. supplierReducedPrice += pros.promotions.reducedPrice
  812. }
  813. }
  814. }
  815. }
  816. })
  817. // 店铺满减
  818. if (item.promotions && item.promotions.mode * 1 === 2) {
  819. // 店铺满减-计算供应商总价/满减金额
  820. if (item.promotions.discount == 1) {
  821. // 支持促销叠加条件的店铺满减 执行
  822. let prosDiscountNum = parseInt(supplierPrice / item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
  823. console.log('店铺满减促销叠加通道叠加次数', `${prosDiscountNum}次`)
  824. if (supplierPrice >= item.promotions.touchPrice) {
  825. supplierPrice -= item.promotions.reducedPrice * prosDiscountNum
  826. supplierReducedPrice += item.promotions.reducedPrice * prosDiscountNum
  827. }
  828. } else {
  829. console.log('店铺满减非促销叠加通道')
  830. // 店铺满减-计算供应商总价/满减金额
  831. if (supplierPrice >= item.promotions.touchPrice) {
  832. supplierPrice -= item.promotions.reducedPrice
  833. supplierReducedPrice += item.promotions.reducedPrice
  834. }
  835. }
  836. }
  837. item.totalprice = supplierPrice
  838. item.reducedprice = supplierReducedPrice
  839. item.originalprice = supplierPrice + supplierReducedPrice
  840. totalPrice += item.totalprice
  841. reducedPrice += item.reducedprice
  842. originalPrice += item.originalprice
  843. console.log('totalPrice', totalPrice)
  844. console.log('originalPrice', originalPrice)
  845. })
  846. if (this.isCheckedProductStatus) {
  847. // 总促销计算
  848. this.promotionsList.forEach(promotions => {
  849. // 凑单满减
  850. if (promotions.mode === 2 && promotions.type === 2) {
  851. let collecTotal = 0
  852. let collecDiscountNum = 0
  853. promotions.productList.forEach(pros => {
  854. collecTotal += this.collecTotalPrice(pros)
  855. })
  856. if (promotions.discount == 1) {
  857. // 支持凑单满减促销叠加条件的执行
  858. collecDiscountNum += parseInt(collecTotal / promotions.touchPrice) // 凑单满减促销叠加次数 = 凑单商品合计价格/凑单满减促销价格
  859. console.log('凑单促销满减叠加通道叠加次数', `${collecDiscountNum}次`)
  860. if (collecTotal >= promotions.touchPrice) {
  861. totalPrice -= promotions.reducedPrice * collecDiscountNum
  862. reducedPrice += promotions.reducedPrice * collecDiscountNum
  863. }
  864. } else {
  865. console.log('凑单促销满减非叠加通道')
  866. if (collecTotal >= promotions.touchPrice) {
  867. totalPrice -= promotions.reducedPrice
  868. reducedPrice += promotions.reducedPrice
  869. }
  870. }
  871. }
  872. })
  873. //最后统计商品原价
  874. this.totalOriginalPrice = originalPrice
  875. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  876. this.reducedPrice = reducedPrice
  877. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  878. this.allPrice = totalPrice
  879. }
  880. },
  881. collecTotalPrice(pros) {
  882. // 凑单满减计算勾选的凑单商品总价
  883. let price
  884. this.checkenProsList.find(el => {
  885. if (pros.productId == el.productId) {
  886. price = el.number * el.price
  887. }
  888. })
  889. return price
  890. },
  891. totalCount() {
  892. //计算总数量
  893. this.allCount = 0
  894. let prosAllCount = 0
  895. let validCount = 0
  896. let validList = []
  897. let productsList = []
  898. this.goodsList.forEach(item => {
  899. productsList = item.cartList
  900. productsList.forEach(pros => {
  901. if (pros.isChecked) {
  902. prosAllCount += parseInt(pros.number)
  903. this.allCount = prosAllCount
  904. }
  905. })
  906. })
  907. },
  908. changeCountAdd(item, pros) {
  909. //商品数量加加
  910. if (pros.step === 2) {
  911. pros.isStep = false
  912. pros.number += pros.min
  913. this.processActivityPrice(pros)
  914. this.isStock = false
  915. } else {
  916. pros.number++
  917. this.processActivityPrice(pros)
  918. this.isStock = false
  919. }
  920. this.updateShoppogNum(pros)
  921. this.totalShopPeice()
  922. },
  923. changeCountSub(item, pros) {
  924. //商品数量减减
  925. if (pros.number <= pros.min) {
  926. pros.number = pros.min
  927. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  928. return
  929. } else {
  930. if (pros.step === 2) {
  931. pros.isStep = false
  932. pros.number -= pros.min
  933. } else {
  934. pros.number--
  935. }
  936. this.processActivityPrice(pros)
  937. }
  938. this.updateShoppogNum(pros)
  939. this.totalShopPeice()
  940. },
  941. changeNnmber(e, item, pros) {
  942. //输入商品数量更新
  943. let _value = e.detail.value
  944. if (!this.$api.isNumber(_value)) {
  945. pros.number = pros.min
  946. } else if (_value < pros.min) {
  947. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  948. pros.number = pros.min
  949. } else if (_value % pros.min != 0) {
  950. pros.isStep = true
  951. pros.number = pros.min
  952. } else {
  953. pros.isStep = false
  954. pros.number = e.detail.value
  955. this.processActivityPrice(pros)
  956. }
  957. this.updateShoppogNum(pros)
  958. this.totalShopPeice()
  959. },
  960. processActivityPrice(pros) {
  961. //单独处理活动价格和阶梯价格
  962. let ladderPriceList = pros.ladderPrices
  963. if (pros.ladderFlag == 0 || pros.actStatus == 1) {
  964. pros.price = pros.price
  965. } else {
  966. ladderPriceList.forEach((item, index) => {
  967. if (pros.number >= item.buyNum) {
  968. pros.price = item.buyPrice
  969. }
  970. })
  971. }
  972. },
  973. setCartisDisable(){// 删除取消设置不能选的商品
  974. this.goodsList = this.goodsList.map(suppler=>{
  975. suppler.isDisable = false
  976. suppler.cartList.forEach(pros => {
  977. pros.isDisable = false
  978. })
  979. return suppler
  980. })
  981. },
  982. clearCartisDisable(){// 取消删除设置不能选的商品
  983. this.goodsList = this.goodsList.map((supplier) => {
  984. supplier.cartList.forEach(pros => {
  985. if(pros.stock === 0 || pros.number > pros.stock ){
  986. supplier.isDisable = true
  987. pros.isDisable = true
  988. }else{
  989. pros.isDisable = false
  990. }
  991. })
  992. return supplier
  993. })
  994. },
  995. showDelManager() {
  996. //显示删除商品管理
  997. this.isshowDelbtn = true
  998. this.setCartisDisable()
  999. if (this.isCheckAll) {
  1000. this.updateBothCheckBtn()
  1001. } else {
  1002. this.updateCheckAllBtn()
  1003. }
  1004. },
  1005. hideDelManage() {
  1006. //隐藏删除商品管理
  1007. this.isshowDelbtn = false
  1008. this.isCheckAll = false
  1009. this.clearCartisDisable()
  1010. this.goodsList = this.goodsList.map(suppler=>{
  1011. suppler.isChecked = false
  1012. suppler.cartList.forEach(pros => {
  1013. pros.isChecked = false
  1014. })
  1015. return suppler
  1016. })
  1017. },
  1018. goNavto(url) {
  1019. uni.navigateTo({
  1020. url
  1021. })
  1022. },
  1023. PromotionsFormat(promo) {
  1024. //促销活动类型数据处理
  1025. if (promo != null) {
  1026. if (promo.type == 1 && promo.mode == 1) {
  1027. return true
  1028. } else {
  1029. return false
  1030. }
  1031. }
  1032. return false
  1033. },
  1034. navToListPage(id) {
  1035. this.isModallayer = true
  1036. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  1037. },
  1038. isShowVipFlag(pros) {
  1039. if (pros.priceFlag != 1) {
  1040. if (this.userIdentity == 4 && this.vipFlag == 1) {
  1041. return true
  1042. } else if (this.userIdentity == 2) {
  1043. return true
  1044. }
  1045. }
  1046. },
  1047. handleShouUnitPopup(pros) {
  1048. // 规格弹窗
  1049. this.popupShow = true
  1050. this.handlePros = pros
  1051. }
  1052. },
  1053. onReachBottom() {
  1054. if (this.hasNextPage) {
  1055. this.loadding = true
  1056. this.pullUpOn = true
  1057. this.getOnReachBottomData()
  1058. }
  1059. },
  1060. onPullDownRefresh() {
  1061. //下拉刷新
  1062. this.initGetCartGoodsList()
  1063. uni.stopPullDownRefresh()
  1064. },
  1065. onShow() {
  1066. this.initGetStotage()
  1067. }
  1068. }
  1069. </script>
  1070. <style lang="scss">
  1071. page {
  1072. background: #f7f7f7;
  1073. }
  1074. .cart-content {
  1075. position: relative;
  1076. padding-bottom: 100rpx;
  1077. }
  1078. .container-cart-main.none {
  1079. display: none;
  1080. }
  1081. .container-cart-main.show {
  1082. display: block;
  1083. }
  1084. .cart-content.empty.none {
  1085. display: none;
  1086. }
  1087. .cart-content.empty.show {
  1088. display: block;
  1089. }
  1090. .container-cart.show {
  1091. display: block;
  1092. }
  1093. .container-cart.none {
  1094. display: none;
  1095. }
  1096. .empty-container.none {
  1097. display: none;
  1098. }
  1099. .empty-container.show {
  1100. display: flex;
  1101. }
  1102. .foot-check-delbtn {
  1103. width: 100%;
  1104. height: 80rpx;
  1105. position: fixed;
  1106. top: 0;
  1107. left: 0;
  1108. box-sizing: border-box;
  1109. padding: 15rpx 24rpx;
  1110. background-color: #f7f7f7;
  1111. z-index: 990;
  1112. .foot-text {
  1113. font-size: $font-size-26;
  1114. height: 50rpx;
  1115. line-height: 50rpx;
  1116. color: #666666;
  1117. float: left;
  1118. padding-left: 10rpx;
  1119. text {
  1120. // color: $color-system;
  1121. margin: 0 6rpx;
  1122. }
  1123. }
  1124. .delBtn {
  1125. width: 100rpx;
  1126. display: inline-block;
  1127. padding: 0 15rpx;
  1128. font-size: $font-size-26;
  1129. height: 50rpx;
  1130. line-height: 50rpx;
  1131. border-radius: 30rpx;
  1132. background: #ffffff;
  1133. border: 1px solid #e15616;
  1134. color: $color-system;
  1135. float: right;
  1136. text-align: center;
  1137. &.none {
  1138. display: none;
  1139. }
  1140. }
  1141. }
  1142. .checkbox-box {
  1143. display: flex;
  1144. align-items: center;
  1145. .checkbox {
  1146. display: flex;
  1147. margin: 0;
  1148. padding: 0;
  1149. display: flex;
  1150. flex-direction: column;
  1151. align-items: center;
  1152. box-sizing: border-box;
  1153. text-align: center;
  1154. text-decoration: none;
  1155. border-radius: 0;
  1156. -webkit-tap-highlight-color: transparent;
  1157. overflow: hidden;
  1158. background-color: #ffffff;
  1159. font-size: 36rpx;
  1160. color: $color-system;
  1161. padding: 5rpx;
  1162. &.icon-weixuanze {
  1163. color: #b2b2b2;
  1164. }
  1165. }
  1166. &.disabled {
  1167. .checkbox {
  1168. color: #999999;
  1169. }
  1170. }
  1171. .text {
  1172. font-size: $font-size-24;
  1173. margin-left: 10rpx;
  1174. }
  1175. }
  1176. .goods-list {
  1177. width: 100%;
  1178. height: auto;
  1179. border-top: 1px solid #ebebeb;
  1180. background-color: #f7f7f7;
  1181. .goods-item {
  1182. width: 702rpx;
  1183. padding: 0 24rpx;
  1184. background: #ffffff;
  1185. margin-bottom: 24rpx;
  1186. }
  1187. .shoptitle {
  1188. display: flex;
  1189. align-items: center;
  1190. height: 80rpx;
  1191. line-height: 80rpx;
  1192. .checkbox-box {
  1193. padding: 10rpx;
  1194. }
  1195. .text {
  1196. width: 450rpx;
  1197. display: block;
  1198. overflow: hidden;
  1199. text-overflow: ellipsis;
  1200. white-space: nowrap;
  1201. margin-left: 20rpx;
  1202. font-size: $font-size-28;
  1203. color: $text-color;
  1204. text-align: left;
  1205. font-weight: bold;
  1206. }
  1207. .floor-item-act {
  1208. height: 56rpx;
  1209. text-align: center;
  1210. box-sizing: border-box;
  1211. float: left;
  1212. padding: 10rpx 0;
  1213. margin-left: 20rpx;
  1214. .floor-tags {
  1215. height: 28rpx;
  1216. border-radius: 6rpx;
  1217. background-color: #ffffff;
  1218. line-height: 28rpx;
  1219. color: $color-system;
  1220. text-align: center;
  1221. display: inline-block;
  1222. padding: 0 6rpx;
  1223. font-size: $font-size-20;
  1224. border: 1px solid #e15616;
  1225. float: right;
  1226. }
  1227. }
  1228. }
  1229. .goods-pros {
  1230. width: 100%;
  1231. height: auto;
  1232. }
  1233. .goods-pros-t {
  1234. display: flex;
  1235. align-items: center;
  1236. width: 100%;
  1237. height: auto;
  1238. padding: 0 0 20rpx 0;
  1239. .checkbox-box {
  1240. padding: 10rpx;
  1241. }
  1242. .pros-img {
  1243. width: 210rpx;
  1244. height: 210rpx;
  1245. border-radius: 10rpx;
  1246. margin: 0 20rpx;
  1247. border: 1px solid #f3f3f3;
  1248. position: relative;
  1249. image {
  1250. width: 210rpx;
  1251. height: 210rpx;
  1252. border-radius: 10rpx;
  1253. }
  1254. .pros-type {
  1255. width: 64rpx;
  1256. height: 64rpx;
  1257. text-align: justify;
  1258. box-sizing: border-box;
  1259. padding: 10rpx;
  1260. border-radius: 0 0 8rpx 8rpx;
  1261. background-color: #33ccbf;
  1262. font-size: $font-size-22;
  1263. color: #ffffff;
  1264. line-height: 25rpx;
  1265. position: absolute;
  1266. top: 0;
  1267. right: 10rpx;
  1268. }
  1269. }
  1270. }
  1271. .goods-pros-b {
  1272. width: 100%;
  1273. height: auto;
  1274. padding: 0 0 24rpx 0;
  1275. box-sizing: border-box;
  1276. &.show {
  1277. display: block;
  1278. }
  1279. &.none {
  1280. display: none;
  1281. }
  1282. .sum-none {
  1283. width: 100%;
  1284. height: 48rpx;
  1285. line-height: 48rpx;
  1286. color: $text-color;
  1287. float: left;
  1288. text-align: right;
  1289. .money {
  1290. font-size: $font-size-26;
  1291. color: #999999;
  1292. text-decoration: line-through;
  1293. }
  1294. .money-sign {
  1295. font-size: $font-size-26;
  1296. color: #999999;
  1297. text-decoration: line-through;
  1298. }
  1299. .money-reduced {
  1300. margin-left: 10rpx;
  1301. font-size: $font-size-26;
  1302. color: $color-system;
  1303. .iconfont {
  1304. font-size: $font-size-34;
  1305. }
  1306. }
  1307. }
  1308. .sum {
  1309. width: 100%;
  1310. height: 40rpx;
  1311. font-size: $font-size-28;
  1312. line-height: 40rpx;
  1313. color: $text-color;
  1314. float: left;
  1315. display: flex;
  1316. justify-content: flex-end;
  1317. .money {
  1318. color: #ff2a2a;
  1319. font-size: $font-size-28;
  1320. }
  1321. .money-sign {
  1322. font-size: $font-size-24;
  1323. color: #ff2a2a;
  1324. }
  1325. }
  1326. }
  1327. .pros-product {
  1328. width: 386rpx;
  1329. height: 100%;
  1330. line-height: 36rpx;
  1331. font-size: $font-size-26;
  1332. position: relative;
  1333. .producttitle {
  1334. width: 100%;
  1335. display: inline-block;
  1336. height: auto;
  1337. text-overflow: ellipsis;
  1338. display: -webkit-box;
  1339. word-break: break-all;
  1340. -webkit-box-orient: vertical;
  1341. -webkit-line-clamp: 2;
  1342. overflow: hidden;
  1343. margin-bottom: 8rpx;
  1344. .no-text {
  1345. display: inline-block;
  1346. height: 36rpx;
  1347. padding: 0 12rpx;
  1348. line-height: 36rpx;
  1349. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1350. border-radius: 18rpx;
  1351. text-align: center;
  1352. color: #ffffff;
  1353. font-size: $font-size-24;
  1354. margin-right: 24rpx;
  1355. }
  1356. }
  1357. .productspec {
  1358. height: 36rpx;
  1359. color: #999999;
  1360. text-overflow: ellipsis;
  1361. display: -webkit-box;
  1362. word-break: break-all;
  1363. -webkit-box-orient: vertical;
  1364. -webkit-line-clamp: 2;
  1365. overflow: hidden;
  1366. margin-top: 10rpx;
  1367. }
  1368. .productCode {
  1369. color: #666666;
  1370. }
  1371. .cart-sku-temp {
  1372. width: 100%;
  1373. height: 48rpx;
  1374. margin: 30rpx 0 0 0;
  1375. .cart-sku-text {
  1376. font-size: 28rpx;
  1377. line-height: 48rpx;
  1378. color: #666666;
  1379. float: left;
  1380. }
  1381. .cart-sku-btn {
  1382. padding: 0 16rpx;
  1383. text-align: center;
  1384. line-height: 40rpx;
  1385. font-size: 24rpx;
  1386. box-sizing: border-box;
  1387. border: 1px solid #e15616;
  1388. color: #e15616;
  1389. float: left;
  1390. border-radius: 20rpx;
  1391. margin-left: 16rpx;
  1392. }
  1393. }
  1394. .productprice {
  1395. width: 100%;
  1396. height: 48rpx;
  1397. margin: 10rpx 0 0 0;
  1398. .price {
  1399. line-height: 48rpx;
  1400. font-size: $font-size-28;
  1401. width: 48%;
  1402. color: #ff2a2a;
  1403. float: left;
  1404. &.disabled {
  1405. color: #999999;
  1406. text-decoration: line-through;
  1407. }
  1408. .money-sign {
  1409. font-size: $font-size-24;
  1410. color: #ff2a2a;
  1411. }
  1412. }
  1413. .count {
  1414. height: 100%;
  1415. float: right;
  1416. position: relative;
  1417. &.show {
  1418. display: block;
  1419. }
  1420. &.none {
  1421. display: none;
  1422. }
  1423. .count-tips {
  1424. width: auto;
  1425. display: inline-block;
  1426. padding: 0 15rpx;
  1427. line-height: 44rpx;
  1428. height: 44rpx;
  1429. border-radius: 22rpx;
  1430. background: $btn-confirm;
  1431. font-size: $font-size-24;
  1432. text-align: center;
  1433. color: #ffffff;
  1434. position: absolute;
  1435. top: -60rpx;
  1436. left: -5rpx;
  1437. z-index: 5;
  1438. &.step {
  1439. left: -217rpx;
  1440. }
  1441. &::before {
  1442. content: '';
  1443. position: absolute;
  1444. bottom: -30rpx;
  1445. right: 15rpx;
  1446. z-index: 1;
  1447. width: 0;
  1448. height: 0;
  1449. border-width: 18rpx;
  1450. border-style: solid;
  1451. border-color: $color-system transparent transparent transparent;
  1452. }
  1453. }
  1454. .number-box {
  1455. display: flex;
  1456. justify-content: center;
  1457. align-items: center;
  1458. border: 2rpx solid #ffe6dc;
  1459. border-radius: 30rpx;
  1460. height: 48rpx;
  1461. .iconfont {
  1462. font-size: $font-size-24;
  1463. padding: 0 18rpx;
  1464. color: #999999;
  1465. text-align: center;
  1466. line-height: 48rpx;
  1467. font-weight: bold;
  1468. background: #fef6f3;
  1469. &.icon-jianhao {
  1470. border-radius: 30rpx 0 0 30rpx;
  1471. }
  1472. &.icon-jiahao {
  1473. border-radius: 0 30rpx 30rpx 0;
  1474. }
  1475. }
  1476. .btn-input {
  1477. width: 62rpx;
  1478. height: 44rpx;
  1479. line-height: 44rpx;
  1480. border-radius: 4rpx;
  1481. text-align: center;
  1482. font-size: $font-size-24;
  1483. border-bottom: 2rpx solid #ffe6dc;
  1484. border-top: 2rpx solid #ffe6dc;
  1485. }
  1486. }
  1487. .uni-numbox {
  1488. position: absolute;
  1489. left: 45rpx;
  1490. bottom: 0;
  1491. .uni-numbox-minus,
  1492. .uni-numbox-plus {
  1493. width: 50rpx;
  1494. line-height: 40rpx;
  1495. }
  1496. .uni-numbox-value {
  1497. font-size: $font-size-28;
  1498. width: 60rpx;
  1499. }
  1500. }
  1501. }
  1502. }
  1503. .floor-item-act {
  1504. width: 100%;
  1505. height: 56rpx;
  1506. text-align: center;
  1507. box-sizing: border-box;
  1508. float: left;
  1509. padding: 0 0 10rpx 0;
  1510. margin-left: 10rpx;
  1511. }
  1512. }
  1513. }
  1514. .footer {
  1515. width: 100%;
  1516. background-color: #ffffff;
  1517. height: 110rpx;
  1518. position: fixed;
  1519. bottom: 0rpx;
  1520. z-index: 100;
  1521. .footer-le {
  1522. width: 510rpx;
  1523. height: 100%;
  1524. padding: 0 24rpx;
  1525. float: left;
  1526. .foot-check {
  1527. width: 100rpx;
  1528. float: left;
  1529. line-height: 110rpx;
  1530. font-size: $font-size-24;
  1531. .checkbox {
  1532. width: 40rpx;
  1533. text-align: center;
  1534. }
  1535. .text {
  1536. width: 60rpx;
  1537. float: right;
  1538. }
  1539. }
  1540. .sum {
  1541. width: 380rpx;
  1542. height: 110rpx;
  1543. float: right;
  1544. box-sizing: border-box;
  1545. padding: 10rpx;
  1546. .sum-none {
  1547. width: 100%;
  1548. height: 45rpx;
  1549. line-height: 45rpx;
  1550. color: $text-color;
  1551. float: left;
  1552. text-align: right;
  1553. .money {
  1554. font-size: $font-size-24;
  1555. color: #999999;
  1556. text-decoration: line-through;
  1557. }
  1558. .money-sign {
  1559. font-size: $font-size-24;
  1560. color: #999999;
  1561. text-decoration: line-through;
  1562. }
  1563. .money-reduced {
  1564. margin-left: 10rpx;
  1565. font-size: $font-size-24;
  1566. color: $color-system;
  1567. }
  1568. }
  1569. .sum-price {
  1570. text-align: right;
  1571. width: 100%;
  1572. height: 45rpx;
  1573. line-height: 45rpx;
  1574. font-size: $font-size-30;
  1575. color: $text-color;
  1576. float: left;
  1577. font-weight: normal;
  1578. &.none {
  1579. height: 90rpx;
  1580. line-height: 90rpx;
  1581. }
  1582. .money {
  1583. color: #ff2a2a;
  1584. }
  1585. .money-sign {
  1586. font-size: $font-size-24;
  1587. color: #ff2a2a;
  1588. }
  1589. }
  1590. }
  1591. }
  1592. .footer-ri {
  1593. width: 180rpx;
  1594. height: 84rpx;
  1595. background: linear-gradient(135deg, rgba(242, 143, 49, 1) 0%, rgba(225, 86, 22, 1) 100%);
  1596. float: right;
  1597. display: flex;
  1598. justify-content: space-between;
  1599. align-items: center;
  1600. z-index: 999;
  1601. border-radius: 49rpx;
  1602. margin-top: 15rpx;
  1603. margin-right: 10rpx;
  1604. &.none {
  1605. display: none;
  1606. }
  1607. .btn {
  1608. width: 200rpx;
  1609. height: 100%;
  1610. font-size: $font-size-28;
  1611. line-height: 110rpx;
  1612. color: #ffffff;
  1613. display: flex;
  1614. justify-content: center;
  1615. align-items: center;
  1616. }
  1617. }
  1618. .footer-del {
  1619. width: 400rpx;
  1620. height: 110rpx;
  1621. position: absolute;
  1622. padding-left: 200rpx;
  1623. background: #ffffff;
  1624. right: 0;
  1625. top: 0;
  1626. z-index: 1000;
  1627. &.show {
  1628. animation: showDelbtn 0s linear both;
  1629. }
  1630. &.none {
  1631. animation: hideDelbtn 0s linear both;
  1632. }
  1633. .btn {
  1634. width: 50%;
  1635. height: 100%;
  1636. line-height: 110rpx;
  1637. font-size: $font-size-28;
  1638. color: #ffffff;
  1639. text-align: center;
  1640. float: left;
  1641. }
  1642. .btn.btn-cancel {
  1643. background: #eec1ab;
  1644. }
  1645. .btn.btn-confirm {
  1646. background: #ff2a2a;
  1647. }
  1648. @keyframes showDelbtn {
  1649. 0% {
  1650. transform: translateX(0);
  1651. }
  1652. 100% {
  1653. transform: translateX(-100%);
  1654. }
  1655. }
  1656. @keyframes hideDelbtn {
  1657. 0% {
  1658. transform: translateX(-100%);
  1659. }
  1660. 100% {
  1661. transform: translateX(0);
  1662. }
  1663. }
  1664. }
  1665. }
  1666. .failure-list {
  1667. width: 702rpx;
  1668. height: auto;
  1669. padding: 0 24rpx;
  1670. margin-top: 20rpx;
  1671. background: #ffffff;
  1672. .failure-title {
  1673. width: 100%;
  1674. height: 82rpx;
  1675. line-height: 82rpx;
  1676. font-size: $font-size-28;
  1677. .title-txt {
  1678. float: left;
  1679. color: #666666;
  1680. text-align: left;
  1681. }
  1682. .title-btn {
  1683. float: right;
  1684. color: $color-system;
  1685. text-align: right;
  1686. line-height: 80rpx;
  1687. .butto {
  1688. display: inline-block;
  1689. padding: 0 15rpx;
  1690. font-size: $font-size-26;
  1691. height: 50rpx;
  1692. line-height: 50rpx;
  1693. border-radius: 30rpx;
  1694. background: #ffffff;
  1695. // border: 1px solid #C9C9C9;
  1696. // color: #999999;
  1697. margin-top: 15rpx;
  1698. }
  1699. }
  1700. }
  1701. .productlist {
  1702. padding-top: 10rpx;
  1703. .goods-pros {
  1704. width: 100%;
  1705. height: auto;
  1706. padding: 20rpx 0;
  1707. }
  1708. .goods-pros-t {
  1709. display: flex;
  1710. align-items: center;
  1711. width: 100%;
  1712. height: 210rpx;
  1713. position: relative;
  1714. .img-tip {
  1715. display: block;
  1716. width: 72rpx;
  1717. height: 36rpx;
  1718. line-height: 36rpx;
  1719. font-size: $font-size-24;
  1720. text-align: center;
  1721. color: #ffffff;
  1722. border-radius: 24rpx;
  1723. background: rgba(51, 51, 51, 0.3);
  1724. // position: absolute;
  1725. // left: 0;
  1726. // top: 0;
  1727. }
  1728. .checkbox-box {
  1729. padding: 10rpx;
  1730. }
  1731. .pros-img {
  1732. width: 180rpx;
  1733. height: 100%;
  1734. border-radius: 10rpx;
  1735. margin: 0 20rpx;
  1736. border: 1px solid #f3f3f3;
  1737. position: relative;
  1738. image {
  1739. width: 100%;
  1740. height: 100%;
  1741. border-radius: 10rpx;
  1742. }
  1743. }
  1744. .pros-marks {
  1745. width: 750rpx;
  1746. height: 250rpx;
  1747. z-index: 90;
  1748. background: rgba(0, 0, 0, 0.05);
  1749. position: absolute;
  1750. left: -20rpx;
  1751. top: -20rpx;
  1752. }
  1753. }
  1754. .goods-pros-b {
  1755. width: 622rpx;
  1756. margin-left: 84rpx;
  1757. height: 40rpx;
  1758. padding: 0 0 26rpx 0;
  1759. // border-top: 1px solid #EBEBEB;
  1760. &.show {
  1761. display: block;
  1762. }
  1763. &.none {
  1764. display: none;
  1765. }
  1766. .sum {
  1767. font-size: $font-size-28;
  1768. line-height: 40rpx;
  1769. color: $text-color;
  1770. display: flex;
  1771. justify-content: flex-end;
  1772. .money {
  1773. color: #ff2a2a;
  1774. font-size: $font-size-28;
  1775. }
  1776. .money-sign {
  1777. font-size: $font-size-24;
  1778. color: #ff2a2a;
  1779. }
  1780. }
  1781. }
  1782. .pros-product {
  1783. width: 402rpx;
  1784. height: 100%;
  1785. line-height: 36rpx;
  1786. font-size: $font-size-28;
  1787. position: relative;
  1788. .producttitle {
  1789. width: 100%;
  1790. display: inline-block;
  1791. height: auto;
  1792. text-overflow: ellipsis;
  1793. display: -webkit-box;
  1794. word-break: break-all;
  1795. -webkit-box-orient: vertical;
  1796. -webkit-line-clamp: 2;
  1797. overflow: hidden;
  1798. margin-bottom: 8rpx;
  1799. .no-text {
  1800. display: inline-block;
  1801. height: 36rpx;
  1802. padding: 0 12rpx;
  1803. line-height: 36rpx;
  1804. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1805. border-radius: 18rpx;
  1806. text-align: center;
  1807. color: #ffffff;
  1808. font-size: $font-size-28;
  1809. margin-right: 24rpx;
  1810. }
  1811. }
  1812. .productspec {
  1813. height: 36rpx;
  1814. color: #999999;
  1815. font-size: $font-size-26;
  1816. margin-top: 20rpx;
  1817. }
  1818. .productstate {
  1819. font-size: $font-size-28;
  1820. height: 44rpx;
  1821. color: #ff2a2a;
  1822. position: absolute;
  1823. bottom: 0;
  1824. left: 0;
  1825. }
  1826. }
  1827. }
  1828. }
  1829. </style>