cart.vue 36 KB

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