zhaoyi před 8 roky
rodič
revize
9c5f43c9e4

+ 4 - 1
.idea/misc.xml

@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
   <component name="NullableNotNullManager">
     <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
@@ -24,7 +27,7 @@
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 2 - 1
.idea/modules.xml

@@ -2,7 +2,8 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://D:\Dlg\AndroidStudioProjects\small_sheep_android\SamllSheepPlugin.iml" filepath="D:\Dlg\AndroidStudioProjects\small_sheep_android\SamllSheepPlugin.iml" />
+      <module fileurl="file://$PROJECT_DIR$/SamllSheepPlugin.iml" filepath="$PROJECT_DIR$/SamllSheepPlugin.iml" />
+      <module fileurl="file://D:/Dlg/AndroidStudioProjects/small_sheep_android/SamllSheepPlugin.iml" filepath="D:/Dlg/AndroidStudioProjects/small_sheep_android/SamllSheepPlugin.iml" />
       <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
       <module fileurl="file://$PROJECT_DIR$/small_sheep_android.iml" filepath="$PROJECT_DIR$/small_sheep_android.iml" />
     </modules>

+ 1 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/net/SheepCallback.java

@@ -68,6 +68,7 @@ public abstract class SheepCallback<T> implements Callback {
 
     public void otherCode(int code, String string) {
         Toast.makeText(SheepApp.mContext, string, Toast.LENGTH_SHORT).show();
+        failure(new IOException(string));
     }
 
     public abstract void success(T t);

+ 2 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/LoginActivity.java

@@ -108,7 +108,8 @@ public class LoginActivity extends BaseActivity {
         req.state = "small_sheep_auther";
         SheepApp.mWxapi.sendReq(req);*/
 
-        SpUtils.login(this, "4ff3898049503dfb7ca61da4dc31cc91");
+//        SpUtils.login(this, "4ff3898049503dfb7ca61da4dc31cc91");
+        SpUtils.login(this, "123456");
     }
 
 

+ 18 - 7
app/src/main/java/com/sheep/jiuyan/samllsheep/page/MainActivity.java

@@ -25,6 +25,7 @@ import com.sheep.jiuyan.samllsheep.page.fragment.FgtMainPageTask;
 import com.sheep.jiuyan.samllsheep.page.view.RappTabLayout;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PremissUtils;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import java.util.ArrayList;
@@ -160,6 +161,16 @@ public class MainActivity extends BaseActivity {
                 startActivity(intent);
             }
         });
+        findViewById(R.id.txt_get_cash).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if (SpUtils.isLogin(getApplicationContext())) {
+                    Intent intent = new Intent(MainActivity.this, WithdrawActivity.class);
+                    intent.putExtra("money", G.mUser.getBalance());
+                    startActivity(intent);
+                }
+            }
+        });
     }
 
     private void reSetSwipeRefreshLayout() {
@@ -207,13 +218,13 @@ public class MainActivity extends BaseActivity {
                 .setupWithViewPager(mViewPager, R.layout.tab_ripple);
 
         TitleBarUtils.getInstance()
-                .setTitleFinish(this)
-                .setRightImgBotton(this, R.drawable.set, new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        G.showToast("点设置");
-                    }
-                });
+                .setTitleFinish(this);
+//                .setRightImgBotton(this, R.drawable.set, new View.OnClickListener() {
+//                    @Override
+//                    public void onClick(View view) {
+//                        G.showToast("点设置");
+//                    }
+//                });
     }
 
     @Override

+ 3 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/UserCenterActivity.java

@@ -13,6 +13,7 @@ import com.sheep.jiuyan.samllsheep.net.NetManager;
 import com.sheep.jiuyan.samllsheep.net.SheepCallback;
 import com.sheep.jiuyan.samllsheep.net.Url;
 import com.sheep.jiuyan.samllsheep.page.entry.User;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
@@ -75,6 +76,7 @@ public class UserCenterActivity extends BaseActivity implements View.OnClickList
             @Override
             public void success(User user) {
                 mUser = user;
+                G.mUser = user;
                 mTvNick.setText(user.getNickName());
                 mTvMoney.setText(user.getBalance());
                 mTvCode.setText("我的邀请码  " + user.getInvitationCode());
@@ -97,7 +99,7 @@ public class UserCenterActivity extends BaseActivity implements View.OnClickList
         mLlMoneyHostroy = (LinearLayout) findViewById(R.id.ll_money_hostroy);
 
         TitleBarUtils.getInstance()
-                .setTitle(this,"个人中心")
+                .setTitle(this, "个人中心")
                 .setTitleFinish(this);
     }
 

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/WxAccountDetail.java

