|
@@ -1,7 +1,5 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
- <!-- <view :style="{height: statusBarHeight + 'px'}"></view> -->
|
|
|
- <!-- <view :style="{height: navBarHeight + 'px'}"></view> -->
|
|
|
<u-navbar :is-back="false" title="" :background="{ background: '#f7f7f7' }" :border-bottom="false">
|
|
|
<view class="slot-wrap">
|
|
|
<image src="/static/images/login-icon.png" mode="aspectFit" style="width: 200rpx;"></image>
|
|
@@ -62,6 +60,12 @@
|
|
|
</template>
|
|
|
</u-card>
|
|
|
</view>
|
|
|
+ <u-modal v-model="loginModal" mask-close-able class="modal" show-cancel-button
|
|
|
+ :title-style="{fontWeight: 'bold'}" @confirm="confirmModal">
|
|
|
+ <view class="modal-content">
|
|
|
+ <text>请登录后使用该功能</text>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -85,13 +89,12 @@
|
|
|
const navBarHeight = ref(0)
|
|
|
// 是否登录
|
|
|
const isLogin = ref(true)
|
|
|
+
|
|
|
+ const loginModal = ref(false)
|
|
|
// 是否为会员,从缓存里拿取用户信息
|
|
|
// const userInfo = uni.getStorageSync("userinfo") || {}
|
|
|
// const isMember = userInfo?.isMember || false
|
|
|
- const items= ref(['内容1', '内容2', '内容3', '内容4'])
|
|
|
- const onChange = (e) => {
|
|
|
- console.log('当前索引:', e.detail.current);
|
|
|
- }
|
|
|
+
|
|
|
// 首页-轮播图
|
|
|
const swiperList = ref([{
|
|
|
tupian: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.YKoZzgmubNBxQ8j-mmoTKAHaEK?rs=1&pid=ImgDetMain',
|
|
@@ -123,7 +126,6 @@
|
|
|
biaoti: '挑剔42341255243'
|
|
|
},
|
|
|
])
|
|
|
- const current = ref(0)
|
|
|
// 首页-导航栏
|
|
|
const navList = ref([{
|
|
|
id: 'notice',
|
|
@@ -225,15 +227,19 @@
|
|
|
return
|
|
|
}
|
|
|
if (!authStore.isAuthenticated) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/login/login"
|
|
|
- })
|
|
|
+ loginModal.value = true
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
url: data.url
|
|
|
})
|
|
|
}
|
|
|
+ const confirmModal = () => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/login/login"
|
|
|
+ })
|
|
|
+ }
|
|
|
const toPage = () => {
|
|
|
if (!authStore.isAuthenticated) {
|
|
|
uni.navigateTo({
|
|
@@ -242,15 +248,6 @@
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- const onSwiperChange = (event) => {
|
|
|
- this.current = event.detail.current; // 更新当前项
|
|
|
- }
|
|
|
- const onSwiper = (swiper) => {
|
|
|
- console.log(swiper);
|
|
|
- };
|
|
|
- const onSlideChange = () => {
|
|
|
- console.log('slide change');
|
|
|
- }
|
|
|
onReady(() => {
|
|
|
uni.getSystemInfo({
|
|
|
success(e) {
|
|
@@ -272,7 +269,7 @@
|
|
|
.container {
|
|
|
width: 100vw;
|
|
|
background-color: $uni-bg-color;
|
|
|
- padding: 0 20rpx;
|
|
|
+ padding: 0 20rpx 5rpx;
|
|
|
}
|
|
|
|
|
|
.slot-wrap {
|
|
@@ -422,4 +419,15 @@
|
|
|
color: white;
|
|
|
background: linear-gradient(45deg, #ff5858, #f09819); /* 示例背景 */
|
|
|
}
|
|
|
+
|
|
|
+ // 登录模拟态
|
|
|
+ .modal {
|
|
|
+ .modal-content {
|
|
|
+ padding: 50rpx;
|
|
|
+
|
|
|
+ .content-a {
|
|
|
+ color: #2979ff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|