Browse Source

切换按钮

zhanghui 1 year ago
parent
commit
0bcc90bfbe
1 changed files with 9 additions and 7 deletions
  1. 9 7
      pages/user/index.vue

+ 9 - 7
pages/user/index.vue

@@ -9,6 +9,7 @@
 		</view>
 		<view class="mid" style="flex:1;overflow: hidden;padding: 30rpx;padding-top: 0; background: rgb(249,249,249);">
 			<scroll-view scroll-y="true" style="height: 100%;">
+
 				<view class="head" v-if="currentRole === 'leader'">
 					<view class="user-card" :class="member_style == 3 ? 'unBg' : ''">
 						<view class="bg"></view>
@@ -64,7 +65,7 @@
 								</view>
 								<!-- #endif -->
 								<view class="name" v-if="userInfo.id">
-									{{ userInfo.realName }} 测试名字
+									{{ userInfo.realName }}
 									<image class="live" :src="userInfo.vip_icon" v-if="userInfo.vip_icon"></image>
 									<view class="vip" v-if="userInfo.is_money_level > 0 && userInfo.svip_open">
 										<image src="/static/images/svip.png"></image>
@@ -81,7 +82,7 @@
 								<!-- <view class="phone" v-if="!userInfo.username && isLogin" @tap="bindPhone">
 									{{$t('绑定手机号')}}</view> -->
 							</view>
-							<view class="message" style="    white-space: nowrap;">
+							<view v-if="userInfo.livingHall === 1" class="message" style="    white-space: nowrap;">
 								<text v-if="currentRole === 'leader'" style="	color: #75BE00;margin-right: 20rpx;">切换团员</text>
 								<u-switch v-model="roleSwitch" activeColor="#75BE00" size="16" @change="changeRole"></u-switch>
 							</view>
@@ -192,6 +193,7 @@
 						</button>
 					</view>
 				</view>
+
 				<view class="head" v-if="currentRole === 'employees'">
 					<view class="user-card" :class="member_style == 3 ? 'unBg' : ''">
 						<view class="bg"></view>
@@ -247,7 +249,7 @@
 								</view>
 								<!-- #endif -->
 								<view class="name" v-if="userInfo.id">
-									{{ userInfo.realName }} 测试名字
+									{{ userInfo.realName }}
 									<image class="live" :src="userInfo.vip_icon" v-if="userInfo.vip_icon"></image>
 									<view class="vip" v-if="userInfo.is_money_level > 0 && userInfo.svip_open">
 										<image src="/static/images/svip.png"></image>
@@ -264,7 +266,7 @@
 								<!-- <view class="phone" v-if="!userInfo.username && isLogin" @tap="bindPhone">
 									{{$t('绑定手机号')}}</view> -->
 							</view>
-							<view class="message" style="    white-space: nowrap;">
+							<view  v-if="userInfo.livingHall === 1" class="message" style="    white-space: nowrap;">
 								<text style="	color: rgb(174, 33, 56);margin-right: 20rpx;">切换团长</text>
 								<u-switch v-model="roleSwitch" activeColor="#75BE00" size="16" @change="changeRole"></u-switch>
 							</view>
@@ -426,8 +428,8 @@ export default {
 	mixins: [colors],
 	data () {
 		return {
-			roleSwitch: true,
-			currentRole: 'leader',
+			roleSwitch: false,
+			currentRole: 'employees',
 			storeMenu: [], // 商家管理
 			orderMenu: [{
 				img: 'icon-daifukuan',
@@ -600,7 +602,7 @@ export default {
 	methods: {
 					/**
 			 * 退出登录
-			 * 
+			 *
 			 */
 		outLogin: function() {
 				let that = this;