endRecharge.vue 3.66 KB

<template>
  <div>

    <div class="car_charge_bg">

    </div>

    <!--<van-button class="bg_title" type="primary" size="mini">集团车辆点击此处验证</van-button>-->

    <van-cell-group>
      <van-cell title="充电总费用" value="4.20元" size="large"/>
      <van-cell title="充值金额" value="10.00元" size="large"/>
      <van-cell title="充电总服务费" value="2.30元" size="large"/>

      <van-cell title="剩余金额" value="1.30元" size="large"/>
      <van-cell title="充电总时长" value="2小时" size="large"/>

      <van-cell title="充电单价" value="1.20元/小时" size="large"/>
      <van-cell title="充电服务费" value="0.30元/小时" size="large"/>
      <van-cell title="充电平均功率" value="100KW" size="large"/>
      <van-cell title="充电编码" value="1011111" label="结束充电后自动退款剩余金额" size="large"/>
    </van-cell-group>

    <!--<div>-->
      <!--<p style="padding-left: 16px;">-->
        <!--&lt;!&ndash;<span style="font-size: 16px;">请选择充电金额</span>&ndash;&gt;-->
        <!--<span style="font-size: 14px; color: #999;">充电完成后自动退款剩余金额</span>-->
      <!--</p>-->

    <!--</div>-->


    <!--<van-grid :gutter="16">-->
      <!--<van-grid-item v-for="(value, index) in moneyList" :key="value" :text="value+'元'"-->
                     <!--:class="{'activeColor':index==currentIndex}" @click="moneyChage(index)"/>-->
    <!--</van-grid>-->


    <div style="padding: 25px 16px">
      <van-button type="primary" block>结束充电</van-button>

    </div>


  </div>
</template>

<script>

import { swiperQuery } from "../api/navigation/navigation";
export default {
  name: "endRecharge",
  data() {
    return {
      currentIndex: 0,
      moneyList: [
        "10", "20", "30", "50", "80", "100", "150", "200"
      ],
      carNumber: "",  // 车牌号码
      carWrapBG: 0,// 车牌颜色
      swiperData: [] // 轮播数据
    };
  },
  mounted() {
    this.carNumber = this.$route.query.carNumber;  // 车牌号码
    this.carWrapBG = this.$route.query.carNumberColor; // 车牌颜色
    console.log(this.carNumber);
  },
  created() {
    this.initSWiper();
  },
  methods: {
    moneyChage(_index) {
      this.currentIndex = _index;
    },
    initSWiper() {
      var salt = this.$utils.myCommonSalt(32);
      var jsondata = {
        app_id: this.$utils.myVarAppid,
        deviceInfo: this.$utils.myDeviceInfo,
        salt: salt,
        sign_type: "md5",
        sign: "1",
        orgId: this.$utils.myOrgId,
        jumpType: "8"
      };
      // jsondata = JSON.stringify(jsondata);
      swiperQuery(jsondata).then(res => {
        this.swiperData = res.data;
        console.log(this.swiperData);
      });
    },
    openImgUrl(i) { // 点击图片跳转
      window.open(i.jumpUrl);
    },
    toPlateNumber() { //  前往输入车牌页面
      this.$router.push({
          path: "plateNumber"
        }
      );
    },
    toParkRecord() { //  前往停车记录页面
      this.$router.push({
        path: "parkRecord",
        query: {
          carNumber: this.carNumber,
          carNumberColor: this.carWrapBG
        }
      });
    }
  }
};
</script>

<style scoped>
  .car_charge_bg {
    width: 120px;
    height: 120px;
    margin: 25px auto;
    background: url("../assets/images/car.png") no-repeat;
    background-size: 100% 100%;
    position: relative;
  }
  .bg_title{
    position: absolute;
    top:20px;
    right: 16px;
  }

  >>> .van-grid-item__text {
    font-size: 18px;
  }

  .activeColor >>> .van-grid-item__content {
    border: 1px solid #01CF97;
  }

  .activeColor >>> .van-grid-item__text {
    color: #01CF97 !important;
  }

</style>