121212
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
</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>
|
||||
@@ -134,7 +134,7 @@
|
||||
◈<Abutton @click="LockEqu">{{ equData.isLock == 0 ? "绑定" : "解绑" }}</Abutton><br>
|
||||
</span>
|
||||
<span v-if="equData.isOn == 0 && equData.isDeal == 1">
|
||||
◈<Abar href="/">寄售</Abar><br>
|
||||
◈<Abutton @click="saleState = true">寄售</Abutton><br>
|
||||
</span>
|
||||
<!-- <span>
|
||||
◈<Abutton>个性化</Abutton><br>
|
||||
@@ -169,9 +169,20 @@
|
||||
</div>
|
||||
</GamePopup>
|
||||
|
||||
<!-- 寄售 -->
|
||||
<GamePopup v-model:show="saleState" title="【寄售装备】" style="width: 60%;">
|
||||
<div class="common" style="margin-top: 10px;">
|
||||
装备名称:<span v-html="EquTool.ConvertEquName(equData, 0)"></span><br>
|
||||
<span style="font-size: 16px;">寄售价格:</span><input type="number" class="search-ipt" v-model="salePrice" />铜贝
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
<button class="ipt-btn" name="serch" @click="SaleOk" style="margin-top: 15px;">寄售</button>
|
||||
</div>
|
||||
</GamePopup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
@@ -292,4 +303,20 @@ const ApprEqu = async () => {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
const saleState = ref(false);
|
||||
const salePrice = ref(1);
|
||||
const SaleOk = async () => {
|
||||
MessageExtend.LoadingToast("寄售中...");
|
||||
let result = await TradeService.Trade(0, ueId, salePrice.value, 1);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.ShowDialogEvent("寄售装备", "寄售成功!", () => {
|
||||
PageExtend.RedirectTo("/user/bag");
|
||||
});
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("寄售装备", result.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="common" v-if="data.img != ''">
|
||||
<Aimage :url="data.img" _alt="."></Aimage>
|
||||
</div>
|
||||
名称:{{ data.goodsName }} <Abar href="/" v-if="count > 0">寄售</Abar><br>
|
||||
名称:{{ data.goodsName }}<br>
|
||||
<div class="common" v-if="data.code == 'Card'">
|
||||
等级:{{ data.lev }}星
|
||||
</div>
|
||||
@@ -29,6 +29,9 @@
|
||||
<div class="common" v-if="useState == 3">
|
||||
<Abutton @click="btnChoice">使用物品</Abutton>
|
||||
</div>
|
||||
<div class="common" v-if="data.isDeal == 1">
|
||||
<Abutton @click="saleState=true">寄售</Abutton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -78,6 +81,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</GamePopup>
|
||||
<!-- 寄售 -->
|
||||
<GamePopup v-model:show="saleState" title="【寄售物品】" style="width: 60%;">
|
||||
<div class="common" style="margin-top: 10px;">
|
||||
物品名称:{{ data.goodsName }}<br>
|
||||
物品数量:{{ count }}<br>
|
||||
<span style="font-size: 16px;">寄售价格:</span><input type="number" class="search-ipt" v-model="salePrice" />铜贝<br>
|
||||
<span style="font-size: 16px;">寄售数量:</span><input type="number" class="search-ipt" v-model="saleCount" />
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
<button class="ipt-btn" name="serch" @click="SaleOk" style="margin-top: 15px;">寄售</button>
|
||||
</div>
|
||||
</GamePopup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -106,7 +121,7 @@ const BindData = async (): Promise<void> => {
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.goods;
|
||||
count.value = result.data.count;
|
||||
useState.value = result.data.use;
|
||||
useState.value = result.data.use;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
@@ -174,7 +189,7 @@ const btnChoiceOk = async (id: number) => {
|
||||
let result = await GoodsService.UseChoiceGoods(Number(goodsId), id);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
showChoiceView.value = false;
|
||||
showChoiceView.value = false;
|
||||
await BindData();
|
||||
MessageExtend.Notify(result.msg, "success", 5000);
|
||||
}
|
||||
@@ -183,4 +198,21 @@ const btnChoiceOk = async (id: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const saleState = ref(false);
|
||||
const salePrice = ref(1);
|
||||
const saleCount = ref(1);
|
||||
const SaleOk = async () => {
|
||||
MessageExtend.LoadingToast("寄售中...");
|
||||
let result = await TradeService.Trade(1, goodsId, salePrice.value, saleCount.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
saleState.value =false;
|
||||
await BindData();
|
||||
MessageExtend.Notify("寄售成功!","success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("寄售装备", result.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1 +1,157 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="module-title">
|
||||
赠送道具
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="common">
|
||||
赠送给:<Abar :href='"/user/user?no=" + userNo'>{{ nick }}</Abar>(ID:{{ userNo }})
|
||||
</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>.
|
||||
<Acheak @click="Change('2')" :on-value="type" on-cheak="2">物品</Acheak>
|
||||
</div>
|
||||
<div class="common serch">
|
||||
搜索内容:<input type="text" class="search-ipt" v-model="serch">
|
||||
<button class="ipt-btn" name="serch" @click="refData">搜索</button>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="common" v-if="type == '0'">
|
||||
<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>
|
||||
[<Abutton @click="SaleView(item)">赠送</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="common" v-if="type == '1'">
|
||||
<div class="item" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<Abar :href='"/prop/goods?id=" + item.goodsId'>{{ item.goodsName }}({{ item.count }})</Abar>
|
||||
[<Abutton @click="SaleView(item)">赠送</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<div class="common" v-if="type == '2'">
|
||||
<div class="item" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<span v-if="item.code == 'Card'">
|
||||
<Abar :href='"/prop/goods?id=" + item.goodsId'>{{ item.goodsName }}({{ item.count }})</Abar>
|
||||
</span>
|
||||
<span v-else>
|
||||
<Abar :href='"/prop/goods?id=" + item.goodsId'>{{ item.goodsName }}({{ item.count }})</Abar>
|
||||
</span>
|
||||
[<Abutton @click="SaleView(item)">赠送</Abutton>]
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="data.length == 0">暂无.</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Pagination :currentPage="currentPage" :limit="10" :total="total" @pageChange="handlePageChange" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 购买 -->
|
||||
<GamePopup v-model:show="showSale" title="【赠送物品】">
|
||||
<!-- 自定义内容 -->
|
||||
<div class="common" v-if="type == '0'">
|
||||
装备名称:{{ showGoods.equName }}<br>
|
||||
装备等级:{{ showGoods.lev }}级
|
||||
</div>
|
||||
<div class="common" v-else>
|
||||
物品名称:{{ showGoods.goodsName }}<br>
|
||||
背包数量:{{ showGoods.count }}<br>
|
||||
赠送数量:<input type="number" class="search-ipt" v-model="count"><br>
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
<button class="ipt-btn" name="serch" @click="SaleOk" 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 serch = ref('');
|
||||
const type = ref('0');
|
||||
const userNo = ref('');
|
||||
const nick = ref('');
|
||||
let no = PageExtend.QueryString("no");
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await GiveService.GetGoodsData(no, Number(type.value), serch.value, currentPage.value);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.data;
|
||||
total.value = result.data.total;
|
||||
userNo.value = result.data.userNo;
|
||||
nick.value = result.data.nick;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const refData = async () => {
|
||||
currentPage.value = 1;
|
||||
await BindData();
|
||||
}
|
||||
|
||||
/**翻页 */
|
||||
const handlePageChange = async (page: number): Promise<void> => {
|
||||
currentPage.value = page;
|
||||
await BindData();
|
||||
};
|
||||
|
||||
const Change = async (_type: string): Promise<void> => {
|
||||
type.value = _type;
|
||||
await BindData();
|
||||
};
|
||||
|
||||
//赠送
|
||||
const showSale = ref(false);
|
||||
const showGoods = ref<any>({});
|
||||
const count = ref(1);
|
||||
const SaleView = (info: any) => {
|
||||
showGoods.value = info;
|
||||
showSale.value = true;
|
||||
count.value = 1;
|
||||
}
|
||||
|
||||
const SaleOk = async (): Promise<void> => {
|
||||
if (type.value != '0' && (count.value < 1 || count.value > showGoods.value.count)) {
|
||||
MessageExtend.ShowToast("赠送数量不正确.");
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("赠送中...");
|
||||
let propId = '';
|
||||
if (type.value == '0') {
|
||||
propId = showGoods.value.ueId;
|
||||
}
|
||||
else {
|
||||
propId = showGoods.value.goodsId;
|
||||
}
|
||||
let result = await GiveService.GiveGoods(no, Number(type.value), propId, count.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
showSale.value = false;
|
||||
MessageExtend.Notify("赠送成功!", "success");
|
||||
await BindData();
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
@@ -5,9 +5,7 @@
|
||||
金贝:{{ bagInfo.cowry }} <br />
|
||||
负重:{{ bagInfo.onWeight }}/{{ bagInfo.maxWeight }} <span v-if="bagInfo.onWeight > bagInfo.maxWeight"
|
||||
style="color: red;font-weight: bold;">!</span><br />
|
||||
{{ GameTool.FormatCopper(bagInfo.copper) }}<br />
|
||||
<Abar href="/">交易记录</Abar><br>
|
||||
<Abar href="/">赠送记录</Abar>
|
||||
{{ GameTool.FormatCopper(bagInfo.copper) }}<br />
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="common" style="">
|
||||
|
||||
@@ -1 +1,82 @@
|
||||
<template></template>
|
||||
<template>
|
||||
|
||||
<div class="module-title">
|
||||
逗一下
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="common">
|
||||
逗Ta:<Abar :href='"/user/user?no=" + data.userNo'>{{ data.nick }}</Abar>(ID:{{ data.userNo }})
|
||||
</div>
|
||||
<div class="item" v-for="(item, index) in goods" :key="index">
|
||||
{{ index + 1 }}.<Abar :href='"/prop/goods?id=" + item.goodsId'>{{ item.goodsName }}</Abar>({{ item.count }})
|
||||
[<Abutton @click="showView(item)">使用</Abutton>]
|
||||
</div>
|
||||
<span v-if="goods.length == 0">暂无礼物.</span>
|
||||
</div>
|
||||
<GamePopup v-model:show="showInfo" title="【赠送礼物】" style="width: 50%;">
|
||||
<div class="common" style="margin-top: 10px;">
|
||||
道具名称:{{ onShow.goodsName }}<br>
|
||||
道具数量:{{ onShow.count }}<br>
|
||||
<span style="font-size: 16px;">使用数量:</span><input type="number" class="search-ipt" v-model="giveCount">
|
||||
</div>
|
||||
<div class="common" style="text-align: center;">
|
||||
<button class="ipt-btn" name="serch" @click="GiveOk" style="margin-top: 15px;">使用</button>
|
||||
</div>
|
||||
</GamePopup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: middleware.loading
|
||||
})
|
||||
|
||||
const data = ref<any>({});
|
||||
const goods = ref<Array<any>>([]);
|
||||
const showInfo = ref(false);
|
||||
const onShow = ref<any>({});
|
||||
const giveCount = ref(1);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async () => {
|
||||
let no = PageExtend.QueryString("no");
|
||||
let result = await GiveService.GetUserDouGoods(no);
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
goods.value = result.data.data;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("赠送礼物", result.msg);
|
||||
}
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
const showView = (data: any) => {
|
||||
showInfo.value = true;
|
||||
giveCount.value = 1;
|
||||
onShow.value = data;
|
||||
}
|
||||
|
||||
const GiveOk = async () => {
|
||||
let no = PageExtend.QueryString("no");
|
||||
MessageExtend.LoadingToast("使用中...");
|
||||
let result = await GiveService.UseDou(no, onShow.value.goodsId, giveCount.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
showInfo.value = false;
|
||||
await BindData();
|
||||
MessageExtend.Notify("使用成功!", "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<Abar :href='"/user/message/read?id=" + userData.userNo'>私聊</Abar>. <Abar
|
||||
:href='"/user/gift/give?no=" + userData.userNo'>送礼物</Abar>. <Abar href="/user/interact/dou">逗一下</Abar><br />
|
||||
:href='"/user/gift/give?no=" + userData.userNo'>送礼物</Abar>. <Abar :href='"/user/interact/dou?no="+userData.userNo'>逗一下</Abar><br />
|
||||
<Abar href="/user/master/add">拜师</Abar>. <Abar :href='"/trade/user?no=" + userData.userNo'>交易</Abar>. <Abar
|
||||
href="/user/bag/give">送道具</Abar><br>
|
||||
:href='"/user/bag/give?no="+userData.userNo'>送道具</Abar><br>
|
||||
<Abutton @click="FriendHandle">{{ isFriend ? "删除好友" : "加好友" }}</Abutton>
|
||||
<span v-if="isEnemy == false">
|
||||
.<Abutton @click="AddEnemy">加仇人</Abutton>
|
||||
|
||||
9
Web/src/services/Index/TradeService.ts
Normal file
9
Web/src/services/Index/TradeService.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class TradeService {
|
||||
/**
|
||||
* 寄售物品
|
||||
* GET /Trade/Trade
|
||||
*/
|
||||
static async Trade(type: number, prop: string, price: number, count: number) {
|
||||
return await ApiService.Request("get", "/Trade/Trade", { type, prop, price, count });
|
||||
}
|
||||
}
|
||||
@@ -22,4 +22,36 @@ export class GiveService {
|
||||
static async GetGiftLog(no: string, page: number) {
|
||||
return await ApiService.Request("get", "/User/Give/GetGiftLog", { no, page });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取赠送物品列表
|
||||
* GET /User/Give/GetGoodsData
|
||||
*/
|
||||
static async GetGoodsData(no: string, type: number, query: string, page: number) {
|
||||
return await ApiService.Request("get", "/User/Give/GetGoodsData", { no, type, query, page });
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送物品
|
||||
* GET /User/Give/GiveGoods
|
||||
*/
|
||||
static async GiveGoods(no: string, type: number, propId: string, count: number) {
|
||||
return await ApiService.Request("get", "/User/Give/GiveGoods", { no, type, propId, count });
|
||||
}
|
||||
|
||||
/**
|
||||
* 逗一下物品列表
|
||||
* GET /User/Give/GetUserDouGoods
|
||||
*/
|
||||
static async GetUserDouGoods(no: string) {
|
||||
return await ApiService.Request("get", "/User/Give/GetUserDouGoods", { no });
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用逗物品
|
||||
* GET /User/Give/UseDou
|
||||
*/
|
||||
static async UseDou(no: string, goodsId: number, count: number) {
|
||||
return await ApiService.Request("get", "/User/Give/UseDou", { no, goodsId, count });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user