我的预约0.1
This commit is contained in:
parent
897fc160a0
commit
80af8f718b
124
api/personalCenter/index.js
Normal file
124
api/personalCenter/index.js
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
// 个人中心相关API
|
||||
import { get, request } from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取预约列表
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {number} params.pageNum - 页码
|
||||
* @param {number} params.pageSize - 每页数量
|
||||
* @param {number} params.type - 预约类型 1: 活动预约, 2: 斋饭预约
|
||||
* @returns {Promise} 返回预约列表数据
|
||||
*/
|
||||
export function getAppointmentList(params) {
|
||||
return get('/app/subscribe/list', params, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消预约
|
||||
* @param {string} subscribeId - 预约ID
|
||||
* @returns {Promise} 返回取消结果
|
||||
*/
|
||||
export function cancelAppointment(subscribeId) {
|
||||
return request({
|
||||
url: '/app/subscribe/cancelSub',
|
||||
method: 'PUT',
|
||||
params: {
|
||||
subscribeId: subscribeId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预约二维码
|
||||
* @param {string} id - 预约ID
|
||||
* @returns {Promise} 返回二维码数据
|
||||
*/
|
||||
export function getAppointmentQRCode(id) {
|
||||
return get(`/app/subscribe/qrcode/${id}`, {}, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @returns {Promise} 返回用户信息
|
||||
*/
|
||||
export function getUserInfo() {
|
||||
return get('/app/user/info', {}, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户信息
|
||||
* @param {Object} data - 用户信息数据
|
||||
* @returns {Promise} 返回更新结果
|
||||
*/
|
||||
export function updateUserInfo(data) {
|
||||
return request({
|
||||
url: '/app/user/info',
|
||||
method: 'PUT',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的收藏列表
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {number} params.pageNum - 页码
|
||||
* @param {number} params.pageSize - 每页数量
|
||||
* @returns {Promise} 返回收藏列表数据
|
||||
*/
|
||||
export function getMyCollection(params) {
|
||||
return get('/app/collection/list', params, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取捐赠历史记录
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {number} params.pageNum - 页码
|
||||
* @param {number} params.pageSize - 每页数量
|
||||
* @returns {Promise} 返回捐赠历史数据
|
||||
*/
|
||||
export function getDonationHistory(params) {
|
||||
return get('/app/donation/history', params, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取祈福记录
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {number} params.pageNum - 页码
|
||||
* @param {number} params.pageSize - 每页数量
|
||||
* @returns {Promise} 返回祈福记录数据
|
||||
*/
|
||||
export function getPrayerRecords(params) {
|
||||
return get('/app/prayer/records', params, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取寺庙活动列表
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {number} params.pageNum - 页码
|
||||
* @param {number} params.pageSize - 每页数量
|
||||
* @returns {Promise} 返回寺庙活动数据
|
||||
*/
|
||||
export function getTempleActivities(params) {
|
||||
return get('/app/temple/activities', params, {
|
||||
timeout: 10000,
|
||||
showLoading: false,
|
||||
})
|
||||
}
|
||||
|
|
@ -208,6 +208,13 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/personalCenter/myAppointment",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
|
|
|
|||
581
pages/personalCenter/myAppointment.vue
Normal file
581
pages/personalCenter/myAppointment.vue
Normal file
|
|
@ -0,0 +1,581 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<base-background />
|
||||
<!-- 使用自定义导航栏组件 -->
|
||||
<custom-navbar ref="customNavbar" title="我的预约" />
|
||||
|
||||
<!-- 标签页导航 -->
|
||||
<view class="tab-container">
|
||||
<view
|
||||
:class="{ active: activeTab === 'activity' }"
|
||||
class="tab-item"
|
||||
@click="switchTab('activity')"
|
||||
>
|
||||
<text class="tab-text">活动预约</text>
|
||||
</view>
|
||||
<view
|
||||
:class="{ active: activeTab === 'meal' }"
|
||||
class="tab-item"
|
||||
@click="switchTab('meal')"
|
||||
>
|
||||
<text class="tab-text">斋饭预约</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 预约列表 -->
|
||||
<view class="appointment-list">
|
||||
<view
|
||||
v-for="(item, index) in appointmentList"
|
||||
:key="item.id"
|
||||
class="appointment-card"
|
||||
>
|
||||
<!-- 活动标题和状态 -->
|
||||
<view class="card-header">
|
||||
<text class="activity-title">{{ item.title }}</text>
|
||||
<view :class="['status-tag', getStatusClass(Number(item.state))]">
|
||||
<text class="status-text">{{ getStatusText(Number(item.state)) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 活动详情 -->
|
||||
<view class="card-details">
|
||||
<view class="detail-item">
|
||||
<text class="detail-label">活动时间:</text>
|
||||
<text class="detail-value"
|
||||
>{{ formatTime(item.slotStarteTime, item.slotEndTime) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="detail-item">
|
||||
<text class="detail-label">活动地点:</text>
|
||||
<text class="detail-value">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="detail-item">
|
||||
<text class="detail-label">参与人数:</text>
|
||||
<text class="detail-value">{{ item.number }}人</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="card-actions">
|
||||
<!-- 只有待核销状态才显示出示码券按钮 -->
|
||||
<view
|
||||
v-if="Number(item.state) === 1"
|
||||
class="action-btn primary"
|
||||
@click="showQRCode(item)"
|
||||
>
|
||||
<image
|
||||
class="btn-icon"
|
||||
mode="aspectFit"
|
||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
||||
/>
|
||||
<text class="btn-text">出示码券</text>
|
||||
</view>
|
||||
<!-- 只有待核销状态才显示取消预约按钮 -->
|
||||
<view
|
||||
v-if="Number(item.state) === 1"
|
||||
class="action-btn secondary"
|
||||
@click="cancelAppointment(item)"
|
||||
>
|
||||
<image
|
||||
class="btn-icon"
|
||||
mode="aspectFit"
|
||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
||||
/>
|
||||
<text class="btn-text">取消预约</text>
|
||||
</view>
|
||||
<!-- 已核销状态显示完成提示 -->
|
||||
<view v-if="Number(item.state) === 2" class="action-btn completed">
|
||||
<image
|
||||
class="btn-icon"
|
||||
mode="aspectFit"
|
||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
||||
/>
|
||||
<text class="btn-text">已完成</text>
|
||||
</view>
|
||||
<!-- 取消预约状态显示已取消提示 -->
|
||||
<view v-if="Number(item.state) === 3" class="action-btn canceled">
|
||||
<image
|
||||
class="btn-icon"
|
||||
mode="aspectFit"
|
||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
||||
/>
|
||||
<text class="btn-text">已取消</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="appointmentList.length === 0 && !loading" class="empty-state">
|
||||
<image
|
||||
class="empty-icon"
|
||||
mode="aspectFit"
|
||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
||||
/>
|
||||
<text class="empty-text">暂无预约记录</text>
|
||||
</view>
|
||||
|
||||
<!-- 加载状态 -->
|
||||
<view v-if="loading" class="loading-state">
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { CommonEnum } from "@/enum/common.js";
|
||||
import {
|
||||
cancelAppointment,
|
||||
getAppointmentList,
|
||||
getAppointmentQRCode,
|
||||
} from "@/api/personalCenter/index.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
CommonEnum,
|
||||
// 当前激活的标签页
|
||||
activeTab: "activity",
|
||||
// 加载状态
|
||||
loading: false,
|
||||
// 预约列表数据
|
||||
appointmentList: [],
|
||||
// 分页参数
|
||||
pageParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// 页面加载时获取预约列表
|
||||
this.loadAppointmentList();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// 下拉刷新
|
||||
this.refreshList();
|
||||
},
|
||||
onReachBottom() {
|
||||
// 上拉加载更多
|
||||
this.loadMore();
|
||||
},
|
||||
methods: {
|
||||
// 切换标签页
|
||||
switchTab(tab) {
|
||||
if (this.activeTab === tab) return;
|
||||
this.activeTab = tab;
|
||||
this.pageParams.pageNum = 1;
|
||||
this.appointmentList = [];
|
||||
this.loadAppointmentList();
|
||||
},
|
||||
|
||||
// 加载预约列表
|
||||
async loadAppointmentList() {
|
||||
if (this.loading) return;
|
||||
|
||||
this.loading = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: this.pageParams.pageNum,
|
||||
pageSize: this.pageParams.pageSize,
|
||||
type: this.activeTab === "activity" ? 1 : 2, // 1: 活动预约, 2: 斋饭预约
|
||||
};
|
||||
|
||||
const response = await getAppointmentList(params);
|
||||
|
||||
if (response.code === 200) {
|
||||
const { rows, total } = response;
|
||||
this.appointmentList =
|
||||
this.pageParams.pageNum === 1
|
||||
? rows
|
||||
: [...this.appointmentList, ...rows];
|
||||
this.pageParams.total = total;
|
||||
|
||||
// 调试信息:打印预约数据状态
|
||||
console.log("预约列表数据:", this.appointmentList);
|
||||
this.appointmentList.forEach((item, index) => {
|
||||
console.log(`预约 ${index + 1}:`, {
|
||||
title: item.title,
|
||||
state: item.state,
|
||||
stateType: typeof item.state,
|
||||
stateNumber: Number(item.state)
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || "获取预约列表失败",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取预约列表失败:", error);
|
||||
uni.showToast({
|
||||
title: "网络错误,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
} finally {
|
||||
this.loading = false;
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
},
|
||||
|
||||
// 刷新列表
|
||||
refreshList() {
|
||||
this.pageParams.pageNum = 1;
|
||||
this.loadAppointmentList();
|
||||
},
|
||||
|
||||
// 加载更多
|
||||
loadMore() {
|
||||
if (this.appointmentList.length >= this.pageParams.total) {
|
||||
return;
|
||||
}
|
||||
this.pageParams.pageNum++;
|
||||
this.loadAppointmentList();
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatTime(startTime, endTime) {
|
||||
if (!startTime || !endTime) return "时间待定";
|
||||
|
||||
const start = new Date(startTime);
|
||||
const end = new Date(endTime);
|
||||
|
||||
const startStr = `${start.getFullYear()}-${String(start.getMonth() + 1).padStart(2, "0")}-${String(start.getDate()).padStart(2, "0")} ${String(start.getHours()).padStart(2, "0")}:${String(start.getMinutes()).padStart(2, "0")}`;
|
||||
const endStr = `${String(end.getHours()).padStart(2, "0")}:${String(end.getMinutes()).padStart(2, "0")}`;
|
||||
|
||||
return `${startStr}-${endStr}`;
|
||||
},
|
||||
|
||||
// 获取状态文本
|
||||
getStatusText(state) {
|
||||
const statusMap = {
|
||||
1: "待核销",
|
||||
2: "已核销",
|
||||
3: "取消预约",
|
||||
};
|
||||
return statusMap[state] || "未知状态";
|
||||
},
|
||||
|
||||
// 获取状态样式类
|
||||
getStatusClass(state) {
|
||||
const classMap = {
|
||||
1: "status-pending", // 待核销 - 橙色
|
||||
2: "status-verified", // 已核销 - 绿色
|
||||
3: "status-canceled", // 取消预约 - 灰色
|
||||
};
|
||||
return classMap[state] || "status-default";
|
||||
},
|
||||
|
||||
// 显示二维码
|
||||
async showQRCode(item) {
|
||||
try {
|
||||
const response = await getAppointmentQRCode(item.subscribeId || item.id);
|
||||
|
||||
if (response.code === 200) {
|
||||
// TODO: 显示二维码弹窗
|
||||
console.log("二维码数据:", response.data);
|
||||
uni.showToast({
|
||||
title: "二维码功能开发中",
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || "获取二维码失败",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取二维码失败:", error);
|
||||
uni.showToast({
|
||||
title: "获取二维码失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 取消预约
|
||||
cancelAppointment(item) {
|
||||
uni.showModal({
|
||||
title: "确认取消",
|
||||
content: "确定要取消这个预约吗?",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
const response = await cancelAppointment(item.subscribeId || item.id);
|
||||
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: "预约已取消",
|
||||
icon: "success",
|
||||
});
|
||||
|
||||
// 刷新列表
|
||||
this.refreshList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || "取消失败",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("取消预约失败:", error);
|
||||
uni.showToast({
|
||||
title: "取消失败,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
background: #faf8f3;
|
||||
}
|
||||
|
||||
// 标签页容器
|
||||
.tab-container {
|
||||
width: 650rpx;
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 8rpx;
|
||||
border: 2rpx solid #c7a26d;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 12rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&.active {
|
||||
background: #c7a26d;
|
||||
|
||||
.tab-text {
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 32rpx;
|
||||
color: #695347;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
// 预约列表
|
||||
.appointment-list {
|
||||
width: 650rpx;
|
||||
margin-top: 24rpx;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.appointment-card {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx;
|
||||
margin-bottom: 24rpx;
|
||||
border: 2rpx solid #e8e0d0;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
// 卡片头部
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.activity-title {
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #695347;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 8rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
|
||||
&.status-pending {
|
||||
background: #ff9f43; // 待核销 - 橙色
|
||||
}
|
||||
|
||||
&.status-verified {
|
||||
background: #00b894; // 已核销 - 绿色
|
||||
}
|
||||
|
||||
&.status-canceled {
|
||||
background: #95a5a6; // 取消预约 - 灰色
|
||||
}
|
||||
|
||||
&.status-default {
|
||||
background: #74b9ff; // 默认 - 蓝色
|
||||
}
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
// 卡片详情
|
||||
.card-details {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
width: 160rpx;
|
||||
font-size: 28rpx;
|
||||
color: #8b7355;
|
||||
font-weight: 400;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #695347;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
// 操作按钮
|
||||
.card-actions {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 16rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&.primary {
|
||||
background: #c7a26d;
|
||||
|
||||
.btn-text {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: #b8945a;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
&.secondary {
|
||||
background: #f8f4f0;
|
||||
border: 2rpx solid #c7a26d;
|
||||
|
||||
.btn-text {
|
||||
color: #c7a26d;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: #f0e8d8;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
&.completed {
|
||||
background: #00b894;
|
||||
border: 2rpx solid #00b894;
|
||||
|
||||
.btn-text {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&.canceled {
|
||||
background: #95a5a6;
|
||||
border: 2rpx solid #95a5a6;
|
||||
|
||||
.btn-text {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// 空状态
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 120rpx 0;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin-bottom: 30rpx;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
color: #8b7355;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
// 加载状态
|
||||
.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60rpx 0;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 28rpx;
|
||||
color: #8b7355;
|
||||
font-weight: 400;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
<script>
|
||||
import { CommonEnum } from "@/enum/common.js";
|
||||
import { getUserInfo } from "@/api/personalCenter/index.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -98,16 +99,22 @@ export default {
|
|||
async loadUserInfo() {
|
||||
this.loading = true;
|
||||
try {
|
||||
// TODO: 调用获取用户信息API
|
||||
// const response = await getUserInfo()
|
||||
// this.userInfo = response.data
|
||||
|
||||
// 模拟加载
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
}, 500);
|
||||
const response = await getUserInfo();
|
||||
|
||||
if (response.code === 200) {
|
||||
// 更新用户信息
|
||||
this.userInfo = {
|
||||
phone: response.data.phone || "138****8912",
|
||||
verificationStatus: response.data.verificationStatus || "未实名",
|
||||
};
|
||||
} else {
|
||||
console.warn("获取用户信息失败:", response.msg);
|
||||
// 使用默认信息
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取用户信息失败:", error);
|
||||
// 使用默认信息
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user