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>
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js'
export default {
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() {

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

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

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

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

@ -1,5 +1,5 @@
<template>
<view class="page">
<view :class="['page', {oh: !per}]">
<image class="bg" src="@/static/image/index/index2.png" mode="widthFix"></image>
<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>
@ -103,6 +103,7 @@
</template>
<script>
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js'
import { getTeamsByAccountId, getTheBusinessManagerIdsUnderTheTeam } from '@/apis/modules/client.js'
import { treeList } from '@/apis/modules/parner.js'
export default {
@ -116,7 +117,7 @@
}
},
onShow() {
this.initRole()
this.getAuth()
},
methods: {
//
@ -127,6 +128,25 @@
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() {
getTeamsByAccountId().then(({ data }) => {
@ -295,4 +315,7 @@
}
}
}
.oh {
overflow: hidden;
}
</style>

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

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

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