hailu
2024-12-02 0bbcee731e5259feadd261e8a84c3e27b8387e01
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
111
112
<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>