@@ -59,7 +59,7 @@ public class WxAccountDetail extends BaseActivity {
     public void initData() {
         HashMap<String, String> map = new HashMap<>();
         map.put("wx_open_id", SpUtils.getOpenId(this));
-        map.put("wx_id", SpUtils.getOpenId(this));
+        map.put("wx_id", "39");
         NetManager.get(Url.TASK_LIST, map, this, new SheepCallback<List<WxDetailList>>(this) {
             @Override
             public void success(List<WxDetailList> tasks) {

+ 8 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/page/entry/MoneyRecord.java

@@ -0,0 +1,8 @@
+package com.sheep.jiuyan.samllsheep.page.entry;
+
+/**
+ * Created by kemllor on 2018/1/17.
+ */
+
+public class MoneyRecord {
+}

+ 2 - 9
app/src/main/java/com/sheep/jiuyan/samllsheep/page/fragment/FgtMainPageOffline.java

@@ -98,16 +98,9 @@ public class FgtMainPageOffline extends BaseFragment {
                 reFreshView();
             }
 
-            //TODO 你的框架不知道哪个是失败必须执行的,要添加拒绝加载更多等
             @Override
-            public void onFailure(Call call, IOException e) {
-                super.onFailure(call, e);
-                mRecyleViewLoadMoreUtils.setmIsLoading(true);
-                reFreshView();
-            }
-
-            @Override
-            public void otherCode(int code, String string) {
+            public void failure(IOException e) {
+                super.failure(e);
                 mRecyleViewLoadMoreUtils.setmIsLoading(true);
                 reFreshView();
             }

+ 29 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/page/fragment/FgtMainPageTask.java

@@ -16,6 +16,8 @@ import com.sheep.jiuyan.samllsheep.net.NetManager;
 import com.sheep.jiuyan.samllsheep.net.SheepCallback;
 import com.sheep.jiuyan.samllsheep.net.Url;
 import com.sheep.jiuyan.samllsheep.page.DownloadActivity;
+import com.sheep.jiuyan.samllsheep.page.MoneyHistroyActivity;
+import com.sheep.jiuyan.samllsheep.page.TaskRecordActivity;
 import com.sheep.jiuyan.samllsheep.page.adapter.AdpMainActivity;
 import com.sheep.jiuyan.samllsheep.page.entry.TaskPublish;
 import com.sheep.jiuyan.samllsheep.page.entry.User;
@@ -77,6 +79,26 @@ public class FgtMainPageTask extends BaseFragment {
             }
         });
         initData(false);
+
+        findViewById(R.id.view_income_today)
+                .setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        Intent intent = new Intent(getActivity(), MoneyHistroyActivity.class);
+                        startActivity(intent);
+                    }
+                });
+        View.OnClickListener onClickListener=new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Intent intent = new Intent(getActivity(), TaskRecordActivity.class);
+                startActivity(intent);
+            }
+        };
+        findViewById(R.id.view_complete_today)
+                .setOnClickListener(onClickListener);
+        findViewById(R.id.view_history_record)
+                .setOnClickListener(onClickListener);
     }
 
 
@@ -191,6 +213,13 @@ public class FgtMainPageTask extends BaseFragment {
                 super.onFailure(call, e);
                 mRecyleViewLoadMoreUtils.setmIsLoading(true);
             }
