1
1
<template >
2
- <view class =" wrap" >
3
- <view class =" pre-box" v-if =" !showUploadList" >
4
- <view class =" pre-item" v-for =" (item, index) in lists" :key =" index" >
5
- <image class =" pre-item-image" :src =" item.url" mode =" aspectFill" ></image >
6
- </view >
7
- </view >
8
- <u-upload :custom-btn =" true" ref =" uUpload" :show-upload-list =" showUploadList" :action =" action" >
9
- <view slot =" addBtn" class =" slot-btn" hover-class =" slot-btn__hover" hover-stay-time =" 150" >
10
- <u-icon name =" photo" size =" 60" :color =" $u.color['lightColor']" ></u-icon >
11
- </view >
12
- </u-upload >
2
+ <view class =" " >
3
+
13
4
</view >
14
5
</template >
15
6
16
7
<script >
17
- export default {
18
- data () {
19
- return {
20
- action: ' http://192.168.100.17/index.php/index/index/upload' , // 演示地址
21
- showUploadList: false ,
22
- // 如果将某个ref的组件实例赋值给data中的变量,在小程序中会因为循环引用而报错
23
- // 这里直接获取内部的lists变量即可
24
- lists: []
8
+ export default {
9
+
10
+ data () {
11
+ return {
12
+
13
+ };
14
+ },
15
+ onLoad () {
16
+ console .log (this .$u .test .url (' http://www.aa.com?b=3&a=328sdsfhiwiefwismdfhsewiemsnfwiemdhisi' ));
17
+ },
18
+ computed: {
19
+
20
+ },
21
+ methods: {
22
+ reachBottom () {
23
+ // 此tab为空数据
24
+ if (this .current != 2 ) {
25
+ this .loadStatus .splice (this .current ,1 ," loading" )
26
+ setTimeout (() => {
27
+ this .getOrderList (this .current );
28
+ }, 1200 );
29
+ }
30
+ },
31
+
32
+ // 页面数据
33
+ getOrderList (idx ) {
34
+ for (let i = 0 ; i < 5 ; i++ ) {
35
+ let index = this .$u .random (0 , this .dataList .length - 1 );
36
+ let data = JSON .parse (JSON .stringify (this .dataList [index]));
37
+ data .id = this .$u .guid ();
38
+ this .orderList [idx].push (data);
25
39
}
40
+ this .loadStatus .splice (this .current ,1 ," loadmore" )
41
+ },
42
+
43
+ change (index ) {
44
+ this .swiperCurrent = index;
45
+ this .getOrderList ();
46
+ },
47
+ transition ({ detail: { dx } }) {
48
+ this .$refs .tabs .setDx (dx);
26
49
},
27
- // 只有onReady生命周期才能调用refs操作组件
28
- onReady () {
29
- // 得到整个组件对象,内部图片列表变量为"lists"
30
- this .lists = this .$refs .uUpload .lists ;
50
+ animationfinish ({ detail: { current } }) {
51
+ this .$refs .tabs .setFinishCurrent (current);
52
+ this .swiperCurrent = current;
53
+ this .current = current;
54
+ },
55
+
56
+ // 数据请求
57
+ // post示例
58
+ // sumbitByPost() {
59
+ // this.$u.post('http://10.28.83.111:59694/formMessage', {
60
+ // username:this.loginForm.username,
61
+ // password:md5(this.loginForm.password).toUpperCase(),
62
+ // }).then(res => {
63
+ // // res为服务端返回的数据
64
+
65
+ // })
66
+ // },
67
+ sendInfo (){
68
+ let params = {
69
+ username: this .loginForm .username ,
70
+ password: md5 (this .loginForm .password ).toUpperCase (),
71
+ }
72
+ let headers= {
73
+ " Content-Type" : " application/x-www-form-urlencoded" ,
74
+ // "Token":`this.userToken` //设置token,保证每一个用户进入系统的安全性
75
+ }
76
+ uni .request ({
77
+ url: ` http://10.28.83.111:59694/formMessage` ,
78
+ method: ' POST' ,
79
+ header: headers,
80
+ data: params,
81
+ success : (res )=> {
82
+
83
+ },
84
+ fail : (err )=> {
85
+
86
+ }
87
+ })
31
88
}
89
+
90
+
91
+
32
92
}
93
+ };
33
94
</script >
34
95
35
- <style lang="scss">
36
- .wrap {
37
- padding : 24 rpx;
96
+ <style >
97
+ /* #ifndef H5 */
98
+ page {
99
+ height : 100% ;
100
+ background-color : #f2f2f2 ;
101
+ }
102
+ /* #endif */
103
+ </style >
104
+
105
+ <style lang="scss" scoped>
106
+ .order {
107
+ width : 710 rpx;
108
+ background-color : #ffffff ;
109
+ margin : 20 rpx auto ;
110
+ border-radius : 20 rpx;
111
+ box-sizing : border-box ;
112
+ padding : 20 rpx;
113
+ font-size : 28 rpx;
114
+ .top {
115
+ display : flex ;
116
+ justify-content : space-between ;
117
+ .left {
118
+ display : flex ;
119
+ align-items : center ;
120
+ .store {
121
+ margin : 0 10 rpx;
122
+ font-size : 32 rpx;
123
+ font-weight : bold ;
124
+ }
125
+ }
126
+ .right {
127
+ // color: $u-type-warning-dark;
128
+ color : #F29100 ;
129
+ // color: #5098ff;
130
+ // color: #e5d001;
131
+ }
38
132
}
39
-
40
- .slot-btn {
41
- width : 341 rpx;
42
- height : 140 rpx;
133
+ .item {
43
134
display : flex ;
44
- justify-content : center ;
45
- align-items : center ;
46
- background : rgb (244 , 245 , 246 );
47
- border-radius : 10 rpx;
135
+ margin : 20 rpx 0 0 ;
136
+ .left {
137
+ margin-right : 20 rpx;
138
+ image {
139
+ width : 200 rpx;
140
+ height : 200 rpx;
141
+ border-radius : 10 rpx;
142
+ }
143
+ }
144
+ .content {
145
+ .title {
146
+ font-size : 28 rpx;
147
+ line-height : 50 rpx;
148
+ }
149
+ .type {
150
+ margin : 10 rpx 0 ;
151
+ font-size : 24 rpx;
152
+ color : $u-tips-color ;
153
+ }
154
+ .delivery-time {
155
+ color : #999999 ;
156
+ font-size : 24 rpx;
157
+ }
158
+ }
159
+ .right {
160
+ margin-left : 10 rpx;
161
+ padding-top : 20 rpx;
162
+ text-align : right ;
163
+ .decimal {
164
+ font-size : 24 rpx;
165
+ margin-top : 4 rpx;
166
+ }
167
+ .number {
168
+ color : $u-tips-color ;
169
+ font-size : 24 rpx;
170
+ }
171
+ }
48
172
}
49
-
50
- .slot-btn__hover {
51
- background-color : rgb (235 , 236 , 238 );
173
+ .total {
174
+ margin-top : 20 rpx;
175
+ text-align : right ;
176
+ font-size : 24 rpx;
177
+ .total-price {
178
+ font-size : 32 rpx;
179
+ }
52
180
}
53
-
54
- .pre-box {
181
+ .bottom {
55
182
display : flex ;
56
- align-items : center ;
183
+ margin-top : 40 rpx;
184
+ padding : 0 10 rpx;
57
185
justify-content : space-between ;
58
- flex-wrap : wrap ;
186
+ align-items : center ;
187
+ .btn {
188
+ line-height : 52 rpx;
189
+ width : 160 rpx;
190
+ border-radius : 26 rpx;
191
+ border : 2 rpx solid $u-border-color ;
192
+ font-size : 26 rpx;
193
+ text-align : center ;
194
+ color : $u-type-info-dark ;
195
+ }
196
+ .evaluate {
197
+ color : $u-type-warning-dark ;
198
+ border-color : $u-type-warning-dark ;
199
+ }
59
200
}
60
-
61
- .pre-item {
62
- flex : 0 0 48.5% ;
63
- border-radius : 10 rpx;
64
- height : 140 rpx;
65
- overflow : hidden ;
66
- position : relative ;
67
- margin-bottom : 20 rpx;
201
+ }
202
+ .centre {
203
+ text-align : center ;
204
+ margin : 200 rpx auto ;
205
+ font-size : 32 rpx;
206
+ image {
207
+ width : 250 rpx;
208
+ height : 300 rpx;
209
+ // margin-bottom: 20rpx;
68
210
}
69
-
70
- .pre-item-image {
71
- width : 100 % ;
72
- height : 140 rpx ;
211
+ .tips {
212
+ font-size : 24 rpx;
213
+ color : #999999 ;
214
+ margin-top : 20 rpx ;
73
215
}
74
- </style >
216
+
217
+ }
218
+ .wrap {
219
+ display : flex ;
220
+ flex-direction : column ;
221
+ height : calc (100vh - var (--window-top ));
222
+ width : 100% ;
223
+ }
224
+ .swiper-box {
225
+ flex : 1 ;
226
+ }
227
+ .swiper-item {
228
+ height : 100% ;
229
+ }
230
+ </style >
231
+
232
+
0 commit comments