Browse Source

添加退出

和田中职
suyanyan 4 days ago
parent
commit
25a022d8ce
3 changed files with 456 additions and 453 deletions
  1. +195
    -195
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json
  2. +1
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue
  3. +260
    -257
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue

+ 195
- 195
Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json View File

@@ -1,196 +1,196 @@
{
"name" : "智慧校园",
"appid" : "__UNI__7C24C09",
"description" : "智慧校园移动端",
"versionName" : "2.2.0.250110",
"versionCode" : 20200,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"softinputNavBar" : "none",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : false,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "工作流程中需要相册权限以选择并上传图片",
"NSPhotoLibraryAddUsageDescription" : "将图片保存到本机",
"NSCameraUsageDescription" : "工作流程中需要相机权限以选择并上传图片"
},
"idfa" : false
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen" : {
"android" : {
"xxhdpi" : "G:/薛礼根/2018/数字化校园/数字化校园png/北京泉江/数字化校园APP----引导页1080_1882.png",
"xhdpi" : "G:/薛礼根/2018/数字化校园/数字化校园png/北京泉江/数字化校园APP----引导页720_1242.png",
"hdpi" : "G:/薛礼根/2018/数字化校园/数字化校园png/北京泉江/数字化校园APP----引导页480_762.png"
},
"ios" : {
"iphone" : {
"portrait-896h@3x" : "res/startup/startup-ios-x.png",
"portrait-896h@2x" : "res/startup/startup-ios-x.png",
"iphonex" : "res/startup/startup-ios-x.png",
"retina55" : "res/startup/startup-ios-16-9.png",
"retina47" : "res/startup/startup-ios-16-9.png",
"retina40" : "res/startup/startup-ios-3-2.png",
"retina35" : "res/startup/startup-ios-3-2.png"
}
}
}
},
"uniStatistics" : {
"enable" : false
},
"nvueLaunchMode" : "fast"
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wxbc18c9bf92c86d28",
"setting" : {
"urlCheck" : false,
"es6" : true,
"postcss" : false,
"minified" : true
},
"usingComponents" : true,
"optimization" : {
"subPackages" : true
},
"uniStatistics" : {
"enable" : false
}
},
"mp-alipay" : {
"usingComponents" : true,
"component2" : true,
"enableParallelLoader" : true,
"uniStatistics" : {
"enable" : false
},
"appid" : ""
},
"mp-dingtalk" : {
"usingComponents" : true,
"component2" : true,
"enableParallelLoader" : true,
"uniStatistics" : {
"enable" : false
},
"appid" : ""
},
"mp-baidu" : {
"usingComponents" : true,
"uniStatistics" : {
"enable" : false
}
},
"mp-toutiao" : {
"usingComponents" : true,
"uniStatistics" : {
"enable" : false
}
},
"h5" : {
"uniStatistics" : {
"enable" : false
},
"router" : {
"mode" : "hash",
"base" : ""
},
"title" : "数字化智慧校园",
"template" : "index.html",
"optimization" : {
"treeShaking" : {
"enable" : false
}
},
"domain" : "testapp.bjquanjiang.com",
"devServer" : {
"port" : 8000,
"https" : false
}
},
"mp-qq" : {
"uniStatistics" : {
"enable" : false
}
},
"uniStatistics" : {
"enable" : false
}
}
"name": "智慧校园",
"appid": "__UNI__7C24C09",
"description": "智慧校园移动端",
"versionName": "2.2.0.250110",
"versionCode": 20200,
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
"usingComponents": true,
"softinputNavBar": "none",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": false,
"autoclose": true,
"delay": 0
},
/* 模块配置 */
"modules": {},
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "工作流程中需要相册权限以选择并上传图片",
"NSPhotoLibraryAddUsageDescription": "将图片保存到本机",
"NSCameraUsageDescription": "工作流程中需要相机权限以选择并上传图片"
},
"idfa": false
},
/* SDK配置 */
"sdkConfigs": {
"ad": {}
},
"icons": {
"android": {
"hdpi": "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png"
},
"ios": {
"appstore": "unpackage/res/icons/1024x1024.png",
"ipad": {
"app": "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png"
},
"iphone": {
"app@2x": "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen": {
"android": {
"xxhdpi": "G:/薛礼根/2018/数字化校园/数字化校园png/北京泉江/数字化校园APP----引导页1080_1882.png",
"xhdpi": "G:/薛礼根/2018/数字化校园/数字化校园png/北京泉江/数字化校园APP----引导页720_1242.png",
"hdpi": "G:/薛礼根/2018/数字化校园/数字化校园png/北京泉江/数字化校园APP----引导页480_762.png"
},
"ios": {
"iphone": {
"portrait-896h@3x": "res/startup/startup-ios-x.png",
"portrait-896h@2x": "res/startup/startup-ios-x.png",
"iphonex": "res/startup/startup-ios-x.png",
"retina55": "res/startup/startup-ios-16-9.png",
"retina47": "res/startup/startup-ios-16-9.png",
"retina40": "res/startup/startup-ios-3-2.png",
"retina35": "res/startup/startup-ios-3-2.png"
}
}
}
},
"uniStatistics": {
"enable": false
},
"nvueLaunchMode": "fast"
},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wxbc18c9bf92c86d28",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": true
},
"usingComponents": true,
"optimization": {
"subPackages": true
},
"uniStatistics": {
"enable": false
}
},
"mp-alipay": {
"usingComponents": true,
"component2": true,
"enableParallelLoader": true,
"uniStatistics": {
"enable": false
},
"appid": ""
},
"mp-dingtalk": {
"usingComponents": true,
"component2": true,
"enableParallelLoader": true,
"uniStatistics": {
"enable": false
},
"appid": ""
},
"mp-baidu": {
"usingComponents": true,
"uniStatistics": {
"enable": false
}
},
"mp-toutiao": {
"usingComponents": true,
"uniStatistics": {
"enable": false
}
},
"h5": {
"uniStatistics": {
"enable": false
},
"router": {
"mode": "hash",
"base": ""
},
"title": "数字化智慧校园",
"template": "index.html",
"optimization": {
"treeShaking": {
"enable": false
}
},
"domain": "testapp.bjquanjiang.com",
"devServer": {
"port": 80,
"https": false
}
},
"mp-qq": {
"uniStatistics": {
"enable": false
}
},
"uniStatistics": {
"enable": false
}
}

