Commit 994aab41 authored by Zhang Xiaojie's avatar Zhang Xiaojie

update:热门贷款查询

parent 659af81c
<template> <template>
<Skeleton :row="3" :loading="skeLoading"> <Skeleton :row="3" :loading="skeLoading">
<van-swipe class="my-swipe" indicator-color="#3E4FAF" style="margin-top:20px"> <van-swipe
class="my-swipe"
indicator-color="#3E4FAF"
style="margin-top: 20px"
>
<van-swipe-item <van-swipe-item
class="flex justify-center swpiItem" class="flex justify-center swpiItem"
v-for="item in state.hotProductList" v-for="item in state.hotProductList"
...@@ -29,6 +33,7 @@ import { onMounted, PropType, reactive, watch } from "@vue/runtime-core"; ...@@ -29,6 +33,7 @@ import { onMounted, PropType, reactive, watch } from "@vue/runtime-core";
import { eLoanMode } from "@/views/withMenu/Loan/types"; import { eLoanMode } from "@/views/withMenu/Loan/types";
import { hotProduct } from "./type"; import { hotProduct } from "./type";
import { Skeleton } from "vant"; import { Skeleton } from "vant";
import { eProductStatus } from "@/service/LoanProductService/type";
const props = defineProps({ const props = defineProps({
loanMode: { loanMode: {
...@@ -38,7 +43,7 @@ const props = defineProps({ ...@@ -38,7 +43,7 @@ const props = defineProps({
}); });
let skeLoading = ref(true); let skeLoading = ref(true);
let state = reactive({hotProductList: [] as Array<hotProduct>}) let state = reactive({ hotProductList: [] as Array<hotProduct> });
watch(props, (newV, oldV) => { watch(props, (newV, oldV) => {
state.hotProductList = []; state.hotProductList = [];
...@@ -55,32 +60,35 @@ const fetchList = () => { ...@@ -55,32 +60,35 @@ const fetchList = () => {
limit: 3, limit: 3,
loan_type: props.loanMode!, loan_type: props.loanMode!,
offset: 0, offset: 0,
product_status: eProductStatus.hot,
}).then((ret) => { }).then((ret) => {
if (ret.code === 200) { if (ret.code === 200) {
skeLoading.value = false; skeLoading.value = false;
ret.data.uuid.map((uuid) => { ret.data.uuid.map((uuid) => {
queryLoanProductInfo({ uuid }).then((ret) => { queryLoanProductInfo({ uuid }).then((ret) => {
const { rate_lower, max_amount, max_date, inst_name, product_name,product_status } = const {
ret.data; rate_lower,
console.log('status',product_status); max_amount,
max_date,
if( product_status == 3){ inst_name,
state.hotProductList.push({ product_name,
rate_lower, product_status,
max_amount, } = ret.data;
max_date,
inst_name, state.hotProductList.push({
product_name, rate_lower,
uuid, max_amount,
product_status max_date,
}); inst_name,
} product_name,
uuid,
product_status,
});
}); });
}); });
} }
}); });
console.log('pro',state.hotProductList); console.log("pro", state.hotProductList);
}; };
</script> </script>
......
import baseAxios from '../index' import baseAxios from '../index'
import { eLoanMode } from '@/views/withMenu/Loan/types' import { eLoanMode } from '@/views/withMenu/Loan/types'
import { iLoanProdcutItem } from "./type" import { iLoanProdcutItem,eProductStatus } from "./type"
const prefix = '/loan/query' const prefix = '/loan/query'
export function queryLoanProductList(data: { export function queryLoanProductList(data: {
limit: number, limit: number,
loan_type:eLoanMode loan_type:eLoanMode,
product_status:eProductStatus,
offset: number offset: number
}) { }) {
return baseAxios<{ return baseAxios<{
......
...@@ -10,7 +10,7 @@ export interface iLoanProdcutItem{ ...@@ -10,7 +10,7 @@ export interface iLoanProdcutItem{
min_amount: number, min_amount: number,
min_date: number, min_date: number,
product_name: string, product_name: string,
product_status: number, product_status: eProductStatus,
loan_type: number, loan_type: number,
products: string, products: string,
rate_lower: number, rate_lower: number,
...@@ -20,6 +20,14 @@ export interface iLoanProdcutItem{ ...@@ -20,6 +20,14 @@ export interface iLoanProdcutItem{
uuid: string uuid: string
} }
export enum eProductStatus{
all=0,
unpublished=1,
normal=2,
hot=3,
published=4
}
export enum eGuaranteeType{ export enum eGuaranteeType{
credit=1, credit=1,
mortgage=2, mortgage=2,
......
...@@ -81,6 +81,7 @@ import { ...@@ -81,6 +81,7 @@ import {
} from "@/service/LoanProductService"; } from "@/service/LoanProductService";
import { number } from "bitcoinjs-lib/types/script"; import { number } from "bitcoinjs-lib/types/script";
import { Skeleton } from "vant"; import { Skeleton } from "vant";
import { eProductStatus } from "@/service/LoanProductService/type";
export default defineComponent({ export default defineComponent({
components: { components: {
...@@ -186,6 +187,7 @@ export default defineComponent({ ...@@ -186,6 +187,7 @@ export default defineComponent({
limit: 1, limit: 1,
offset: 0, offset: 0,
loan_type: 2, loan_type: 2,
product_status:eProductStatus.hot
}); });
if (ret.code === 200) { if (ret.code === 200) {
this.skeLoading = false; this.skeLoading = false;
......
...@@ -154,6 +154,7 @@ import { ...@@ -154,6 +154,7 @@ import {
} from "@/service/LoanProductService"; } from "@/service/LoanProductService";
import { loanMode } from "@/store/loanModeStore"; import { loanMode } from "@/store/loanModeStore";
import { clearSearchResult } from "@/store/loanSearchResultStore"; import { clearSearchResult } from "@/store/loanSearchResultStore";
import { eProductStatus } from "@/service/LoanProductService/type";
let skeLoading = ref(false); let skeLoading = ref(false);
let state = reactive({ allProductList: [] as Array<simpleItemInfo> }); let state = reactive({ allProductList: [] as Array<simpleItemInfo> });
...@@ -209,9 +210,10 @@ const fetchList = () => { ...@@ -209,9 +210,10 @@ const fetchList = () => {
// 取前7贷款产品遍历 // 取前7贷款产品遍历
skeLoading.value = true; skeLoading.value = true;
queryLoanProductList({ queryLoanProductList({
limit: 8, limit: 4,
loan_type: mode.value, loan_type: mode.value,
offset: 0, offset: 0,
product_status:eProductStatus.normal
}).then((ret) => { }).then((ret) => {
if (ret.code === 200) { if (ret.code === 200) {
skeLoading.value = false; skeLoading.value = false;
...@@ -225,18 +227,14 @@ const fetchList = () => { ...@@ -225,18 +227,14 @@ const fetchList = () => {
product_name, product_name,
product_status, product_status,
} = ret.data; } = ret.data;
if (count.value < 5) { count.value = count.value + 1;
if (product_status == 2) { state.allProductList.push({
count.value = count.value + 1; max_amount,
state.allProductList.push({ product_name,
max_amount, features,
product_name, inst_name,
features, uuid,
inst_name, });
uuid,
});
}
}
}); });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment