<template>
|
<!--申请记录-->
|
<div class="apply-record">
|
<x-header :left-options.showBack="{backText: ''}" :title="'申请记录'" class="gradient-color"></x-header>
|
<div class="tips">平台仅记录您的点击行为,实际申请和审核结果请以产品显示结果为准</div>
|
<scroller lock-x height="-100px" :scrollbar-y=false ref="scroller" @on-pulldown-loading="refresh" :pulldown-config="pulldownConfig" use-pulldown>
|
<FProdList :gutter="true" :lists="prodList" :showNone="showNone" @on-click-prodItem="handleProductJump"></FProdList>
|
</scroller>
|
<FSpace type="large"></FSpace>
|
</div>
|
</template>
|
|
<script>
|
import { XHeader, Scroller } from 'vux';
|
import FProdList from '../../components/common/FProdList.vue';
|
import FSpace from '../../components/common/FSpace.vue';
|
import systemApi from '../../api/api';
|
import statusCodeManage from '../../api/statusCodeManage';
|
/**
|
* Created by 吴彦祖 on 2018/3/30.
|
* 我的--申请记录
|
*/
|
export default {
|
name: 'f-apply-record',
|
data() {
|
return {
|
prodList: [],
|
showNone: false,
|
pulldownConfig: {
|
content: '下拉刷新',
|
height: 40,
|
autoRefresh: false,
|
downContent: '释放刷新',
|
upContent: '释放刷新',
|
loadingContent: '加载中...'
|
}
|
};
|
},
|
components: {
|
FProdList,
|
XHeader,
|
Scroller,
|
FSpace
|
},
|
methods: {
|
//下拉加载
|
refresh() {
|
let _this = this;
|
systemApi.fetchApplyRecord().then(
|
res => {
|
this.prodList = [];
|
res.body.forEach(item => {
|
this.prodList.push({
|
prodId: item.productListInfo.unit.prodId,
|
content: this.getAttrList(
|
item.productListInfo.showEles
|
),
|
applyNumber:
|
item.productListInfo.unit.showNumPrefix +
|
item.productListInfo.unit.showNum,
|
applyTime: item.applyTime,
|
productType: item.productListInfo.unit.prodType
|
});
|
});
|
if (!_this.prodList.length) {
|
_this.showNone = true;
|
}
|
this.$nextTick(() => {
|
this.$refs.scroller.reset();
|
this.$refs.scroller.donePulldown();
|
});
|
},
|
error => {
|
this.$refs.scroller.reset();
|
statusCodeManage.showTipOfStatusCode(error, _this);
|
}
|
);
|
},
|
// 处理产品跳转
|
handleProductJump(item) {
|
// 极速贷款或者银行卡
|
if (
|
item.productType === 40000005 ||
|
item.productType === 40000006
|
) {
|
this.$router.push({
|
path: '/f-loan-detail',
|
query: {
|
id: item.prodId
|
}
|
});
|
// 信用卡
|
} else if (item.productType === 40000007) {
|
this.$router.push({
|
path: '/f-credit-detail',
|
query: {
|
id: item.prodId
|
}
|
});
|
}
|
},
|
// 获取Attr的列表, prodElements产品组件的元素列表
|
getAttrList(prodElements) {
|
// 获取用户修改的数据
|
let attrList = [];
|
if (prodElements instanceof Array) {
|
prodElements.map(function(listItem) {
|
listItem.attrs.forEach(function(item) {
|
attrList.push(item.value);
|
});
|
});
|
}
|
return attrList;
|
},
|
// 初始化
|
init() {
|
let _this = this;
|
systemApi.fetchApplyRecord().then(
|
res => {
|
_this.prodList = [];
|
res.body.forEach(function(item) {
|
_this.prodList.push({
|
prodId: item.productListInfo.unit.prodId,
|
content: _this.getAttrList(
|
item.productListInfo.showEles
|
),
|
applyNumber:
|
item.productListInfo.unit.showNumPrefix +
|
item.productListInfo.unit.showNum,
|
applyTime: item.applyTime,
|
productType: item.productListInfo.unit.prodType
|
});
|
});
|
if (!_this.prodList.length) {
|
_this.showNone = true;
|
}
|
},
|
error => {
|
// _this.$refs.scroller.donePulldown();
|
statusCodeManage.showTipOfStatusCode(error, _this);
|
}
|
);
|
}
|
},
|
activated() {
|
this.init();
|
},
|
deactivated() {
|
this.prodList = [];
|
this.showNone = false;
|
}
|
};
|
</script>
|
|
<style lang="less">
|
@import '../../style/mixin.less';
|
|
.apply-record {
|
.vux-header {
|
.color-linear-gradient(@color-primary-light, @color-primary, 90deg);
|
.vux-header-title {
|
font-size: 18px;
|
}
|
.vux-header-left {
|
.left-arrow:before {
|
border: solid 1px @color-white;
|
border-width: 2px 0 0 2px;
|
}
|
}
|
}
|
.tips {
|
padding: 4px 13px;
|
box-sizing: border-box;
|
background-color: @color-background-default;
|
font-size: @font-size-small;
|
color: @color-text-third;
|
}
|
}
|
</style>
|