cart.vue 42 KB

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