Parcourir la source

控制二维码显示

pangqijun il y a 1 an
Parent
commit
7a0ee7be11
2 fichiers modifiés avec 16 ajouts et 4 suppressions
  1. 1 1
      pages/user/index.vue
  2. 15 3
      pages/users/user_info/index.vue

+ 1 - 1
pages/user/index.vue

@@ -798,7 +798,7 @@ export default {
 				toLogin();
 			} else {
 				uni.navigateTo({
-					url: '/pages/users/user_info/index'
+					url: '/pages/users/user_info/index?currentRole=' + this.currentRole
 				})
 			}
 

+ 15 - 3
pages/users/user_info/index.vue

@@ -50,7 +50,7 @@
 <!--						</navigator>-->
 <!--					</view>-->
 
-					<view class='item acea-row row-between-wrapper'>
+					<view class='item acea-row row-between-wrapper' v-if="currentRole == 'leader'">
 						<view>二维码</view>
 
 						<view v-if="userInfo.wxQrcode" class='input    acea-row row-between-wrapper'>
@@ -120,7 +120,9 @@ import {
 	toLogin
 } from '@/libs/login.js';
 import {
-	mapGetters
+	mapState,
+	mapGetters,
+	mapMutations
 } from "vuex";
 import dayjs from "@/plugin/dayjs/dayjs.min.js";
 // #ifdef MP
@@ -139,6 +141,7 @@ export default {
 	mixins: [colors],
 	data () {
 		return {
+			currentRole: '',
 			sex: '1',
 			userInfo: {},
 			loginType: 'h5', //app.globalData.loginType
@@ -195,7 +198,13 @@ export default {
 			setIndex: 0,
 		};
 	},
-	computed: mapGetters(['isLogin']),
+	computed: {
+		...mapGetters({
+			cartNum: 'cartNum',
+			isLogin: 'isLogin',
+			newCurrentRole:'newCurrentRole'
+		})
+	},
 	watch: {
 		isLogin: {
 			handler: function (newV, oldV) {
@@ -206,6 +215,9 @@ export default {
 			deep: true
 		}
 	},
+	onShow: function () {
+		this.currentRole=this.$store.getters.newCurrentRole;
+	},
 	onLoad () {
 		if (this.isLogin) {
 			this.getUserInfo();