-
Notifications
You must be signed in to change notification settings - Fork 2
/
Pitch.qml
342 lines (321 loc) · 12 KB
/
Pitch.qml
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
import QtQuick 2.0
Item {
id: itemPitch
width: parent.width
height: parent.height
z: 100
property string m_pitchName: ""
property int m_pitchId: 0
property date m_curDate: new Date()
Rectangle {
anchors.fill: parent
color: "#e8e8e7"
z: 101
}
HeadItem {
id: head
visible: true
z: 103
m_headTitle: "场地详情"
m_imgToolUrl: "images/icon/share.png"
onRetClicked: {
stackMain.pop()
}
}
Component.onCompleted: {
var day = m_curDate.getDay()
for(var i=day;i<20;i++) {
lModel.append({
"dateStr":m_curDate.getMonth() + "月" + i + "日",
"weekStr":"周六"
})
}
}
Flickable {
id: flick
z: 102
anchors.top: head.bottom
anchors.bottom: parent.bottom
width: parent.width
height: parent.height - head.height
contentWidth: width
contentHeight: rectInfo.height + rectList.height + rectJob.height + rectCall.height + rectMark.height + 20/800*parent.height*6
Rectangle {
id: rectInfo
color: "#ffffff"
width: parent.width
height: (imgPitch.height >= rectText.height ? imgPitch.height : rectText.height)
+ imgPitch.anchors.topMargin
+ txtListTit.height + txtListTit.anchors.topMargin
+ 10/800*itemPitch.height
Image {
id: imgPitch
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: 10/800*itemPitch.height
anchors.leftMargin: 10/480*itemPitch.width
source: "images/item_def.jpg"
width: 155/480*itemPitch.width
height: 116/480*itemPitch.width
}
Rectangle {
id: rectText
anchors.left: imgPitch.right
anchors.top: parent.top
anchors.leftMargin: 10/480*parent.width
anchors.topMargin: 10/800*itemPitch.height
width: 300/480*itemPitch.width
height: 122/800*itemPitch.width
Text {
id: txtName
width: parent.width
text: m_pitchName
font.pointSize: 16
color: "#333333"
font.family: "微软雅黑"
anchors.top: parent.top
anchors.topMargin: 3/112*parent.height
}
Image {
id: imgTip
source: "images/icon/tip.png"
width: 25
height: 25
anchors.top: txtTis.top
}
Text {
id: txtTis
text: "订场时请一定要购买保险,对队友负责,对家庭负责。"
width: parent.width - imgTip.width - anchors.leftMargin
color: "#666666"
font.family: "微软雅黑"
anchors.top: txtName.bottom
anchors.topMargin: 20/112*parent.height
anchors.left: imgTip.right
anchors.leftMargin: 10/480*itemPitch.width
font.pointSize: 16
wrapMode: Text.WrapAnywhere
}
}
Text {
anchors.top: imgPitch.height >= rectText.height ? imgPitch.bottom : rectText.bottom
anchors.left: parent.left
anchors.topMargin: 26/800*itemPitch.height
anchors.leftMargin: 10/480*itemPitch.width
font.pointSize: 20
id: txtListTit
text: qsTr("场次预定")
color: "#333333"
}
}
Rectangle {
id: rectList
width: parent.width
height: 160/800*itemPitch.height
anchors.top: rectInfo.bottom
color: "#e8e8e7"
ListView {
id: list
width: parent.width
height: 160/800*itemPitch.height
model: lModel
delegate: delegate
orientation: ListView.Horizontal
anchors.verticalCenter: parent.verticalCenter
Component {
id: delegate
Item {
height: 150/800*itemPitch.height
width: 110/480*itemPitch.width
Rectangle {
anchors.fill: parent
anchors.margins: 6/480*itemPitch.width
color: "#ffffff"
radius: 5/480*itemPitch.width
Text {
id: txtWeek
anchors.horizontalCenter: parent.horizontalCenter
color: "#333333"
anchors.top: parent.top
anchors.topMargin: 14/800*itemPitch.height
font.pointSize: 16
text: weekStr
}
Text {
id: txtDate
anchors.horizontalCenter: parent.horizontalCenter
color: "#999999"
anchors.top: txtWeek.bottom
anchors.topMargin: 7///800*itemPitch.height
text: dateStr
}
Rectangle {
anchors.top: txtDate.bottom
anchors.topMargin: 7///800*itemPitch.height
border.color: "red"
border.width: 1
radius: 3/480*itemPitch.width
anchors.horizontalCenter: parent.horizontalCenter
width: txtVePost.width + 10
height: txtVePost.height + 5
Text {
id: txtVePost
color: "red"
anchors.centerIn: parent
text: "预定"
font.pointSize: 16
}
MouseArea {
anchors.fill: parent
onClicked: {
console.log("PitchId: " + m_pitchId)
}
}
}
}
}
}
ListModel {
id: lModel
}
}
}
Rectangle {
id: rectJob
anchors.top: rectList.bottom
color: "#ffffff"
height: txtJob.height + 40
width: parent.width
Text {
id: txtJob
font.pointSize: 18
color: "#666666"
anchors.left: parent.left
anchors.leftMargin: 10/480*parent.width
anchors.verticalCenter: parent.verticalCenter
text: "散客招募"
}
Text {
text: ">"
anchors.right: parent.right
anchors.rightMargin: 10/480*parent.width
anchors.verticalCenter: parent.verticalCenter
font.pointSize: 18
color: "#999999"
}
MouseArea {
anchors.fill: parent
onClicked: {
}
}
}
Rectangle {
id: rectCall
anchors.top: rectJob.bottom
anchors.topMargin: 20/800*itemPitch.height
width: parent.width
height: txtPhone.height + txtPhone.anchors.topMargin*2 + txtAddr.height + 20/800*itemPitch.height*2 + 2
color: "#ffffff"
Image {
id: imgPhone
source: "images/icon/phone.png"
height: txtPhone.height
width: height
anchors.bottom: txtPhone.bottom
x: txtJob.x
}
Text {
id: txtPhone
text: "13807799097"
anchors.left: imgPhone.right
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 20/800*itemPitch.height
color: "#666666"
font.pointSize: 18
}
Text {
text: ">"
color: "#999999"
font.pointSize: 18
anchors.right: parent.right
anchors.rightMargin: 10/480*parent.width
anchors.bottom: txtPhone.bottom
}
Rectangle {
id: line_1
anchors.top: txtPhone.bottom
anchors.topMargin: 20/800*itemPitch.height
height: 2
color: "#E8E8E7"
width: parent.width - 16/480*itemPitch.width
}
Image {
id: imgPos
source: "images/icon/mark_g.png"
height: imgPhone.height
width: imgPhone.width
y: txtAddr.y + txtAddr.height/2 - height/2
x: txtJob.x
}
Text {
id: txtAddr
text: "北海市海城区西藏路108号银河科技园后面场地"
anchors.left: imgPos.right
anchors.leftMargin: 20
anchors.top: line_1.bottom
anchors.topMargin: 20/800*itemPitch.height
color: "#666666"
font.pointSize: 18
width: parent.width - imgPos.width - txtJob.anchors.leftMargin - imgGoto.width - imgGoto.anchors.rightMargin - 40
wrapMode: Text.WrapAnywhere
}
Image {
id: imgGoto
anchors.right: parent.right
anchors.rightMargin: 10/480*parent.width
anchors.bottom: imgPos.bottom
width: 95
height: 23
source: "images/goto.png"
}
}
Rectangle {
id: rectMark
anchors.top: rectCall.bottom
anchors.topMargin: 20/800*parent.height
color: "#ffffff"
height: txtMarkTit.height + 2 + txtSumy.height + 20/800*itemPitch.height*4
width: parent.width
Text {
id: txtMarkTit
font.pointSize: 18
color: "#333333"
anchors.left: parent.left
anchors.leftMargin: 10/480*parent.width
anchors.top: parent.top
anchors.topMargin: 20/800*itemPitch.height
text: "场地简介"
}
Rectangle {
id: line_2
anchors.top: txtMarkTit.bottom
anchors.topMargin: 20/800*itemPitch.height
height: 2
color: "#E8E8E7"
width: parent.width - 16/480*itemPitch.width
}
Text {
id: txtSumy
text: "有灯光,假草,楼下就是停车场,后背靠就是银河科技园区,进出方便,有小卖部,买东西方便。"
x: txtMarkTit.x
anchors.top: line_2.bottom
anchors.topMargin: 20/800*itemPitch.height
color: "#999999"
font.pointSize: 17
width: parent.width - 16/480*itemPitch.width
wrapMode: Text.WrapAnywhere
}
}
}
}