cart.vue 39 KB

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