Przeglądaj źródła

取消一开始就需要登录,先不判断用户类型,头像默认图片

gcz 4 lat temu
rodzic
commit
0f2d3bcee2
5 zmienionych plików z 43 dodań i 37 usunięć
  1. 6 3
      pages.json
  2. 20 19
      pages/index/index.vue
  3. 4 3
      pages/index/init.vue
  4. 12 11
      pages/use/use.vue
  5. 1 1
      pages/usercenter/usercenter.vue

+ 6 - 3
pages.json

@@ -151,12 +151,15 @@
 	        "iconPath": "/static/img/icon_home.png",
 			"selectedIconPath":"static/img/icon_home_active.png",
 	        "text": "首页"
-	    },{
-	        "pagePath": "pages/use/useRouter",
+	    }
+		,{
+	        // "pagePath": "pages/use/useRouter",
+			"pagePath": "pages/use/use",
 	        "iconPath": "static/img/icon_use.png",
 			"selectedIconPath":"static/img/icon_use_active.png",
 	        "text": "价值实现"
-	    },{
+		}
+		,{
 	        "pagePath": "pages/usercenter/usercenter",
 	        "iconPath": "static/img/icon_usercenter.png",
 			"selectedIconPath":"static/img/icon_usercenter_active.png",

+ 20 - 19
pages/index/index.vue

@@ -212,25 +212,26 @@
 		},
 		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.rankTab(2);
+			// 		};
+			// 	}
+			// });
 		},
 		onLoad() {
 			this.thetoken = 'Bearer' + ' ' + this.$store.state.token;

+ 4 - 3
pages/index/init.vue

@@ -28,10 +28,11 @@
 			 }
 			 if (launch&&version==this.config.version&&haslogin) {
 			   // 如果已经有,直接去首页
-				   // this.goIndex();
-				   this.goLogin();//有问题先每次登录
+				   this.goIndex();
+				   // this.goLogin();//有问题先每次登录
 			 } else if(launch&&version==this.config.version&&!haslogin){
-				 this.goLogin();				 
+				 // this.goLogin();
+				  this.goIndex();
 			 } else {
 			   // 没有值,跳到引导页,并存储,下次打开就不会进去引导页
 			   this.goGuide();			   

+ 12 - 11
pages/use/use.vue

@@ -29,7 +29,7 @@
 			</view>
 		</view>
 
-		<hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber>
+		<!-- <hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber> -->
 	</view>
 </template>
 
@@ -65,16 +65,17 @@ export default {
 	},
 	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');
-				}
-			}
-		});
+		//判断用户类别
+		// 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() {},
 	methods: {

+ 1 - 1
pages/usercenter/usercenter.vue

@@ -6,7 +6,7 @@
 		<view class="top-img usercenter">
 			<image :src="$getimg + 'usercenter-bg.png'" class="img" mode="widthFix"></image>
 			<view class="usercenter-baseinfo">
-				<image :src="userInfo.headImage|| ''" class="photo" mode="scaleToFill"></image>
+				<image :src="userInfo.headImage||$getimg + 'member_nopic.png'" class="photo" mode="scaleToFill"></image>
 				<view class="text">
 					<view class="name">{{userInfo.customerName|| '游客'}}</view>
 					<view class="tyep" v-if="userInfo.isCompany">