cart.vue 44 KB

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