This commit is contained in:
Putoo
2026-07-16 12:48:31 +08:00
parent c94b3ce200
commit 2cd2ed02f8
19 changed files with 138 additions and 20 deletions

View File

@@ -30,7 +30,7 @@
<Abutton @click="btnChoice">使用物品</Abutton>
</div>
<div class="common" v-if="data.isDeal == 1">
<Abutton @click="saleState=true">寄售</Abutton>
<Abutton @click="saleState = true">寄售</Abutton>
</div>
</div>
@@ -54,7 +54,7 @@
物品名称{{ data.goodsName }}<br>
物品数量{{ count }}<br>
</div>
<div class="common" style="text-align: center;">
<div class="common" style="text-align: center;">
<span style="font-size: 16px;">使用数量</span><input type="number" class="search-ipt" v-model="useCount"><br>
<button class="ipt-btn" name="serch" @click="UseGoods" style="margin-top: 15px;">确认</button>
</div>
@@ -86,8 +86,9 @@
<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" />
<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>
@@ -162,6 +163,10 @@ const showUse = () => {
const showUseNumView = ref(false);
const UseGoods = async () => {
if (useCount.value <= 0) {
MessageExtend.ShowToast("使用数量不能小于0!", "fail")
return;
}
MessageExtend.LoadingToast("使用中...");
let result = await GoodsService.UseGoods(Number(goodsId), useCount.value);
MessageExtend.LoadingClose();
@@ -203,13 +208,21 @@ const saleState = ref(false);
const salePrice = ref(1);
const saleCount = ref(1);
const SaleOk = async () => {
if (saleCount.value <= 0) {
MessageExtend.ShowToast("寄售数量不能小于0!", "fail")
return;
}
if (salePrice.value <= 0) {
MessageExtend.ShowToast("寄售价格不能小于0!", "fail")
return;
}
MessageExtend.LoadingToast("寄售中...");
let result = await TradeService.Trade(1, goodsId, salePrice.value, saleCount.value);
MessageExtend.LoadingClose();
if (result.code == 0) {
saleState.value =false;
saleState.value = false;
await BindData();
MessageExtend.Notify("寄售成功!","success");
MessageExtend.Notify("寄售成功!", "success");
}
else {
MessageExtend.ShowDialog("寄售装备", result.msg);