cart.vue 37 KB

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