<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>
|
</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;
|
|
.left {
|
width: 150upx;
|
height: 100upx;
|
line-height: 100upx;
|
text-align: left;
|
display: flex;
|
|
i {
|
font-size: 36upx;
|
}
|
}
|
|
.search {
|
flex: 1;
|
height: 80upx;
|
line-height: 80upx;
|
border-radius: 40upx;
|
background-color: #fff;
|
padding: 0 20upx;
|
margin: 20upx 0;
|
color: #236AF0;
|
|
i {
|
font-size: 26upx;
|
color: #ccc;
|
}
|
}
|
|
}
|
</style>
|