jialh
2024-12-11 cb5ecb1d5e80fe0b510e5dc229c02bd25a89153b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<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>