admin
2021-12-09 f609ca35ee2946acd0ff04b7ac1aa61f75a2e4a1
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
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>会员开通记录</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <!-- <script src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script> -->
        <script>
            window.onresize = function() {
                document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
            };
            window.onresize();
        </script>
        <style>
            body {
                background: #F3F3F3;
                margin: 0;
                padding: 1px 0;
            }
 
            .item {
                height: 2.25rem;
                display: flex;
                justify-content: space-between;
                margin-bottom: 1px;
                background: #FFFFFF;
                padding: 0.2rem 0.24rem;
                box-sizing: border-box;
            }
 
            .item .title {
                font-size: 0.28rem;
                color: #000000;
            }
 
            .item .content {
                color: #C0C0C0;
                font-size: 0.24rem;
                margin-top: 0.12rem;
            }
 
            .item .left {
                display: flex;
                flex-direction: column;
                width: 5rem;
                position: relative;
            }
 
 
            .item .left .date {
                font-size: 0.24rem;
                color: #99999 !important;
            }
 
            .item .left .desc {
                font-size: 0.24rem;
                color: #C0C0C0 !important;
            }
 
            .item .active {
                color: #FF2C3B;
            }
 
            .empty {
                position: fixed;
                font-size: 0.36rem;
                color: #999999;
                width: 3rem;
                text-align: center;
                height: 1rem;
                left: 0;
                bottom: 0;
                right: 0;
                top: 0;
                margin: auto;
            }
 
            .more {
                text-align: center;
                font-size: 0.24rem;
                line-height: 0.4rem;
                color: white;
            }
 
            .copy {
                text-decoration: none;
                color: #888888;
                background: #f3f3f3;
                padding: 0.05rem 0.2rem;
                border-radius: 0.5rem;
                margin-left: 0.2rem;
                font-size: 0.26rem;
            }
        </style>
 
    </head>
    <body>
        <div id="data" style="display: none;">
            <div v-for="item in list" class="item">
                <div class="left">
                    <div class="title">
                        {{item.title}}
                    </div>
 
                    <div class="content desc">
                        订单号: {{item.orderNo}} <span class="copy" href="javascript:void()" v-on:click="copy(item.orderNo)">复制</span>
                    </div>
 
                    <div class="content date">
                        有效期: {{item.startTime}} - {{item.endTime}}
                    </div>
 
                    <div class="content date">
                        {{item.date}}
                    </div>
 
                </div>
 
 
            </div>
 
            <div class="more" v-if="hasMore" v-on:click="loadMore">点击加载更多</div>
 
            <div class="empty" v-if="list.length==0">
                暂无记录
            </div>
        </div>
        <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
        </script>
        <script src="../js/app.js"></script>
        <script src="js/vue-2.6.12.min.js"></script>
        <script src="js/http.js"></script>
 
 
 
        <script>
            var app = null;
            $(function() {
                app = new Vue({
                    el: '#data',
                    // 数据定义
                    data: {
                        list: [],
                        page: 1,
                        hasMore: false
                    },
                    watch: {
                        list: function(res) {
                            $("#data").css("display", "block");
 
                        }
                    },
                    methods: {
                        copy: function(orderId) {
                            ksbridge.call("copyText", {
                                content: orderId + ""
                            });
                            ksbridge.call("toast", {
                                msg: "复制成功"
                            })
                        },
                        getRecordList: function(page) {
                            ksbridge.call("getUid", function(res) {
                                ksbridge.call("getRequestBaseParams", {
                                    uid: res,
                                    page: page
                                }, function(res) {
                                    params = JSON.parse(res);
                                    if (page == 1)
                                        ksbridge.call("showLoading");
                                    $.ajax({
                                        type: 'POST',
                                        url: ksapp.host + '/api/v1/vip/getOrderList',
                                        data: params,
                                        success: function(data) {
                                            data = JSON.parse(data);
                                            app.page = page;
                                            console.log(data);
                                            if (data.code == 0) {
                                                if (page == 1)
                                                    app.list = data.data.list;
                                                else {
                                                    app.list = app.list.concat(data.data.list);
                                                }
                                                app.hasMore = data.data.count > app.list.length;
                                            } else {
                                                ksbridge.call("toast", {
                                                    msg: data.msg
                                                });
                                            }
 
                                        },
                                        fail: function(result) {
                                            ksbridge.call("toast", {
                                                msg: "网络请求出错"
                                            });
                                        },
                                        complete: function() {
                                            ksbridge.call("hideLoading");
                                        }
                                    });
 
                                });
                            });
                        },
                        loadMore: function() {
                            app.getRecordList(app.page + 1);
                        }
                    }
                });
                app.getRecordList(1);
            });
        </script>
</html>