@@ -206,9 +206,9 @@
206 206
 
207 207
             <LinearLayout
208 208
                 android:id="@+id/layout_message_part"
209
-                android:layout_marginTop="8dp"
210 209
                 android:layout_width="match_parent"
211 210
                 android:layout_height="wrap_content"
211
+                android:layout_marginTop="8dp"
212 212
                 android:background="@color/background_white"
213 213
                 android:orientation="vertical">
214 214
 
@@ -221,11 +221,10 @@
221 221
                         android:layout_width="wrap_content"
222 222
                         android:layout_height="wrap_content"
223 223
                         android:layout_gravity="center_vertical"
224
-                        android:text="@string/message"
225 224
                         android:paddingLeft="10dp"
225
+                        android:text="@string/message"
226 226
                         android:textColor="@color/_7B8088"
227
-                        android:textSize="14sp"
228
-                        />
227
+                        android:textSize="14sp" />
229 228
                 </LinearLayout>
230 229
 
231 230
             </LinearLayout>
@@ -233,68 +232,138 @@
233 232
             <View
234 233
                 android:layout_width="match_parent"
235 234
                 android:layout_height="1px"
236
-                android:background="@color/text_hint_grey_color"/>
235
+                android:background="@color/text_hint_grey_color" />
237 236
 
238 237
             <LinearLayout
239 238
                 android:layout_width="match_parent"
240 239
                 android:layout_height="44dp"
241
-                android:paddingLeft="10dp"
242
-                android:paddingRight="6dp"
243 240
                 android:background="@color/background_white"
244
-                android:orientation="horizontal">
241
+                android:orientation="horizontal"
242
+                android:paddingLeft="10dp"
243
+                android:paddingRight="6dp">
245 244
 
246 245
                 <TextSwitcher
247 246
                     android:id="@+id/switcher_system_msg"
248 247
                     android:layout_width="0dp"
249
-                    android:inAnimation="@android:anim/slide_in_left"
250
-                    android:outAnimation="@android:anim/slide_out_right"
251 248
                     android:layout_height="wrap_content"
252 249
                     android:layout_gravity="center_vertical"
253
-                    android:layout_weight="1"/>
250
+                    android:layout_weight="1"
251
+                    android:inAnimation="@android:anim/slide_in_left"
252
+                    android:outAnimation="@android:anim/slide_out_right" />
254 253
 
255 254
                 <ImageView
256 255
                     android:layout_width="10dp"
257 256
                     android:layout_height="18dp"
258 257
                     android:layout_gravity="center_vertical"
259
-                    android:src="@drawable/arrow_right"/>
258
+                    android:src="@drawable/arrow_right" />
260 259
 
261 260
             </LinearLayout>
262 261
 
263 262
             <View
264 263
                 android:layout_width="match_parent"
265 264
                 android:layout_height="1px"
266
-                android:background="@color/text_hint_grey_color"/>
265
+                android:background="@color/text_hint_grey_color" />
267 266
 
268 267
             <LinearLayout
269 268
                 android:layout_width="match_parent"
270 269
                 android:layout_height="44dp"
271
-                android:paddingLeft="10dp"
272
-                android:paddingRight="6dp"
273 270
                 android:background="@color/background_white"
274
-                android:orientation="horizontal">
271
+                android:orientation="horizontal"
272
+                android:paddingLeft="10dp"
273
+                android:paddingRight="6dp">
275 274
 
276 275
                 <TextSwitcher
277 276
                     android:id="@+id/switcher_order_msg"
278 277
                     android:layout_width="0dp"
279 278
                     android:layout_height="wrap_content"
280
-                    android:inAnimation="@android:anim/slide_in_left"
281
-                    android:outAnimation="@android:anim/slide_out_right"
282 279
                     android:layout_gravity="center_vertical"
283
-                    android:layout_weight="1"/>
280
+                    android:layout_weight="1"
281
+                    android:inAnimation="@android:anim/slide_in_left"
282
+                    android:outAnimation="@android:anim/slide_out_right" />
284 283
 
285 284
                 <ImageView
286 285
                     android:layout_width="10dp"
287 286
                     android:layout_height="18dp"
288 287
                     android:layout_gravity="center_vertical"
289
-                    android:src="@drawable/arrow_right"/>
288
+                    android:src="@drawable/arrow_right" />
290 289
 
291 290
             </LinearLayout>
292 291
 
293 292
             <LinearLayout
294
-                android:id="@+id/layout_box_part"
293
+                android:id="@+id/layout_upload_part"
294
+                android:layout_width="match_parent"
295
+                android:layout_height="wrap_content"
295 296
                 android:layout_marginTop="8dp"
