gcz 4 lat temu
rodzic
commit
4668f63de8

+ 100 - 0
components/hans-tabbar/hans-tabbar.vue

@@ -0,0 +1,100 @@
+<template>
+	<view class="weui-tabbar" :class="extClass">
+		<!-- 选中的时候往weui-tabbar__item加class:weui-bar__item_on -->
+		<view  @click="tabChange(index)" v-for="(item, index) in list" :key="index" class="weui-tabbar__item" :class="{'weui-bar__item_on':index === current}">
+			<view style="position: relative;display:inline-block;"><image :src="current === index ? item.selectedIconPath : item.iconPath" class="weui-tabbar__icon"></image></view>
+			<view class="weui-tabbar__label">{{ item.text }}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	props: {
+		list: {
+			type: Array,
+			default: function() {
+				return []
+			}
+		}
+	},
+	data() {
+		return {
+			extClass: '',
+			current: 1
+		};
+	},
+	methods: {
+		tabChange(index) {
+			if (index === this.current) {
+				return;
+			}
+			this.current = index;
+			this.$emit('tabChange',index)
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped >
+.weui-tabbar {
+	display: flex;
+	position: relative;
+	z-index: 500;
+	background-color: #ffffff;
+}
+.weui-tabbar:before {
+	content: ' ';
+	position: absolute;
+	left: 0;
+	top: 0;
+	right: 0;
+	height: 1px;
+	border-top: 1rpx solid rgba(0, 0, 0, 0.1);
+	color: rgba(0, 0, 0, 0.1);
+}
+.weui-tabbar__item {
+	display: block;
+	flex: 1;
+	padding: 8px 0 4px;
+	padding-bottom: calc(8px + constant(safe-area-inset-bottom));
+	padding-bottom: calc(8px + env(safe-area-inset-bottom));
+	font-size: 0;
+	color: rgba(0, 0, 0, 0.5);
+	text-align: center;
+	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.weui-tabbar__item:first-child {
+	padding-left: constant(safe-area-inset-left);
+	padding-left: env(safe-area-inset-left);
+}
+.weui-tabbar__item:last-child {
+	padding-right: constant(safe-area-inset-right);
+	padding-right: env(safe-area-inset-right);
+}
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon > i,
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
+	color: #26D18B;
+}
+.weui-tabbar__icon {
+	display: inline-block;
+	width: 28px;
+	height: 28px;
+	margin-bottom: 2px;
+}
+i.weui-tabbar__icon,
+.weui-tabbar__icon > i {
+	font-size: 24px;
+	color: rgba(0, 0, 0, 0.5);
+}
+.weui-tabbar__icon image {
+	width: 100%;
+	height: 100%;
+}
+.weui-tabbar__label {
+	color: #bfbfbf;
+	font-size: 10px;
+	line-height: 1.4;
+}
+</style>

+ 2 - 1
config/config.js

@@ -20,8 +20,9 @@ const config = {
 	
 	
 	//online 线上配置
-
 	
+	// 证书地址
+	certificateUrl:'https://cqthht.hongweisoft.com/cert?',
 	
 	//本地图片
 	// imgUrl:"../../static/img/",

+ 59 - 13
pages/building/building.vue

@@ -10,13 +10,34 @@
 		</view>
 		<image :src="$getimg + 'building.png'" class="building-img" mode="heightFix"></image>
 		<view class="building-text">正在建设中<text class="dotting"></text></view>
+		
+		<hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber>
 	</view>
 </template>
 
 <script>
+	import hansTabber from '../../components/hans-tabbar/hans-tabbar.vue';
 	export default {
+		components:{
+			hansTabber
+		},
 		data() {
 			return {
+				list: [{
+				 "text": "首页",
+				 "iconPath": '/static/img/icon_home.png' ,
+				 "selectedIconPath": '/static/img/icon_home_active.png'
+			   },
+			   {
+				 "text": "价值实现",
+				 "iconPath": '/static/img/icon_use.png',
+				 "selectedIconPath":'/static/img/icon_use_active.png'
+				 },
+				 {
+				   "text": "我的信息",
+				   "iconPath": '/static/img/icon_usercenter.png',
+				   "selectedIconPath": '/static/img/icon_usercenter_active.png'
+				 }],
 				$getimg:this.$getimg,
 				token:'',
 				params:{
@@ -25,25 +46,50 @@
 				
 			}
 		},
-		onBackPress(options) {  
-			console.log('onBackPress options',options);
-			if (options.from === 'navigateBack') {  
-				return false;  
-			}  
-			this.back();  
-			return true;  
-		}, 
 		onShow() {
-			let serf = this;		
+			let self = this;
+			uni.getStorage({
+				key : 'userInfo',
+				success:function(res){
+					if(res.data.customerType =='1'){
+						// console.log('个人用户');
+						self.list[1].text='普惠商城';
+						self.list[1].iconPath='/static/img/icon_mall.png';
+						self.list[1].selectedIconPath='/static/img/icon_mall_active.png';
+					}else{
+						
+					};
+				}
+			});
 		},
 		onLoad() {
-			var pages = getCurrentPages();
-			console.log('pages',pages);
-			let menuButtonInfo = uni.getMenuButtonBoundingClientRect();//胶囊按钮信息
-			console.log('menuButtonInfo',menuButtonInfo);
+			// var pages = getCurrentPages();
+			// console.log('pages',pages);
+			// let menuButtonInfo = uni.getMenuButtonBoundingClientRect();//胶囊按钮信息
+			// console.log('menuButtonInfo',menuButtonInfo);
 
 		},
 		methods: {
+			tabChange(index) {
+				console.log(index)
+				switch(index) {
+				     case 0:
+				        uni.switchTab({
+				        	url:'../index/index'
+				        });
+				        break;
+				     case 1:
+				        return
+				        break;
+					case 2:
+					   uni.switchTab({
+					   	url:'../usercenter/usercenter'
+					   });
+					   break;
+				     default:
+				        return
+				} 
+			}
 
 		}
 	}

+ 1 - 1
pages/buySuccess/buySuccess.vue

@@ -3,7 +3,7 @@
 		<view class="content">
 			<image :src="$getimg + 'icon-chenggong.png'" class="content-icon" mode="heightFix"></image>
 			<view class="content-til">购买成功</view>
-			<view class="content-subtil">您已成购买碳汇产品</view>
+			<view class="content-subtil">您将获得由重庆生态环境局发给您的碳汇购碳证书,您还可以将您的证书分享到您的朋友圈,号召更多的人购买碳汇践行环保</view>
 		</view>
 		<view class="full-btn" @click="goCertDetails">查看证书</view>
 	</view>

+ 21 - 0
pages/use/use.vue

@@ -32,13 +32,34 @@
 				<view class="use-item-til">大型活动碳中和</view>
 			</view>
 		</view>
+		
+		<hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber>
 	</view>
 </template>
 
 <script>
+	import hansTabber from '../../components/hans-tabbar/hans-tabbar.vue';
 	export default {
+		components:{
+			hansTabber
+		},
 		data() {
 			return {
+				list: [{
+					 "text": "首页",
+					 "iconPath": '/static/img/icon_home.png' ,
+					 "selectedIconPath": '/static/img/icon_home_active.png'
+				},
+				{
+				 "text": "价值实现",
+				 "iconPath": '/static/img/icon_use.png',
+				 "selectedIconPath":'/static/img/icon_use_active.png'
+				 },
+				 {
+				   "text": "我的信息",
+				   "iconPath": '/static/img/icon_usercenter.png',
+				   "selectedIconPath": '/static/img/icon_usercenter_active.png'
+				 }],
 				$getimg:this.$getimg,
 				token:'',
 				params:{

+ 1 - 0
pages/usercenter/certificateList/certificate/certificate.css

@@ -3,6 +3,7 @@
 .cart-no{margin-top: 333rpx;text-align: center;font-size: 24rpx;color: #26D18B;}
 .cart-text{margin: 10rpx 100rpx;line-height: 40rpx;font-size: 28rpx;color: #666;text-indent: 2em;}
 
+.save-tip{text-align: center;margin-top: 24rpx;color: #666;font-size: 30rpx;}
 
 
 

+ 15 - 3
pages/usercenter/certificateList/certificate/certificate.vue

@@ -1,15 +1,25 @@
 <template>
 	<view class="pages">
-		<!-- <web-view src="http://172.16.90.6:8080"></web-view> -->
+		<web-view :src="certificateUrl
+		+'credentialNo='+item.credentialNo
+		+'&customerName='+item.customerName
+		+'&year='+item.year
+		+'&carbonAmount='+item.carbonAmount
+		+'&orderAmount='+item.orderAmount
+		+'&buyDate='+item.buyDate
+		"></web-view>
+<!-- 		<view class="save-tip">
+			长按保存
+		</view> -->
 		<!-- 画板 -->		
-		<l-painter ref="painter" :board="base"/>
+		<!-- <l-painter ref="painter" :board="base"/>
 		<view class="bottom-btn-wrap">
 			<view class="bottom-btn-wrap-bg">
 				<view class="bottom-btn btn" @click="download">
 					下载图片
 				</view>
 			</view>
-		</view>
+		</view> -->
 		<!-- <button class="generate-btn" id="mycanvas" @click="download()"></button> -->
 		<!-- <view class="container" id="wrapper">
 			<view class="image-wrapper draw">
@@ -41,6 +51,7 @@
 		data() {
 			return {
 				$getimg:this.$getimg,
+				certificateUrl:this.config.certificateUrl,
 				thetoken:'',
 				orderid:'',
 				item:[],
@@ -137,6 +148,7 @@
 		
 		},
 		onLoad(e) {
+			console.log('config',this.config);
 			this.thetoken = 'Bearer' + ' ' + this.$store.state.token;
 			this.orderid = e.orderid;
 			uni.showLoading({