Browse Source

不直接近登录页面

gcz 4 years ago
parent
commit
6327fb8cb9

+ 1 - 1
pages.json

@@ -150,7 +150,7 @@
 	        "pagePath": "pages/index/index",
 	        "iconPath": "/static/img/icon_home.png",
 			"selectedIconPath":"static/img/icon_home_active.png",
-	        "text": "首页"
+	        "text": "碳汇产品"
 	    }
 		,{
 	        // "pagePath": "pages/use/useRouter",

+ 2 - 2
pages/index/guide.vue

@@ -107,8 +107,8 @@
 				  key: 'launchFlag',
 				  data: true
 				});
-				uni.redirectTo({
-				    url: '/pages/login/loginType',
+				uni.switchTab({
+				    url: '/pages/index/index',
 					fail(err) {
 						// console.log(err)
 					}

+ 26 - 20
pages/index/index.vue

@@ -212,26 +212,27 @@
 		},
 		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('个人用户');
-			// 			uni.setTabBarItem({
-			// 			  index: 1,
-			// 			  text: '普惠商城',
-			// 			  iconPath: '/static/img/icon_mall.png',
-			// 			  selectedIconPath: '/static/img/icon_mall_active.png',
-			// 			  pagePath: '/pages/mall/mall'
-			// 			});
-			// 			self.buyNowText = '立即购碳'
-			// 		}else{
-			// 			self.rankTab(2);
-			// 		};
-			// 	}
-			// });
+			//判断用户类别
+			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'
+						// });
+						self.buyNowText = '立即购碳'
+					}else{
+						self.buyNowText = '立即认购'
+						self.rankTab(2);
+					};
+				}
+			});
 		},
 		onLoad() {
 			this.thetoken = 'Bearer' + ' ' + this.$store.state.token;
@@ -297,6 +298,11 @@
 			},
 			//开启多株购碳
 			randomPop() {
+				//登录判断
+				if(!this.$store.state.hasLogin){
+					this.$api.msg('请先登录');
+					return;
+				};
 				this.modal.visibleModal = true;
 				this.$nextTick(res => {
 					// console.log('this.$refs',this.$refs.quickBuy)

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

@@ -62,7 +62,7 @@
 						// console.log('个人用户');
 						self.amountBtnText = '立即购买'
 					}else{
-						
+						self.amountBtnText = '提交认购申请'
 					};
 					
 				}

+ 5 - 0
pages/product/product.vue

@@ -153,6 +153,11 @@
 			},
 			//开启多株购碳
 			randomPop() {
+				//登录判断
+				if(!this.$store.state.hasLogin){
+					this.$api.msg('请先登录');
+					return;
+				};
 				this.modal.visibleModal = true;
 				this.$nextTick(res => {
 					// console.log('this.$refs',this.$refs.quickBuy)

+ 9 - 1
pages/use/use.vue

@@ -27,8 +27,13 @@
 				<image :src="$getimg + 'icon-huodong.png'" class="use-item-img" mode="scaleToFill"></image>
 				<view class="use-item-til">大型活动碳中和</view>
 			</view>
+			<view class="use-item" @click="shangcheng">
+				<image :src="$getimg + 'mall.png'" class="use-item-img" mode="scaleToFill"></image>
+				<view class="use-item-til">普惠商城</view>
+			</view>
 		</view>
-
+		
+		<!-- 自定义tabBar -->
 		<!-- <hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber> -->
 	</view>
 </template>
@@ -92,6 +97,9 @@ export default {
 			this.$api.href('/pages/usercenter/question/question');
 			// this.$api.msg('稍后展示')
 		},
+		shangcheng(){
+			this.$api.msg('暂未开放');
+		},
 		tabChange(index) {
 			console.log(index);
 			switch (index) {

+ 1 - 0
pages/usercenter/usercenter.vue

@@ -6,6 +6,7 @@
 		<view class="top-img usercenter">
 			<image :src="$getimg + 'usercenter-bg.png'" class="img" mode="widthFix"></image>
 			<view class="usercenter-baseinfo">
+				<!-- 头像在store里做拼接处理 -->
 				<image :src="userInfo.headImage||$getimg + 'member_nopic.png'" class="photo" mode="scaleToFill"></image>
 				<view class="text">
 					<view class="name">{{userInfo.customerName|| '游客'}}</view>

+ 1 - 1
store/index.js

@@ -181,7 +181,7 @@ export default new Vuex.Store({
 						   var https = /^https:\/\/.*/i.test(headImage);
 						   //如果两个都为假,我们就为客户添加http://
 						   if (!http && !https) {
-							   headImage = config.onlineImg + headImage;
+							   headImage = config.imgUrl + headImage;
 						   }
 					   };
 					    res.data.retBody.headImage = headImage;