<template>
|
<view class="container">
|
<header>
|
<!-- <u-input class="search" placeholder="搜索" type="text" v-model="search" /> <u-button type="primary"
|
style="width: 100upx;margin-top: 20upx;" size="normal" text="搜索" @click="getsearch"></u-button> -->
|
<view class="right">
|
<image src="/static/index/search.png" mode=""></image>
|
<input class="search" placeholder="请输入感兴趣的政策内容" type="text" v-model="search" />
|
<u-button type="primary" style="width: 100upx;border-radius: 18upx;" size="normal" text="搜索"
|
@click="getsearch()"></u-button>
|
</view>
|
</header>
|
<view
|
style="padding: 0 20upx;background-color: #fff;display: flex;justify-content: space-between;">
|
<u-tabs :list="tabsList" @click="chooseArticleType" style="padding-left: 4px;" lineWidth="30"
|
lineColor="#6190E8" :activeStyle="{
|
color: '#6190E8',
|
transform: 'scale(1.05)'
|
}" :inactiveStyle="{
|
color: '#606266',
|
transform: 'scale(1)'
|
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 54px;">
|
</u-tabs>
|
|
</view>
|
<view v-if="!loading">
|
<view
|
style="padding: 40upx;background-color: #fff;margin-top: 20upx;padding-bottom:200upx;color: #969799;font-size: 28upx;"
|
v-if="ArticleType == '可申领补贴'&& goodsList.length>0">
|
<view class="goods-item" v-for="(item, index) in goodsList" :key="index" @click="godetail(item)">
|
<view style="background-color: #f7f7f7;padding: 10upx;margin-bottom: 10upx;">
|
<view style="display: flex;justify-content: space-between;">
|
<view style="font-weight: 800px;color: #000;">{{ item.ProjectTitle }}</view>
|
<u-tag :text="item.ProjectType" plain size="mini" type="primary"></u-tag>
|
</view>
|
<view style="display: flex;justify-content: space-between;margin-top: 2upx;">
|
<view style="font-size: 22upx;line-height: 44upx;">{{ item.PlatForm }}</view>
|
<!-- <u-tag :text="item.StartDate.split(' ')[0]" plain size="mini" type="primary"></u-tag> -->
|
<!-- PubTime -->
|
</view>
|
</view>
|
</view>
|
</view>
|
<view
|
style="padding: 40upx;background-color: #fff;margin-top: 20upx;padding-bottom:200upx;color: #969799;font-size: 28upx;"
|
v-if="ArticleType == '已获批补贴'&& PolicyAppliedPageList.length>0">
|
<view class="goods-item" v-for="(item, index) in PolicyAppliedPageList" :key="index"
|
@click="godetail(item)">
|
<view style="background-color: #f7f7f7;padding: 10upx;margin-bottom: 10upx;">
|
<view style="display: flex;justify-content: space-between;">
|
<view style="font-weight: 800px;color: #000;">{{ item.Subsidized }}</view>
|
<u-tag :text="item.GetTime ? item.GetTime.slice(0, 4) : ''" plain size="mini"
|
type="primary"></u-tag>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view v-if="loading" style="margin-top: 100upx;">
|
<u-loading-icon></u-loading-icon>
|
</view>
|
<view v-if="ArticleType == '可申领补贴'">
|
<u-empty v-if="!loading && goodsList.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/car.png">
|
</u-empty>
|
</view>
|
<view v-if="ArticleType == '已获批补贴'">
|
<u-empty v-if="!loading && PolicyAppliedPageList.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/car.png">
|
</u-empty>
|
</view>
|
<view style="position: fixed;bottom: 0;background-color: #fff;width: 100%;" v-if="ArticleType == '可申领补贴'">
|
<Pagination :totalItems="total1" :itemsPerPage="pageSize" :currentPage="pageIndex1"
|
@page-change="onPageChange1" />
|
</view>
|
<view style="position: fixed;bottom: 0;background-color: #fff;width: 100%;" v-else>
|
<Pagination :totalItems="total2" :itemsPerPage="pageSize" :currentPage="pageIndex2"
|
@page-change="onPageChange2" />
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import Pagination from '../../components/Pagination';
|
export default {
|
components: {
|
Pagination
|
},
|
|
data() {
|
return {
|
loading: false,
|
keyword: '',
|
search: '',
|
goodsList: [],
|
tabsList: [
|
{
|
name: '可申领补贴',
|
badge: {
|
value: 0,
|
type: 'error',
|
max:99
|
|
}
|
},
|
{
|
name: '已获批补贴',
|
badge: {
|
value: 0,
|
type: 'error',
|
max:99
|
}
|
},
|
],
|
pageIndex1: 1,
|
pageIndex2: 1,
|
pageSize: 8,
|
total1: 0,
|
total2: 0,
|
PolicyAppliedList: [],
|
PolicyAppliedPageList: [],
|
ArticleType: '可申领补贴',
|
};
|
},
|
onLoad() {
|
if (uni.getStorageSync('Address') && uni.getStorageSync('Address') != 'null') {
|
this.search = uni.getStorageSync('Address')
|
}
|
this.getArticleDataList()
|
this.getPolicyApplied()
|
|
|
|
},
|
methods: {
|
getsearch() {
|
this.pageIndex1 = 1
|
this.pageIndex2 = 1
|
this.getArticleDataList()
|
this.getPolicyApplied()
|
},
|
|
chooseArticleType(e) {
|
console.log('item', e);
|
this.ArticleType = e.name
|
|
},
|
|
getArticleDataList() {
|
this.loading = true
|
let data = {
|
CompanyName: this.search,
|
Keyword: this.keyword,
|
PageNumber: this.pageIndex1,
|
PageSize: this.pageSize
|
};
|
this.$http.post('/SubsidyData/GetSubsidyDataList', data).then(res => {
|
if (res.Check) {
|
for (let i = 0; i < res.Data.Data.length; i++) {
|
res.Data.Data[i].index = 10 * (this.pageIndex - 1) + 1 + i;
|
}
|
this.goodsList = res.Data.Data;
|
this.total1 = res.Data.TotalCount;
|
this.tabsList[0].badge.value = res.Data.TotalCount;
|
this.loading = false;
|
console.log(this.tabsList);
|
} else {
|
this.$msg(res.Msg);
|
this.total1 = 0
|
this.goodsList = [];
|
}
|
})
|
},
|
getPolicyApplied() {
|
this.loading = true
|
let data = {
|
Company: this.search,
|
PageNumber: this.pageIndex2,
|
PageSize: this.pageSize
|
}
|
this.$http.post('/SubsidizedCompanies/GetSubsidizedCompaniesList', data).then(res => {
|
console.log(res);
|
|
if (res.Check && res.Data && res.Data.Data != '-1' && res.Data.Data != '-2') {
|
// this.PolicyAppliedList = res.Data.Data;
|
this.total2 = res.Data.TotalCount;
|
this.tabsList[1].badge.value = res.Data.TotalCount;
|
this.loading = false
|
// 前端分页
|
// this.PolicyAppliedPageList = this.PolicyAppliedList.slice((this.pageIndex2 - 1) * this.pageSize, this.pageIndex2 * this.pageSize);
|
this.PolicyAppliedPageList = res.Data.Data;
|
} else {
|
this.PolicyAppliedPageList = []
|
this.PolicyAppliedList = []
|
this.tabsList[1].badge.value = 0
|
this.total2 = 0
|
this.loading = false
|
}
|
})
|
},
|
godetail(item) {
|
// 手机浏览器跳转
|
window.open(item.SubsidyUrl, "_blank");
|
},
|
|
onPageChange1(e) {
|
this.pageIndex1 = e
|
this.getArticleDataList()
|
},
|
onPageChange2(e) {
|
this.pageIndex2 = e
|
this.getPolicyApplied()
|
// this.PolicyAppliedPageList = this.PolicyAppliedList.slice((this.pageIndex - 1) * this.pageSize, this.pageIndex * this.pageSize);
|
},
|
|
}
|
|
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
page {
|
background-color: #F7F7F7;
|
}
|
|
header {
|
padding: 0 30upx;
|
height: 120upx;
|
background-color: #236AF0;
|
display: flex;
|
color: #fff;
|
font-size: 14px;
|
.right{
|
flex: 1;
|
display: flex;
|
align-items: center;
|
background-color: #fff;
|
border-radius: 20upx;
|
// height: 80upx;
|
// line-height: 80upx;
|
padding: 0 10upx 0 20upx;
|
margin: 20upx 0 ;
|
color: #236AF0;
|
image {
|
width: 28upx;
|
height: 28upx;
|
margin-right:10upx;
|
}
|
.search{
|
flex: 1;
|
}
|
}
|
}
|
|
.u-page__tag-item {
|
height: 40upx;
|
line-height: 40upx;
|
min-width: 50upx;
|
text-align: center;
|
margin: 10upx;
|
}
|
</style>
|