297
+                android:background="@color/background_white"
298
+                android:orientation="vertical">
299
+
300
+                <LinearLayout
301
+                    android:layout_width="match_parent"
302
+                    android:layout_height="32dp"
303
+                    android:orientation="horizontal">
304
+
305
+                    <TextView
306
+                        android:layout_width="wrap_content"
307
+                        android:layout_height="wrap_content"
308
+                        android:layout_gravity="center_vertical"
309
+                        android:paddingLeft="10dp"
310
+                        android:text="@string/upload_setting"
311
+                        android:textColor="@color/_7B8088"
312
+                        android:textSize="14sp" />
313
+                </LinearLayout>
314
+
315
+                <View
316
+                    android:layout_width="match_parent"
317
+                    android:layout_height="1px"
318
+                    android:background="@color/text_hint_grey_color" />
319
+
320
+                <RadioGroup
321
+                    android:id="@+id/rg_upload_settings"
322
+                    android:layout_width="match_parent"
323
+                    android:layout_height="44dp"
324
+                    android:orientation="horizontal"
325
+                    android:gravity="center">
326
+
327
+                    <RadioButton
328
+                        android:id="@+id/rb_upload_fast"
329
+                        android:layout_width="wrap_content"
330
+                        android:layout_height="wrap_content"
331
+                        android:layout_marginLeft="10dp"
332
+                        android:layout_marginRight="10dp"
333
+                        android:textColor="@color/dark_grey"
334
+                        android:textSize="16sp"
335
+                        android:text="@string/upload_fast"/>
336
+
337
+                    <RadioButton
338
+                        android:id="@+id/rb_upload_normal"
339
+                        android:checked="true"
340
+                        android:layout_width="wrap_content"
341
+                        android:layout_height="wrap_content"
342
+                        android:layout_marginLeft="10dp"
343
+                        android:layout_marginRight="10dp"
344
+                        android:textColor="@color/dark_grey"
345
+                        android:textSize="16sp"
346
+                        android:text="@string/upload_normal"/>
347
+
348
+
349
+                    <RadioButton
350
+                        android:id="@+id/rb_upload_slow"
351
+                        android:layout_width="wrap_content"
352
+                        android:layout_height="wrap_content"
353
+                        android:layout_marginLeft="10dp"
354
+                        android:layout_marginRight="10dp"
355
+                        android:textColor="@color/dark_grey"
356
+                        android:textSize="16sp"
357
+                        android:text="@string/upload_slow"/>
358
+                </RadioGroup>
359
+
360
+            </LinearLayout>
361
+
362
+            <LinearLayout
363
+                android:id="@+id/layout_box_part"
296 364
                 android:layout_width="match_parent"
297 365
                 android:layout_height="wrap_content"
366
+                android:layout_marginTop="8dp"
298 367
                 android:background="@color/background_white"
299 368
                 android:orientation="vertical">
300 369
 
@@ -307,17 +376,16 @@
307 376
                         android:layout_width="wrap_content"
308 377
                         android:layout_height="wrap_content"
309 378
                         android:layout_gravity="center_vertical"
310
-                        android:text="@string/box_setting"
311 379
                         android:paddingLeft="10dp"
380
+                        android:text="@string/box_setting"
312 381
                         android:textColor="@color/_7B8088"
313
-                        android:textSize="14sp"
314
-                        />
382
+                        android:textSize="14sp" />
315 383
                 </LinearLayout>
316 384
 
317 385
                 <View
318 386
                     android:layout_width="match_parent"
319 387
                     android:layout_height="1px"
320
-                    android:background="@color/text_hint_grey_color"/>
388
+                    android:background="@color/text_hint_grey_color" />
321 389
 
322 390
                 <LinearLayout
323 391
                     android:layout_width="match_parent"
@@ -328,29 +396,27 @@
328 396
                         android:layout_width="wrap_content"
329 397
                         android:layout_height="wrap_content"
330 398
                         android:layout_gravity="center_vertical"
331
-                        android:text="@string/box_no"
332 399
                         android:paddingLeft="10dp"
400
+                        android:text="@string/box_no"
333 401
                         android:textColor="@color/dark_grey"
334
-                        android:textSize="16sp"
335
-                        />
402
+                        android:textSize="16sp" />
336 403
 
337 404
                     <TextView
338 405
                         android:id="@+id/tv_box_num"
339 406
                         android:layout_width="0dp"
340
-                        android:layout_weight="1"
341 407
                         android:layout_height="match_parent"
408
+                        android:layout_weight="1"
342 409
                         android:gravity="center_vertical|right"
