1212121
This commit is contained in:
21
Web/src/components/Business/GameEqu.vue
Normal file
21
Web/src/components/Business/GameEqu.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<span v-if="showUrl == false">
|
||||
{{ equData.equName }}({{ equData.lev }}级)
|
||||
</span>
|
||||
<router-link v-if="showUrl" :to='"/prop/equ?ue=" + equData.ueId'>
|
||||
{{ equData.equName }}({{ equData.lev }}级)
|
||||
</router-link>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// 1. 定义接收父组件传来的参数 props
|
||||
const props = defineProps({
|
||||
showUrl: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
equData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -17,7 +17,10 @@
|
||||
|
||||
const props = defineProps({
|
||||
// 字段名、类型、默认值
|
||||
isShow: Boolean,
|
||||
isShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: String
|
||||
})
|
||||
const visible = ref(props.isShow)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
统一配置中心
|
||||
*/
|
||||
export class BaseConfig {
|
||||
public static BaseUrl: string = 'https://192.168.0.142:7198'
|
||||
public static BaseMediaUrl: string = 'https://192.168.0.142:7198'
|
||||
public static BaseUrl: string = 'https://localhost:7198'
|
||||
public static BaseMediaUrl: string = 'https://localhost:7198/'
|
||||
// public static BaseUrl:string="http://kx.iyba.cn:5291";
|
||||
// public static BaseMediaUrl:string="http://kx.iyba.cn:5291";
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
</span>
|
||||
部位:{{ EquTool.GetEquPlaceName(equData.code) }}<br>
|
||||
等级:{{ equData.lev }}<br>
|
||||
品阶:{{ EquTool.EquStartTips(equData.start) }}<br>
|
||||
<span v-if="equData.quality > 0">
|
||||
品质:<Abar href="">equData.qualityName</Abar><br>
|
||||
</span>
|
||||
@@ -117,16 +116,13 @@
|
||||
</div>
|
||||
<div class="common" v-if="myUserId == equData.userId && equData.isAppr == 1">
|
||||
<span>
|
||||
◈<Abutton @click="UpOrDownEqu">{{equData.isOn==1?"卸下装备":"穿戴装备"}}</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>洗练</Abutton><br>
|
||||
◈<Abutton @click="UpOrDownEqu">{{ equData.isOn == 1 ? "卸下装备" : "穿戴装备" }}</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>觉醒</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>升星</Abutton><br>
|
||||
◈<Abutton>洗练</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton @click="LockEqu">{{ equData.isLock == 0 ? "绑定" : "解绑" }}</Abutton><br>
|
||||
@@ -189,7 +185,7 @@ const BindData = async (): Promise<void> => {
|
||||
/**穿/卸装备 */
|
||||
const UpOrDownEqu = async () => {
|
||||
MessageExtend.LoadingToast("操作中...");
|
||||
let result = await EquService.DownOrUpEqu(ueId,"");
|
||||
let result = await EquService.DownOrUpEqu(ueId, "");
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="item" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>
|
||||
<span v-if="item.isOn == 1">(穿)</span>
|
||||
<span v-if="item.isOn == 1">(装)</span>
|
||||
<span v-if="item.isAppr == 0">(未鉴定)</span>
|
||||
<span v-if="item.useEndTime < onTime" style="color: red;">(过期)</span>
|
||||
<span v-if="item.durability < 1" style="color: red;">(损坏)</span>
|
||||
@@ -144,6 +144,7 @@ const BindData = async (): Promise<void> => {
|
||||
|
||||
/**切换背包 */
|
||||
const ChangeBag = async (_type: string): Promise<void> => {
|
||||
currentPage.value = 1;
|
||||
type.value = _type;
|
||||
type_ch.value = '0';
|
||||
serch.value='';
|
||||
@@ -151,6 +152,7 @@ const ChangeBag = async (_type: string): Promise<void> => {
|
||||
}
|
||||
|
||||
const ChangeChildBag = async (ch: string): Promise<void> => {
|
||||
currentPage.value = 1;
|
||||
type_ch.value = ch;
|
||||
await BindData();
|
||||
}
|
||||
|
||||
@@ -1,72 +1,76 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
手持: <Abutton>[+]</Abutton>
|
||||
手持: <Abutton @click="chooseEqu(1, Hold)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Hold">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton @click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
副手: <Abutton>[+]</Abutton>
|
||||
副手: <Abutton @click="chooseEqu(2, Vice)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Vice">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
头戴: <Abutton>[+]</Abutton>
|
||||
头戴: <Abutton @click="chooseEqu(3, Head)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Head">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
身穿: <Abutton>[+]</Abutton>
|
||||
身穿: <Abutton @click="chooseEqu(4, Wear)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Wear">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
腰带: <Abutton>[+]</Abutton>
|
||||
腰带: <Abutton @click="chooseEqu(5, Waist)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Waist">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
脚穿: <Abutton>[+]</Abutton>
|
||||
脚穿: <Abutton @click="chooseEqu(6, Foot)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Foot">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
佩戴: <Abutton>[+]</Abutton>
|
||||
佩戴: <Abutton @click="chooseEqu(7, Ornaments)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Ornaments">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
时装: <Abutton>[+]</Abutton>
|
||||
时装: <Abutton @click="chooseEqu(8, Fashion)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Fashion">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
羽翼: <Abutton>[+]</Abutton>
|
||||
羽翼: <Abutton @click="chooseEqu(9, Wing)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Wing">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
装饰: <Abutton>[+]</Abutton>
|
||||
装饰: <Abutton @click="chooseEqu(10, Decorate)">[+]</Abutton>
|
||||
<div class="item" v-for="item in Decorate">
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>[<Abutton
|
||||
@click="DownEqu(item.ueId)">卸下</Abutton>]
|
||||
<GameEqu :equ-data="item" :show-url="true"></GameEqu>[<Abutton
|
||||
@click="DownAndOnEqu(item.ueId, '')">卸下</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="suit.length > 0">
|
||||
<div class="item" v-for="item in suit">
|
||||
套装:<Abar :href='"/user/equ/suit?id=" + item.suitCode'>{{ item.suitName }}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
@@ -74,6 +78,37 @@
|
||||
<Abar href="/">我的圣痕</Abar><br>
|
||||
<Abar href="/user/bag">装备物品</Abar>
|
||||
</div>
|
||||
<!-- 选择装备 -->
|
||||
<GamePopup v-model:show="showChooseEqu" title="【选择装备】" style="min-width: 60%;">
|
||||
<!-- 自定义内容 -->
|
||||
<div class="content">
|
||||
<div class="mapList" style="max-height: 300px;margin-top: 15px;">
|
||||
<div v-for="(item, index) in equData" :key="index">
|
||||
{{ index + 1 }}.
|
||||
<Abutton @click="OnEqu(item.ueId)">
|
||||
<GameEqu :equ-data="item" :show-url="false"></GameEqu>
|
||||
</Abutton>
|
||||
</div>
|
||||
<span v-if="equData.length == 0">暂无装备.</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</GamePopup>
|
||||
<GamePopup v-model:show="showChangeEqu" title="【替换装备】" style="min-width: 60%;">
|
||||
<!-- 自定义内容 -->
|
||||
<div class="content">
|
||||
<div class="mapList" style="max-height: 300px;margin-top: 15px;">
|
||||
<div v-for="(item, index) in changeData" :key="index">
|
||||
{{ index + 1 }}.
|
||||
<Abutton @click="ChangeEqu(item.ueId)">
|
||||
<GameEqu :equ-data="item" :show-url="false"></GameEqu>
|
||||
</Abutton>
|
||||
</div>
|
||||
<span v-if="changeData.length == 0">暂无装备.</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</GamePopup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
@@ -81,6 +116,7 @@ definePageMeta({
|
||||
middleware: middleware.loading
|
||||
})
|
||||
const data = ref<Array<any>>([]);
|
||||
const suit = ref<Array<any>>([]);
|
||||
const Hold = ref<Array<any>>([]);
|
||||
const Vice = ref<Array<any>>([]);
|
||||
const Head = ref<Array<any>>([]);
|
||||
@@ -91,12 +127,17 @@ const Ornaments = ref<Array<any>>([]);
|
||||
const Fashion = ref<Array<any>>([]);
|
||||
const Wing = ref<Array<any>>([]);
|
||||
const Decorate = ref<Array<any>>([]);
|
||||
|
||||
const showChooseEqu = ref(false);
|
||||
const showChangeEqu = ref(false);
|
||||
const equData = ref<Array<any>>([]);
|
||||
const changeData = ref<Array<any>>([]);
|
||||
const onUpEqu = ref('');
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await EquService.GetUserOnEqu();
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
data.value = result.data.data;
|
||||
suit.value = result.data.suit;
|
||||
Hold.value = data.value.filter(it => it.code == 'Hold');
|
||||
Vice.value = data.value.filter(it => it.code == 'Vice');
|
||||
Head.value = data.value.filter(it => it.code == 'Head');
|
||||
@@ -106,7 +147,7 @@ const BindData = async (): Promise<void> => {
|
||||
Ornaments.value = data.value.filter(it => it.code == 'Ornaments');
|
||||
Fashion.value = data.value.filter(it => it.code == 'Fashion');
|
||||
Wing.value = data.value.filter(it => it.code == 'Wing');
|
||||
Decorate.value = data.value.filter(it => it.code == 'Decorate');
|
||||
Decorate.value = data.value.filter(it => it.code == 'Decorate');
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("我的装备", result.msg);
|
||||
@@ -123,8 +164,44 @@ onMounted(async () => {
|
||||
}
|
||||
})
|
||||
|
||||
const DownEqu = async (ueId: string) => {
|
||||
alert(ueId);
|
||||
const DownAndOnEqu = async (ueId: string, de: string) => {
|
||||
MessageExtend.LoadingToast("操作中...");
|
||||
let result = await EquService.DownOrUpEqu(ueId, de);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
MessageExtend.Notify(result.msg, "success");
|
||||
}
|
||||
else if (result.code == 100) {
|
||||
onUpEqu.value = ueId;
|
||||
showChangeEqu.value = true;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("穿/卸装备", result.msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const chooseEqu = async (type: number, data: Array<any>) => {
|
||||
showChooseEqu.value = true;
|
||||
changeData.value = data;
|
||||
let result = await EquService.GetCanOnEqu(type);
|
||||
if (result.code == 0) {
|
||||
equData.value = result.data;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("装备提示", result.msg);
|
||||
}
|
||||
}
|
||||
|
||||
const OnEqu = async (ueId: string) => {
|
||||
showChooseEqu.value = false;
|
||||
await DownAndOnEqu(ueId, "");
|
||||
}
|
||||
const ChangeEqu = async (ueId: string) => {
|
||||
showChangeEqu.value = false;
|
||||
await DownAndOnEqu(onUpEqu.value, ueId);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
68
Web/src/pages/user/equ/suit.vue
Normal file
68
Web/src/pages/user/equ/suit.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
【套装介绍】
|
||||
</div>
|
||||
<div class="content">
|
||||
套装名称:{{ data.suitName }}<br>
|
||||
套装介绍:<span v-html="data.sign"></span><br>
|
||||
</div>
|
||||
<div class="content">
|
||||
---◈套装部件◈---<br>
|
||||
<div class="item" v-for="item in onEqu">
|
||||
▸<Abar :href='"/prop/equ?id=" + item.equId'>{{ item.equName }}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
---◈套装属性◈---<br>
|
||||
<div v-for="item in suitAttr">
|
||||
<div class="content" v-for="attr in item.attrItem">
|
||||
<span>{{ item.type == 0 ? "✧" : "✡" }}</span>
|
||||
<span>{{ attr.tip }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
---◈已激活属性◈---<br>
|
||||
<div v-for="item in OnSuitAttr">
|
||||
<div class="content" v-for="attr in item.attrItem">
|
||||
<span>{{ item.type == 0 ? "✧" : "✡" }}</span>
|
||||
<span>{{ attr.tip }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
const onEqu = ref<Array<any>>([]);
|
||||
const suitAttr = ref<Array<any>>([]);
|
||||
const OnSuitAttr = ref<Array<any>>([]);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let suitCode = PageExtend.QueryString("id");
|
||||
let result = await EquService.GetUserOnSuitInfo(suitCode);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
onEqu.value = data.value.onEqu;
|
||||
suitAttr.value = data.value.attr;
|
||||
OnSuitAttr.value = result.data.suit.suitAttr;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -38,4 +38,20 @@ export class EquService {
|
||||
static async DownOrUpEqu(ueId: string, de: string) {
|
||||
return await ApiService.Request("get", "/Equ/DownOrUpEqu", { ueId, de });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可穿戴装备
|
||||
* GET /Equ/GetCanOnEqu
|
||||
*/
|
||||
static async GetCanOnEqu(type: number) {
|
||||
return await ApiService.Request("get", "/Equ/GetCanOnEqu", { type });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取激活套装属性
|
||||
* GET /Equ/GetUserOnSuitInfo
|
||||
*/
|
||||
static async GetUserOnSuitInfo(suitCode: string) {
|
||||
return await ApiService.Request("get", "/Equ/GetUserOnSuitInfo", { suitCode });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user