This commit is contained in:
Ls
2026-06-15 17:31:34 +08:00
parent 404af92f96
commit 5d4b5c989a
8 changed files with 428 additions and 292 deletions

129
Web/package-lock.json generated
View File

@@ -1856,9 +1856,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1876,9 +1873,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1896,9 +1890,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1916,9 +1907,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1936,9 +1924,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1956,9 +1941,6 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1976,9 +1958,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -1996,9 +1975,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2220,9 +2196,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2240,9 +2213,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2260,9 +2230,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2280,9 +2247,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2300,9 +2264,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2320,9 +2281,6 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2340,9 +2298,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2360,9 +2315,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2594,9 +2546,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2614,9 +2563,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2634,9 +2580,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2654,9 +2597,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2674,9 +2614,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2694,9 +2631,6 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2714,9 +2648,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2734,9 +2665,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2959,9 +2887,6 @@
"arm" "arm"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2983,9 +2908,6 @@
"arm" "arm"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3007,9 +2929,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3031,9 +2950,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3055,9 +2971,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3079,9 +2992,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3572,9 +3482,6 @@
"arm" "arm"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3589,9 +3496,6 @@
"arm" "arm"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3606,9 +3510,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3623,9 +3524,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3640,9 +3538,6 @@
"loong64" "loong64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3657,9 +3552,6 @@
"loong64" "loong64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3674,9 +3566,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3691,9 +3580,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3708,9 +3594,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3725,9 +3608,6 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3742,9 +3622,6 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3759,9 +3636,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -3776,9 +3650,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [

View File

@@ -2,8 +2,8 @@
统一配置中心 统一配置中心
*/ */
export class BaseConfig { export class BaseConfig {
public static BaseUrl:string="https://localhost:7198"; public static BaseUrl: string = 'https://192.168.0.142:7198'
public static BaseMediaUrl:string="https://localhost:7198"; public static BaseMediaUrl: string = 'https://192.168.0.142:7198'
// public static BaseUrl:string="http://kx.iyba.cn:5291"; // public static BaseUrl:string="http://kx.iyba.cn:5291";
// public static BaseMediaUrl:string="http://kx.iyba.cn:5291"; // public static BaseMediaUrl:string="http://kx.iyba.cn:5291";
} }

View File

