12121
This commit is contained in:
BIN
Web/public/images/site/tg.gif
Normal file
BIN
Web/public/images/site/tg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 B |
BIN
Web/public/images/site/tr.gif
Normal file
BIN
Web/public/images/site/tr.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 B |
@@ -42,6 +42,7 @@ const visible = ref(props.isShow)
|
||||
position: relative;
|
||||
padding: 18px 20px;
|
||||
text-align: center;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
/* 标题文字 */
|
||||
|
||||
32
Web/src/components/Business/GameTaskPropVerify.vue
Normal file
32
Web/src/components/Business/GameTaskPropVerify.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="common" v-for="(item, index) in data" :key="index">
|
||||
<div v-if="item.code == 'Goods'">
|
||||
▸<Abar :href='"/prop/goods?id=" + item.parameter'>{{ item.name }}</Abar>:({{ item.onCount }}/{{ item.count
|
||||
}})
|
||||
<span style="color: red;" v-if="item.isAsk == 0">(不满足)</span>
|
||||
<span v-if="item.isAsk == 0">
|
||||
[<Abutton @click="MapTo(index)">传送</Abutton>]
|
||||
</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
▸{{ item.name }}:({{ item.onCount }}/{{ item.count }})
|
||||
<span style="color: red;" v-if="item.isAsk == 0">(不满足)</span>
|
||||
<span v-if="item.isAsk == 0">
|
||||
[<Abutton @click="MapTo(index)">传送</Abutton>]
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
// 字段名、类型、默认值
|
||||
data: Array<any>
|
||||
})
|
||||
const emit = defineEmits(['mapTo'])
|
||||
|
||||
const MapTo = async (num: Number) => {
|
||||
emit('mapTo', { num: num });
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -119,7 +119,7 @@ const Initialize = async (): Promise<void> => {
|
||||
areaData.value = result.data?.area;
|
||||
noticeData.value = result.data.notice;
|
||||
OnCount.value = result.data.onCount;
|
||||
AccountInfo.value = result.data.account;
|
||||
AccountInfo.value = result.data.account;
|
||||
userData.value = result.data.userData;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="data.busType == 'Box'">
|
||||
222
|
||||
<div class="common" v-if="needs.length > 0">
|
||||
开启要求:<br>
|
||||
<GamePropVerify :data="verifyData.needs"></GamePropVerify>
|
||||
</div>
|
||||
<div class="common" v-if="verifyData.result">
|
||||
<Abutton @click="OpenBox">立即开启</Abutton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -67,4 +73,17 @@ const MapTo = async (index: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
const OpenBox = async () => {
|
||||
MessageExtend.LoadingToast("开启中...");
|
||||
let result = await MapBusService.MapBusBox(Number(busId));
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
MessageExtend.Notify(result.msg,"success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowToast(result.msg);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<GameBroadcast :data="broadcast"></GameBroadcast>
|
||||
<div class="content" v-if="isHook==1">
|
||||
<div class="content" v-if="isHook == 1">
|
||||
<div class="item" style="font-size:15px;font-weight:bold;color:green">
|
||||
<i class="dup"></i>
|
||||
<Abar href="/user/onhook" style="color:green">小宝贝,正在挂机中...</Abar>
|
||||
@@ -31,7 +31,9 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="item" v-for="item in npcData">
|
||||
<Abar :href='"/map/npc?npc=" + item.npcId'>{{ item.npcName }}{{ item.tips }}</Abar>
|
||||
<img src="/images/site/tg.gif" v-if="item.state == 1" />
|
||||
<img src="/images/site/tr.gif" v-if="item.state == 2" />
|
||||
<Abar :href='"/map/npc?npc=" + item.npcId'>{{ item.name }}{{ item.tips }}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="business.length > 0">
|
||||
@@ -171,7 +173,7 @@ const BindData = async (map: string): Promise<void> => {
|
||||
cityShow.value = result.data.cityShow;
|
||||
mapUser.value = result.data.nearUser;
|
||||
messageCount.value = result.data.noReadMsg;
|
||||
business.value = result.data.business;
|
||||
business.value = result.data.business;
|
||||
mapRes.value = result.data.mapRes;
|
||||
broadcast.value = result.data.broadcast;
|
||||
MapVent(result.data.mapInfo.near);
|
||||
@@ -340,15 +342,15 @@ const AddFight = async (type: number, monsterId: string, sign: string) => {
|
||||
|
||||
/**拾取物品 */
|
||||
const GetMapGoods = async (mgId: string) => {
|
||||
MessageExtend.LoadingToast("拾取中...");
|
||||
MessageExtend.LoadingToast("拾取中...");
|
||||
let result = await MapService.GetMapGoods(mgId);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
await BindData("");
|
||||
MessageExtend.Notify(result.msg,"success");
|
||||
MessageExtend.Notify(result.msg, "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.Notify(result.msg,"danger");
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,11 +7,21 @@
|
||||
{{ data.story }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="content" v-if="data.code == 'Default'">
|
||||
<div class="item" v-for="item in data.bus">
|
||||
◈<Abar :href="item.url">{{ item.name }}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="data.code == 'Task'">
|
||||
<div class="common" v-if="task.length > 0">
|
||||
当前任务:<br>
|
||||
<div class="item" v-for="item in task">
|
||||
<img src="/images/site/tg.gif" v-if="item.state==0" />
|
||||
<img src="/images/site/tr.gif" v-if="item.state==1" />
|
||||
<Abar :href='"/task/info?task=" + item.itemId'>[{{ item.code }}]{{ item.name }}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -20,7 +30,7 @@ definePageMeta({
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
|
||||
const task = ref<Array<any>>([]);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
@@ -36,8 +46,9 @@ const BindData = async (): Promise<void> => {
|
||||
let npc = PageExtend.QueryString("npc");
|
||||
let result = await MapService.GetNpcInfo(Number(npc));
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
LocalStorageHelper.SetOnNpc(npc);//存储当前进的npc信息
|
||||
data.value = result.data.data;
|
||||
task.value = result.data.task;
|
||||
LocalStorageHelper.SetOnNpc(npc);//存储当前进的npc信息
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialogEvent("提示", result.msg, () => {
|
||||
|
||||
110
Web/src/pages/task/info.vue
Normal file
110
Web/src/pages/task/info.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<strong>{{ npcData.npcName }}</strong>:{{ talkMsg }}
|
||||
</div>
|
||||
<div class="content" v-if="taskState == 100">
|
||||
等待开放下一环任务!
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="data.state != -1">
|
||||
<div class="content" v-if="needs.length > 0">
|
||||
任务要求:<br>
|
||||
<GameTaskPropVerify :data="verifyData.needs" @mapTo="mapTo"></GameTaskPropVerify>
|
||||
</div>
|
||||
<div class="content" v-if="verifyData.result">
|
||||
<div v-if="taskState == 1">
|
||||
我:<Abutton @click="ReturnTask">{{ btnTips }}</Abutton>
|
||||
</div>
|
||||
<div v-if="taskState == 2">
|
||||
➢<Abutton @click="retTask">我要传送</Abutton>(领路蝶:{{ retGoods }})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
const npcData = ref<any>({});
|
||||
const verifyData = ref<any>({});
|
||||
const needs = ref<Array<any>>([]);
|
||||
const talkMsg = ref('');
|
||||
const btnTips = ref('');
|
||||
const taskState = ref(-1);
|
||||
const toGoods = ref(0);
|
||||
const retGoods = ref(0);
|
||||
let taskId = PageExtend.QueryString("task");
|
||||
let npcId = LocalStorageHelper.GetOnNpc();
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await TaskService.GetTaskByNpc(Number(npcId), Number(taskId));
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
npcData.value = result.data.npc;
|
||||
talkMsg.value = result.data.talkMsg;
|
||||
btnTips.value = result.data.btnTips;
|
||||
taskState.value = result.data.taskState;
|
||||
toGoods.value = result.data.toGoods;
|
||||
retGoods.value = result.data.retGoods;
|
||||
verifyData.value = data.value.result;
|
||||
needs.value = verifyData.value.needs;
|
||||
taskId = data.value.itemId;
|
||||
}
|
||||
else {
|
||||
PageExtend.RedirectTo("/map/npc?npc=" + npcId)
|
||||
}
|
||||
};
|
||||
|
||||
const ReturnTask = async () => {
|
||||
MessageExtend.LoadingToast("提交任务中...");
|
||||
let result = await TaskService.OverTask(Number(npcId), Number(data.value.itemId));
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
if (result.msg != '') {
|
||||
MessageExtend.Notify(result.msg, "success");
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
}
|
||||
|
||||
const mapTo = async (btnData: any) => {
|
||||
MessageExtend.LoadingToast("传送中...");
|
||||
let result = await TaskService.NeedMapTo( Number(data.value.itemId), btnData.num);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
PageExtend.RedirectTo("/map");
|
||||
}
|
||||
else {
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
}
|
||||
|
||||
const retTask = async (btnData: any) => {
|
||||
MessageExtend.LoadingToast("传送中...");
|
||||
let result = await TaskService.ReturnTask( Number(data.value.itemId));
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
PageExtend.RedirectTo("/map");
|
||||
}
|
||||
else {
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -14,4 +14,12 @@ export class MapBusService {
|
||||
static async MapBusTo(id: number, num: number) {
|
||||
return await ApiService.Request("get", "/Map/MapBus/MapBusTo", { id, num });
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开宝箱
|
||||
* GET /Map/MapBus/MapBusBox
|
||||
*/
|
||||
static async MapBusBox(id: number) {
|
||||
return await ApiService.Request("get", "/Map/MapBus/MapBusBox", { id });
|
||||
}
|
||||
}
|
||||
33
Web/src/services/map/TaskService.ts
Normal file
33
Web/src/services/map/TaskService.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
export class TaskService {
|
||||
/**
|
||||
* 获取NPC任务
|
||||
* GET /Map/Task/GetTaskByNpc
|
||||
*/
|
||||
static async GetTaskByNpc(npcId: number, taskId: number) {
|
||||
return await ApiService.Request("get", "/Map/Task/GetTaskByNpc", { npcId, taskId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
* GET /Map/Task/OverTask
|
||||
*/
|
||||
static async OverTask(npcId: number, taskId: number) {
|
||||
return await ApiService.Request("get", "/Map/Task/OverTask", { npcId, taskId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 物品道具点传送
|
||||
* GET /Map/Task/NeedMapTo
|
||||
*/
|
||||
static async NeedMapTo(task: number, num: number) {
|
||||
return await ApiService.Request("get", "/Map/Task/NeedMapTo", { task, num });
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务提交传送
|
||||
* GET /Map/Task/ReturnTask
|
||||
*/
|
||||
static async ReturnTask(task: number) {
|
||||
return await ApiService.Request("get", "/Map/Task/ReturnTask", { task });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user