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

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

@@ -79,6 +79,27 @@ const eSigns = data => {
}) })
} }
// 账户信息 - 基础资料
const userInfoBase = () => {
return request({
url : 'user/base',
})
}
// 账户信息 - 机构列表
const userInfoBanks = () => {
return request({
url : 'user/base/banks',
})
}
// 账户信息 - 机构详情
const userInfoBank = id => {
return request({
url : 'user/base/' + id + '/bank',
})
}
export { export {
relations, relations,
code, code,
@@ -88,5 +109,8 @@ export {
certified, certified,
certification, certification,
identityOcr, identityOcr,
eSigns eSigns,
userInfoBase,
userInfoBanks,
userInfoBank
} }

View File

@@ -31,20 +31,21 @@
/* android */ /* android */
"android" : { "android" : {
"permissions" : [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
], ],
"schemes" : "doufire" "schemes" : "doufire"

View File

@@ -298,7 +298,17 @@
"navigationBarTitleText": "机构信息", "navigationBarTitleText": "机构信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#446EFE", "navigationBarBackgroundColor": "#446EFE",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "使用历史",
"color": "#ffffff",
"fontSize": "28rpx",
"width": "180rpx"
}]
}
}
} }
}, { }, {
"path": "pages/work/perfectBasis", "path": "pages/work/perfectBasis",
@@ -308,7 +318,17 @@
"navigationBarTitleText": "基础信息", "navigationBarTitleText": "基础信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#446EFE", "navigationBarBackgroundColor": "#446EFE",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "使用历史",
"color": "#ffffff",
"fontSize": "28rpx",
"width": "180rpx"
}]
}
}
} }
}, { }, {
"path": "pages/transfers/lists", "path": "pages/transfers/lists",
@@ -396,7 +416,35 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}], }, {
"path": "pages/user/userdata",
"auth": true,
"name": "UserData",
"style": {
"navigationBarTitleText": "账户信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
}
}, {
"path": "pages/user/userdataBase",
"auth": true,
"name": "UserDataBase",
"style": {
"navigationBarTitleText": "账户信息 - 基础信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
}
},{
"path": "pages/user/userdataBanks",
"auth": true,
"name": "UserDataBank",
"style": {
"navigationBarTitleText": "账户信息 - 机构信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
}
}
],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "抖火", "navigationBarTitleText": "抖火",

View File

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

View File

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

View File

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

View File

@@ -16,14 +16,14 @@
</view> </view>
</view> </view>
<view class="set-nav-block"> <view class="set-nav-block">
<view class="set-nav" @click="onNav('ResetPassword')"> <view class="set-nav" @click="onNav('ResetPassword', { type: 'userSet' })">
<label>修改密码</label> <label>修改密码</label>
<view class="value nowrap"> <view class="value nowrap">
<uni-icons type="right" color="gray"></uni-icons> <uni-icons type="right" color="gray"></uni-icons>
</view> </view>
</view> </view>
<view class="border-solid-empty"></view> <view class="border-solid-empty"></view>
<view class="set-nav" @click="onNav()"> <view class="set-nav" @click="onNav('UserData')">
<label>账户信息</label> <label>账户信息</label>
<view class="value nowrap"> <view class="value nowrap">
<uni-icons type="right" color="gray"></uni-icons> <uni-icons type="right" color="gray"></uni-icons>
@@ -75,8 +75,9 @@
name: 'Auth' name: 'Auth'
}) })
}, },
onNav(name){ onNav(name, p){
this.$Router.push({name}) 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-back order-flex">
<view class="order-title">订单信息</view> <view class="order-title">订单信息</view>
<view class="order-item"> <view class="order-item" @click="copyNo(order_no)">
<label>订单编号</label> <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>
<view class="order-item"> <view class="order-item">
<label>创建时间</label> <label>创建时间</label>
@@ -132,14 +132,20 @@
onCallPhone(phone){ onCallPhone(phone){
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone, phoneNumber: phone,
fail(err) { })
},
// 复制订单号码
copyNo(no){
uni.setClipboardData({
data : no,
success : res => {
uni.showToast({ uni.showToast({
title: err.message, title: '订单号已复制',
icon : 'none' icon : 'none'
}) })
} }
}) })
} },
} }
} }
</script> </script>
@@ -211,6 +217,11 @@
} }
} }
} }
.order-value-icon{
display: inline-block;
vertical-align: middle;
margin-bottom: 10rpx;
}
&.order-value-price{ &.order-value-price{
color: red; color: red;
font-weight: bold; font-weight: bold;

View File

@@ -22,7 +22,7 @@
<view class="orders" v-if="orders.length > 0"> <view class="orders" v-if="orders.length > 0">
<view class="orders-item" v-for="(item, index) in orders" :key="index"> <view class="orders-item" v-for="(item, index) in orders" :key="index">
<view class="orders-flex"> <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" v-if="!item.is_my">客户</text>
<text class="orders-tag order-tag-my" v-else>个人</text> <text class="orders-tag order-tag-my" v-else>个人</text>
{{item.order_no}} {{item.order_no}}
@@ -30,13 +30,14 @@
<view class="state">{{item.status.text}}</view> <view class="state">{{item.status.text}}</view>
</view> </view>
<view class="orders-content"> <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> <label>业务类型</label>
<view class="nowrap orders-content-type"> <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> <text v-for="(itemType, indexType) in item.item_type" :key="indexType" v-if="itemType.number > 0">{{itemType.title}}x{{itemType.number}}</text>
</view> </view>
<uni-icons class="orders-content-icon" :type="item.is_show_type ? 'top': 'bottom'" size="14" color="gray"></uni-icons>
</view> </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" 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-title">{{citem.institution.title}}({{citem.business_type.title}})</view>
<view class="item-flex-value">{{citem.price}}</view> <view class="item-flex-value">{{citem.price}}</view>
@@ -52,7 +53,7 @@
</view> </view>
</view> </view>
<view class="orders-flex"> <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> <image class="user-cover" :src="item.user.avatar" mode="aspectFill"></image>
<view class="user-name">{{item.user.nickname}}</view> <view class="user-name">{{item.user.nickname}}</view>
</view> </view>
@@ -168,6 +169,9 @@
status: this.tabType status: this.tabType
}).then(res => { }).then(res => {
let { data } = res; let { data } = res;
data.map(val => {
val.is_show_type = false
})
this.orders = data this.orders = data
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
@@ -270,6 +274,24 @@
icon : 'none' 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{ label{
color: #999999; color: #999999;
} }
&.orders-content-bottom{
padding-right: 40rpx;
position: relative;
.orders-content-icon{
position: absolute;
right: 0;
top: 0;
}
}
} }
&-type{ &-type{
text{ text{

View File

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

View File

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