+ 1
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue View File

@@ -96,7 +96,7 @@
<!--#endif -->
</view>
</view>
<!-- <tabBar selectedIndex='/pages/home'></tabBar> -->
<tabBar selectedIndex='/pages/home'></tabBar>
</view>
</template>



+ 260
- 257
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue View File

@@ -1,46 +1,42 @@
<template>
<view v-if="currentUser" id="my" class="page">
<!-- 顶部用户名、头像 banner -->
<view @click="goTo('info')" class="mybanner">
<view class="avatarslot">
<image
:src="avatarSrc()"
:style="{ borderRadius: roundAvatar ? '50%' : '3px' }"
mode="aspectFit"
class="avatar"
></image>
</view>
<view class="info">
<view class="username text-xl text-white">{{ currentUser.realName }}</view>
<view class="usertag">
<l-tag color="green">{{ userTag }}</l-tag>
</view>
</view>
<view class="badge text-white text-lg"><l-icon type="right" round /></view>
</view>

<!-- 用户信息菜单 -->
<l-list border card>
<l-list-item @click="goTo('contact')" arrow>
<l-icon type="phone" color="blue" />
联系方式
</l-list-item>
<!-- <l-list-item @click="goTo('qrcode')" arrow>
<view v-if="currentUser" id="my" class="page">
<!-- 顶部用户名、头像 banner -->
<view @click="goTo('info')" class="mybanner">
<view class="avatarslot">
<image :src="avatarSrc()" :style="{ borderRadius: roundAvatar ? '50%' : '3px' }" mode="aspectFit"
class="avatar"></image>
</view>
<view class="info">
<view class="username text-xl text-white">{{ currentUser.realName }}</view>
<view class="usertag">
<l-tag color="green">{{ userTag }}</l-tag>
</view>
</view>
<view class="badge text-white text-lg"><l-icon type="right" round /></view>
</view>

