98 lines
2.1 KiB
Vue
98 lines
2.1 KiB
Vue
<template>
|
|
<view>
|
|
<u-navbar
|
|
class="u-navbar"
|
|
title="我的"
|
|
placeholder
|
|
@leftClick="leftClick"
|
|
leftIconColor="#fff"
|
|
bgColor="#00337A"
|
|
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
|
|
/>
|
|
|
|
<view class="header-user">
|
|
<view>{{ userName }}</view>
|
|
<view>{{ userPhone }}</view>
|
|
</view>
|
|
|
|
<view class="message-push" @tap="onMessagePush">
|
|
<uni-icons type="email" size="30" style="color: #9da7b0; margin-right: 36rpx"></uni-icons>
|
|
短信推送
|
|
</view>
|
|
|
|
<m-tabbar fixed fill :current="2" :tabbar="tabbar"></m-tabbar>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import TabbarConfig from '../util/tabbar'
|
|
export default {
|
|
data() {
|
|
return {
|
|
tabbar: TabbarConfig,
|
|
userName: '',
|
|
userPhone: '',
|
|
wkPermissions: []
|
|
}
|
|
},
|
|
methods: {
|
|
// 返回
|
|
leftClick() {
|
|
uni.reLaunch({
|
|
url: '/pages/gzt/index'
|
|
})
|
|
},
|
|
/* 短信推送按钮 */
|
|
onMessagePush() {
|
|
console.log('推送')
|
|
|
|
if (this.wkPermissions.length > 0) {
|
|
const isPush = this.wkPermissions.some(e => e.name == '短信推送')
|
|
|
|
if (isPush) {
|
|
// console.log('具备权限')
|
|
uni.navigateTo({ url: '/pages/workPlan/messagePush/index' })
|
|
} else {
|
|
uni.showToast({
|
|
title: '当前无短信推送权限,请联系管理员!',
|
|
icon: 'none',
|
|
mask: true
|
|
})
|
|
}
|
|
}
|
|
|
|
console.log(this.wkPermissions, '权限')
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.userName = uni.getStorageSync('wkName')
|
|
this.userPhone = uni.getStorageSync('userPhone')
|
|
this.wkPermissions = uni.getStorageSync('wkPermissions')
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.header-user {
|
|
padding: 60rpx 0 18rpx 60rpx;
|
|
background-color: #f2f6f9;
|
|
color: #003778;
|
|
|
|
view {
|
|
padding: 8rpx 0;
|
|
font-size: 30rpx;
|
|
}
|
|
}
|
|
|
|
.message-push {
|
|
margin-top: 24rpx;
|
|
padding-left: 60rpx;
|
|
padding: 30rpx 0 30rpx 60rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
background-color: #f2f6f9;
|
|
color: #9da7b0;
|
|
font-size: 28rpx;
|
|
}
|
|
</style>
|