<template>
|
<view class="page">
|
<view class="title">请选择登录身份</view>
|
<view class="sub-title">切换角色后需使用对应身份重新登录</view>
|
<view class="card" @click="goOps">
|
<view class="name">运维人员</view>
|
<view class="desc">工单、巡检、设备运维</view>
|
</view>
|
<view class="card merchant" @click="goMerchant">
|
<view class="name">商户</view>
|
<view class="desc">交电费、查合同、查账单</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
onLoad (option) {
|
if (option && option.switch === '1') return
|
const userType = uni.getStorageSync('userType')
|
const token = uni.getStorageSync('token')
|
if (userType === 0 && token) {
|
uni.redirectTo({ url: '/pages/index' })
|
} else if (userType === 1 && token) {
|
uni.redirectTo({ url: '/pages/customer/index' })
|
}
|
},
|
methods: {
|
goOps () {
|
uni.setStorageSync('userType', 0)
|
uni.redirectTo({ url: '/pages/login' })
|
},
|
goMerchant () {
|
uni.setStorageSync('userType', 1)
|
uni.redirectTo({ url: '/pages/customer/login' })
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.page { min-height: 100vh; padding: 120rpx 48rpx; background: linear-gradient(180deg, #e8f0ff 0%, #fff 100%); }
|
.title { font-size: 44rpx; font-weight: 600; margin-bottom: 16rpx; color: #222; }
|
.sub-title { font-size: 26rpx; color: #999; margin-bottom: 48rpx; }
|
.card { background: #fff; border-radius: 24rpx; padding: 40rpx; margin-bottom: 32rpx; box-shadow: 0 8rpx 24rpx rgba(0,0,0,.06); }
|
.card.merchant { border: 2rpx solid #3c7cff; }
|
.name { font-size: 36rpx; font-weight: 600; color: #222; }
|
.desc { margin-top: 12rpx; font-size: 26rpx; color: #888; }
|
</style>
|