<!-- 用户信息菜单 -->
<l-list border card>
<l-list-item @click="goTo('contact')" arrow>
<l-icon type="phone" color="blue" />
联系方式
</l-list-item>
<!-- <l-list-item @click="goTo('qrcode')" arrow>
<l-icon type="qrcode" color="blue" />
我的二维码
</l-list-item> -->
<l-list-item @click="goTo('password')" arrow>
<!-- <l-list-item @click="goTo('password')" arrow>
<l-icon type="edit" color="blue" />
修改密码
</l-list-item>
<l-list-item @click="unbound" arrow>
</l-list-item> -->
<!-- <l-list-item @click="unbound" arrow>
<image src="@/static/unbound.png" mode="" style="color: #0081ff;width: 14px;height: 14px;margin: 0 10px 0 5px;"></image>
解绑微信
</l-list-item>
</l-list>
</l-list-item> -->
</l-list>

<!-- 关于菜单 -->
<!-- <l-list border card>
<!-- 关于菜单 -->
<!-- <l-list border card>
<l-list-item @click="goTo('learun')" arrow>
<l-icon type="home" color="blue" />
关于泉江
@@ -51,235 +47,242 @@
</l-list-item>
</l-list> -->

<view class="padding" style="padding-top: 0;">
<!-- 小程序账号绑定/解除按钮 -->
<!-- #ifdef MP-ALIPAY || MP-WEIXIN -->
<l-button
v-if="MPBind && !currentUser.miniProgram"
@click="userBind"
size="lg"
line="blue"
class="block margin-top"
block
>
绑定{{ PLATFORM_TEXT }}账号
</l-button>
<l-button
v-if="MPUnbind && currentUser.miniProgram"
@click="userUnBind"
size="lg"
line="red"
class="block margin-top"
block
>
解绑{{ PLATFORM_TEXT }}账号
</l-button>
<!-- #endif -->

<l-button @click="logout" size="lg" color="red" class="block margin-top" block>退出登录</l-button>
</view>

<view class="footer">{{ copyRightDisplay }}</view>
<tabBar selectedPath='/pages/my'></tabBar>
</view>
<view class="padding" style="padding-top: 0;">
<!-- 小程序账号绑定/解除按钮 -->
<!-- #ifdef MP-ALIPAY || MP-WEIXIN -->
<l-button v-if="MPBind && !currentUser.miniProgram" @click="userBind" size="lg" line="blue"
class="block margin-top" block>
绑定{{ PLATFORM_TEXT }}账号
</l-button>
<l-button v-if="MPUnbind && currentUser.miniProgram" @click="userUnBind" size="lg" line="red"
class="block margin-top" block>
解绑{{ PLATFORM_TEXT }}账号
</l-button>
<!-- #endif -->

<l-button @click="logout" size="lg" color="red" class="block margin-top" block>退出登录</l-button>
</view>

<view class="footer">{{ copyRightDisplay }}</view>
<tabBar selectedPath='/pages/my'></tabBar>
</view>
</template>

