<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="getArticleDataList()"></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="getArticleDataList()"></u-button>
|
</view>
|
</header>
|
<view v-if = "!loading&& (content!= ''|| content!= 'null')"
|
style="padding: 40upx;background-color: #fff;margin-top: 20upx;display: flex;justify-content: space-between;">
|
<view v-html="content"></view>
|
</view>
|
<view v-if="loading" style="margin-top: 100upx;">
|
<u-loading-icon></u-loading-icon>
|
</view>
|
<u-empty v-if="!loading && !(content!= ''|| content!= 'null')" mode="data" icon="http://cdn.uviewui.com/uview/empty/car.png">
|
</u-empty>
|
|
</view>
|
</template>
|
|
<script>
|
|
export default {
|
components: {
|
|
},
|
|
data() {
|
return {
|
loading: false,
|
search: '',
|
content: '',
|
|
};
|
},
|
onLoad() {
|
if (uni.getStorageSync('Address') && uni.getStorageSync('Address') != 'null') {
|
this.search = uni.getStorageSync('Address')
|
}
|
this.getArticleDataList()
|
|
},
|
methods: {
|
|
getArticleDataList() {
|
this.loading = true
|
let data = {
|
CompanyName: this.search,
|
}
|
this.$http.post('/SubsidyData/GetPolicyAnswer', data).then(res => {
|
if (res.Check && res.Data.Data) {
|
this.content = res.Data.Data.replace(/\n/g, '<br>')
|
this.content = this.content.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
this.loading = false
|
|
}else {
|
this.$msg(res.Msg)
|
this.content = ''
|
this.loading = false
|
}
|
})
|
},
|
|
}
|
|
|
}
|
</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;
|
}
|
}
|
|
}
|
</style>
|