|
@@ -2,6 +2,11 @@
|
|
<scroll-view
|
|
<scroll-view
|
|
:scroll-top="sTop"
|
|
:scroll-top="sTop"
|
|
@scrolltolower="onScroll"
|
|
@scrolltolower="onScroll"
|
|
|
|
+ @refresherrefresh="onRefresh"
|
|
|
|
+ @refresherpulling="onPulling"
|
|
|
|
+ @refresherrestore="pullUpEnd"
|
|
|
|
+ :refresher-triggered="triggered"
|
|
|
|
+ :refresher-enabled="true"
|
|
scroll-y
|
|
scroll-y
|
|
class="claimList"
|
|
class="claimList"
|
|
>
|
|
>
|
|
@@ -17,7 +22,7 @@
|
|
@click="toDetail(item)"
|
|
@click="toDetail(item)"
|
|
class="clain"
|
|
class="clain"
|
|
>
|
|
>
|
|
- <claim-item :detail="item"></claim-item>
|
|
|
|
|
|
+ <claim-item :detail="item" :claimType="currenType"></claim-item>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<wd-gap bg-color="#f7f8f9" height="50rpx"></wd-gap>
|
|
<wd-gap bg-color="#f7f8f9" height="50rpx"></wd-gap>
|
|
@@ -26,14 +31,15 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
-import { ref, reactive, watch } from "vue";
|
|
|
|
|
|
+import { ref, reactive, watch, nextTick, computed } from "vue";
|
|
import ActiveBlock from "./components/activeBlock.vue";
|
|
import ActiveBlock from "./components/activeBlock.vue";
|
|
-import { quickclaimsList } from "@/services/claim";
|
|
|
|
|
|
+import { quickclaimsList, auditSuccessList } from "@/services/claim";
|
|
import emptyBox from "@/components/emptyBox.vue";
|
|
import emptyBox from "@/components/emptyBox.vue";
|
|
import claimItem from "./components/claimItem.vue";
|
|
import claimItem from "./components/claimItem.vue";
|
|
-
|
|
|
|
|
|
+import { onPullDownRefresh } from "@dcloudio/uni-app";
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
activeName: String,
|
|
activeName: String,
|
|
|
|
+ type: String,
|
|
});
|
|
});
|
|
|
|
|
|
const openid = uni.getStorageSync("openid");
|
|
const openid = uni.getStorageSync("openid");
|
|
@@ -50,18 +56,29 @@ const sTop = ref(0);
|
|
watch(
|
|
watch(
|
|
() => props.activeName,
|
|
() => props.activeName,
|
|
(val) => {
|
|
(val) => {
|
|
- if (val === "claim") {
|
|
|
|
|
|
+ if (val === "claim" || !val) {
|
|
sTop.value = 0;
|
|
sTop.value = 0;
|
|
list.value = [];
|
|
list.value = [];
|
|
params.pageNum = 1;
|
|
params.pageNum = 1;
|
|
- getList("search");
|
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ getList("search");
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ immediate: true,
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+const currenType = computed(() => {
|
|
|
|
+ return claimType.value || props.type;
|
|
|
|
+});
|
|
|
|
+
|
|
const getList = (type?: string) => {
|
|
const getList = (type?: string) => {
|
|
if (type === "search") params.pageNum = 1;
|
|
if (type === "search") params.pageNum = 1;
|
|
- quickclaimsList({ openid, ...params }).then((res: any) => {
|
|
|
|
|
|
+ const currentApi =
|
|
|
|
+ currenType.value === "list" ? auditSuccessList : quickclaimsList;
|
|
|
|
+ currentApi({ openid, ...params }).then((res: any) => {
|
|
params.currentPage = Math.ceil(res.total / params.pageSize);
|
|
params.currentPage = Math.ceil(res.total / params.pageSize);
|
|
list.value = [...list.value, ...res.rows].map((item) => {
|
|
list.value = [...list.value, ...res.rows].map((item) => {
|
|
return {
|
|
return {
|
|
@@ -70,10 +87,14 @@ const getList = (type?: string) => {
|
|
paymentBillImageArr: item.paymentBillImage.split(","),
|
|
paymentBillImageArr: item.paymentBillImage.split(","),
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
+ console.log("----------------------------", list.value);
|
|
|
|
+
|
|
|
|
+ // isRefresh.value = false;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
const toDetail = (item: any) => {
|
|
const toDetail = (item: any) => {
|
|
|
|
+ if (currenType.value === "list") return;
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: `/pagesOne/claim/claimRecord?id=${item.id}`,
|
|
url: `/pagesOne/claim/claimRecord?id=${item.id}`,
|
|
});
|
|
});
|
|
@@ -85,12 +106,39 @@ const onScroll = () => {
|
|
getList();
|
|
getList();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const claimType = ref("");
|
|
|
|
+onLoad((options: any) => {
|
|
|
|
+ claimType.value = options.type;
|
|
|
|
+ // isRefresh.value = false;
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const triggered = ref(false);
|
|
|
|
+const onRefresh = () => {
|
|
|
|
+ sTop.value = 0;
|
|
|
|
+ list.value = [];
|
|
|
|
+ params.pageNum = 1;
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ getList("search");
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const onPulling = (e: any) => {
|
|
|
|
+ triggered.value = true;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ triggered.value = false;
|
|
|
|
+ }, 1000);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const pullUpEnd = () => {
|
|
|
|
+ triggered.value = false;
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.claimList {
|
|
.claimList {
|
|
background: #f7f8f9;
|
|
background: #f7f8f9;
|
|
- height: calc(100vh - 84rpx);
|
|
|
|
|
|
+ height: 100vh; //calc(100vh - 84rpx);;
|
|
padding: 32rpx;
|
|
padding: 32rpx;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
|
|