ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<template>
    <div class="assessment-result-page">
        <x-header :left-options="{showBack: true, backText: '', preventGoBack:true}" @on-click-back="goBackPage" class="gradient-color">额度评估</x-header>
        <div class="result-box">
            <!--表盘开始-->
            <div class="dash-board">
                <div class="circle" :style="{ transform: dashRotate }">
                    <div class="square"></div>
                </div>
                <div class="result">
                    <p>您的额度评估如下</p>
                    <p>¥<span>{{ quota }}</span></p>
                </div>
            </div>
            <!--表盘结束-->
            <!--波浪开始-->
            <div class="waveWrapper gradient-color waveAnimation">
                <div class="waveWrapperInner bgTop">
                    <div class="wave waveTop"></div>
                </div>
                <div class="waveWrapperInner bgMiddle">
                    <div class="wave waveMiddle"></div>
                </div>
                <div class="waveWrapperInner bgBottom">
                    <div class="wave waveBottom"></div>
                </div>
            </div>
            <!--波浪结束-->
        </div>
        <FBlockTitle title="为你推荐" v-if="prodList.length"></FBlockTitle>
        <FProdList :lists="prodList" @on-click-prodItem="handleProductJump" v-if="prodList.length"></FProdList>
    </div>
</template>
 
<script>
    /**
     * Created by c.y on 2018/3/16.
     * 额度评估的结果页
     */
    import FBlockTitle from '../../components/common/FBlockTitle.vue';
    import FProdList from '../../components/common/FProdList.vue';
    import systemApi from '../../api/api';
    import statusCodeManage from '../../api/statusCodeManage';
    import {XHeader} from 'vux';
 
    export default {
        name: 'f-assessment-result',
        data() {
            return {
                dashRotate: 'rotate(0deg)',
                quota: 0, // 额度结果
                prodList: [] // 产品列表
            }
        },
        components: {
            FBlockTitle,
            FProdList,
            XHeader
        },
        methods: {
            goBackPage(){
                this.$router.push({path:'f-main'});
            },
            // 处理产品跳转
            handleProductJump (item) {
                // 极速贷款或者银行卡
                if (item.productType === 40000005 || item.productType === 40000006) {
                    this.$router.push({
                        path: '/f-loan-detail',
                        query: {
                            id: item.prodId,
                        }
                    });
                    // 信用卡
                } else if (item.productType === 40000007) {
                    this.$router.push({
                        path: '/credit-detail',
                        query: {
                            id: item.prodId,
                        }
                    });
                }
            },
            // 获取Attr的列表, prodElements产品组件的元素列表
            getAttrList (prodElements) {
                // 获取用户修改的数据
                let attrList = [];
                if (prodElements instanceof Array) {
                    prodElements.map(function (listItem) {
                        listItem.attrs.forEach(function (item) {
                            attrList.push(item.value);
                        });
                    });
                }
                return attrList;
            },
            init () {
                let _this = this;
                systemApi.fetchPushProd().then((res) => {
                    res.body.forEach(function (item) {
                        _this.prodList.push({
                            prodId: item.unit.prodId,
                            content: _this.getAttrList(item.showEles),
                            productType: item.unit.prodType,
                            applyNumber: item.unit.showNumPrefix + item.unit.showNum
                        });
                    });
                }, (error) => {
                    statusCodeManage.showTipOfStatusCode(error,_this);
                });
            }
        },
        activated: function () {
            let _this = this;
            this.quota = 0;
            if (this.$route.query.quota) {
                this.quota = this.$route.query.quota;
            }
            this.prodList=[];
            this.init();
            setTimeout(function () {
                _this.dashRotate = 'rotate(200deg)';
            }, 500);
        }
    }
</script>
 
<style lang="less">
    @import "../../style/mixin";
    .assessment-result-page {
        .result-box {
            padding-top: 38px;
            .color-linear-gradient(@color-gradient-darkBlue-left, @color-gradient-darkBlue-right);
        }
        .vux-header {
            .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
            .vux-header-title {
                font-size: 18px;
            }
            .vux-header-left {
                .left-arrow:before {
                    border: solid 1px @color-white;
                    border-width: 2px 0 0 2px;
                }
            }
            .vux-header-right{
                color: @color-white !important;
            }
        }
    }
    @keyframes move_wave {
        0% {
            transform: translateX(0) translateZ(0) scaleY(1)
        }
        50% {
            transform: translateX(-25%) translateZ(0) scaleY(1)
        }
        100% {
            transform: translateX(0) translateZ(0) scaleY(1)
        }
    }
 
    .waveWrapper {
        height: 68px;
        overflow: hidden;
        position: relative;
    }
 
    .waveWrapperInner {
        position: absolute;
        width: 100%;
        overflow: hidden;
        height: 100%;
        bottom: -1px;
    }
 
    .bgTop {
        z-index: 15;
        opacity: 0.5;
    }
 
    .bgMiddle {
        z-index: 10;
        opacity: 0.75;
    }
 
    .bgBottom {
        z-index: 5;
    }
 
    .wave {
        position: absolute;
        left: 0;
        width: 200%;
        height: 100%;
        background-repeat: repeat no-repeat;
        background-position: 0 bottom;
        transform-origin: center bottom;
    }
 
    .waveTop {
        background-size: 60% 60px;
        background-image: url(../../assets/img/wave-top.png);
    }
 
    .waveAnimation .waveTop {
        animation: move-wave 3s infinite;
        -webkit-animation: move-wave 3s;
        -webkit-animation-delay: 1s;
        animation-delay: 1s;
    }
 
    .waveMiddle {
        background-size: 60% 60px;
        background-image: url(../../assets/img/wave-mid.png);
    }
 
    .waveAnimation .waveMiddle {
        animation: move_wave 10s linear infinite;
    }
 
    .waveBottom {
        background-size: 60% 60px;
        background-image: url(../../assets/img/wave-bot.png);
    }
 
    .waveAnimation .waveBottom {
        animation: move_wave 15s linear infinite;
    }
 
    .dash-board {
        position: relative;
        width: 100%;
        height: 200px;
        text-align: center;
        color: @color-white;
        font-size: @font-size-medium;
        &:before {
            content: '';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 200px;
            height: 200px;
            border-radius: 50%;
            border: 2px solid #68c1f8;
            border-bottom-color: transparent;
        }
        &:after {
            content: '';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 140px;
            height: 140px;
            border-radius: 50%;
            border: 6px solid #a1e1fe;
            border-bottom-color: transparent;
        }
        .result {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 100%;
            p {
                &:first-child {
                    font-size: @font-size-medium;
                }
                &:last-child {
                    font-size: 20PX;
                    span {
                        font-size: 30PX;
                    }
 
                }
            }
        }
        .circle {
            width: 200px;
            height: 200px;
            margin: 0 auto;
            border-radius: 50%;
            border: 1px solid transparent;
            position: relative;
            transform: rotate(0deg);
            transition: all 1s;
            .square {
                position: absolute;
                left: 25px;
                bottom: 30px;
                width: 6px;
                height: 6px;
                margin-left: -6px;
                border-radius: 50%;
                border: 2px solid #9ddcfc;
                background-color: @color-white;
            }
        }
    }
</style>