个人中心账户信息功能开发

This commit is contained in:
唐明明
2022-12-27 17:42:15 +08:00
parent b141c6cd97
commit c3e137f302
14 changed files with 847 additions and 428 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="registered-content">
<view class="title">重置账户登录密码</view>
<view class="title">{{type == 'userSet' ? '修改' : '找回'}}账户登录密码</view>
<view class="submit-title">请填写账号信息</view>
<view class="from">
<view class="from-inpus from-input-phoen">
@@ -46,6 +46,7 @@
export default {
data() {
return {
type : '',
username : '',
password : '',
confirmation: '',
@@ -58,6 +59,14 @@
captchaShow : false
};
},
created() {
if(this.$Route.query.type == 'userSet'){
uni.setNavigationBarTitle({
title: '修改密码'
})
this.type = this.$Route.query.type
}
},
methods: {
// 提交修改信息
onRegistered(){
@@ -77,7 +86,7 @@
clearInterval(outTime);
uni.showModal({
title : "提示",
content : "登录密码已重置",
content : "登录密码已变更",
showCancel : false,
confirmColor: "#446EFE",
success : modalRes => {

View File

@@ -158,7 +158,6 @@
},
getZf(){
zf().then(res=>{
console.log(res)
// this.jfList = res
}).catch(err=>{
uni.showToast({

View File

@@ -113,7 +113,6 @@
}
})
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'

View File

@@ -16,14 +16,14 @@
</view>
</view>
<view class="set-nav-block">
<view class="set-nav" @click="onNav('ResetPassword')">
<view class="set-nav" @click="onNav('ResetPassword', { type: 'userSet' })">
<label>修改密码</label>
<view class="value nowrap">
<uni-icons type="right" color="gray"></uni-icons>
</view>
</view>
<view class="border-solid-empty"></view>
<view class="set-nav" @click="onNav()">
<view class="set-nav" @click="onNav('UserData')">
<label>账户信息</label>
<view class="value nowrap">
<uni-icons type="right" color="gray"></uni-icons>
@@ -75,8 +75,9 @@
name: 'Auth'
})
},
onNav(name){
this.$Router.push({name})
onNav(name, p){
let params = p || {}
this.$Router.push({name, params})
}
}
}

106
pages/user/userdata.vue Normal file
View File

@@ -0,0 +1,106 @@
<template>
<view class="content">
<view class="content-label">基础资料</view>
<view class="content-block">
<view class="content-item" @click="onNav('UserDataBase', {})">
<view class="title nowrap">基础信息</view>
<uni-icons type="right" color="gray"></uni-icons>
</view>
</view>
<view class="content-label">机构资料</view>
<view class="content-block" v-if="banks.length > 0">
<view class="content-item" v-for="(item, index) in banks" :key="index" @click="onNav('UserDataBank', {id: item.user_bank_id})">
<view class="text">
<view class="text-title nowrap">{{item.institution.title || '-'}}</view>
<view class="text-time nowrap">更新时间{{item.created_at || '-'}}</view>
</view>
<uni-icons type="right" color="gray"></uni-icons>
</view>
</view>
<view v-else class="content-null">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
text="暂无机构资料数据"
>
</u-empty>
</view>
</view>
</template>
<script>
import { userInfoBanks } from '@/apis/interfaces/user.js'
export default {
data() {
return {
banks: []
};
},
created() {
uni.showLoading({
title: '加载中...',
mask : true
})
userInfoBanks().then(res => {
this.banks = res;
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods: {
onNav(name, params){
this.$Router.push({
name,
params
})
}
}
}
</script>
<style lang="scss">
.content-label{
padding: 15rpx 30rpx;
font-size: 30rpx;
color: gray;
}
.content-block{
background: white;
.content-item{
display: flex;
justify-content: space-between;
align-items: center;
line-height: 40rpx;
padding: 30rpx;
font-size: 32rpx;
.text{
width: 80%;
.text-title{
font-size: 32rpx;
}
.text-time{
font-size: 28rpx;
color: gray
}
}
@extend .border-solid;
&::after{
left: 30rpx;
}
&:last-child::after{
display: none;
}
}
}
.content-null{
background-color: white;
height: 50vh;
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@@ -0,0 +1,73 @@
<template>
<view class="content">
<view class="content-block" v-if="params.length > 0">
<view class="content-item" v-for="(item, index) in params" :key="index">
<view class="text-title nowrap">{{item.title || '-'}}</view>
<view class="text-value">{{item.value_text || '-'}}</view>
</view>
</view>
</view>
</template>
<script>
import { userInfoBank } from '@/apis/interfaces/user.js'
export default {
data() {
return {
params: []
};
},
created() {
uni.showLoading({
title: '加载中...',
mask : true
})
userInfoBank(this.$Route.query.id).then(res => {
let { params, institution } = res;
this.params = params;
uni.setNavigationBarTitle({
title: institution.title + '-机构资料'
})
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
.content{
padding: 30rpx 0;
box-sizing: border-box;
.content-block{
background: white;
.content-item{
display: flex;
justify-content: space-between;
align-items: center;
line-height: 40rpx;
padding: 30rpx;
font-size: 30rpx;
.text-title{
width: 300rpx;
color: gray;
}
.text-value{
width: calc( 100% - 300rpx);
text-align: right;
}
@extend .border-solid;
&::after{
left: 30rpx;
}
&:last-child::after{
display: none;
}
}
}
}
</style>

113
pages/user/userdataBase.vue Normal file
View File

@@ -0,0 +1,113 @@
<template>
<view class="content" v-if="info.name">
<view class="content-block">
<view class="content-item">
<view class="text-title nowrap">姓名</view>
<view class="text-value">{{info.name || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">性别</view>
<view class="text-value">{{info.sex || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">年龄</view>
<view class="text-value">{{info.age || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">手机号码</view>
<view class="text-value">{{info.mobile || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">属相</view>
<view class="text-value">{{info.zodiak || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">身份证号</view>
<view class="text-value">{{info.id_card || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">婚姻状况</view>
<view class="text-value">{{info.marriages[info.marriage] || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">配偶姓名</view>
<view class="text-value">{{info.mate || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">学历</view>
<view class="text-value">{{info.educations[info.education] || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">毕业院校</view>
<view class="text-value">{{info.school || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">身份证地址</view>
<view class="text-value">{{info.address || '-'}}</view>
</view>
<view class="content-item">
<view class="text-title nowrap">联系地址</view>
<view class="text-value">{{info.contact_address || '-'}}</view>
</view>
</view>
</view>
</template>
<script>
import { userInfoBase } from '@/apis/interfaces/user.js'
export default {
data() {
return {
info: {}
};
},
created() {
uni.showLoading({
title: '加载中...',
mask : true
})
userInfoBase().then(res => {
this.info = res;
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
.content{
padding: 30rpx 0;
box-sizing: border-box;
.content-block{
background: white;
.content-item{
display: flex;
justify-content: space-between;
align-items: center;
line-height: 40rpx;
padding: 30rpx;
font-size: 30rpx;
.text-title{
width: 200rpx;
color: gray;
}
.text-value{
width: calc( 100% - 200rpx);
text-align: right;
}
@extend .border-solid;
&::after{
left: 30rpx;
}
&:last-child::after{
display: none;
}
}
}
}
</style>

View File

@@ -62,9 +62,9 @@
<!-- 订单其他信息 -->
<view class="order-back order-flex">
<view class="order-title">订单信息</view>
<view class="order-item">
<view class="order-item" @click="copyNo(order_no)">
<label>订单编号</label>
<view class="order-value nowrap">{{order_no || '-'}}</view>
<view class="order-value nowrap">{{order_no || '-'}}<u-icon class="order-value-icon" name="file-text" color="gray" size="18"></u-icon></view>
</view>
<view class="order-item">
<label>创建时间</label>
@@ -132,14 +132,20 @@
onCallPhone(phone){
uni.makePhoneCall({
phoneNumber: phone,
fail(err) {
})
},
// 复制订单号码
copyNo(no){
uni.setClipboardData({
data : no,
success : res => {
uni.showToast({
title: err.message,
title: '订单号已复制',
icon : 'none'
})
}
})
}
},
}
}
</script>
@@ -211,6 +217,11 @@
}
}
}
.order-value-icon{
display: inline-block;
vertical-align: middle;
margin-bottom: 10rpx;
}
&.order-value-price{
color: red;
font-weight: bold;

View File

@@ -22,7 +22,7 @@
<view class="orders" v-if="orders.length > 0">
<view class="orders-item" v-for="(item, index) in orders" :key="index">
<view class="orders-flex">
<view class="no nowrap">
<view class="no nowrap" @click="copyNo(item.order_no)">
<text class="orders-tag" v-if="!item.is_my">客户</text>
<text class="orders-tag order-tag-my" v-else>个人</text>
{{item.order_no}}
@@ -30,13 +30,14 @@
<view class="state">{{item.status.text}}</view>
</view>
<view class="orders-content">
<view class="orders-content-item">
<view class="orders-content-item orders-content-bottom" @click="item.is_show_type = !item.is_show_type">
<label>业务类型</label>
<view class="nowrap orders-content-type">
<text v-for="(itemType, indexType) in item.item_type" :key="indexType" v-if="itemType.number > 0">{{itemType.title}}x{{itemType.number}}</text>
</view>
<uni-icons class="orders-content-icon" :type="item.is_show_type ? 'top': 'bottom'" size="14" color="gray"></uni-icons>
</view>
<view class="orders-content-block">
<view class="orders-content-block" v-show="item.is_show_type">
<view class="item-flex" v-for="(citem, cindex) in item.items" :key="cindex">
<view class="item-flex-title">{{citem.institution.title}}({{citem.business_type.title}})</view>
<view class="item-flex-value">{{citem.price}}</view>
@@ -52,7 +53,7 @@
</view>
</view>
<view class="orders-flex">
<view class="user">
<view class="user" @click="makePhone(item.user.username)">
<image class="user-cover" :src="item.user.avatar" mode="aspectFill"></image>
<view class="user-name">{{item.user.nickname}}</view>
</view>
@@ -168,6 +169,9 @@
status: this.tabType
}).then(res => {
let { data } = res;
data.map(val => {
val.is_show_type = false
})
this.orders = data
}).catch(err => {
uni.showToast({
@@ -270,6 +274,24 @@
icon : 'none'
})
})
},
// 复制订单号码
copyNo(no){
uni.setClipboardData({
data : no,
success : res => {
uni.showToast({
title: '订单号已复制',
icon : 'none'
})
}
})
},
// 拨打电话
makePhone(phone){
uni.makePhoneCall({
phoneNumber: phone
})
}
}
}
@@ -302,6 +324,15 @@
label{
color: #999999;
}
&.orders-content-bottom{
padding-right: 40rpx;
position: relative;
.orders-content-icon{
position: absolute;
right: 0;
top: 0;
}
}
}
&-type{
text{

View File

@@ -1,5 +1,5 @@
<template>
<view v-if="base.name">
<view class="content" v-if="base.name">
<view class="item-flex">
<label>姓名</label>
<view class="value">{{base.name || '-'}}</view>
@@ -79,6 +79,9 @@
</script>
<style lang="scss">
.content{
padding: 30rpx 0;
}
.item-flex{
display: flex;
justify-content: space-between;
@@ -86,6 +89,7 @@
position: relative;
line-height: 40rpx;
align-items: center;
background: white;
label{
width: 200rpx;
font-size: 30rpx;
@@ -97,14 +101,12 @@
width: calc( 100% - 200rpx );
font-size: 30rpx;
}
@extend .border-solid;
&::after{
position: absolute;
left: 30rpx;
right: 0;
bottom: 0;
height: 1rpx;
content: " ";
background: #f6f6f6;
}
&:last-child::after{
display: none;
}
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view class="content">
<view class="item-flex" v-for="(item, index) in params" :key="index">
<label>{{item.title}}</label>
<view class="value">{{item.value_text || '-'}}</view>
@@ -35,6 +35,9 @@
</script>
<style lang="scss">
.content{
padding: 30rpx 0;
}
.item-flex{
display: flex;
justify-content: space-between;
@@ -42,6 +45,7 @@
position: relative;
line-height: 40rpx;
align-items: center;
background: white;
label{
width: 300rpx;
font-size: 30rpx;
@@ -53,14 +57,12 @@
width: calc( 100% - 300rpx );
font-size: 30rpx;
}
@extend .border-solid;
&::after{
position: absolute;
left: 30rpx;
right: 0;
bottom: 0;
height: 1rpx;
content: " ";
background: #f6f6f6;
}
&:last-child::after{
display: none;
}
}
</style>