1.优化商品列表全部加载动画 2.退款界面自定义退款使inpt自动获得焦点

This commit is contained in:
gyq
2025-03-25 14:42:42 +08:00
parent 3e84edbb6c
commit 4245b5a098
7 changed files with 16338 additions and 97 deletions

View File

@@ -35,7 +35,7 @@
<el-button type="success" style="width: 100%;" @click="toOrderMeal(1)">加菜/管理</el-button>
</div>
<div class="btn_wrap">
<el-button type="primary" style="width: 100%;" @click="showPayHandle">结算({{
<el-button type="primary" style="width: 100%;" :loading="payLoading" @click="showPayHandle">结算({{
orderInfo.orderAmount || 0 }})</el-button>
</div>
</div>
@@ -76,20 +76,16 @@
</transition>
</div>
<!-- 结算订单 -->
<settleAccount ref="settleAccountRef" :cart="cartList" :amount="orderInfo.orderAmount"
:remark="orderInfo.remark" :masterId="orderInfo.masterId" :orderInfo="orderInfo" @paySuccess="paySuccess" />
<SettleAccount ref="SettleAccountRef" @success="emits('success')" />
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch } from 'vue'
import { ref, onMounted, watch } from 'vue'
import { useRouter } from 'vue-router'
import { useUser } from "@/store/user.js"
import { useGlobal } from '@/store/global.js'
import { queryMembermember } from '@/api/member/index.js'
import { orderDetail } from '@/api/order/index.js'
import { formatDecimal } from '@/utils/index.js'
import settleAccount from "@/views/home/components/settleAccount.vue";
import SettleAccount from '@/views/home/components/settleAccount.vue'
import { ElMessage } from 'element-plus'
import { clearTable } from '@/api/table.js'
import { useGoods } from "@/store/goods.js";
@@ -97,8 +93,8 @@ import { getOrderByIdAjax } from '@/utils/index.js'
const goodsStore = useGoods()
const router = useRouter()
const global = useGlobal()
const store = useUser()
const SettleAccountRef = ref(null)
const emits = defineEmits(['close', 'success'])
@@ -109,7 +105,6 @@ const props = defineProps({
}
})
const showPeopleNum = ref(false)
const peopleNum = ref(0)
const peopleNumInputValue = ref('')
@@ -123,7 +118,6 @@ function inputFocus() {
peopleNum.value = 'custom'
}
const settleAccountRef = ref(null)
const orderInfo = ref({})
const cartList = ref([])
@@ -140,8 +134,20 @@ const status = ref({
const payLoading = ref(false)
// 显示结算页面
function showPayHandle() {
settleAccountRef.value.show()
async function showPayHandle() {
try {
payLoading.value = true
await goodsStore.historyOrderAjax('', props.tableInfo.orderId)
goodsStore.selectTable({
...props.tableInfo,
num: props.tableInfo.useNum
})
goodsStore.calcCartInfo()
SettleAccountRef.value.show()
} catch (error) {
console.log(error);
}
payLoading.value = false
}
// 显示就就餐人数
@@ -227,7 +233,10 @@ function orderDownHandle() {
function toOrderMeal(t) {
if (t == 1) {
// 直接点单
global.setOrderTable(props.tableInfo)
goodsStore.selectTable({
...props.tableInfo,
num: props.tableInfo.useNum
})
router.push({
name: 'home',
})