功能:完善门店能力与用户安全配置
This commit is contained in:
@@ -58,6 +58,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* CouponView page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { LeftOutlined } from '@ant-design/icons-vue'
|
||||
@@ -66,8 +70,10 @@ import { couponApi } from '@/api/coupon'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
/** loading is a reactive state variable used by the template and event handlers. */
|
||||
const loading = ref(false)
|
||||
const coupons = ref<any[]>([])
|
||||
/** activeFilter is a reactive state variable used by the template and event handlers. */
|
||||
const activeFilter = ref('all')
|
||||
|
||||
const filterOptions = [
|
||||
@@ -77,6 +83,7 @@ const filterOptions = [
|
||||
{ label: '已过期', value: 'expired' }
|
||||
]
|
||||
|
||||
/** filteredCoupons is a reactive state variable used by the template and event handlers. */
|
||||
const filteredCoupons = computed(() => {
|
||||
if (activeFilter.value === 'all') {
|
||||
return coupons.value
|
||||
@@ -90,6 +97,7 @@ const filteredCoupons = computed(() => {
|
||||
return coupons.value
|
||||
})
|
||||
|
||||
/** loadCoupons is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const loadCoupons = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -103,6 +111,7 @@ const loadCoupons = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
/** getStatusClass is a local helper used by this page script. */
|
||||
const getStatusClass = (status: number) => {
|
||||
switch (status) {
|
||||
case 1:
|
||||
@@ -116,6 +125,7 @@ const getStatusClass = (status: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
/** formatDate is a local helper used by this page script. */
|
||||
const formatDate = (dateString: string) => {
|
||||
if (!dateString) return ''
|
||||
const date = new Date(dateString)
|
||||
|
||||
Reference in New Issue
Block a user