修复
This commit is contained in:
@@ -58,7 +58,7 @@ export default defineNuxtConfig({
|
||||
},
|
||||
},
|
||||
|
||||
css: ['~/assets/css/style.css'],
|
||||
css: ['~/assets/css/style.css','~/assets/css/home.css'],
|
||||
|
||||
compatibilityDate: '2024-04-03',
|
||||
})
|
||||
|
||||
BIN
Web/public/css/images/home/bar.gif
Normal file
BIN
Web/public/css/images/home/bar.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 473 B |
BIN
Web/public/css/images/home/btn_b_gold.gif
Normal file
BIN
Web/public/css/images/home/btn_b_gold.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 346 B |
BIN
Web/public/css/images/home/btn_l_gray.gif
Normal file
BIN
Web/public/css/images/home/btn_l_gray.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 380 B |
BIN
Web/public/css/images/home/btn_m_gray.gif
Normal file
BIN
Web/public/css/images/home/btn_m_gray.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 344 B |
BIN
Web/public/css/images/home/btn_s_gray.gif
Normal file
BIN
Web/public/css/images/home/btn_s_gray.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 307 B |
BIN
Web/public/css/images/home/unit/bao.jpg
Normal file
BIN
Web/public/css/images/home/unit/bao.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
508
Web/src/assets/css/home.css
Normal file
508
Web/src/assets/css/home.css
Normal file
@@ -0,0 +1,508 @@
|
||||
.tw_icon {
|
||||
max-width: 20px;
|
||||
max-height: 20px;
|
||||
}
|
||||
|
||||
.replies_em {
|
||||
max-height: 30px;
|
||||
max-width: 30px;
|
||||
}
|
||||
|
||||
.roleitem {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
video {
|
||||
max-height: 211px;
|
||||
height: 211px;
|
||||
background-color: black;
|
||||
width: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
audio {
|
||||
max-width: 680px;
|
||||
max-height: 350px;
|
||||
}
|
||||
|
||||
.icon_s {
|
||||
max-width: 30px;
|
||||
max-height: 30px;
|
||||
}
|
||||
|
||||
.clear {
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
.site-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.deep {
|
||||
background: #E3EEF8;
|
||||
border: 1px solid #9FC6EC;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.nick {
|
||||
color: #0051a4;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.ta-border {
|
||||
font-size: 13px;
|
||||
width: 98%;
|
||||
height: 30px;
|
||||
margin: 0 0 5px 0;
|
||||
border: 1px solid #9FC6EC;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
.user-info a {
|
||||
font-size: 13px;
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
.user-info img {
|
||||
margin-right: 1px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.user-title img {
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
font-size: 13px;
|
||||
width: 98%;
|
||||
margin: 0 0 5px 0;
|
||||
border: 1px solid #9FC6EC;
|
||||
}
|
||||
|
||||
#footer {
|
||||
padding: 5px;
|
||||
background: #E3EEF8;
|
||||
border-top: 1px solid #9FC6EC;
|
||||
}
|
||||
|
||||
#footer a {
|
||||
font-size: 17px;
|
||||
color: #0051A4;
|
||||
}
|
||||
|
||||
.ipt-txt {
|
||||
height: 18px;
|
||||
margin: 0 3px 0 0;
|
||||
border: 1px solid #b1d5e5;
|
||||
}
|
||||
|
||||
.ipt-s {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.seperate {
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.ipt-btn-gray-s {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
border: none;
|
||||
background: url(/css/images/home/btn_s_gray.gif) no-repeat;
|
||||
}
|
||||
|
||||
.ipt-btn-gray-m {
|
||||
width: 60px;
|
||||
height: 20px;
|
||||
border: none;
|
||||
background: url(/css/images/home/btn_m_gray.gif) no-repeat;
|
||||
}
|
||||
|
||||
.ipt-btn-gray-l {
|
||||
width: 80px;
|
||||
height: 20px;
|
||||
border: none;
|
||||
background: url(/css/images/home/btn_l_gray.gif) no-repeat;
|
||||
}
|
||||
|
||||
.ipt-btn-gold-b {
|
||||
width: 61px;
|
||||
height: 21px;
|
||||
font-size: 13px;
|
||||
border: none;
|
||||
background: url(/css/images/home/btn_b_gold.gif) no-repeat;
|
||||
color: #af4c00;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
padding: 1px 0 0 12px;
|
||||
background-color: #4c95e7;
|
||||
}
|
||||
|
||||
.main-nav p {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.main-nav p a {
|
||||
margin: 0 7px 0 0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.forum-title {
|
||||
margin: 8px 0 2px;
|
||||
padding: 0 5px;
|
||||
height: 20px,auto;
|
||||
line-height: 20px;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.module-title {
|
||||
margin: 9px 0 0px;
|
||||
padding: 0 5px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
border-bottom: 4px solid #9FC6EC;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.module-title a {
|
||||
color: #0051A4;
|
||||
}
|
||||
|
||||
.module-title span {
|
||||
font-weight: normal;
|
||||
/* font-size: 13px;
|
||||
margin: 0 0 0 10px;*/
|
||||
}
|
||||
|
||||
.module-title span a {
|
||||
color: #0051A4;
|
||||
}
|
||||
|
||||
.module-content {
|
||||
line-height: 1.6;
|
||||
padding: 3px 5px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.module-content a {
|
||||
color: #0051A4;
|
||||
}
|
||||
|
||||
.module-content img {
|
||||
margin-right: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 5px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.module-page {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.crumb-nav {
|
||||
height: 22px;
|
||||
padding: 0 3px;
|
||||
background: #71afe3 url(/css/images/home/bar.gif) repeat-x;
|
||||
line-height: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.crumb-nav a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.crumb-nav .current {
|
||||
color: #98d2ff;
|
||||
}
|
||||
|
||||
.bottom-crumb-nav {
|
||||
padding: 0 5px;
|
||||
border-top: 1px solid #eee;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.bottom-crumb-nav-sim {
|
||||
padding: 0 5px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.bottom-module {
|
||||
padding: 5px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.crumb-nav-large {
|
||||
height: 25px;
|
||||
padding: 0 5px;
|
||||
background: #71afe3 url(/css/images/home/bar.gif) repeat-x;
|
||||
line-height: 25px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.crumb-nav-large a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.crumb-nav-large .current {
|
||||
color: #98d2ff;
|
||||
}
|
||||
|
||||
.txt-fade {
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.txt-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.txt-slim {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.txt-emphasis {
|
||||
color: #B1761A;
|
||||
}
|
||||
|
||||
.spacing-3 {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.spacing-5 {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.tab-5 {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.border-btm {
|
||||
border-bottom: 1px solid #E3E6EB;
|
||||
}
|
||||
|
||||
.tips {
|
||||
background: #FFF2BD;
|
||||
border-top: 1px solid #ffd56a;
|
||||
border-bottom: 1px solid #ffd56a;
|
||||
line-height: 1.5;
|
||||
padding: 3px 5px;
|
||||
color: #738698;
|
||||
}
|
||||
|
||||
.tips p {
|
||||
padding: 0 0 0 14px;
|
||||
background: url(/css/images/home/bg_module_content_list_dot_01.gif) 4px 9px no-repeat;
|
||||
}
|
||||
|
||||
.tips img {
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.login-tips {
|
||||
background: #FFF9B7;
|
||||
padding: 3px 5px;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.login-tips img {
|
||||
margin-right: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.login-tips span {
|
||||
margin-left: 14px;
|
||||
}
|
||||
|
||||
.annc-border {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.user-title {
|
||||
margin-top: 5px;
|
||||
padding: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.user-stat {
|
||||
padding: 5px;
|
||||
background: #e4eff9;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.write-mood {
|
||||
padding: 5px;
|
||||
background: #e4eff9;
|
||||
line-height: 1.5;
|
||||
border-top: 1px solid #9FC6EC;
|
||||
border-bottom: 1px solid #9FC6EC;
|
||||
}
|
||||
|
||||
.tool-box {
|
||||
background-color: #f0f0f0;
|
||||
border-top: 1px solid #dedede;
|
||||
border-bottom: 1px solid #dedede;
|
||||
line-height: 1.3;
|
||||
padding: 3px 5px;
|
||||
color: #FFAA22;
|
||||
}
|
||||
|
||||
.ipt-nick {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.ipt-y {
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ipt-m, .ipt-d {
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ipt-intro {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.msg_tail {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.note {
|
||||
background: #FFF9B7;
|
||||
border-bottom: 1px solid #9FC6EC;
|
||||
border-top: 1px solid #ffd56a;
|
||||
line-height: 1.5;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
.note p {
|
||||
padding: 0 0 0 14px;
|
||||
background: url(/css/images/home/bg_module_content_list_dot_01.gif) 4px 9px no-repeat;
|
||||
}
|
||||
|
||||
.note img {
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.imgBar60 {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.imgBarMaxHeight {
|
||||
max-width: 100%;
|
||||
max-height: 80px;
|
||||
}
|
||||
|
||||
.guess-tag {
|
||||
background: coral;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
padding: 4px;
|
||||
height: initial;
|
||||
vertical-align: 1px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
.guess-m {
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
padding: 4px;
|
||||
height: initial;
|
||||
vertical-align: 1px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
.guess-v {
|
||||
background-color: dodgerblue;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
padding: 4px;
|
||||
height: initial;
|
||||
vertical-align: 1px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
.conter {
|
||||
width: 100%;
|
||||
height: 350px;
|
||||
border: 1px solid #000;
|
||||
margin: 0px auto;
|
||||
padding: 0px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.conter h1 {
|
||||
height: 20px;
|
||||
font-size: 12px;
|
||||
background: #CC6600;
|
||||
line-height: 20px;
|
||||
text-indent: 5px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.conter iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.redBox {
|
||||
background: url('/css/images/home/unit/bao.jpg') no-repeat;
|
||||
width: 180px;
|
||||
height: 65px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.redBox_title {
|
||||
position: relative;
|
||||
top: 3px;
|
||||
left: 40px;
|
||||
font-size: 12px;
|
||||
color: white
|
||||
}
|
||||
|
||||
.redBox_tips {
|
||||
position: relative;
|
||||
top: -3px;
|
||||
left: 40px;
|
||||
font-size: 12px;
|
||||
color: white
|
||||
}
|
||||
@@ -97,7 +97,9 @@ a:focus {
|
||||
margin-right: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.border-btm {
|
||||
border-bottom: 1px solid #E3E6EB;
|
||||
}
|
||||
.input {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ export class LocalStorageHelper {
|
||||
}
|
||||
public static SetOnNpc(npcId: String) {
|
||||
LocalStorageExtend.Set(this.key, npcId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<slot />
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="content ">
|
||||
<button class="btn btn-ret" @click="GoBack">返回</button><br />
|
||||
<Abar href="/map">返回游戏</Abar>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
19
Web/src/services/Index/MallService.ts
Normal file
19
Web/src/services/Index/MallService.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export class MallService {
|
||||
/**
|
||||
* 获取商城列表
|
||||
* GET /Mall/GetMall
|
||||
*/
|
||||
static async GetMall(type: string, page: number) {
|
||||
return await ApiService.Request("get", "/Mall/GetMall", { type, page });
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买物品
|
||||
* POST /Mall/Buy
|
||||
* @param id body
|
||||
* @param count body
|
||||
*/
|
||||
static async Buy(id: string, count: number) {
|
||||
return await ApiService.Request("post", "/Mall/Buy", { id, count });
|
||||
}
|
||||
}
|
||||
43
Web/src/services/Index/MessageService.ts
Normal file
43
Web/src/services/Index/MessageService.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export class MessageService {
|
||||
/**
|
||||
* 获取消息
|
||||
* GET /Message/GetMessageData
|
||||
*/
|
||||
static async GetMessageData(type: number, page: number) {
|
||||
return await ApiService.Request("get", "/Message/GetMessageData", { type, page });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息界面
|
||||
* GET /Message/GetReadInfo
|
||||
*/
|
||||
static async GetReadInfo(no: number) {
|
||||
return await ApiService.Request("get", "/Message/GetReadInfo", { no });
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* POST /Message/SendMsg
|
||||
* @param no body
|
||||
* @param sign body
|
||||
*/
|
||||
static async SendMsg(no: number, sign: string) {
|
||||
return await ApiService.Request("post", "/Message/SendMsg", { no, sign });
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天记录
|
||||
* GET /Message/MessageLog
|
||||
*/
|
||||
static async MessageLog(no: number, page: number) {
|
||||
return await ApiService.Request("get", "/Message/MessageLog", { no, page });
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对话
|
||||
* GET /Message/DeleteMsg
|
||||
*/
|
||||
static async DeleteMsg(no: number) {
|
||||
return await ApiService.Request("get", "/Message/DeleteMsg", { no });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user