Browse Source

auto commit

gcz 4 years ago
parent
commit
36cf18f203

+ 4 - 0
main.js

@@ -22,6 +22,10 @@ http.interceptors.response.use((response) => { /* 对响应成功做点什么 
 		 	icon:"none",
 		 	duration:2000
 		});
+		uni.setStorage({
+			key: "hasLogin",
+			data: false
+		});
 		setTimeout(i=>{
 			uni.navigateTo({
 				url: '/pages/login/loginType',

+ 15 - 1
pages.json

@@ -56,6 +56,20 @@
 				"navigationBarTitleText": ""
 			}
 		},
+		{
+			"path": "pages/use/useRouter",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle":"custom"
+			}
+		},
+		{
+			"path": "pages/mall/mall",
+			"style": {
+				"navigationBarTitleText": "普惠商城",
+				"navigationStyle":"custom"
+			}
+		},
 		{
 			"path": "pages/use/use",
 			"style": {
@@ -124,7 +138,7 @@
 			"selectedIconPath":"static/img/icon_home_active.png",
 	        "text": "首页"
 	    },{
-	        "pagePath": "pages/use/use",
+	        "pagePath": "pages/use/useRouter",
 	        "iconPath": "static/img/icon_use.png",
 			"selectedIconPath":"static/img/icon_use_active.png",
 	        "text": "价值实现"

+ 5 - 2
pages/confirmOrder/confirmOrder.vue

@@ -86,7 +86,8 @@
 				token:'',
 				requested:true,//是否请求中
 				min:1,
-				cartList:[]
+				cartList:[],
+				orderid:'',
 			}
 		},
 		methods:{
@@ -172,6 +173,7 @@
 			},
 			//拉起微信支付
 			pullWeichatPay(item){
+				this.orderid = item.guid;
 				let self = this;
 				console.log('pay item',item);
 				let userInfo = uni.getStorageSync("userInfo");
@@ -197,7 +199,8 @@
 					    signType: 'MD5',
 					    paySign: res.data.retBody.paySign,
 					    success: function (res) {
-							self.$api.href('/pages/usercenter/orderList/orderList')
+							// self.$api.href('/pages/usercenter/orderList/orderList')
+							self.$api.href('/pages/usercenter/certificateList/certificate/certificate?orderid=' + self.orderid)
 					        console.log('success:' + JSON.stringify(res));
 					    },
 					    fail: function (err) {

+ 6 - 6
pages/index/guide.vue

@@ -11,17 +11,17 @@
 			:autoplay="swiper.autoplay" 			
 			:interval="swiper.interval" :duration="swiper.duration">
 				<swiper-item>
-					<view class="adv-item"><image :src="$getimg +'guide01.png'" class="pic" mode="widthFix"></image></view>
+					<view class="adv-item"><image :src="$getimg +'guide01.png'" class="pic" mode="scaleToFill"></image></view>
 				</swiper-item>
 				<swiper-item>
-					<view class="adv-item"><image :src="$getimg +'guide02.png'" class="pic" mode="widthFix"></image></view>
+					<view class="adv-item"><image :src="$getimg +'guide02.png'" class="pic" mode="scaleToFill"></image></view>
 				</swiper-item>
 				<swiper-item>
-					<view class="adv-item"><image :src="$getimg +'guide03.png'" class="pic" mode="widthFix"></image></view>
+					<view class="adv-item"><image :src="$getimg +'guide03.png'" class="pic" mode="scaleToFill"></image></view>
 				</swiper-item>
 				<swiper-item>
 					<view class="adv-item" @click="goIndex">
-						<image :src="$getimg +'guide04.png'" class="pic" mode="widthFix"></image>
+						<image :src="$getimg +'guide04.png'" class="pic" mode="scaleToFill"></image>
 						<view class="tip-btn-wrap">
 							<text class="tip-btn">立即体验</text>
 						</view>
@@ -45,7 +45,7 @@
 				$getimg:this.$getimg,
 				swiper: {
 					indicatorDots: true,
-					autoplay: true,
+					autoplay: false,
 					interval: 9000,
 					duration: 500,
 					indicatorColor:"rgba(171, 234, 213, 1)",
@@ -120,7 +120,7 @@
 .guide-img{position: fixed;left: 0;right: 0;top: 0;bottom: 0;display: block;}
 .swiper{height: 100%;}
 .adv-item{height: 100%;position: relative;}
-.guide-img .pic{width: 100%;/* max-height: 100%; */}
+.guide-img .pic{width: 100%;height: 100%;/* max-height: 100%; */}
 .adv-item .tip-btn-wrap{position: fixed;left: 0;bottom: 60rpx;right: 0;text-align: center;}
 .adv-item .tip-btn{display: inline-block;width: 454rpx;height: 100rpx;line-height: 100rpx;font-size: 35rpx;font-weight: 600;letter-spacing: 6rpx;color: #24C696;background-color: #fff;border-radius: 100rpx;}
 

+ 31 - 6
pages/index/index.css

@@ -35,22 +35,47 @@ page{background-color: #f5f5f5;}
 .product-list-item{width: 200rpx;height: 200rpx;position: relative;margin-bottom: 18rpx;overflow: hidden;border-radius: 16rpx;text-align: center;}
 .product-list-item:nth-child(3n-1){margin-left: 10rpx;margin-right: 10rpx;}
 .product-list-item .product-img{width: 100%;height: 100%;}
-.product-list-item .product-text{position: absolute;left: 0;bottom: 0;right: 0;height: 56rpx;line-height: 56rpx;font-size: 24rpx;color: #fff;padding-left: 16rpx;overflow: hidden;text-overflow: ellipsis;background: rgba(0, 0, 0, 0.4);}
+.product-list-item .product-text{position: absolute;left: 0;bottom: 0;right: 0;height: 56rpx;line-height: 56rpx;font-size: 24rpx;color: #fff;padding-left: 16rpx;padding-right: 16rpx;overflow: hidden;text-overflow: ellipsis;background: rgba(0, 0, 0, 0.4);}
 
 .rank-wrap{margin-bottom: 44rpx;border-radius: 16rpx;box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.04);}
 .rank-tab{display: flex;background-color: #fff;margin-bottom: 8rpx;box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.04);border-radius: 16rpx;}
 .rank-tab-item{flex: 1;position: relative;height: 86rpx;line-height: 86rpx;text-align: center;font-size: 28rpx;color: #333;}
 .rank-tab-item.active{color: #26D18B;}
 .rank-tab-item.active::after{content: '';width: 130rpx;margin-left: -65rpx;height: 4rpx;background-color: #26D18B;border-radius: 2rpx;position: absolute;left: 50%;bottom: 0;}
-.rank-top{display: flex;justify-content: center;border-radius: 16rpx 16rpx 0 0 ;padding: 105rpx 0 16rpx;background-color: #fff;position: relative;}
+.rank-top{display: flex;justify-content: space-between;border-radius: 16rpx 16rpx 0 0 ;padding: 105rpx 29rpx 16rpx;background-color: #fff;position: relative;}
 .rank-top-item{width: 210rpx;text-align: center;}
+.rank-top-item.rank-top-2{width: 190rpx;padding-top: 12rpx;}
+.rank-top-item.rank-top-3{width: 170rpx;padding-top: 25rpx;}
+.rank-top-item.rank-top-3 .rank-top-text{bottom: 0;}
+.rank-top-imgwrap .rank-bg{position: absolute;}
+.rank-top-imgwrap .rank-left{left: 0;}
+.rank-top-imgwrap .rank-right{right: 0;}
+.rank-top-imgwrap .rank-center{bottom: 0;}
+
+.rank-top-1 .rank-right,
+.rank-top-1 .rank-left{width: 55rpx;height: 43rpx;bottom: 16rpx;z-index: 1;}
+.rank-top-1 .rank-center{width: 179rpx;height: 46rpx;left: 16rpx;z-index: 3;}
+.rank-top-2 .rank-right,
+.rank-top-2 .rank-left{width: 49rpx;height: 39rpx;bottom: 15rpx;z-index: 1;}
+.rank-top-2 .rank-center{width: 161rpx;height: 42rpx;left: 14rpx;z-index: 3;}
+.rank-top-3 .rank-right,
+.rank-top-3 .rank-left{width: 44rpx;height: 35rpx;bottom: 13rpx;z-index: 1;}
+.rank-top-3 .rank-center{width: 145rpx;height: 38rpx;left: 12rpx;z-index: 3;}
+
+.rank-top-photo{border: 1px solid transparent;background-clip: padding-box;position: relative;}
+.rank-top-photo::after {content: "";display: block;position: absolute;top: -1px;right: -1px;bottom: -1px;left: -1px;border-radius: 50%;background: linear-gradient(180deg, rgba(253, 227, 127, 1), rgba(251, 189, 78, 1)) 1 1;z-index: -1;}
+/* .rank-top-photo{border:1px solid;} */
+.rank-top-1 .rank-top-photo{border: 1px solid #FBBD4E;border-color: #FDE37F;}
+.rank-top-2 .rank-top-photo{width: 130rpx;height: 130rpx;border-color: #8DC3FF;}
+.rank-top-3 .rank-top-photo{width: 117rpx;height: 117rpx;border-color: #FBBD4E;}
+
+.rank-top-text{font-size: 20rpx;color: #fff;position: absolute;left: 0;right: 0;bottom: 4rpx;text-align: center;z-index: 4;}
 .rank-top-imgwrap{position: relative;margin-bottom: 12rpx;}
 .rank-top-bg{width: 100%;height: 61rpx;position: absolute;left: 0;bottom: 0;}
-.rank-top-photo{width: 144rpx;height: 144rpx;border-radius: 50%;}
+.rank-top-photo{position: relative;width: 144rpx;height: 144rpx;border-radius: 50%;z-index: 2;}
 .rank-top-name{font-size: 28rpx;color: #333;line-height: 40rpx;font-weight: 500;}
 .rank-top-carbon{font-size: 20rpx;color: #999;}
-.rank-wrap .rank-top-item:nth-child(2){transform: scale(0.9);transform-origin: bottom;}
-.rank-wrap .rank-top-item:nth-child(3){transform: scale(0.8);transform-origin: bottom;}
+
 .my-rank-wrap{flex: unset;position: absolute;top: 24rpx;right: 0;align-items: center;display: flex;}
 .my-rank-photo{width: 80rpx;height: 80rpx;position: relative;right: -30rpx;box-sizing: border-box;border-radius: 50%;overflow: hidden;border: 2rpx solid #fff;}
 .my-rank-photo .photo{width: 100%;height: 100%;}
@@ -60,7 +85,7 @@ page{background-color: #f5f5f5;}
 .rank-list-header{display: flex;align-items: center;height: 68rpx;font-size: 24rpx;color: #666;text-align: center;}
 .rank-list-header-rank{width: 128rpx;}
 .rank-list-header-user{flex: 1;}
-.rank-list-header-carbon{width: 170rpx;margin-left: 0;}
+.rank-list-header-carbon{width: 170rpx;margin-left: 0;padding-right: 40rpx;}
 .rank-list{overflow: hidden;background-color: #fff;padding: 0 40rpx 0 0;border-radius: 0 0 16rpx 16rpx;}
 .rank-list-item{display: flex;align-items: center;margin: 24rpx 0;padding-bottom: 31rpx;position: relative;}
 .rank-list-item::after{content: '';width: calc( 100% - 128rpx );height: 2px;background-color: #EDEEED;position: absolute;right: 0;bottom: 0;}

+ 43 - 13
pages/index/index.vue

@@ -82,7 +82,7 @@
 						<view class="product-text">{{item.goodsName}}</view>
 					</view>
 				</view>
-				<navigator class="common-content-blink" url="/pages/product/productList/productList">查看更多</navigator>
+				<navigator class="common-content-blink" url="/pages/product/productList/productList">查看更多 ></navigator>
 				<!-- <view class="common-content-blink">查看更多 ></view> -->
 			</view>
 			<!-- 碳汇产品展示 结束 -->
@@ -98,11 +98,32 @@
 				</view>
 				<custom-nodata v-if="rankResult.list == ''"></custom-nodata>
 				<view class="rank-top" v-if="rankTop.length > 0">
-					<view class="rank-top-item" v-for="(item, index) in rankTop" :key="index">
+					<view class="rank-top-item" :class="'rank-top-'+(index+1)" v-for="(item, index) in rankTop" :key="index">
 						<view class="rank-top-imgwrap">
-							<image :src="$getimg+'rank-top-1.png'" v-if="item.rank == '1'" class="rank-top-bg" mode="aspectFit"></image>
+							<view class="item-top-rank" v-if="item.rank == '1'" >
+								<image :src="$getimg+'rank-left-1.png'" class="rank-bg rank-left" mode="aspectFit"></image>
+								<image :src="$getimg+'rank-center-1.png'" class="rank-bg rank-center" mode="aspectFit"></image>
+								<image :src="$getimg+'rank-right-1.png'" class="rank-bg rank-right" mode="aspectFit"></image>
+								<view class="rank-top-text">第一名</view>
+							</view>
+							<view class="item-top-rank" v-if="item.rank == '2'" >
+								<image :src="$getimg+'rank-left-2.png'" class="rank-bg rank-left" mode="aspectFit"></image>
+								<image :src="$getimg+'rank-center-2.png'" class="rank-bg rank-center" mode="aspectFit"></image>
+								<image :src="$getimg+'rank-right-2.png'" class="rank-bg rank-right" mode="aspectFit"></image>
+								<view class="rank-top-text">第二名</view>
+							</view>
+							<view class="item-top-rank" v-if="item.rank == '3'" >
+								<image :src="$getimg+'rank-left-3.png'" class="rank-bg rank-left" mode="aspectFit"></image>
+								<image :src="$getimg+'rank-center-3.png'" class="rank-bg rank-center" mode="aspectFit"></image>
+								<image :src="$getimg+'rank-right-3.png'" class="rank-bg rank-right" mode="aspectFit"></image>
+								<view class="rank-top-text">第三名</view>
+							</view>
+							
+							
+							
+							<!-- <image :src="$getimg+'rank-top-1.png'" v-if="item.rank == '1'" class="rank-top-bg" mode="aspectFit"></image>
 							<image :src="$getimg+'rank-top-2.png'" v-if="item.rank == '2'" class="rank-top-bg" mode="aspectFit"></image>
-							<image :src="$getimg+'rank-top-3.png'" v-if="item.rank == '3'" class="rank-top-bg" mode="aspectFit"></image>							
+							<image :src="$getimg+'rank-top-3.png'" v-if="item.rank == '3'" class="rank-top-bg" mode="aspectFit"></image> -->							
 							<image :src="item.headImage" class="rank-top-photo" mode="scaleToFill"></image>
 						</view>
 						<view class="rank-top-name f-ellipsis">{{item.customerName}}</view>
@@ -185,14 +206,23 @@
 			}
 		},
 		onShow() {
-			// let self = this;
-			// uni.getStorage({
-			// 	key:'accessToken',
-			// 	success:function(res){
-			// 		console.log('getStorage',res.data.accessToken);
-			// 		self.thetoken = res.data.accessToken;
-			// 	}
-			// })			
+			let self = this;
+			uni.getStorage({
+				key : 'userInfo',
+				success:function(res){
+					console.log('userInfo customerType',res.data.customerType);
+					if(res.data.customerType =='1'){
+						console.log('个人用户');
+						uni.setTabBarItem({
+						  index: 1,
+						  text: '普惠商城',
+						  iconPath: '/static/img/icon_mall.png',
+						  selectedIconPath: '/static/img/icon_mall_active.png',
+						  pagePath: '/pages/mall/mall'
+						})
+					};
+				}
+			});
 		},
 		onLoad() {
 			this.thetoken = 'Bearer' + ' ' + this.$store.state.token;
@@ -231,7 +261,7 @@
 				this.getRank(type);
 			},
 			getRank(){
-				let params = {"type":this.rankType};
+				let params = {"type":this.rankType,"pageSize":4};
 				// console.log('this.thetoken',this.thetoken);
 				this.$api.http.get(this.config.apiBaseurl+'/carbon-h5/wap/carbonVal/getCustomerCarbonValRank',{params:params,header: {Authorization:this.thetoken}}).then(res => {
 					if(!res.data.retBody){

+ 2 - 2
pages/index/init.vue

@@ -17,7 +17,7 @@
 		onLoad() {
 			// 从本地缓存中同步获取指定 key 对应的内容,用于判断是否是第一次打开应用
 			 const launch = uni.getStorageSync('launchFlag');
-			 const haslogin = uni.getStorageSync('haslogin');
+			 const haslogin = uni.getStorageSync('hasLogin');
 			 const version = uni.getStorageSync('version');
 			 
 			 if(!version){
@@ -48,7 +48,7 @@
 				  key: 'version',
 				  data: this.config.version
 				});
-				uni.redirectTo({
+				uni.switchTab({
 				    url: '/pages/index/index',
 					fail(err) {
 						// console.log(err)

+ 1 - 1
pages/index/modal/quickBuy.vue

@@ -17,7 +17,7 @@
 				<view class="conditions-item remark-wrap" v-if="productType == 'all'">
 					<view class="conditions-item-til">备注说明:</view>
 					<view class="remark">
-						<textarea class="remark-textarea" maxlength="240" v-model="remark" placeholder="请输入您对认购的碳汇产品要求" />
+						<textarea class="remark-textarea" maxlength="240" v-model="remark" placeholder-style="font-size:30rpx" placeholder="请输入您对认购的碳汇产品要求" />
 					</view>
 				</view>
 				<view class="amount-wrap">

+ 10 - 1
pages/login/loginType.vue

@@ -4,7 +4,7 @@
 			<!-- 占据了状态栏位置 -->
 		</view>
 		<view class="page-bg-wrap">
-			<image :src="$getimg+'loginType-bg.jpg'" class="page-bg" mode="widthFix"></image>
+			<image :src="$getimg+pageBg" class="page-bg" mode="widthFix"></image>
 		</view>
 		<view class="login-out">
 			<view class="login-wrap" v-if="!hasLogin">
@@ -38,6 +38,7 @@
 		data() {
 			return {
 				$getimg:this.$getimg,
+				pageBg:'loginType-bg.jpg',
 				backUrl:'',
 				havePhone:true,
 			}
@@ -57,7 +58,15 @@
 			}	
 		},
 		onLoad(options) {
+			let self = this;
 			this.backUrl = options.backUrl;
+			uni.getSystemInfo({
+			    success: function (res) {
+					if(res.windowHeight>800){
+						self.pageBg = 'loginType-bg.png'
+					}
+			    }
+			});
 		},
 		methods: {
 			...mapMutations(['login','upInfo']),

+ 20 - 0
pages/mall/mall.css

@@ -0,0 +1,20 @@
+.tip{margin-top: 500rpx;font-size: 50rpx;color: #999;text-align: center;}
+.tip .back-index{margin: 50rpx 200rpx;background-color: #26D18B;color: #fff;}
+
+.top-img{height: 340rpx;overflow: visible;padding-top: 200rpx;box-sizing: border-box;}
+.top-img::after{content: '';}
+.top-img .img{height: 100%;}
+.integral{position: relative;margin: 0 40rpx 60rpx;padding: 32rpx 65rpx;background-color: #fff;border-radius: 20rpx;}
+.integral-til{font-size: 28rpx;color: #333;font-weight: 500;line-height: 40rpx;margin-bottom: 9rpx;}
+
+
+
+
+
+
+
+
+
+
+
+

+ 52 - 0
pages/mall/mall.vue

@@ -0,0 +1,52 @@
+<template>
+	<view class="pages">
+		<view class="tip">
+			正在建设中
+			<button type="default" @click="goIndex" class="back-index">返回首页</button>
+		</view>
+		<view class="hold-status-bar">
+			<!-- 占据了状态栏位置 -->
+		</view>
+		<view class="" style="display: none;">
+			<view class="top-img mall">
+				<image :src="$getimg + 'usercenter-bg.png'" class="img" mode="scaleToFill"></image>
+				<view class="integral">
+					<view class="integral-til">我的积分</view>
+				</view>
+			</view>
+		</view>		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				token:'',
+				$getimg:this.$getimg,
+				params:{
+					
+				}
+				
+			}
+		},
+		onShow() {
+			this.token = this.$store.state.token;
+		},
+		onLoad() {
+
+		},
+		methods: {
+			goIndex(){
+				uni.switchTab({
+					url:'../index/index'
+				})
+			}
+
+		}
+	}
+</script>
+
+<style>
+	@import url("./mall.css");
+</style>

+ 1 - 0
pages/product/product.css

@@ -1,4 +1,5 @@
 page{background-color: #F5F5F5;}
+.swiper-wrap{margin-bottom: 24rpx;}
 .goods-name{display: flex;align-items: center;justify-content: space-between;padding: 24rpx;background-color: #fff;border-bottom: 1px solid #ddd;}
 .goods-name .name{flex: 1;font-size: 30rpx;font-weight: 600;line-height: 40rpx;}
 .goods-name .type{font-size: 24rpx;color: #999;width: 200rpx;text-align: right;}

+ 1 - 1
pages/product/productList/productList.css

@@ -5,7 +5,7 @@
 .producttype-nav{position: fixed;left: 0;bottom: 0;top: calc(44px + env(safe-area-inset-top));top: 0;width: 200rpx;height: 100%;box-sizing: border-box;background-color: #F6F6F9;overflow-y: auto;}
 .producttype-nav-item{position: relative;padding: 29rpx 0;box-sizing: border-box;text-align: center;font-size: 30rpx;font-weight: 500;color: #333;line-height: 42rpx;}
 .producttype-nav-item.active{background-color: #fff;color: #26D18B;}
-.producttype-nav-item.active::before{content: '';position: absolute;left: 0;top: 50%;margin-top: -15rpx;width: 6rpx;height: 30rpx;background: #26D18B;border-radius: 3px;}
+.producttype-nav-item.active::before{content: '';position: absolute;left: 0;top: 0;width: 6rpx;height: 100%;background: #26D18B;border-radius: 3px;}
 
 .producttype-con{position: relative;flex: 1;margin: 0 0 0 237rpx;box-sizing: border-box;height: 100%;overflow-y: auto;}
 

+ 3 - 3
pages/use/use.css

@@ -2,11 +2,11 @@ page{background-color: #f5f5f5;}
 .top-img{height: 702rpx;z-index: -1;}
 .use-wrap{margin: -210rpx 40rpx 40rpx;padding: 60rpx 24rpx 24rpx;background-color: #fff;box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.04);border-radius: 16rpx;}
 .use-wrap-header{display: flex;justify-content: space-between;align-items: center;margin-bottom: 60rpx;}
-.use-wrap-header .til{font-size: 32rpx;color: #333;font-weight: 500;}
-.use-wrap-header .subtil{font-size: 24rpx;color: #999;}
+.use-wrap-header .til{font-size: 32rpx;color: #333;font-weight: 500;padding-left: 16rpx;}
+.use-wrap-header .subtil{font-size: 24rpx;color: #999;padding-right: 16rpx;}
 .use-wrap-header .subtil .iconfont{margin-left: 8rpx;}
 
-.use-item{margin-bottom: 30rpx;padding-left: 121rpx;display: flex;align-items: center;justify-content: flex-start;border-radius: 32rpx;height: 152rpx;box-shadow: 0px 20rpx 15rpx 0px rgba(0, 0, 0, 0.04), 0px 13rpx 14rpx 0px rgba(0, 0, 0, 0.08), 0px 7rpx 12rpx 0px rgba(0, 0, 0, 0.06), 0px 0px 12rpx 0px rgba(0, 0, 0, 0.04);}
+.use-item{margin-bottom: 30rpx;padding-left: 121rpx;display: flex;align-items: center;justify-content: flex-start;border-radius: 32rpx;height: 152rpx;box-shadow: 0px 20rpx 15rpx 0px rgba(0, 0, 0, 0.00004), 0px 13rpx 14rpx 0px rgba(0, 0, 0, 0.08), 0px 7rpx 12rpx 0px rgba(0, 0, 0, 0.06), 0px 0px 12rpx 0px rgba(0, 0, 0, 0.04);}
 .use-item-img{width: 80rpx;height: 80rpx;margin-right: 35rpx;}
 .use-item-til{font-size: 32rpx;color: #333;font-weight: 600;letter-spacing: 2rpx;margin-right: 24rpx;}
 .use-item-subtil{font-size: 24rpx;color: #999;}

+ 14 - 0
pages/use/use.vue

@@ -1,5 +1,8 @@
 <template>
 	<view class="pages">
+		<view class="hold-status-bar">
+			<!-- 占据了状态栏位置 -->
+		</view>
 		<view class="top-img">
 			<image :src="$getimg + 'use-bg-s1.png'" class="img" mode="widthFix"></image>
 		</view>
@@ -40,6 +43,17 @@
 			}
 		},
 		onShow() {
+			let self = this;
+			uni.getStorage({
+				key : 'userInfo',
+				success:function(res){
+					console.log('userInfo customerType',res.data.customerType);
+					if(res.data.customerType =='1'){
+						console.log('个人用户');
+						self.$api.href('/pages/mall/mall')
+					};
+				}
+			});
 		},
 		onLoad() {
 

+ 43 - 0
pages/use/useRouter.vue

@@ -0,0 +1,43 @@
+<template>
+	<view class="pages">
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				params:{
+					token:'',
+				}
+				
+			}
+		},
+		onShow() {
+			let self = this;
+			uni.getStorage({
+				key : 'userInfo',
+				success:function(res){
+					console.log('userInfo customerType',res.data.customerType);
+					if(res.data.customerType =='1'){
+						console.log('个人用户');
+						self.$api.href('/pages/mall/mall')
+					}else{
+						self.$api.href('/pages/use/use')
+					};
+				}
+			});
+		},
+		onLoad() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style >
+	/* @import url("./index.css"); */
+</style>

BIN
static/img/icon_mall.png


BIN
static/img/icon_mall_active.png


+ 12 - 1
store/index.js

@@ -49,6 +49,10 @@ export default new Vuex.Store({
 					accessToken: state.token
 				}
 			});
+			uni.setStorage({
+				key: "hasLogin",
+				data: true
+			});
 		},
 		/**
 		 * 退出登录,传入false只更新缓存不跳转
@@ -68,6 +72,13 @@ export default new Vuex.Store({
 			uni.removeStorage({
 				key: sysTokenKey
 			});
+			uni.removeStorage({
+				key: "userInfo"
+			});
+			uni.setStorage({
+				key: "hasLogin",
+				data: false
+			});
 			//跳到登录页
 			// v && $api.goto(loginUrl);
 		},
@@ -159,7 +170,7 @@ export default new Vuex.Store({
 			//在线更新取得用户信息
 			then(await(
 					http.get(config.apiBaseurl + '/carbon-h5/wap/customer/getCustomerByToken',{header: {Authorization:thetoken}}).then(res => {
-						console.log('getCustomerByToken', res);
+						console.log('getCustomerByToken',JSON.parse(JSON.stringify(res)));
 						if(res.data.retHead.errCode == 0){res.data.code = 0;}
 						// 处理非微信头像
 						let headImage = res.data.retBody.headImage;