feat(login): 添加迷你登录页面并更新相关组件
- 新增迷你登录页面 indexMini.vue - 更新 Tabbar.vue 组件样式和图片路径 - 修改 mineMini.vue 组件跳转逻辑至迷你登录页
This commit is contained in:
parent
1ba80c041c
commit
b3cd7aff28
|
|
@ -3,12 +3,13 @@
|
||||||
<PageHeaderView title="个人中心"></PageHeaderView>
|
<PageHeaderView title="个人中心"></PageHeaderView>
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<view class="userContainer">
|
<view class="userContainer">
|
||||||
<u-avatar src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png" size="60"></u-avatar>
|
<u-avatar
|
||||||
|
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png"
|
||||||
|
size="60"
|
||||||
|
></u-avatar>
|
||||||
<view class="userData">
|
<view class="userData">
|
||||||
<text class="phone">{{
|
<text class="phone">{{
|
||||||
!isLoginStatus
|
!isLoginStatus ? "未登录用户" : maskPhoneNumber()
|
||||||
? "未登录用户"
|
|
||||||
: maskPhoneNumber()
|
|
||||||
}}</text>
|
}}</text>
|
||||||
<!-- <view class="setUserData">
|
<!-- <view class="setUserData">
|
||||||
编辑我的个人资料
|
编辑我的个人资料
|
||||||
|
|
@ -34,30 +35,53 @@
|
||||||
<!-- 其他功能区 -->
|
<!-- 其他功能区 -->
|
||||||
<view class="otherContainer" v-if="isLoginStatus">
|
<view class="otherContainer" v-if="isLoginStatus">
|
||||||
<u-cell-group :border="false">
|
<u-cell-group :border="false">
|
||||||
<u-cell title="已订阅栏目" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip.png" isLink
|
<u-cell
|
||||||
:iconStyle="{ width: '46rpx', height: '32rpx', marginRight: '14rpx' }" :titleStyle="{
|
title="已订阅栏目"
|
||||||
|
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip.png"
|
||||||
|
isLink
|
||||||
|
:iconStyle="{ width: '46rpx', height: '32rpx', marginRight: '14rpx' }"
|
||||||
|
:titleStyle="{
|
||||||
fontSize: '32rpx',
|
fontSize: '32rpx',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
}" @click="handleClick(-1)">
|
}"
|
||||||
|
@click="handleClick(-1)"
|
||||||
|
>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell title="我的收藏" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png" isLink
|
<u-cell
|
||||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
title="我的收藏"
|
||||||
|
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png"
|
||||||
|
isLink
|
||||||
|
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||||
|
:titleStyle="{
|
||||||
fontSize: '32rpx',
|
fontSize: '32rpx',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
}" @click="handleClick(0)">
|
}"
|
||||||
|
@click="handleClick(0)"
|
||||||
|
>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell title="我喜欢的" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png" isLink
|
<u-cell
|
||||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
title="我喜欢的"
|
||||||
|
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png"
|
||||||
|
isLink
|
||||||
|
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||||
|
:titleStyle="{
|
||||||
fontSize: '32rpx',
|
fontSize: '32rpx',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
}" @click="handleClick(1)">
|
}"
|
||||||
|
@click="handleClick(1)"
|
||||||
|
>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<!-- title="浏览记录" :icon="time" :border="false" -->
|
<!-- title="浏览记录" :icon="time" :border="false" -->
|
||||||
<u-cell icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png" isLink
|
<u-cell
|
||||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png"
|
||||||
|
isLink
|
||||||
|
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||||
|
:titleStyle="{
|
||||||
fontSize: '32rpx',
|
fontSize: '32rpx',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
}" @click="handleClick(2)">
|
}"
|
||||||
|
@click="handleClick(2)"
|
||||||
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="recordText">
|
<view class="recordText">
|
||||||
<text style="font-size: 32rpx">浏览记录</text>
|
<text style="font-size: 32rpx">浏览记录</text>
|
||||||
|
|
@ -82,8 +106,12 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 登录弹框 -->
|
<!-- 登录弹框 -->
|
||||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
<LoginPopup
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
:show="LoginShow"
|
||||||
|
@handlePopupClose="handlePopupClose"
|
||||||
|
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||||
|
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -103,26 +131,23 @@ const isLoginStatus = ref(false);
|
||||||
const LoginShow = ref(false);
|
const LoginShow = ref(false);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log("🚀 ~ uni.getStorageSync('token'):", uni.getStorageSync('token'))
|
console.log("🚀 ~ uni.getStorageSync('token'):", uni.getStorageSync("token"));
|
||||||
|
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync("token")) {
|
||||||
isLoginStatus.value = true;
|
isLoginStatus.value = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 将手机号的中间四位用 * 代替
|
// 将手机号的中间四位用 * 代替
|
||||||
const maskPhoneNumber = (phoneNumber: string) => {
|
const maskPhoneNumber = (phoneNumber: string) => {
|
||||||
if (!phoneNumber && uni.getStorageSync('userPhone')) {
|
if (!phoneNumber && uni.getStorageSync("userPhone")) {
|
||||||
phoneNumber = uni.getStorageSync('userPhone')
|
phoneNumber = uni.getStorageSync("userPhone");
|
||||||
}
|
}
|
||||||
if (phoneNumber) {
|
if (phoneNumber) {
|
||||||
return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "未登录用户";
|
return "未登录用户";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 关闭弹框
|
// 关闭弹框
|
||||||
|
|
@ -146,7 +171,10 @@ const loginBtnStatus = () => {
|
||||||
// 登录状态,点击就是退出登录
|
// 登录状态,点击就是退出登录
|
||||||
loginOut();
|
loginOut();
|
||||||
} else {
|
} else {
|
||||||
LoginShow.value = true;
|
// LoginShow.value = true;
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/login/indexMini",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,39 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="tabbar">
|
<view class="tabbar">
|
||||||
<view class="tabbar_item" @click="tabChange(0)">
|
<view class="tabbar_item" @click="tabChange(0)">
|
||||||
<image v-if="tabIndex == 1"
|
<image
|
||||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.pngg"
|
v-if="tabIndex == 1"
|
||||||
class="tabbar_img" />
|
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.png"
|
||||||
<image v-if="tabIndex == 0"
|
class="tabbar_img"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
v-if="tabIndex == 0"
|
||||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
||||||
class="tabbar_img" />
|
class="tabbar_img"
|
||||||
<text class="tabbar_title" :style="{ color: tabIndex == 0 ? '#D13E3C' : '#757A80' }">海外资讯</text>
|
/>
|
||||||
|
<text
|
||||||
|
class="tabbar_title"
|
||||||
|
:style="{ color: tabIndex == 0 ? '#D13E3C' : '#757A80' }"
|
||||||
|
>海外资讯</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="tabbar_item" @click="tabChange(1)">
|
<view class="tabbar_item" @click="tabChange(1)">
|
||||||
<image v-if="tabIndex == 0"
|
<image
|
||||||
|
v-if="tabIndex == 0"
|
||||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
|
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
|
||||||
class="tabbar_img" />
|
class="tabbar_img"
|
||||||
<image v-if="tabIndex == 1"
|
/>
|
||||||
|
<image
|
||||||
|
v-if="tabIndex == 1"
|
||||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
|
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
|
||||||
class="tabbar_img" />
|
class="tabbar_img"
|
||||||
<text class="tabbar_title" :style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }">全部</text>
|
/>
|
||||||
|
<text
|
||||||
|
class="tabbar_title"
|
||||||
|
:style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }"
|
||||||
|
>全部</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -30,10 +46,9 @@ const tabIndex = ref(0);
|
||||||
function tabChange(index) {
|
function tabChange(index) {
|
||||||
tabIndex.value = index;
|
tabIndex.value = index;
|
||||||
emit("tabChange", index);
|
emit("tabChange", index);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => { });
|
onMounted(async () => {});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
{
|
{
|
||||||
"path": "pages/login/index"
|
"path": "pages/login/index"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/login/indexMini"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/realtimeInfo/rankDetail"
|
"path": "pages/realtimeInfo/rankDetail"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
<template>
|
||||||
|
<view class="loginContainer">
|
||||||
|
<!-- prompt -->
|
||||||
|
<!-- <view class="prompt"></view> -->
|
||||||
|
<!-- logo -->
|
||||||
|
<view class="logo"></view>
|
||||||
|
|
||||||
|
<view class="bottom_btn" @click="goIndex"> 立即进入 </view>
|
||||||
|
<!-- 用户协议 -->
|
||||||
|
<view class="tips">
|
||||||
|
<u-checkbox class="checkbox" shape="circle"></u-checkbox>
|
||||||
|
<text class="r_userAgreement"
|
||||||
|
>已阅读并同意<text class="userAgreement"
|
||||||
|
>《江南农商银行隐私政策》《中证参考智能资讯小程序服务使用许可及服务协议》</text
|
||||||
|
>,首次登录的手机号将自动注册。</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref, reactive, watch, nextTick, onActivated } from "vue";
|
||||||
|
import {
|
||||||
|
onLaunch,
|
||||||
|
onShow,
|
||||||
|
onLoad,
|
||||||
|
onShareAppMessage,
|
||||||
|
onShareTimeline,
|
||||||
|
onUnload,
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
|
|
||||||
|
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
|
||||||
|
import { useShareStore } from "@/stores/shareStore";
|
||||||
|
const stores = useShareStore();
|
||||||
|
|
||||||
|
let timer = ref();
|
||||||
|
|
||||||
|
function goIndex() {
|
||||||
|
const subStatus = {
|
||||||
|
overseas: false, // 海外
|
||||||
|
domestic: false, // 国内
|
||||||
|
chinaSecurities: false, // 中证
|
||||||
|
};
|
||||||
|
uni.setStorageSync("subStatus", subStatus);
|
||||||
|
|
||||||
|
// 清空缓存数据
|
||||||
|
uni.removeStorageSync("tabValue");
|
||||||
|
uni.removeStorageSync("colTypeValue");
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/home/index",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onShareAppMessage((res) => {
|
||||||
|
return {};
|
||||||
|
});
|
||||||
|
// onReachBottom(() => {
|
||||||
|
// console.log("🚀 ~ onReachBottom ~ onReachBottom:");
|
||||||
|
// });
|
||||||
|
|
||||||
|
// 当进入页面时
|
||||||
|
onLoad((option) => {
|
||||||
|
// timer.value = setTimeout(() => {
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: "/pages/home/index",
|
||||||
|
// });
|
||||||
|
// }, 2000)
|
||||||
|
});
|
||||||
|
|
||||||
|
// 当离开页面时
|
||||||
|
onUnload(() => {
|
||||||
|
clearTimeout(timer.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
stores.initWxConfig();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.loginContainer {
|
||||||
|
height: 100vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/log_bg.png);
|
||||||
|
background-size: cover;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 176rpx 0;
|
||||||
|
|
||||||
|
.prompt {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 596rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 0;
|
||||||
|
margin-top: 176rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/new_logo.png);
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 292rpx;
|
||||||
|
height: 68rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
bottom: 0;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
margin-bottom: 176rpx;
|
||||||
|
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/logo.png);
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom_btn {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: linear-gradient(to right, #fc5c69, #e7303f);
|
||||||
|
border-radius: 100rpx;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 270rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: 0.1);
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
color: white;
|
||||||
|
font-size: 32rpx;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 87vw;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 370rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
display: flex;
|
||||||
|
align-items: start;
|
||||||
|
|
||||||
|
.checkbox {
|
||||||
|
}
|
||||||
|
:deep(.u-checkbox) {
|
||||||
|
margin-top: 5rpx;
|
||||||
|
}
|
||||||
|
.r_userAgreement {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #192236;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
.userAgreement {
|
||||||
|
color: #5978b2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue