master
yujialong 3 years ago
parent 7e1d9fe995
commit 5a9e8516c8
  1. 18
      App.vue
  2. 7
      apis/request.js
  3. 2
      libs/util.js
  4. 1
      main.js
  5. 12
      pages.json
  6. 27
      pages/index/index.vue
  7. 1
      pages/login/login.vue
  8. 2
      pages/person/person.vue
  9. 3
      styles/common.scss

@ -1,23 +1,7 @@
<script> <script>
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js'
export default { export default {
onLaunch: function() { onLaunch: function() {
//
uni.getStorageSync('token') && getUserRolesPermissionMenu({
platformId: 4
}).then(({ permissionMenu }) => {
const auth = []
const generateAuth = (list, parent) => {
list.map(e => {
const name = `${parent ? parent + ':' : ''}${e.name}`
auth.push(name)
generateAuth(e.children, name)
})
}
generateAuth(permissionMenu[0].children, '')
console.log(333, auth)
uni.setStorageSync('auth', auth)
}).catch(e => {})
}, },
onShow: function() { onShow: function() {

@ -29,12 +29,7 @@ const request = options => {
resolve(data) resolve(data)
} else if (status == 401) { } else if (status == 401) {
// 登录过期 // 登录过期
uni.removeStorageSync('token') uni.clearStorageSync()
uni.removeStorageSync('userName')
uni.removeStorageSync('avatar')
uni.removeStorageSync('sessionKey')
uni.removeStorageSync('team')
uni.removeStorageSync('auth')
uni.showToast({ uni.showToast({
title: message, title: message,
icon: 'none' icon: 'none'

@ -55,5 +55,5 @@ export default {
// 获取商务经理名称 // 获取商务经理名称
getBmName(val) { getBmName(val) {
return uni.getStorageSync('team').partnerClassificationName return uni.getStorageSync('team').partnerClassificationName
}, }
} }

@ -18,6 +18,7 @@ Vue.prototype.auth = function(text){
const isPermission = auth.includes(text) const isPermission = auth.includes(text)
return auth.includes(text) return auth.includes(text)
} }
// return true
} }
const app = new Vue({ const app = new Vue({

@ -9,26 +9,26 @@
} }
}, },
{ {
"path" : "pages/index/index", "path" : "pages/invite/invite",
"style" : "style" :
{ {
"navigationBarTitleText": "", "navigationBarTitleText": "加入团队",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/qrcode/qrcode", "path" : "pages/index/index",
"style" : "style" :
{ {
"navigationBarTitleText": "邀请加入", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/invite/invite", "path" : "pages/qrcode/qrcode",
"style" : "style" :
{ {
"navigationBarTitleText": "加入团队", "navigationBarTitleText": "邀请加入",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },

@ -1,5 +1,5 @@
<template> <template>
<view class="page"> <view :class="['page', {oh: !per}]">
<image class="bg" src="@/static/image/index/index2.png" mode="widthFix"></image> <image class="bg" src="@/static/image/index/index2.png" mode="widthFix"></image>
<view class="team"> <view class="team">
<uni-data-picker class="picker-input" placeholder="切换团队" popup-title="切换团队" preload :clear-icon="false" :localdata="list" :map="{text: 'partnerClassificationName', value: 'teamId'}" v-model="teamId" @change="teamChange"></uni-data-picker> <uni-data-picker class="picker-input" placeholder="切换团队" popup-title="切换团队" preload :clear-icon="false" :localdata="list" :map="{text: 'partnerClassificationName', value: 'teamId'}" v-model="teamId" @change="teamChange"></uni-data-picker>
@ -103,6 +103,7 @@
</template> </template>
<script> <script>
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js'
import { getTeamsByAccountId, getTheBusinessManagerIdsUnderTheTeam } from '@/apis/modules/client.js' import { getTeamsByAccountId, getTheBusinessManagerIdsUnderTheTeam } from '@/apis/modules/client.js'
import { treeList } from '@/apis/modules/parner.js' import { treeList } from '@/apis/modules/parner.js'
export default { export default {
@ -116,7 +117,7 @@
} }
}, },
onShow() { onShow() {
this.initRole() this.getAuth()
}, },
methods: { methods: {
// //
@ -127,6 +128,25 @@
this.getInfo() this.getInfo()
} }
}, },
//
getAuth() {
uni.getStorageSync('token') && getUserRolesPermissionMenu({
platformId: 4
}).then(({ permissionMenu }) => {
const auth = []
const generateAuth = (list, parent) => {
list.map(e => {
const name = `${parent ? parent + ':' : ''}${e.name}`
auth.push(name)
generateAuth(e.children, name)
})
}
generateAuth(permissionMenu[0].children, '')
console.log(333, auth)
uni.setStorageSync('auth', auth)
this.initRole()
}).catch(e => {})
},
// //
getInfo() { getInfo() {
getTeamsByAccountId().then(({ data }) => { getTeamsByAccountId().then(({ data }) => {
@ -295,4 +315,7 @@
} }
} }
} }
.oh {
overflow: hidden;
}
</style> </style>

@ -56,6 +56,7 @@
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
this.toIndex() this.toIndex()
} else { } else {
uni.clearStorageSync()
this.isLogin = false this.isLogin = false
this.getPhone = false this.getPhone = false
} }

@ -13,7 +13,7 @@
<view v-if="auth('我的:我的收益')" class="item"> <view v-if="auth('我的:我的收益')" class="item">
<view class="left"> <view class="left">
<image class="icon" src="@/static/image/person1.png" mode=""></image> <image class="icon" src="@/static/image/person1.png" mode=""></image>
<text class="name">我的收益</text> <text class="name">我的项目收益</text>
</view> </view>
<text class="val">{{ my.myIncome}}</text> <text class="val">{{ my.myIncome}}</text>
</view> </view>

@ -176,4 +176,7 @@ ul {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
background-color: rgba(255, 255, 255, 0.95); background-color: rgba(255, 255, 255, 0.95);
-webkit-user-drag: none;
-webkit-user-select: none;
user-select: none;
} }
Loading…
Cancel
Save