个人中心页面接口数据获取
This commit is contained in:
parent
5c935f23b1
commit
a5f7f64459
|
|
@ -1,5 +1,5 @@
|
||||||
// 个人中心相关API
|
// 个人中心相关API
|
||||||
import { get, request } from '@/utils/request'
|
import { get, request } from "@/utils/request";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取预约列表
|
* 获取预约列表
|
||||||
|
|
@ -10,10 +10,10 @@ import { get, request } from '@/utils/request'
|
||||||
* @returns {Promise} 返回预约列表数据
|
* @returns {Promise} 返回预约列表数据
|
||||||
*/
|
*/
|
||||||
export function getAppointmentList(params) {
|
export function getAppointmentList(params) {
|
||||||
return get('/app/subscribe/list', params, {
|
return get("/app/subscribe/list", params, {
|
||||||
timeout: 10000,
|
timeout: 6000,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -23,12 +23,12 @@ export function getAppointmentList(params) {
|
||||||
*/
|
*/
|
||||||
export function cancelAppointment(subscribeId) {
|
export function cancelAppointment(subscribeId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/app/subscribe/cancelSub',
|
url: "/app/subscribe/cancelSub",
|
||||||
method: 'PUT',
|
method: "PUT",
|
||||||
params: {
|
params: {
|
||||||
subscribeId: subscribeId
|
subscribeId: subscribeId,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -37,12 +37,16 @@ export function cancelAppointment(subscribeId) {
|
||||||
* @returns {Promise} 返回核销结果
|
* @returns {Promise} 返回核销结果
|
||||||
*/
|
*/
|
||||||
export function verifyAppointmentCode(subscribeId) {
|
export function verifyAppointmentCode(subscribeId) {
|
||||||
return get('/app/subscribe/verifiedCode', {
|
return get(
|
||||||
subscribeId: subscribeId
|
"/app/subscribe/verifiedCode",
|
||||||
}, {
|
{
|
||||||
timeout: 10000,
|
subscribeId: subscribeId,
|
||||||
showLoading: true,
|
},
|
||||||
})
|
{
|
||||||
|
timeout: 6000,
|
||||||
|
showLoading: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -50,10 +54,14 @@ export function verifyAppointmentCode(subscribeId) {
|
||||||
* @returns {Promise} 返回用户信息
|
* @returns {Promise} 返回用户信息
|
||||||
*/
|
*/
|
||||||
export function getUserInfo() {
|
export function getUserInfo() {
|
||||||
return get('/app/user/info', {}, {
|
return get(
|
||||||
timeout: 10000,
|
"/app/user/getUser",
|
||||||
showLoading: false,
|
{},
|
||||||
})
|
{
|
||||||
|
timeout: 6000,
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,10 +71,10 @@ export function getUserInfo() {
|
||||||
*/
|
*/
|
||||||
export function updateUserInfo(data) {
|
export function updateUserInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/app/user/info',
|
url: "/app/user/info",
|
||||||
method: 'PUT',
|
method: "PUT",
|
||||||
data,
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -77,10 +85,10 @@ export function updateUserInfo(data) {
|
||||||
* @returns {Promise} 返回收藏列表数据
|
* @returns {Promise} 返回收藏列表数据
|
||||||
*/
|
*/
|
||||||
export function getMyCollection(params) {
|
export function getMyCollection(params) {
|
||||||
return get('/app/collection/list', params, {
|
return get("/app/collection/list", params, {
|
||||||
timeout: 10000,
|
timeout: 6000,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,10 +99,10 @@ export function getMyCollection(params) {
|
||||||
* @returns {Promise} 返回捐赠历史数据
|
* @returns {Promise} 返回捐赠历史数据
|
||||||
*/
|
*/
|
||||||
export function getDonationHistory(params) {
|
export function getDonationHistory(params) {
|
||||||
return get('/app/donation/history', params, {
|
return get("/app/donation/history", params, {
|
||||||
timeout: 10000,
|
timeout: 6000,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -105,10 +113,10 @@ export function getDonationHistory(params) {
|
||||||
* @returns {Promise} 返回祈福记录数据
|
* @returns {Promise} 返回祈福记录数据
|
||||||
*/
|
*/
|
||||||
export function getPrayerRecords(params) {
|
export function getPrayerRecords(params) {
|
||||||
return get('/app/prayer/records', params, {
|
return get("/app/prayer/records", params, {
|
||||||
timeout: 10000,
|
timeout: 6000,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -119,8 +127,8 @@ export function getPrayerRecords(params) {
|
||||||
* @returns {Promise} 返回寺庙活动数据
|
* @returns {Promise} 返回寺庙活动数据
|
||||||
*/
|
*/
|
||||||
export function getTempleActivities(params) {
|
export function getTempleActivities(params) {
|
||||||
return get('/app/temple/activities', params, {
|
return get("/app/temple/activities", params, {
|
||||||
timeout: 10000,
|
timeout: 6000,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -5,16 +5,12 @@
|
||||||
<custom-navbar ref="customNavbar" title="个人中心" />
|
<custom-navbar ref="customNavbar" title="个人中心" />
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<view class="avatar-container">
|
<view class="avatar-container">
|
||||||
<image
|
<image :src="userInfo.avatar" class="avatar" mode="aspectFill" />
|
||||||
class="avatar"
|
|
||||||
mode="aspectFill"
|
|
||||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="user-details">
|
<view class="user-details">
|
||||||
<text class="phone-number">{{ userInfo.phone }}</text>
|
<text class="phone-number">{{ userInfo.phone }}</text>
|
||||||
<view class="verification-status">
|
<view class="verification-status">
|
||||||
<text class="status-text">{{ userInfo.verificationStatus }}</text>
|
<text class="status-text">{{ realNameStatus }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -57,8 +53,9 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
// 用户信息
|
// 用户信息
|
||||||
userInfo: {
|
userInfo: {
|
||||||
phone: "138****8912",
|
phone: "666****6666",
|
||||||
verificationStatus: "未实名",
|
verificationStatus: "false",
|
||||||
|
avatar: "",
|
||||||
},
|
},
|
||||||
// 菜单项数据
|
// 菜单项数据
|
||||||
menuItems: [
|
menuItems: [
|
||||||
|
|
@ -97,15 +94,15 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
// 加载用户信息
|
// 加载用户信息
|
||||||
async loadUserInfo() {
|
async loadUserInfo() {
|
||||||
this.loading = true;
|
|
||||||
try {
|
try {
|
||||||
const response = await getUserInfo();
|
const response = await getUserInfo();
|
||||||
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
// 更新用户信息
|
// 更新用户信息
|
||||||
this.userInfo = {
|
this.userInfo = {
|
||||||
phone: response.data.phone || "138****8912",
|
phone: response.data.phonenumber || "666****6666",
|
||||||
verificationStatus: response.data.verificationStatus || "未实名",
|
isRealName: response.data.isReal || "false",
|
||||||
|
avatar: response.data.avatar,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
console.warn("获取用户信息失败:", response.msg);
|
console.warn("获取用户信息失败:", response.msg);
|
||||||
|
|
@ -138,6 +135,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
realNameStatus() {
|
||||||
|
return this.isRealName ? "实名" : "未实名";
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user