12121
This commit is contained in:
@@ -1 +1,123 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="module-title">
|
||||
交易大厅.<Abar href="/trade/my">我的交易</Abar>
|
||||
</div>
|
||||
<div class="module-content">
|
||||
分类:
|
||||
<Acheak @click="Change('0')" :on-value="type" on-cheak="0">全部</Acheak>
|
||||
<span> . </span>
|
||||
<Acheak @click="Change('1')" :on-value="type" on-cheak="1">装备</Acheak>
|
||||
<span> . </span>
|
||||
<Acheak @click="Change('2')" :on-value="type" on-cheak="2">物品</Acheak>
|
||||
</div>
|
||||
<div class="module-content serch">
|
||||
搜索内容:<input type="text" class="search-ipt" v-model="serch">
|
||||
<button class="ipt-btn" name="serch" @click="BindData">搜索</button>
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<span v-if="item.code == 'Equ'">
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
</span>
|
||||
[<Abutton @click="Buy(item)">购买</Abutton>]
|
||||
</div>
|
||||
<span v-if="data.length == 0">
|
||||
暂无交易.
|
||||
</span>
|
||||
</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>
|
||||
购买单价:{{ showGoods.price }} 铜贝<br>
|
||||
<span v-if="showGoods.code != 'Equ'">
|
||||
剩余数量:{{ showGoods.count }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
<span v-if="showGoods.code != 'Equ'">
|
||||
购买数量:<input type="number" class="search-ipt" v-model="count"><br>
|
||||
</span>
|
||||
<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 currentPage = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const data = ref<Array<any>>([]);
|
||||
const showBuy = ref(false);
|
||||
const count = ref(1);
|
||||
const showGoods = ref<any>({});
|
||||
const type = ref('0');
|
||||
const serch = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await TradeService.GetTradeData("", Number(type.value), serch.value, currentPage.value);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
total.value = result.data.total;
|
||||
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const Change = async (_type: string) => {
|
||||
type.value = _type;
|
||||
await BindData();
|
||||
}
|
||||
|
||||
/**翻页 */
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
};
|
||||
|
||||
|
||||
const Buy = (info: any) => {
|
||||
showGoods.value = info;
|
||||
count.value = 1;
|
||||
showBuy.value = true;
|
||||
}
|
||||
const ShopOk = async () => {
|
||||
if (count.value < 1 || count.value > 99) {
|
||||
MessageExtend.ShowToast("每次购买数量在1~99哦.");
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("购买中...");
|
||||
let result = await TradeService.Buy(showGoods.value.tradeId, count.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
showBuy.value = false;
|
||||
await BindData();
|
||||
MessageExtend.Notify(`成功购买${showGoods.value.name}×${count.value}`, "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
122
Web/src/pages/trade/info.vue
Normal file
122
Web/src/pages/trade/info.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<div class="common" v-if="equInfo.img != ''">
|
||||
<Aimage :url="equInfo.img" _alt="."></Aimage>
|
||||
</div>
|
||||
|
||||
<div class="common">
|
||||
名称:<span v-html="EquTool.ConvertEquName(equData, 0)"></span> <br>
|
||||
<span v-if="equData.equName != equData.unitEquName">
|
||||
装备名称:{{ equData.unitEquName }}<br>
|
||||
</span>
|
||||
部位:{{ EquTool.GetEquPlaceName(equData.code) }}<br>
|
||||
等级:{{ equData.lev }}<br>
|
||||
品质:{{ equData.qualityName }}<br>
|
||||
交易:{{ equData.isDeal == 1 ? "可交易" : "不可交易" }}<br>
|
||||
赠送:{{ equData.isGive == 1 ? "可赠送" : "不可赠送" }}<br>
|
||||
获取途径:{{ equInfo.source }}<br>
|
||||
说明:{{ equInfo.remark }}<br>
|
||||
签名:{{ equData.sign }}<br>
|
||||
获得人:<GameUser :data="owUser" :show-icon="0" :show-area="0"></GameUser><br>
|
||||
<span v-if="equData.sex != 'Default'">
|
||||
性别:{{ equData.sex == 'Boy' ? "男" : "女" }}<br>
|
||||
</span>
|
||||
强化:{{ equData.isIntensify == 1 ? "可强化" : "不可强化" }}<br>
|
||||
<span v-if="equData.intensifyLev > 0">
|
||||
强化等级:{{ equData.intensifyLev }}<br>
|
||||
</span>
|
||||
<span v-if="equAwaken.length > 0">
|
||||
<Abar :href='"/user/equ/awaken?ue=" + equData.ueId'>装备特性:{{ equAwaken[0].name }}({{ equAwaken[0].lev
|
||||
}}级)
|
||||
</Abar><br>
|
||||
</span>
|
||||
附魔:{{ equMent.name }}<br>
|
||||
负重:{{ equData.weight }}<br>
|
||||
<div v-if="equData.isAppr == 1" style="margin:0px;">
|
||||
<span v-if="Number(equData.blood) > 0">
|
||||
体力:{{ equData.blood }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.minAtk) > 0">
|
||||
攻击:{{ equData.minAtk }}-{{ equData.maxAtk }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.defense) > 0">
|
||||
防御:{{ equData.defense }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.agility) > 0">
|
||||
敏捷:{{ equData.agility }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.morale) > 0">
|
||||
士气:{{ equData.morale }}<br>
|
||||
</span>
|
||||
</div>
|
||||
耐久:{{ equData.maxdurability }}/{{ equData.durability }}<br>
|
||||
<span v-if="equData.suitCode != '0' && equData.suitCode != ''">
|
||||
套装:<Abar :href='"/prop/suit?no=" + equData.suitCode'>{{ suitInfo.suitName }}</Abar><br>
|
||||
</span>
|
||||
特性:{{ EquTool.GetEquAttrName(equData.equAttr, 0) }}<br>
|
||||
<span v-if="equData.holeCount > 0">
|
||||
镶嵌:({{ gemMent.length }}/{{ equData.holeCount }})<br>
|
||||
</span>
|
||||
<span v-if="equData.opTime == 0">
|
||||
<span v-if="equInfo.useTime > 0">
|
||||
有效期:{{ equInfo.useTime }}天
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span v-if="equInfo.useTime > 0">
|
||||
到期时间:{{ TimeExtend.Format(equData.useEndTime, "yyyy-MM-dd") }}
|
||||
</span>
|
||||
</span>
|
||||
<div v-if="equData.isAppr == 0">
|
||||
(*该装备需要鉴定)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const equData = ref<any>({});
|
||||
const equInfo = ref<any>({});
|
||||
const suitInfo = ref<any>({});
|
||||
const owUser = ref<any>({});
|
||||
const equAwaken = ref<Array<any>>([]);
|
||||
const equMent = ref<any>({});
|
||||
const gemMent = ref<Array<any>>([]);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let tradeId = PageExtend.QueryString("id");
|
||||
let result = await TradeService.GetTradeInfo(tradeId);
|
||||
if (result.code == 0) {
|
||||
equData.value = result.data.equData;
|
||||
equInfo.value = result.data.equ;
|
||||
suitInfo.value = result.data.suit;
|
||||
owUser.value = result.data.user;
|
||||
equAwaken.value = result.data.equData.equAwaken;
|
||||
equMent.value = result.data.equData.equMent;
|
||||
gemMent.value = result.data.equData.gemMent;
|
||||
}
|
||||
else if (result.code == 100) {
|
||||
PageExtend.RedirectTo("/prop/goods?id=" + result.msg);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1 +1,79 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="module-title">
|
||||
我的交易
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ index + 1 }}.[{{ GetRankName(item.code) }}]
|
||||
<span v-if="item.code == 'Equ'">
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
</span>
|
||||
(<Abutton @click="Down(item.tradeId)">下架</Abutton>)<br>
|
||||
<span v-if="item.code != 'Equ'">
|
||||
数量:{{ item.count }}
|
||||
</span>
|
||||
</div>
|
||||
<span v-if="data.length == 0">
|
||||
暂无交易.
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
|
||||
const data = ref<Array<any>>([]);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await TradeService.GetMyTrade();
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const GetRankName = (type: string) => {
|
||||
let result = '其他';
|
||||
switch (type) {
|
||||
case "Equ":
|
||||
result = "装备"; break;
|
||||
case "Goods":
|
||||
result = "物品"; break;
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const Down = async (tradeId: string) => {
|
||||
MessageExtend.ShowConfirmDialogAsyc("下架操作", `您确定要下架吗?`, async () => {
|
||||
let result = await TradeService.DownTrade(tradeId);
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
MessageExtend.Notify("下架成功!", "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1 +1,117 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="module-title">
|
||||
交易信息
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="item border-btm" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.[{{ GetRankName(item.code) }}]
|
||||
<span v-if="item.code == 'Equ'">
|
||||
<Abar :href='"/trade/info?id=" + item.tradeId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.propId'>{{ item.name }}({{ item.price }}铜贝)</Abar>
|
||||
</span>
|
||||
[<Abutton @click="Buy(item)">购买</Abutton>]
|
||||
</div>
|
||||
<span v-if="data.length == 0">
|
||||
暂无交易.
|
||||
</span>
|
||||
</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>
|
||||
购买单价:{{ showGoods.price }} 铜贝<br>
|
||||
<span v-if="showGoods.code != 'Equ'">
|
||||
剩余数量:{{ showGoods.count }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
<span v-if="showGoods.code != 'Equ'">
|
||||
购买数量:<input type="number" class="search-ipt" v-model="count"><br>
|
||||
</span>
|
||||
<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 currentPage = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const data = ref<Array<any>>([]);
|
||||
const showBuy = ref(false);
|
||||
const count = ref(1);
|
||||
const showGoods = ref<any>({});
|
||||
|
||||
|
||||
let no = PageExtend.QueryString("no");
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await TradeService.GetTradeData(no, 0, "", currentPage.value);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
total.value = result.data.total;
|
||||
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
/**翻页 */
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
};
|
||||
|
||||
const GetRankName = (type: string) => {
|
||||
let result = '其他';
|
||||
switch (type) {
|
||||
case "Equ":
|
||||
result = "装备"; break;
|
||||
case "Goods":
|
||||
result = "物品"; break;
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
const Buy = (info: any) => {
|
||||
showGoods.value = info;
|
||||
count.value = 1;
|
||||
showBuy.value = true;
|
||||
}
|
||||
const ShopOk = async () => {
|
||||
if (count.value < 1 || count.value > 99) {
|
||||
MessageExtend.ShowToast("每次购买数量在1~99哦.");
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("购买中...");
|
||||
let result = await TradeService.Buy(showGoods.value.tradeId, count.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
showBuy.value = false;
|
||||
await BindData();
|
||||
MessageExtend.Notify(`成功购买${showGoods.value.name}×${count.value}`, "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user