com.kailaimei.carbon/pages/contribution/contribution.vue

112 lines
2.7 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">
<!-- 头部 -->
<view class="header">
<view class="logo">
<image src="/static/logo.png" mode="widthFix"></image>
</view>
<view class="title">
<image src="/static/count-title.png" mode="widthFix"></image>
</view>
<view class="position">
<image src="/static/icon-home.png" mode="widthFix"></image>
</view>
</view>
<!-- 计算器 -->
<view class="calculator-bg">
<view class="bg-img">
<image src="/static/count-bg.png" mode="widthFix"></image>
</view>
<view class="calculator calculator-other" style="padding-top: 0;">
<view class="iframe-box">
<iframe src="https://www.baidu.com" frameborder="0"></iframe>
</view>
<view class="nav-btns" style="margin-top: 30px;">
<view class="btn" @tap="toPage('/pages/count/count')">
<image src="/static/icon-tabbar-01.png" mode="heightFix"></image>
</view>
<view class="btn" @tap="toPage('/pages/assess/assess')">
<image src="/static/icon-tabbar-02.png" mode="heightFix"></image>
</view>
<view class="btn active" @tap="toPage('/pages/eliminate/eliminate')">
<image src="/static/icon-tabbar-03.png" mode="heightFix"></image>
</view>
</view>
</view>
</view>
<!-- 轮播 -->
<view class="banner">
<swiper-pull></swiper-pull>
</view>
<!-- 底部 -->
<view class="footer">
<text>中国绿色碳汇基金会低碳旅游专项基金监制北京凯来美气候技术咨询有限公司开发</text>
</view>
</view>
</template>
<script>
import swiperPull from '@/components/swiper/swiper-pull.vue';
export default {
components: {
swiperPull
},
data() {
return {
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
member: 0, //家庭成员
total: 0, //总计
subTotal: [], //小计
}
},
onLoad(op) {
if (op.total) {
this.total = op.total;
}
if (uni.getStorageSync('subTotal')) {
this.subTotal = uni.getStorageSync('subTotal');
}
},
methods: {
//跳转
toPage(url) {
if (url == '/pages/count/count') {
uni.reLaunch({
url: url
})
}
if (url == '/pages/assess/assess') {
if (uni.getStorageSync('subTotal')) {
uni.navigateTo({
url: `${url}?total=${this.total}`
})
} else {
uni.showToast({
title: '请先计算碳足迹',
icon: 'none',
duration: 2000
})
}
}
if (url == '/pages/eliminate/eliminate') {
if (uni.getStorageSync('average')) {
uni.navigateTo({
url: `${url}?total=${this.total}`
})
} else {
uni.showToast({
title: '请先评估碳足迹',
icon: 'none',
duration: 2000
})
}
}
}
}
}
</script>
<style>
</style>