cart.vue 45 KB

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