App.vue
3.8 KB
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
<script>
export default {
onLaunch: function() {
// console.log('App Launch')
},
onShow: function() {
// console.log('App Show')
},
onHide: function() {
// console.log('App Hide')
},
post: function(url, data,method) {
// (showLoad == undefined || showLoad) ?
// wx.showLoading({
// title: '加载中',
// }) : ''
// wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this,
token = uni.getStorageSync('token'),
header = {
token: token || ''
},
postData;
// console.log(token,"token")
//网络请求
uni.request({
url: this.globalData.baseUrl + url,
data: data,
method: method,
header: header,
success: function(res) { //返回取得的数据
console.log(res)
if (res.data.code == 1) {
resolve(res.data.data);
} else {
// uni.showToast({
// title: res.data.msg,
// icon: 'none',
// })
reject(res.data)
if (res.data.code == '401') {}
}
// (showLoad || showLoad == undefined) ? wx.hideLoading(): "";
// wx.hideNavigationBarLoading()
},
fail: function(e) {
console.log(e)
reject('网络出错');
// (showLoad || showLoad == undefined) ? wx.hideLoading() : "";
wx.hideNavigationBarLoading()
},
complete: function(daa) {
console.log(daa)
}
})
});
return promise;
},
timeFormate(timestamp, timeType) {
if (timestamp) {
var timeStamp = timestamp.length == 13 ? timestamp : timestamp * 1000
var date = new Date(timeStamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear() + '-';
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
var D = date.getDate() + ' ';
var h = date.getHours() + ':';
var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
var s = date.getSeconds();
if (timeType == 'YYMMDD') {
return Y + M + D;
} else if (timeType == 'YYMMDDHHMM') {
return Y + M + D + " " + h + m;
} else {
return h + m;
}
}
},
globalData: {
userInfo: null,
// baseUrl: 'http://icrgangjuren.w.brotop.cn/'
baseUrl:'https://icr.gangjuren.com/'
}
}
</script>
<style>
/*每个页面公共css */
/*每个页面公共css */
body {
background-color: #f6f6f6;
}
/* 布局 */
.layor_start {
display: flex;
justify-content: flex-start;
align-items: center;
}
.layor_center {
display: flex;
justify-content: center;
align-items: center;
}
.layor_between {
display: flex;
justify-content: space-between;
align-items: center;
}
.layor_around {
display: flex;
justify-content: space-around;
align-items: center;
}
.layor_end {
display: flex;
justify-content: flex-end;
align-items: center;
}
.flex_center {
display: flex;
flex-direction: column;
align-items: center;
}
.layor_start-warp {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.register {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0rpx;
left: 0;
right: 0;
z-index: 5;
}
.box{
background: #F5F5F5;
}
.remaintime {
display: flex;
justify-content: space-between;
align-items: center;
width: 686rpx;
height: 100rpx;
background: rgba(62, 58, 57, 1);
box-shadow: 0rpx 4rpx 18rpx rgba(0, 0, 0, 0.04);
opacity: 1;
border-radius: 10rpx;
margin: 24rpx auto 0;
padding: 0 18rpx 0 32rpx;
box-sizing: border-box;
}
.remainleft {
color: #fff;
font-size: 28rpx;
}
.remainright {
width: 48rpx;
height: 48rpx;
font-size: 0;
}
image{
width:100%;
height:100%;
}
.nodata{
color:#999;
font-size: 30rpx;
text-align: center;
margin-top:100rpx;
}
</style>