zhaojs
2023-09-15 39e2103e28830337c3be4dbd3dc7ad0a829ee78b
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
<template>
    <view class="container">
        <view v-if="orders.length>0" class="orders-list d-flex flex-column w-100" style="padding: 20rpx; padding-bottom: 0;">
            <view class="order-item" v-for="(item, index) in orders" :key="index" style="margin-bottom: 30rpx;">
                <list-cell :hover="false">
                    <view class="w-100 d-flex align-items-center">
                        <view @tap="copy(item.id)" class="flex-fill d-flex flex-column" style="width: 60%;">
                            <view class="font-size-lg text-color-base" style="margin-bottom: 20rpx;">
                                {{ item.mobile }}
                            </view>
                            <view style="display: flex;">
                                <view class="font-size-sm text-color-assist taskid-show">任务编号:{{ item.id }}</view>
                                <view style="color: #919293;">复制</view>
                            </view>
 
                        </view>
                        <view class="font-size-lg text-color-primary" style="font-size: 14px;">
                            {{ getSmsStatus(item.sendstatus) }}
                        </view>
                    </view>
                </list-cell>
                <list-cell :hover="false" last>
                    <view class="w-100 d-flex flex-column">
                        <view class="w-100 text-truncate font-size-lg text-color-base" style="margin-bottom: 20rpx;">
                            {{ item.smscontent}}
                        </view>
                        <view class="d-flex justify-content-between align-items-center" style="margin-bottom: 30rpx;">
                            <view class="font-size-sm text-color-assist">
                                {{item.sendtime}}
                            </view>
                            <view class="d-flex font-size-sm text-color-base align-items-center">
                                <view style="margin-right: 10rpx;">共{{ item.succedcount }}条短信</view>
                                <!-- <view class="font-size-lg">¥{{ item.amount }}</view> -->
                            </view>
                        </view>
                        <view class="d-flex align-items-center justify-content-end">
                            <!-- <view style="margin-right: 10rpx;">
                                <button type="primary" plain size="mini">查看回复</button>
                            </view> -->
 
                        </view>
                    </view>
                </list-cell>
            </view>
        </view>
        <view v-else>
            <gray-empty img="empty" text="无数据" />
        </view>
    </view>
</template>
 
<script>
    import listCell from '@/components/list-cell/list-cell'
import comUtils from '@/utils/ComUtils.js'
    export default {
        components: {
            listCell
        },
        data() {
            return {
                orders: []
            }
        },
        computed: {
 
        },
        onLoad() {
            this.getSendHistory();
        },
        async onReachBottom() {
 
        },
        async onPullDownRefresh() {
 
        },
        methods: {
            copy(taskid) {
                uni.setClipboardData({
                    data: taskid,
                    success: function() {
                        uni.showToast({
                            title: '复制成功',
                            icon: 'none'
                        });
                    }
                });
 
            },
            getSendHistory() {
                let memberInfo = uni.getStorageSync('smsmemberinfo');
                if (memberInfo == null) {
                    return;
                }
                uni.showLoading({
                    title: '加载中'
                })
                this.$http.post('/smsapi/SmsBusiness/GetSmsSend', {
                    Memberid: memberInfo.id
                }).then(e => {
                    this.orders = e.result;
                    uni.hideLoading()
                }).catch(function(err) {
                    uni.hideLoading()
                    console.log(err);
                })
            },
            getSmsStatus(status) {
                return comUtils.getSmsStatus(status);
            },
            detail(id) {
                uni.navigateTo({
                    url: '/pages/orders/detail?id=' + id
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .taskid-show {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        width: 80%;
    }
</style>