zxy 4 years ago
parent
commit
036f8c2d85

+ 0 - 6
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/clock/ClockResultActivity.java

@@ -89,17 +89,11 @@ public class ClockResultActivity extends BaseActivity<ClockResultPresenter> impl
             if (!TextUtils.isEmpty(bean.getEndPunchClock())) {//下班卡
                 tvResult.setText(R.string.clock_out_success);
                 tvTime.setText("打卡时间 " + DateUtils.getFormatStrToHHmm(bean.getEndPunchClock()));
-                tvClockIn.setVisibility(View.GONE);
-                llClockOut.setVisibility(View.VISIBLE);
                 tvHour.setText(bean.getDuration());
                 tvDayRepay.setText(bean.getTodayMoney());
-                llMoney.setVisibility(View.VISIBLE);
             } else {//上班卡
                 tvResult.setText(R.string.clock_in_success);
                 tvTime.setText("打卡时间 " + DateUtils.getFormatStrToHHmm(bean.getStartPunchClock()));
-                llMoney.setVisibility(View.GONE);
-                tvClockIn.setVisibility(View.VISIBLE);
-                llClockOut.setVisibility(View.GONE);
             }
         }
     }

+ 3 - 10
app/src/main/java/com/tongyu/luck/happywork/ui/fragment/cclient/ClockFragment.java

@@ -231,12 +231,9 @@ public class ClockFragment extends BaseFragment<ClockFragmentPresenter> implemen
                 cvAuthentication.setVisibility(View.GONE);
                 rlTodayMoney.setVisibility(View.GONE);
                 tvRelocation.setVisibility(View.GONE);
+
+                tvName.setText(AppCacheManager.getInstance().getMemberModel() != null && !TextUtils.isEmpty(AppCacheManager.getInstance().getMemberModel().getRealName()) ? AppCacheManager.getInstance().getMemberModel().getRealName() : "开心用户");
                 ImageLoaderUtil.getInstance().loadCircleImage(AppCacheManager.getInstance().getLoginModel().getHeadImgUrl(), R.mipmap.ic_default_header, ivHeader);
-                if (!TextUtils.isEmpty(AppCacheManager.getInstance().getLoginModel().getNickName())) {
-                    tvName.setText(AppCacheManager.getInstance().getLoginModel().getNickName());
-                } else {
-                    tvName.setText("开心用户");
-                }
 
                 tvWorkHour.setText(infoBean.getSumDuration());
                 tvWeekRepay.setText(infoBean.getSumMoney());
@@ -264,6 +261,7 @@ public class ClockFragment extends BaseFragment<ClockFragmentPresenter> implemen
                     tvAuthentication.setText(R.string.me_wait_authentication);
                     endLocation();
                 } else {//认证成功
+                    startLocation();
                     tvAuthentication.setText(R.string.me_yes_authentication);
                     if (infoBean.getClockType() == AppConstant.CLOCK_TYPE_START) {//上班打卡
                         if ("未完成".equals(infoBean.getStartPunch())) {//如果是未完成代表可以打上班卡
@@ -271,27 +269,23 @@ public class ClockFragment extends BaseFragment<ClockFragmentPresenter> implemen
                             vClock.setBackgroundResource(R.mipmap.ic_clock_btn_1);
                             tvClockRangeState.setText(R.string.have_in_clock_range);
                             vClockRangeState.setBackgroundResource(R.mipmap.ic_clock_tips_range_in);
-                            startLocation();
                         } else {//如果存在上班卡,表示已打上班卡,下班时间未到不可打下班卡
                             vClock.setEnabled(false);
                             vClock.setBackgroundResource(R.mipmap.ic_clock_btn_2_2);
                             tvClockRangeState.setText("上班" + infoBean.getDailyAvailableMinHour() + "小时候才能进行上班打卡");
                             vClockRangeState.setBackgroundResource(R.mipmap.ic_clock_tips_remind);
-                            endLocation();
                         }
                     } else if (infoBean.getClockType() == AppConstant.CLOCK_TYPE_END) {//下班打卡
                         vClock.setEnabled(true);
                         vClock.setBackgroundResource(R.mipmap.ic_clock_btn_2_1);
                         tvClockRangeState.setText(R.string.have_in_clock_range);
                         vClockRangeState.setBackgroundResource(R.mipmap.ic_clock_tips_range_in);
-                        startLocation();
                     } else if (infoBean.getClockType() == AppConstant.CLOCK_TYPE_MORE_THAN) {//超出范围
                         vClock.setEnabled(false);
                         vClock.setBackgroundResource(R.mipmap.ic_clock_btn_4);
                         tvClockRangeState.setText(R.string.please_in_company);
                         vClockRangeState.setBackgroundResource(R.mipmap.ic_clock_tips_remind);
                         tvRelocation.setVisibility(View.VISIBLE);
-                        endLocation();
                     } else if (infoBean.getClockType() == AppConstant.CLOCK_TYPE_FINISH) {//完成
                         vClock.setEnabled(false);
                         vClock.setBackgroundResource(R.mipmap.ic_clock_btn_3);
@@ -301,7 +295,6 @@ public class ClockFragment extends BaseFragment<ClockFragmentPresenter> implemen
                             tvTodayMoney.setText(infoBean.getTodayMoney());
                             rlTodayMoney.setVisibility(View.VISIBLE);
                         }
-                        endLocation();
                     }
                 }
             }

+ 4 - 3
app/src/main/res/layout/activity_clock_result.xml

@@ -96,11 +96,11 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="10dp"
                     android:gravity="center"
+                    android:visibility="gone"
                     android:lineSpacingExtra="10dp"
                     android:text="@string/clock_in_result_tips"
                     android:textColor="@color/text_black"
-                    android:textSize="@dimen/px42_14sp"
-                    android:visibility="gone" />
+                    android:textSize="@dimen/px42_14sp" />
 
                 <LinearLayout
                     android:id="@+id/ll_clock_out"
@@ -143,7 +143,8 @@
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:gravity="center_horizontal"
-                        android:orientation="horizontal">
+                        android:orientation="horizontal"
+                        android:visibility="gone">
 
 
                         <TextView