343
-                        android:text="SN89757"
344 410
                         android:paddingRight="10dp"
411
+                        android:text="SN89757"
345 412
                         android:textColor="@color/grey"
346
-                        android:textSize="14sp"
347
-                        />
413
+                        android:textSize="14sp" />
348 414
                 </LinearLayout>
349 415
 
350 416
                 <View
351 417
                     android:layout_width="match_parent"
352 418
                     android:layout_height="1px"
353
-                    android:background="@color/text_hint_grey_color"/>
419
+                    android:background="@color/text_hint_grey_color" />
354 420
 
355 421
                 <LinearLayout
356 422
                     android:layout_width="match_parent"
@@ -361,32 +427,30 @@
361 427
                         android:layout_width="wrap_content"
362 428
                         android:layout_height="wrap_content"
363 429
                         android:layout_gravity="center_vertical"
364
-                        android:text="@string/box_status"
365 430
                         android:paddingLeft="10dp"
431
+                        android:text="@string/box_status"
366 432
                         android:textColor="@color/dark_grey"
367
-                        android:textSize="16sp"
368
-                        />
433
+                        android:textSize="16sp" />
369 434
 
370 435
                     <TextView
371 436
                         android:id="@+id/tv_box_status"
372 437
                         android:layout_width="0dp"
373
-                        android:layout_weight="1"
374 438
                         android:layout_height="match_parent"
439
+                        android:layout_weight="1"
375 440
                         android:gravity="center_vertical|right"
376
-                        android:text="@string/connected_device"
377 441
                         android:paddingRight="10dp"
442
+                        android:text="@string/connected_device"
378 443
                         android:textColor="@color/grey"
379
-                        android:textSize="14sp"
380
-                        />
444
+                        android:textSize="14sp" />
381 445
                 </LinearLayout>
382 446
 
383 447
             </LinearLayout>
384 448
 
385 449
             <LinearLayout
386 450
                 android:id="@+id/layout_price_part"
387
-                android:layout_marginTop="8dp"
388 451
                 android:layout_width="match_parent"
389 452
                 android:layout_height="wrap_content"
453
+                android:layout_marginTop="8dp"
390 454
                 android:background="@color/background_white"
391 455
                 android:orientation="vertical">
392 456
 
@@ -394,15 +458,15 @@
394 458
                     android:id="@+id/layout_price_setting"
395 459
                     android:layout_width="match_parent"
396 460
                     android:layout_height="44dp"
397
-                    android:paddingRight="6dp"
398
-                    android:orientation="horizontal">
461
+                    android:orientation="horizontal"
462
+                    android:paddingRight="6dp">
399 463
 
400 464
                     <TextView
401 465
                         android:layout_width="wrap_content"
402 466
                         android:layout_height="wrap_content"
403 467
                         android:layout_gravity="center_vertical"
404
-                        android:text="@string/price_manage"
405 468
                         android:paddingLeft="10dp"
469
+                        android:text="@string/price_manage"
406 470
                         android:textColor="@color/dark_grey"
407 471
                         android:textSize="16sp" />
408 472
 
@@ -411,47 +475,47 @@
411 475
                         android:layout_width="0dp"
412 476
                         android:layout_height="wrap_content"
413 477
                         android:layout_gravity="center_vertical"
414
-                        android:text="@string/price_manage"
478
+                        android:layout_weight="1"
415 479
                         android:paddingLeft="10dp"
480
+                        android:text="@string/price_manage"
416 481
                         android:textColor="@color/grey"
417
-                        android:textSize="14sp"
418
-                        android:layout_weight="1"/>
482
+                        android:textSize="14sp" />
419 483
 
420 484
                     <ImageView
421 485
                         android:layout_width="10dp"
422 486
                         android:layout_height="18dp"
423 487
                         android:layout_gravity="center_vertical"
424
-                        android:src="@drawable/arrow_right"/>
488
+                        android:src="@drawable/arrow_right" />
425 489
 
426 490
                 </LinearLayout>
427 491
 
428 492
                 <View
429 493
                     android:layout_width="match_parent"
430 494
                     android:layout_height="1px"
431
-                    android:background="@color/text_hint_grey_color"/>
495
+                    android:background="@color/text_hint_grey_color" />
432 496
 
433 497
                 <LinearLayout
434 498
                     android:id="@+id/layout_price_introduction"
435 499
                     android:layout_width="match_parent"
436 500
                     android:layout_height="44dp"
437
-                    android:paddingRight="6dp"
438
-                    android:orientation="horizontal">
501
+                    android:orientation="horizontal"
502
+                    android:paddingRight="6dp">
439 503
 
