4cf9d409 by lttnew

我的订单

1 parent e97c4b0a
......@@ -349,6 +349,14 @@ export function addSelectPageList(query) {
})
}
// 获取个人技术认证详情
export function getPersonTecDetails(type, personId) {
return request({
url: `/person/technology/getPersonTecDetails/${type}/${personId}`,
method: 'get'
})
}
export function fillAuditLog(ids) {
return request({
url: `/person/paymentRange/fillAuditLog/${ids}`,
......@@ -1441,7 +1449,57 @@ export function bindUser(data) {
export function unbindUser() {
return request({
url: `/person/info/unbindUser`,
url: `/person/info/unBindUser`,
method: 'post'
})
}
/**
* 订单列表
* @param params
* @returns {*}
*/
export function orderList(params) {
return request({
url: `/common/order/list`,
method: 'get',
params
})
}
/**
* 删除订单
* @param params
* @returns {*}
*/
export function deleteOrder(id) {
return request({
url: `/common/order/${id}`,
method: 'delete'
})
}
/**
* 取消订单
* @param params
* @returns {*}
*/
export function cancelPay(id) {
return request({
url: `/person/paymentRangeNew/cancelPay/${id}`,
method: 'post'
})
}
export const outputInvoiceNo = (data) => {
return request({
url: `/common/order/outputInvoiceNo/${data.id}`,
method: 'post',
params: data
})
}
export function getAssoPers(perId) {
return request({
url: '/person/info/getRoleListByPerId/' + perId,
method: 'get'
})
}
\ No newline at end of file
......
......@@ -47,6 +47,7 @@ function logout() {
uni.removeStorageSync('token')
uni.removeStorageSync('userName')
uni.removeStorageSync('webUserName')
uni.removeStorageSync('openId')
userStore.setUser(null)
app.globalData.isLogin = false
......
// dev
const baseUrl_api = 'http://192.168.1.189:8787'
const baseUrl_api = 'http://192.168.1.137:8787'
const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
// prod
......
......@@ -22,6 +22,8 @@
<uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')">
</uni-list-item>
<uni-list-item thumb="/static/user_icon03.png" title="我的订单" showArrow clickable @click="goPath('/myCenter/order')">
</uni-list-item>
</uni-list>
......
......@@ -13,11 +13,25 @@
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "中国跆拳道协会",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/msgList",
"style": {
"navigationBarTitleText": "待办列表",
"enablePullDownRefresh": false
}
},
{
"path": "pages/invoice/apply",
"style": {
"navigationBarTitleText": "开具发票",
"enablePullDownRefresh": false
}
}, {
"path": "pages/rank/approval",
"style": {
......@@ -170,6 +184,34 @@
"navigationBarTitleText": "个人会员中心",
"enablePullDownRefresh": false
}
},
{
"path": "personInfo",
"style": {
"navigationBarTitleText": "人员信息",
"enablePullDownRefresh": false
}
},
{
"path": "memberInfo",
"style": {
"navigationBarTitleText": "个人会员信息",
"enablePullDownRefresh": false
}
},
{
"path": "levelRecord",
"style": {
"navigationBarTitleText": "级位记录",
"enablePullDownRefresh": false
}
},
{
"path": "order",
"style": {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false
}
}
]
},
......@@ -684,6 +726,13 @@
}
},
{
"path": "order",
"style": {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false
}
},
{
"path": "reviewList",
"style": {
"navigationBarTitleText": "审核详情",
......
<template>
<view class="invoice-apply">
<view class="content">
<!-- 发票类型 -->
<view class="form-item">
<text class="label">发票类型</text>
<text class="value">{{ form.invoiceType === '2' ? '普通发票(企业)' : '普通发票(个人)' }}</text>
</view>
<!-- 发票抬头 -->
<view class="form-item">
<text class="label">发票抬头</text>
<input
class="input"
v-model="form.name"
placeholder="请输入公司全称或个人姓名"
placeholder-style="color: #999;"
/>
</view>
<!-- 纳税人识别号(企业才显示) -->
<view class="form-item" v-if="form.invoiceType === '2'">
<text class="label">纳税人识别号</text>
<input
class="input"
v-model="form.taxno"
placeholder="请输入纳税人识别号"
placeholder-style="color: #999;"
maxlength="20"
/>
</view>
<!-- 开票金额 -->
<view class="form-item">
<text class="label">开票金额</text>
<text class="amount">¥ {{ (Number(form.amount)).toFixed(2) }}</text>
</view>
<!-- 接收方式 -->
<view class="form-item">
<text class="label">接收方式</text>
<text class="value">电子邮箱</text>
</view>
<!-- 接收邮箱 -->
<view class="form-item">
<text class="label">接收邮箱</text>
<input
class="input"
v-model="form.email"
placeholder="请输入接收发票的邮箱(必填)"
placeholder-style="color: #999;"
/>
</view>
</view>
<view class="hint">电子发票将在3-5个工作日内发送至该邮箱</view>
<!-- 提交按钮 -->
<view class="btn-wrap" @click="submitInvoice">
<view class="submit-btn">提交申请</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { outputInvoiceNo } from '@/common/api.js'; // 与PC端接口一致
// 表单数据(与PC端字段完全对齐)
const form = reactive({
invoiceType: '1', // 1=个人 2=企业
name: '', // 发票抬头
taxno: '', // 纳税人识别号
email: '', // 邮箱
amount: 0, // 金额
id: '' // 订单ID
});
// 页面加载(接收PC端传来的参数)
onLoad((options) => {
if (options.id) {
form.id = options.id;
form.amount = options.amount;
console.log(33,form.amount);
}
if (options.invoiceType) {
form.invoiceType = options.invoiceType;
}
// getOrderInfo();
});
// 获取订单金额
// const getOrderInfo = async () => {
// try {
// // 这里替换成你真实获取订单金额的接口
// = 1500;
// } catch (error) {
// uni.showToast({ title: '获取订单信息失败', icon: 'none' });
// }
// };
// 提交发票申请(与PC逻辑完全一致)
const submitInvoice = async () => {
// 1. PC端逻辑:个人不允许开票
if (form.invoiceType === '1') {
return uni.showToast({ title: '暂不支持个人开票', icon: 'none' });
}
// 2. 抬头校验
if (!form.name) {
return uni.showToast({ title: '请输入发票抬头', icon: 'none' });
}
// 3. 企业必须填纳税人识别号
if (form.invoiceType === '2' && !form.taxno) {
return uni.showToast({ title: '请输入纳税人识别号', icon: 'none' });
}
// 4. 纳税人识别号格式校验(同PC)
const taxReg = /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/;
if (form.invoiceType === '2' && !taxReg.test(form.taxno)) {
return uni.showToast({ title: '纳税人识别号格式不正确', icon: 'none' });
}
// 5. 邮箱校验
const emailReg = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
if (!form.email) {
return uni.showToast({ title: '请输入接收邮箱', icon: 'none' });
}
if (!emailReg.test(form.email)) {
return uni.showToast({ title: '请输入正确的邮箱地址', icon: 'none' });
}
try {
// 调用PC端同一个接口:outputInvoiceNo
await outputInvoiceNo(form);
uni.showToast({
title: '发票申请提交成功!',
icon: 'success',
duration: 2000
});
setTimeout(() => {
uni.navigateBack();
}, 2000);
} catch (error) {
uni.showToast({ title: '提交失败,请检查信息', icon: 'none' });
}
};
</script>
<style lang="scss" scoped>
.invoice-apply {
min-height: 100vh;
background: #f5f7fa;
.content {
padding: 20rpx;
.form-item {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
padding: 24rpx;
border-bottom: 1rpx solid #eee;
.label {
font-size: 28rpx;
color: #333;
}
.input {
width: 80%;
font-size: 28rpx;
color: #333;
padding: 16rpx 0;
text-align: right;
}
.value {
font-size: 28rpx;
color: #333;
}
.amount {
font-size: 28rpx;
color: #e4393c;
font-weight: 500;
}
}
}
.hint {
font-size: 26rpx;
color: #B6BCC0;
margin-top: 20rpx;
text-align: center;
}
.btn-wrap {
width: 100%;
background-color: #fff;
padding: 30rpx;
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
.submit-btn {
height: 70rpx;
line-height: 70rpx;
border-radius: 35rpx;
width: 90%;
margin: 0 auto;
background: #AD181F;
color: #fff;
font-size: 28rpx;
text-align: center;
}
}
</style>
\ No newline at end of file
<template>
<view class="container">
<web-view :src="url" @message="handleMessage"></web-view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import {
onShow,
onLoad
} from '@dcloudio/uni-app'
const url = ref('');
onLoad((options) => {
if (options.url) {
url.value = decodeURIComponent(options.url);
}
});
const handleMessage = (event) => {
console.log('收到消息:', event.detail.data);
};
</script>
<style scoped>
.container {
width: 100%;
height: 100vh;
}
</style>
\ No newline at end of file
<template>
<view class="page-container">
<!-- 信息展示区域 -->
<view v-if="loading" class="loading-container">
<uni-icons type="spinner" size="40" color="#409eff" class="loading-icon" />
<view class="loading-text">加载中...</view>
</view>
<view v-else class="info-card">
<view class="info-item">
<view class="info-label">姓名</view>
<view class="info-value">{{ form?.name || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">证件类型</view>
<view class="info-value">{{ getCertType(form?.idcType) }}</view>
</view>
<view class="info-item">
<view class="info-label">证件号</view>
<view class="info-value">{{ form?.idcCode || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">性别</view>
<view class="info-value">{{ getGender(form?.sex) }}</view>
</view>
<view class="info-item">
<view class="info-label">会员编号</view>
<view class="info-value">{{ form?.perCode || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">所属一级协会</view>
<view class="info-value">{{ form?.topAssName || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">所属地区协会</view>
<view class="info-value">{{ form?.areaAssName || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">注册单位会员</view>
<view class="info-value">{{ form?.memName || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">缴费日期</view>
<view class="info-value">{{ form?.payDate || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">注册时间</view>
<view class="info-value">{{ form?.createTime || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">出生日期</view>
<view class="info-value">{{ form?.birth || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">手机号码</view>
<view class="info-value">{{ form?.phone || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">地址</view>
<view class="info-value">{{ form?.site || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">详细地址</view>
<view class="info-value">{{ form?.address || '--' }}</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { useUserStore } from '../store/modules/user';
import { getAssoPers, getInfo } from '@/common/api.js';
const userStore = useUserStore();
const form = ref({});
const loading = ref(false);
const perId = ref('');
// 返回上一页
const goBack = () => {
uni.navigateBack();
};
// 获取证件类型
const getCertType = (type) => {
switch (type) {
case '0':
case '1':
return '身份证';
case '2':
return '护照';
case '3':
return '军官证';
case '4':
return '港澳通行证';
case '5':
return '台湾通行证';
default:
return '--';
}
};
// 获取性别
const getGender = (gender) => {
switch (gender) {
case '0':
case '1':
return '男';
case '2':
return '女';
default:
return '--';
}
};
// 获取个人会员信息
const getMemberInfo = async () => {
loading.value = true;
try {
const res = await getInfo(perId.value);
form.value = res.data;
// 处理数据
form.value.topAssName = form.value?.ancestorNameList?.[0] || '--';
form.value.areaAssName = form.value?.ancestorNameList?.[1] || '--';
form.value.memName = form.value.memName || '--';
form.value.payDate = form.value.payDate ? form.value.payDate.substring(0, 10) : '--';
form.value.createTime = form.value.createTime ? form.value.createTime.substring(0, 10) : '--';
form.value.birth = form.value.birth ? form.value.birth.substring(0, 10) : '--';
form.value.site = form.value.site || '--';
form.value.address = form.value.address || '--';
} catch (error) {
console.error('获取个人会员信息失败:', error);
uni.showToast({
title: '获取个人会员信息失败',
icon: 'none'
});
} finally {
loading.value = false;
}
};
onMounted(async () => {
// 获取perId
const userInfo = userStore.user;
if (userInfo && userInfo.perId) {
perId.value = userInfo.perId;
getMemberInfo();
} else {
// 如果userInfo中没有perId,尝试通过getAssoPers获取
try {
const res = await getAssoPers(userInfo?.id || '');
perId.value = res.data[10] || '';
if (perId.value) {
getMemberInfo();
} else {
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
});
}
} catch (error) {
console.error('获取perId失败:', error);
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
});
}
}
});
</script>
<style lang="scss" scoped>
.page-container {
min-height: 100vh;
background: #f5f5f5;
padding-bottom: 30rpx;
}
/* 导航栏 */
.nav-bar {
display: flex;
align-items: center;
justify-content: space-between;
height: 88rpx;
background: #ffffff;
padding: 0 30rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
position: sticky;
top: 0;
z-index: 100;
}
.nav-left {
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.nav-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.nav-right {
width: 44rpx;
}
/* 信息卡片 */
.info-card {
margin: 20rpx;
background: #ffffff;
border-radius: 12rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
overflow: hidden;
}
/* 信息项 */
.info-item {
display: flex;
align-items: center;
padding: 30rpx 24rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.info-item:last-child {
border-bottom: none;
}
/* 标签 */
.info-label {
font-size: 28rpx;
color: #666666;
width: 200rpx;
flex-shrink: 0;
}
/* 值 */
.info-value {
font-size: 28rpx;
color: #333333;
flex: 1;
padding-left: 20rpx;
text-align: left;
word-break: break-all;
}
/* 加载状态 */
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 500rpx;
}
.loading-icon {
animation: spin 1s linear infinite;
}
.loading-text {
margin-top: 20rpx;
font-size: 28rpx;
color: #666;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/* 响应式调整 */
@media (max-width: 375px) {
.info-label {
width: 160rpx;
font-size: 26rpx;
}
.info-value {
font-size: 26rpx;
padding-left: 16rpx;
}
.info-item {
padding: 24rpx 20rpx;
}
}
</style>
\ No newline at end of file
<template>
<view class="page-container">
<!-- 信息展示区域 -->
<view class="info-section">
<view class="info-item">
<view class="info-label">姓名</view>
<view class="info-value">{{ perInfo?.perName || '' }}</view>
</view>
<!-- <view class="info-item">
<view class="info-label">证件类型</view>
<view class="info-value">{{ getCertType(perInfo?.idcType) }}</view>
</view> -->
<view class="info-item">
<view class="info-label">身份证号</view>
<view class="info-value">{{ perInfo?.perIdcCode || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">生日</view>
<view class="info-value">{{ perInfo?.birth || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">会员卡号</view>
<view class="info-value">{{ perInfo?.perCode || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">会员有效期</view>
<view class="info-value">{{ perInfo?.perValidDate || '--' }}</view>
</view>
<!-- <view class="info-item">
<view class="info-label">性别</view>
<view class="info-value">{{ getGender(perInfo?.gender) }}</view>
</view>
<view class="info-item">
<view class="info-label">民族</view>
<view class="info-value">{{ perInfo?.nation || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">联系电话</view>
<view class="info-value">{{ perInfo?.phone || '--' }}</view>
</view>
<view class="info-item">
<view class="info-label">邮箱</view>
<view class="info-value">{{ perInfo?.email || '--' }}</view>
</view> -->
<!-- <view class="info-item">
<view class="info-label">地址</view>
<view class="info-value">{{ perInfo?.address || '--' }}</view>
</view> -->
</view>
</view>
</template>
<script setup>
import { computed, onMounted } from 'vue';
import { useUserStore } from '../store/modules/user';
const userStore = useUserStore();
const perInfo = computed(() => userStore.perInfo);
// 返回上一页
const goBack = () => {
uni.navigateBack();
};
// 获取证件类型
const getCertType = (type) => {
switch (type) {
case '1':
return '身份证';
case '2':
return '护照';
case '3':
return '军官证';
case '4':
return '港澳通行证';
case '5':
return '台湾通行证';
default:
return '--';
}
};
// 获取性别
const getGender = (gender) => {
switch (gender) {
case '1':
return '男';
case '2':
return '女';
default:
return '--';
}
};
onMounted(() => {
// 可以在这里添加额外的初始化逻辑
});
</script>
<style lang="scss" scoped>
.page-container {
min-height: 100vh;
background: #f5f5f5;
}
/* 导航栏 */
.nav-bar {
display: flex;
align-items: center;
justify-content: space-between;
height: 88rpx;
background: #ffffff;
padding: 0 30rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
position: sticky;
top: 0;
z-index: 100;
}
.nav-left {
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.nav-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.nav-right {
width: 44rpx;
}
/* 信息展示区域 */
.info-section {
margin: 20rpx;
background: #ffffff;
}
.info-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.info-item:last-child {
border-bottom: none;
}
.info-label {
font-size: 28rpx;
color: #666;
width: 150rpx;
}
.info-value {
font-size: 28rpx;
color: #333;
flex: 1;
text-align: right;
padding-left: 30rpx;
}
</style>
\ 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!