-
-
-
-
{{ userStore.username }}
-
个人资料
+
+
+
+
{{ '' }}
+
{{ 20 }}岁
+
{{ '男' }}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- 退出登录
-
+
+
diff --git a/src/pages/order/Success.vue b/src/pages/order/Success.vue
index 6ddcaba..5464a25 100644
--- a/src/pages/order/Success.vue
+++ b/src/pages/order/Success.vue
@@ -13,19 +13,23 @@ const orderStore = useOrderStore()
const wxStore = useWxStoreOutside()
const orderId = ref(Number(route.query.orderId))
const currentOrder = ref
()
-const isButtonDisabled = ref(false)
+const isButtonDisabled = ref>({})
async function handleOpenCabinet(orderId: number, orderGoodsId: number) {
- isButtonDisabled.value = true
+ isButtonDisabled.value[orderGoodsId] = true
try {
- await openCabinetApi(orderId, orderGoodsId)
+ const result = await openCabinetApi(orderId, orderGoodsId)
+ if (result.code !== 0) {
+ showFailToast(result.message)
+ return
+ }
showSuccessToast('柜口已成功开启')
} catch (error) {
showFailToast('开启失败,请稍后重试')
} finally {
- setTimeout(() => {
- isButtonDisabled.value = false
- }, 5000)
+ setTimeout((currentId) => {
+ delete isButtonDisabled.value[currentId]
+ }, 5000, orderGoodsId)
}
}
@@ -67,7 +71,7 @@ watch(() => orderId.value, async (newVal) => {
{{ item.goodsInfo.goodsName }}
- ¥{{ (item.goodsInfo.price / 100).toFixed(2) }}
+ ¥{{ item.goodsInfo.price.toFixed(2) }}
orderId.value, async (newVal) => {
size="small"
class="open-btn add-cart-btn"
@click.stop="handleOpenCabinet(currentOrder.orderId, item.orderGoods.orderGoodsId)"
- :disabled="isButtonDisabled"
+ :disabled="isButtonDisabled[item.orderGoods.orderGoodsId]"
>
- {{ isButtonDisabled ? '处理中...' : '打开柜口' }}
+ {{ isButtonDisabled[item.orderGoods.orderGoodsId] ? '处理中...' : '打开柜口' }}