饿了么底部栏

 

底部栏

<template>

  <div class="tab">

    <div class="chart">

      <div class="circle">

        <img src="@/assets/SVG/shopping_cart.svg" alt="" @click="changeCart" />

      </div>

    </div>

    <p class="money">¥ {{goodsData}} </p>

    <p class="fee">另需配送费¥4元</p>

    <p class="low">{{paySeic}} </p>

  </div>

</template>

<script>

import bus from "@/eventBus.js";


 

export default {

  name:'TabBar',

  data(){

    return{

      goodsData:0

    }

  },

  methods:{

    changeCart() {

      this.$store.commit("showCart");

     

    },

  },

  created(){

    bus.$on("shareComputed", (val) =>{

      this.goodsData = val;

     

    } );

    bus.$on('totalMony' ,(val) =>{

      this.goodsData = val;

    })

  },

  computed:{

    paySeic(){

      if(this.goodsData === 0){

        return  `¥${20}元起送 `

      }

      else if(this.goodsData < 20){

        let index = 20 - this.goodsData

        return `还差¥${index}元起送 `

        }else{

          return `去结算`

        }

    }

  }

}

</script>

<style lang="less" scoped>

.tab {

  background-color: #141d27;

  height: 50px;

  width: 100%;

  position: fixed;

  bottom: 0;

   color: aliceblue;

   z-index: 61;

  .chart {

    position: absolute;

    top: -12px;

    width: 44px;

    height: 44px;

    left: 18px;

    border-radius: 50%;

    background-color: #141d27;

    .circle {

      position: absolute;

      left: 5px;

      top: 5px;

      width: 36px;

      line-height: 40px;

      text-align: center;

      height: 36px;

      border-radius: 50%;

      background-color: rgba(255, 255, 255, 0.4);

      img {

        width: 20px;

        height: 20px;

    }

    }

  }

  .money{

     position: absolute;

     left: 80px;

     bottom: 20px;

    font-size: 16px;

    font-weight:700;

  }

  .fee{

      width: 100px;

      margin-left: 140px;

      font-size:12px ;

      margin-top:15px ;

     

  }

  .low{

      right: 0;

      bottom: 0;

      height: 50px;

      width:90px ;

      line-height: 50px;

      position: absolute;

      text-align: center;

      background-color:rgba(255, 255, 255, 0.4) ;

  }

}

</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值