<template>
|
|
<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0">
|
|
<view class="toast">
|
|
<view class="title">
|
|
提示
|
|
</view>
|
|
<view class="content">
|
|
本小程序需要登录之后才可以正常使用
|
|
</view>
|
|
<view class="btnstwo">
|
|
<view class="btn c" @click="cancel">
|
|
取消
|
|
</view>
|
|
<view class="btn c" @click="$store.commit('login')">
|
|
登录
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
</template>
|
|
|
|
<script setup>
|
|
export default {
|
|
name: 'ShowLogin',
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
methods: {
|
|
checkLogin() {
|
|
if (!uni.getStorageSync('token')) {
|
|
this.$refs.popup.open('center');
|
|
return true
|
|
}
|
|
},
|
|
|
|
cancel() {
|
|
this.$refs.popup.close('center')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.toast {
|
|
width: 500rpx;
|
|
background: white;
|
|
|
|
.title {
|
|
min-height: 70rpx;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
font-size: 32rpx;
|
|
}
|
|
|
|
.content {
|
|
font-size: 28rpx;
|
|
min-height: 300rpx;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.btnstwo {
|
|
display: flex;
|
|
|
|
.btn {
|
|
flex: 1;
|
|
// background: $uni-linear-gradient-btn-color;
|
|
// color: #fff;
|
|
padding: 20rpx 0;
|
|
text-align: center;
|
|
}
|
|
|
|
.c {
|
|
background: #fff;
|
|
border-top: 1px solid #999;
|
|
color: #333;
|
|
}
|
|
}
|
|
}
|
|
</style>
|