<script>
export default {
onShow() {
uni.hideTabBar()
},
methods: {
// 点击「注销登录」按钮
async logout() {
if (!(await this.CONFIRM('注销确认', '确定要注销登录吗?', true))) {
return
}

this.CLEAR_GLOBAL()
this.RELAUNCH_TO('/pages/login')
},

// #ifdef MP-ALIPAY || MP-WEIXIN
// 小程序绑定方法,只会编译到小程序
async userBind() {
const type = this.PLATFORM
const confirm = await this.CONFIRM(
'绑定确认',
`确定要将智慧校园账号与当前登录的${this.PLATFORM_TEXT}账号绑定吗?\n(绑定后可以使用一键登录功能)`,
true
)
if (!confirm) {
return
}

this.LOADING('绑定中…')
const [codeErr, { code }] = await uni.login({ provider: type })
if (codeErr || !code) {
this.HIDE_LOADING()
this.TOAST('获取用户授权码失败')
return
}

const success = await this.HTTP_POST('learun/adms/user/openid_bind', { code, type }, '绑定失败')
if (!success) {
return
}

this.HIDE_LOADING()
this.SET_GLOBAL('loginUser', Object.assign({}, this.currentUser, { miniProgram: true }))
this.TOAST(`已成功绑定到当前的${this.PLATFORM_TEXT}账号`)
},

// 解绑小程序
async userUnBind() {
const confirm = await this.CONFIRM(
'解绑确认',
'确定要解除小程序账号绑定吗? (解绑将自动退出登录,需使用力软账号和密码再次登录)',
true
)
if (!confirm) {
return
}

const success = await this.HTTP_POST('learun/adms/user/openid_unbind', { type: this.PLATFORM }, '解除绑定失败')
if (!success) {
return
}

this.CLEAR_GLOBAL()
this.RELAUNCH_TO('/pages/login')
this.TOAST('已成功解除绑定')
},
// #endif

// 跳转到
goTo(urlPath) {
this.NAV_TO(`/pages/my/${urlPath}`)
},
// 解绑微信
unbound(){
this.CONFIRM('提示', '确定要解绑微信账号?', true).then(res => {
if (res) {
this.LOADING('正在解绑…');
this.HTTP_POST('learun/adms/user/unbundWeiXin', null, '解绑失败').then(success => {
this.HIDE_LOADING();
if (!success) {
return
export default {
onShow() {
uni.hideTabBar()
},
methods: {
// 点击「注销登录」按钮
async logout() {
if (!(await this.CONFIRM('注销确认', '确定要注销登录吗?', true))) {
return
}
let res = await this.HTTP_GET(
'/api/ht/out'
)
console.log(res, "退出返回信息");
this.CLEAR_GLOBAL()
window.open(res.info)
// this.RELAUNCH_TO('/pages/login')
},

// #ifdef MP-ALIPAY || MP-WEIXIN
// 小程序绑定方法,只会编译到小程序
async userBind() {
const type = this.PLATFORM
const confirm = await this.CONFIRM(
'绑定确认',
`确定要将智慧校园账号与当前登录的${this.PLATFORM_TEXT}账号绑定吗?\n(绑定后可以使用一键登录功能)`,
true
)
if (!confirm) {
return
}

this.LOADING('绑定中…')
const [codeErr, {
code
}] = await uni.login({
provider: type
})
if (codeErr || !code) {
this.HIDE_LOADING()
this.TOAST('获取用户授权码失败')
return
}

const success = await this.HTTP_POST('learun/adms/user/openid_bind', {
code,
type
}, '绑定失败')
if (!success) {
return
}

this.HIDE_LOADING()
this.SET_GLOBAL('loginUser', Object.assign({}, this.currentUser, {
miniProgram: true
}))
this.TOAST(`已成功绑定到当前的${this.PLATFORM_TEXT}账号`)
},

// 解绑小程序
async userUnBind() {
const confirm = await this.CONFIRM(
'解绑确认',
'确定要解除小程序账号绑定吗? (解绑将自动退出登录,需使用力软账号和密码再次登录)',
true
)
if (!confirm) {
return
}

const success = await this.HTTP_POST('learun/adms/user/openid_unbind', {
type: this.PLATFORM
}, '解除绑定失败')
if (!success) {
return
}

this.CLEAR_GLOBAL()
this.RELAUNCH_TO('/pages/login')
this.TOAST('已成功解除绑定')
},
// #endif

// 跳转到
goTo(urlPath) {
this.NAV_TO(`/pages/my/${urlPath}`)
},

// 解绑微信
unbound() {
this.CONFIRM('提示', '确定要解绑微信账号?', true).then(res => {
if (res) {
this.LOADING('正在解绑…');
this.HTTP_POST('learun/adms/user/unbundWeiXin', null, '解绑失败').then(success => {
this.HIDE_LOADING();
if (!success) {
return
}
this.TOAST("解绑成功")
setTimeout(() => {
this.CLEAR_GLOBAL()
this.RELAUNCH_TO('/pages/login')
}, 1000)
});
}
this.TOAST("解绑成功")
setTimeout(()=>{
this.CLEAR_GLOBAL()
this.RELAUNCH_TO('/pages/login')
},1000)
});
},

// 用户头像 url
avatarSrc() {
if (!this.currentUser) {
return ''
}

return this.API + `/learun/adms/user/img?data=${this.currentUser.userId}`
}
});
},

// 用户头像 url
avatarSrc() {
if (!this.currentUser) {
return ''
}

return this.API + `/learun/adms/user/img?data=${this.currentUser.userId}`
}
},

computed: {
// 返回当前用户
currentUser() {
return this.GET_GLOBAL('loginUser')
},

// 获取组织结构 tag 的显示
userTag() {
if (!this.currentUser) {
return ''
}

const { companyId, departmentId } = this.currentUser
if (!companyId) {
return `总集团公司`
}

const company = this.GET_GLOBAL('company')
const dep = this.GET_GLOBAL('department')
// const companyName = company[companyId].name
// if (!dep) {
// return companyName
// }

// return `${companyName} / ${dep[departmentId].name}`
},

// 头像圆形/方形显示参数
roundAvatar() {
return this.CONFIG('pageConfig.roundAvatar')
},

// 页面底部公司/版权显示
copyRightDisplay() {
const year = new Date().getFullYear()
const company = this.CONFIG('company')

return `Copyright © ${year} ${company}`
},

// #ifdef MP-ALIPAY || MP-WEIXIN
// 是否显示小程序绑定按钮
MPBind() {
return this.CONFIG(`miniProgramAccount.${this.PLATFORM}`).includes('bind')
},

// 是否显示小程序解绑按钮
MPUnbind() {
return this.CONFIG(`miniProgramAccount.${this.PLATFORM}`).includes('unbind')
}
// #endif
}
}
},

computed: {
// 返回当前用户
currentUser() {
return this.GET_GLOBAL('loginUser')
},

// 获取组织结构 tag 的显示
userTag() {
if (!this.currentUser) {
return ''
}

const {
companyId,
departmentId
} = this.currentUser
if (!companyId) {
return `总集团公司`
}

const company = this.GET_GLOBAL('company')
const dep = this.GET_GLOBAL('department')
// const companyName = company[companyId].name
// if (!dep) {
// return companyName
// }

// return `${companyName} / ${dep[departmentId].name}`
},

// 头像圆形/方形显示参数
roundAvatar() {
return this.CONFIG('pageConfig.roundAvatar')
},

// 页面底部公司/版权显示
copyRightDisplay() {
const year = new Date().getFullYear()
const company = this.CONFIG('company')

return `Copyright © ${year} ${company}`
},

// #ifdef MP-ALIPAY || MP-WEIXIN
// 是否显示小程序绑定按钮
MPBind() {
return this.CONFIG(`miniProgramAccount.${this.PLATFORM}`).includes('bind')
},

// 是否显示小程序解绑按钮
MPUnbind() {
return this.CONFIG(`miniProgramAccount.${this.PLATFORM}`).includes('unbind')
}
// #endif
}
}
</script>

<style lang="less" scoped>
.page{
padding-bottom: 48px;
}
.mybanner {
background: #0c86d8;
height: 120px;
padding: 25px 15px;
display: flex;
align-items: center;

.avatarslot {
.avatar {
height: 80px;
width: 60px;
}
}

.info {
padding-left: 20px;

.username {
margin-bottom: 5px;
}
}

.badge {
flex-grow: 1;
display: flex;
justify-content: flex-end;
}
}

.footer {
text-align: center;
font-size: 14px;
color: #ccc;
margin-bottom: 10rpx;
}
</style>
.page {
padding-bottom: 48px;
}

.mybanner {
background: #0c86d8;
height: 120px;
padding: 25px 15px;
display: flex;
align-items: center;

.avatarslot {
.avatar {
height: 80px;
width: 60px;
}
}

.info {
padding-left: 20px;

.username {
margin-bottom: 5px;
}
}

.badge {
flex-grow: 1;
display: flex;
justify-content: flex-end;
}
}

.footer {
text-align: center;
font-size: 14px;
color: #ccc;
margin-bottom: 10rpx;
}
</style>

Loading…
Cancel
Save