完善添加银行卡功能
This commit is contained in:
55
pages/discover/company.vue
Normal file
55
pages/discover/company.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<script setup></script>
|
||||
|
||||
<template>
|
||||
<view class="company">
|
||||
<view class="top-log">
|
||||
<image
|
||||
src="https://qcloud.dpfile.com/pc/TrdZpLN1zkXDV4oN2FH98LdVnvHj694NKQu0_KA3ul4eYxZWRPQ7CJuw-PqyZBS4.jpg"
|
||||
mode="aspectFill"
|
||||
class="img"
|
||||
></image>
|
||||
<text>名字</text>
|
||||
</view>
|
||||
|
||||
<view class="consten">
|
||||
<view class="item">富文本</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.top-log {
|
||||
margin: 114rpx 0 96rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.img {
|
||||
width: 192rpx;
|
||||
height: 192rpx;
|
||||
}
|
||||
text {
|
||||
margin-top: 32rpx;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.consten {
|
||||
padding: 0 24rpx;
|
||||
.item {
|
||||
background: #ffffff;
|
||||
padding: 48rpx 32rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -20,6 +20,14 @@
|
||||
navigateTo('/pages/discover/punch')
|
||||
return
|
||||
}
|
||||
if (item === 'company') {
|
||||
navigateTo('/pages/discover/company')
|
||||
return
|
||||
}
|
||||
if (item === 'circle') {
|
||||
navigateTo('/pages/discover/dynamic/dynamic')
|
||||
return
|
||||
}
|
||||
if (item === 'mall') {
|
||||
navigateTo('/pages/mall/list')
|
||||
return
|
||||
|
||||
115
pages/discover/dynamic/dynamic.vue
Normal file
115
pages/discover/dynamic/dynamic.vue
Normal file
@@ -0,0 +1,115 @@
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue'
|
||||
import { onPageScroll } from '@dcloudio/uni-app'
|
||||
|
||||
const MAX_SCROLL = 446
|
||||
|
||||
const cbNavBar = ref({})
|
||||
const topIcon = reactive({
|
||||
leftColor: '#ffffff',
|
||||
rightColor: '#ffffff'
|
||||
})
|
||||
|
||||
onPageScroll(e => {
|
||||
cbNavBar.value?.updateScroll(e.scrollTop)
|
||||
if (e.scrollTop > MAX_SCROLL - 220) {
|
||||
topIcon.leftColor = '#000'
|
||||
topIcon.rightColor = '#000'
|
||||
} else {
|
||||
topIcon.leftColor = '#ffffff'
|
||||
topIcon.rightColor = '#ffffff'
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="dynamic">
|
||||
<nav-bar
|
||||
ref="cbNavBar"
|
||||
isTopBg
|
||||
target-color="#f9f9f9"
|
||||
:max-scroll="MAX_SCROLL"
|
||||
>
|
||||
<template #back>
|
||||
<uni-icons
|
||||
:color="topIcon.leftColor"
|
||||
type="left"
|
||||
size="24"
|
||||
></uni-icons>
|
||||
</template>
|
||||
<template #right>
|
||||
<uni-icons
|
||||
:color="topIcon.rightColor"
|
||||
type="camera"
|
||||
size="24"
|
||||
></uni-icons>
|
||||
</template>
|
||||
</nav-bar>
|
||||
<view class="top-bg-img">
|
||||
<image
|
||||
src="https://wx4.sinaimg.cn/mw690/006i0nC8ly1hqugav3k6yj31o01o0aod.jpg"
|
||||
mode="aspectFill"
|
||||
class="img"
|
||||
></image>
|
||||
<!-- 用户信息 -->
|
||||
<view class="user-info">
|
||||
<text>名字</text>
|
||||
<image
|
||||
src="https://img2.baidu.com/it/u=3408192385,656358498&fm=253&app=138&f=JPEG?w=760&h=760"
|
||||
mode="aspectFill"
|
||||
class="avatar"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 动态列表 -->
|
||||
<view class="dynamic-list">
|
||||
<view v-for="item in 4" class="list">
|
||||
<image
|
||||
src="https://img1.baidu.com/it/u=2645961124,1296922095&fm=253&app=138&f=JPEG?w=800&h=1530"
|
||||
mode="aspectFill"
|
||||
class="avatar"
|
||||
></image>
|
||||
<view class="content">
|
||||
<text class="name">名字</text>
|
||||
<text class="text">这是一条朋友圈的标题</text>
|
||||
<view class="img-list">
|
||||
<image
|
||||
src="https://p4.itc.cn/images01/20220619/46660ed163164c14be90e605a73ee5e8.jpeg"
|
||||
mode="aspectFill"
|
||||
class="item-img"
|
||||
></image>
|
||||
</view>
|
||||
<!-- 地址 -->
|
||||
<view class="address">
|
||||
<text>19分钟前</text>
|
||||
<text>重庆市渝北xxx寄街道</text>
|
||||
</view>
|
||||
<!-- 点赞评论 -->
|
||||
<view class="like-box">
|
||||
<view class="like">
|
||||
<uni-icons
|
||||
type="hand-up"
|
||||
size="20"
|
||||
color="#747474"
|
||||
></uni-icons>
|
||||
<text>22</text>
|
||||
</view>
|
||||
<uni-icons type="chat" size="20" color="#747474"></uni-icons>
|
||||
</view>
|
||||
<!-- 评论内容 -->
|
||||
<view class="comment">
|
||||
<view v-for="item in 3" :key="item" class="comment-item">
|
||||
<text>Admin:</text>
|
||||
<text>确实的很好,值得推荐的很好</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../styles/dynamic.scss';
|
||||
</style>
|
||||
@@ -1,4 +1,15 @@
|
||||
<script setup></script>
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const indexData = ref([1, 2, 3, 4])
|
||||
|
||||
const onItem = item => {
|
||||
if (indexData.value.includes(item)) {
|
||||
return
|
||||
}
|
||||
indexData.value.push(item)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="punch">
|
||||
@@ -12,20 +23,130 @@
|
||||
</template>
|
||||
</nav-bar>
|
||||
<view class="public-header—box">
|
||||
<!-- <image
|
||||
src="/static/images/ranking-list/title-icon.png"
|
||||
mode="aspectFit"
|
||||
class="left-icon"
|
||||
></image>
|
||||
<view class="integral-box">
|
||||
<text>我的积分</text>
|
||||
<text>410</text>
|
||||
</view>
|
||||
<image
|
||||
src="/static/images/ranking-list/hat.png"
|
||||
src="/static/images/discover/calendar.png"
|
||||
mode="aspectFit"
|
||||
class="right-icon"
|
||||
></image> -->
|
||||
></image>
|
||||
</view>
|
||||
|
||||
<view class="punch-box">
|
||||
<view class="top-title">
|
||||
<text class="title">每日签到领积分</text>
|
||||
<view class="right-box">
|
||||
<text>已连续签到</text>
|
||||
<text>05</text>
|
||||
<text>天</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 签到列表 -->
|
||||
<view class="list-box">
|
||||
<view
|
||||
v-for="item in 30"
|
||||
:key="item"
|
||||
:class="{ active: indexData.includes(item) }"
|
||||
class="item"
|
||||
@click="onItem(item)"
|
||||
>
|
||||
<view class="bg-box">
|
||||
<image
|
||||
src="/static/images/discover/bean.png"
|
||||
mode="heightFix"
|
||||
class="icon"
|
||||
></image>
|
||||
<text>+10</text>
|
||||
</view>
|
||||
<text class="bottom-name">今天</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './styles/index.scss';
|
||||
.punch-box {
|
||||
padding: 0 24rpx;
|
||||
.top-title {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.right-box {
|
||||
margin-left: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
&:nth-child(2) {
|
||||
margin: 0 4rpx;
|
||||
color: #00d993;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-box {
|
||||
margin-top: 38rpx;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
grid-gap: 22rpx;
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.bg-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 80rpx;
|
||||
height: 100rpx;
|
||||
background: #f4f4f4;
|
||||
border-radius: 8rpx;
|
||||
.icon {
|
||||
height: 48rpx;
|
||||
}
|
||||
text {
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.bottom-name {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.active {
|
||||
.bg-box {
|
||||
background: linear-gradient(0deg, #00d993 0%, #00d9c5 100%);
|
||||
text {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.bottom-name {
|
||||
color: #00d993;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,36 @@
|
||||
<script setup></script>
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onPageScroll } from '@dcloudio/uni-app'
|
||||
import { getUserIntegralRank } from '@/api'
|
||||
|
||||
const cbNavBar = ref({})
|
||||
const listData = ref([])
|
||||
|
||||
const getData = async () => {
|
||||
const res = await getUserIntegralRank({
|
||||
pageNum: 1,
|
||||
pageSize: 100
|
||||
})
|
||||
listData.value = res.rows
|
||||
}
|
||||
|
||||
onPageScroll(e => {
|
||||
cbNavBar.value?.updateScroll(e.scrollTop)
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="ranking-list">
|
||||
<nav-bar>
|
||||
<nav-bar
|
||||
ref="cbNavBar"
|
||||
isTopBg
|
||||
target-color="#f9f9f9"
|
||||
:max-scroll="446"
|
||||
>
|
||||
<template #back>
|
||||
<image
|
||||
src="/static/images/public/return-icon.png"
|
||||
@@ -46,8 +74,8 @@
|
||||
</uni-row>
|
||||
<!-- 列表内容 -->
|
||||
<uni-row
|
||||
v-for="(item, index) in 19"
|
||||
:key="index"
|
||||
v-for="(item, index) in listData"
|
||||
:key="item.id"
|
||||
class="table-content"
|
||||
>
|
||||
<uni-col :span="6">
|
||||
@@ -69,14 +97,14 @@
|
||||
class="left-icon"
|
||||
></image>
|
||||
<view class="name">
|
||||
<text>张三</text>
|
||||
<text>名字</text>
|
||||
<text>158****98874</text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="table-right">
|
||||
<text class="item-text">100</text>
|
||||
<text class="item-text">{{ item.totalPoints }}</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
126
pages/discover/styles/dynamic.scss
Normal file
126
pages/discover/styles/dynamic.scss
Normal file
@@ -0,0 +1,126 @@
|
||||
.top-bg-img {
|
||||
width: 100%;
|
||||
height: 544rpx;
|
||||
position: relative;
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.user-info {
|
||||
position: absolute;
|
||||
right: 24rpx;
|
||||
bottom: -60rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
text {
|
||||
margin-top: 30rpx;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
.avatar {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dynamic-list {
|
||||
padding: 86rpx 26rpx 0 26rpx;
|
||||
.list + .list {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.list {
|
||||
display: flex;
|
||||
.avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 96rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: 32rpx;
|
||||
}
|
||||
.content {
|
||||
width: 100%;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.name {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin: 16rpx 0;
|
||||
}
|
||||
.img-list {
|
||||
.item-img {
|
||||
width: 410rpx;
|
||||
height: 250rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
.address {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 16rpx 0 14rpx;
|
||||
text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-right: 16rpx;
|
||||
&:last-child {
|
||||
font-size: 24rpx;
|
||||
color: #0c587e;
|
||||
}
|
||||
}
|
||||
}
|
||||
.like-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.like {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 86rpx;
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #747474;
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment {
|
||||
margin-top: 16rpx;
|
||||
padding: 16rpx 18rpx;
|
||||
background: #f9f9f9;
|
||||
border-radius: 8rpx;
|
||||
.comment-item + .comment-item {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.comment-item {
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-right: 8rpx;
|
||||
&:last-child {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,27 @@
|
||||
background: #ffffff;
|
||||
border-radius: 32rpx 32rpx 0rpx 0rpx;
|
||||
}
|
||||
.integral-box {
|
||||
width: 354rpx;
|
||||
height: 166rpx;
|
||||
position: absolute;
|
||||
bottom: 82rpx;
|
||||
left: 48rpx;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
&:last-child {
|
||||
font-size: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.left-icon {
|
||||
width: 354rpx;
|
||||
height: 166rpx;
|
||||
|
||||
72
pages/my-index/components/card-input.vue
Normal file
72
pages/my-index/components/card-input.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<script setup>
|
||||
const name = defineModel({
|
||||
type: String,
|
||||
default: ''
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
/**
|
||||
* 输入框状态类型
|
||||
* text: 文本
|
||||
* password: 密码
|
||||
* number: 数字
|
||||
* tel: 手机号
|
||||
* email: 邮箱
|
||||
*/
|
||||
type: {
|
||||
type: String,
|
||||
default: 'text'
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题'
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请输入'
|
||||
}
|
||||
})
|
||||
|
||||
const placeholderStyle = `font-family: PingFang SC, PingFang SC; font-weight: 500; color: #D9D9D9; font-size: 28rpx; font-style: normal; text-transform: none;`
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="card-input">
|
||||
<text class="title">{{ props.title }}</text>
|
||||
<input
|
||||
v-model="name"
|
||||
:type="props.type"
|
||||
:placeholder-style="placeholderStyle"
|
||||
:placeholder="props.placeholder"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card-input + .card-input {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.card-input {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 32rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
input {
|
||||
width: 340rpx;
|
||||
text-align: right;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,14 @@
|
||||
<script setup>
|
||||
import { useAuthUser } from '@/composables/useAuthUser'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { navigateTo } from '@/utils/router'
|
||||
|
||||
const bottomList = [
|
||||
{ name: '我的钱包', icon: 'wallet' },
|
||||
{
|
||||
name: '我的钱包',
|
||||
icon: 'wallet',
|
||||
url: '/pages/my-index/wallet/index'
|
||||
},
|
||||
{ name: '我的团队', icon: 'team' },
|
||||
{ name: '会议记录', icon: 'meeting' },
|
||||
{ name: '我的朋友圈', icon: 'circle' },
|
||||
@@ -11,11 +17,19 @@
|
||||
{ name: '系统设置', icon: 'system' }
|
||||
]
|
||||
const { userInfo } = useAuthUser()
|
||||
|
||||
onLoad(() => {
|
||||
// 获取用户信息
|
||||
console.log(userInfo.value, '===获取用户信息')
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="my-index">
|
||||
<view class="top-info">
|
||||
<view
|
||||
class="top-info"
|
||||
@click="navigateTo('/pages/my-index/personal-center/index')"
|
||||
>
|
||||
<view class="left-box">
|
||||
<image
|
||||
src="https://wx1.sinaimg.cn/mw690/92eeb099gy1i29hl0ne80j21jk2bcash.jpg"
|
||||
@@ -38,7 +52,7 @@
|
||||
<view class="top-box">
|
||||
<view class="left-name">
|
||||
<text>账户积分</text>
|
||||
<text>2933</text>
|
||||
<text>{{ userInfo?.totalPoints }}</text>
|
||||
</view>
|
||||
<view class="right-btn">
|
||||
<button>充值</button>
|
||||
@@ -50,6 +64,7 @@
|
||||
v-for="(item, index) in bottomList"
|
||||
:key="index"
|
||||
class="item-box"
|
||||
@click="item.url && navigateTo(item.url)"
|
||||
>
|
||||
<view class="item-name">
|
||||
<image
|
||||
@@ -82,7 +97,6 @@
|
||||
.top-info {
|
||||
padding: 32rpx 46rpx;
|
||||
background: #ffffff;
|
||||
height: 192rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
58
pages/my-index/personal-center/index.vue
Normal file
58
pages/my-index/personal-center/index.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<script setup>
|
||||
import { useAuthUser } from '@/composables/useAuthUser'
|
||||
|
||||
const itemList = [
|
||||
{ title: '我的二维码', key: '1', value: '' },
|
||||
{ title: 'ID', key: '2', value: 'userId' },
|
||||
{ title: '昵称', key: '3', value: 'userName' },
|
||||
{ title: '性别', key: '4', value: '' },
|
||||
{ title: '手机号码', key: '5', value: 'mobile' },
|
||||
{ title: '个性签名', key: '6', value: '' }
|
||||
]
|
||||
|
||||
const { userInfo } = useAuthUser()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="personal-center">
|
||||
<view class="public-card">
|
||||
<view class="left-img">
|
||||
<image
|
||||
src="https://p4.itc.cn/images01/20220619/46660ed163164c14be90e605a73ee5e8.jpeg"
|
||||
mode="aspectFill"
|
||||
class="avatar"
|
||||
></image>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<text class="value">换头像</text>
|
||||
<uni-icons type="right" size="16" color="#999999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-for="(item, index) in itemList"
|
||||
:key="index"
|
||||
class="public-card"
|
||||
>
|
||||
<view class="left-box">
|
||||
<text>{{ item.title }}</text>
|
||||
<text v-if="item.key === '6'" class="text">
|
||||
这个人很懒,什么也没有
|
||||
</text>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<text v-if="!['1', '6'].includes(item.key)" class="value">
|
||||
{{ item.value ? userInfo[item.value] : '' }}
|
||||
</text>
|
||||
<uni-icons type="right" size="16" color="#999999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../styles/index.scss';
|
||||
.personal-center {
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
</style>
|
||||
70
pages/my-index/styles/index.scss
Normal file
70
pages/my-index/styles/index.scss
Normal file
@@ -0,0 +1,70 @@
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.public-card + .public-card {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.public-card {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
|
||||
.left-box,
|
||||
.left-img,
|
||||
.right-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.left-img {
|
||||
.avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 96rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.card {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.left-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
width: 70%;
|
||||
text {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.text {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.right-box {
|
||||
align-items: flex-end;
|
||||
.value {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
63
pages/my-index/wallet/bank-card/card-details.vue
Normal file
63
pages/my-index/wallet/bank-card/card-details.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { reactive } from 'vue'
|
||||
import CardInput from '../../components/card-input.vue'
|
||||
|
||||
const stateData = reactive({
|
||||
title: '',
|
||||
state: '0'
|
||||
})
|
||||
|
||||
const formData = reactive({
|
||||
// 银行卡名称
|
||||
name: '',
|
||||
// 开户行名称
|
||||
khName: '',
|
||||
// 银行卡号
|
||||
cardNum: '',
|
||||
// 微信/支付宝号
|
||||
codeName: '',
|
||||
// 图片链接
|
||||
img: ''
|
||||
})
|
||||
onLoad(e => {
|
||||
const titltData = {
|
||||
0: '添加银行卡',
|
||||
101: '添加支付宝账户',
|
||||
102: '添加微信账户'
|
||||
}[e.key]
|
||||
stateData.title = titltData
|
||||
stateData.state = e.key
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<nav-bar isTopBg isPlaceholder :title="stateData.title"></nav-bar>
|
||||
|
||||
<view
|
||||
v-if="!['101', '102'].includes(stateData.state)"
|
||||
class="card-details"
|
||||
>
|
||||
<CardInput v-model="formData.name" title="银行名称"></CardInput>
|
||||
<CardInput v-model="formData.khName" title="开户行"></CardInput>
|
||||
<CardInput v-model="formData.cardNum" title="银行卡号"></CardInput>
|
||||
</view>
|
||||
|
||||
<view v-else class="card-details">
|
||||
<CardInput
|
||||
v-model="formData.codeName"
|
||||
:title="`${
|
||||
stateData.state === '101' ? '支付宝账号' : '微信账号'
|
||||
}`"
|
||||
></CardInput>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../../styles/index.scss';
|
||||
.card-details {
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
</style>
|
||||
56
pages/my-index/wallet/bank-card/index.vue
Normal file
56
pages/my-index/wallet/bank-card/index.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { navigateTo } from '@/utils/router'
|
||||
|
||||
const itemList = ref([
|
||||
{
|
||||
title: '支付宝',
|
||||
key: '101',
|
||||
icon: '/static/images/my-index/zfb.png'
|
||||
},
|
||||
{ title: '微信', key: '102', icon: '/static/images/my-index/wx.png' }
|
||||
])
|
||||
|
||||
const onAddCard = key => {
|
||||
navigateTo('/pages/my-index/wallet/bank-card/card-details', { key })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="bank-card">
|
||||
<view
|
||||
v-for="(item, index) in itemList"
|
||||
:key="index"
|
||||
class="public-card"
|
||||
@click="onAddCard(item.key)"
|
||||
>
|
||||
<view class="left-img">
|
||||
<image
|
||||
:src="
|
||||
item.icon
|
||||
? item.icon
|
||||
: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2024%2F1227%2F842e0e65j00sp543n001fd000i700iim.jpg&thumbnail=660x2147483647&quality=80&type=jpg'
|
||||
"
|
||||
mode="aspectFill"
|
||||
class="card"
|
||||
></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<uni-icons type="right" size="16" color="#999999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<bottom-view>
|
||||
<cb-button @click="onAddCard('0')">+添加银行卡</cb-button>
|
||||
</bottom-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../../styles/index.scss';
|
||||
.bank-card {
|
||||
padding: 38rpx 24rpx;
|
||||
}
|
||||
</style>
|
||||
101
pages/my-index/wallet/edit-password.vue
Normal file
101
pages/my-index/wallet/edit-password.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<script setup>
|
||||
import { reactive } from 'vue'
|
||||
import CardInput from '../components/card-input.vue'
|
||||
import { useUI } from '@/utils/use-ui'
|
||||
import { validateTransactionPassword } from '@/utils/validate'
|
||||
|
||||
const { showToast } = useUI()
|
||||
|
||||
const formData = reactive({
|
||||
// 旧密码
|
||||
password: '',
|
||||
// 新密码
|
||||
newPassword: '',
|
||||
// 确认密码
|
||||
confirmPassword: ''
|
||||
})
|
||||
const onEdit = () => {
|
||||
const passwordValue = validateTransactionPassword(
|
||||
formData.password,
|
||||
'旧密码'
|
||||
)
|
||||
if (!passwordValue.valid) {
|
||||
showToast(passwordValue.message)
|
||||
return
|
||||
}
|
||||
|
||||
const newPasswordValue = validateTransactionPassword(
|
||||
formData.newPassword,
|
||||
'新的交易密码'
|
||||
)
|
||||
if (!newPasswordValue.valid) {
|
||||
showToast(newPasswordValue.message)
|
||||
return
|
||||
}
|
||||
|
||||
const confirmPasswordValue = validateTransactionPassword(
|
||||
formData.confirmPassword,
|
||||
'确认交易密码'
|
||||
)
|
||||
if (!confirmPasswordValue.valid) {
|
||||
showToast(confirmPasswordValue.message)
|
||||
return
|
||||
}
|
||||
|
||||
if (formData.newPassword !== formData.confirmPassword) {
|
||||
showToast('两次密码不一致')
|
||||
return
|
||||
}
|
||||
|
||||
console.log('修改密码:', formData)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="edit-password">
|
||||
<nav-bar isTopBg isPlaceholder title="交易密码">
|
||||
<template #right>
|
||||
<text class="top-right-name" @click="onEdit">确认</text>
|
||||
</template>
|
||||
</nav-bar>
|
||||
|
||||
<view class="input-box">
|
||||
<CardInput
|
||||
v-model="formData.password"
|
||||
title="旧密码"
|
||||
type="password"
|
||||
></CardInput>
|
||||
<CardInput
|
||||
v-model="formData.newPassword"
|
||||
title="设置新的交易密码"
|
||||
type="password"
|
||||
></CardInput>
|
||||
<CardInput
|
||||
v-model="formData.confirmPassword"
|
||||
title="重复新的交易密码"
|
||||
type="password"
|
||||
></CardInput>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../styles/index.scss';
|
||||
|
||||
.top-right-name {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
background: #00d993;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
</style>
|
||||
125
pages/my-index/wallet/index.vue
Normal file
125
pages/my-index/wallet/index.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<script setup>
|
||||
import { navigateTo } from '@/utils/router'
|
||||
|
||||
const itemList = [
|
||||
{
|
||||
title: '提现卡',
|
||||
key: '1',
|
||||
url: '/pages/my-index/wallet/bank-card/index'
|
||||
},
|
||||
{ title: '交易记录', key: '2', url: '' },
|
||||
{
|
||||
title: '修改支付密码',
|
||||
key: '3',
|
||||
url: '/pages/my-index/wallet/edit-password'
|
||||
},
|
||||
{ title: '实名认证', key: '4', url: '' }
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="wallet">
|
||||
<!-- 顶部样式 -->
|
||||
<view class="top-card">
|
||||
<view class="left-box">
|
||||
<text>我的资产</text>
|
||||
<text>2222</text>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<button>充值</button>
|
||||
<button>提现</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-for="(item, index) in itemList"
|
||||
:key="index"
|
||||
class="public-card"
|
||||
@click="item.url && navigateTo(item.url)"
|
||||
>
|
||||
<view class="left-box">
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<uni-icons type="right" size="16" color="#999999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../styles/index.scss';
|
||||
.wallet {
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
|
||||
.top-card {
|
||||
padding: 36rpx;
|
||||
margin-bottom: 48rpx;
|
||||
background: #ff4c54;
|
||||
border-radius: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
&::after {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
right: 54rpx;
|
||||
content: '';
|
||||
position: absolute;
|
||||
background: url('/static/images/my-index/wallet-bg.png');
|
||||
background-size: 30%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
.left-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
margin-bottom: 8rpx;
|
||||
&:last-child {
|
||||
font-weight: bold;
|
||||
font-size: 64rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
.right-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
button {
|
||||
width: 128rpx;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
background: transparent;
|
||||
border: 2rpx solid #ffffff;
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
&:last-child {
|
||||
margin-left: 16rpx;
|
||||
background: #ffffff;
|
||||
color: #eb1c26;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user