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

103 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">
<!-- 头部 -->
<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/count/count'
})
});
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/assess/assess'
})
}
})
}, 1000);
},
methods: {
}
}
</script>
<style>
</style>