This commit is contained in:
Putoo
2026-07-12 17:36:07 +08:00
parent c40f3711bc
commit 035eb476ea
19 changed files with 932 additions and 22 deletions

View File

@@ -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>