cart.vue 36 KB

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