+
+            @Override
+            public void failure(IOException e) {
+                super.failure(e);
+                mRecyleViewLoadMoreUtils.setmIsLoading(true);
+            }
+
             @Override
             public void otherCode(int code, String string) {
                 mRecyleViewLoadMoreUtils.setmIsLoading(true);

+ 35 - 30
app/src/main/res/layout/fgt_main_page_task.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-              xmlns:tools="http://schemas.android.com/tools"
-              android:layout_width="match_parent"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/white"
     android:orientation="vertical">
@@ -33,7 +32,7 @@
             android:text="1218"
             android:textColor="@color/orange_text_light"
             android:textSize="@dimen/text_size_3"
-            app:layout_constraintLeft_toRightOf="@+id/txt_fgt_main_page_task_income"
+            app:layout_constraintLeft_toRightOf="@id/txt_fgt_main_page_task_income"
             app:layout_constraintRight_toLeftOf="@+id/txt_fgt_main_page_task_remain"
             app:layout_constraintTop_toTopOf="parent" />
 
@@ -45,7 +44,8 @@
             android:text="128"
             android:textColor="@color/orange_text_light"
             android:textSize="@dimen/text_size_3"
-            app:layout_constraintLeft_toRightOf="@+id/txt_fgt_main_page_task_succ"
+            android:visibility="gone"
+            app:layout_constraintLeft_toRightOf="@id/txt_fgt_main_page_task_succ"
             app:layout_constraintRight_toLeftOf="@+id/txt_fgt_main_page_task_history"
             app:layout_constraintTop_toTopOf="parent" />
 
@@ -57,7 +57,7 @@
             android:text="128"
             android:textColor="@color/orange_text_light"
             android:textSize="@dimen/text_size_3"
-            app:layout_constraintLeft_toRightOf="@+id/txt_fgt_main_page_task_remain"
+            app:layout_constraintLeft_toRightOf="@id/txt_fgt_main_page_task_remain"
             app:layout_constraintRight_toRightOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
@@ -69,9 +69,9 @@
             android:text="今日收入"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_2"
-            app:layout_constraintLeft_toLeftOf="@+id/txt_fgt_main_page_task_income"
-            app:layout_constraintRight_toRightOf="@+id/txt_fgt_main_page_task_income"
-            app:layout_constraintTop_toBottomOf="@+id/txt_fgt_main_page_task_income" />
+            app:layout_constraintLeft_toLeftOf="@id/txt_fgt_main_page_task_income"
+            app:layout_constraintRight_toRightOf="@id/txt_fgt_main_page_task_income"
+            app:layout_constraintTop_toBottomOf="@id/txt_fgt_main_page_task_income" />
 
         <TextView
             android:layout_width="wrap_content"
@@ -80,9 +80,9 @@
             android:text="今日完成"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_2"
-            app:layout_constraintLeft_toLeftOf="@+id/txt_fgt_main_page_task_succ"
-            app:layout_constraintRight_toRightOf="@+id/txt_fgt_main_page_task_succ"
-            app:layout_constraintTop_toBottomOf="@+id/txt_fgt_main_page_task_income" />
+            app:layout_constraintLeft_toLeftOf="@id/txt_fgt_main_page_task_succ"
+            app:layout_constraintRight_toRightOf="@id/txt_fgt_main_page_task_succ"
+            app:layout_constraintTop_toBottomOf="@id/txt_fgt_main_page_task_income" />
 
         <TextView
             android:layout_width="wrap_content"
@@ -91,9 +91,10 @@
             android:text="剩余次数"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_2"
-            app:layout_constraintLeft_toLeftOf="@+id/txt_fgt_main_page_task_remain"
-            app:layout_constraintRight_toRightOf="@+id/txt_fgt_main_page_task_remain"
-            app:layout_constraintTop_toBottomOf="@+id/txt_fgt_main_page_task_income" />
+            android:visibility="gone"
+            app:layout_constraintLeft_toLeftOf="@id/txt_fgt_main_page_task_remain"
+            app:layout_constraintRight_toRightOf="@id/txt_fgt_main_page_task_remain"
+            app:layout_constraintTop_toBottomOf="@id/txt_fgt_main_page_task_income" />
 
         <TextView
             android:layout_width="wrap_content"
@@ -102,21 +103,22 @@
             android:text="任务记录"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_2"
-            app:layout_constraintLeft_toLeftOf="@+id/txt_fgt_main_page_task_history"
-            app:layout_constraintRight_toRightOf="@+id/txt_fgt_main_page_task_history"
-            app:layout_constraintTop_toBottomOf="@+id/txt_fgt_main_page_task_income" />
+            app:layout_constraintLeft_toLeftOf="@id/txt_fgt_main_page_task_history"
+            app:layout_constraintRight_toRightOf="@id/txt_fgt_main_page_task_history"
+            app:layout_constraintTop_toBottomOf="@id/txt_fgt_main_page_task_income" />
 
         <LinearLayout
-            android:layout_width="8dp"
-            android:layout_height="0dp"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/layout_heigh_default"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            tools:layout_editor_absoluteX="8dp">
+            app:layout_constraintTop_toTopOf="parent">
 
-            <Space
+            <View
+                android:id="@+id/view_income_today"
                 android:layout_width="0dp"
-                android:layout_height="1px"
+                android:layout_height="match_parent"
                 android:layout_weight="1" />
 
             <View
@@ -124,19 +126,21 @@
                 android:layout_height="25dp"
                 android:background="@color/sheep_red" />
 
-            <Space
+            <View
                 android:layout_width="0dp"
-                android:layout_height="1px"
-                android:layout_weight="1" />
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:visibility="gone" />
 
             <View
                 android:layout_width="1px"
                 android:layout_height="25dp"
                 android:background="@color/sheep_red" />
 
-            <Space
+            <View
+                android:id="@+id/view_complete_today"
                 android:layout_width="0dp"
-                android:layout_height="1px"
+                android:layout_height="match_parent"
                 android:layout_weight="1" />
 
             <View
@@ -144,9 +148,10 @@
                 android:layout_height="25dp"
                 android:background="@color/sheep_red" />
 
-            <Space
+            <View
+                android:id="@+id/view_history_record"
                 android:layout_width="0dp"
-                android:layout_height="1px"
+                android:layout_height="match_parent"
                 android:layout_weight="1" />
 
         </LinearLayout>

+ 1 - 1
app/src/main/res/layout/main_activity.xml

@@ -77,7 +77,7 @@
 
 
                     <TextView
-                        android:id="@+id/tv_withdraw"
+                        android:id="@+id/txt_get_cash"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"