com.kailaimei.carbon/pages/eliminate/eliminate.vue

90 lines
2.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="main">
<!-- 头部 -->
<status-nav></status-nav>
<!-- 消除碳足迹 -->
<view class="calculator-bg">
<view class="bg-img">
<image src="/static/count-bg.png" mode="widthFix"></image>
</view>
<view class="calculator calculator-other">
<view class="eliminate">
<view class="eliminate-title">
<image src="/static/icon-title-03.png" mode="heightFix"></image>
</view>
<view class="tips">
<view class="item">
您全家一年的碳足迹碳排放<text>{{total}}</text>kg人均碳足迹为<text>{{average}}</text>kg
</view>
<view class="item">
消除掉您的家庭碳足迹需要指数<text>{{treeNum.toFixed(2)}}</text>您需要捐款<text>{{money.toFixed(2)}}</text>元人民币用于中国绿色碳汇基金会低碳旅游专项基金
</view>
<view class="item">
谢谢您在应对气候变化方面所做的贡献您是一位有责任的的人
</view>
</view>
<view class="eliminate-img">
<image src="/static/eliminate.png" mode="heightFix"></image>
<view class="payment-btn" @tap="toEliminate">
<image src="/static/icon-tabbar-04.png" mode="heightFix"></image>
</view>
</view>
</view>
<!-- 导航 -->
<tabbar :current='2'></tabbar>
</view>
</view>
<!-- 轮播 -->
<view class="banner">
<swiper-pull></swiper-pull>
</view>
<!-- 底部 -->
<view class="footer">
<text>中国绿色碳汇基金会低碳旅游专项基金监制北京凯来美气候技术咨询有限公司开发</text>
</view>
</view>
</template>
<script>
import statusNav from '@/components/status-nav/status-nav.vue';
import tabbar from '@/components/tabbar/tabbar.vue';
import swiperPull from '@/components/swiper/swiper-pull.vue';
export default {
components: {
statusNav,
tabbar,
swiperPull
},
data() {
return {
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
member: 0, //家庭成员
total: 0, //总计
average: 0, //平均值
treeNum: 0, //树数量
money: 0, //捐款额
}
},
onLoad() {
if (uni.getStorageSync('allTotal') && uni.getStorageSync('average')) {
this.total = uni.getStorageSync('allTotal');
this.average = uni.getStorageSync('average');
this.treeNum = this.average/220.00*1;
this.money = this.treeNum*30.25*1
}
},
methods: {
// 去捐款
toEliminate() {
uni.navigateTo({
url: `/pages/contribution/contribution?money=${this.money}`
})
},
}
}
</script>
<style>
</style>