index.vue 40 KB

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