liangjin
2021-03-25 19f91bd79fa4ce2c50dfb5b44b0ebfc4f01baeae
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-19 16:20:48
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-12-09 20:32:32
 * @Description: 花呗分期——订单详情
 -->
<template>
    <div class="lthyj-detail h-100-g">
        <v-navbar title="订单详情" fixed></v-navbar>
        <div class="content">
            <div class="cell-group">
                <van-cell value="" title='合约信息' readonly style="font-weight: bold"></van-cell>
                <van-cell :value="form.contName" title='合约套餐' readonly></van-cell>
                <van-cell :value="form.monthConsAmt | dealMoney" title='月缴话费' readonly></van-cell>
                <van-cell :value="form.term | dealTerm" title='期数' readonly></van-cell>
                <van-cell :value="form.eleBondAmt | dealMoney" title='电子券金额' readonly></van-cell>
                <van-cell :value="form.strDownAmt | dealMoney" title='直降金额' readonly></van-cell>
            </div>
 
            <div class="cell-group">
                <van-cell value="" title='商品信息' readonly style="font-weight: bold"></van-cell>
                <van-cell :value="form.goodsBrand" title='品牌' readonly></van-cell>
                <van-cell :value="form.goodsModel" title='规格' readonly></van-cell>
                <van-cell :value="form.goodsPrice | dealMoney" title='价格' readonly></van-cell>
            </div>
 
            <div class="cell-group" >
                <van-cell value="" title='订单信息' readonly style="font-weight: bold"></van-cell>
                <van-cell :value="form.orderId || '暂无'" title='订单号' readonly></van-cell>
                <van-cell :value="form.orderStatus || '暂无'" title='订单状态' readonly></van-cell>
                <van-cell :value="form.userName || '暂无'" title='用户姓名' readonly></van-cell>
                <van-cell :value="form.contMblNo || '暂无'" title='合约手机号' readonly></van-cell>
                <van-cell :value="form.applyTime | dealTime" title='申请时间' readonly></van-cell>
                <van-cell :value="form.signTime | dealTime" title='签约时间' readonly></van-cell>
            </div>
 
            <div class="cell-group" >
                <van-cell value="" title='收货照片' readonly style="font-weight: bold"></van-cell>
                <van-image width="100px" height="100px" :src="form.recImage" @click="preview(form.recImage)"/>
            </div>
            <van-image-preview v-model="showImg" :images="images">
            </van-image-preview>
        </div>
    </div>
</template>
 
<script>
    import {mapState} from 'vuex';
    import Vue from 'vue';
    import { Image as VanImage } from 'vant';
    import dataformat from "@/utils/dateformat";
    import { ImagePreview } from 'vant';
    // 全局注册
    Vue.use(ImagePreview);
    Vue.use(VanImage);
    export default {
        data() {
            return {
                form: {},
                showImg: false,
                images: []
            }
        },
        filters: {
            dealMoney(val) {
                return val ? `${val}元` : ''
            },
            dealTerm(val) {
                return val ? `${val}期` : ''
            },
            dealTime(val) {
                return val ? dataformat.format(val, 'yyyy-MM-dd HH:mm') : "暂无"
            },
        },
        computed: {
            id() {
                return this.$route.query.id
            },
            typeId() {
                return this.$route.query.typeId
            },
            ...mapState(['userinfo'])
        },
        created() {
            this.init()
        },
        methods: {
            init() {
                this.$api.cuccOrderDetail({orderId: this.$route.query.id}).then((res) => {
                    this.form = res.body || {};
                }).catch((err) => {});
            },
            preview(src) {
                console.log(src)
                this.showImg = true
                this.images = [src]
            }
        },
    }
</script>
<style lang="less" scoped>
    .lthyj-detail {
        padding-top: 44px;
        background-color: @c-bg-f5;
 
        .content {
            padding: 10px 8px;
        }
 
        .cell-group {
            width: 100%;
            background: #fff;
            margin-bottom: 10px;
            .van-image {
                margin: 20px
            }
        }
    }
</style>