440 504
                     <TextView
441 505
                         android:layout_width="0dp"
442 506
                         android:layout_height="wrap_content"
443 507
                         android:layout_gravity="center_vertical"
444
-                        android:text="@string/platform_price_rule"
508
+                        android:layout_weight="1"
445 509
                         android:paddingLeft="10dp"
510
+                        android:text="@string/platform_price_rule"
446 511
                         android:textColor="@color/dark_grey"
447
-                        android:textSize="16sp"
448
-                        android:layout_weight="1"/>
512
+                        android:textSize="16sp" />
449 513
 
450 514
                     <ImageView
451 515
                         android:layout_width="10dp"
452 516
                         android:layout_height="18dp"
453 517
                         android:layout_gravity="center_vertical"
454
-                        android:src="@drawable/arrow_right"/>
518
+                        android:src="@drawable/arrow_right" />
455 519
 
456 520
                 </LinearLayout>
457 521
 

+ 6 - 0
app/src/main/res/values/strings.xml

@@ -165,4 +165,10 @@
165 165
     <string name="can_not_delete">该照片已在上传队列,无法删除</string>
166 166
 
167 167
     <string name="sdcard_fail">手机sd卡错误</string>
168
+
169
+    <string name="upload_setting">上传延时设置</string>
170
+
171
+    <string name="upload_slow">长</string>
172
+    <string name="upload_normal">中</string>
173
+    <string name="upload_fast">短</string>
168 174
 </resources>

kodo - Gogs: Go Git Service

Nessuna descrizione

tourguide_views.py 3.0KB

    # -*- coding: utf-8 -*- from __future__ import division from django.conf import settings from django.db import transaction from django_logit import logit from django_response import response from account.models import TourGuideInfo, UserInfo from utils.error.errno_utils import TourGuideStatusCode from utils.redis.rprofile import set_profile_info @logit def tourguide_submit_api(request): """ 导游信息提交 """ unionid = request.POST.get('unionid', '') openid = request.POST.get('openid', '') phone = request.POST.get('phone', '') serverIds = request.POST.getlist('serverIds[]', []) # TODO: get tour guide photo from wx server if TourGuideInfo.objects.filter(phone=phone).exclude(unionid=unionid).exists(): return response(TourGuideStatusCode.TOURGUIDE_PHONE_ALREADY_EXISTS) fields = { 'name': request.POST.get('name', ''), 'sex': int(request.POST.get('sex', 1)), 'phone': phone, 'location': request.POST.get('location', ''), 'no': request.POST.get('no', ''), 'user_status': TourGuideInfo.UNVERIFIED, } tourguide, created = TourGuideInfo.objects.get_or_create(unionid=unionid, defaults=fields) # 状态为 UNVERIFIED 的允许修改, 其他需要登录导游 APP 进行信息的修改 if tourguide.user_status not in [TourGuideInfo.UNVERIFIED, TourGuideInfo.REFUSED]: return response(TourGuideStatusCode.TOURGUIDE_ALREADY_NOT_UNVERIFIED) if not created: for key, value in fields.iteritems(): setattr(tourguide, key, value) tourguide.save() return response(200, 'Submit Success', u'提交成功', {}) @logit @transaction.atomic def tourguide_wx_authorize_api(request): try: user = UserInfo.objects.select_for_update().get(unionid=request.POST.get('unionid', ''), istourguide=True, status=True) except UserInfo.DoesNotExist: return response(TourGuideStatusCode.TOURGUIDE_NOT_FOUND) # 用户是否激活 if user.user_status != UserInfo.ACTIVATED: return response(TourGuideStatusCode.TOURGUIDE_NOT_ACTIVATED) # Set User Key's Value user.openid_tourguide = request.POST.get('openid', '') user.sex = request.POST.get('sex', 0) user.nickname = request.POST.get('nickname', '') or request.POST.get('screen_name', '') user.avatar = request.POST.get('headimgurl', '') or request.POST.get('profile_image_url', '') user.country = request.POST.get('country', '') user.province = request.POST.get('province', '') user.city = request.POST.get('city', '') user.save() set_profile_info(user) return response(200, 'Tour Guide Login Success', u'导游登录成功', user.data) @logit def tourguide_guest_login_api(request): try: user = UserInfo.objects.get(unionid=settings.PAI2_TOURGUIDE_GUEST_UNIONID, istourguide=True, status=True) except UserInfo.DoesNotExist: return response(TourGuideStatusCode.TOURGUIDE_NOT_FOUND) return response(200, 'Tour Guide Login Success', u'导游登录成功', user.data)