Files
pj_h5_cloud/src/pages/apply/stride-items.vue
T

73 lines
1.9 KiB
Vue

<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { filePath } from "@@/utils/file"
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
const state = reactive<any>({
pa: {
bizId: null,
pagesize: 99,
},
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, applyApi.codeList, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa)
}
onLoad((options: any) => {
if (!isEmpty(options.id)) {
state.pa.bizId = options.id
}
})
onShow(() => {})
</script>
<template>
<crud-layout title="跨单位就餐" bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
:fixed="false"
v-model="pageHook.list"
:default-page-size="10"
safe-area-inset-bottom
:loading-more-enabled="true"
:show-scrollbar="false"
@query="query"
:auto-clean-list-when-reload="false"
:auto-scroll-to-top-when-reload="false"
@scroll="pageHook.scroll"
>
<template #top>
<view class="h-30rpx" />
</template>
<view
class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list"
:key="i"
@tap="hooks.usePreviewImage(filePath(v.code))"
>
<view class="flex-row items-center">
<view class="flex-row items-center">
<tm-tag v-if="v.status == 0" size="m" color="info">未使用</tm-tag>
<tm-tag v-if="v.status == 1" size="m" color="success">已使用</tm-tag>
</view>
<view class="flex-row items-center sub-text-26">
<text class="m-l-30rpx">{{ v.username }}</text>
<text class="m-l-10rpx second-text-26">{{ v.userMobile }}</text>
</view>
</view>
<view class="iconfont icon-erweima font-size-40rpx! color-blue" />
</view>
</z-paging>
</crud-layout>
</template>
<style lang="scss" scoped></style>