4cf9d409 by lttnew

我的订单

1 parent e97c4b0a
...@@ -349,6 +349,14 @@ export function addSelectPageList(query) { ...@@ -349,6 +349,14 @@ export function addSelectPageList(query) {
349 }) 349 })
350 } 350 }
351 351
352 // 获取个人技术认证详情
353 export function getPersonTecDetails(type, personId) {
354 return request({
355 url: `/person/technology/getPersonTecDetails/${type}/${personId}`,
356 method: 'get'
357 })
358 }
359
352 export function fillAuditLog(ids) { 360 export function fillAuditLog(ids) {
353 return request({ 361 return request({
354 url: `/person/paymentRange/fillAuditLog/${ids}`, 362 url: `/person/paymentRange/fillAuditLog/${ids}`,
...@@ -1441,7 +1449,57 @@ export function bindUser(data) { ...@@ -1441,7 +1449,57 @@ export function bindUser(data) {
1441 1449
1442 export function unbindUser() { 1450 export function unbindUser() {
1443 return request({ 1451 return request({
1444 url: `/person/info/unbindUser`, 1452 url: `/person/info/unBindUser`,
1445 method: 'post' 1453 method: 'post'
1446 }) 1454 })
1455 }
1456 /**
1457 * 订单列表
1458 * @param params
1459 * @returns {*}
1460 */
1461 export function orderList(params) {
1462 return request({
1463 url: `/common/order/list`,
1464 method: 'get',
1465 params
1466 })
1467 }
1468
1469 /**
1470 * 删除订单
1471 * @param params
1472 * @returns {*}
1473 */
1474 export function deleteOrder(id) {
1475 return request({
1476 url: `/common/order/${id}`,
1477 method: 'delete'
1478 })
1479 }
1480 /**
1481 * 取消订单
1482 * @param params
1483 * @returns {*}
1484 */
1485 export function cancelPay(id) {
1486 return request({
1487 url: `/person/paymentRangeNew/cancelPay/${id}`,
1488 method: 'post'
1489 })
1490 }
1491
1492 export const outputInvoiceNo = (data) => {
1493 return request({
1494 url: `/common/order/outputInvoiceNo/${data.id}`,
1495 method: 'post',
1496 params: data
1497 })
1498 }
1499
1500 export function getAssoPers(perId) {
1501 return request({
1502 url: '/person/info/getRoleListByPerId/' + perId,
1503 method: 'get'
1504 })
1447 } 1505 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -47,6 +47,7 @@ function logout() { ...@@ -47,6 +47,7 @@ function logout() {
47 uni.removeStorageSync('token') 47 uni.removeStorageSync('token')
48 uni.removeStorageSync('userName') 48 uni.removeStorageSync('userName')
49 uni.removeStorageSync('webUserName') 49 uni.removeStorageSync('webUserName')
50 uni.removeStorageSync('openId')
50 51
51 userStore.setUser(null) 52 userStore.setUser(null)
52 app.globalData.isLogin = false 53 app.globalData.isLogin = false
......
1 // dev 1 // dev
2 const baseUrl_api = 'http://192.168.1.189:8787' 2 const baseUrl_api = 'http://192.168.1.137:8787'
3 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' 3 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
4 4
5 // prod 5 // prod
......
1 <template> 1 <template>
2 <view class="page"> 2 <view class="page">
3 <view class="bgbg"> 3 <view class="bgbg">
4 <view class="flex"> 4 <view class="flex">
5 <view class="imgbox"> 5 <view class="imgbox">
6 <image v-if="state.user.avatar" :src="state.user.avatar"/> 6 <image v-if="state.user.avatar" :src="state.user.avatar"/>
7 <image v-else src="@/static/nodata.png"/> 7 <image v-else src="@/static/nodata.png"/>
8 </view> 8 </view>
9 <text class="name">{{ state.user.userName }}</text> 9 <text class="name">{{ state.user.userName }}</text>
10 </view> 10 </view>
11 </view> 11 </view>
12 <view class="rMainBox"> 12 <view class="rMainBox">
13 <uni-list :border="false" class="myList"> 13 <uni-list :border="false" class="myList">
14 <uni-list-item thumb="/static/user_icon01.png" title="团体信息" showArrow clickable @click="goPath('/myCenter/teamInfo')"> 14 <uni-list-item thumb="/static/user_icon01.png" title="团体信息" showArrow clickable @click="goPath('/myCenter/teamInfo')">
15 </uni-list-item> 15 </uni-list-item>
16 16
17 <uni-list-item thumb="/static/user_icon02.png" title="会员认证" showArrow clickable @click="goPath('/myCenter/auth')"> 17 <uni-list-item thumb="/static/user_icon02.png" title="会员认证" showArrow clickable @click="goPath('/myCenter/auth')">
18 </uni-list-item> 18 </uni-list-item>
19 19
20 <!-- <uni-list-item thumb="/static/user_icon03.png" v-show="userType==2" title="账户信息" showArrow clickable> 20 <!-- <uni-list-item thumb="/static/user_icon03.png" v-show="userType==2" title="账户信息" showArrow clickable>
21 </uni-list-item> --> 21 </uni-list-item> -->
22 22
23 <uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')"> 23 <uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')">
24 </uni-list-item> 24 </uni-list-item>
25 25 <uni-list-item thumb="/static/user_icon03.png" title="我的订单" showArrow clickable @click="goPath('/myCenter/order')">
26 </uni-list> 26 </uni-list-item>
27 27
28 </view> 28 </uni-list>
29 29
30 <view class="fixedBottom" style="background: transparent;box-shadow: none;"> 30 </view>
31 <button @click="loginOut" class="btn btn-red" style="border-radius: 50px;">退出登录</button> 31
32 <view class="fixedBottom" style="background: transparent;box-shadow: none;">
33 <button @click="loginOut" class="btn btn-red" style="border-radius: 50px;">退出登录</button>
32 </view> 34 </view>
33 </view> 35 </view>
34 </template> 36 </template>
...@@ -60,11 +62,11 @@ let proId; ...@@ -60,11 +62,11 @@ let proId;
60 const svId = ref(null); 62 const svId = ref(null);
61 const numData = ref({}); 63 const numData = ref({});
62 64
63 const messageList = ref([]) 65 const messageList = ref([])
64 const state = reactive({ 66 const state = reactive({
65 user: {}, 67 user: {},
66 roleGroup: {}, 68 roleGroup: {},
67 postGroup: {} 69 postGroup: {}
68 }) 70 })
69 onShow(() => { 71 onShow(() => {
70 if (app.globalData.isLogin) { 72 if (app.globalData.isLogin) {
...@@ -80,12 +82,12 @@ onLoad(option => { ...@@ -80,12 +82,12 @@ onLoad(option => {
80 proId = decodeURIComponent(option.scene); 82 proId = decodeURIComponent(option.scene);
81 } else { 83 } else {
82 proId = option.proId; 84 proId = option.proId;
83 } 85 }
84 if(uni.showShareMenu){ 86 if(uni.showShareMenu){
85 uni.showShareMenu({ 87 uni.showShareMenu({
86 withShareTicket: true, 88 withShareTicket: true,
87 menus: ['shareAppMessage', 'shareTimeline'] 89 menus: ['shareAppMessage', 'shareTimeline']
88 }); 90 });
89 } 91 }
90 }); 92 });
91 93
...@@ -104,21 +106,21 @@ function loginOut() { ...@@ -104,21 +106,21 @@ function loginOut() {
104 } 106 }
105 }) 107 })
106 } 108 }
107 function getUser() { 109 function getUser() {
108 api.getUserProfile().then((response) => { 110 api.getUserProfile().then((response) => {
109 state.user = response.data.user 111 state.user = response.data.user
110 if(state.user.avatar&&state.user.avatar.indexOf('http')==-1){ 112 if(state.user.avatar&&state.user.avatar.indexOf('http')==-1){
111 state.user.avatar = config.baseUrl_api+state.user.avatar 113 state.user.avatar = config.baseUrl_api+state.user.avatar
112 } 114 }
113 state.roleGroup = response.data.roleGroup 115 state.roleGroup = response.data.roleGroup
114 state.postGroup = response.data.postGroup 116 state.postGroup = response.data.postGroup
115 uni.hideLoading(); 117 uni.hideLoading();
116 }) 118 })
117 } 119 }
118 function init() { 120 function init() {
119 uni.showLoading({ 121 uni.showLoading({
120 title: '加载中' 122 title: '加载中'
121 }); 123 });
122 getUser() 124 getUser()
123 loginServer.getMyOwnMemberInfo().then(res => { 125 loginServer.getMyOwnMemberInfo().then(res => {
124 userType.value = app.globalData.userType 126 userType.value = app.globalData.userType
...@@ -126,31 +128,31 @@ function init() { ...@@ -126,31 +128,31 @@ function init() {
126 uni.hideLoading(); 128 uni.hideLoading();
127 }) 129 })
128 } 130 }
129 function goPath(url){ 131 function goPath(url){
130 uni.navigateTo({ 132 uni.navigateTo({
131 url:url 133 url:url
132 }) 134 })
133 } 135 }
134 136
135 </script> 137 </script>
136 <style scope lang="scss"> 138 <style scope lang="scss">
137 .uni-list:after{display: none;} 139 .uni-list:after{display: none;}
138 .page { 140 .page {
139 width: 100vw; 141 width: 100vw;
140 overflow: hidden; 142 overflow: hidden;
141 } 143 }
142 .bgbg{ 144 .bgbg{
143 .flex{align-items: center;} 145 .flex{align-items: center;}
144 height: 280rpx;padding:30rpx; 146 height: 280rpx;padding:30rpx;
145 .name{margin-left: 20rpx; 147 .name{margin-left: 20rpx;
146 font-size: 36rpx;} 148 font-size: 36rpx;}
147 .imgbox{width: 120rpx; 149 .imgbox{width: 120rpx;
148 height: 120rpx;overflow: hidden; 150 height: 120rpx;overflow: hidden;
149 // background: #C7C7CD; 151 // background: #C7C7CD;
150 // border: 4rpx solid #FFFFFF; 152 // border: 4rpx solid #FFFFFF;
151 border-radius: 50%; 153 border-radius: 50%;
152 image{height: 120rpx;width: 120rpx;object-fit: cover;} 154 image{height: 120rpx;width: 120rpx;object-fit: cover;}
153 } 155 }
154 } 156 }
155 .loginOutIcon { 157 .loginOutIcon {
156 position: relative; 158 position: relative;
...@@ -219,11 +221,11 @@ function goPath(url){ ...@@ -219,11 +221,11 @@ function goPath(url){
219 margin: 30rpx 0 20rpx; 221 margin: 30rpx 0 20rpx;
220 padding: 0 20rpx 0; 222 padding: 0 20rpx 0;
221 } 223 }
222 } 224 }
223 .rMainBox {position: relative;top:-120rpx; 225 .rMainBox {position: relative;top:-120rpx;
224 box-sizing: border-box;padding: 20rpx 20rpx; 226 box-sizing: border-box;padding: 20rpx 20rpx;
225 background-color: #fff; 227 background-color: #fff;
226 border-radius: 15rpx; 228 border-radius: 15rpx;
227 margin: 25rpx;overflow: hidden; 229 margin: 25rpx;overflow: hidden;
228 } 230 }
229 </style> 231 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -13,11 +13,25 @@ ...@@ -13,11 +13,25 @@
13 } 13 }
14 }, 14 },
15 { 15 {
16 "path": "pages/webview/webview",
17 "style": {
18 "navigationBarTitleText": "中国跆拳道协会",
19 "enablePullDownRefresh": false
20 }
21 },
22 {
16 "path": "pages/index/msgList", 23 "path": "pages/index/msgList",
17 "style": { 24 "style": {
18 "navigationBarTitleText": "待办列表", 25 "navigationBarTitleText": "待办列表",
19 "enablePullDownRefresh": false 26 "enablePullDownRefresh": false
20 } 27 }
28 },
29 {
30 "path": "pages/invoice/apply",
31 "style": {
32 "navigationBarTitleText": "开具发票",
33 "enablePullDownRefresh": false
34 }
21 }, { 35 }, {
22 "path": "pages/rank/approval", 36 "path": "pages/rank/approval",
23 "style": { 37 "style": {
...@@ -165,12 +179,40 @@ ...@@ -165,12 +179,40 @@
165 } 179 }
166 }, 180 },
167 { 181 {
168 "path": "home", 182 "path": "home",
169 "style": { 183 "style": {
170 "navigationBarTitleText": "个人会员中心", 184 "navigationBarTitleText": "个人会员中心",
171 "enablePullDownRefresh": false 185 "enablePullDownRefresh": false
172 }
173 } 186 }
187 },
188 {
189 "path": "personInfo",
190 "style": {
191 "navigationBarTitleText": "人员信息",
192 "enablePullDownRefresh": false
193 }
194 },
195 {
196 "path": "memberInfo",
197 "style": {
198 "navigationBarTitleText": "个人会员信息",
199 "enablePullDownRefresh": false
200 }
201 },
202 {
203 "path": "levelRecord",
204 "style": {
205 "navigationBarTitleText": "级位记录",
206 "enablePullDownRefresh": false
207 }
208 },
209 {
210 "path": "order",
211 "style": {
212 "navigationBarTitleText": "我的订单",
213 "enablePullDownRefresh": false
214 }
215 }
174 ] 216 ]
175 }, 217 },
176 { 218 {
...@@ -684,6 +726,13 @@ ...@@ -684,6 +726,13 @@
684 } 726 }
685 }, 727 },
686 { 728 {
729 "path": "order",
730 "style": {
731 "navigationBarTitleText": "我的订单",
732 "enablePullDownRefresh": false
733 }
734 },
735 {
687 "path": "reviewList", 736 "path": "reviewList",
688 "style": { 737 "style": {
689 "navigationBarTitleText": "审核详情", 738 "navigationBarTitleText": "审核详情",
......
1 <template>
2 <view class="invoice-apply">
3 <view class="content">
4 <!-- 发票类型 -->
5 <view class="form-item">
6 <text class="label">发票类型</text>
7 <text class="value">{{ form.invoiceType === '2' ? '普通发票(企业)' : '普通发票(个人)' }}</text>
8 </view>
9
10 <!-- 发票抬头 -->
11 <view class="form-item">
12 <text class="label">发票抬头</text>
13 <input
14 class="input"
15 v-model="form.name"
16 placeholder="请输入公司全称或个人姓名"
17 placeholder-style="color: #999;"
18 />
19 </view>
20
21 <!-- 纳税人识别号(企业才显示) -->
22 <view class="form-item" v-if="form.invoiceType === '2'">
23 <text class="label">纳税人识别号</text>
24 <input
25 class="input"
26 v-model="form.taxno"
27 placeholder="请输入纳税人识别号"
28 placeholder-style="color: #999;"
29 maxlength="20"
30 />
31 </view>
32
33 <!-- 开票金额 -->
34 <view class="form-item">
35 <text class="label">开票金额</text>
36 <text class="amount">¥ {{ (Number(form.amount)).toFixed(2) }}</text>
37 </view>
38
39 <!-- 接收方式 -->
40 <view class="form-item">
41 <text class="label">接收方式</text>
42 <text class="value">电子邮箱</text>
43 </view>
44
45 <!-- 接收邮箱 -->
46 <view class="form-item">
47 <text class="label">接收邮箱</text>
48 <input
49 class="input"
50 v-model="form.email"
51 placeholder="请输入接收发票的邮箱(必填)"
52 placeholder-style="color: #999;"
53 />
54 </view>
55 </view>
56
57 <view class="hint">电子发票将在3-5个工作日内发送至该邮箱</view>
58
59 <!-- 提交按钮 -->
60 <view class="btn-wrap" @click="submitInvoice">
61 <view class="submit-btn">提交申请</view>
62 </view>
63 </view>
64 </template>
65
66 <script setup>
67 import { ref, reactive } from 'vue';
68 import { onLoad } from '@dcloudio/uni-app';
69 import { outputInvoiceNo } from '@/common/api.js'; // 与PC端接口一致
70
71 // 表单数据(与PC端字段完全对齐)
72 const form = reactive({
73 invoiceType: '1', // 1=个人 2=企业
74 name: '', // 发票抬头
75 taxno: '', // 纳税人识别号
76 email: '', // 邮箱
77 amount: 0, // 金额
78 id: '' // 订单ID
79 });
80
81 // 页面加载(接收PC端传来的参数)
82 onLoad((options) => {
83 if (options.id) {
84 form.id = options.id;
85 form.amount = options.amount;
86 console.log(33,form.amount);
87 }
88 if (options.invoiceType) {
89 form.invoiceType = options.invoiceType;
90 }
91 // getOrderInfo();
92 });
93
94 // 获取订单金额
95 // const getOrderInfo = async () => {
96 // try {
97 // // 这里替换成你真实获取订单金额的接口
98 // = 1500;
99 // } catch (error) {
100 // uni.showToast({ title: '获取订单信息失败', icon: 'none' });
101 // }
102 // };
103
104 // 提交发票申请(与PC逻辑完全一致)
105 const submitInvoice = async () => {
106 // 1. PC端逻辑:个人不允许开票
107 if (form.invoiceType === '1') {
108 return uni.showToast({ title: '暂不支持个人开票', icon: 'none' });
109 }
110
111 // 2. 抬头校验
112 if (!form.name) {
113 return uni.showToast({ title: '请输入发票抬头', icon: 'none' });
114 }
115
116 // 3. 企业必须填纳税人识别号
117 if (form.invoiceType === '2' && !form.taxno) {
118 return uni.showToast({ title: '请输入纳税人识别号', icon: 'none' });
119 }
120
121 // 4. 纳税人识别号格式校验(同PC)
122 const taxReg = /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/;
123 if (form.invoiceType === '2' && !taxReg.test(form.taxno)) {
124 return uni.showToast({ title: '纳税人识别号格式不正确', icon: 'none' });
125 }
126
127 // 5. 邮箱校验
128 const emailReg = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
129 if (!form.email) {
130 return uni.showToast({ title: '请输入接收邮箱', icon: 'none' });
131 }
132 if (!emailReg.test(form.email)) {
133 return uni.showToast({ title: '请输入正确的邮箱地址', icon: 'none' });
134 }
135
136 try {
137 // 调用PC端同一个接口:outputInvoiceNo
138 await outputInvoiceNo(form);
139
140 uni.showToast({
141 title: '发票申请提交成功!',
142 icon: 'success',
143 duration: 2000
144 });
145
146 setTimeout(() => {
147 uni.navigateBack();
148 }, 2000);
149 } catch (error) {
150 uni.showToast({ title: '提交失败,请检查信息', icon: 'none' });
151 }
152 };
153 </script>
154
155 <style lang="scss" scoped>
156 .invoice-apply {
157 min-height: 100vh;
158 background: #f5f7fa;
159
160 .content {
161 padding: 20rpx;
162
163 .form-item {
164 display: flex;
165 justify-content: space-between;
166 align-items: center;
167 background: #fff;
168 padding: 24rpx;
169 border-bottom: 1rpx solid #eee;
170
171 .label {
172 font-size: 28rpx;
173 color: #333;
174 }
175
176 .input {
177 width: 80%;
178 font-size: 28rpx;
179 color: #333;
180 padding: 16rpx 0;
181 text-align: right;
182 }
183
184 .value {
185 font-size: 28rpx;
186 color: #333;
187 }
188
189 .amount {
190 font-size: 28rpx;
191 color: #e4393c;
192 font-weight: 500;
193 }
194 }
195 }
196
197 .hint {
198 font-size: 26rpx;
199 color: #B6BCC0;
200 margin-top: 20rpx;
201 text-align: center;
202 }
203
204 .btn-wrap {
205 width: 100%;
206 background-color: #fff;
207 padding: 30rpx;
208 position: fixed;
209 bottom: 0;
210 left: 0;
211 right: 0;
212 }
213
214 .submit-btn {
215 height: 70rpx;
216 line-height: 70rpx;
217 border-radius: 35rpx;
218 width: 90%;
219 margin: 0 auto;
220 background: #AD181F;
221 color: #fff;
222 font-size: 28rpx;
223 text-align: center;
224 }
225 }
226 </style>
...\ No newline at end of file ...\ No newline at end of file
1 <template>
2 <view class="container">
3 <web-view :src="url" @message="handleMessage"></web-view>
4 </view>
5 </template>
6
7 <script setup>
8 import { ref } from 'vue';
9 import {
10 onShow,
11 onLoad
12 } from '@dcloudio/uni-app'
13
14 const url = ref('');
15
16 onLoad((options) => {
17 if (options.url) {
18 url.value = decodeURIComponent(options.url);
19 }
20 });
21
22 const handleMessage = (event) => {
23 console.log('收到消息:', event.detail.data);
24 };
25 </script>
26
27 <style scoped>
28 .container {
29 width: 100%;
30 height: 100vh;
31 }
32 </style>
...\ No newline at end of file ...\ No newline at end of file
1 <template>
2 <view class="page-container">
3
4 <!-- 信息展示区域 -->
5 <view v-if="loading" class="loading-container">
6 <uni-icons type="spinner" size="40" color="#409eff" class="loading-icon" />
7 <view class="loading-text">加载中...</view>
8 </view>
9 <view v-else class="info-card">
10 <view class="info-item">
11 <view class="info-label">姓名</view>
12 <view class="info-value">{{ form?.name || '--' }}</view>
13 </view>
14 <view class="info-item">
15 <view class="info-label">证件类型</view>
16 <view class="info-value">{{ getCertType(form?.idcType) }}</view>
17 </view>
18 <view class="info-item">
19 <view class="info-label">证件号</view>
20 <view class="info-value">{{ form?.idcCode || '--' }}</view>
21 </view>
22 <view class="info-item">
23 <view class="info-label">性别</view>
24 <view class="info-value">{{ getGender(form?.sex) }}</view>
25 </view>
26 <view class="info-item">
27 <view class="info-label">会员编号</view>
28 <view class="info-value">{{ form?.perCode || '--' }}</view>
29 </view>
30 <view class="info-item">
31 <view class="info-label">所属一级协会</view>
32 <view class="info-value">{{ form?.topAssName || '--' }}</view>
33 </view>
34 <view class="info-item">
35 <view class="info-label">所属地区协会</view>
36 <view class="info-value">{{ form?.areaAssName || '--' }}</view>
37 </view>
38 <view class="info-item">
39 <view class="info-label">注册单位会员</view>
40 <view class="info-value">{{ form?.memName || '--' }}</view>
41 </view>
42 <view class="info-item">
43 <view class="info-label">缴费日期</view>
44 <view class="info-value">{{ form?.payDate || '--' }}</view>
45 </view>
46 <view class="info-item">
47 <view class="info-label">注册时间</view>
48 <view class="info-value">{{ form?.createTime || '--' }}</view>
49 </view>
50 <view class="info-item">
51 <view class="info-label">出生日期</view>
52 <view class="info-value">{{ form?.birth || '--' }}</view>
53 </view>
54 <view class="info-item">
55 <view class="info-label">手机号码</view>
56 <view class="info-value">{{ form?.phone || '--' }}</view>
57 </view>
58 <view class="info-item">
59 <view class="info-label">地址</view>
60 <view class="info-value">{{ form?.site || '--' }}</view>
61 </view>
62 <view class="info-item">
63 <view class="info-label">详细地址</view>
64 <view class="info-value">{{ form?.address || '--' }}</view>
65 </view>
66 </view>
67 </view>
68 </template>
69
70 <script setup>
71 import { ref, onMounted } from 'vue';
72 import { useUserStore } from '../store/modules/user';
73 import { getAssoPers, getInfo } from '@/common/api.js';
74
75 const userStore = useUserStore();
76 const form = ref({});
77 const loading = ref(false);
78 const perId = ref('');
79
80 // 返回上一页
81 const goBack = () => {
82 uni.navigateBack();
83 };
84
85 // 获取证件类型
86 const getCertType = (type) => {
87 switch (type) {
88 case '0':
89 case '1':
90 return '身份证';
91 case '2':
92 return '护照';
93 case '3':
94 return '军官证';
95 case '4':
96 return '港澳通行证';
97 case '5':
98 return '台湾通行证';
99 default:
100 return '--';
101 }
102 };
103
104 // 获取性别
105 const getGender = (gender) => {
106 switch (gender) {
107 case '0':
108 case '1':
109 return '男';
110 case '2':
111 return '女';
112 default:
113 return '--';
114 }
115 };
116
117 // 获取个人会员信息
118 const getMemberInfo = async () => {
119 loading.value = true;
120 try {
121 const res = await getInfo(perId.value);
122 form.value = res.data;
123 // 处理数据
124 form.value.topAssName = form.value?.ancestorNameList?.[0] || '--';
125 form.value.areaAssName = form.value?.ancestorNameList?.[1] || '--';
126 form.value.memName = form.value.memName || '--';
127 form.value.payDate = form.value.payDate ? form.value.payDate.substring(0, 10) : '--';
128 form.value.createTime = form.value.createTime ? form.value.createTime.substring(0, 10) : '--';
129 form.value.birth = form.value.birth ? form.value.birth.substring(0, 10) : '--';
130 form.value.site = form.value.site || '--';
131 form.value.address = form.value.address || '--';
132 } catch (error) {
133 console.error('获取个人会员信息失败:', error);
134 uni.showToast({
135 title: '获取个人会员信息失败',
136 icon: 'none'
137 });
138 } finally {
139 loading.value = false;
140 }
141 };
142
143 onMounted(async () => {
144 // 获取perId
145 const userInfo = userStore.user;
146 if (userInfo && userInfo.perId) {
147 perId.value = userInfo.perId;
148 getMemberInfo();
149 } else {
150 // 如果userInfo中没有perId,尝试通过getAssoPers获取
151 try {
152 const res = await getAssoPers(userInfo?.id || '');
153 perId.value = res.data[10] || '';
154 if (perId.value) {
155 getMemberInfo();
156 } else {
157 uni.showToast({
158 title: '获取用户信息失败',
159 icon: 'none'
160 });
161 }
162 } catch (error) {
163 console.error('获取perId失败:', error);
164 uni.showToast({
165 title: '获取用户信息失败',
166 icon: 'none'
167 });
168 }
169 }
170 });
171 </script>
172
173 <style lang="scss" scoped>
174 .page-container {
175 min-height: 100vh;
176 background: #f5f5f5;
177 padding-bottom: 30rpx;
178 }
179
180 /* 导航栏 */
181 .nav-bar {
182 display: flex;
183 align-items: center;
184 justify-content: space-between;
185 height: 88rpx;
186 background: #ffffff;
187 padding: 0 30rpx;
188 box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
189 position: sticky;
190 top: 0;
191 z-index: 100;
192 }
193
194 .nav-left {
195 width: 44rpx;
196 height: 44rpx;
197 display: flex;
198 align-items: center;
199 justify-content: center;
200 }
201
202 .nav-title {
203 font-size: 32rpx;
204 font-weight: 500;
205 color: #333;
206 }
207
208 .nav-right {
209 width: 44rpx;
210 }
211
212 /* 信息卡片 */
213 .info-card {
214 margin: 20rpx;
215 background: #ffffff;
216 border-radius: 12rpx;
217 box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
218 overflow: hidden;
219 }
220
221 /* 信息项 */
222 .info-item {
223 display: flex;
224 align-items: center;
225 padding: 30rpx 24rpx;
226 border-bottom: 1rpx solid #f0f0f0;
227 }
228
229 .info-item:last-child {
230 border-bottom: none;
231 }
232
233 /* 标签 */
234 .info-label {
235 font-size: 28rpx;
236 color: #666666;
237 width: 200rpx;
238 flex-shrink: 0;
239 }
240
241 /* 值 */
242 .info-value {
243 font-size: 28rpx;
244 color: #333333;
245 flex: 1;
246 padding-left: 20rpx;
247 text-align: left;
248 word-break: break-all;
249 }
250
251 /* 加载状态 */
252 .loading-container {
253 display: flex;
254 flex-direction: column;
255 align-items: center;
256 justify-content: center;
257 height: 500rpx;
258 }
259
260 .loading-icon {
261 animation: spin 1s linear infinite;
262 }
263
264 .loading-text {
265 margin-top: 20rpx;
266 font-size: 28rpx;
267 color: #666;
268 }
269
270 @keyframes spin {
271 from {
272 transform: rotate(0deg);
273 }
274 to {
275 transform: rotate(360deg);
276 }
277 }
278
279 /* 响应式调整 */
280 @media (max-width: 375px) {
281 .info-label {
282 width: 160rpx;
283 font-size: 26rpx;
284 }
285
286 .info-value {
287 font-size: 26rpx;
288 padding-left: 16rpx;
289 }
290
291 .info-item {
292 padding: 24rpx 20rpx;
293 }
294 }
295 </style>
...\ No newline at end of file ...\ No newline at end of file
1 <template>
2 <view class="page-container">
3
4
5 <!-- 信息展示区域 -->
6 <view class="info-section">
7 <view class="info-item">
8 <view class="info-label">姓名</view>
9 <view class="info-value">{{ perInfo?.perName || '' }}</view>
10 </view>
11 <!-- <view class="info-item">
12 <view class="info-label">证件类型</view>
13 <view class="info-value">{{ getCertType(perInfo?.idcType) }}</view>
14 </view> -->
15 <view class="info-item">
16 <view class="info-label">身份证号</view>
17 <view class="info-value">{{ perInfo?.perIdcCode || '--' }}</view>
18 </view>
19 <view class="info-item">
20 <view class="info-label">生日</view>
21 <view class="info-value">{{ perInfo?.birth || '--' }}</view>
22 </view>
23 <view class="info-item">
24 <view class="info-label">会员卡号</view>
25 <view class="info-value">{{ perInfo?.perCode || '--' }}</view>
26 </view>
27 <view class="info-item">
28 <view class="info-label">会员有效期</view>
29 <view class="info-value">{{ perInfo?.perValidDate || '--' }}</view>
30 </view>
31 <!-- <view class="info-item">
32 <view class="info-label">性别</view>
33 <view class="info-value">{{ getGender(perInfo?.gender) }}</view>
34 </view>
35 <view class="info-item">
36 <view class="info-label">民族</view>
37 <view class="info-value">{{ perInfo?.nation || '--' }}</view>
38 </view>
39 <view class="info-item">
40 <view class="info-label">联系电话</view>
41 <view class="info-value">{{ perInfo?.phone || '--' }}</view>
42 </view>
43 <view class="info-item">
44 <view class="info-label">邮箱</view>
45 <view class="info-value">{{ perInfo?.email || '--' }}</view>
46 </view> -->
47 <!-- <view class="info-item">
48 <view class="info-label">地址</view>
49 <view class="info-value">{{ perInfo?.address || '--' }}</view>
50 </view> -->
51 </view>
52 </view>
53 </template>
54
55 <script setup>
56 import { computed, onMounted } from 'vue';
57 import { useUserStore } from '../store/modules/user';
58
59 const userStore = useUserStore();
60 const perInfo = computed(() => userStore.perInfo);
61
62 // 返回上一页
63 const goBack = () => {
64 uni.navigateBack();
65 };
66
67 // 获取证件类型
68 const getCertType = (type) => {
69 switch (type) {
70 case '1':
71 return '身份证';
72 case '2':
73 return '护照';
74 case '3':
75 return '军官证';
76 case '4':
77 return '港澳通行证';
78 case '5':
79 return '台湾通行证';
80 default:
81 return '--';
82 }
83 };
84
85 // 获取性别
86 const getGender = (gender) => {
87 switch (gender) {
88 case '1':
89 return '男';
90 case '2':
91 return '女';
92 default:
93 return '--';
94 }
95 };
96
97 onMounted(() => {
98 // 可以在这里添加额外的初始化逻辑
99 });
100 </script>
101
102 <style lang="scss" scoped>
103 .page-container {
104 min-height: 100vh;
105 background: #f5f5f5;
106 }
107
108 /* 导航栏 */
109 .nav-bar {
110 display: flex;
111 align-items: center;
112 justify-content: space-between;
113 height: 88rpx;
114 background: #ffffff;
115 padding: 0 30rpx;
116 box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
117 position: sticky;
118 top: 0;
119 z-index: 100;
120 }
121
122 .nav-left {
123 width: 44rpx;
124 height: 44rpx;
125 display: flex;
126 align-items: center;
127 justify-content: center;
128 }
129
130 .nav-title {
131 font-size: 32rpx;
132 font-weight: 500;
133 color: #333;
134 }
135
136 .nav-right {
137 width: 44rpx;
138 }
139
140 /* 信息展示区域 */
141 .info-section {
142 margin: 20rpx;
143 background: #ffffff;
144 }
145
146 .info-item {
147 display: flex;
148 align-items: center;
149 justify-content: space-between;
150 padding: 30rpx;
151 border-bottom: 1rpx solid #f5f5f5;
152 }
153
154 .info-item:last-child {
155 border-bottom: none;
156 }
157
158 .info-label {
159 font-size: 28rpx;
160 color: #666;
161 width: 150rpx;
162 }
163
164 .info-value {
165 font-size: 28rpx;
166 color: #333;
167 flex: 1;
168 text-align: right;
169 padding-left: 30rpx;
170 }
171 </style>
...\ No newline at end of file ...\ No newline at end of file
static/bd@2x.png

711 Bytes

Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!