index.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314
  1. <template>
  2. <view class="container cart clearfix" v-if="hasLogin">
  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="container-cart-main tui-skeleton" :style="{ paddingTop: isshowDelbtn ? '0rpx' : '80rpx' }">
  11. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length > 0">
  12. <view class="foot-text">
  13. 共<text>{{ kindCount }}</text
  14. >件商品</view
  15. >
  16. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  17. </view>
  18. <view v-if="!isEmpty" class="container-cart">
  19. <!-- TODO -->
  20. <view class="receive-coupon">
  21. <view class="tip-text">还差¥200可用“满200元减50元”优惠券</view>
  22. <view class="btn" @click="couponVisible = true">领券</view>
  23. </view>
  24. <view class="cart-content" :style="{ paddingBottom: isIphoneX ? '130rpx' : '100rpx' }">
  25. <view class="goods-list">
  26. <view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
  27. <view class="shoptitle">
  28. <!--选择商店的全部商品"-->
  29. <view class="checkbox-box" @click.stop="checkShop(item)">
  30. <view
  31. class="checkbox iconfont"
  32. :class="[item.checked ? 'icon-xuanze' : 'icon-weixuanze']"
  33. ></view>
  34. </view>
  35. <view class="text">{{ item.name }}</view>
  36. </view>
  37. <view class="productlist">
  38. <view class="goods-pros" v-for="(pros, idx) in item.productList" :key="idx">
  39. <view class="goods-pros-t">
  40. <!--选择商品-->
  41. <view class="checkbox-box" @click.stop="checkProduct(item, pros)">
  42. <view
  43. class="checkbox iconfont"
  44. :class="[pros.productsChecked ? 'icon-xuanze' : 'icon-weixuanze']"
  45. ></view>
  46. </view>
  47. <view class="pros-img" @click.stop="navToListPage(pros)"
  48. ><image :src="pros.mainImage ? pros.mainImage : ''" alt=""
  49. /></view>
  50. <view class="pros-product">
  51. <view class="producttitle" @click.stop="navToListPage(pros)">{{
  52. pros.productName
  53. }}</view>
  54. <view class="productspec">规格:{{ pros.unit ? pros.unit : '' }}</view>
  55. <view class="floor-item-act" v-if="pros.activeStatus == 1">
  56. <text class="tag tag-01" v-if="!pros.heUserId">自营</text>
  57. <text class="tag tag-01" v-else>促销</text>
  58. <text class="tag tag-02" @click.stop="clickPopupShow(pros, 2)"
  59. >活动价</text
  60. >
  61. </view>
  62. <view class="productprice">
  63. <!--使用过滤器对总价改变-->
  64. <view class="price"><text>¥</text>{{ pros.price | NumFormat }}</view>
  65. <view class="count">
  66. <view class="number-box">
  67. <view
  68. class="iconfont icon-jianhao"
  69. @click="changeCountSub(item, pros)"
  70. ></view>
  71. <input
  72. class="btn-input"
  73. type="number"
  74. maxlength="4"
  75. v-model="pros.productCount"
  76. @blur="changeNumber($event, item, pros)"
  77. @focus="changeInput(pros)"
  78. />
  79. <view
  80. class="iconfont icon-jiahao"
  81. @click="changeCountAdd(item, pros)"
  82. ></view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none' : 'show']">
  91. <view class="sum-none" v-if="item.reducedPrice > 0">
  92. <text class="money-sign">¥</text>
  93. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  94. <text class="money-reduced"
  95. >减<text>¥{{ item.reducedPrice | NumFormat }}</text></text
  96. >
  97. </view>
  98. <view class="sum"
  99. >合计:<text class="money"
  100. ><text class="money-sign">¥</text>{{ item.totalPrice | NumFormat }}</text
  101. ></view
  102. >
  103. </view>
  104. </view>
  105. </view>
  106. <view class="failure-list" v-if="failureList.length > 0">
  107. <view class="failure-title">
  108. <view class="title-txt"
  109. >失效商品<text>{{ failureList.length }}件</text></view
  110. >
  111. <view class="title-btn" @click.stop="deletefailureList"
  112. ><text class="butto">清空失效商品</text></view
  113. >
  114. </view>
  115. <view class="productlist">
  116. <view class="goods-pros" v-for="(failure, failureIdx) in failureList" :key="failureIdx">
  117. <view class="goods-pros-t" @click.stop="navToListPage(failure)">
  118. <!--选择商品-->
  119. <view
  120. class="checkbox-box"
  121. @click.stop="ischeckFailure(failure)"
  122. v-if="isshowDelbtn"
  123. >
  124. <button
  125. class="checkbox iconfont"
  126. :class="[failure.productsChecked ? 'icon-xuanze' : 'icon-weixuanze']"
  127. ></button>
  128. </view>
  129. <text class="img-tip">失效</text>
  130. <view class="pros-img">
  131. <image :src="failure.mainImage ? failure.mainImage : ''" alt="" />
  132. </view>
  133. <view class="pros-product">
  134. <view class="producttitle">{{ failure.name }}</view>
  135. <view class="productspec">规格:{{ failure.unit ? failure.unit : '' }}</view>
  136. <view class="productstate">商品已下架</view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. <!-- 脚部菜单 -->
  144. <view class="footer">
  145. <view class="footer-le">
  146. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  147. <button
  148. class="checkbox iconfont"
  149. :class="[isCheckAll ? 'icon-xuanze' : 'icon-weixuanze']"
  150. ></button>
  151. <view class="text">全选</view>
  152. </view>
  153. <view class="sum">
  154. <view v-if="!isshowDelbtn" class="sum-price">
  155. <view class="row">
  156. <text>总价:</text> <text class="money-sign">¥</text>
  157. <text class="money">{{ allPrice | NumFormat }}</text>
  158. </view>
  159. <view class="row">
  160. <text>共减</text> <text class="discounted-price">¥200.00</text>
  161. <text @click="showDiscountedDetail">优惠明细</text>
  162. <text
  163. class="iconfont"
  164. :class="showDitail ? 'tui-icon-arrowdown' : 'tui-icon-arrowup'"
  165. ></text>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <view v-if="!isshowDelbtn" class="footer-ri">
  171. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{ allCount }})</view>
  172. </view>
  173. <view v-else class="footer-del">
  174. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  175. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  176. </view>
  177. </view>
  178. </view>
  179. <view v-else class="cart-content empty">
  180. <view class="empty-container">
  181. <image
  182. class="empty-container-image"
  183. :src="StaticUrl + 'icon-empty-cart.png'"
  184. mode="aspectFit"
  185. ></image>
  186. <text class="error-text">购物车空空的,快去逛逛吧~</text>
  187. </view>
  188. </view>
  189. </view>
  190. <!-- 操作弹窗 -->
  191. <tui-modal
  192. :show="modal"
  193. @click="handleClick"
  194. @cancel="hideModal"
  195. :content="contentModalText"
  196. color="#333"
  197. :size="32"
  198. shape="circle"
  199. :maskClosable="false"
  200. ></tui-modal>
  201. <!-- 促销活动弹窗 -->
  202. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  203. <!-- 优惠券列表 TODO-->
  204. <cm-coupon-list
  205. title="优惠券"
  206. listType="search"
  207. :visible="couponVisible"
  208. @close="closeCouponList"
  209. ></cm-coupon-list>
  210. <!-- 优惠明细 -->
  211. <cm-drawer
  212. title="优惠明细"
  213. :visible="showDitail"
  214. position="bottom"
  215. :offset="100"
  216. @close="showDitail = false"
  217. zIndex="99"
  218. >
  219. <template>
  220. <view class="discounted-ditail">
  221. <view class="row"> <text>商品总额</text> <text>¥450.00</text> </view>
  222. <view class="row"> <text>促销满减</text> <text class="red">-¥180.00</text> </view>
  223. <view class="row"> <text>优惠券</text> <text class="red">-¥20.00</text> </view>
  224. <view class="row total"> <text>总计</text> <text>¥250.00</text> </view>
  225. <view class="tip"> 实际订单金额以结算页为准 </view>
  226. </view>
  227. </template>
  228. </cm-drawer>
  229. <!-- 透明模态层 -->
  230. <modal-layer v-if="modallayer"></modal-layer>
  231. </view>
  232. </template>
  233. <script>
  234. import authorize from '@/common/authorize.js'
  235. import activiPopup from '@/components/cm-module/productDetails/cm-activipopu'
  236. import modalLayer from '@/components/cm-module/modal-layer/modal-layer'
  237. import CmCouponList from '@/components/cm-module/cm-coupon-list/cm-coupon-list'
  238. import CmDrawer from '@/components/cm-module/cm-drawer/cm-drawer.vue'
  239. import { mapGetters, mapActions, mapMutations } from 'vuex'
  240. export default {
  241. components: {
  242. activiPopup,
  243. modalLayer,
  244. CmCouponList,
  245. CmDrawer
  246. },
  247. data() {
  248. return {
  249. StaticUrl: this.$Static,
  250. CustomBar: this.CustomBar, // 顶部导航栏高度
  251. popupShow: false,
  252. handlerPros: {}, //监听单挑促销商品
  253. isCheckAll: false, //是否全选
  254. allPrice: 0, //所有价格
  255. totalOriginalPrice: 0, //所有原价价
  256. reducedPrice: 0, //满减
  257. skeletonShow: true,
  258. isshowDelbtn: false,
  259. scrollHeight: 'auto',
  260. hasNextPage: false,
  261. modal: false,
  262. contentModalText: '',
  263. deleteType: 0,
  264. couponVisible: false,
  265. showDitail: false
  266. }
  267. },
  268. onLoad() {
  269. this.setScrollHeight()
  270. },
  271. computed: {
  272. ...mapGetters([
  273. 'hasLogin',
  274. 'isIphoneX',
  275. 'isEmpty',
  276. 'goodsList',
  277. 'failureList',
  278. 'kindCount',
  279. 'userId',
  280. 'cartIds'
  281. ]),
  282. //被选中的产品数量
  283. allCount() {
  284. return this.cartIds.length
  285. }
  286. },
  287. filters: {
  288. NumFormat(value) {
  289. //处理金额
  290. return Number(value).toFixed(2)
  291. },
  292. totalprice(val, count) {
  293. //单件商品的价格 × 数量
  294. return (val * count).toFixed(2)
  295. }
  296. },
  297. watch: {
  298. //深度监听所有数据,每次改变重新计算总价和总数
  299. goodsList: {
  300. deep: true,
  301. handler(val, oldval) {
  302. this.totalPeice()
  303. }
  304. }
  305. },
  306. //下拉刷新
  307. onPullDownRefresh() {
  308. this.initCart().finally(() => {
  309. setTimeout(() => {
  310. uni.stopPullDownRefresh()
  311. }, 2000)
  312. })
  313. },
  314. onShow() {
  315. if (this.hasLogin) {
  316. this.initData()
  317. } else {
  318. this.$api.redirectTo('/pages/login/login')
  319. }
  320. },
  321. onHide() {
  322. this.saveCartIds([])
  323. },
  324. methods: {
  325. ...mapActions('cart', ['initCart', 'updateShoppogCount', 'removeFromCart', 'removeFailureFromCart']),
  326. ...mapMutations('cart', [
  327. 'selectProduct',
  328. 'selectAllShopProduct',
  329. 'selectAllProduct',
  330. 'saveCartIds',
  331. 'selectFailure',
  332. 'selectAllFailure'
  333. ]),
  334. initData() {
  335. this.initCart().finally(() => {
  336. this.skeletonShow = false
  337. })
  338. },
  339. // 关闭优惠券弹窗
  340. closeCouponList() {
  341. this.couponVisible = false
  342. },
  343. // 活动价弹窗
  344. clickPopupShow(pros, type) {
  345. if (pros.ladderList.length > 0) {
  346. this.popupShow = true
  347. this.handlerPros = pros
  348. }
  349. },
  350. // 优惠明细 TODO
  351. showDiscountedDetail() {
  352. this.showDitail = true
  353. },
  354. // 勾选单个失效商品
  355. ischeckFailure(failure) {
  356. this.selectFailure({
  357. productId: failure.productId,
  358. checked: !failure.productsChecked
  359. })
  360. this.getCheckedProductId()
  361. },
  362. // 勾选单个商品
  363. checkProduct(shop, product) {
  364. this.selectProduct({
  365. shopId: shop.shopId,
  366. productId: product.productId,
  367. checked: !product.productsChecked
  368. })
  369. this.isSelectAll()
  370. },
  371. // 勾选商店所有商品
  372. checkShop(shop) {
  373. this.selectAllShopProduct({
  374. shopId: shop.shopId,
  375. checked: !shop.checked
  376. })
  377. this.isSelectAll()
  378. },
  379. // 勾选全部商品
  380. checkAll() {
  381. this.isCheckAll = !this.isCheckAll
  382. this.selectAllProduct(this.isCheckAll)
  383. // 删除商品的全选也要选中失效商品
  384. if (this.isshowDelbtn) {
  385. this.selectAllFailure(this.isCheckAll)
  386. }
  387. this.isSelectAll()
  388. },
  389. // 判断是否全选商品
  390. isSelectAll() {
  391. this.isCheckAll = this.goodsList.every(shop => shop.checked)
  392. this.getCheckedProductId()
  393. },
  394. // 获取勾选商品的id
  395. getCheckedProductId() {
  396. const cartIds = []
  397. this.goodsList.forEach(shop => {
  398. const ids = shop.productList.reduce((cartIds, prod) => {
  399. if (prod.productsChecked) cartIds.push(prod.cartId)
  400. return cartIds
  401. }, [])
  402. cartIds.push(...ids)
  403. })
  404. if (this.isshowDelbtn) {
  405. const ids = this.failureList.reduce((cartIds, prod) => {
  406. if (prod.productsChecked) cartIds.push(prod.cartId)
  407. return cartIds
  408. }, [])
  409. cartIds.push(...ids)
  410. }
  411. console.log(cartIds)
  412. this.saveCartIds(cartIds)
  413. },
  414. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  415. totalPeice() {
  416. const priceObj = this.goodsList.reduce(
  417. (priceObj, shop) => {
  418. shop.productList.forEach(prod => {
  419. if (prod.productsChecked) {
  420. priceObj.totalOriginalPrice += prod.price * prod.productCount
  421. // 单品满减
  422. if (prod.promotion && prod.promotion.type * 1 === 1 && prod.promotion.mode * 1 === 2) {
  423. // 单品满减-重新计算供应商总价/满减金额
  424. if (prod.price * prod.productCount >= prod.promotion.touchPrice) {
  425. priceObj.reducedPrice += prod.promotion.reducedPrice
  426. }
  427. }
  428. }
  429. })
  430. priceObj.allPrice = priceObj.totalOriginalPrice - priceObj.reducedPrice
  431. return priceObj
  432. },
  433. {
  434. totalOriginalPrice: 0,
  435. reducedPrice: 0,
  436. allPrice: 0
  437. }
  438. )
  439. this.allPrice = priceObj.allPrice
  440. },
  441. //商品数量加加
  442. changeCountAdd(item, pros) {
  443. const productCount = pros.productCount + 1
  444. this.updateShoppogCount({
  445. cartId: pros.cartId,
  446. productCount
  447. })
  448. },
  449. //商品数量减减
  450. changeCountSub(item, pros) {
  451. let productCount = pros.productCount
  452. if (productCount <= 1) {
  453. productCount = 1
  454. this.$util.msg('购买数量不能少于1', 2000)
  455. return
  456. } else {
  457. productCount--
  458. }
  459. this.updateShoppogCount({
  460. cartId: pros.cartId,
  461. productCount
  462. })
  463. },
  464. //输入商品数量更新
  465. changeInput(pros) {},
  466. //输入商品数量更新
  467. changeNumber(e, item, pros) {
  468. let _value = Math.abs(Number(e.detail.value))
  469. let productCount = pros.productCount
  470. if (_value <= 1) {
  471. this.$util.msg('购买数量不能少于1', 2000)
  472. productCount = 1
  473. } else {
  474. productCount = _value
  475. }
  476. this.updateShoppogCount({
  477. cartId: pros.cartId,
  478. productCount
  479. })
  480. },
  481. //显示删除商品管理
  482. showDelManager() {
  483. this.isshowDelbtn = true
  484. },
  485. //隐藏删除商品管理
  486. hideDelManage() {
  487. this.selectAllFailure(false)
  488. this.getCheckedProductId()
  489. this.isshowDelbtn = false
  490. },
  491. //删除购物车商品
  492. deleteList() {
  493. if (this.cartIds.length <= 0) {
  494. return this.$util.msg('请选择要删除的商品~', 2000)
  495. } else {
  496. this.modal = true
  497. this.contentModalText = '确定删除选中的商品吗?'
  498. this.deleteType = 1
  499. }
  500. },
  501. // 清空失效商品
  502. deletefailureList() {
  503. this.modal = true
  504. this.contentModalText = '确定清除所有失效商品吗?'
  505. this.deleteType = 2
  506. },
  507. //从购物车移除商品
  508. handleClick(e) {
  509. if (e.index !== 1) return (this.modal = false)
  510. if (this.deleteType === 1) {
  511. // 删除所有勾选的商品
  512. this.removeFromCart().finally(() => {
  513. this.isshowDelbtn = false
  514. })
  515. } else {
  516. //一键删除失效商品
  517. this.removeFailureFromCart().finally(() => {
  518. this.isshowDelbtn = false
  519. })
  520. }
  521. this.modal = false
  522. },
  523. //跳转确认订单页面
  524. toConfirmation() {
  525. if (this.cartIds.length <= 0) {
  526. return this.$util.msg('请先选择结算商品~', 2000)
  527. }
  528. let cartPramsData = {
  529. allPrice: this.allPrice,
  530. allCount: this.allCount,
  531. cartIds: this.cartIds.join(','),
  532. productCount: ''
  533. }
  534. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({ data: cartPramsData })}`)
  535. },
  536. hideModal() {
  537. this.modal = false
  538. },
  539. navToListPage(item) {
  540. this.$api.navigateTo(`/pages/goods/product?productId=${item.productId}`)
  541. },
  542. // 窗口高度-footer高度
  543. setScrollHeight() {
  544. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  545. setTimeout(() => {
  546. const query = uni.createSelectorQuery().in(this)
  547. query.selectAll('.footer').boundingClientRect()
  548. query.exec(res => {
  549. this.windowHeight = windowHeight
  550. if (res[0][0]) {
  551. this.scrollHeight = windowHeight - res[0][0].height
  552. }
  553. })
  554. }, 500)
  555. }
  556. }
  557. }
  558. </script>
  559. <style lang="scss" scoped>
  560. page {
  561. background: #f7f7f7;
  562. height: auto;
  563. }
  564. .discounted-ditail {
  565. padding: 52rpx 8rpx 0;
  566. .row {
  567. display: flex;
  568. justify-content: space-between;
  569. align-items: center;
  570. padding: 12rpx 0;
  571. text {
  572. font-size: 30rpx;
  573. color: #333333;
  574. &.red {
  575. color: #f94b4b;
  576. }
  577. }
  578. &.total{
  579. font-size: 30rpx;
  580. font-weight: 600;
  581. }
  582. }
  583. .tip {
  584. padding: 12rpx 0;
  585. font-size: 26rpx;
  586. color: #999999;
  587. }
  588. }
  589. .receive-coupon {
  590. display: flex;
  591. justify-content: space-between;
  592. align-items: center;
  593. padding: 24rpx;
  594. background: #fff;
  595. .tip-text {
  596. font-size: 26rpx;
  597. color: #ff457b;
  598. }
  599. .btn {
  600. width: 88rpx;
  601. height: 42rpx;
  602. background: linear-gradient(270deg, #f83c6c 0%, #fc32b4 100%);
  603. border-radius: 28rpx;
  604. font-size: 26rpx;
  605. color: #ffffff;
  606. text-align: center;
  607. line-height: 42rpx;
  608. }
  609. }
  610. .cart-content {
  611. position: relative;
  612. }
  613. .container-cart-main.none {
  614. display: none;
  615. }
  616. .container-cart-main.show {
  617. display: block;
  618. }
  619. .cart-content.empty.none {
  620. display: none;
  621. }
  622. .cart-content.empty.show {
  623. display: block;
  624. }
  625. .container-cart.show {
  626. display: block;
  627. }
  628. .container-cart.none {
  629. display: none;
  630. }
  631. .empty-container.none {
  632. display: none;
  633. }
  634. .empty-container.show {
  635. display: flex;
  636. }
  637. .foot-check-delbtn {
  638. width: 100%;
  639. height: 80rpx;
  640. position: fixed;
  641. top: 0;
  642. left: 0;
  643. box-sizing: border-box;
  644. padding: 15rpx 24rpx;
  645. background-color: #f7f7f7;
  646. z-index: 990;
  647. .foot-text {
  648. font-size: $font-size-26;
  649. height: 50rpx;
  650. line-height: 50rpx;
  651. color: #666666;
  652. float: left;
  653. padding-left: 10rpx;
  654. text {
  655. margin: 0 6rpx;
  656. }
  657. }
  658. .delBtn {
  659. width: 100rpx;
  660. display: inline-block;
  661. padding: 0 15rpx;
  662. font-size: $font-size-26;
  663. height: 50rpx;
  664. line-height: 50rpx;
  665. border-radius: 30rpx;
  666. background: #ffffff;
  667. border: 1px solid #ff457b;
  668. color: #ff457b;
  669. float: right;
  670. text-align: center;
  671. &.none {
  672. display: none;
  673. }
  674. }
  675. }
  676. .checkbox-box {
  677. display: flex;
  678. align-items: center;
  679. .checkbox {
  680. display: flex;
  681. margin: 0;
  682. padding: 0 5rpx;
  683. display: flex;
  684. flex-direction: column;
  685. align-items: center;
  686. box-sizing: border-box;
  687. text-align: center;
  688. text-decoration: none;
  689. border-radius: 0;
  690. -webkit-tap-highlight-color: transparent;
  691. overflow: hidden;
  692. background-color: #ffffff;
  693. font-size: 36rpx;
  694. color: #999999;
  695. &.icon-xuanze {
  696. color: $color-system;
  697. }
  698. }
  699. &.disabled {
  700. .checkbox {
  701. color: #999999;
  702. }
  703. }
  704. .text {
  705. font-size: $font-size-24;
  706. margin-left: 10rpx;
  707. }
  708. }
  709. .goods-list {
  710. width: 100%;
  711. height: auto;
  712. background-color: #f7f7f7;
  713. .goods-item {
  714. width: 702rpx;
  715. padding: 0 24rpx;
  716. background: #ffffff;
  717. margin-bottom: 24rpx;
  718. }
  719. .shoptitle {
  720. display: flex;
  721. align-items: center;
  722. height: 80rpx;
  723. line-height: 80rpx;
  724. .checkbox-box {
  725. padding: 10rpx;
  726. }
  727. .text {
  728. width: 450rpx;
  729. display: block;
  730. overflow: hidden;
  731. text-overflow: ellipsis;
  732. white-space: nowrap;
  733. margin-left: 20rpx;
  734. font-size: $font-size-28;
  735. color: $text-color;
  736. text-align: left;
  737. font-weight: bold;
  738. }
  739. }
  740. .goods-pros {
  741. width: 100%;
  742. height: auto;
  743. margin-bottom: 20rpx;
  744. }
  745. .goods-pros-t {
  746. display: flex;
  747. align-items: center;
  748. width: 100%;
  749. height: 210rpx;
  750. padding: 0 0 26rpx 0;
  751. .checkbox-box {
  752. padding: 10rpx;
  753. }
  754. .pros-img {
  755. width: 210rpx;
  756. height: 100%;
  757. border-radius: 10rpx;
  758. margin: 0 20rpx;
  759. border: 1px solid #f3f3f3;
  760. image {
  761. width: 100%;
  762. height: 100%;
  763. border-radius: 10rpx;
  764. }
  765. }
  766. }
  767. .goods-pros-b {
  768. width: 100%;
  769. height: auto;
  770. padding: 0 0 24rpx 0;
  771. box-sizing: border-box;
  772. &.show {
  773. display: block;
  774. }
  775. &.none {
  776. display: none;
  777. }
  778. .sum-none {
  779. width: 100%;
  780. height: 48rpx;
  781. line-height: 48rpx;
  782. color: $text-color;
  783. float: left;
  784. text-align: right;
  785. .money {
  786. font-size: $font-size-26;
  787. color: #999999;
  788. text-decoration: line-through;
  789. }
  790. .money-sign {
  791. font-size: $font-size-26;
  792. color: #999999;
  793. text-decoration: line-through;
  794. }
  795. .money-reduced {
  796. margin-left: 10rpx;
  797. font-size: $font-size-26;
  798. color: $color-system;
  799. .iconfont {
  800. font-size: $font-size-34;
  801. }
  802. }
  803. }
  804. .sum {
  805. width: 100%;
  806. height: 40rpx;
  807. font-size: $font-size-26;
  808. line-height: 40rpx;
  809. color: $text-color;
  810. float: left;
  811. display: flex;
  812. justify-content: flex-end;
  813. font-weight: bold;
  814. .money {
  815. color: $color-system;
  816. font-size: $font-size-26;
  817. }
  818. .money-sign {
  819. font-size: $font-size-24;
  820. color: $color-system;
  821. }
  822. }
  823. }
  824. .pros-product {
  825. width: 416rpx;
  826. height: 100%;
  827. line-height: 36rpx;
  828. font-size: $font-size-28;
  829. position: relative;
  830. .producttitle {
  831. width: 100%;
  832. display: inline-block;
  833. height: auto;
  834. text-overflow: ellipsis;
  835. display: -webkit-box;
  836. word-break: break-all;
  837. -webkit-box-orient: vertical;
  838. -webkit-line-clamp: 2;
  839. overflow: hidden;
  840. margin-bottom: 15rpx;
  841. .no-text {
  842. display: inline-block;
  843. height: 36rpx;
  844. padding: 0 12rpx;
  845. line-height: 36rpx;
  846. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  847. border-radius: 18rpx;
  848. text-align: center;
  849. color: #ffffff;
  850. font-size: $font-size-28;
  851. margin-right: 24rpx;
  852. }
  853. }
  854. .productspec {
  855. height: 36rpx;
  856. color: #999999;
  857. font-size: $font-size-26;
  858. }
  859. .productprice {
  860. position: absolute;
  861. bottom: 0;
  862. width: 100%;
  863. height: 48rpx;
  864. margin: 30rpx 0 0 0;
  865. .price {
  866. line-height: 48rpx;
  867. font-size: $font-size-26;
  868. width: 48%;
  869. color: $color-system;
  870. float: left;
  871. font-weight: bold;
  872. &.disabled {
  873. color: #999999;
  874. text-decoration: line-through;
  875. }
  876. .money-sign {
  877. font-size: $font-size-24;
  878. color: $color-system;
  879. }
  880. }
  881. .count {
  882. height: 100%;
  883. float: right;
  884. position: relative;
  885. &.show {
  886. display: block;
  887. }
  888. &.none {
  889. display: none;
  890. }
  891. .count-tips {
  892. width: auto;
  893. display: inline-block;
  894. padding: 0 15rpx;
  895. line-height: 44rpx;
  896. height: 44rpx;
  897. border-radius: 22rpx;
  898. background: $btn-confirm;
  899. font-size: $font-size-24;
  900. text-align: center;
  901. color: #ffffff;
  902. position: absolute;
  903. top: -60rpx;
  904. left: -5rpx;
  905. z-index: 5;
  906. &.step {
  907. left: -217rpx;
  908. }
  909. &::before {
  910. content: '';
  911. position: absolute;
  912. bottom: -30rpx;
  913. right: 15rpx;
  914. z-index: 1;
  915. width: 0;
  916. height: 0;
  917. border-width: 18rpx;
  918. border-style: solid;
  919. border-color: $color-system transparent transparent transparent;
  920. }
  921. }
  922. .number-box {
  923. display: flex;
  924. justify-content: center;
  925. align-items: center;
  926. border: 2rpx solid #e1e1e1;
  927. border-radius: 30rpx;
  928. height: 48rpx;
  929. margin-left: 20rpx;
  930. .iconfont {
  931. font-size: $font-size-24;
  932. padding: 0 14rpx;
  933. color: #666666;
  934. text-align: center;
  935. line-height: 48rpx;
  936. font-weight: bold;
  937. background: #ffffff;
  938. &.icon-jianhao {
  939. border-radius: 30rpx 0 0 30rpx;
  940. }
  941. &.icon-jiahao {
  942. border-radius: 0 30rpx 30rpx 0;
  943. }
  944. }
  945. .btn-input {
  946. width: 56rpx;
  947. height: 44rpx;
  948. line-height: 44rpx;
  949. border-radius: 4rpx;
  950. text-align: center;
  951. font-size: $font-size-24;
  952. color: #333333;
  953. background-color: #f7f7f7;
  954. }
  955. }
  956. .uni-numbox {
  957. position: absolute;
  958. left: 45rpx;
  959. bottom: 0;
  960. .uni-numbox-minus,
  961. .uni-numbox-plus {
  962. width: 50rpx;
  963. line-height: 40rpx;
  964. }
  965. .uni-numbox-value {
  966. font-size: $font-size-28;
  967. width: 60rpx;
  968. }
  969. }
  970. }
  971. }
  972. .floor-item-act {
  973. width: 100%;
  974. height: 30rpx;
  975. margin-top: 8rpx;
  976. float: left;
  977. .tag {
  978. display: inline-block;
  979. height: 32rpx;
  980. font-size: 22rpx;
  981. line-height: 30rpx;
  982. text-align: center;
  983. color: #f83c6c;
  984. float: left;
  985. margin-right: 10rpx;
  986. &.tag-02 {
  987. width: 80rpx;
  988. background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png) top center
  989. no-repeat;
  990. background-size: contain;
  991. }
  992. &.tag-01 {
  993. width: 56rpx;
  994. color: #fff;
  995. background-color: #f83c6c;
  996. border-radius: 4rpx;
  997. }
  998. }
  999. }
  1000. }
  1001. }
  1002. .failure-list {
  1003. width: 702rpx;
  1004. height: auto;
  1005. padding: 0 24rpx;
  1006. margin-top: 20rpx;
  1007. background: #ffffff;
  1008. .failure-title {
  1009. width: 100%;
  1010. height: 82rpx;
  1011. line-height: 82rpx;
  1012. font-size: $font-size-28;
  1013. border-bottom: 1px solid #ebebeb;
  1014. .title-txt {
  1015. float: left;
  1016. color: #666666;
  1017. text-align: left;
  1018. }
  1019. .title-btn {
  1020. float: right;
  1021. color: $color-system;
  1022. text-align: right;
  1023. line-height: 80rpx;
  1024. .butto {
  1025. display: inline-block;
  1026. padding: 0 15rpx;
  1027. font-size: $font-size-26;
  1028. height: 50rpx;
  1029. line-height: 50rpx;
  1030. border-radius: 30rpx;
  1031. background: #fff8fd;
  1032. border: 1px solid #ff457b;
  1033. color: #ff457b;
  1034. margin-top: 15rpx;
  1035. }
  1036. }
  1037. }
  1038. .productlist {
  1039. padding-top: 10rpx;
  1040. .goods-pros {
  1041. width: 100%;
  1042. height: auto;
  1043. padding: 20rpx 0;
  1044. }
  1045. .goods-pros-t {
  1046. display: flex;
  1047. align-items: center;
  1048. width: 100%;
  1049. height: 210rpx;
  1050. position: relative;
  1051. .img-tip {
  1052. display: block;
  1053. width: 72rpx;
  1054. height: 36rpx;
  1055. line-height: 36rpx;
  1056. font-size: $font-size-24;
  1057. text-align: center;
  1058. color: #ffffff;
  1059. border-radius: 24rpx;
  1060. background: rgba(51, 51, 51, 0.3);
  1061. // position: absolute;
  1062. // left: 0;
  1063. // top: 0;
  1064. }
  1065. .checkbox-box {
  1066. padding: 10rpx;
  1067. }
  1068. .pros-img {
  1069. width: 180rpx;
  1070. height: 100%;
  1071. border-radius: 10rpx;
  1072. margin: 0 20rpx;
  1073. border: 1px solid #f3f3f3;
  1074. position: relative;
  1075. image {
  1076. width: 100%;
  1077. height: 100%;
  1078. border-radius: 10rpx;
  1079. }
  1080. }
  1081. .pros-marks {
  1082. width: 730rpx;
  1083. height: 250rpx;
  1084. z-index: 90;
  1085. background: rgba(0, 0, 0, 0.05);
  1086. position: absolute;
  1087. left: -20rpx;
  1088. top: -20rpx;
  1089. }
  1090. }
  1091. .goods-pros-b {
  1092. width: 622rpx;
  1093. margin-left: 84rpx;
  1094. height: 40rpx;
  1095. padding: 0 0 26rpx 0;
  1096. // border-top: 1px solid #EBEBEB;
  1097. &.show {
  1098. display: block;
  1099. }
  1100. &.none {
  1101. display: none;
  1102. }
  1103. .sum {
  1104. font-size: $font-size-28;
  1105. line-height: 40rpx;
  1106. color: $text-color;
  1107. display: flex;
  1108. justify-content: flex-end;
  1109. .money {
  1110. color: #ff2a2a;
  1111. font-size: $font-size-28;
  1112. }
  1113. .money-sign {
  1114. font-size: $font-size-24;
  1115. color: #ff2a2a;
  1116. }
  1117. }
  1118. }
  1119. .pros-product {
  1120. width: 402rpx;
  1121. height: 100%;
  1122. line-height: 36rpx;
  1123. font-size: $font-size-28;
  1124. position: relative;
  1125. .producttitle {
  1126. width: 100%;
  1127. display: inline-block;
  1128. height: auto;
  1129. text-overflow: ellipsis;
  1130. display: -webkit-box;
  1131. word-break: break-all;
  1132. -webkit-box-orient: vertical;
  1133. -webkit-line-clamp: 2;
  1134. overflow: hidden;
  1135. margin-bottom: 8rpx;
  1136. .no-text {
  1137. display: inline-block;
  1138. height: 36rpx;
  1139. padding: 0 12rpx;
  1140. line-height: 36rpx;
  1141. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1142. border-radius: 18rpx;
  1143. text-align: center;
  1144. color: #ffffff;
  1145. font-size: $font-size-28;
  1146. margin-right: 24rpx;
  1147. }
  1148. }
  1149. .productspec {
  1150. height: 36rpx;
  1151. color: #999999;
  1152. font-size: $font-size-26;
  1153. margin-top: 20rpx;
  1154. }
  1155. .productstate {
  1156. font-size: $font-size-28;
  1157. height: 44rpx;
  1158. color: #ff2a2a;
  1159. position: absolute;
  1160. bottom: 0;
  1161. left: 0;
  1162. }
  1163. }
  1164. }
  1165. }
  1166. .footer {
  1167. width: 100%;
  1168. background-color: #ffffff;
  1169. height: 100rpx;
  1170. position: fixed;
  1171. bottom: 0rpx;
  1172. z-index: 100;
  1173. border-top: 1px solid #EFEFEF;
  1174. .footer-le {
  1175. width: 520rpx;
  1176. height: 100%;
  1177. padding: 10rpx 24rpx;
  1178. float: left;
  1179. box-sizing: border-box;
  1180. .foot-check {
  1181. width: 100rpx;
  1182. float: left;
  1183. line-height: 80rpx;
  1184. font-size: $font-size-24;
  1185. .checkbox {
  1186. width: 40rpx;
  1187. text-align: center;
  1188. }
  1189. .text {
  1190. width: 60rpx;
  1191. float: right;
  1192. }
  1193. }
  1194. .sum {
  1195. width: 360rpx;
  1196. height: 100%;
  1197. float: right;
  1198. box-sizing: border-box;
  1199. padding: 0 10rpx;
  1200. .sum-price {
  1201. display: flex;
  1202. justify-content: center;
  1203. align-items: flex-end;
  1204. flex-direction: column;
  1205. width: 100%;
  1206. height: 80rpx;
  1207. font-size: $font-size-30;
  1208. color: $text-color;
  1209. float: left;
  1210. font-weight: normal;
  1211. .money {
  1212. color: $color-system;
  1213. }
  1214. .money-sign {
  1215. font-size: $font-size-24;
  1216. color: $color-system;
  1217. }
  1218. .discounted-price {
  1219. margin-right: 32rpx;
  1220. }
  1221. .row {
  1222. &:nth-child(2) {
  1223. font-size: 24rpx;
  1224. color: #ff457b;
  1225. }
  1226. }
  1227. }
  1228. }
  1229. }
  1230. .footer-ri {
  1231. width: 230rpx;
  1232. height: 100%;
  1233. float: right;
  1234. display: flex;
  1235. justify-content: space-between;
  1236. align-items: center;
  1237. z-index: 999;
  1238. box-sizing: border-box;
  1239. padding: 13rpx 15rpx;
  1240. &.none {
  1241. display: none;
  1242. }
  1243. .btn {
  1244. width: 200rpx;
  1245. height: 100%;
  1246. background: $btn-confirm;
  1247. font-size: $font-size-28;
  1248. line-height: 80rpx;
  1249. color: #ffffff;
  1250. display: flex;
  1251. border-radius: 40rpx;
  1252. justify-content: center;
  1253. align-items: center;
  1254. }
  1255. }
  1256. .footer-del {
  1257. width: 420rpx;
  1258. height: 100rpx;
  1259. position: absolute;
  1260. padding-left: 200rpx;
  1261. background: #ffffff;
  1262. right: 0;
  1263. top: 0;
  1264. z-index: 1000;
  1265. box-sizing: border-box;
  1266. padding: 10rpx 0;
  1267. display: flex;
  1268. &.show {
  1269. animation: showDelbtn 0s linear both;
  1270. }
  1271. &.none {
  1272. animation: hideDelbtn 0s linear both;
  1273. }
  1274. .btn {
  1275. flex: 1;
  1276. margin: 0 8rpx;
  1277. height: 100%;
  1278. line-height: 80rpx;
  1279. font-size: $font-size-28;
  1280. color: #ffffff;
  1281. text-align: center;
  1282. float: left;
  1283. border-radius: 40rpx;
  1284. }
  1285. .btn.btn-cancel {
  1286. background: #f7f7f7;
  1287. color: #b2b2b2;
  1288. }
  1289. .btn.btn-confirm {
  1290. background: $btn-confirm;
  1291. color: #ffffff;
  1292. }
  1293. @keyframes showDelbtn {
  1294. 0% {
  1295. transform: translateX(0);
  1296. }
  1297. 100% {
  1298. transform: translateX(-100%);
  1299. }
  1300. }
  1301. @keyframes hideDelbtn {
  1302. 0% {
  1303. transform: translateX(-100%);
  1304. }
  1305. 100% {
  1306. transform: translateX(0);
  1307. }
  1308. }
  1309. }
  1310. }
  1311. </style>