|
|
@@ -6,10 +6,10 @@ import { useUserStore } from '@/store'
|
|
|
import { useTokenStore } from '@/store/token'
|
|
|
|
|
|
definePage({
|
|
|
- style: {
|
|
|
- navigationBarTitleText: '收益',
|
|
|
- navigationStyle: 'custom',
|
|
|
- },
|
|
|
+ style: {
|
|
|
+ navigationBarTitleText: '收益',
|
|
|
+ navigationStyle: 'custom',
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
@@ -19,152 +19,152 @@ const { userInfo } = storeToRefs(userStore)
|
|
|
|
|
|
// 微信小程序下登录
|
|
|
async function handleLogin() {
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- // 微信登录
|
|
|
- await tokenStore.wxLogin()
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ // 微信登录
|
|
|
+ await tokenStore.wxLogin()
|
|
|
|
|
|
- // #endif
|
|
|
- // #ifndef MP-WEIXIN
|
|
|
- uni.navigateTo({
|
|
|
- url: `${LOGIN_PAGE}`,
|
|
|
- })
|
|
|
- // #endif
|
|
|
+ // #endif
|
|
|
+ // #ifndef MP-WEIXIN
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `${LOGIN_PAGE}`,
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
}
|
|
|
|
|
|
function handleLogout() {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定要退出登录吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- // 清空用户信息
|
|
|
- useTokenStore().logout()
|
|
|
- // 执行退出登录逻辑
|
|
|
- uni.showToast({
|
|
|
- title: '退出登录成功',
|
|
|
- icon: 'success',
|
|
|
- })
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- // 微信小程序,去首页
|
|
|
- // uni.reLaunch({ url: '/pages/index/index' })
|
|
|
- // #endif
|
|
|
- // #ifndef MP-WEIXIN
|
|
|
- // 非微信小程序,去登录页
|
|
|
- // uni.navigateTo({ url: LOGIN_PAGE })
|
|
|
- // #endif
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定要退出登录吗?',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ // 清空用户信息
|
|
|
+ useTokenStore().logout()
|
|
|
+ // 执行退出登录逻辑
|
|
|
+ uni.showToast({
|
|
|
+ title: '退出登录成功',
|
|
|
+ icon: 'success',
|
|
|
+ })
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ // 微信小程序,去首页
|
|
|
+ // uni.reLaunch({ url: '/pages/index/index' })
|
|
|
+ // #endif
|
|
|
+ // #ifndef MP-WEIXIN
|
|
|
+ // 非微信小程序,去登录页
|
|
|
+ // uni.navigateTo({ url: LOGIN_PAGE })
|
|
|
+ // #endif
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 顶部导航栏高度,设置banner位置
|
|
|
const navigationBarHeight = ref(0)
|
|
|
// #ifdef MP-WEIXIN
|
|
|
function getNavigationBarHeight() {
|
|
|
- uni.getSystemInfo({
|
|
|
- success: (res) => {
|
|
|
- const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
|
|
- console.log('顶部导航栏高度:', res.statusBarHeight, menuButtonInfo)
|
|
|
- // 顶部导航栏高度 = 状态栏高度 + 胶囊的高度
|
|
|
- navigationBarHeight.value = res.statusBarHeight + menuButtonInfo.height + 12
|
|
|
- },
|
|
|
- })
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success: (res) => {
|
|
|
+ const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
|
|
+ console.log('顶部导航栏高度:', res.statusBarHeight, menuButtonInfo)
|
|
|
+ // 顶部导航栏高度 = 状态栏高度 + 胶囊的高度
|
|
|
+ navigationBarHeight.value = res.statusBarHeight + menuButtonInfo.height + 12
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
getNavigationBarHeight()
|
|
|
// #endif
|
|
|
|
|
|
function menuClick(page: string) {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages-A/${page}/index`,
|
|
|
- })
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages-A/${page}/index`,
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <view class="profile-container">
|
|
|
- <!-- 顶部区域 -->
|
|
|
- <view class="income-header" style="background: url('../../static/images/me/me-bg.png') no-repeat center center; background-size: cover;">
|
|
|
- <view class="income-header-avatar-info" :style="{ paddingTop: `${navigationBarHeight}px` }">
|
|
|
- <view class="income-header-balance">
|
|
|
- 当前账户余额(元)
|
|
|
- </view>
|
|
|
- <view class="income-header-balance-num">
|
|
|
- <view class="income-header-balance-num-amount">
|
|
|
- 7297491.08
|
|
|
- </view>
|
|
|
- <view class="income-header-balance-num-btns">
|
|
|
- <view class="income-header-balance-num-btn js">
|
|
|
- 解锁
|
|
|
+ <view class="profile-container">
|
|
|
+ <!-- 顶部区域 -->
|
|
|
+ <view class="income-header" style="background: url('../../static/images/me/me-bg.png') no-repeat center center; background-size: cover;">
|
|
|
+ <view class="income-header-avatar-info" :style="{ paddingTop: `${navigationBarHeight}px` }">
|
|
|
+ <view class="income-header-balance">
|
|
|
+ 当前账户余额(元)
|
|
|
+ </view>
|
|
|
+ <view class="income-header-balance-num">
|
|
|
+ <view class="income-header-balance-num-amount">
|
|
|
+ 7297491.08
|
|
|
+ </view>
|
|
|
+ <view class="income-header-balance-num-btns">
|
|
|
+ <view class="income-header-balance-num-btn js">
|
|
|
+ 解锁
|
|
|
+ </view>
|
|
|
+ <view class="income-header-balance-num-btn tx">
|
|
|
+ 提现
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="income-header-balance-num-btn tx">
|
|
|
- 提现
|
|
|
+ <view class="income-header-tips">
|
|
|
+ <view class="income-header-tips-item">
|
|
|
+ <view class="income-header-tips-item-num">
|
|
|
+ 729000.00
|
|
|
+ </view>
|
|
|
+ <view class="income-header-tips-item-des">
|
|
|
+ 可提现金额
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="income-header-tips-item">
|
|
|
+ <view class="income-header-tips-item-num">
|
|
|
+ 1,125
|
|
|
+ </view>
|
|
|
+ <view class="income-header-tips-item-des">
|
|
|
+ 未结算金额
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income-header-tips">
|
|
|
- <view class="income-header-tips-item">
|
|
|
- <view class="income-header-tips-item-num">
|
|
|
- 729000.00
|
|
|
- </view>
|
|
|
- <view class="income-header-tips-item-des">
|
|
|
- 可提现金额
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income-header-tips-item">
|
|
|
- <view class="income-header-tips-item-num">
|
|
|
- 1,125
|
|
|
- </view>
|
|
|
- <view class="income-header-tips-item-des">
|
|
|
- 未结算金额
|
|
|
- </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 公告 -->
|
|
|
- <view class="income-header-notice">
|
|
|
- <view class="income-header-notice-icon">
|
|
|
- <image src="@/static/images/income/notice.png" mode="" />
|
|
|
- </view>
|
|
|
- <view class="income-header-notice-content">
|
|
|
- 在考核周期内未达标已锁定收益,<text>前往查看~</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 菜单 -->
|
|
|
- <view class="income-header-menu">
|
|
|
- <!-- 结算筛选 -->
|
|
|
- <view class="income-header-menu-filter">
|
|
|
- <view class="income-header-menu-filter-item active">
|
|
|
- 待结算
|
|
|
- </view>
|
|
|
- <view class="income-header-menu-filter-item">
|
|
|
- 已结算
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income-header-menu-item" @click="menuClick('applyForm')">
|
|
|
- <view class="income-header-menu-icon">
|
|
|
- <image src="@/static/images/me/coupon-need.png" mode="" />
|
|
|
- <view class="income-header-menu-text">
|
|
|
- 发券人申请
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income-header-menu-left">
|
|
|
- <u-icon name="arrow-right" color="#979797" size="12" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="income-header-menu-item" @click="handleLogout">
|
|
|
- <view class="income-header-menu-icon">
|
|
|
- <image src="@/static/images/me/loginOut.png" mode="" />
|
|
|
- <view class="income-header-menu-text">
|
|
|
- 退出登录
|
|
|
- </view>
|
|
|
+ <!-- 公告 -->
|
|
|
+ <view class="income-header-notice">
|
|
|
+ <view class="income-header-notice-icon">
|
|
|
+ <image src="@/static/images/income/notice.png" mode="" />
|
|
|
+ </view>
|
|
|
+ <view class="income-header-notice-content">
|
|
|
+ 在考核周期内未达标已锁定收益,<text>前往查看~</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="income-header-menu-left">
|
|
|
- <u-icon name="arrow-right" color="#979797" size="12" />
|
|
|
+ <!-- 菜单 -->
|
|
|
+ <view class="income-header-menu">
|
|
|
+ <!-- 结算筛选 -->
|
|
|
+ <view class="income-header-menu-filter">
|
|
|
+ <view class="income-header-menu-filter-item active">
|
|
|
+ 待结算
|
|
|
+ </view>
|
|
|
+ <view class="income-header-menu-filter-item">
|
|
|
+ 已结算
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="income-header-menu-item" @click="menuClick('applyForm')">
|
|
|
+ <view class="income-header-menu-icon">
|
|
|
+ <image src="@/static/images/me/coupon-need.png" mode="" />
|
|
|
+ <view class="income-header-menu-text">
|
|
|
+ 发券人申请
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="income-header-menu-left">
|
|
|
+ <u-icon name="arrow-right" color="#979797" size="12" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="income-header-menu-item" @click="handleLogout">
|
|
|
+ <view class="income-header-menu-icon">
|
|
|
+ <image src="@/static/images/me/loginOut.png" mode="" />
|
|
|
+ <view class="income-header-menu-text">
|
|
|
+ 退出登录
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="income-header-menu-left">
|
|
|
+ <u-icon name="arrow-right" color="#979797" size="12" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|