cart.vue 36 KB

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