修复
This commit is contained in:
@@ -1,3 +1,115 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
<div class="content">
|
||||
【商城】<br>
|
||||
金元:{{ gold }}<br>
|
||||
金贝:{{ cowry }}<br>
|
||||
</div>
|
||||
<div class="content">
|
||||
〔
|
||||
<Acheak @click="Change('0')" :on-value="type" on-cheak="0">金贝</Acheak> |
|
||||
<Acheak @click="Change('1')" :on-value="type" on-cheak="1">金元</Acheak>
|
||||
〕
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="common">名称|价格</div>
|
||||
<div class="item" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<Abar :href='"/prop/equ?id=" + item.parameter' v-if="item.type == 'Equ'">
|
||||
{{ item.name }}({{ GameTool.GetCurrencyNameAll(item.price, item.payType) }})</Abar>
|
||||
<Abar :href='"/prop/goods?id=" + item.parameter' v-else>
|
||||
{{ item.name }}({{ GameTool.GetCurrencyNameAll(item.price, item.payType) }})</Abar>
|
||||
[<Abutton @click="ShopView(item)">购买</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Pagination :currentPage="currentPage" :limit="10" :total="total" @pageChange="handlePageChange" />
|
||||
</div>
|
||||
<!-- 购买 -->
|
||||
<GamePopup v-model:show="showBuy" title="【购买】">
|
||||
<!-- 自定义内容 -->
|
||||
<div class="common">
|
||||
物品名称:{{ showGoods.name }}<br>
|
||||
购买价格:{{ GameTool.GetCurrencyNameAll(showGoods.price, showGoods.payType) }}<br>
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
购买数量:<input type="number" class="search-ipt" v-model="count"><br>
|
||||
<button class="ipt-btn" name="serch" @click="ShopOk" style="margin-top: 15px;">确认</button>
|
||||
</div>
|
||||
</GamePopup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const type = ref('0');
|
||||
const gold = ref(0);
|
||||
const cowry = ref(0);
|
||||
const currentPage = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const data = ref<Array<any>>([]);
|
||||
const showBuy = ref(false);
|
||||
const showGoods = ref<any>({});
|
||||
const count = ref(1);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await MallService.GetMall(type.value, currentPage.value);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
total.value = result.data.total;
|
||||
gold.value = result.data.gold;
|
||||
cowry.value = result.data.cowry;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const Change = async (_type: string): Promise<void> => {
|
||||
currentPage.value = 1;
|
||||
type.value = _type;
|
||||
await BindData();
|
||||
}
|
||||
|
||||
/**翻页 */
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
};
|
||||
|
||||
//购买
|
||||
const ShopView = (info: any) => {
|
||||
showGoods.value = info;
|
||||
showBuy.value = true;
|
||||
count.value = 1;
|
||||
}
|
||||
|
||||
const ShopOk = async (): Promise<void> => {
|
||||
if (count.value < 1 || count.value > 99) {
|
||||
MessageExtend.ShowToast("每次购买数量在1~99哦.");
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("购买中...");
|
||||
let result = await MallService.Buy(showGoods.value.mallId, count.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
showBuy.value = false;
|
||||
MessageExtend.Notify(`成功购买${showGoods.value.name}×${count.value}`, "success");
|
||||
await BindData();
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
@@ -6,7 +6,7 @@
|
||||
{{ cityInfo.cityName }}·{{ mapInfo.mapName }}
|
||||
<Abutton @click="Refresh">刷新</Abutton>
|
||||
<Abar href="/task/">任务</Abar>
|
||||
<Abar href="/message/">消息</Abar>
|
||||
<Abar href="/message/">消息{{ messageCount > 0 ? "(" + messageCount + ")" : "" }}</Abar>
|
||||
</div>
|
||||
|
||||
<div class="notification">
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="item" v-for="item in npcData">
|
||||
<Abar :href='"/npc?npc="+item.npcId'>{{ item.npcName }}{{ item.tips }}</Abar>
|
||||
<Abar :href='"/npc?npc=" + item.npcId'>{{ item.npcName }}{{ item.tips }}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -91,8 +91,9 @@ const npcData = ref<Array<any>>([]);
|
||||
const chatData = ref<Array<any>>([]);
|
||||
const cityShow = ref<Array<any>>([]);
|
||||
const mapUser = ref<Array<any>>([]);
|
||||
const messageCount = ref(0);
|
||||
// 城内地图显示
|
||||
const showCity = ref(false)
|
||||
const showCity = ref(false);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
@@ -113,6 +114,7 @@ const BindData = async (map: string): Promise<void> => {
|
||||
chatData.value = result.data.chatData;
|
||||
cityShow.value = result.data.cityShow;
|
||||
mapUser.value = result.data.nearUser;
|
||||
messageCount.value = result.data.noReadMsg;
|
||||
MapVent(result.data.mapInfo.near);
|
||||
onMap.value = mapInfo.value.mapId;
|
||||
console.log(result.data);
|
||||
|
||||
@@ -1 +1,87 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="crumb-nav-large">
|
||||
❀游戏消息❀
|
||||
</div>
|
||||
<div class="module-title">
|
||||
<Acheak @click="Change('0')" :on-value="type" on-cheak="0">未读</Acheak>|
|
||||
<Acheak @click="Change('1')" :on-value="type" on-cheak="1">已读</Acheak>|
|
||||
<Acheak @click="Change('2')" :on-value="type" on-cheak="2">通知</Acheak>|
|
||||
<Acheak @click="Change('3')" :on-value="type" on-cheak="3">邮件</Acheak>
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<Abar :href='"/message/read?id=" + item.user.userNo'>
|
||||
{{ item.user.nick }}:{{ item.sign }}</Abar>
|
||||
[<Abutton @click="delTlak(item.user.userNo)">×</Abutton>]
|
||||
</div>
|
||||
<span v-if="data.length == 0">暂无消息.</span>
|
||||
</div>
|
||||
<Pagination :currentPage="currentPage" :limit="10" :total="total" @pageChange="handlePageChange" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const type = ref('0');
|
||||
const currentPage = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const data = ref<Array<any>>([]);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
let local_type = LocalStorageExtend.Get<string>("MsgType");
|
||||
if (local_type == null || local_type == '') {
|
||||
LocalStorageExtend.Set("MsgType", type.value);
|
||||
}
|
||||
else {
|
||||
type.value = local_type;
|
||||
}
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await MessageService.GetMessageData(Number(type.value), currentPage.value);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
total.value = result.data.total;
|
||||
console.log(result);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const Change = async (_type: string): Promise<void> => {
|
||||
currentPage.value = 1;
|
||||
type.value = _type;
|
||||
LocalStorageExtend.Set("MsgType", type.value);
|
||||
await BindData();
|
||||
}
|
||||
|
||||
/**翻页 */
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
};
|
||||
const delTlak = async (no: number): Promise<void> => {
|
||||
MessageExtend.LoadingToast("删除中...");
|
||||
let result = await MessageService.DeleteMsg(no);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.Notify("删除成功!", "success");
|
||||
await BindData();
|
||||
PageExtend.ScrollToTop();
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
60
Web/src/pages/message/log.vue
Normal file
60
Web/src/pages/message/log.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div class="module-title">
|
||||
消息记录
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="border-btm tab-5 spacing-3" v-for="item in data">
|
||||
<span v-if="item.sendId == '0'">海精灵:</span>
|
||||
<span v-else-if="myId == item.sendId">我:</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/user/user?no=" + user.userNo'>{{ user.nick }}</Abar>:
|
||||
</span>
|
||||
<span class="item">
|
||||
{{ item.sign }}
|
||||
</span>
|
||||
<small>[{{ TimeExtend.Format(item.addTime, "yyyy-MM-dd HH:mm:ss") }}]</small><br />
|
||||
</div>
|
||||
</div>
|
||||
<Pagination :currentPage="currentPage" :limit="10" :total="total" @pageChange="handlePageChange" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const currentPage = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const data = ref<Array<any>>([]);
|
||||
const user = ref<any>({});
|
||||
const myId = StateHelper.userId;
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let no = PageExtend.QueryString("no");
|
||||
let result = await MessageService.MessageLog(Number(no), currentPage.value);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
total.value = result.data.total;
|
||||
user.value = result.data.user;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
/**翻页 */
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
114
Web/src/pages/message/read.vue
Normal file
114
Web/src/pages/message/read.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<div class="crumb-nav-large">
|
||||
<Abar href="/message">我的消息</Abar>>发送消息
|
||||
</div>
|
||||
<div class="module-title" v-if="user.userNo != '0'">
|
||||
【<Abar :href='"/user/user?no=" + user.userNo'>{{ user.nick }}</Abar> ({{ user.userNo }})】
|
||||
</div>
|
||||
<div class="module-title" v-else>
|
||||
【系统消息】
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="tab-5 spacing-3" v-for="item in data">
|
||||
<span class="data_detail">
|
||||
{{ item.sign }}</span><br />
|
||||
<small>[{{ TimeExtend.Format(item.addTime, "yyyy-MM-dd HH:mm:ss") }}]</small><br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="module-content" v-if="user.userNo != '0'">
|
||||
<input name="u" type="hidden" value="931212" />
|
||||
<div class="module-content">
|
||||
<textarea name="content" id="content" class="ta-border emojiTxt" rows="2" maxlength="100"
|
||||
v-model="msg"></textarea>
|
||||
</div>
|
||||
<Abutton @click="Refresh" style="float: left;">刷新</Abutton>
|
||||
<button class="ipt-btn-gold-b" style="float:right" @click="SendMsg">发送</button>
|
||||
</div>
|
||||
<div class="module-title" style="margin-top:35px">消息记录</div>
|
||||
<div class="module-content">
|
||||
|
||||
<div class="border-btm tab-5 spacing-3" v-for="item in logs">
|
||||
<span v-if="item.sendId == '0'">海精灵:</span>
|
||||
<span v-else-if="myId == item.sendId">我:</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/user/user?no=" + user.userNo'>{{ user.nick }}</Abar>:
|
||||
</span>
|
||||
<span class="item">
|
||||
{{ item.sign }}
|
||||
</span>
|
||||
<small>[{{ TimeExtend.Format(item.addTime, "yyyy-MM-dd HH:mm:ss") }}]</small><br />
|
||||
</div>
|
||||
|
||||
<Abar :href='"/message/log?no="+user.userNo' v-if="logs.length > 0">查看记录>></Abar>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<Array<any>>([]);
|
||||
const user = ref<any>({});
|
||||
const logs = ref<Array<any>>([]);
|
||||
const msg = ref('');
|
||||
const myId = StateHelper.userId;
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let no = PageExtend.QueryString("id");
|
||||
let result = await MessageService.GetReadInfo(Number(no));
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
user.value = result.data.user;
|
||||
logs.value = result.data.logs;
|
||||
console.log(result);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialogEvent("提示", result.msg, () => {
|
||||
return PageExtend.Redirect("/message");
|
||||
}, "确认");
|
||||
}
|
||||
};
|
||||
|
||||
/**发送消息 */
|
||||
const SendMsg = async (): Promise<void> => {
|
||||
if (msg.value == null || msg.value == '') {
|
||||
MessageExtend.ShowToast("发送内容不能为空!");
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("发送中...");
|
||||
let no = PageExtend.QueryString("id");
|
||||
let result = await MessageService.SendMsg(Number(no), msg.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.Notify("发送成功!", "success");
|
||||
msg.value = '';
|
||||
await BindData();
|
||||
PageExtend.ScrollToTop();
|
||||
}
|
||||
else if (result.code == 100) {
|
||||
MessageExtend.ShowDialogEvent("提示", result.msg, () => {
|
||||
return PageExtend.Redirect("/message");
|
||||
}, "确认");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
}
|
||||
/**刷新 */
|
||||
const Refresh = async (): Promise<void> => {
|
||||
MessageExtend.LoadingToast("刷新中...");
|
||||
await BindData();
|
||||
MessageExtend.LoadingClose();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<Abar>私聊</Abar>. <Abar>送礼物</Abar>. <Abar>逗一下</Abar><br />
|
||||
<Abar :href='"/message/read?id=" + userData.userNo'>私聊</Abar>. <Abar>送礼物</Abar>. <Abar>逗一下</Abar><br />
|
||||
<Abar>拜师</Abar>. <Abar>山寨</Abar>. <Abar>送道具</Abar><br>
|
||||
<Abar>加好友</Abar>. <Abar>加仇人</Abar>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@ const BindData = async (): Promise<void> => {
|
||||
userData.value = result.data.user;
|
||||
attrData.value = result.data.attr;
|
||||
accData.value = result.data.acc;
|
||||
online.value = result.data.isOnline;
|
||||
online.value = result.data.isOnline;
|
||||
onMap.value = result.data.onMapName;
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user