@@ -1,100 +1,115 @@
export class TimeExtend { export class TimeExtend {
/** /**
* 格式化日期 * 格式化日期
* @param date 日期对象/时间戳/日期字符串 * @param date 日期对象/时间戳/日期字符串
* @param format 格式化模板 * @param format 格式化模板
* 示例yyyy-MM-dd、yyyy-MM-dd HH:mm:ss、HH:mm:ss、yyyy年MM月dd日 * 示例yyyy-MM-dd、yyyy-MM-dd HH:mm:ss、HH:mm:ss、yyyy年MM月dd日
*/ */
public static Format(date: Date | string | number, format = 'yyyy-MM-dd HH:mm:ss'): string { public static Format(date: Date | string | number, format = 'yyyy-MM-dd HH:mm:ss'): string {
let targetDate: Date let targetDate: Date
if (typeof date === 'number') { if (typeof date === 'number') {
date = date - 28800; date = date - 28800
targetDate = date.toString().length === 10 ? new Date(date * 1000) : new Date(date) targetDate = date.toString().length === 10 ? new Date(date * 1000) : new Date(date)
} else { } else {
targetDate = new Date(date) targetDate = new Date(date)
}
if (isNaN(targetDate.getTime())) return ''
const year = targetDate.getFullYear()
const month = targetDate.getMonth() + 1
const day = targetDate.getDate()
const hours = targetDate.getHours()
const minutes = targetDate.getMinutes()
const seconds = targetDate.getSeconds()
const pad = (num: number) => num.toString().padStart(2, '0')
return format
.replace('yyyy', String(year))
.replace('MM', pad(month))
.replace('dd', pad(day))
.replace('HH', pad(hours))
.replace('hh', pad(hours > 12 ? hours - 12 : hours))
.replace('mm', pad(minutes))
.replace('ss', pad(seconds))
} }
/** if (isNaN(targetDate.getTime())) return ''
* 获取当前时间格式化字符串
* @param format 格式
*/
public static Now(format = 'yyyy-MM-dd HH:mm:ss'): string {
return this.Format(new Date(), format)
}
/** const year = targetDate.getFullYear()
* 获取当前毫秒时间戳 const month = targetDate.getMonth() + 1
*/ const day = targetDate.getDate()
public static GetTimeStamp(): number { const hours = targetDate.getHours()
return Date.now() const minutes = targetDate.getMinutes()
} const seconds = targetDate.getSeconds()
/** const pad = (num: number) => num.toString().padStart(2, '0')
* 获取当前秒级时间戳
*/
public static GetSecondStamp(): number {
return Math.floor(Date.now() / 1000) + 28800
}
/** return format
* 获取当前日期 yyyy-MM-dd .replace('yyyy', String(year))
*/ .replace('MM', pad(month))
public static GetDateStr(): string { .replace('dd', pad(day))
return this.Now('yyyy-MM-dd') .replace('HH', pad(hours))
} .replace('hh', pad(hours > 12 ? hours - 12 : hours))
.replace('mm', pad(minutes))
.replace('ss', pad(seconds))
}
/** /**
* 获取当前时分秒 HH:mm:ss * 获取当前时间格式化字符串
*/ * @param format 格式
public static GetTimeStr(): string { */
return this.Now('HH:mm:ss') public static Now(format = 'yyyy-MM-dd HH:mm:ss'): string {
} return this.Format(new Date(), format)
}
/** /**
* 时间字符串 转换为 指定格式字符串 * 获取当前毫秒时间戳
* 场景:把 "2025-01-01 12:30:45" 转成 "2025年01月01日" / "01-01 12:30" 等 */
* @param timeStr 时间字符串(如 2025-01-01、2025/01/01 12:30、2025-01-01 12:30:45 public static GetTimeStamp(): number {
* @param format 目标格式 return Date.now()
*/ }
public static StrToFormat(timeStr: string, format = 'yyyy-MM-dd HH:mm:ss'): string {
return this.Format(timeStr, format);
}
/**
* 时间字符串 转 日期对象
* @param timeStr 时间字符串
*/
public static StrToDate(timeStr: string): Date | null {
const date = new Date(timeStr);
return isNaN(date.getTime()) ? null : date;
}
/** /**
* 时间字符串 转 秒级时间戳 * 获取当前秒级时间戳
* @param timeStr 时间字符串 */
*/ public static GetSecondStamp(): number {
public static StrToSecondStamp(timeStr: string): number | null { return Math.floor(Date.now() / 1000) + 28800
const date = this.StrToDate(timeStr); }
return date ? Math.floor(date.getTime() / 1000) : null;
/**
* 获取当前日期 yyyy-MM-dd
*/
public static GetDateStr(): string {
return this.Now('yyyy-MM-dd')
}
/**
* 获取当前时分秒 HH:mm:ss
*/
public static GetTimeStr(): string {
return this.Now('HH:mm:ss')
}
/**
* 时间字符串 转换为 指定格式字符串
* 场景:把 "2025-01-01 12:30:45" 转成 "2025年01月01日" / "01-01 12:30" 等
* @param timeStr 时间字符串(如 2025-01-01、2025/01/01 12:30、2025-01-01 12:30:45
* @param format 目标格式
*/
public static StrToFormat(timeStr: string, format = 'yyyy-MM-dd HH:mm:ss'): string {
return this.Format(timeStr, format)
}
/**
* 时间字符串 转 日期对象
* @param timeStr 时间字符串
*/
public static StrToDate(timeStr: string): Date | null {
const date = new Date(timeStr)
return isNaN(date.getTime()) ? null : date
}
/**
* 时间字符串 转 秒级时间戳
* @param timeStr 时间字符串
*/
public static StrToSecondStamp(timeStr: string): number | null {
const date = this.StrToDate(timeStr)
return date ? Math.floor(date.getTime() / 1000) : null
}
/**
* 计算目标时间与当前时间的剩余分钟数
* @param timeStr 时间字符串
*/
public static GetRemainingMinutes(timeStr: string): number {
const target = new Date(timeStr.replace(/-/g, '/'))
const now = new Date()
const diffMs = target.getTime() - now.getTime()
if (Math.floor(diffMs / 1000 / 60) <= 0) {
return 0
} else {
return Math.floor(diffMs / 1000 / 60)
} }
}
} }

View File

@@ -31,7 +31,8 @@
</div> </div>
<div class="content"> <div class="content">
<div class="item" v-for="(item, index) in userData" :key="index"> <div class="item" v-for="(item, index) in userData" :key="index">
<Abutton @click="loginGame(item.userId)" >{{ item.areaId }}{{ item.nick }}({{ (item.sex == null || item.sex == '') ? <Abutton @click="loginGame(item.userId)">{{ item.areaId }}{{ item.nick }}({{ (item.sex == null || item.sex
== '') ?
"未知" : item.sex }})</Abutton> "未知" : item.sex }})</Abutton>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,164 @@
<template>
<div class="content">
<Acheak :on-value="type" on-cheak="0">练功房</Acheak>
</div>
<div>
<Abutton v-if="data.length == 0" @click="showView()">立即修炼</Abutton>
</div>
<div class="content" v-if="type == '0'">
<div class="item" v-for="(item, index) in data" :key="index">
<span v-if="TimeExtend.GetRemainingMinutes(item.endTime) > 0">
{{ item.name }}
剩余{{ TimeExtend.GetRemainingMinutes(item.endTime) }}分钟
</span>
<span v-else>
{{ item.name }}
<Abutton @click="finish(item)">完成修炼</Abutton>
</span>
</div>
<span v-if="data.length == 0">
暂无修炼
</span>
</div>
<GamePopup v-model:show="showInfo" title="修炼资源" style="width: 70%;">
<div>
<div class="item" v-for="(item, index) in resourceList" :key="index">
{{ item.goodsName }} x {{ item.count }}
<Abutton @click="useResource(item)">立即使用</Abutton>
</div>
<div style="text-align: center;" v-if="resourceList.length == 0">
暂无资源
</div>
</div>
</GamePopup>
<!-- <div class="content">
<Pagination :currentPage="currentPage" :limit="10" :total="total" @pageChange="handlePageChange" />
</div>
<div class="clear"></div> -->
</template>
<script setup lang="ts">
interface friendStorage {
type: string
page: number
}
definePageMeta({
layout: layout.default,
middleware: 'page-loading'
})
const currentPage = ref<number>(1);
const total = ref<number>(0);
const data = ref<Array<any>>([]);
const type = ref('0');
let limit = ref(10)
let resourceList = ref<Array<any>>([])
let showInfo = ref(false)
onMounted(async () => {
try {
await BindData();
}
finally {
PageLoading.Close();
}
})
const BindData = async (): Promise<void> => {
let result = await PractiseService.GetUserPractise(Number(currentPage.value));
if (result.code == 0) {
data.value = result.data.list;
total.value = result.data.total.value
console.log(total.value);
limit.value = result.data.limit
//存储请求参数
let addLocalData: friendStorage = { type: type.value, page: currentPage.value };
LocalStorageExtend.Set("FriendCache", addLocalData);
}
else {
MessageExtend.ShowDialog("提示", result.msg);
}
};
// 弹窗控制
const showView = () => {
showInfo.value = true;
getResource()
}
const getResource = async () => {
let result = await PractiseService.MakeGoodsList();
if (result.code == 0) {
resourceList.value = result.data.list
}
else {
MessageExtend.ShowDialog("提示", result.msg);
}
}
// 使用资源
const useResource = async (item: any) => {
MessageExtend.ShowConfirmDialogAsyc("使用道具", `您确定使用${item.goodsName}吗?`, async () => {
let result = await PractiseService.MakeGoods(item.ugId);
if (result.code == 0) {
MessageExtend.ShowDialog("提示", '使用成功!');
showInfo.value = false;
BindData()
}
else {
MessageExtend.ShowDialog("提示", result.msg);
}
return true;
});
}
// 完成修炼
const finish = async (item: any) => {
console.log(item);
let result = await PractiseService.OkPractise(item.practiseId);
if (result.code == 0) {
MessageExtend.ShowDialog("提示", '修炼已完成!');
BindData()
}
else {
MessageExtend.ShowDialog("提示", result.msg);
}
return true;
}
/**翻页 */
const handlePageChange = async (page: number): Promise<void> => {
currentPage.value = page;
await BindData();
};
</script>
<style scoped>
.item {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>

View File

@@ -1 +1,53 @@
<template></template> <template>
<div class="content">
我的山寨
</div>
<div>山寨建筑</div>
<div>
<div>
1.<Abar href="/user/home/study/Practise">练功房</Abar>
</div>
<div>
2.<Abar href="/map/user">农场</Abar>
</div>
</div>
</template>
<script setup lang="ts">
onMounted(async () => {
try {
}
finally {
PageLoading.Close();
}
})
</script>
<style scoped>
.item {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>

View File

@@ -1,88 +1,88 @@
<template> <template>
<div class="content"> <div class="content">
<Abar href="/user/maxname">更换称号</Abar><br> <Abar href="/user/maxname">更换称号</Abar><br>
ID:{{ userData.userNo }}&nbsp;[<Abar href="/privilege/liang">升靓号</Abar>]<br> ID:{{ userData.userNo }}&nbsp;[<Abar href="/privilege/liang">升靓号</Abar>]<br>
昵称:<Abar href="/user/nick">{{ userData.nick }}</Abar><br> 昵称:<Abar href="/user/nick">{{ userData.nick }}</Abar><br>
性别:<Abar href="/user/sex">{{ userData.sex }}</Abar><br> 性别:<Abar href="/user/sex">{{ userData.sex }}</Abar><br>
<Abar href="/privilege/">特权</Abar>:<br> <Abar href="/privilege/">特权</Abar>:<br>
徽章:<Abar href="/user/badge/">显示</Abar><br> 徽章:<Abar href="/user/badge/">显示</Abar><br>
社交:<Abar href="/user/gift">未收到礼物</Abar><br> 社交:<Abar href="/user/gift">未收到礼物</Abar><br>
婚姻:单身<br> 婚姻:单身<br>
个性签名:{{ userData.sign }}<Abar href="/user/sign">修改</Abar><br> 个性签名:{{ userData.sign }}<Abar href="/user/sign">修改</Abar><br>
宠物:暂无<br> 宠物:暂无<br>
坐骑:<br> 坐骑:<br>
成就:<Abar href="/user/honnor">展示成就</Abar><br> 成就:<Abar href="/user/honnor">展示成就</Abar><br>
等级:{{ attrData.lev }}<br> 等级:{{ attrData.lev }}<br>
综合战力:{{attrData.score}}<br> 综合战力:{{ attrData.score }}<br>
经验:{{ expData.exp }}/{{ expData.upExp }}<br> 经验:{{ expData.exp }}/{{ expData.upExp }}<br>
体力:{{attrData.blood}}/{{attrData.upBlood}} {{attrData.bloodTips}}<br> 体力:{{ attrData.blood }}/{{ attrData.upBlood }} {{ attrData.bloodTips }}<br>
攻击:{{attrData.minAtk}}-{{attrData.maxAtk}} {{attrData.atkTips}}<br> 攻击:{{ attrData.minAtk }}-{{ attrData.maxAtk }} {{ attrData.atkTips }}<br>
防御:{{attrData.defense}} {{attrData.defTips}}<br> 防御:{{ attrData.defense }} {{ attrData.defTips }}<br>
敏捷:{{attrData.agility}} {{attrData.agilityTips}}<br> 敏捷:{{ attrData.agility }} {{ attrData.agilityTips }}<br>
士气:{{attrData.morale}}/{{attrData.upMorale}} {{attrData.moraleTips}}<br> 士气:{{ attrData.morale }}/{{ attrData.upMorale }} {{ attrData.moraleTips }}<br>
师德:{{accData.teach}}<br> 师德:{{ accData.teach }}<br>
声望:{{accData.renown}}<br> 声望:{{ accData.renown }}<br>
活力:{{ vitality }}<br> 活力:{{ vitality }}<br>
罪恶值:0<br> 罪恶值:0<br>
帮派:<br> 帮派:<br>
<!-- ---药品状态---<br> <!-- ---药品状态---<br>
体力宝+24370<br> 体力宝+24370<br>
耐久包+0<br> --> 耐久包+0<br> -->
</div>
<div class="content">
<div class="item">
<Abar href="/user/equ">装备</Abar>.
<Abar href="/user/skill">技能</Abar>.
<Abar href="/user/attr">特性</Abar>
</div> </div>
<div class="content"> <div class="item">
<div class="item"> <Abar href="/group">帮派</Abar>.
<Abar href="/user/equ">装备</Abar>. <Abar href="/pet">宠物</Abar>.
<Abar href="/user/skill">技能</Abar>. <Abar href="/user/ship">船队</Abar>
<Abar href="/user/attr">特性</Abar>
</div>
<div class="item">
<Abar href="/group">帮派</Abar>.
<Abar href="/pet">宠物</Abar>.
<Abar href="/user/ship">船队</Abar>
</div>
<div class="item">
<Abar href="/user/home/study">山寨</Abar>.
<Abar href="/user/home">房产</Abar>.
<Abar href="/user/setting">设置</Abar>
</div>
</div> </div>
<div class="item">
<Abar href="/user/home/study/Practise">山寨</Abar>.
<Abar href="/user/home">房产</Abar>.
<Abar href="/user/setting">设置</Abar>
</div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
definePageMeta({ definePageMeta({
layout: layout.default, layout: layout.default,
middleware: 'page-loading' middleware: 'page-loading'
}) })
const userData = ref<any>({}); const userData = ref<any>({});
const vitality = ref(0); const vitality = ref(0);
const expData = ref<any>({}); const expData = ref<any>({});
const attrData = ref<any>({}); const attrData = ref<any>({});
const accData = ref<any>({}); const accData = ref<any>({});
onMounted(async () => { onMounted(async () => {
try { try {
await BindData(); await BindData();
} }
finally { finally {
PageLoading.Close(); PageLoading.Close();
} }
}) })
const BindData = async (): Promise<void> => { const BindData = async (): Promise<void> => {
let result = await UserService.GetUserInfo(); let result = await UserService.GetUserInfo();
if (result.code == 0) { if (result.code == 0) {
userData.value = result.data.user; userData.value = result.data.user;
vitality.value = result.data.vitality; vitality.value = result.data.vitality;
expData.value = result.data.exp; expData.value = result.data.exp;
attrData.value = result.data.attr; attrData.value = result.data.attr;
accData.value = result.data.acc; accData.value = result.data.acc;
console.log(result); console.log(result);
} }
else { else {
MessageExtend.ShowDialog("提示", result.msg); MessageExtend.ShowDialog("提示", result.msg);
} }
}; };
</script> </script>

View File

@@ -0,0 +1,33 @@
export class PractiseService {
/**
* 获取山寨修炼列表信息
* GET /Practise/GetUserPractise
*/
static async GetUserPractise(page: number) {
return await ApiService.Request('get', '/Practise/GetUserPractise', { page })
}
/**
* 获取修炼道具
* GET /Practise/MakeGoodsList
*/
static async MakeGoodsList() {
return await ApiService.Request('get', '/Practise/MakeGoodsList', {})
}
/**
* 立即修炼
* GET /Practise/MakeGoods
*/
static async MakeGoods(par: string) {
return await ApiService.Request('post', '/Practise/MakeGoods', { par })
}
/**
* 完成修炼
* GET /Practise/OkPractise
*/
static async OkPractise(par: string) {
return await ApiService.Request('post', '/Practise/OkPractise', { par })
}
}