index.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  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="ischeck(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="changeNnmber($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="hideMobel"
  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 } 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. userId: '',
  207. popupShow: false,
  208. handlerPros: {}, //监听单挑促销商品
  209. failureList: [], //失效商品列表
  210. goodsList: [], //购物车的商品
  211. delGoodsList: '', //要删除的商品
  212. setGoodData: '', //确认订单的商品
  213. isCheckAll: false, //是否全选
  214. kindCount: 0, //购物车宝贝数量
  215. allPrice: 0, //所有价格
  216. totalOriginalPrice: 0, //所有原价价
  217. reducedPrice: 0, //满减
  218. allCount: 0, //被选中的产品数量
  219. isModallayer: false,
  220. skeletonShow: true,
  221. isshowDelbtn: false,
  222. isDisabled: false, // 供应商/店铺全选是否禁用状态
  223. isEmpty: false, //显示空购物车
  224. scrollHeight: 'auto',
  225. nomoreText: '上拉显示更多',
  226. hasNextPage: false,
  227. loadding: false,
  228. pullUpOn: true,
  229. pullFlag: true,
  230. pageSize: 10,
  231. pageNum: 1,
  232. submitIds: [],
  233. modal: false,
  234. contentModalText: '',
  235. deleteType: 0
  236. }
  237. },
  238. onLoad() {
  239. this.setScrollHeight()
  240. },
  241. computed: {
  242. ...mapGetters(['hasLogin', 'isIphoneX'])
  243. },
  244. filters: {
  245. NumFormat(value) {
  246. //处理金额
  247. return Number(value).toFixed(2)
  248. },
  249. totalprice(val, count) {
  250. //单件商品的价格 × 数量
  251. return (val * count).toFixed(2)
  252. }
  253. },
  254. methods: {
  255. initData() {
  256. this.isModallayer = false //遮罩层 防止多次点击
  257. this.isCheckAll = false //是否全选
  258. this.submitIds = []
  259. this.$api.getStorage().then(resolve => {
  260. this.userId = resolve.userId ? resolve.userId : 0
  261. this.InitGetCartGoodsList()
  262. this.GetCartNumber()
  263. })
  264. },
  265. clickPopupShow(pros, type) {
  266. if (pros.ladderList.length > 0) {
  267. this.popupShow = true
  268. this.handlerPros = pros
  269. }
  270. },
  271. setScrollHeight() {
  272. // 窗口高度-footer高度
  273. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  274. setTimeout(() => {
  275. const query = uni.createSelectorQuery().in(this)
  276. query.selectAll('.footer').boundingClientRect()
  277. query.exec(res => {
  278. this.windowHeight = windowHeight
  279. if (res[0][0]) {
  280. this.scrollHeight = windowHeight - res[0][0].height
  281. }
  282. })
  283. }, 500)
  284. },
  285. InitGetCartGoodsList() {
  286. //初始化购物车 index:1
  287. this.ProductService.QueryShoppingCartList({ userId: this.userId })
  288. .then(response => {
  289. this.skeletonShow = false
  290. let data = response.data
  291. this.kindCount = data.cartQuantity
  292. if (data.shopList.length > 0 || data.products.length > 0) {
  293. this.isEmpty = false
  294. } else {
  295. this.isEmpty = true
  296. }
  297. if (data.shopList && data.shopList.length > 0) {
  298. this.goodsList = data.shopList
  299. console.log(this.goodsList)
  300. this.totalShopPeice()
  301. } else {
  302. this.goodsList = []
  303. }
  304. if (data.products && data.products.length > 0) {
  305. this.failureList = data.products
  306. } else {
  307. this.failureList = []
  308. }
  309. })
  310. .catch(error => {
  311. this.$util.msg(error.msg, 2000)
  312. })
  313. },
  314. ischeckFailure(failure) {
  315. failure.productsChecked = !failure.productsChecked
  316. this.updateCheckAllBtn()
  317. },
  318. ischeck(item, pro) {
  319. //为未选中的时候改变为true,反之为true
  320. pro.productsChecked = !pro.productsChecked
  321. if (pro.productsChecked) {
  322. if (!this.submitIds.includes(pro.productID * 1)) {
  323. this.submitIds.push(pro.productID)
  324. }
  325. } else {
  326. var lent = this.submitIds.indexOf(pro.productID * 1)
  327. if (lent >= 0) {
  328. this.submitIds.splice(lent, 1)
  329. }
  330. }
  331. this.updateProductCheckedAllBtn(item)
  332. this.updateCheckAllBtn()
  333. },
  334. updateProductCheckedAllBtn(item) {
  335. // 单独每个供应商的勾选判断
  336. let productList = item.productList,
  337. productsCheckedLength = 0,
  338. disabledLength = 0
  339. if (this.isshowDelbtn) {
  340. productList.forEach(pros => {
  341. if (pros.productsChecked) {
  342. productsCheckedLength++
  343. }
  344. })
  345. } else {
  346. productList.forEach(pros => {
  347. if (pros.productsChecked) {
  348. productsCheckedLength++
  349. }
  350. })
  351. }
  352. item.checked = productsCheckedLength === productList.length
  353. },
  354. updateCheckAllBtn() {
  355. // 全选勾选判断
  356. let goodsCheckedLength = 0,
  357. goodsList = this.goodsList,
  358. failureList = this.failureList
  359. goodsList.forEach(item => {
  360. if (item.checked) {
  361. goodsCheckedLength++
  362. }
  363. })
  364. failureList.forEach(failureItem => {
  365. if (failureItem.productsChecked) {
  366. goodsCheckedLength++
  367. }
  368. })
  369. if (this.isshowDelbtn) {
  370. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length
  371. } else {
  372. this.isCheckAll = goodsCheckedLength === goodsList.length
  373. }
  374. },
  375. checkShop(item) {
  376. //与单选商品类似
  377. item.checked = !item.checked
  378. this.setProductChecked(item)
  379. this.updateCheckAllBtn()
  380. },
  381. setProductChecked(item) {
  382. item.productList.forEach(pros => {
  383. if (item.checked) {
  384. pros.productsChecked = true
  385. if (!this.submitIds.includes(pros.productId * 1)) {
  386. this.submitIds.push(pros.productId)
  387. }
  388. } else {
  389. pros.productsChecked = false
  390. var lent = this.submitIds.indexOf(pros.productId * 1)
  391. if (lent >= 0) {
  392. this.submitIds.splice(lent, 1)
  393. }
  394. }
  395. })
  396. },
  397. updateBothCheckBtn() {
  398. if (this.isshowDelbtn) {
  399. // 当管理删除按钮出现时,失效的商品可被选择
  400. this.goodsList.forEach(item => {
  401. item.checked = this.isCheckAll
  402. this.setProductChecked(item)
  403. })
  404. //删除按钮 全选包括失效商品勾选
  405. this.failureList.forEach(failureItem => {
  406. failureItem.productsChecked = this.isCheckAll
  407. })
  408. } else {
  409. this.goodsList.forEach(item => {
  410. item.checked = this.isCheckAll && !item.isDisabled
  411. this.setProductChecked(item)
  412. })
  413. }
  414. },
  415. checkAll() {
  416. //全选方法内调用方法
  417. this.isCheckAll = !this.isCheckAll
  418. this.updateBothCheckBtn()
  419. },
  420. totalShopPeice() {
  421. //每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  422. let touchPrice = 0
  423. let reducedPrice = 0 //商铺合计满减价
  424. this.goodsList.map((item, index) => {
  425. let _totalPrice = 0
  426. let _reducedPrice = 0
  427. let _totalOriginalPrice = 0
  428. item.productList.forEach(pros => {
  429. let _price = pros.price * pros.productCount
  430. _totalOriginalPrice += pros.price * pros.productCount
  431. if (pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2) {
  432. if (_price >= pros.promotion.touchPrice) {
  433. _price = _price - pros.promotion.reducedPrice
  434. _reducedPrice += pros.promotion.reducedPrice
  435. }
  436. _totalPrice += _price
  437. } else {
  438. _reducedPrice = 0
  439. _totalPrice += pros.price * pros.productCount
  440. }
  441. })
  442. item.reducedPrice = _reducedPrice
  443. item.totalOriginalPrice = _totalOriginalPrice
  444. item.totalPrice = _totalPrice
  445. })
  446. },
  447. totalPeice() {
  448. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  449. let totalPrice = 0
  450. let reducedPrice = 0
  451. let originalPrice = 0
  452. this.goodsList.forEach((item, index) => {
  453. let supplierPrice = 0
  454. let supplierReducedPrice = 0
  455. item.totalprice = 0
  456. item.reducedprice = 0
  457. item.originalprice = 0
  458. item.productList.forEach(pros => {
  459. if (pros.productsChecked) {
  460. supplierPrice += pros.price * pros.productCount
  461. // 单品满减
  462. if (pros.promotion && pros.promotion.type * 1 === 1 && pros.promotion.mode * 1 === 2) {
  463. // 单品满减-重新计算供应商总价/满减金额
  464. if (pros.price * pros.productCount >= pros.promotion.touchPrice) {
  465. supplierPrice -= pros.promotion.reducedPrice
  466. supplierReducedPrice += pros.promotion.reducedPrice
  467. }
  468. }
  469. }
  470. })
  471. item.totalprice = supplierPrice
  472. item.reducedprice = supplierReducedPrice
  473. item.originalprice = supplierPrice + supplierReducedPrice
  474. totalPrice += item.totalprice
  475. reducedPrice += item.reducedprice
  476. originalPrice += item.originalprice
  477. })
  478. //最后统计商品原价
  479. this.totalOriginalPrice = originalPrice
  480. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  481. this.reducedPrice = reducedPrice
  482. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  483. this.allPrice = totalPrice
  484. },
  485. totalCount() {
  486. //计算总数量
  487. this.allCount = 0
  488. let prosAllCount = 0
  489. let validCount = 0
  490. let validList = []
  491. let productList = []
  492. this.goodsList.forEach(item => {
  493. productList = item.productList
  494. productList.forEach(pros => {
  495. if (pros.productsChecked) {
  496. prosAllCount += parseInt(pros.productCount)
  497. this.allCount = prosAllCount
  498. }
  499. })
  500. })
  501. },
  502. changeCountAdd(item, pros) {
  503. //商品数量加加
  504. pros.productCount++
  505. this.processActivityPrice(pros)
  506. this.updateShoppogNum(pros)
  507. this.totalShopPeice()
  508. },
  509. changeCountSub(item, pros) {
  510. //商品数量减减
  511. if (pros.productCount <= 1) {
  512. pros.productCount = 1
  513. this.$util.msg('购买数量不能少于1', 2000)
  514. return
  515. } else {
  516. pros.productCount--
  517. }
  518. this.processActivityPrice(pros)
  519. this.updateShoppogNum(pros)
  520. this.totalShopPeice()
  521. },
  522. changeInput(pros) {
  523. //输入商品数量更新
  524. },
  525. changeNnmber(e, item, pros) {
  526. //输入商品数量更新
  527. let _value = Number(e.detail.value)
  528. if (!this.$api.isNumber(_value)) {
  529. pros.productCount = 1
  530. } else if (_value <= 1) {
  531. this.$util.msg('购买数量不能少于1', 2000)
  532. pros.productCount = 1
  533. } else {
  534. pros.productCount = e.detail.value
  535. }
  536. this.processActivityPrice(pros)
  537. this.updateShoppogNum(pros)
  538. this.totalShopPeice()
  539. },
  540. processActivityPrice(pros) {
  541. //单独处理活动价格和阶梯价格
  542. if (pros.activeStatus == 1) {
  543. pros.ladderList.forEach((item, index) => {
  544. if (pros.productCount >= item.buyNum) {
  545. pros.price = item.buyPrice
  546. }
  547. })
  548. } else {
  549. pros.price = pros.price
  550. }
  551. },
  552. updateShoppogNum(pros) {
  553. //加减购物车商品更新到后台
  554. this.ProductService.ShoppingCartUpdate({
  555. cartId: pros.cartId,
  556. productCount: pros.productCount
  557. })
  558. .then(response => {
  559. this.isshowDelbtn = false
  560. this.InitGetCartGoodsList()
  561. })
  562. .catch(error => {
  563. this.$util.msg(error.msg, 2000)
  564. })
  565. },
  566. toConfirmation() {
  567. //跳转确认订单页面
  568. let setGoodsList = []
  569. this.goodsList.forEach(res => {
  570. let products = res.productList
  571. products.forEach(pros => {
  572. if (pros.productsChecked) {
  573. setGoodsList.push(pros.productId)
  574. }
  575. })
  576. })
  577. if (setGoodsList == '') {
  578. this.$util.msg('请先选择结算商品~', 2000)
  579. return
  580. }
  581. let cartIds = ''
  582. this.goodsList.forEach(el => {
  583. //获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  584. el.productList.forEach(pros => {
  585. if (pros.productsChecked) {
  586. cartIds += pros.cartId + ','
  587. }
  588. })
  589. })
  590. let cartPramsData = {
  591. allPrice: this.allPrice,
  592. allCount: this.allCount,
  593. cartIds: cartIds.substring(0, cartIds.lastIndexOf(',')),
  594. productCount: ''
  595. }
  596. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({ data: cartPramsData })}`)
  597. },
  598. showDelManager() {
  599. //显示删除商品管理
  600. this.isshowDelbtn = true
  601. if (this.isCheckAll) {
  602. this.updateBothCheckBtn()
  603. } else {
  604. this.goodsList.forEach(item => {
  605. if (item.checked) {
  606. item.productList.forEach(pros => {
  607. pros.productsChecked = true
  608. })
  609. }
  610. })
  611. this.updateCheckAllBtn()
  612. }
  613. // 失效也被勾选
  614. this.failureList.forEach(failureItem => {
  615. if (failureItem.isFailureLayer) {
  616. failureItem.isFailureLayer = false
  617. }
  618. })
  619. },
  620. hideDelManage() {
  621. //隐藏删除商品管理
  622. this.isshowDelbtn = false
  623. let isFailureLayer,
  624. newFailureList = []
  625. if (this.isCheckAll) {
  626. this.updateBothCheckBtn()
  627. } else {
  628. // 失效商品取消勾选
  629. this.goodsList.forEach(item => {
  630. if (item.isDisabled) {
  631. item.checked = false
  632. }
  633. item.productList.forEach(pros => {
  634. if (pros.validFlag == 3) {
  635. pros.productsChecked = false
  636. }
  637. })
  638. })
  639. this.updateCheckAllBtn()
  640. }
  641. this.failureList.forEach((failure, index) => {
  642. if (failure.failureState == 1 || failure.failureState == 2) {
  643. isFailureLayer = true
  644. } else {
  645. isFailureLayer = false
  646. }
  647. newFailureList.push(Object.assign({}, failure, { isFailureLayer: isFailureLayer }))
  648. })
  649. this.failureList = newFailureList
  650. },
  651. deleteList() {
  652. //删除购物车商品
  653. this.delGoodsList = []
  654. this.goodsList.forEach(delitem => {
  655. let products = delitem.productList
  656. products.forEach(pros => {
  657. if (pros.productsChecked) {
  658. this.delGoodsList += pros.cartId + ','
  659. }
  660. })
  661. })
  662. this.failureList.forEach(failure => {
  663. if (failure.productsChecked) {
  664. this.delGoodsList += failure.cartId + ','
  665. }
  666. })
  667. if (this.delGoodsList.length == 0) {
  668. this.$util.msg('请选择要删除的商品~', 2000)
  669. return
  670. } else {
  671. this.modal = true
  672. this.contentModalText = '确定删除选中的商品吗?'
  673. this.deleteType = 1
  674. }
  675. },
  676. deletefailureList() {
  677. this.delGoodsList = ''
  678. this.failureList.forEach(failure => {
  679. this.delGoodsList += failure.cartId + ','
  680. })
  681. this.modal = true
  682. this.contentModalText = '确定清除所有失效商品吗?'
  683. this.deleteType = 2
  684. },
  685. handleClick(e) {
  686. //用户操作订单
  687. let index = e.index
  688. if (index == 1) {
  689. this.ProductService.ShoppingCartDelete({
  690. cartIds: this.delGoodsList
  691. })
  692. .then(response => {
  693. this.$util.msg('删除成功', 2000)
  694. setTimeout(() => {
  695. this.isshowDelbtn = false
  696. this.InitGetCartGoodsList()
  697. }, 1000)
  698. })
  699. .catch(error => {
  700. this.$util.msg(error.msg, 2000)
  701. })
  702. .finally(() => {
  703. this.GetCartNumber()
  704. })
  705. }
  706. this.modal = false
  707. },
  708. hideMobel() {
  709. this.modal = false
  710. },
  711. GetCartNumber() {
  712. //查询购物车数量
  713. this.ProductService.QueryShoppingQuantity({
  714. userId: this.userId
  715. })
  716. .then(response => {
  717. this.$store.commit('app/updateAllNum', response.data)
  718. })
  719. .catch(error => {
  720. console.log('查询购物车数量错误信息', error)
  721. })
  722. },
  723. navToListPage(item) {
  724. this.isModallayer = true
  725. this.$api.navigateTo(`/pages/goods/product?productId=${item.productId}`)
  726. },
  727. setHeaderBtnPosi() {
  728. // 获得胶囊按钮位置信息
  729. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  730. return headerBtnPosi
  731. },
  732. setSysteminfo() {
  733. let systeminfo
  734. uni.getSystemInfo({
  735. // 获取设备信息
  736. success: res => {
  737. systeminfo = res
  738. }
  739. })
  740. return systeminfo
  741. },
  742. PromotionsFormat(promo) {
  743. //促销活动类型数据处理
  744. if (promo != null) {
  745. if (promo.type == 1 && promo.mode == 1) {
  746. return true
  747. } else {
  748. return false
  749. }
  750. }
  751. return false
  752. }
  753. },
  754. watch: {
  755. //深度监听所有数据,每次改变重新计算总价和总数
  756. goodsList: {
  757. deep: true,
  758. handler(val, oldval) {
  759. this.totalPeice()
  760. this.totalCount()
  761. }
  762. }
  763. },
  764. onPullDownRefresh() {
  765. //下拉刷新
  766. this.InitGetCartGoodsList()
  767. uni.stopPullDownRefresh()
  768. },
  769. onShow() {
  770. if (this.hasLogin) {
  771. this.initData()
  772. } else {
  773. this.$api.redirectTo('/pages/login/login')
  774. }
  775. }
  776. }
  777. </script>
  778. <style lang="scss">
  779. page {
  780. background: #f7f7f7;
  781. height: auto;
  782. }
  783. .cart-content {
  784. position: relative;
  785. }
  786. .container-cart-main.none {
  787. display: none;
  788. }
  789. .container-cart-main.show {
  790. display: block;
  791. }
  792. .cart-content.empty.none {
  793. display: none;
  794. }
  795. .cart-content.empty.show {
  796. display: block;
  797. }
  798. .container-cart.show {
  799. display: block;
  800. }
  801. .container-cart.none {
  802. display: none;
  803. }
  804. .empty-container.none {
  805. display: none;
  806. }
  807. .empty-container.show {
  808. display: flex;
  809. }
  810. .foot-check-delbtn {
  811. width: 100%;
  812. height: 80rpx;
  813. position: fixed;
  814. top: 0;
  815. left: 0;
  816. box-sizing: border-box;
  817. padding: 15rpx 24rpx;
  818. background-color: #f7f7f7;
  819. z-index: 990;
  820. .foot-text {
  821. font-size: $font-size-26;
  822. height: 50rpx;
  823. line-height: 50rpx;
  824. color: #666666;
  825. float: left;
  826. padding-left: 10rpx;
  827. text {
  828. margin: 0 6rpx;
  829. }
  830. }
  831. .delBtn {
  832. width: 100rpx;
  833. display: inline-block;
  834. padding: 0 15rpx;
  835. font-size: $font-size-26;
  836. height: 50rpx;
  837. line-height: 50rpx;
  838. border-radius: 30rpx;
  839. background: #ffffff;
  840. border: 1px solid #ff457b;
  841. color: #ff457b;
  842. float: right;
  843. text-align: center;
  844. &.none {
  845. display: none;
  846. }
  847. }
  848. }
  849. .checkbox-box {
  850. display: flex;
  851. align-items: center;
  852. .checkbox {
  853. display: flex;
  854. margin: 0;
  855. padding: 0 5rpx;
  856. display: flex;
  857. flex-direction: column;
  858. align-items: center;
  859. box-sizing: border-box;
  860. text-align: center;
  861. text-decoration: none;
  862. border-radius: 0;
  863. -webkit-tap-highlight-color: transparent;
  864. overflow: hidden;
  865. background-color: #ffffff;
  866. font-size: 36rpx;
  867. color: #999999;
  868. &.icon-xuanze {
  869. color: $color-system;
  870. }
  871. }
  872. &.disabled {
  873. .checkbox {
  874. color: #999999;
  875. }
  876. }
  877. .text {
  878. font-size: $font-size-24;
  879. margin-left: 10rpx;
  880. }
  881. }
  882. .goods-list {
  883. width: 100%;
  884. height: auto;
  885. background-color: #f7f7f7;
  886. .goods-item {
  887. width: 702rpx;
  888. padding: 0 24rpx;
  889. background: #ffffff;
  890. margin-bottom: 24rpx;
  891. }
  892. .shoptitle {
  893. display: flex;
  894. align-items: center;
  895. height: 80rpx;
  896. line-height: 80rpx;
  897. .checkbox-box {
  898. padding: 10rpx;
  899. }
  900. .text {
  901. width: 450rpx;
  902. display: block;
  903. overflow: hidden;
  904. text-overflow: ellipsis;
  905. white-space: nowrap;
  906. margin-left: 20rpx;
  907. font-size: $font-size-28;
  908. color: $text-color;
  909. text-align: left;
  910. font-weight: bold;
  911. }
  912. }
  913. .goods-pros {
  914. width: 100%;
  915. height: auto;
  916. margin-bottom: 20rpx;
  917. }
  918. .goods-pros-t {
  919. display: flex;
  920. align-items: center;
  921. width: 100%;
  922. height: 210rpx;
  923. padding: 0 0 26rpx 0;
  924. .checkbox-box {
  925. padding: 10rpx;
  926. }
  927. .pros-img {
  928. width: 210rpx;
  929. height: 100%;
  930. border-radius: 10rpx;
  931. margin: 0 20rpx;
  932. border: 1px solid #f3f3f3;
  933. image {
  934. width: 100%;
  935. height: 100%;
  936. border-radius: 10rpx;
  937. }
  938. }
  939. }
  940. .goods-pros-b {
  941. width: 100%;
  942. height: auto;
  943. padding: 0 0 24rpx 0;
  944. box-sizing: border-box;
  945. &.show {
  946. display: block;
  947. }
  948. &.none {
  949. display: none;
  950. }
  951. .sum-none {
  952. width: 100%;
  953. height: 48rpx;
  954. line-height: 48rpx;
  955. color: $text-color;
  956. float: left;
  957. text-align: right;
  958. .money {
  959. font-size: $font-size-26;
  960. color: #999999;
  961. text-decoration: line-through;
  962. }
  963. .money-sign {
  964. font-size: $font-size-26;
  965. color: #999999;
  966. text-decoration: line-through;
  967. }
  968. .money-reduced {
  969. margin-left: 10rpx;
  970. font-size: $font-size-26;
  971. color: $color-system;
  972. .iconfont {
  973. font-size: $font-size-34;
  974. }
  975. }
  976. }
  977. .sum {
  978. width: 100%;
  979. height: 40rpx;
  980. font-size: $font-size-26;
  981. line-height: 40rpx;
  982. color: $text-color;
  983. float: left;
  984. display: flex;
  985. justify-content: flex-end;
  986. font-weight: bold;
  987. .money {
  988. color: $color-system;
  989. font-size: $font-size-26;
  990. }
  991. .money-sign {
  992. font-size: $font-size-24;
  993. color: $color-system;
  994. }
  995. }
  996. }
  997. .pros-product {
  998. width: 416rpx;
  999. height: 100%;
  1000. line-height: 36rpx;
  1001. font-size: $font-size-28;
  1002. position: relative;
  1003. .producttitle {
  1004. width: 100%;
  1005. display: inline-block;
  1006. height: auto;
  1007. text-overflow: ellipsis;
  1008. display: -webkit-box;
  1009. word-break: break-all;
  1010. -webkit-box-orient: vertical;
  1011. -webkit-line-clamp: 2;
  1012. overflow: hidden;
  1013. margin-bottom: 15rpx;
  1014. .no-text {
  1015. display: inline-block;
  1016. height: 36rpx;
  1017. padding: 0 12rpx;
  1018. line-height: 36rpx;
  1019. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1020. border-radius: 18rpx;
  1021. text-align: center;
  1022. color: #ffffff;
  1023. font-size: $font-size-28;
  1024. margin-right: 24rpx;
  1025. }
  1026. }
  1027. .productspec {
  1028. height: 36rpx;
  1029. color: #999999;
  1030. font-size: $font-size-26;
  1031. }
  1032. .productprice {
  1033. position: absolute;
  1034. bottom: 0;
  1035. width: 100%;
  1036. height: 48rpx;
  1037. margin: 30rpx 0 0 0;
  1038. .price {
  1039. line-height: 48rpx;
  1040. font-size: $font-size-26;
  1041. width: 48%;
  1042. color: $color-system;
  1043. float: left;
  1044. font-weight: bold;
  1045. &.disabled {
  1046. color: #999999;
  1047. text-decoration: line-through;
  1048. }
  1049. .money-sign {
  1050. font-size: $font-size-24;
  1051. color: $color-system;
  1052. }
  1053. }
  1054. .count {
  1055. height: 100%;
  1056. float: right;
  1057. position: relative;
  1058. &.show {
  1059. display: block;
  1060. }
  1061. &.none {
  1062. display: none;
  1063. }
  1064. .count-tips {
  1065. width: auto;
  1066. display: inline-block;
  1067. padding: 0 15rpx;
  1068. line-height: 44rpx;
  1069. height: 44rpx;
  1070. border-radius: 22rpx;
  1071. background: $btn-confirm;
  1072. font-size: $font-size-24;
  1073. text-align: center;
  1074. color: #ffffff;
  1075. position: absolute;
  1076. top: -60rpx;
  1077. left: -5rpx;
  1078. z-index: 5;
  1079. &.step {
  1080. left: -217rpx;
  1081. }
  1082. &::before {
  1083. content: '';
  1084. position: absolute;
  1085. bottom: -30rpx;
  1086. right: 15rpx;
  1087. z-index: 1;
  1088. width: 0;
  1089. height: 0;
  1090. border-width: 18rpx;
  1091. border-style: solid;
  1092. border-color: $color-system transparent transparent transparent;
  1093. }
  1094. }
  1095. .number-box {
  1096. display: flex;
  1097. justify-content: center;
  1098. align-items: center;
  1099. border: 2rpx solid #e1e1e1;
  1100. border-radius: 30rpx;
  1101. height: 48rpx;
  1102. margin-left: 20rpx;
  1103. .iconfont {
  1104. font-size: $font-size-24;
  1105. padding: 0 14rpx;
  1106. color: #666666;
  1107. text-align: center;
  1108. line-height: 48rpx;
  1109. font-weight: bold;
  1110. background: #ffffff;
  1111. &.icon-jianhao {
  1112. border-radius: 30rpx 0 0 30rpx;
  1113. }
  1114. &.icon-jiahao {
  1115. border-radius: 0 30rpx 30rpx 0;
  1116. }
  1117. }
  1118. .btn-input {
  1119. width: 56rpx;
  1120. height: 44rpx;
  1121. line-height: 44rpx;
  1122. border-radius: 4rpx;
  1123. text-align: center;
  1124. font-size: $font-size-24;
  1125. color: #333333;
  1126. background-color: #f7f7f7;
  1127. }
  1128. }
  1129. .uni-numbox {
  1130. position: absolute;
  1131. left: 45rpx;
  1132. bottom: 0;
  1133. .uni-numbox-minus,
  1134. .uni-numbox-plus {
  1135. width: 50rpx;
  1136. line-height: 40rpx;
  1137. }
  1138. .uni-numbox-value {
  1139. font-size: $font-size-28;
  1140. width: 60rpx;
  1141. }
  1142. }
  1143. }
  1144. }
  1145. .floor-item-act {
  1146. width: 100%;
  1147. height: 30rpx;
  1148. margin-top: 8rpx;
  1149. float: left;
  1150. .tag {
  1151. display: inline-block;
  1152. height: 32rpx;
  1153. font-size: 22rpx;
  1154. line-height: 30rpx;
  1155. text-align: center;
  1156. color: #f83c6c;
  1157. float: left;
  1158. margin-right: 10rpx;
  1159. &.tag-02 {
  1160. width: 80rpx;
  1161. background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png) top center
  1162. no-repeat;
  1163. background-size: contain;
  1164. }
  1165. &.tag-01 {
  1166. width: 56rpx;
  1167. color: #fff;
  1168. background-color: #f83c6c;
  1169. border-radius: 4rpx;
  1170. }
  1171. }
  1172. }
  1173. }
  1174. }
  1175. .failure-list {
  1176. width: 702rpx;
  1177. height: auto;
  1178. padding: 0 24rpx;
  1179. margin-top: 20rpx;
  1180. background: #ffffff;
  1181. .failure-title {
  1182. width: 100%;
  1183. height: 82rpx;
  1184. line-height: 82rpx;
  1185. font-size: $font-size-28;
  1186. border-bottom: 1px solid #ebebeb;
  1187. .title-txt {
  1188. float: left;
  1189. color: #666666;
  1190. text-align: left;
  1191. }
  1192. .title-btn {
  1193. float: right;
  1194. color: $color-system;
  1195. text-align: right;
  1196. line-height: 80rpx;
  1197. .butto {
  1198. display: inline-block;
  1199. padding: 0 15rpx;
  1200. font-size: $font-size-26;
  1201. height: 50rpx;
  1202. line-height: 50rpx;
  1203. border-radius: 30rpx;
  1204. background: #fff8fd;
  1205. border: 1px solid #ff457b;
  1206. color: #ff457b;
  1207. margin-top: 15rpx;
  1208. }
  1209. }
  1210. }
  1211. .productlist {
  1212. padding-top: 10rpx;
  1213. .goods-pros {
  1214. width: 100%;
  1215. height: auto;
  1216. padding: 20rpx 0;
  1217. }
  1218. .goods-pros-t {
  1219. display: flex;
  1220. align-items: center;
  1221. width: 100%;
  1222. height: 210rpx;
  1223. position: relative;
  1224. .img-tip {
  1225. display: block;
  1226. width: 72rpx;
  1227. height: 36rpx;
  1228. line-height: 36rpx;
  1229. font-size: $font-size-24;
  1230. text-align: center;
  1231. color: #ffffff;
  1232. border-radius: 24rpx;
  1233. background: rgba(51, 51, 51, 0.3);
  1234. // position: absolute;
  1235. // left: 0;
  1236. // top: 0;
  1237. }
  1238. .checkbox-box {
  1239. padding: 10rpx;
  1240. }
  1241. .pros-img {
  1242. width: 180rpx;
  1243. height: 100%;
  1244. border-radius: 10rpx;
  1245. margin: 0 20rpx;
  1246. border: 1px solid #f3f3f3;
  1247. position: relative;
  1248. image {
  1249. width: 100%;
  1250. height: 100%;
  1251. border-radius: 10rpx;
  1252. }
  1253. }
  1254. .pros-marks {
  1255. width: 730rpx;
  1256. height: 250rpx;
  1257. z-index: 90;
  1258. background: rgba(0, 0, 0, 0.05);
  1259. position: absolute;
  1260. left: -20rpx;
  1261. top: -20rpx;
  1262. }
  1263. }
  1264. .goods-pros-b {
  1265. width: 622rpx;
  1266. margin-left: 84rpx;
  1267. height: 40rpx;
  1268. padding: 0 0 26rpx 0;
  1269. // border-top: 1px solid #EBEBEB;
  1270. &.show {
  1271. display: block;
  1272. }
  1273. &.none {
  1274. display: none;
  1275. }
  1276. .sum {
  1277. font-size: $font-size-28;
  1278. line-height: 40rpx;
  1279. color: $text-color;
  1280. display: flex;
  1281. justify-content: flex-end;
  1282. .money {
  1283. color: #ff2a2a;
  1284. font-size: $font-size-28;
  1285. }
  1286. .money-sign {
  1287. font-size: $font-size-24;
  1288. color: #ff2a2a;
  1289. }
  1290. }
  1291. }
  1292. .pros-product {
  1293. width: 402rpx;
  1294. height: 100%;
  1295. line-height: 36rpx;
  1296. font-size: $font-size-28;
  1297. position: relative;
  1298. .producttitle {
  1299. width: 100%;
  1300. display: inline-block;
  1301. height: auto;
  1302. text-overflow: ellipsis;
  1303. display: -webkit-box;
  1304. word-break: break-all;
  1305. -webkit-box-orient: vertical;
  1306. -webkit-line-clamp: 2;
  1307. overflow: hidden;
  1308. margin-bottom: 8rpx;
  1309. .no-text {
  1310. display: inline-block;
  1311. height: 36rpx;
  1312. padding: 0 12rpx;
  1313. line-height: 36rpx;
  1314. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1315. border-radius: 18rpx;
  1316. text-align: center;
  1317. color: #ffffff;
  1318. font-size: $font-size-28;
  1319. margin-right: 24rpx;
  1320. }
  1321. }
  1322. .productspec {
  1323. height: 36rpx;
  1324. color: #999999;
  1325. font-size: $font-size-26;
  1326. margin-top: 20rpx;
  1327. }
  1328. .productstate {
  1329. font-size: $font-size-28;
  1330. height: 44rpx;
  1331. color: #ff2a2a;
  1332. position: absolute;
  1333. bottom: 0;
  1334. left: 0;
  1335. }
  1336. }
  1337. }
  1338. }
  1339. .footer {
  1340. width: 100%;
  1341. background-color: #ffffff;
  1342. height: 100rpx;
  1343. position: fixed;
  1344. bottom: 0rpx;
  1345. z-index: 100;
  1346. .footer-le {
  1347. width: 520rpx;
  1348. height: 100%;
  1349. padding: 10rpx 24rpx;
  1350. float: left;
  1351. box-sizing: border-box;
  1352. .foot-check {
  1353. width: 100rpx;
  1354. float: left;
  1355. line-height: 80rpx;
  1356. font-size: $font-size-24;
  1357. .checkbox {
  1358. width: 40rpx;
  1359. text-align: center;
  1360. }
  1361. .text {
  1362. width: 60rpx;
  1363. float: right;
  1364. }
  1365. }
  1366. .sum {
  1367. width: 360rpx;
  1368. height: 100%;
  1369. float: right;
  1370. box-sizing: border-box;
  1371. padding: 0 10rpx;
  1372. .sum-price {
  1373. text-align: right;
  1374. width: 100%;
  1375. height: 80rpx;
  1376. line-height: 80rpx;
  1377. font-size: $font-size-30;
  1378. color: $text-color;
  1379. float: left;
  1380. font-weight: normal;
  1381. .money {
  1382. color: $color-system;
  1383. }
  1384. .money-sign {
  1385. font-size: $font-size-24;
  1386. color: $color-system;
  1387. }
  1388. }
  1389. }
  1390. }
  1391. .footer-ri {
  1392. width: 230rpx;
  1393. height: 100%;
  1394. float: right;
  1395. display: flex;
  1396. justify-content: space-between;
  1397. align-items: center;
  1398. z-index: 999;
  1399. box-sizing: border-box;
  1400. padding: 13rpx 15rpx;
  1401. &.none {
  1402. display: none;
  1403. }
  1404. .btn {
  1405. width: 200rpx;
  1406. height: 100%;
  1407. background: $btn-confirm;
  1408. font-size: $font-size-28;
  1409. line-height: 80rpx;
  1410. color: #ffffff;
  1411. display: flex;
  1412. border-radius: 40rpx;
  1413. justify-content: center;
  1414. align-items: center;
  1415. }
  1416. }
  1417. .footer-del {
  1418. width: 420rpx;
  1419. height: 100rpx;
  1420. position: absolute;
  1421. padding-left: 200rpx;
  1422. background: #ffffff;
  1423. right: 0;
  1424. top: 0;
  1425. z-index: 1000;
  1426. box-sizing: border-box;
  1427. padding: 10rpx 0;
  1428. display: flex;
  1429. &.show {
  1430. animation: showDelbtn 0s linear both;
  1431. }
  1432. &.none {
  1433. animation: hideDelbtn 0s linear both;
  1434. }
  1435. .btn {
  1436. flex: 1;
  1437. margin: 0 8rpx;
  1438. height: 100%;
  1439. line-height: 80rpx;
  1440. font-size: $font-size-28;
  1441. color: #ffffff;
  1442. text-align: center;
  1443. float: left;
  1444. border-radius: 40rpx;
  1445. }
  1446. .btn.btn-cancel {
  1447. background: #f7f7f7;
  1448. color: #b2b2b2;
  1449. }
  1450. .btn.btn-confirm {
  1451. background: $btn-confirm;
  1452. color: #ffffff;
  1453. }
  1454. @keyframes showDelbtn {
  1455. 0% {
  1456. transform: translateX(0);
  1457. }
  1458. 100% {
  1459. transform: translateX(-100%);
  1460. }
  1461. }
  1462. @keyframes hideDelbtn {
  1463. 0% {
  1464. transform: translateX(-100%);
  1465. }
  1466. 100% {
  1467. transform: translateX(0);
  1468. }
  1469. }
  1470. }
  1471. }
  1472. </style>