代码优化完成
|
@ -45,6 +45,34 @@ image{
|
||||||
margin: 33px auto;
|
margin: 33px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 导航 */
|
||||||
|
.calculator .nav-btns{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 46px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.calculator .nav-btns .btn{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 271px;
|
||||||
|
height: 73px;
|
||||||
|
background-image: url('/static/icon-tabbar.png');
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
.calculator .nav-btns .btn.active{
|
||||||
|
background-image: url('/static/icon-tabbar-active.png');
|
||||||
|
}
|
||||||
|
.calculator .nav-btns .btn image{
|
||||||
|
height: 27px;
|
||||||
|
margin-top: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 尾部 */
|
/* 尾部 */
|
||||||
.footer{
|
.footer{
|
||||||
background-color: #31742f;
|
background-color: #31742f;
|
||||||
|
@ -77,12 +105,13 @@ image{
|
||||||
height: 350px;
|
height: 350px;
|
||||||
}
|
}
|
||||||
.calculator{
|
.calculator{
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fcfbd2;
|
||||||
|
}
|
||||||
|
.calculator .count{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 100%;
|
|
||||||
padding-top: 47px;
|
|
||||||
background-color: #fcfbd2;
|
|
||||||
}
|
}
|
||||||
.calculator .cate{
|
.calculator .cate{
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -228,13 +257,25 @@ image{
|
||||||
.interface .result .total .item view:first-child{
|
.interface .result .total .item view:first-child{
|
||||||
letter-spacing: 5px;
|
letter-spacing: 5px;
|
||||||
}
|
}
|
||||||
.interface .result .item view input{
|
.interface .result .item view .input{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
/* white-space: nowrap;
|
/* white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
direction: rtl */;
|
direction: rtl */;
|
||||||
}
|
}
|
||||||
|
.interface .result .item view .input.blur{
|
||||||
|
animation: opacity_name 0.8s linear alternate infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes opacity_name {
|
||||||
|
from {
|
||||||
|
opacity: .1;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 计算器按钮 */
|
/* 计算器按钮 */
|
||||||
.interface-btns{
|
.interface-btns{
|
||||||
|
@ -299,7 +340,7 @@ image{
|
||||||
|
|
||||||
/* 评估碳足迹 */
|
/* 评估碳足迹 */
|
||||||
.calculator-other{
|
.calculator-other{
|
||||||
padding: 26px 0 16px;
|
padding-top: 26px;
|
||||||
}
|
}
|
||||||
.assess,
|
.assess,
|
||||||
.eliminate{
|
.eliminate{
|
||||||
|
@ -319,6 +360,11 @@ image{
|
||||||
.eliminate-title>image{
|
.eliminate-title>image{
|
||||||
height: 29px;
|
height: 29px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.assess .assess-title-other{
|
||||||
|
margin-top: -22px;
|
||||||
|
}
|
||||||
|
|
||||||
.total-num{
|
.total-num{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -357,7 +403,7 @@ image{
|
||||||
.histogram{
|
.histogram{
|
||||||
width: calc(100% - 400px);
|
width: calc(100% - 400px);
|
||||||
height: 370px;
|
height: 370px;
|
||||||
padding-top: 20px;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
.histogram .form-list{
|
.histogram .form-list{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -434,7 +480,7 @@ image{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 26px;
|
padding: 0 26px;
|
||||||
margin: 15px 0 42px;
|
margin: 15px 0 15px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +520,7 @@ image{
|
||||||
}
|
}
|
||||||
.assess-contrast .assess-contrast-bg{
|
.assess-contrast .assess-contrast-bg{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 253px;
|
height: 235px;
|
||||||
background-color: rgba(252, 252, 242, .52);
|
background-color: rgba(252, 252, 242, .52);
|
||||||
}
|
}
|
||||||
.assess-contrast .line{
|
.assess-contrast .line{
|
||||||
|
@ -534,11 +580,11 @@ image{
|
||||||
.eliminate-img{
|
.eliminate-img{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 63px 26px 45px;
|
padding: 34px 26px 42px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.eliminate-img>image{
|
.eliminate-img>image{
|
||||||
height: 495px;
|
height: 460px;
|
||||||
}
|
}
|
||||||
.eliminate-img .payment-btn{
|
.eliminate-img .payment-btn{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -570,14 +616,10 @@ image{
|
||||||
}
|
}
|
||||||
.iframe-box{
|
.iframe-box{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 885px;
|
height: 818px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
.iframe-box iframe{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 查看证书 */
|
/* 查看证书 */
|
||||||
.certificate-bg{
|
.certificate-bg{
|
||||||
|
|
|
@ -1,92 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="nav-btns">
|
|
||||||
<view class="btn" :class="current==index?'active':''" @tap="toPage(index)" v-for="(item,index) in navList" :key="index">
|
|
||||||
<image :src="`/static/icon-tabbar-0${index+1}.png`" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "tabbar",
|
|
||||||
props:{
|
|
||||||
// 当前选中项
|
|
||||||
current:{
|
|
||||||
type:Number,
|
|
||||||
default:0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
navList:['/pages/count/count','/pages/assess/assess','/pages/eliminate/eliminate']
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//跳转
|
|
||||||
toPage(index) {
|
|
||||||
switch (index){
|
|
||||||
case 0:
|
|
||||||
uni.navigateTo({
|
|
||||||
url: this.navList[index]
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (uni.getStorageSync('subTotal')) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: this.navList[index]
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请先计算碳足迹',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (uni.getStorageSync('average')) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: this.navList[index]
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请先评估碳足迹',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 切换按钮 */
|
|
||||||
.calculator .nav-btns{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 46px;
|
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
.calculator .nav-btns .btn{
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 271px;
|
|
||||||
height: 73px;
|
|
||||||
background-image: url('/static/icon-tabbar.png');
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
.calculator .nav-btns .btn.active{
|
|
||||||
background-image: url('/static/icon-tabbar-active.png');
|
|
||||||
}
|
|
||||||
.calculator .nav-btns .btn image{
|
|
||||||
height: 27px;
|
|
||||||
margin-top: 9px;
|
|
||||||
}
|
|
||||||
</style>
|
|
18
pages.json
|
@ -11,24 +11,6 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "计算碳足迹"
|
"navigationBarTitleText": "计算碳足迹"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/assess/assess",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "评估碳足迹"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/eliminate/eliminate",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消除碳足迹"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/contribution/contribution",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "在线捐款"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
|
@ -1,263 +0,0 @@
|
||||||
<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="assess">
|
|
||||||
<view class="assess-title">
|
|
||||||
<image src="/static/icon-title-01.png" mode="heightFix"></image>
|
|
||||||
<view class="total-num">
|
|
||||||
<view class="num" v-for="(item,index) in showTotal" :key="index">{{item}}</view>
|
|
||||||
<image src="/static/kg.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="assess-form">
|
|
||||||
<!-- 柱状图 -->
|
|
||||||
<view class="histogram">
|
|
||||||
<view class="form-list">
|
|
||||||
<view class="form-item">
|
|
||||||
<text>{{subTotal[0]}}kg</text>
|
|
||||||
<view :style="{'height':heightList[0]}"></view>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text>{{subTotal[1]}}kg</text>
|
|
||||||
<view :style="{'height':heightList[1]}"></view>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text>{{subTotal[2]}}kg</text>
|
|
||||||
<view :style="{'height':heightList[2]}"></view>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text>{{subTotal[3]}}kg</text>
|
|
||||||
<view :style="{'height':heightList[3]}"></view>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text>{{subTotal[4]}}kg</text>
|
|
||||||
<view :style="{'height':heightList[4]}"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="form-title">
|
|
||||||
<view>
|
|
||||||
<image src="/static/icon-font-01.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<image src="/static/icon-font-02.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<image src="/static/icon-font-03.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<image src="/static/icon-font-04.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<image src="/static/icon-font-05.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 饼图 -->
|
|
||||||
<view class="pie-chart">
|
|
||||||
<l-echart ref="chart" @finished="init"></l-echart>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="assess-title">
|
|
||||||
<image src="/static/icon-title-02.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
<view class="assess-txt">
|
|
||||||
<view class="">您全家一年的碳足迹(碳排放)为<text>{{total}}</text>kg,家庭人数</view>
|
|
||||||
<view class="assess-btns">
|
|
||||||
<view class="btn" @tap="changeNum('reduce')">
|
|
||||||
<image src="/static/icon-reduce.png" mode="widthFix"></image>
|
|
||||||
</view>
|
|
||||||
<input type="number" @blur="averageEv" v-model="member">
|
|
||||||
<view class="btn" @tap="changeNum('add')">
|
|
||||||
<image src="/static/icon-add.png" mode="widthFix"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="">,人均碳足迹为<text>{{average}}</text>kg。</view>
|
|
||||||
</view>
|
|
||||||
<view class="assess-contrast">
|
|
||||||
<!-- <image src="/static/assess.png" mode="widthFix"></image> -->
|
|
||||||
<view class="assess-contrast-bg"></view>
|
|
||||||
<view class="line"></view>
|
|
||||||
<view class="list">
|
|
||||||
<view class="item">
|
|
||||||
<image src="/static/footprint.png" mode="heightFix" :style="{height:averageHeight>=235?'235px':averageHeight+'px'}"></image>
|
|
||||||
<view>您的碳足迹为</view>
|
|
||||||
<view><text>{{average}}</text>kg</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<image src="/static/footprint.png" mode="heightFix" style="height: 92px;"></image>
|
|
||||||
<view>中国人均碳足迹为</view>
|
|
||||||
<view><text>7100</text>kg</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<image src="/static/footprint.png" mode="heightFix" style="height: 207px;"></image>
|
|
||||||
<view>美国人均碳足迹为</view>
|
|
||||||
<view><text>16100</text>kg</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<image src="/static/footprint.png" mode="heightFix" style="height: 60px;"></image>
|
|
||||||
<view>全球人均碳足迹为</view>
|
|
||||||
<view><text>4700</text>kg</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<image src="/static/footprint.png" mode="heightFix" style="height: 30px;"></image>
|
|
||||||
<view>应对气候变化全球人均目标碳足迹为</view>
|
|
||||||
<view><text>2330</text>kg</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 导航 -->
|
|
||||||
<tabbar :current='1'></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';
|
|
||||||
import * as echarts from '@/uni_modules/lime-echart/static/echarts.min.js';
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
statusNav,
|
|
||||||
tabbar,
|
|
||||||
swiperPull
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
|
||||||
member: 1, //家庭成员
|
|
||||||
total: 0, //总计
|
|
||||||
subTotal: [], //小计
|
|
||||||
average: 0, //平均值
|
|
||||||
showTotal: [], //显示总计
|
|
||||||
histogram: {}, //柱状图数据
|
|
||||||
pie: {}, //饼图数据
|
|
||||||
heightList: [], //柱状高度
|
|
||||||
averageHeight:0, //足迹icon图片
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
if (uni.getStorageSync('allTotal')) {
|
|
||||||
this.total = uni.getStorageSync('allTotal');
|
|
||||||
this.showTotal = this.total.toString().split('');
|
|
||||||
// 计算平均值
|
|
||||||
this.averageEv();
|
|
||||||
}
|
|
||||||
if (uni.getStorageSync('subTotal')) {
|
|
||||||
this.subTotal = uni.getStorageSync('subTotal');
|
|
||||||
}
|
|
||||||
// 计算柱状高度
|
|
||||||
let height01 = `${(this.subTotal[0]/this.total*280).toFixed(2)}%`;
|
|
||||||
let height02 = `${(this.subTotal[1]/this.total*280).toFixed(2)}%`;
|
|
||||||
let height03 = `${(this.subTotal[2]/this.total*280).toFixed(2)}%`;
|
|
||||||
let height04 = `${(this.subTotal[3]/this.total*280).toFixed(2)}%`;
|
|
||||||
let height05 = `${(this.subTotal[4]/this.total*280).toFixed(2)}%`;
|
|
||||||
this.heightList = [height01, height02, height03, height04, height05];
|
|
||||||
// 绘制饼图
|
|
||||||
this.pieEv();
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$refs.chart.init(echarts, chart => {
|
|
||||||
chart.setOption(this.pie);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取饼图数据
|
|
||||||
pieEv() {
|
|
||||||
this.pie = {
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'item'
|
|
||||||
},
|
|
||||||
series: [{
|
|
||||||
type: 'pie',
|
|
||||||
color: [
|
|
||||||
'#a6fea5',
|
|
||||||
'#ffb0ae',
|
|
||||||
'#92dede',
|
|
||||||
'#ffdaad',
|
|
||||||
'#8888ac'
|
|
||||||
],
|
|
||||||
radius: '50%',
|
|
||||||
label: {
|
|
||||||
fontSize: 15,
|
|
||||||
color: '#000',
|
|
||||||
fontWeight: 'bold'
|
|
||||||
},
|
|
||||||
data: [{
|
|
||||||
value: this.subTotal[0],
|
|
||||||
name: `${(this.subTotal[0]/this.total*100).toFixed(2)}%`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: this.subTotal[1],
|
|
||||||
name: `${(this.subTotal[1]/this.total*100).toFixed(2)}%`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: this.subTotal[2],
|
|
||||||
name: `${(this.subTotal[2]/this.total*100).toFixed(2)}%`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: this.subTotal[3],
|
|
||||||
name: `${(this.subTotal[3]/this.total*100).toFixed(2)}%`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: this.subTotal[4],
|
|
||||||
name: `${(this.subTotal[4]/this.total*100).toFixed(2)}%`
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 绘制饼图
|
|
||||||
init() {
|
|
||||||
this.$refs.chart.init(echarts, chart => {
|
|
||||||
chart.setOption(this.pie);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// 改变数量
|
|
||||||
changeNum(type) {
|
|
||||||
if (type == 'reduce') {
|
|
||||||
if (this.member > 1) {
|
|
||||||
this.member--
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type == 'add') {
|
|
||||||
this.member++
|
|
||||||
}
|
|
||||||
// 计算平均值
|
|
||||||
this.averageEv();
|
|
||||||
},
|
|
||||||
|
|
||||||
// 计算平均值
|
|
||||||
averageEv() {
|
|
||||||
let averageNum = this.total / this.member * 1;
|
|
||||||
this.average = averageNum.toFixed(2);
|
|
||||||
this.averageHeight = Math.ceil((this.average*30)/2330*1);
|
|
||||||
uni.setStorageSync('average', this.average);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,102 +0,0 @@
|
||||||
<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" style="padding-top: 0;">
|
|
||||||
<view class="iframe-box">
|
|
||||||
<web-view :src="webViewUrl" allow></web-view>
|
|
||||||
</view>
|
|
||||||
<!-- 导航 -->
|
|
||||||
<tabbar :current='3'></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, //状态栏高度
|
|
||||||
total: 0, //总计
|
|
||||||
subTotal: [], //小计
|
|
||||||
money:0, //捐款金额
|
|
||||||
webViewUrl:'', //web-view地址
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(op) {
|
|
||||||
if(op.money){
|
|
||||||
this.webViewUrl = `http://e-file.thjj.org/tools/thjj-c.htm?cid=122104&y=0&mn=${op.money}`;
|
|
||||||
}
|
|
||||||
if (uni.getStorageSync('allTotal')) {
|
|
||||||
this.total = uni.getStorageSync('allTotal');
|
|
||||||
}
|
|
||||||
if (uni.getStorageSync('subTotal')) {
|
|
||||||
this.subTotal = uni.getStorageSync('subTotal');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onReady() {
|
|
||||||
// webView信息
|
|
||||||
let iframeInfo = {};
|
|
||||||
const query = wx.createSelectorQuery().in(this)
|
|
||||||
query.select('.iframe-box').boundingClientRect((rect) => {
|
|
||||||
iframeInfo.top = rect.top;
|
|
||||||
iframeInfo.left = rect.left;
|
|
||||||
iframeInfo.width = rect.width;
|
|
||||||
iframeInfo.height = rect.height;
|
|
||||||
}).exec()
|
|
||||||
|
|
||||||
let currentWebview = this.$scope.$getAppWebview();
|
|
||||||
setTimeout(function() {
|
|
||||||
let wv = currentWebview.children()[0];
|
|
||||||
wv.setStyle({top:iframeInfo.top,left:iframeInfo.left,width:iframeInfo.width,height:iframeInfo.height});
|
|
||||||
// wv.overrideUrlLoading({mode:"reject",match:'.*www\.thjj\.org/list.html#key.*'}, (e)=>{
|
|
||||||
// let wxCode = e.url.substr(e.url.indexOf('=')+1);
|
|
||||||
// console.log(wxCode+'微信证书编号')
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:'/pages/eliminate/eliminate'
|
|
||||||
// })
|
|
||||||
// });
|
|
||||||
// wv.addEventListener('titleUpdate',({title}) => {
|
|
||||||
// console.log(title+'标题url')
|
|
||||||
// if(title.indexOf('show.aspx?no=')!==-1){
|
|
||||||
// let zfbCode = title.substr(title.indexOf('show.aspx?no=')+1);
|
|
||||||
// console.log(zfbCode+'支付宝编号');
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:'/pages/eliminate/eliminate'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -8,6 +8,7 @@
|
||||||
<image src="/static/count-bg.png" mode="widthFix"></image>
|
<image src="/static/count-bg.png" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="calculator">
|
<view class="calculator">
|
||||||
|
<view class="count" style="padding-top: 47px;" v-if="current==0">
|
||||||
<view class="cate">
|
<view class="cate">
|
||||||
<view class="list" v-for="(item,index) in cateList" :key="index">
|
<view class="list" v-for="(item,index) in cateList" :key="index">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
|
@ -19,15 +20,15 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="interface">
|
<view class="interface">
|
||||||
<scroll-view class="result" scroll-y="true">
|
<scroll-view class="result" scroll-y="true" id="" :scroll-top="scrollTop">
|
||||||
|
<view class="message-scroll">
|
||||||
<view class="individual" v-if="cateTagList.length>0">
|
<view class="individual" v-if="cateTagList.length>0">
|
||||||
<view class="list" v-for="(item,index) in cateList" :key="index">
|
<view class="list" v-for="(item,index) in cateList" :key="index">
|
||||||
<view class="item" v-for="(item1,index1) in item" :key="index1"
|
<view class="item" v-for="(item1,index1) in item" :key="index1"
|
||||||
v-if="cateTagList.indexOf(item1.tag)!==-1">
|
v-if="cateTagList.indexOf(item1.tag)!==-1">
|
||||||
<view>{{item1.title}}</view>
|
<view>{{item1.title}}</view>
|
||||||
<view>
|
<view>
|
||||||
<input type="text" focus="true" v-model="item1.num" placeholder="0"
|
<text class="input" :class="focusIndex==index&&focusIndex1==index1?'blur':''" @tap="changeFocus(index,index1)">{{item1.num!==''?item1.num:0}}</text>
|
||||||
@tap="changeFocus(index,index1)">
|
|
||||||
</view>
|
</view>
|
||||||
<view>{{item1.company}}</view>
|
<view>{{item1.company}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -67,6 +68,7 @@
|
||||||
<view>kg</view>
|
<view>kg</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="interface-btns">
|
<view class="interface-btns">
|
||||||
<view class="num">
|
<view class="num">
|
||||||
|
@ -81,8 +83,148 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="assess" style="padding-top: 26px;" v-if="current==1">
|
||||||
|
<view class="assess-title">
|
||||||
|
<image src="/static/icon-title-01.png" mode="heightFix"></image>
|
||||||
|
<view class="total-num">
|
||||||
|
<view class="num" v-for="(item,index) in showTotal" :key="index">{{item}}</view>
|
||||||
|
<image src="/static/kg.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="assess-form">
|
||||||
|
<!-- 柱状图 -->
|
||||||
|
<view class="histogram">
|
||||||
|
<view class="form-list">
|
||||||
|
<view class="form-item">
|
||||||
|
<text>{{cacheSubTotal[0]}}kg</text>
|
||||||
|
<view :style="{'height':heightList[0]}"></view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<text>{{cacheSubTotal[1]}}kg</text>
|
||||||
|
<view :style="{'height':heightList[1]}"></view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<text>{{cacheSubTotal[2]}}kg</text>
|
||||||
|
<view :style="{'height':heightList[2]}"></view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<text>{{cacheSubTotal[3]}}kg</text>
|
||||||
|
<view :style="{'height':heightList[3]}"></view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<text>{{cacheSubTotal[4]}}kg</text>
|
||||||
|
<view :style="{'height':heightList[4]}"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-title">
|
||||||
|
<view>
|
||||||
|
<image src="/static/icon-font-01.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/icon-font-02.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/icon-font-03.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/icon-font-04.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/icon-font-05.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 饼图 -->
|
||||||
|
<view class="pie-chart">
|
||||||
|
<l-echart ref="chart" @finished="init"></l-echart>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="assess-title assess-title-other">
|
||||||
|
<image src="/static/icon-title-02.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="assess-txt">
|
||||||
|
<view class="">您全家一年的碳足迹(碳排放)为<text>{{cacheTotal}}</text>kg,家庭人数</view>
|
||||||
|
<view class="assess-btns">
|
||||||
|
<view class="btn" @tap="changeNum('reduce')">
|
||||||
|
<image src="/static/icon-reduce.png" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<input type="number" @blur="averageEv" v-model="member">
|
||||||
|
<view class="btn" @tap="changeNum('add')">
|
||||||
|
<image src="/static/icon-add.png" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="">,人均碳足迹为<text>{{average}}</text>kg。</view>
|
||||||
|
</view>
|
||||||
|
<view class="assess-contrast">
|
||||||
|
<!-- <image src="/static/assess.png" mode="widthFix"></image> -->
|
||||||
|
<view class="assess-contrast-bg"></view>
|
||||||
|
<view class="line"></view>
|
||||||
|
<view class="list">
|
||||||
|
<view class="item">
|
||||||
|
<image src="/static/footprint.png" mode="heightFix" :style="{height:averageHeight>=230?'230px':averageHeight+'px'}"></image>
|
||||||
|
<view>您的碳足迹为</view>
|
||||||
|
<view><text>{{average}}</text>kg</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<image src="/static/footprint.png" mode="heightFix" style="height: 92px;"></image>
|
||||||
|
<view>中国人均碳足迹为</view>
|
||||||
|
<view><text>7100</text>kg</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<image src="/static/footprint.png" mode="heightFix" style="height: 207px;"></image>
|
||||||
|
<view>美国人均碳足迹为</view>
|
||||||
|
<view><text>16100</text>kg</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<image src="/static/footprint.png" mode="heightFix" style="height: 60px;"></image>
|
||||||
|
<view>全球人均碳足迹为</view>
|
||||||
|
<view><text>4700</text>kg</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<image src="/static/footprint.png" mode="heightFix" style="height: 30px;"></image>
|
||||||
|
<view>应对气候变化全球人均目标碳足迹为</view>
|
||||||
|
<view><text>2330</text>kg</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="eliminate" style="padding-top: 26px;" v-if="current==2">
|
||||||
|
<view class="eliminate-title">
|
||||||
|
<image src="/static/icon-title-03.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="tips">
|
||||||
|
<view class="item">
|
||||||
|
您全家一年的碳足迹(碳排放)为<text>{{cacheTotal}}</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="changeNav(3)">
|
||||||
|
<image src="/static/icon-tabbar-04.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="payment-btn payment-btn-other" @tap="ifShow=true">
|
||||||
|
<image src="/static/icon-tabbar-05.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 在线捐款 -->
|
||||||
|
<view class="iframe-box" style="padding-top: 0;" v-if="current==3">
|
||||||
|
<web-view :src="webViewUrl" allow></web-view>
|
||||||
|
</view>
|
||||||
<!-- 导航 -->
|
<!-- 导航 -->
|
||||||
<tabbar :current='0'></tabbar>
|
<view class="nav-btns">
|
||||||
|
<view class="btn" :class="current==index?'active':''" @tap="changeNav(index)" v-for="(item,index) in navList" :key="index">
|
||||||
|
<image :src="`/static/icon-tabbar-0${index+1}.png`" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <tabbar :current='0'></tabbar> -->
|
||||||
<!-- 操作说明 -->
|
<!-- 操作说明 -->
|
||||||
<view class="explain">友情提醒:计算前请先按AC键,消除上一用户数据</view>
|
<view class="explain">友情提醒:计算前请先按AC键,消除上一用户数据</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -95,22 +237,61 @@
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<text>中国绿色碳汇基金会低碳旅游专项基金监制,北京凯来美气候科技有限公司开发。</text>
|
<text>中国绿色碳汇基金会低碳旅游专项基金监制,北京凯来美气候科技有限公司开发。</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 证书 -->
|
||||||
|
<view class="certificate-bg" v-show="ifShow" @tap.stop="ifShow=false">
|
||||||
|
<view class="certificate" @tap.stop="">
|
||||||
|
<image src="/static/certificate-bg.jpg" mode="widthFix"></image>
|
||||||
|
<view class="content">
|
||||||
|
<view class="logo">
|
||||||
|
<image src="/static/logo-01.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="txt">
|
||||||
|
<image src="/static/code-title.png" mode="heightFix"></image>
|
||||||
|
<view class="code">NO.{{code}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="msg">
|
||||||
|
<view class="item">
|
||||||
|
您是第
|
||||||
|
<view class="number">
|
||||||
|
<text v-for="(item,index) in difference">0</text>
|
||||||
|
<text>{{experients}}</text>
|
||||||
|
</view>
|
||||||
|
位体验者:
|
||||||
|
</view>
|
||||||
|
<view class="item">感谢您参与“爱绿行碳普惠”平台互动,计算碳排放量,学习节能降碳等知识,践行低碳旅游和生活新风尚,用行动守护景区美丽环境。</view>
|
||||||
|
<view class="time">{{date}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="foot">
|
||||||
|
<view class="qr">
|
||||||
|
<image src="/static/qr-alx.png" mode="widthFix"></image>
|
||||||
|
<view class="tips">扫码关注<text>爱绿行</text></view>
|
||||||
|
</view>
|
||||||
|
<view class="foot-logo">
|
||||||
|
<!-- <image src="/static/logo-02.png" mode="widthFix"></image> -->
|
||||||
|
<image src="/static/logo-03.png" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="support">技术支持:北京零碳创意科技有限公司</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import statusNav from '@/components/status-nav/status-nav.vue';
|
import statusNav from '@/components/status-nav/status-nav.vue';
|
||||||
import tabbar from '@/components/tabbar/tabbar.vue';
|
|
||||||
import swiperPull from '@/components/swiper/swiper-pull.vue';
|
import swiperPull from '@/components/swiper/swiper-pull.vue';
|
||||||
|
import * as echarts from '@/uni_modules/lime-echart/static/echarts.min.js';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
statusNav,
|
statusNav,
|
||||||
tabbar,
|
|
||||||
swiperPull
|
swiperPull
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
||||||
|
navList:['/pages/count/count','/pages/assess/assess','/pages/eliminate/eliminate'],
|
||||||
|
current:0, //当前选择
|
||||||
cateList: {
|
cateList: {
|
||||||
'衣': [{
|
'衣': [{
|
||||||
'title': '购买衣服数量',
|
'title': '购买衣服数量',
|
||||||
|
@ -322,6 +503,33 @@
|
||||||
|
|
||||||
focusIndex: '', //选中一级分类
|
focusIndex: '', //选中一级分类
|
||||||
focusIndex1: 0, //选中二级分类
|
focusIndex1: 0, //选中二级分类
|
||||||
|
|
||||||
|
// 评估碳足迹
|
||||||
|
member: 1, //家庭成员
|
||||||
|
average: 0, //平均值
|
||||||
|
cacheTotal:0, //缓存总计
|
||||||
|
cacheSubTotal:[], //缓存小计
|
||||||
|
showTotal: [], //显示总计
|
||||||
|
histogram: {}, //柱状图数据
|
||||||
|
pie: {}, //饼图数据
|
||||||
|
heightList: [], //柱状高度
|
||||||
|
averageHeight:0, //足迹icon图片
|
||||||
|
|
||||||
|
// 消除碳足迹
|
||||||
|
treeNum: 0, //树数量
|
||||||
|
money: 0, //捐款额
|
||||||
|
ifShow:false, //是否显示证书
|
||||||
|
code:'', //证书编码
|
||||||
|
experients:0, //体验者编号
|
||||||
|
difference:0, //补齐位数
|
||||||
|
date:'', //报告时间
|
||||||
|
webViewUrl:'', //web-view地址
|
||||||
|
|
||||||
|
// 双击控制
|
||||||
|
index: 0,
|
||||||
|
start_time: 0,
|
||||||
|
end_time: 0,
|
||||||
|
scrollTop:0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
@ -337,15 +545,173 @@
|
||||||
if(uni.getStorageSync('cateList')){
|
if(uni.getStorageSync('cateList')){
|
||||||
this.cateList = uni.getStorageSync('cateList');
|
this.cateList = uni.getStorageSync('cateList');
|
||||||
}
|
}
|
||||||
|
setTimeout(()=>{
|
||||||
|
const query = wx.createSelectorQuery().in(this);
|
||||||
|
query.select('.message-scroll').boundingClientRect((rect) => {
|
||||||
|
this.scrollTop = rect.height;
|
||||||
|
}).exec()
|
||||||
|
},200)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//切换页面
|
||||||
|
changeNav(index) {
|
||||||
|
switch (index){
|
||||||
|
case 0:
|
||||||
|
if(index!==this.current){
|
||||||
|
this.current = index;
|
||||||
|
if(uni.getStorageSync('cateTagList')){
|
||||||
|
this.cateTagList = uni.getStorageSync('cateTagList');
|
||||||
|
}
|
||||||
|
if(uni.getStorageSync('cacheTotal')){
|
||||||
|
this.total = uni.getStorageSync('cacheTotal');
|
||||||
|
}
|
||||||
|
if(uni.getStorageSync('cacheSubTotal')){
|
||||||
|
this.subTotal = uni.getStorageSync('cacheSubTotal');
|
||||||
|
}
|
||||||
|
if(uni.getStorageSync('cateList')){
|
||||||
|
this.cateList = uni.getStorageSync('cateList');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (uni.getStorageSync('subTotal')) {
|
||||||
|
if(index!==this.current){
|
||||||
|
this.current = index;
|
||||||
|
if (uni.getStorageSync('allTotal')) {
|
||||||
|
this.cacheTotal = uni.getStorageSync('allTotal');
|
||||||
|
this.showTotal = this.cacheTotal.toString().split('');
|
||||||
|
// 计算平均值
|
||||||
|
this.averageEv();
|
||||||
|
}
|
||||||
|
if (uni.getStorageSync('subTotal')) {
|
||||||
|
this.cacheSubTotal = uni.getStorageSync('subTotal');
|
||||||
|
}
|
||||||
|
// 计算柱状高度
|
||||||
|
let height01 = `${(this.subTotal[0]/this.total*280).toFixed(2)}%`;
|
||||||
|
let height02 = `${(this.subTotal[1]/this.total*280).toFixed(2)}%`;
|
||||||
|
let height03 = `${(this.subTotal[2]/this.total*280).toFixed(2)}%`;
|
||||||
|
let height04 = `${(this.subTotal[3]/this.total*280).toFixed(2)}%`;
|
||||||
|
let height05 = `${(this.subTotal[4]/this.total*280).toFixed(2)}%`;
|
||||||
|
this.heightList = [height01, height02, height03, height04, height05];
|
||||||
|
// 绘制饼图
|
||||||
|
this.pieEv();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先计算碳足迹',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (uni.getStorageSync('average')) {
|
||||||
|
if(index!==this.current){
|
||||||
|
this.current = index;
|
||||||
|
if(uni.getStorageSync('newUser')!=='newUser'){
|
||||||
|
if(uni.getStorageSync('experients')){
|
||||||
|
this.experients = uni.getStorageSync('experients')+1;
|
||||||
|
}else{
|
||||||
|
this.experients = 1;
|
||||||
|
}
|
||||||
|
uni.setStorageSync('experients',this.experients);
|
||||||
|
uni.setStorageSync('newUser','newUser');
|
||||||
|
}else{
|
||||||
|
this.experients = uni.getStorageSync('experients');
|
||||||
|
}
|
||||||
|
this.difference = 6-this.experients.toString().length;
|
||||||
|
if (uni.getStorageSync('allTotal') && uni.getStorageSync('average')) {
|
||||||
|
this.total = uni.getStorageSync('allTotal');
|
||||||
|
this.average = uni.getStorageSync('average');
|
||||||
|
this.treeNum = this.average/440.00*1;
|
||||||
|
this.money = this.treeNum*67.6*1;
|
||||||
|
this.webViewUrl = `http://e-file.thjj.org/tools/thjj-c.htm?cid=122104&y=0&mn=${this.money}`;
|
||||||
|
}
|
||||||
|
const date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
let hour = date.getHours();
|
||||||
|
let minute = date.getMinutes();
|
||||||
|
let second = date.getSeconds();
|
||||||
|
let random = Math.ceil(Math.random() * 99 + 1);
|
||||||
|
this.date = `${year}年${month<10?'0'+month:month}月${day<10?'0'+day:day}日`;
|
||||||
|
this.code = `${year.toString().substr(2)}${month<10?'0'+month:month}${day<10?'0'+day:day}${hour<10?'0'+hour:hour}${minute<10?'0'+minute:minute}${second<10?'0'+second:second}${random<10?'0'+random:random}`
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先评估碳足迹',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if(index!==this.current){
|
||||||
|
this.current = index;
|
||||||
|
setTimeout(()=>{
|
||||||
|
// webView信息
|
||||||
|
let iframeInfo = {};
|
||||||
|
const query = wx.createSelectorQuery().in(this)
|
||||||
|
query.select('.iframe-box').boundingClientRect((rect) => {
|
||||||
|
iframeInfo.top = rect.top;
|
||||||
|
iframeInfo.left = rect.left;
|
||||||
|
iframeInfo.width = rect.width;
|
||||||
|
iframeInfo.height = rect.height;
|
||||||
|
}).exec()
|
||||||
|
|
||||||
|
let currentWebview = this.$scope.$getAppWebview();
|
||||||
|
setTimeout(()=> {
|
||||||
|
let wv = currentWebview.children()[0];
|
||||||
|
wv.setStyle({top:iframeInfo.top,left:iframeInfo.left,width:iframeInfo.width,height:iframeInfo.height});
|
||||||
|
wv.overrideUrlLoading({mode:"reject",match:'.*www\.thjj\.org/list.html#key.*'}, (e)=>{
|
||||||
|
let wxCode = e.url.substr(e.url.indexOf('=')+1);
|
||||||
|
console.log(wxCode+'微信证书编号')
|
||||||
|
this.webViewUrl = `http://e-file.thjj.org/ajaxserv/webform/zfb/show.aspx?no=${wxCode}`;
|
||||||
|
});
|
||||||
|
wv.addEventListener('titleUpdate',({title}) => {
|
||||||
|
console.log(title+'标题url')
|
||||||
|
if(title.indexOf('show.aspx?no=')!==-1){
|
||||||
|
let zfbCode = title.substr(title.indexOf('show.aspx?no=')+1);
|
||||||
|
console.log(zfbCode+'支付宝编号');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 100);
|
||||||
|
},100)
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 选择分类
|
// 选择分类
|
||||||
changeEv(index, index1) {
|
changeEv(index, index1) {
|
||||||
|
let delIndex = this.cateTagList.indexOf(this.cateList[index][index1].tag);
|
||||||
|
this.index = this.index == 0 ? 1 : this.index + 1;
|
||||||
|
if (this.index == 1) {
|
||||||
|
this.start_time = new Date().getTime();
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.index = this.start_time = this.end_time = 0;
|
||||||
|
if(delIndex==-1){
|
||||||
this.cateTagList.push(this.cateList[index][index1].tag);
|
this.cateTagList.push(this.cateList[index][index1].tag);
|
||||||
this.focusIndex = index;
|
this.focusIndex = index;
|
||||||
this.focusIndex1 = index1;
|
this.focusIndex1 = index1;
|
||||||
// 缓存已选分类
|
// 缓存已选分类
|
||||||
uni.setStorageSync('cateTagList',this.cateTagList)
|
uni.setStorageSync('cateTagList',this.cateTagList);
|
||||||
|
}
|
||||||
|
},200)
|
||||||
|
} else if (this.index == 2) {
|
||||||
|
this.end_time = new Date().getTime();
|
||||||
|
if (this.end_time - this.start_time < 300) {
|
||||||
|
if(delIndex!==-1){
|
||||||
|
this.cateTagList.splice(delIndex,1);
|
||||||
|
this.cateList[index][index1].num = '';
|
||||||
|
this.focusIndex = '';
|
||||||
|
// 缓存已选分类
|
||||||
|
uni.setStorageSync('cateTagList',this.cateTagList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.index = this.start_time = this.end_time = 0;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取光标
|
// 获取光标
|
||||||
|
@ -404,6 +770,7 @@
|
||||||
|
|
||||||
// 计算
|
// 计算
|
||||||
calculationEv() {
|
calculationEv() {
|
||||||
|
this.focusIndex = '';
|
||||||
// 小计
|
// 小计
|
||||||
let subTotalArr1 = this.cateList['衣'].filter(item => {
|
let subTotalArr1 = this.cateList['衣'].filter(item => {
|
||||||
return item.num !== ''
|
return item.num !== ''
|
||||||
|
@ -477,6 +844,92 @@
|
||||||
|
|
||||||
// 缓存分类数组
|
// 缓存分类数组
|
||||||
uni.setStorageSync('cateList', this.cateList);
|
uni.setStorageSync('cateList', this.cateList);
|
||||||
|
|
||||||
|
// 滚动到底部
|
||||||
|
this.scrollToButtom();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 滚动到底部
|
||||||
|
scrollToButtom() {
|
||||||
|
const query = wx.createSelectorQuery().in(this);
|
||||||
|
query.select('.message-scroll').boundingClientRect((rect) => {
|
||||||
|
this.scrollTop = rect.height;
|
||||||
|
}).exec()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取饼图数据
|
||||||
|
pieEv() {
|
||||||
|
this.pie = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
type: 'pie',
|
||||||
|
color: [
|
||||||
|
'#a6fea5',
|
||||||
|
'#ffb0ae',
|
||||||
|
'#92dede',
|
||||||
|
'#ffdaad',
|
||||||
|
'#8888ac'
|
||||||
|
],
|
||||||
|
radius: '50%',
|
||||||
|
label: {
|
||||||
|
fontSize: 15,
|
||||||
|
color: '#000',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
},
|
||||||
|
data: [{
|
||||||
|
value: this.subTotal[0],
|
||||||
|
name: `${(this.subTotal[0]/this.total*100).toFixed(2)}%`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: this.subTotal[1],
|
||||||
|
name: `${(this.subTotal[1]/this.total*100).toFixed(2)}%`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: this.subTotal[2],
|
||||||
|
name: `${(this.subTotal[2]/this.total*100).toFixed(2)}%`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: this.subTotal[3],
|
||||||
|
name: `${(this.subTotal[3]/this.total*100).toFixed(2)}%`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: this.subTotal[4],
|
||||||
|
name: `${(this.subTotal[4]/this.total*100).toFixed(2)}%`
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 绘制饼图
|
||||||
|
init() {
|
||||||
|
this.$refs.chart.init(echarts, chart => {
|
||||||
|
chart.setOption(this.pie);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 改变数量
|
||||||
|
changeNum(type) {
|
||||||
|
if (type == 'reduce') {
|
||||||
|
if (this.member > 1) {
|
||||||
|
this.member--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == 'add') {
|
||||||
|
this.member++
|
||||||
|
}
|
||||||
|
// 计算平均值
|
||||||
|
this.averageEv();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 计算平均值
|
||||||
|
averageEv() {
|
||||||
|
let averageNum = this.total / this.member * 1;
|
||||||
|
this.average = averageNum.toFixed(2);
|
||||||
|
this.averageHeight = Math.ceil((this.average*30)/2330*1);
|
||||||
|
uni.setStorageSync('average', this.average);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,158 +0,0 @@
|
||||||
<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 class="payment-btn payment-btn-other" @tap="ifShow=true">
|
|
||||||
<image src="/static/icon-tabbar-05.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 class="certificate-bg" v-if="ifShow" @tap="ifShow=false">
|
|
||||||
<view class="certificate">
|
|
||||||
<image src="/static/certificate-bg.jpg" mode="widthFix"></image>
|
|
||||||
<view class="content">
|
|
||||||
<view class="logo">
|
|
||||||
<image src="/static/logo-01.png" mode="heightFix"></image>
|
|
||||||
</view>
|
|
||||||
<view class="txt">
|
|
||||||
<image src="/static/code-title.png" mode="heightFix"></image>
|
|
||||||
<view class="code">NO.{{code}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="msg">
|
|
||||||
<view class="item">
|
|
||||||
您是第
|
|
||||||
<view class="number">
|
|
||||||
<text v-for="(item,index) in difference">0</text>
|
|
||||||
<text>{{experients}}</text>
|
|
||||||
</view>
|
|
||||||
位体验者:
|
|
||||||
</view>
|
|
||||||
<view class="item">感谢您参与“爱绿行碳普惠”平台互动,计算碳排放量,学习节能降碳等知识,践行低碳旅游和生活新风尚,用行动守护景区美丽环境。</view>
|
|
||||||
<view class="time">{{date}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="foot">
|
|
||||||
<view class="qr">
|
|
||||||
<image src="/static/qr-alx.png" mode="widthFix"></image>
|
|
||||||
<view class="tips">扫码关注<text>爱绿行</text></view>
|
|
||||||
</view>
|
|
||||||
<view class="foot-logo">
|
|
||||||
<!-- <image src="/static/logo-02.png" mode="widthFix"></image> -->
|
|
||||||
<image src="/static/logo-03.png" mode="widthFix"></image>
|
|
||||||
</view>
|
|
||||||
<view class="support">技术支持:北京零碳创意科技有限公司</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</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, //捐款额
|
|
||||||
ifShow:false, //是否显示证书
|
|
||||||
code:'', //证书编码
|
|
||||||
experients:0, //体验者编号
|
|
||||||
difference:0, //补齐位数
|
|
||||||
date:'', //报告时间
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
if(uni.getStorageSync('newUser')!=='newUser'){
|
|
||||||
if(uni.getStorageSync('experients')){
|
|
||||||
this.experients = uni.getStorageSync('experients')+1;
|
|
||||||
}else{
|
|
||||||
this.experients = 1;
|
|
||||||
}
|
|
||||||
uni.setStorageSync('experients',this.experients);
|
|
||||||
uni.setStorageSync('newUser','newUser');
|
|
||||||
}else{
|
|
||||||
this.experients = uni.getStorageSync('experients');
|
|
||||||
}
|
|
||||||
this.difference = 6-this.experients.toString().length;
|
|
||||||
|
|
||||||
if (uni.getStorageSync('allTotal') && uni.getStorageSync('average')) {
|
|
||||||
this.total = uni.getStorageSync('allTotal');
|
|
||||||
this.average = uni.getStorageSync('average');
|
|
||||||
this.treeNum = this.average/440.00*1;
|
|
||||||
this.money = this.treeNum*67.6*1
|
|
||||||
}
|
|
||||||
const date = new Date();
|
|
||||||
let year = date.getFullYear();
|
|
||||||
let month = date.getMonth() + 1;
|
|
||||||
let day = date.getDate();
|
|
||||||
let hour = date.getHours();
|
|
||||||
let minute = date.getMinutes();
|
|
||||||
let second = date.getSeconds();
|
|
||||||
let random = Math.ceil(Math.random() * 99 + 1);
|
|
||||||
this.date = `${year}年${month<10?'0'+month:month}月${day<10?'0'+day:day}日`;
|
|
||||||
this.code = `${year.toString().substr(2)}${month<10?'0'+month:month}${day<10?'0'+day:day}${hour<10?'0'+hour:hour}${minute<10?'0'+minute:minute}${second<10?'0'+second:second}${random<10?'0'+random:random}`
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 去捐款
|
|
||||||
toEliminate() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/contribution/contribution?money=${this.money}`
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -38,12 +38,12 @@
|
||||||
}
|
}
|
||||||
// 赋值MAC
|
// 赋值MAC
|
||||||
this.macStr = finalMac;
|
this.macStr = finalMac;
|
||||||
// #endif
|
|
||||||
if(this.allowMac.includes(this.macStr)){
|
if(this.allowMac.includes(this.macStr)){
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:'/pages/count/count'
|
url:'/pages/count/count'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
https://ide.dcloud.net.cn/build/download/e4cf4290-a39e-11ed-bf60-f5413aaa0b54
|
|
|
@ -1 +0,0 @@
|
||||||
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
|
|
|
@ -1,3 +0,0 @@
|
||||||
andrCertfile=D:/HbuilderX/HBuilderX/plugins/app-safe-pack/Test.keystore
|
|
||||||
andrCertAlias=android
|
|
||||||
andrCertPass=ep/Tdjka4Y7WYqDB6/S7dw==
|
|
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.0 KiB |
|
@ -1,25 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-CN">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<script>
|
|
||||||
var __UniViewStartTime__ = Date.now();
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
||||||
CSS.supports('top: constant(a)'))
|
|
||||||
document.write(
|
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<title>View</title>
|
|
||||||
<link rel="stylesheet" href="view.css" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="__uniappes6.js"></script>
|
|
||||||
<script src="view.umd.min.js"></script>
|
|
||||||
<script src="app-view.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,8 +0,0 @@
|
||||||
|
|
||||||
var isReady=false;var onReadyCallbacks=[];
|
|
||||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
|
||||||
var __uniConfig = {"pages":["pages/index/index","pages/count/count","pages/assess/assess","pages/eliminate/eliminate","pages/contribution/contribution"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"碳足迹计算器","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","titleNView":false,"bounce":"none","scrollIndicator":"none"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"碳足迹计算器","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
|
||||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"设备判断"}},{"path":"/pages/count/count","meta":{},"window":{"navigationBarTitleText":"计算碳足迹"}},{"path":"/pages/assess/assess","meta":{},"window":{"navigationBarTitleText":"评估碳足迹"}},{"path":"/pages/eliminate/eliminate","meta":{},"window":{"navigationBarTitleText":"消除碳足迹"}},{"path":"/pages/contribution/contribution","meta":{},"window":{"navigationBarTitleText":"在线捐款"}}];
|
|
||||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
|
||||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
|
||||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
|
|
@ -1 +0,0 @@
|
||||||
(function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);f&&f(r);while(s.length)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var p=t[i];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={"app-config":0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonp"]=this["webpackJsonp"]||[],p=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var f=p;t()})([]);
|
|
Before Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 198 KiB |
|
@ -1 +0,0 @@
|
||||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__DB95977","name":"碳足迹计算器","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"},"prerendered":"false"}},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"ol.kailaimei.ceshi","aliasname":"","password":"","keystore":"html5plus://test","custompermissions":true},"apple":{"dSYMs":false,"devices":"universal"},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"orientation":"portrait-primary"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.6.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html","adid":"124662120805"}}
|
|
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 290 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 941 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 200 KiB |
|
@ -1,129 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport"
|
|
||||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title></title>
|
|
||||||
<style type="text/css">
|
|
||||||
html,
|
|
||||||
body,
|
|
||||||
.canvas {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
overflow-y: hidden;
|
|
||||||
background-color: transparent;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="canvas" id="limeChart"></div>
|
|
||||||
<script type="text/javascript" src="./uni.webview.1.5.3.js"></script>
|
|
||||||
<script type="text/javascript" src="./echarts.min.js"></script>
|
|
||||||
<script type="text/javascript" src="./ecStat.min.js"></script>
|
|
||||||
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-liquidfill@latest/dist/echarts-liquidfill.min.js"></script> -->
|
|
||||||
<script>
|
|
||||||
let chart = null;
|
|
||||||
let cache = [];
|
|
||||||
console.log = function(...agrs) {
|
|
||||||
postMessage(agrs)
|
|
||||||
}
|
|
||||||
function emit(event, data) {
|
|
||||||
let dataStr = JSON.stringify(data, stringify)
|
|
||||||
postMessage({
|
|
||||||
event,
|
|
||||||
data: dataStr
|
|
||||||
})
|
|
||||||
cache = []
|
|
||||||
}
|
|
||||||
function postMessage(data) {
|
|
||||||
uni.postMessage({
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function stringify(key, value) {
|
|
||||||
if (typeof value === 'object' && value !== null) {
|
|
||||||
if (cache.indexOf(value) !== -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cache.push(value);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
function parse(name, callback, options) {
|
|
||||||
const optionNameReg = /[\w]+\.setOption\(([\w]+\.)?([\w]+)\)/
|
|
||||||
if (optionNameReg.test(callback)) {
|
|
||||||
const optionNames = callback.match(optionNameReg)
|
|
||||||
if(optionNames[1]) {
|
|
||||||
const _this = optionNames[1].split('.')[0]
|
|
||||||
window[_this] = {}
|
|
||||||
window[_this][optionNames[2]] = options
|
|
||||||
return optionNames[2]
|
|
||||||
} else {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
function init(callback, options, opts = {}, theme = null) {
|
|
||||||
if(!chart) {
|
|
||||||
chart = echarts.init(document.getElementById('limeChart'), theme, opts)
|
|
||||||
if(options) {
|
|
||||||
chart.setOption(options)
|
|
||||||
}
|
|
||||||
// const name = parse('a', callback, options)
|
|
||||||
// console.log('options::', callback)
|
|
||||||
// if(name) this[name] = options
|
|
||||||
// eval(`a = ${callback};`)
|
|
||||||
// if(a) {a(chart)}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setChart(callback, options) {
|
|
||||||
if(!callback) return
|
|
||||||
if(chart && callback && options) {
|
|
||||||
var r = null
|
|
||||||
const name = parse('r', callback, options)
|
|
||||||
if(name) this[name] = options
|
|
||||||
eval(`r = ${callback};`)
|
|
||||||
if(r) {r(chart)}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function setOption(data) {
|
|
||||||
if (chart) chart.setOption(data[0], data[1])
|
|
||||||
}
|
|
||||||
function showLoading(data) {
|
|
||||||
if (chart) chart.showLoading(data[0], data[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideLoading() {
|
|
||||||
if (chart) chart.hideLoading()
|
|
||||||
}
|
|
||||||
|
|
||||||
function clear() {
|
|
||||||
if (chart) chart.clear()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function dispose() {
|
|
||||||
if (chart) chart.dispose()
|
|
||||||
}
|
|
||||||
function resize(size) {
|
|
||||||
if (chart) chart.resize(size)
|
|
||||||
}
|
|
||||||
|
|
||||||
function canvasToTempFilePath(opt = {}) {
|
|
||||||
if (chart) {
|
|
||||||
const src = chart.getDataURL(opt)
|
|
||||||
postMessage({
|
|
||||||
file: true,
|
|
||||||
data: src
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
var isReady=false;var onReadyCallbacks=[];
|
var isReady=false;var onReadyCallbacks=[];
|
||||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||||
var __uniConfig = {"pages":["pages/index/index","pages/count/count","pages/assess/assess","pages/eliminate/eliminate","pages/contribution/contribution"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"碳足迹计算器","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","titleNView":false,"bounce":"none","scrollIndicator":"none"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"碳足迹计算器","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
var __uniConfig = {"pages":["pages/index/index","pages/count/count"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"碳足迹计算器","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","titleNView":false,"bounce":"none","scrollIndicator":"none"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"碳足迹计算器","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"设备判断"}},{"path":"/pages/count/count","meta":{},"window":{"navigationBarTitleText":"计算碳足迹"}},{"path":"/pages/assess/assess","meta":{},"window":{"navigationBarTitleText":"评估碳足迹"}},{"path":"/pages/eliminate/eliminate","meta":{},"window":{"navigationBarTitleText":"消除碳足迹"}},{"path":"/pages/contribution/contribution","meta":{},"window":{"navigationBarTitleText":"在线捐款"}}];
|
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"设备判断"}},{"path":"/pages/count/count","meta":{},"window":{"navigationBarTitleText":"计算碳足迹"}}];
|
||||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
var isReady=false;var onReadyCallbacks=[];
|
var isReady=false;var onReadyCallbacks=[];
|
||||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||||
var __uniConfig = {"pages":["pages/index/index","pages/count/count","pages/assess/assess","pages/eliminate/eliminate","pages/contribution/contribution"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"碳足迹计算器","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","titleNView":false,"bounce":"none","scrollIndicator":"none"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"碳足迹计算器","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
var __uniConfig = {"pages":["pages/index/index","pages/count/count"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"碳足迹计算器","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","titleNView":false,"bounce":"none","scrollIndicator":"none"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"碳足迹计算器","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"设备判断"}},{"path":"/pages/count/count","meta":{},"window":{"navigationBarTitleText":"计算碳足迹"}},{"path":"/pages/assess/assess","meta":{},"window":{"navigationBarTitleText":"评估碳足迹"}},{"path":"/pages/eliminate/eliminate","meta":{},"window":{"navigationBarTitleText":"消除碳足迹"}},{"path":"/pages/contribution/contribution","meta":{},"window":{"navigationBarTitleText":"在线捐款"}}];
|
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"设备判断"}},{"path":"/pages/count/count","meta":{},"window":{"navigationBarTitleText":"计算碳足迹"}}];
|
||||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
||||||
|
|
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.0 KiB |
|
@ -1,25 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-CN">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<script>
|
|
||||||
var __UniViewStartTime__ = Date.now();
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
||||||
CSS.supports('top: constant(a)'))
|
|
||||||
document.write(
|
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<title>View</title>
|
|
||||||
<link rel="stylesheet" href="view.css" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="__uniappes6.js"></script>
|
|
||||||
<script src="view.umd.min.js"></script>
|
|
||||||
<script src="app-view.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,8 +0,0 @@
|
||||||
|
|
||||||
var isReady=false;var onReadyCallbacks=[];
|
|
||||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
|
||||||
var __uniConfig = {"pages":["pages/index/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"app-demo","compilerVersion":"3.6.15","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
|
||||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"uni-app"}}];
|
|
||||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
|
||||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
|
||||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
|
|
@ -1 +0,0 @@
|
||||||
(function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);f&&f(r);while(s.length)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var p=t[i];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={"app-config":0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonp"]=this["webpackJsonp"]||[],p=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var f=p;t()})([]);
|
|
|
@ -1 +0,0 @@
|
||||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__DB95977","name":"app-demo","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.6.15","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html"}}
|
|
Before Width: | Height: | Size: 3.9 KiB |