feat(order): add order detail and list pages with components for order management
- Implemented order detail page with components for displaying order status, user info, and refund options. - Created order list page with pagination and order cards for displaying all orders. - Added styles for order detail and list pages. - Developed a prompt document outlining component requirements for the order management system. - Introduced a new Card component for quick booking with a responsive design. - Enhanced Tabs component for better navigation between different categories. - Integrated z-paging for efficient data loading and management in order and quick booking lists. - Added service order card component for displaying service requests with call functionality. - Updated main CSS for improved viewport handling.
This commit is contained in:
73
src/components/Stepper/index.vue
Normal file
73
src/components/Stepper/index.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div class="stepper-wrapper border-box flex flex-items-center rounded-8">
|
||||
<uni-icons type="minus" size="24" color="#D1D1D1" @click="decrease" />
|
||||
<text
|
||||
class="stepper-text text-center font-size-14 font-500 color-000 ml-4 mr-4"
|
||||
>
|
||||
{{ value }} {{ unit }}
|
||||
</text>
|
||||
<uni-icons type="plus" size="24" color="#198CFF" @click="increase" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineProps, defineEmits, watch } from "vue";
|
||||
|
||||
// Props
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
min: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: 100,
|
||||
},
|
||||
unit: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
// Emit
|
||||
const emit = defineEmits(["update:modelValue", "decrease", "increase"]);
|
||||
|
||||
// Local state
|
||||
const value = ref(props.modelValue);
|
||||
|
||||
// 监听外部值变化,同步更新本地状态
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
value.value = newValue;
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
// Methods
|
||||
const decrease = () => {
|
||||
if (value.value === 1) return;
|
||||
|
||||
if (value.value > props.min) {
|
||||
value.value--;
|
||||
emit("update:modelValue", value.value);
|
||||
emit("decrease");
|
||||
}
|
||||
};
|
||||
|
||||
const increase = () => {
|
||||
if (value.value < props.max) {
|
||||
value.value++;
|
||||
emit("update:modelValue", value.value);
|
||||
emit("increase");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
Reference in New Issue
Block a user