cart.vue 37 KB

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