feat(周星打榜页): 接口调整
This commit is contained in:
parent
93766bbdfb
commit
52853e3d11
@ -4,7 +4,7 @@ import { get, post } from '../utils/http.js'
|
|||||||
export const getWeekStarRanking = async (data) => {
|
export const getWeekStarRanking = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response = await get(
|
const response = await get(
|
||||||
`/activity/week-star/ranking?type=${data.type}¤t=${data.current}&size=${data.size}`
|
`/activity/week-star/ranking?type=${data.type}¤t=${data.current}&size=${data.size}`,
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -18,7 +18,7 @@ export const getWeekStarRanking = async (data) => {
|
|||||||
export const getMyWeekStarRanking = async (data) => {
|
export const getMyWeekStarRanking = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response = await get(
|
const response = await get(
|
||||||
`/activity/week-star/my-rank?type=${data.type}&userId=${data.userId}`
|
`/activity/week-star/my-rank?type=${data.type}&userId=${data.userId}`,
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -68,7 +68,7 @@ export const getHistoryTopOne = async () => {
|
|||||||
export const getExchangeGoods = async (data) => {
|
export const getExchangeGoods = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response = await get(
|
const response = await get(
|
||||||
`/activity/week-star/listActivityResource?sysOrigin=${data.sysOrigin}&activityType=${data.activityType}`
|
`/activity/week-star/listActivityResource?sysOrigin=${data.sysOrigin}&activityType=${data.activityType}`,
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -82,7 +82,7 @@ export const getExchangeGoods = async (data) => {
|
|||||||
export const getMyFragment = async (data) => {
|
export const getMyFragment = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response = await post(
|
const response = await post(
|
||||||
`/activity/week-star/list/by/user-id?userId=${data.userId}&fragmentsIds=${data.fragmentsIds}`
|
`/activity/week-star/list/by/user-id?userId=${data.userId}&fragmentsIds=${data.fragmentsIds}`,
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -95,9 +95,7 @@ export const getMyFragment = async (data) => {
|
|||||||
// 获取我拥有的碎片
|
// 获取我拥有的碎片
|
||||||
export const exchangeGood = async (data) => {
|
export const exchangeGood = async (data) => {
|
||||||
try {
|
try {
|
||||||
const response = await post(
|
const response = await post(`/activity/week-star/exchange`, data)
|
||||||
`/activity/week-star/exchange?propsGroupId=${data.propsGroupId}&fragmentsId=${data.fragmentsId}`
|
|
||||||
)
|
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to exchange goods:', error)
|
console.error('Failed to exchange goods:', error)
|
||||||
|
|||||||
@ -985,16 +985,19 @@ const selectGood = (good) => {
|
|||||||
selectedGood.value = good
|
selectedGood.value = good
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 兑换商品
|
||||||
const exchangeSelectedGood = async (propsGroupId) => {
|
const exchangeSelectedGood = async (propsGroupId) => {
|
||||||
try {
|
try {
|
||||||
let data = {
|
let data = {
|
||||||
propsGroupId,
|
propsGroupId,
|
||||||
fragmentsId: '1968948330210508801',
|
fragmentsId: '1968948330210508801',
|
||||||
|
userId: userInfo.value.id,
|
||||||
}
|
}
|
||||||
const resExchangeGood = await exchangeGood(data)
|
const resExchangeGood = await exchangeGood(data)
|
||||||
|
|
||||||
if (resExchangeGood.status) {
|
if (resExchangeGood.status) {
|
||||||
getThisWeekExchangeGoods() //刷新我的碎片
|
closedPopup() // 关闭弹窗
|
||||||
|
getThisWeekMyFragment() //刷新我的碎片
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error:', error)
|
console.log('error:', error)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user