Commit 2181568b44fe91ef565f9de89e10db07dba68c13
Exists in
yxb_dev
and in
2 other branches
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer
# Conflicts: # app/src/main/AndroidManifest.xml # app/src/main/java/com/shunzhi/parent/AppConfig.java # app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java # app/src/main/java/com/shunzhi/parent/model/loginandregister/LoginAndRegisterModel.java # app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java # app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java # app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java # app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java # app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
Showing
37 changed files
with
635 additions
and
137 deletions
Show diff stats
app/src/main/AndroidManifest.xml
@@ -112,17 +112,18 @@ | @@ -112,17 +112,18 @@ | ||
112 | android:name="com.amap.api.v2.apikey" | 112 | android:name="com.amap.api.v2.apikey" |
113 | android:value="1d130afb822d8a1019e6592cbaf10bcc"/> | 113 | android:value="1d130afb822d8a1019e6592cbaf10bcc"/> |
114 | 114 | ||
115 | - <activity android:name=".ui.activity.LoginAndRegistActivity"> | 115 | + <activity android:name=".ui.MainActivity" |
116 | + android:windowSoftInputMode="adjustPan|stateAlwaysHidden"> | ||
116 | <intent-filter> | 117 | <intent-filter> |
117 | <action android:name="android.intent.action.MAIN"/> | 118 | <action android:name="android.intent.action.MAIN"/> |
118 | 119 | ||
119 | <category android:name="android.intent.category.LAUNCHER"/> | 120 | <category android:name="android.intent.category.LAUNCHER"/> |
120 | </intent-filter> | 121 | </intent-filter> |
121 | </activity> | 122 | </activity> |
122 | - <activity | ||
123 | - android:name=".ui.MainActivity" | ||
124 | - android:screenOrientation="portrait" | ||
125 | - android:windowSoftInputMode="adjustPan|stateAlwaysHidden"/> | 123 | + <!--<activity--> |
124 | + <!--android:name=".ui.MainActivity"--> | ||
125 | + <!--android:screenOrientation="portrait"--> | ||
126 | + <!--android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />--> | ||
126 | <activity | 127 | <activity |
127 | android:name=".ui.activity.MyChildActivity" | 128 | android:name=".ui.activity.MyChildActivity" |
128 | android:screenOrientation="portrait"/> | 129 | android:screenOrientation="portrait"/> |
@@ -142,9 +143,10 @@ | @@ -142,9 +143,10 @@ | ||
142 | android:name=".ui.activity.binding.SelectSchoolActivity" | 143 | android:name=".ui.activity.binding.SelectSchoolActivity" |
143 | android:screenOrientation="portrait" | 144 | android:screenOrientation="portrait" |
144 | android:windowSoftInputMode="adjustPan|stateHidden"/> | 145 | android:windowSoftInputMode="adjustPan|stateHidden"/> |
145 | - <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" --> | ||
146 | - <!-- android:screenOrientation="portrait" --> | ||
147 | - <!-- /> --> | 146 | + android:windowSoftInputMode="adjustPan|stateHidden" /> |
147 | + <activity android:name=".ui.activity.LoginAndRegistActivity" | ||
148 | + android:screenOrientation="portrait" | ||
149 | + /> | ||
148 | <activity | 150 | <activity |
149 | android:name=".ui.activity.PersonInfoActivity" | 151 | android:name=".ui.activity.PersonInfoActivity" |
150 | android:screenOrientation="portrait" | 152 | android:screenOrientation="portrait" |
app/src/main/java/com/shunzhi/parent/AppConfig.java
@@ -22,13 +22,14 @@ public class AppConfig { | @@ -22,13 +22,14 @@ public class AppConfig { | ||
22 | public static String USER_SEX = "user_sex"; | 22 | public static String USER_SEX = "user_sex"; |
23 | public static String USER_IMAGE = "user_image"; | 23 | public static String USER_IMAGE = "user_image"; |
24 | public static String PARENT_ID = "parent_id"; | 24 | public static String PARENT_ID = "parent_id"; |
25 | + public static boolean ISLOGIN = false; | ||
25 | 26 | ||
26 | - public static int BINDING_SUCCESS_HEZUO = 1; | ||
27 | - public static int BINDING_SUCCESS_NOT= 2; | ||
28 | - public static int ORDER_CENTER = 3; | 27 | + public static int BINDING_SUCCESS_HEZUO = 1; |
28 | + public static int BINDING_SUCCESS_NOT = 2; | ||
29 | + public static int ORDER_CENTER = 3; | ||
29 | 30 | ||
30 | - public static String USER_ID="user_id"; | ||
31 | - public static String APP_IS_START="app_is_start"; | 31 | + public static String USER_ID = "user_id"; |
32 | + public static String APP_IS_START = "app_is_start"; | ||
32 | 33 | ||
33 | //http://campus.myjxt.com/ | 34 | //http://campus.myjxt.com/ |
34 | public static String BASE_URL="http://60.190.202.57:1000/"; | 35 | public static String BASE_URL="http://60.190.202.57:1000/"; |
@@ -36,7 +37,6 @@ public class AppConfig { | @@ -36,7 +37,6 @@ public class AppConfig { | ||
36 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | 37 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; |
37 | 38 | ||
38 | 39 | ||
39 | - | ||
40 | //默认日志保存的路径 | 40 | //默认日志保存的路径 |
41 | public final static String DEFAULT_SAVE_LOG_PATH = Environment | 41 | public final static String DEFAULT_SAVE_LOG_PATH = Environment |
42 | .getExternalStorageDirectory() | 42 | .getExternalStorageDirectory() |
app/src/main/java/com/shunzhi/parent/adapter/ContextAdapter.java
0 → 100644
@@ -0,0 +1,66 @@ | @@ -0,0 +1,66 @@ | ||
1 | +package com.shunzhi.parent.adapter; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.view.LayoutInflater; | ||
5 | +import android.view.View; | ||
6 | +import android.view.ViewGroup; | ||
7 | +import android.widget.ImageView; | ||
8 | +import android.widget.TextView; | ||
9 | + | ||
10 | +import com.bumptech.glide.Glide; | ||
11 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
12 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | ||
13 | +import com.shunzhi.parent.R; | ||
14 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
15 | + | ||
16 | +/** | ||
17 | + * Created by lenovo on 2018/3/18. | ||
18 | + */ | ||
19 | + | ||
20 | +public class ContextAdapter extends BaseRecyclerViewAdapter<ChannelContextBean>{ | ||
21 | + Context context; | ||
22 | + | ||
23 | + public ContextAdapter(Context context) { | ||
24 | + this.context = context; | ||
25 | + } | ||
26 | + | ||
27 | + | ||
28 | + @Override | ||
29 | + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
30 | + View view = LayoutInflater.from(context).inflate(R.layout.layout_consult_content, null); | ||
31 | + return new MyViewHolder(view); | ||
32 | + } | ||
33 | + | ||
34 | + private class MyViewHolder extends BaseRecyclerViewHolder<ChannelContextBean> { | ||
35 | + TextView tvConsultTitle,tvConsultContent,tvPingLunNums,tvZhuanFaNums; | ||
36 | + ImageView iv_consult; | ||
37 | + | ||
38 | + | ||
39 | + public MyViewHolder(View view) { | ||
40 | + super(view); | ||
41 | + tvConsultContent=view.findViewById(R.id.tvConsultContent); | ||
42 | + tvConsultTitle=view.findViewById(R.id.tvConsultTitle); | ||
43 | + tvPingLunNums=view.findViewById(R.id.tvPingLunNums); | ||
44 | + tvZhuanFaNums=view.findViewById(R.id.tvZhuanFaNums); | ||
45 | + iv_consult=view.findViewById(R.id.iv_consult); | ||
46 | + | ||
47 | + } | ||
48 | + | ||
49 | + @Override | ||
50 | + public void onBindViewHolder(final ChannelContextBean object, int position) { | ||
51 | + tvConsultTitle.setText(object.getTitle()); | ||
52 | + tvConsultContent.setText(object.getContent()); | ||
53 | + Glide.with(context).load(object.getImage()).placeholder(R.color.xueqing_blue) | ||
54 | + .into(iv_consult); | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + } | ||
61 | + | ||
62 | + } | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | +} |
app/src/main/java/com/shunzhi/parent/api/Consult.java
@@ -3,7 +3,10 @@ package com.shunzhi.parent.api; | @@ -3,7 +3,10 @@ package com.shunzhi.parent.api; | ||
3 | import com.google.gson.JsonObject; | 3 | import com.google.gson.JsonObject; |
4 | 4 | ||
5 | import io.reactivex.Observable; | 5 | import io.reactivex.Observable; |
6 | +import retrofit2.http.Field; | ||
7 | +import retrofit2.http.FormUrlEncoded; | ||
6 | import retrofit2.http.GET; | 8 | import retrofit2.http.GET; |
9 | +import retrofit2.http.POST; | ||
7 | import retrofit2.http.Query; | 10 | import retrofit2.http.Query; |
8 | 11 | ||
9 | /** | 12 | /** |
@@ -12,9 +15,13 @@ import retrofit2.http.Query; | @@ -12,9 +15,13 @@ import retrofit2.http.Query; | ||
12 | 15 | ||
13 | public interface Consult { | 16 | public interface Consult { |
14 | 17 | ||
15 | - @GET("api/ParentService/GetAds") | ||
16 | - Observable<JsonObject> getBanners(@Query("position") String position); | 18 | + @GET("/api/ParentService/GetAds") |
19 | + Observable<JsonObject> getBanners(@Query("position") String position, @Query("areaName") String areaName); | ||
17 | 20 | ||
18 | 21 | ||
19 | - Observable<JsonObject> getConsultContent(); | 22 | + @FormUrlEncoded |
23 | + @POST("/api/ParentService/GetChannelInfo") | ||
24 | + Observable<JsonObject> getConsultContent(@Field("areaName") String areaName, @Field("channel") int channel | ||
25 | + , @Field("toFirstPage") int toFirstPage, @Field("pageIndex") int pageIndex); | ||
26 | + | ||
20 | } | 27 | } |
app/src/main/java/com/shunzhi/parent/api/LoginRegisterApi.java
@@ -33,6 +33,12 @@ public interface LoginRegisterApi { | @@ -33,6 +33,12 @@ public interface LoginRegisterApi { | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | + @GET("/api/Account/ReSetpass") | ||
37 | + Observable<JsonObject> reSetpassResult( | ||
38 | + @Field("mobile") String username, @Field("captcha") String idCode,@Field("pass") String password); | ||
39 | + | ||
40 | + | ||
41 | + | ||
36 | @GET("api/Account/ChangePhoneCaptcha") | 42 | @GET("api/Account/ChangePhoneCaptcha") |
37 | Observable<JsonObject> getidCodeResult( | 43 | Observable<JsonObject> getidCodeResult( |
38 | @Query("mobile") String username); | 44 | @Query("mobile") String username); |
app/src/main/java/com/shunzhi/parent/api/MineApi.java
@@ -32,7 +32,7 @@ public interface MineApi { | @@ -32,7 +32,7 @@ public interface MineApi { | ||
32 | @FormUrlEncoded | 32 | @FormUrlEncoded |
33 | @POST("/api/ParentHelper/BindlingChildren") | 33 | @POST("/api/ParentHelper/BindlingChildren") |
34 | Observable<JsonObject> addChildResult( | 34 | Observable<JsonObject> addChildResult( |
35 | - @Field("parentId") int parentId, @Field("mobileFlag") boolean mobileFlag, @Field("cooperateFlag") boolean cooperateFlag | 35 | + @Field("sex") int sex ,@Field("studentName") String studentName ,@Field("parentId") int parentId, @Field("mobileFlag") boolean mobileFlag, @Field("cooperateFlag") boolean cooperateFlag |
36 | , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId); | 36 | , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId); |
37 | 37 | ||
38 | @GET("/api/ParentHelper/GetClassOrGrade") | 38 | @GET("/api/ParentHelper/GetClassOrGrade") |
app/src/main/java/com/shunzhi/parent/bean/channel/ChannelBean.java
0 → 100644
@@ -0,0 +1,67 @@ | @@ -0,0 +1,67 @@ | ||
1 | +package com.shunzhi.parent.bean.channel; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | + | ||
5 | +/** | ||
6 | + * Created by lenovo on 2018/3/18. | ||
7 | + */ | ||
8 | + | ||
9 | +public class ChannelBean implements Serializable { | ||
10 | + private int id; | ||
11 | + private String channelName; | ||
12 | + private String channelImage; | ||
13 | + private int orderById; | ||
14 | + private String url; | ||
15 | + | ||
16 | + | ||
17 | + public int getId() { | ||
18 | + return id; | ||
19 | + } | ||
20 | + | ||
21 | + public void setId(int id) { | ||
22 | + this.id = id; | ||
23 | + } | ||
24 | + | ||
25 | + public String getChannelName() { | ||
26 | + return channelName; | ||
27 | + } | ||
28 | + | ||
29 | + public void setChannelName(String channelName) { | ||
30 | + this.channelName = channelName; | ||
31 | + } | ||
32 | + | ||
33 | + public String getChannelImage() { | ||
34 | + return channelImage; | ||
35 | + } | ||
36 | + | ||
37 | + public void setChannelImage(String channelImage) { | ||
38 | + this.channelImage = channelImage; | ||
39 | + } | ||
40 | + | ||
41 | + public int getOrderById() { | ||
42 | + return orderById; | ||
43 | + } | ||
44 | + | ||
45 | + public void setOrderById(int orderById) { | ||
46 | + this.orderById = orderById; | ||
47 | + } | ||
48 | + | ||
49 | + public String getUrl() { | ||
50 | + return url; | ||
51 | + } | ||
52 | + | ||
53 | + public void setUrl(String url) { | ||
54 | + this.url = url; | ||
55 | + } | ||
56 | + | ||
57 | + @Override | ||
58 | + public String toString() { | ||
59 | + return "ChannelContextBean:{" + | ||
60 | + ",id='" + id + '\'' + | ||
61 | + ",channelName='" + channelName + '\'' + | ||
62 | + ",channelImage='" + channelImage + '\'' + | ||
63 | + ",orderById='" + orderById + '\'' + | ||
64 | + ", url=" + url + | ||
65 | + "}"; | ||
66 | + } | ||
67 | +} |
app/src/main/java/com/shunzhi/parent/bean/channel/ChannelContextBean.java
0 → 100644
@@ -0,0 +1,108 @@ | @@ -0,0 +1,108 @@ | ||
1 | +package com.shunzhi.parent.bean.channel; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | + | ||
5 | +/** | ||
6 | + * Created by lenovo on 2018/3/18. | ||
7 | + */ | ||
8 | + | ||
9 | +public class ChannelContextBean implements Serializable{ | ||
10 | + private int id; | ||
11 | + private String image; | ||
12 | + private String title; | ||
13 | + private String url; | ||
14 | + private String content; | ||
15 | + private int forwardingNum; | ||
16 | + private int talkNum; | ||
17 | + private int orderById; | ||
18 | + private int isAds; | ||
19 | + | ||
20 | + | ||
21 | + public int getId() { | ||
22 | + return id; | ||
23 | + } | ||
24 | + | ||
25 | + public void setId(int id) { | ||
26 | + this.id = id; | ||
27 | + } | ||
28 | + | ||
29 | + public String getImage() { | ||
30 | + return image; | ||
31 | + } | ||
32 | + | ||
33 | + public void setImage(String image) { | ||
34 | + this.image = image; | ||
35 | + } | ||
36 | + | ||
37 | + public String getTitle() { | ||
38 | + return title; | ||
39 | + } | ||
40 | + | ||
41 | + public void setTitle(String title) { | ||
42 | + this.title = title; | ||
43 | + } | ||
44 | + | ||
45 | + public String getUrl() { | ||
46 | + return url; | ||
47 | + } | ||
48 | + | ||
49 | + public void setUrl(String url) { | ||
50 | + this.url = url; | ||
51 | + } | ||
52 | + | ||
53 | + public String getContent() { | ||
54 | + return content; | ||
55 | + } | ||
56 | + | ||
57 | + public void setContent(String content) { | ||
58 | + this.content = content; | ||
59 | + } | ||
60 | + | ||
61 | + public int getForwardingNum() { | ||
62 | + return forwardingNum; | ||
63 | + } | ||
64 | + | ||
65 | + public void setForwardingNum(int forwardingNum) { | ||
66 | + this.forwardingNum = forwardingNum; | ||
67 | + } | ||
68 | + | ||
69 | + public int getTalkNum() { | ||
70 | + return talkNum; | ||
71 | + } | ||
72 | + | ||
73 | + public void setTalkNum(int talkNum) { | ||
74 | + this.talkNum = talkNum; | ||
75 | + } | ||
76 | + | ||
77 | + public int getOrderById() { | ||
78 | + return orderById; | ||
79 | + } | ||
80 | + | ||
81 | + public void setOrderById(int orderById) { | ||
82 | + this.orderById = orderById; | ||
83 | + } | ||
84 | + | ||
85 | + public int getIsAds() { | ||
86 | + return isAds; | ||
87 | + } | ||
88 | + | ||
89 | + public void setIsAds(int isAds) { | ||
90 | + this.isAds = isAds; | ||
91 | + } | ||
92 | + | ||
93 | + @Override | ||
94 | + public String toString() { | ||
95 | + return "ChannelContextBean:{" + | ||
96 | + ",id='" + id + '\'' + | ||
97 | + ",image='" + image + '\'' + | ||
98 | + ",title='" + title + '\'' + | ||
99 | + ",url='" + url + '\'' + | ||
100 | + ",content='" + content + '\'' + | ||
101 | + ",forwardingNum='" + forwardingNum + '\'' + | ||
102 | + ",talkNum='" + talkNum + '\'' + | ||
103 | + ",orderById='" + orderById + '\'' + | ||
104 | + ", isAds=" + isAds + | ||
105 | + "}"; | ||
106 | + } | ||
107 | + | ||
108 | +} |
app/src/main/java/com/shunzhi/parent/bean/channel/ChannelInfo.java
0 → 100644
@@ -0,0 +1,42 @@ | @@ -0,0 +1,42 @@ | ||
1 | +package com.shunzhi.parent.bean.channel; | ||
2 | + | ||
3 | +import com.share.mvpsdk.base.BaseModel; | ||
4 | +import com.share.mvpsdk.base.entity.BaseEntity; | ||
5 | +import com.shunzhi.parent.bean.ToolBean; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * Created by lenovo on 2018/3/18. | ||
12 | + */ | ||
13 | + | ||
14 | +public class ChannelInfo implements Serializable { | ||
15 | + private List<ChannelContextBean> channelContent; | ||
16 | + private List<ChannelBean> subchannel; | ||
17 | + | ||
18 | + | ||
19 | + public List<ChannelContextBean> getChannelContent() { | ||
20 | + return channelContent; | ||
21 | + } | ||
22 | + | ||
23 | + public void setChannelContent(List<ChannelContextBean> channelContent) { | ||
24 | + this.channelContent = channelContent; | ||
25 | + } | ||
26 | + | ||
27 | + public List<ChannelBean> getSubchannel() { | ||
28 | + return subchannel; | ||
29 | + } | ||
30 | + | ||
31 | + public void setSubchannel(List<ChannelBean> subchannel) { | ||
32 | + this.subchannel = subchannel; | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + public String toString() { | ||
37 | + return "ChannelInfo{" + | ||
38 | + ",subchannel='" + subchannel + '\'' + | ||
39 | + ", channelContent=" + channelContent + | ||
40 | + "}"; | ||
41 | + } | ||
42 | +} |
app/src/main/java/com/shunzhi/parent/contract/consult/ConsultContract.java
@@ -7,6 +7,8 @@ import com.share.mvpsdk.base.BasePresenter; | @@ -7,6 +7,8 @@ import com.share.mvpsdk.base.BasePresenter; | ||
7 | import com.share.mvpsdk.base.IBaseFragment; | 7 | import com.share.mvpsdk.base.IBaseFragment; |
8 | import com.share.mvpsdk.base.IBaseModel; | 8 | import com.share.mvpsdk.base.IBaseModel; |
9 | import com.shunzhi.parent.bean.GuangGaoBean; | 9 | import com.shunzhi.parent.bean.GuangGaoBean; |
10 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
11 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
10 | 12 | ||
11 | import java.util.List; | 13 | import java.util.List; |
12 | 14 | ||
@@ -18,23 +20,31 @@ import io.reactivex.Observable; | @@ -18,23 +20,31 @@ import io.reactivex.Observable; | ||
18 | 20 | ||
19 | public interface ConsultContract { | 21 | public interface ConsultContract { |
20 | 22 | ||
21 | - abstract class ConsultPresenter extends BasePresenter<IConsultModel,IConsultView>{ | 23 | + abstract class ConsultPresenter extends BasePresenter<IConsultModel, IConsultView> { |
22 | public abstract void getTools(LinearLayout linearLayout); | 24 | public abstract void getTools(LinearLayout linearLayout); |
23 | 25 | ||
24 | - public abstract void getBanners(String position); | 26 | + public abstract void getBanners(String position, String areaName); |
27 | + | ||
28 | + public abstract void getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex); | ||
25 | } | 29 | } |
26 | 30 | ||
27 | 31 | ||
28 | - interface IConsultModel extends IBaseModel{ | 32 | + interface IConsultModel extends IBaseModel { |
29 | Observable<JsonObject> getTools(); | 33 | Observable<JsonObject> getTools(); |
30 | 34 | ||
31 | - Observable<JsonObject> getBanners(String position); | 35 | + Observable<JsonObject> getBanners(String position, String areaName); |
36 | + | ||
37 | + Observable<JsonObject> getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex); | ||
32 | } | 38 | } |
33 | 39 | ||
34 | - interface IConsultView extends IBaseFragment{ | 40 | + interface IConsultView extends IBaseFragment { |
35 | void showTools(); | 41 | void showTools(); |
36 | 42 | ||
37 | void showBanners(List<GuangGaoBean> guangGaoBeanList); | 43 | void showBanners(List<GuangGaoBean> guangGaoBeanList); |
44 | + | ||
45 | + void showChannel(List<ChannelBean> list); | ||
46 | + | ||
47 | + void showContext(List<ChannelContextBean> list); | ||
38 | } | 48 | } |
39 | 49 | ||
40 | } | 50 | } |
app/src/main/java/com/shunzhi/parent/contract/consult/consultone/ConsultOneContract.java
@@ -21,17 +21,17 @@ public interface ConsultOneContract { | @@ -21,17 +21,17 @@ public interface ConsultOneContract { | ||
21 | abstract class ConsultOnePresenter extends BasePresenter<IConsultOneModel,IConsultOneView>{ | 21 | abstract class ConsultOnePresenter extends BasePresenter<IConsultOneModel,IConsultOneView>{ |
22 | public abstract void getTools(LinearLayout linearLayout); | 22 | public abstract void getTools(LinearLayout linearLayout); |
23 | 23 | ||
24 | - public abstract void getBanners(String position); | 24 | + public abstract void getBanners(String position,String areaName); |
25 | 25 | ||
26 | - public abstract void getConsultContent(); | 26 | + public abstract void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex); |
27 | } | 27 | } |
28 | 28 | ||
29 | interface IConsultOneModel extends IBaseModel{ | 29 | interface IConsultOneModel extends IBaseModel{ |
30 | void getTools(); | 30 | void getTools(); |
31 | 31 | ||
32 | - Observable<JsonObject> getBanners(String position); | 32 | + Observable<JsonObject> getBanners(String position,String areaName); |
33 | 33 | ||
34 | - Observable<JsonObject> getConsultContent(); | 34 | + Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex); |
35 | } | 35 | } |
36 | 36 | ||
37 | interface IConsultOneView extends IBaseFragment{ | 37 | interface IConsultOneView extends IBaseFragment{ |
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
@@ -25,6 +25,7 @@ public interface LoginAndRegisterContract { | @@ -25,6 +25,7 @@ public interface LoginAndRegisterContract { | ||
25 | public abstract void getUserInfo(String mobile,int school_id,String captcha); | 25 | public abstract void getUserInfo(String mobile,int school_id,String captcha); |
26 | 26 | ||
27 | public abstract void nimLogin(String account,String password); | 27 | public abstract void nimLogin(String account,String password); |
28 | + public abstract void reSetpassResult(String adminName,String idCode,String password); | ||
28 | } | 29 | } |
29 | 30 | ||
30 | interface ILoginModel extends IBaseModel{ | 31 | interface ILoginModel extends IBaseModel{ |
@@ -38,6 +39,7 @@ public interface LoginAndRegisterContract { | @@ -38,6 +39,7 @@ public interface LoginAndRegisterContract { | ||
38 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); | 39 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); |
39 | 40 | ||
40 | Observable<NIMLoginResultBean> nimLoginResult(String account, String token); | 41 | Observable<NIMLoginResultBean> nimLoginResult(String account, String token); |
42 | + Observable<JsonObject> reSetpass(String adminName,String idCode,String password); | ||
41 | } | 43 | } |
42 | interface ILoginView extends IBaseFragment { | 44 | interface ILoginView extends IBaseFragment { |
43 | 45 |
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
@@ -21,7 +21,7 @@ public interface MyChildContract { | @@ -21,7 +21,7 @@ public interface MyChildContract { | ||
21 | 21 | ||
22 | abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> { | 22 | abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> { |
23 | public abstract void loadChildList(String mobile, int school_id, String captcha); | 23 | public abstract void loadChildList(String mobile, int school_id, String captcha); |
24 | - public abstract void addChild(int parentId, boolean mobileFlag,boolean cooperateFlag | 24 | + public abstract void addChild( int sex ,String studentName,int parentId, boolean mobileFlag,boolean cooperateFlag |
25 | , int schoolId,int classId,int studentId,String studentUserId); | 25 | , int schoolId,int classId,int studentId,String studentUserId); |
26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); | 26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); |
27 | 27 | ||
@@ -31,7 +31,7 @@ public interface MyChildContract { | @@ -31,7 +31,7 @@ public interface MyChildContract { | ||
31 | 31 | ||
32 | interface IMyChildModel extends IBaseModel { | 32 | interface IMyChildModel extends IBaseModel { |
33 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); | 33 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); |
34 | - Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | 34 | + Observable<JsonObject> addChildResult( int sex , String studentName,int parentId, boolean mobileFlag,boolean cooperateFlag |
35 | , int schoolId,int classId,int studentId,String studentUserId); | 35 | , int schoolId,int classId,int studentId,String studentUserId); |
36 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); | 36 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); |
37 | Observable<JsonObject>unBinnding(int parentId,int studentId); | 37 | Observable<JsonObject>unBinnding(int parentId,int studentId); |
app/src/main/java/com/shunzhi/parent/model/consult/ConsultModel.java
@@ -6,6 +6,8 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; | @@ -6,6 +6,8 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; | ||
6 | import com.share.mvpsdk.helper.RxHelper; | 6 | import com.share.mvpsdk.helper.RxHelper; |
7 | import com.shunzhi.parent.AppConfig; | 7 | import com.shunzhi.parent.AppConfig; |
8 | import com.shunzhi.parent.api.Consult; | 8 | import com.shunzhi.parent.api.Consult; |
9 | +import com.shunzhi.parent.api.LoginRegisterApi; | ||
10 | +import com.shunzhi.parent.bean.UserInfo; | ||
9 | import com.shunzhi.parent.contract.consult.ConsultContract; | 11 | import com.shunzhi.parent.contract.consult.ConsultContract; |
10 | 12 | ||
11 | import io.reactivex.Observable; | 13 | import io.reactivex.Observable; |
@@ -23,9 +25,17 @@ public class ConsultModel extends BaseModel implements ConsultContract.IConsultM | @@ -23,9 +25,17 @@ public class ConsultModel extends BaseModel implements ConsultContract.IConsultM | ||
23 | } | 25 | } |
24 | 26 | ||
25 | @Override | 27 | @Override |
26 | - public Observable<JsonObject> getBanners(String position) { | 28 | + public Observable<JsonObject> getBanners(String position,String areaName) { |
27 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | 29 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) |
28 | - .getBanners(position).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 30 | + .getBanners(position,areaName).compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
31 | + } | ||
32 | + | ||
33 | + @Override | ||
34 | + public Observable<JsonObject> getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex) { | ||
35 | +// return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | ||
36 | +// .getConsultContent(areaName,channel,toFirstPage,pageIndex); | ||
37 | + return RetrofitCreateHelper.getInstance().createApi(Consult.class,AppConfig.BASE_URL).getConsultContent(areaName,channel,toFirstPage,pageIndex) | ||
38 | + .compose(RxHelper.<JsonObject>rxSchedulerHelper()); | ||
29 | } | 39 | } |
30 | 40 | ||
31 | public static ConsultContract.IConsultModel newInstance() { | 41 | public static ConsultContract.IConsultModel newInstance() { |
app/src/main/java/com/shunzhi/parent/model/consult/consultone/ConsultOneModel.java
@@ -27,14 +27,14 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo | @@ -27,14 +27,14 @@ public class ConsultOneModel extends BaseModel implements ConsultOneContract.ICo | ||
27 | } | 27 | } |
28 | 28 | ||
29 | @Override | 29 | @Override |
30 | - public Observable<JsonObject> getBanners(String position) { | 30 | + public Observable<JsonObject> getBanners(String position,String areaName) { |
31 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | 31 | return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) |
32 | - .getBanners(position).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 32 | + .getBanners(position,areaName).compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
33 | } | 33 | } |
34 | 34 | ||
35 | @Override | 35 | @Override |
36 | - public Observable<JsonObject> getConsultContent() { | ||
37 | - return RetrofitCreateHelper.getInstance().createApi(Consult.class,AppConfig.BASE_URL) | ||
38 | - .getConsultContent().compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 36 | + public Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { |
37 | + return RetrofitCreateHelper.getInstance().createApi(Consult.class, AppConfig.BASE_URL) | ||
38 | + .getConsultContent(areaName,channel,toFirstPage,pageIndex); | ||
39 | } | 39 | } |
40 | } | 40 | } |
app/src/main/java/com/shunzhi/parent/model/loginandregister/LoginAndRegisterModel.java
@@ -52,6 +52,9 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste | @@ -52,6 +52,9 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste | ||
52 | @Override | 52 | @Override |
53 | public Observable<NIMLoginResultBean> nimLoginResult(String account, String token) { | 53 | public Observable<NIMLoginResultBean> nimLoginResult(String account, String token) { |
54 | return MessageManager.getInstance().login(account, token); | 54 | return MessageManager.getInstance().login(account, token); |
55 | + public Observable<JsonObject> reSetpass(String adminName, String idCode, String password) { | ||
56 | + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).reSetpassResult(adminName,idCode,password) | ||
57 | + .compose(RxHelper.<JsonObject>rxSchedulerHelper()); | ||
55 | } | 58 | } |
56 | 59 | ||
57 | } | 60 | } |
app/src/main/java/com/shunzhi/parent/model/mine/MyChildModel.java
@@ -11,6 +11,7 @@ import com.shunzhi.parent.bean.UserInfo; | @@ -11,6 +11,7 @@ import com.shunzhi.parent.bean.UserInfo; | ||
11 | import com.shunzhi.parent.contract.mine.MyChildContract; | 11 | import com.shunzhi.parent.contract.mine.MyChildContract; |
12 | 12 | ||
13 | import io.reactivex.Observable; | 13 | import io.reactivex.Observable; |
14 | +import retrofit2.http.Field; | ||
14 | 15 | ||
15 | /** | 16 | /** |
16 | * Created by Administrator on 2018/3/8 0008. | 17 | * Created by Administrator on 2018/3/8 0008. |
@@ -30,9 +31,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | @@ -30,9 +31,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | ||
30 | 31 | ||
31 | 32 | ||
32 | @Override | 33 | @Override |
33 | - public Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | 34 | + public Observable<JsonObject> addChildResult( int sex , String studentName,int parentId, boolean mobileFlag,boolean cooperateFlag |
34 | , int schoolId,int classId,int studentId,String studentUserId) { | 35 | , int schoolId,int classId,int studentId,String studentUserId) { |
35 | - return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).addChildResult(parentId,mobileFlag,cooperateFlag,schoolId | 36 | + return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).addChildResult(sex ,studentName,parentId,mobileFlag,cooperateFlag,schoolId |
36 | ,classId,studentId,studentUserId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 37 | ,classId,studentId,studentUserId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
37 | } | 38 | } |
38 | 39 |
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
@@ -9,20 +9,27 @@ import android.widget.LinearLayout; | @@ -9,20 +9,27 @@ import android.widget.LinearLayout; | ||
9 | import com.google.gson.Gson; | 9 | import com.google.gson.Gson; |
10 | import com.google.gson.JsonArray; | 10 | import com.google.gson.JsonArray; |
11 | import com.google.gson.JsonObject; | 11 | import com.google.gson.JsonObject; |
12 | +import com.share.mvpsdk.utils.OkHttpExceptionUtil; | ||
12 | import com.share.mvpsdk.utils.ToastUtils; | 13 | import com.share.mvpsdk.utils.ToastUtils; |
13 | import com.shunzhi.parent.R; | 14 | import com.shunzhi.parent.R; |
14 | import com.shunzhi.parent.bean.GuangGaoBean; | 15 | import com.shunzhi.parent.bean.GuangGaoBean; |
15 | import com.shunzhi.parent.bean.ToolBean; | 16 | import com.shunzhi.parent.bean.ToolBean; |
17 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
18 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
19 | +import com.shunzhi.parent.bean.channel.ChannelInfo; | ||
16 | import com.shunzhi.parent.contract.consult.ConsultContract; | 20 | import com.shunzhi.parent.contract.consult.ConsultContract; |
17 | import com.shunzhi.parent.model.consult.ConsultModel; | 21 | import com.shunzhi.parent.model.consult.ConsultModel; |
18 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | 22 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; |
19 | import com.shunzhi.parent.util.AttrsUtils; | 23 | import com.shunzhi.parent.util.AttrsUtils; |
20 | import com.shunzhi.parent.views.TextAndImgShowView; | 24 | import com.shunzhi.parent.views.TextAndImgShowView; |
21 | 25 | ||
26 | +import org.json.JSONObject; | ||
27 | + | ||
22 | import java.util.ArrayList; | 28 | import java.util.ArrayList; |
23 | import java.util.List; | 29 | import java.util.List; |
24 | 30 | ||
25 | import io.reactivex.functions.Consumer; | 31 | import io.reactivex.functions.Consumer; |
32 | +import retrofit2.HttpException; | ||
26 | 33 | ||
27 | /** | 34 | /** |
28 | * Created by ToaHanDong on 2018/3/14. | 35 | * Created by ToaHanDong on 2018/3/14. |
@@ -31,18 +38,18 @@ import io.reactivex.functions.Consumer; | @@ -31,18 +38,18 @@ import io.reactivex.functions.Consumer; | ||
31 | public class ConsultPresenter extends ConsultContract.ConsultPresenter { | 38 | public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
32 | @Override | 39 | @Override |
33 | public void getTools(LinearLayout layout_control) { | 40 | public void getTools(LinearLayout layout_control) { |
34 | - List<ToolBean> toolBeanList=new ArrayList<>(); | ||
35 | - toolBeanList.add(new ToolBean(R.drawable.xiaoxue+"","小学")); | ||
36 | - toolBeanList.add(new ToolBean(R.drawable.zhongxue+"","中学")); | ||
37 | - toolBeanList.add(new ToolBean(R.drawable.gaozhong+"","高中")); | ||
38 | - toolBeanList.add(new ToolBean(R.drawable.parent+"","家长")); | 41 | + List<ToolBean> toolBeanList = new ArrayList<>(); |
42 | + toolBeanList.add(new ToolBean(R.drawable.xiaoxue + "", "小学")); | ||
43 | + toolBeanList.add(new ToolBean(R.drawable.zhongxue + "", "中学")); | ||
44 | + toolBeanList.add(new ToolBean(R.drawable.gaozhong + "", "高中")); | ||
45 | + toolBeanList.add(new ToolBean(R.drawable.parent + "", "家长")); | ||
39 | for (int i = 0; i < toolBeanList.size(); i++) { | 46 | for (int i = 0; i < toolBeanList.size(); i++) { |
40 | - TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity()); | 47 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(mIView.getBindActivity()); |
41 | textAndImgShowView.setTextColor(R.color.textColor); | 48 | textAndImgShowView.setTextColor(R.color.textColor); |
42 | textAndImgShowView.setText(toolBeanList.get(i).toolName); | 49 | textAndImgShowView.setText(toolBeanList.get(i).toolName); |
43 | textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImage)); | 50 | textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImage)); |
44 | textAndImgShowView.setSelect(true); | 51 | textAndImgShowView.setSelect(true); |
45 | - textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control); | 52 | + textAndImgShowView.setWidth(mIView.getBindActivity(), layout_control); |
46 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(mIView.getBindActivity()).getDrawable(0)); | 53 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(mIView.getBindActivity()).getDrawable(0)); |
47 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { | 54 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
48 | @Override | 55 | @Override |
@@ -56,29 +63,58 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | @@ -56,29 +63,58 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | ||
56 | } | 63 | } |
57 | 64 | ||
58 | @Override | 65 | @Override |
59 | - public void getBanners(String position) { | 66 | + public void getBanners(String position, String areaName) { |
60 | 67 | ||
61 | - mRxManager.register(mIModel.getBanners(position).subscribe(new Consumer<JsonObject>() { | 68 | + mRxManager.register(mIModel.getBanners(position, areaName).subscribe(new Consumer<JsonObject>() { |
62 | @Override | 69 | @Override |
63 | public void accept(JsonObject jsonObject) throws Exception { | 70 | public void accept(JsonObject jsonObject) throws Exception { |
64 | - if (jsonObject.get("status").getAsString().equals("1")){ | ||
65 | - JsonArray jsonArray=jsonObject.getAsJsonArray("data"); | ||
66 | - List<GuangGaoBean> guangGaoBeanList=new ArrayList<>(); | 71 | + if (jsonObject.get("status").getAsString().equals("1")) { |
72 | + JsonArray jsonArray = jsonObject.getAsJsonArray("data"); | ||
73 | + List<GuangGaoBean> guangGaoBeanList = new ArrayList<>(); | ||
67 | for (int i = 0; i < jsonArray.size(); i++) { | 74 | for (int i = 0; i < jsonArray.size(); i++) { |
68 | - GuangGaoBean guangGaoBean=new Gson().fromJson(jsonArray.get(i).getAsJsonObject(),GuangGaoBean.class); | 75 | + GuangGaoBean guangGaoBean = new Gson().fromJson(jsonArray.get(i).getAsJsonObject(), GuangGaoBean.class); |
69 | guangGaoBeanList.add(guangGaoBean); | 76 | guangGaoBeanList.add(guangGaoBean); |
70 | } | 77 | } |
71 | mIView.showBanners(guangGaoBeanList); | 78 | mIView.showBanners(guangGaoBeanList); |
72 | - }else { | 79 | + } else { |
73 | ToastUtils.showToast(jsonObject.get("message").getAsString()); | 80 | ToastUtils.showToast(jsonObject.get("message").getAsString()); |
74 | } | 81 | } |
75 | } | 82 | } |
76 | }, new Consumer<Throwable>() { | 83 | }, new Consumer<Throwable>() { |
77 | @Override | 84 | @Override |
78 | public void accept(Throwable throwable) throws Exception { | 85 | public void accept(Throwable throwable) throws Exception { |
86 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
87 | + } | ||
88 | + })); | ||
89 | + } | ||
90 | + | ||
91 | + @Override | ||
92 | + public void getContextChannel(String areaName, int channel, int toFirstPage, int pageIndex) { | ||
93 | + mRxManager.register(mIModel.getContextChannel(areaName, channel, toFirstPage, pageIndex).subscribe(new Consumer<JsonObject>() { | ||
94 | + @Override | ||
95 | + public void accept(JsonObject jsonObject) throws Exception { | ||
96 | + ToastUtils.showToast(jsonObject.toString()); | ||
97 | + JsonObject json=jsonObject.getAsJsonObject("data"); | ||
98 | + Gson g=new Gson(); | ||
99 | + ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | ||
100 | + List<ChannelContextBean> contextList = channelInfo.getChannelContent(); | ||
101 | + List<ChannelBean> channelList = channelInfo.getSubchannel(); | ||
102 | + mIView.showChannel(channelList); | ||
103 | + mIView.showContext(contextList); | ||
104 | + | ||
105 | + | ||
106 | + | ||
79 | 107 | ||
80 | } | 108 | } |
109 | + }, new Consumer<Throwable>() { | ||
110 | + @Override | ||
111 | + public void accept(Throwable throwable) throws Exception { | ||
112 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
113 | + } | ||
81 | })); | 114 | })); |
115 | + | ||
116 | + | ||
117 | + | ||
82 | } | 118 | } |
83 | 119 | ||
84 | @Override | 120 | @Override |
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java
@@ -54,8 +54,8 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | @@ -54,8 +54,8 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | ||
54 | } | 54 | } |
55 | 55 | ||
56 | @Override | 56 | @Override |
57 | - public void getBanners(String position) { | ||
58 | - mRxManager.register(mIModel.getBanners(position).subscribe(new Consumer<JsonObject>() { | 57 | + public void getBanners(String position,String areaName) { |
58 | + mRxManager.register(mIModel.getBanners(position,areaName).subscribe(new Consumer<JsonObject>() { | ||
59 | @Override | 59 | @Override |
60 | public void accept(JsonObject jsonObject) throws Exception { | 60 | public void accept(JsonObject jsonObject) throws Exception { |
61 | if (jsonObject.get("status").getAsString().equals("1")){ | 61 | if (jsonObject.get("status").getAsString().equals("1")){ |
@@ -79,10 +79,11 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | @@ -79,10 +79,11 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ | ||
79 | } | 79 | } |
80 | 80 | ||
81 | @Override | 81 | @Override |
82 | - public void getConsultContent() { | 82 | + public void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex) { |
83 | 83 | ||
84 | } | 84 | } |
85 | 85 | ||
86 | + | ||
86 | @Override | 87 | @Override |
87 | public ConsultOneContract.IConsultOneModel getModel() { | 88 | public ConsultOneContract.IConsultOneModel getModel() { |
88 | return ConsultOneModel.newInstance(); | 89 | return ConsultOneModel.newInstance(); |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
@@ -50,6 +50,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -50,6 +50,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
50 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | 50 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); |
51 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); | 51 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); |
52 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); | 52 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); |
53 | + AppConfig.ISLOGIN = true; | ||
53 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); | 54 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); |
54 | getUserInfo(loginName, 0, ""); | 55 | getUserInfo(loginName, 0, ""); |
55 | } else { | 56 | } else { |
@@ -89,7 +90,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -89,7 +90,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
89 | //TODO 注册成功返回 | 90 | //TODO 注册成功返回 |
90 | Log.e("1111", jsonObject.toString()); | 91 | Log.e("1111", jsonObject.toString()); |
91 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); | 92 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); |
92 | - AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); | 93 | +// AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); |
93 | mIView.getUserInfo(1); | 94 | mIView.getUserInfo(1); |
94 | } | 95 | } |
95 | }, new Consumer<Throwable>() { | 96 | }, new Consumer<Throwable>() { |
@@ -144,6 +145,8 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -144,6 +145,8 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
144 | String account = currentBean.getUserid(); | 145 | String account = currentBean.getUserid(); |
145 | String token = Utils.MD5(account); | 146 | String token = Utils.MD5(account); |
146 | nimLogin(account, token); | 147 | nimLogin(account, token); |
148 | + mIView.getUserInfo(0); | ||
149 | + | ||
147 | } else { | 150 | } else { |
148 | LoginAndRegistFragment.progressDialog.dismiss(); | 151 | LoginAndRegistFragment.progressDialog.dismiss(); |
149 | ToastUtils.showToast("错误"); | 152 | ToastUtils.showToast("错误"); |
@@ -168,6 +171,21 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -168,6 +171,21 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
168 | } | 171 | } |
169 | })); | 172 | })); |
170 | } | 173 | } |
174 | + public void reSetpassResult(final String adminName, String idCode, String password) { | ||
175 | + mRxManager.register(mIModel.reSetpass(adminName, idCode, password).subscribe(new Consumer<JsonObject>() { | ||
176 | + @Override | ||
177 | + public void accept(JsonObject jsonObject) throws Exception { | ||
178 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); | ||
179 | + mIView.getUserInfo(2); | ||
180 | + } | ||
181 | + }, new Consumer<Throwable>() { | ||
182 | + @Override | ||
183 | + public void accept(Throwable throwable) throws Exception { | ||
184 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
185 | + } | ||
186 | + })); | ||
187 | + | ||
188 | + } | ||
171 | 189 | ||
172 | 190 | ||
173 | @Override | 191 | @Override |
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
@@ -64,8 +64,8 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -64,8 +64,8 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
64 | } | 64 | } |
65 | 65 | ||
66 | @Override | 66 | @Override |
67 | - public void addChild(int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | ||
68 | - mRxManager.register(mIModel.addChildResult(parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | 67 | + public void addChild( int sex , String studentName,int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { |
68 | + mRxManager.register(mIModel.addChildResult(sex,studentName,parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | ||
69 | @Override | 69 | @Override |
70 | public void accept(JsonObject jsonObject) throws Exception { | 70 | public void accept(JsonObject jsonObject) throws Exception { |
71 | ToastUtils.showToast("绑定孩子成功"); | 71 | ToastUtils.showToast("绑定孩子成功"); |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
@@ -25,6 +25,7 @@ import com.shunzhi.parent.bean.CurrentBean; | @@ -25,6 +25,7 @@ import com.shunzhi.parent.bean.CurrentBean; | ||
25 | import com.shunzhi.parent.contract.mine.MyChildContract; | 25 | import com.shunzhi.parent.contract.mine.MyChildContract; |
26 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; | 26 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
27 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 27 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
28 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | ||
28 | 29 | ||
29 | import java.util.List; | 30 | import java.util.List; |
30 | 31 | ||
@@ -81,9 +82,9 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -81,9 +82,9 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
81 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(child_sex.getText()) | 82 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(child_sex.getText()) |
82 | && !TextUtils.isEmpty(child_grade.getText()) && !TextUtils.isEmpty(child_class.getText())) { | 83 | && !TextUtils.isEmpty(child_grade.getText()) && !TextUtils.isEmpty(child_class.getText())) { |
83 | if (isNew == 0) { | 84 | if (isNew == 0) { |
84 | - mPresenter.addChild(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), true, true, 0, 0, studentId,""); | 85 | + mPresenter.addChild(0,"",Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), true, true, 0, 0, studentId,""); |
85 | } else { | 86 | } else { |
86 | - mPresenter.addChild(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), false, true, 0, classId, studentId, ""); | 87 | + mPresenter.addChild(0,"",Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), false, true, 0, classId, studentId, ""); |
87 | } | 88 | } |
88 | } else { | 89 | } else { |
89 | final PopupWindow popupWindow = new PopupWindow(); | 90 | final PopupWindow popupWindow = new PopupWindow(); |
@@ -150,7 +151,11 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -150,7 +151,11 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
150 | @Override | 151 | @Override |
151 | public void addChildSuccess() { | 152 | public void addChildSuccess() { |
152 | // WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); | 153 | // WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); |
154 | + WebViewActivity.getInstance(CheckInfoActivity.this, | ||
155 | + AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+ | ||
156 | + AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_HEZUO); | ||
153 | finish(); | 157 | finish(); |
158 | + | ||
154 | } | 159 | } |
155 | 160 | ||
156 | @Override | 161 | @Override |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java
1 | package com.shunzhi.parent.ui.activity.binding; | 1 | package com.shunzhi.parent.ui.activity.binding; |
2 | 2 | ||
3 | -import android.content.Intent; | ||
4 | import android.os.Bundle; | 3 | import android.os.Bundle; |
5 | import android.support.annotation.NonNull; | 4 | import android.support.annotation.NonNull; |
6 | import android.support.v4.util.ArrayMap; | 5 | import android.support.v4.util.ArrayMap; |
7 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
7 | +import android.util.Log; | ||
8 | import android.view.ContextMenu; | 8 | import android.view.ContextMenu; |
9 | import android.view.MenuItem; | 9 | import android.view.MenuItem; |
10 | import android.view.View; | 10 | import android.view.View; |
@@ -21,7 +21,7 @@ import com.shunzhi.parent.bean.ChildClass; | @@ -21,7 +21,7 @@ import com.shunzhi.parent.bean.ChildClass; | ||
21 | import com.shunzhi.parent.bean.CurrentBean; | 21 | import com.shunzhi.parent.bean.CurrentBean; |
22 | import com.shunzhi.parent.contract.mine.MyChildContract; | 22 | import com.shunzhi.parent.contract.mine.MyChildContract; |
23 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; | 23 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
24 | -import com.shunzhi.parent.ui.activity.MyChildActivity; | 24 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
25 | 25 | ||
26 | import java.util.ArrayList; | 26 | import java.util.ArrayList; |
27 | import java.util.List; | 27 | import java.util.List; |
@@ -62,6 +62,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -62,6 +62,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
62 | } | 62 | } |
63 | }); | 63 | }); |
64 | add_child = findViewById(R.id.add_child); | 64 | add_child = findViewById(R.id.add_child); |
65 | + add_child.setOnClickListener(this); | ||
65 | child_name = findViewById(R.id.child_name); | 66 | child_name = findViewById(R.id.child_name); |
66 | select_sex = findViewById(R.id.select_sex); | 67 | select_sex = findViewById(R.id.select_sex); |
67 | select_grade = findViewById(R.id.select_grade); | 68 | select_grade = findViewById(R.id.select_grade); |
@@ -70,6 +71,8 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -70,6 +71,8 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
70 | select_grade.setOnClickListener(this); | 71 | select_grade.setOnClickListener(this); |
71 | select_class.setOnClickListener(this); | 72 | select_class.setOnClickListener(this); |
72 | registerForContextMenu(select_sex); | 73 | registerForContextMenu(select_sex); |
74 | + registerForContextMenu(select_grade); | ||
75 | + registerForContextMenu(select_class); | ||
73 | sexList.add("男"); | 76 | sexList.add("男"); |
74 | sexList.add("女"); | 77 | sexList.add("女"); |
75 | 78 | ||
@@ -90,7 +93,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -90,7 +93,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
90 | if (v == add_child) { | 93 | if (v == add_child) { |
91 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(select_sex.getText()) | 94 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(select_sex.getText()) |
92 | && !TextUtils.isEmpty(select_grade.getText()) && !TextUtils.isEmpty(select_class.getText())) { | 95 | && !TextUtils.isEmpty(select_grade.getText()) && !TextUtils.isEmpty(select_class.getText())) { |
93 | - mPresenter.addChild(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)) | 96 | + mPresenter.addChild(sexId,child_name.getText().toString(),Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)) |
94 | , true, false, school_id, classId, 0, ""); | 97 | , true, false, school_id, classId, 0, ""); |
95 | } else { | 98 | } else { |
96 | ToastUtils.showToast("请填写完整的孩子信息"); | 99 | ToastUtils.showToast("请填写完整的孩子信息"); |
@@ -128,19 +131,22 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -128,19 +131,22 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
128 | 131 | ||
129 | @Override | 132 | @Override |
130 | public void addChildSuccess() { | 133 | public void addChildSuccess() { |
131 | - startActivity(new Intent().setClass(CreateChildInfoActivity.this, MyChildActivity.class)); | 134 | + WebViewActivity.getInstance(CreateChildInfoActivity.this,AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_NOT); |
132 | finish(); | 135 | finish(); |
133 | } | 136 | } |
134 | 137 | ||
135 | @Override | 138 | @Override |
136 | public void showClass(List<ChildClass> list) { | 139 | public void showClass(List<ChildClass> list) { |
137 | if (list.size() > 0 && list != null) { | 140 | if (list.size() > 0 && list != null) { |
141 | + Log.e("111-===",list.get(0).getGradeName()); | ||
138 | if (list.get(0).getGradeId() == 0) { | 142 | if (list.get(0).getGradeId() == 0) { |
139 | //班级列表 | 143 | //班级列表 |
140 | - classList = list; | 144 | + classList.clear(); |
145 | + classList.addAll(list); | ||
141 | } else { | 146 | } else { |
142 | //年级列表 | 147 | //年级列表 |
143 | - gradeList = list; | 148 | + gradeList.clear(); |
149 | + gradeList.addAll(list); | ||
144 | } | 150 | } |
145 | 151 | ||
146 | } | 152 | } |
@@ -175,7 +181,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -175,7 +181,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
175 | } else if (type == 1) { | 181 | } else if (type == 1) { |
176 | for (int i = 0; i < gradeList.size(); i++) { | 182 | for (int i = 0; i < gradeList.size(); i++) { |
177 | try { | 183 | try { |
178 | - final String title = gradeList.get(i).getClassName(); | 184 | + final String title = gradeList.get(i).getGradeName(); |
179 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 185 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { |
180 | @Override | 186 | @Override |
181 | public boolean onMenuItemClick(MenuItem item) { | 187 | public boolean onMenuItemClick(MenuItem item) { |
@@ -192,7 +198,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -192,7 +198,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
192 | } else if (type == 2) { | 198 | } else if (type == 2) { |
193 | for (int i = 0; i < classList.size(); i++) { | 199 | for (int i = 0; i < classList.size(); i++) { |
194 | try { | 200 | try { |
195 | - final String title = classList.get(i).getGradeName(); | 201 | + final String title = classList.get(i).getClassName(); |
196 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 202 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { |
197 | @Override | 203 | @Override |
198 | public boolean onMenuItemClick(MenuItem item) { | 204 | public boolean onMenuItemClick(MenuItem item) { |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
@@ -186,9 +186,14 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | @@ -186,9 +186,14 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | ||
186 | @Override | 186 | @Override |
187 | public void showList(List<SchoolBean> list) { | 187 | public void showList(List<SchoolBean> list) { |
188 | final List<SortBean> schoolList = OrderedSortSmodel(list); | 188 | final List<SortBean> schoolList = OrderedSortSmodel(list); |
189 | + if(schoolListAdapter==null){ | ||
189 | schoolListAdapter = new SchoolListAdapter(this, schoolList); | 190 | schoolListAdapter = new SchoolListAdapter(this, schoolList); |
190 | schoolListAdapter.addAll(schoolList); | 191 | schoolListAdapter.addAll(schoolList); |
191 | schoollist.setAdapter(schoolListAdapter); | 192 | schoollist.setAdapter(schoolListAdapter); |
193 | + }else{ | ||
194 | + schoolListAdapter.addAll(schoolList); | ||
195 | + schoolListAdapter.notifyDataSetChanged(); | ||
196 | + } | ||
192 | } | 197 | } |
193 | 198 | ||
194 | @Override | 199 | @Override |
@@ -208,6 +213,9 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | @@ -208,6 +213,9 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | ||
208 | 213 | ||
209 | @Override | 214 | @Override |
210 | public void getCity(String name) { | 215 | public void getCity(String name) { |
216 | + tvLocalAddress.setText(name.split(" ")[2]); | ||
217 | + mPresenter.schoolListResult(name.split(" ")[2],""); | ||
218 | + | ||
211 | 219 | ||
212 | } | 220 | } |
213 | } | 221 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
@@ -8,7 +8,6 @@ import android.os.Bundle; | @@ -8,7 +8,6 @@ import android.os.Bundle; | ||
8 | import android.support.annotation.NonNull; | 8 | import android.support.annotation.NonNull; |
9 | import android.support.annotation.Nullable; | 9 | import android.support.annotation.Nullable; |
10 | import android.support.design.widget.FloatingActionButton; | 10 | import android.support.design.widget.FloatingActionButton; |
11 | -import android.util.Log; | ||
12 | import android.view.View; | 11 | import android.view.View; |
13 | import android.widget.FrameLayout; | 12 | import android.widget.FrameLayout; |
14 | import android.widget.ImageView; | 13 | import android.widget.ImageView; |
@@ -17,13 +16,12 @@ import android.widget.TextView; | @@ -17,13 +16,12 @@ import android.widget.TextView; | ||
17 | 16 | ||
18 | import com.share.mvpsdk.base.BasePresenter; | 17 | import com.share.mvpsdk.base.BasePresenter; |
19 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 18 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
20 | -import com.share.mvpsdk.utils.DisplayUtils; | ||
21 | import com.share.mvpsdk.utils.ToastUtils; | 19 | import com.share.mvpsdk.utils.ToastUtils; |
22 | import com.shunzhi.parent.AppContext; | 20 | import com.shunzhi.parent.AppContext; |
23 | import com.shunzhi.parent.R; | 21 | import com.shunzhi.parent.R; |
24 | import com.shunzhi.parent.contract.ceping.CepingContract; | 22 | import com.shunzhi.parent.contract.ceping.CepingContract; |
25 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; | 23 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; |
26 | -import com.shunzhi.parent.views.DragFloatActionButton; | 24 | +import com.shunzhi.parent.ui.activity.MyChildActivity; |
27 | import com.shunzhi.parent.views.TextAndImgShowView; | 25 | import com.shunzhi.parent.views.TextAndImgShowView; |
28 | 26 | ||
29 | import me.leefeng.citypicker.CityPicker; | 27 | import me.leefeng.citypicker.CityPicker; |
@@ -80,7 +78,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | @@ -80,7 +78,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP | ||
80 | floatingActionButton.setOnClickListener(new View.OnClickListener() { | 78 | floatingActionButton.setOnClickListener(new View.OnClickListener() { |
81 | @Override | 79 | @Override |
82 | public void onClick(View view) { | 80 | public void onClick(View view) { |
83 | - | 81 | + startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); |
84 | } | 82 | } |
85 | }); | 83 | }); |
86 | // floatingActionButton.setOnClickListeners(new DragFloatActionButton.OnClickListeners() { | 84 | // floatingActionButton.setOnClickListeners(new DragFloatActionButton.OnClickListeners() { |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -7,6 +7,8 @@ import android.content.IntentFilter; | @@ -7,6 +7,8 @@ import android.content.IntentFilter; | ||
7 | import android.os.Bundle; | 7 | import android.os.Bundle; |
8 | import android.support.annotation.NonNull; | 8 | import android.support.annotation.NonNull; |
9 | import android.support.annotation.Nullable; | 9 | import android.support.annotation.Nullable; |
10 | +import android.support.v7.widget.LinearLayoutManager; | ||
11 | +import android.support.v7.widget.RecyclerView; | ||
10 | import android.view.View; | 12 | import android.view.View; |
11 | import android.widget.ImageView; | 13 | import android.widget.ImageView; |
12 | import android.widget.LinearLayout; | 14 | import android.widget.LinearLayout; |
@@ -18,14 +20,17 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | @@ -18,14 +20,17 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | ||
18 | import com.shunzhi.parent.AppConfig; | 20 | import com.shunzhi.parent.AppConfig; |
19 | import com.shunzhi.parent.AppContext; | 21 | import com.shunzhi.parent.AppContext; |
20 | import com.shunzhi.parent.R; | 22 | import com.shunzhi.parent.R; |
23 | +import com.shunzhi.parent.adapter.ContextAdapter; | ||
21 | import com.shunzhi.parent.bean.GuangGaoBean; | 24 | import com.shunzhi.parent.bean.GuangGaoBean; |
25 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
26 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
22 | import com.shunzhi.parent.contract.consult.ConsultContract; | 27 | import com.shunzhi.parent.contract.consult.ConsultContract; |
23 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; | 28 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
29 | +import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; | ||
30 | +import com.shunzhi.parent.util.AttrsUtils; | ||
31 | +import com.shunzhi.parent.views.TextAndImgShowView; | ||
24 | import com.stx.xhb.xbanner.XBanner; | 32 | import com.stx.xhb.xbanner.XBanner; |
25 | 33 | ||
26 | -import java.io.ByteArrayOutputStream; | ||
27 | -import java.io.IOException; | ||
28 | -import java.io.InputStream; | ||
29 | import java.util.ArrayList; | 34 | import java.util.ArrayList; |
30 | import java.util.List; | 35 | import java.util.List; |
31 | 36 | ||
@@ -33,15 +38,20 @@ import cn.jzvd.JZVideoPlayerStandard; | @@ -33,15 +38,20 @@ import cn.jzvd.JZVideoPlayerStandard; | ||
33 | import me.leefeng.citypicker.CityPicker; | 38 | import me.leefeng.citypicker.CityPicker; |
34 | import me.leefeng.citypicker.CityPickerListener; | 39 | import me.leefeng.citypicker.CityPickerListener; |
35 | 40 | ||
36 | -public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter,ConsultContract.IConsultModel> implements View.OnClickListener | ||
37 | -,ConsultContract.IConsultView,CityPickerListener{ | 41 | +public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.ConsultPresenter, ConsultContract.IConsultModel> implements View.OnClickListener |
42 | + , ConsultContract.IConsultView, CityPickerListener { | ||
38 | 43 | ||
39 | ImageView ivSearch; | 44 | ImageView ivSearch; |
40 | 45 | ||
41 | XBanner xBanner; | 46 | XBanner xBanner; |
42 | 47 | ||
48 | + RecyclerView recycler_context; | ||
49 | + | ||
50 | + ContextAdapter contextAdapter; | ||
51 | + | ||
43 | List<String> imgesUrl = new ArrayList<>(); | 52 | List<String> imgesUrl = new ArrayList<>(); |
44 | List<String> describeList = new ArrayList<>(); | 53 | List<String> describeList = new ArrayList<>(); |
54 | + List<ChannelContextBean> contextList = new ArrayList<>(); | ||
45 | 55 | ||
46 | JZVideoPlayerStandard videoplayer; | 56 | JZVideoPlayerStandard videoplayer; |
47 | 57 | ||
@@ -49,8 +59,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -49,8 +59,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
49 | 59 | ||
50 | LinearLayout layout_control; | 60 | LinearLayout layout_control; |
51 | 61 | ||
52 | - CityPicker cityPicker=null; | ||
53 | - | 62 | + CityPicker cityPicker = null; |
63 | + | ||
54 | @Override | 64 | @Override |
55 | public int getLayoutId() { | 65 | public int getLayoutId() { |
56 | return R.layout.fragment_zi_xun; | 66 | return R.layout.fragment_zi_xun; |
@@ -59,25 +69,36 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -59,25 +69,36 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
59 | @Override | 69 | @Override |
60 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 70 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
61 | 71 | ||
72 | + | ||
73 | + recycler_context = view.findViewById(R.id.recycler_content); | ||
74 | + initRecycler(); | ||
75 | + | ||
62 | ivSearch = view.findViewById(R.id.ivSearch); | 76 | ivSearch = view.findViewById(R.id.ivSearch); |
63 | xBanner = view.findViewById(R.id.xBanner); | 77 | xBanner = view.findViewById(R.id.xBanner); |
64 | videoplayer = view.findViewById(R.id.videoplayer); | 78 | videoplayer = view.findViewById(R.id.videoplayer); |
65 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); | 79 | tvLocalAddress = view.findViewById(R.id.tvLocalAddress); |
66 | - layout_control=view.findViewById(R.id.layout_control); | 80 | + layout_control = view.findViewById(R.id.layout_control); |
67 | 81 | ||
68 | tvLocalAddress.setText(AppContext.getInstance().cityName); | 82 | tvLocalAddress.setText(AppContext.getInstance().cityName); |
69 | videoplayer.batteryLevel.setVisibility(View.GONE); | 83 | videoplayer.batteryLevel.setVisibility(View.GONE); |
70 | videoplayer.replayTextView.setVisibility(View.GONE); | 84 | videoplayer.replayTextView.setVisibility(View.GONE); |
71 | videoplayer.backButton.setVisibility(View.GONE); | 85 | videoplayer.backButton.setVisibility(View.GONE); |
72 | 86 | ||
73 | - mPresenter.getTools(layout_control); | ||
74 | - mPresenter.getBanners("2"); | 87 | +// mPresenter.getTools(layout_control); |
88 | + mPresenter.getBanners("2", "余杭区"); | ||
89 | + mPresenter.getContextChannel("余杭区", 0, 1, 1); | ||
75 | 90 | ||
76 | initBroadCast(); | 91 | initBroadCast(); |
77 | 92 | ||
78 | initListeners(); | 93 | initListeners(); |
79 | } | 94 | } |
80 | 95 | ||
96 | + private void initRecycler() { | ||
97 | + recycler_context.setLayoutManager(new LinearLayoutManager(getActivity())); | ||
98 | + contextAdapter = new ContextAdapter(getActivity()); | ||
99 | + | ||
100 | + } | ||
101 | + | ||
81 | private void initListeners() { | 102 | private void initListeners() { |
82 | ivSearch.setOnClickListener(this); | 103 | ivSearch.setOnClickListener(this); |
83 | tvLocalAddress.setOnClickListener(this); | 104 | tvLocalAddress.setOnClickListener(this); |
@@ -118,8 +139,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -118,8 +139,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
118 | switch (view.getId()) { | 139 | switch (view.getId()) { |
119 | case R.id.tvLocalAddress: | 140 | case R.id.tvLocalAddress: |
120 | // AppContext.getInstance().startLocation(); | 141 | // AppContext.getInstance().startLocation(); |
121 | - if (null==cityPicker)cityPicker=new CityPicker(getActivity(),this); | ||
122 | - if (cityPicker.isShow())cityPicker.close(); | 142 | + if (null == cityPicker) cityPicker = new CityPicker(getActivity(), this); |
143 | + if (cityPicker.isShow()) cityPicker.close(); | ||
123 | else cityPicker.show(); | 144 | else cityPicker.show(); |
124 | break; | 145 | break; |
125 | case R.id.ivSearch://搜索按钮 | 146 | case R.id.ivSearch://搜索按钮 |
@@ -149,8 +170,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -149,8 +170,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
149 | @Override | 170 | @Override |
150 | public void onDestroy() { | 171 | public void onDestroy() { |
151 | super.onDestroy(); | 172 | super.onDestroy(); |
152 | - if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver); | ||
153 | - if (null!=cityPicker)cityPicker.cancle(); | 173 | + if (null != broadcastReceiver) getActivity().unregisterReceiver(broadcastReceiver); |
174 | + if (null != cityPicker) cityPicker.cancle(); | ||
154 | } | 175 | } |
155 | 176 | ||
156 | @Override | 177 | @Override |
@@ -161,13 +182,48 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -161,13 +182,48 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
161 | @Override | 182 | @Override |
162 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { | 183 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
163 | for (int i = 0; i < guangGaoBeanList.size(); i++) { | 184 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
164 | - imgesUrl.add(AppConfig.BASE_URL_IMG+guangGaoBeanList.get(i).fileSrc); | 185 | + imgesUrl.add(AppConfig.BASE_URL_IMG + guangGaoBeanList.get(i).fileSrc); |
165 | describeList.add(guangGaoBeanList.get(i).describe); | 186 | describeList.add(guangGaoBeanList.get(i).describe); |
166 | } | 187 | } |
167 | initBanners(); | 188 | initBanners(); |
168 | } | 189 | } |
169 | 190 | ||
170 | @Override | 191 | @Override |
192 | + public void showChannel(List<ChannelBean> list) { | ||
193 | + for (int i = 0; i < list.size(); i++) { | ||
194 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(getActivity()); | ||
195 | + textAndImgShowView.setTextColor(R.color.textColor); | ||
196 | + textAndImgShowView.setText(list.get(i).getChannelName()); | ||
197 | +// textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(list.get(i).getChannelImage())); | ||
198 | + textAndImgShowView.addImgs(list.get(i).getChannelImage()); | ||
199 | + textAndImgShowView.setSelect(true); | ||
200 | + textAndImgShowView.setWidth(getActivity(), layout_control); | ||
201 | + textAndImgShowView.setBackground(AttrsUtils.getAttrs(getActivity()).getDrawable(0)); | ||
202 | + textAndImgShowView.setOnClickListener(new View.OnClickListener() { | ||
203 | + @Override | ||
204 | + public void onClick(View view) { | ||
205 | + ConsultOneLevelActivity.getInstance(getActivity()); | ||
206 | + } | ||
207 | + }); | ||
208 | + layout_control.addView(textAndImgShowView); | ||
209 | + } | ||
210 | + | ||
211 | + | ||
212 | + | ||
213 | + | ||
214 | + } | ||
215 | + | ||
216 | + @Override | ||
217 | + public void showContext(List<ChannelContextBean> list) { | ||
218 | + contextList.clear(); | ||
219 | + contextList.addAll(list); | ||
220 | + contextAdapter.addAll(contextList); | ||
221 | + recycler_context.setAdapter(contextAdapter); | ||
222 | + | ||
223 | + | ||
224 | + } | ||
225 | + | ||
226 | + @Override | ||
171 | public void getCity(String name) { | 227 | public void getCity(String name) { |
172 | tvLocalAddress.setText(name.split(" ")[1]); | 228 | tvLocalAddress.setText(name.split(" ")[1]); |
173 | } | 229 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
@@ -20,14 +20,15 @@ import com.shunzhi.parent.R; | @@ -20,14 +20,15 @@ import com.shunzhi.parent.R; | ||
20 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | 20 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
21 | import com.shunzhi.parent.contract.mine.MineContract; | 21 | import com.shunzhi.parent.contract.mine.MineContract; |
22 | import com.shunzhi.parent.presenter.mine.MinePresenter; | 22 | import com.shunzhi.parent.presenter.mine.MinePresenter; |
23 | +import com.shunzhi.parent.ui.activity.LoginAndRegistActivity; | ||
23 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 24 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
24 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 25 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; |
25 | -import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | ||
26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
27 | +import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | ||
27 | 28 | ||
28 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 29 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
29 | implements MineContract.IMineView, View.OnClickListener { | 30 | implements MineContract.IMineView, View.OnClickListener { |
30 | - LinearLayout childlayout, personinfo,layout_orderDetail,layout_order; | 31 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; |
31 | RoundedImageView user_photo; | 32 | RoundedImageView user_photo; |
32 | TextView user_name, user_mobile; | 33 | TextView user_name, user_mobile; |
33 | 34 | ||
@@ -46,8 +47,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -46,8 +47,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
46 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 47 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
47 | childlayout = view.findViewById(R.id.childlayout); | 48 | childlayout = view.findViewById(R.id.childlayout); |
48 | personinfo = view.findViewById(R.id.personinfo); | 49 | personinfo = view.findViewById(R.id.personinfo); |
49 | - layout_order=view.findViewById(R.id.layout_order); | ||
50 | - layout_orderDetail=view.findViewById(R.id.layout_orderDetail); | 50 | + layout_order = view.findViewById(R.id.layout_order); |
51 | + layout_orderDetail = view.findViewById(R.id.layout_orderDetail); | ||
51 | childlayout.setOnClickListener(this); | 52 | childlayout.setOnClickListener(this); |
52 | personinfo.setOnClickListener(this); | 53 | personinfo.setOnClickListener(this); |
53 | layout_order.setOnClickListener(this); | 54 | layout_order.setOnClickListener(this); |
@@ -59,19 +60,21 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -59,19 +60,21 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
59 | } | 60 | } |
60 | 61 | ||
61 | private void setPersonInfo() { | 62 | private void setPersonInfo() { |
62 | - String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | ||
63 | - ToastUtils.showToast(url); | ||
64 | - if (!TextUtils.isEmpty(url)) { | ||
65 | - Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | ||
66 | - } else { | ||
67 | - Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | 63 | + if (AppConfig.ISLOGIN) { |
64 | + String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | ||
65 | + ToastUtils.showToast(url); | ||
66 | + if (!TextUtils.isEmpty(url)) { | ||
67 | + Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | ||
68 | + } else { | ||
69 | + Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | ||
70 | + user_photo.setCornerRadius(20); | ||
71 | + } | ||
68 | user_photo.setCornerRadius(20); | 72 | user_photo.setCornerRadius(20); |
73 | + user_photo.setOval(true); | ||
74 | + user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); | ||
75 | + user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | ||
76 | + user_mobile.setVisibility(View.VISIBLE); | ||
69 | } | 77 | } |
70 | - user_photo.setCornerRadius(20); | ||
71 | - user_photo.setOval(true); | ||
72 | - user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); | ||
73 | - user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | ||
74 | - | ||
75 | } | 78 | } |
76 | 79 | ||
77 | 80 | ||
@@ -82,16 +85,20 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -82,16 +85,20 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
82 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); | 85 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); |
83 | break; | 86 | break; |
84 | case R.id.personinfo: | 87 | case R.id.personinfo: |
85 | - startActivity(new Intent().setClass(getActivity(), PersonInfoActivity.class)); | 88 | + if (AppConfig.ISLOGIN) |
89 | + startActivity(new Intent().setClass(getActivity(), PersonInfoActivity.class)); | ||
90 | + else | ||
91 | + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
86 | break; | 92 | break; |
87 | case R.id.layout_orderDetail: | 93 | case R.id.layout_orderDetail: |
88 | startNewActivity(OrderDetailActivity.class); | 94 | startNewActivity(OrderDetailActivity.class); |
89 | break; | 95 | break; |
90 | case R.id.layout_order: | 96 | case R.id.layout_order: |
91 | - Bundle bundle=new Bundle(); | ||
92 | - bundle.putString("url",AppConfig.BASE_URL_ORDER+"ParentOrderCenter.aspx?userid="+ | ||
93 | - AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID)); | ||
94 | - startNewActivity(WebViewActivity.class,bundle); | 97 | + Bundle bundle = new Bundle(); |
98 | + bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" + | ||
99 | + AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID)); | ||
100 | + bundle.putInt("type",AppConfig.ORDER_CENTER); | ||
101 | + startNewActivity(WebViewActivity.class, bundle); | ||
95 | break; | 102 | break; |
96 | default: | 103 | default: |
97 | break; | 104 | break; |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
@@ -14,6 +14,8 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | @@ -14,6 +14,8 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | ||
14 | import com.shunzhi.parent.AppConfig; | 14 | import com.shunzhi.parent.AppConfig; |
15 | import com.shunzhi.parent.R; | 15 | import com.shunzhi.parent.R; |
16 | import com.shunzhi.parent.bean.GuangGaoBean; | 16 | import com.shunzhi.parent.bean.GuangGaoBean; |
17 | +import com.shunzhi.parent.bean.channel.ChannelBean; | ||
18 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | ||
17 | import com.shunzhi.parent.contract.consult.ConsultContract; | 19 | import com.shunzhi.parent.contract.consult.ConsultContract; |
18 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; | 20 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
19 | import com.shunzhi.parent.ui.MainActivity; | 21 | import com.shunzhi.parent.ui.MainActivity; |
@@ -36,9 +38,9 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -36,9 +38,9 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
36 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 38 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
37 | xBanner = view.findViewById(R.id.xBanner); | 39 | xBanner = view.findViewById(R.id.xBanner); |
38 | if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START))) { | 40 | if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START))) { |
39 | - mPresenter.getBanners("0"); | 41 | + mPresenter.getBanners("0","杭州"); |
40 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); | 42 | AppConfig.getAppConfig(getContext()).set(AppConfig.APP_IS_START, "1"); |
41 | - } else mPresenter.getBanners("1"); | 43 | + } else mPresenter.getBanners("1","杭州"); |
42 | } | 44 | } |
43 | 45 | ||
44 | @NonNull | 46 | @NonNull |
@@ -57,6 +59,16 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -57,6 +59,16 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
57 | initBannes(guangGaoBeanList); | 59 | initBannes(guangGaoBeanList); |
58 | } | 60 | } |
59 | 61 | ||
62 | + @Override | ||
63 | + public void showChannel(List<ChannelBean> list) { | ||
64 | + | ||
65 | + } | ||
66 | + | ||
67 | + @Override | ||
68 | + public void showContext(List<ChannelContextBean> list) { | ||
69 | + | ||
70 | + } | ||
71 | + | ||
60 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { | 72 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
61 | final List<String> imgUrl = new ArrayList<>(); | 73 | final List<String> imgUrl = new ArrayList<>(); |
62 | List<String> describeList = new ArrayList<>(); | 74 | List<String> describeList = new ArrayList<>(); |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
@@ -23,7 +23,6 @@ import com.share.mvpsdk.utils.DisplayUtils; | @@ -23,7 +23,6 @@ import com.share.mvpsdk.utils.DisplayUtils; | ||
23 | import com.shunzhi.parent.AppConfig; | 23 | import com.shunzhi.parent.AppConfig; |
24 | import com.shunzhi.parent.R; | 24 | import com.shunzhi.parent.R; |
25 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 25 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
26 | -import com.shunzhi.parent.bean.GrallyBean; | ||
27 | import com.shunzhi.parent.bean.GuangGaoBean; | 26 | import com.shunzhi.parent.bean.GuangGaoBean; |
28 | import com.shunzhi.parent.bean.MyConsultBean; | 27 | import com.shunzhi.parent.bean.MyConsultBean; |
29 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 28 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
@@ -82,7 +81,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -82,7 +81,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
82 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); | 81 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
83 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); | 82 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
84 | 83 | ||
85 | - mPresenter.getBanners("3"); | 84 | + mPresenter.getBanners("3","杭州"); |
86 | initRecyclerViewConsult(); | 85 | initRecyclerViewConsult(); |
87 | } | 86 | } |
88 | 87 | ||
@@ -128,7 +127,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -128,7 +127,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
128 | 127 | ||
129 | @Override | 128 | @Override |
130 | public void showConsultContent() { | 129 | public void showConsultContent() { |
131 | - | ||
132 | } | 130 | } |
133 | 131 | ||
134 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { | 132 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { |
@@ -167,7 +165,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -167,7 +165,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
167 | public void onBindViewHolder(GuangGaoBean object, int position) { | 165 | public void onBindViewHolder(GuangGaoBean object, int position) { |
168 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | 166 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); |
169 | // iv_grally.setImageResource(R.drawable.ic_launcher_background); | 167 | // iv_grally.setImageResource(R.drawable.ic_launcher_background); |
170 | - tv_grally_title.setText(object.describe); | 168 | + tv_grally_title.setText(object.describe+""); |
171 | } | 169 | } |
172 | } | 170 | } |
173 | } | 171 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
@@ -106,7 +106,6 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -106,7 +106,6 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
106 | et_password_new = view.findViewById(R.id.et_password_new); | 106 | et_password_new = view.findViewById(R.id.et_password_new); |
107 | et_password_new.addTextChangedListener(textWatcher); | 107 | et_password_new.addTextChangedListener(textWatcher); |
108 | 108 | ||
109 | - | ||
110 | if ("登录".equals(typepage)) { | 109 | if ("登录".equals(typepage)) { |
111 | idCodeLayout.setVisibility(View.GONE); | 110 | idCodeLayout.setVisibility(View.GONE); |
112 | passwordLayout_new.setVisibility(View.GONE); | 111 | passwordLayout_new.setVisibility(View.GONE); |
@@ -133,7 +132,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -133,7 +132,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
133 | roundedImageView.setOnClickListener(new View.OnClickListener() { | 132 | roundedImageView.setOnClickListener(new View.OnClickListener() { |
134 | @Override | 133 | @Override |
135 | public void onClick(View view) { | 134 | public void onClick(View view) { |
136 | - startNewActivity(MainActivity.class); | 135 | + mPresenter.loginResult("18358585335", "123456"); |
137 | } | 136 | } |
138 | }); | 137 | }); |
139 | } | 138 | } |
@@ -173,6 +172,10 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -173,6 +172,10 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
173 | 172 | ||
174 | popupWindow.setContentView(view); | 173 | popupWindow.setContentView(view); |
175 | popupWindow.showAtLocation(main_login, Gravity.CENTER, 0, 0); | 174 | popupWindow.showAtLocation(main_login, Gravity.CENTER, 0, 0); |
175 | + }else if(type==3){ | ||
176 | + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
177 | + phoneNumber.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | ||
178 | + password.setFocusable(true); | ||
176 | } | 179 | } |
177 | 180 | ||
178 | 181 | ||
@@ -189,6 +192,13 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -189,6 +192,13 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
189 | mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString()); | 192 | mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString()); |
190 | } else if (loginAndRegister.getText().toString().trim().equals("确定")) { | 193 | } else if (loginAndRegister.getText().toString().trim().equals("确定")) { |
191 | //修改密码 | 194 | //修改密码 |
195 | + if(TextUtils.isEmpty(password.getText().toString())&&TextUtils.isEmpty(et_password_new.getText().toString())) { | ||
196 | + if(password.getText().toString().equals(et_password_new.getText().toString())) { | ||
197 | + mPresenter.reSetpassResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString()); | ||
198 | + }else{ | ||
199 | + ToastUtils.showToast("两次输入的密码不一致"); | ||
200 | + } | ||
201 | + } | ||
192 | } | 202 | } |
193 | 203 | ||
194 | } else if (v == tv_goto) { | 204 | } else if (v == tv_goto) { |
app/src/main/java/com/shunzhi/parent/views/TextAndImgShowView.java
@@ -4,7 +4,6 @@ import android.app.Activity; | @@ -4,7 +4,6 @@ import android.app.Activity; | ||
4 | import android.content.Context; | 4 | import android.content.Context; |
5 | import android.support.annotation.DrawableRes; | 5 | import android.support.annotation.DrawableRes; |
6 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
7 | -import android.text.Layout; | ||
8 | import android.util.AttributeSet; | 7 | import android.util.AttributeSet; |
9 | import android.util.Log; | 8 | import android.util.Log; |
10 | import android.view.View; | 9 | import android.view.View; |
4.53 KB
app/src/main/res/layout/fragment_login_and_regist.xml
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | android:layout_height="50dp" | 56 | android:layout_height="50dp" |
57 | android:background="@null" | 57 | android:background="@null" |
58 | android:hint="请输入手机号码" | 58 | android:hint="请输入手机号码" |
59 | - android:text="18358585335" | 59 | + android:text="" |
60 | android:maxLength="11" | 60 | android:maxLength="11" |
61 | android:textColorHint="@color/hintTextColor" | 61 | android:textColorHint="@color/hintTextColor" |
62 | android:textSize="@dimen/sp_16" /> | 62 | android:textSize="@dimen/sp_16" /> |
@@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
129 | android:layout_weight="1" | 129 | android:layout_weight="1" |
130 | android:background="@null" | 130 | android:background="@null" |
131 | android:hint="请设置密码:6~16个字符" | 131 | android:hint="请设置密码:6~16个字符" |
132 | - android:text="123456" | 132 | + android:text="" |
133 | android:maxLength="16" | 133 | android:maxLength="16" |
134 | android:inputType="textPassword" | 134 | android:inputType="textPassword" |
135 | android:textColorHint="@color/hintTextColor" | 135 | android:textColorHint="@color/hintTextColor" |
app/src/main/res/layout/fragment_mine.xml
@@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
40 | android:layout_width="60dp" | 40 | android:layout_width="60dp" |
41 | android:layout_height="60dp" | 41 | android:layout_height="60dp" |
42 | android:layout_margin="20dp" | 42 | android:layout_margin="20dp" |
43 | - android:src="@color/white" | 43 | + android:src="@drawable/user_imge_defult" |
44 | app:riv_corner_radius="10dp" /> | 44 | app:riv_corner_radius="10dp" /> |
45 | 45 | ||
46 | <LinearLayout | 46 | <LinearLayout |
@@ -48,13 +48,14 @@ | @@ -48,13 +48,14 @@ | ||
48 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" |
49 | android:layout_marginTop="25dp" | 49 | android:layout_marginTop="25dp" |
50 | android:layout_weight="1" | 50 | android:layout_weight="1" |
51 | + android:gravity="center_vertical" | ||
51 | android:orientation="vertical"> | 52 | android:orientation="vertical"> |
52 | 53 | ||
53 | <TextView | 54 | <TextView |
54 | android:id="@+id/user_name" | 55 | android:id="@+id/user_name" |
55 | android:layout_width="wrap_content" | 56 | android:layout_width="wrap_content" |
56 | android:layout_height="wrap_content" | 57 | android:layout_height="wrap_content" |
57 | - android:text="马铂賽" | 58 | + android:text="登录/注册" |
58 | android:textColor="@color/white" | 59 | android:textColor="@color/white" |
59 | android:textSize="@dimen/txtsize_headline" /> | 60 | android:textSize="@dimen/txtsize_headline" /> |
60 | 61 | ||
@@ -65,6 +66,7 @@ | @@ -65,6 +66,7 @@ | ||
65 | android:text="账号:12345678991" | 66 | android:text="账号:12345678991" |
66 | android:textColor="@color/white" | 67 | android:textColor="@color/white" |
67 | android:textSize="@dimen/txtsize_title" | 68 | android:textSize="@dimen/txtsize_title" |
69 | + android:visibility="gone" | ||
68 | 70 | ||
69 | /> | 71 | /> |
70 | 72 |
app/src/main/res/layout/fragment_zi_xun.xml
@@ -31,14 +31,23 @@ | @@ -31,14 +31,23 @@ | ||
31 | android:orientation="vertical"> | 31 | android:orientation="vertical"> |
32 | 32 | ||
33 | <TextView | 33 | <TextView |
34 | - android:layout_width="wrap_content" | 34 | + android:layout_width="match_parent" |
35 | android:layout_height="wrap_content" | 35 | android:layout_height="wrap_content" |
36 | android:text="@string/consult_huati" | 36 | android:text="@string/consult_huati" |
37 | android:textColor="@color/xueqing_blue" | 37 | android:textColor="@color/xueqing_blue" |
38 | android:textSize="@dimen/textSize16" /> | 38 | android:textSize="@dimen/textSize16" /> |
39 | 39 | ||
40 | - <include layout="@layout/layout_consult_content"/> | 40 | + <!--<include layout="@layout/layout_consult_content"/>--> |
41 | + <LinearLayout | ||
42 | + android:layout_width="match_parent" | ||
43 | + android:layout_height="wrap_content"> | ||
44 | + <android.support.v7.widget.RecyclerView | ||
45 | + android:id="@+id/recycler_content" | ||
46 | + android:layout_width="match_parent" | ||
47 | + android:layout_height="match_parent"> | ||
41 | 48 | ||
49 | + </android.support.v7.widget.RecyclerView> | ||
50 | + </LinearLayout> | ||
42 | </LinearLayout> | 51 | </LinearLayout> |
43 | 52 | ||
44 | 53 |
app/src/main/res/layout/layout_consult_content.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | - android:layout_marginBottom="@dimen/size_dp_10" | ||
5 | - android:layout_height="wrap_content"> | 4 | + android:layout_height="wrap_content" |
5 | + android:layout_marginBottom="@dimen/size_dp_10"> | ||
6 | + | ||
6 | <LinearLayout | 7 | <LinearLayout |
7 | android:layout_width="match_parent" | 8 | android:layout_width="match_parent" |
8 | android:layout_height="match_parent" | 9 | android:layout_height="match_parent" |
@@ -45,27 +46,34 @@ | @@ -45,27 +46,34 @@ | ||
45 | android:layout_height="wrap_content" | 46 | android:layout_height="wrap_content" |
46 | android:layout_marginTop="@dimen/size_dp_5"> | 47 | android:layout_marginTop="@dimen/size_dp_5"> |
47 | 48 | ||
48 | - <TextView | ||
49 | - android:id="@+id/tvPingLunNums" | ||
50 | - style="@style/TextView_Wrap_16" | ||
51 | - android:layout_gravity="center_vertical" | ||
52 | - android:text="评论:30" | ||
53 | - android:textSize="@dimen/textSize14" /> | 49 | + <RelativeLayout |
50 | + android:layout_width="match_parent" | ||
51 | + android:layout_height="wrap_content"> | ||
52 | + | ||
53 | + <TextView | ||
54 | + android:id="@+id/tvPingLunNums" | ||
55 | + style="@style/TextView_Wrap_16" | ||
56 | + android:layout_gravity="center_vertical" | ||
57 | + android:text="评论:30" | ||
58 | + android:textSize="@dimen/textSize14" /> | ||
54 | 59 | ||
55 | - <TextView | ||
56 | - android:id="@+id/tvZhuanFaNums" | ||
57 | - style="@style/TextView_Wrap_16" | ||
58 | - android:layout_gravity="right|center_vertical" | ||
59 | - android:text="转发:50" | ||
60 | - android:textSize="@dimen/textSize14" /> | 60 | + <TextView |
61 | + android:id="@+id/tvZhuanFaNums" | ||
62 | + style="@style/TextView_Wrap_16" | ||
63 | + android:layout_alignParentRight="true" | ||
64 | + android:layout_centerVertical="true" | ||
65 | + android:text="转发:50" | ||
66 | + android:textSize="@dimen/textSize14" /> | ||
67 | + </RelativeLayout> | ||
61 | </FrameLayout> | 68 | </FrameLayout> |
69 | + | ||
62 | </LinearLayout> | 70 | </LinearLayout> |
63 | 71 | ||
64 | <ImageView | 72 | <ImageView |
65 | - android:layout_margin="@dimen/size_dp_2" | ||
66 | android:id="@+id/iv_consult" | 73 | android:id="@+id/iv_consult" |
67 | android:layout_width="0dp" | 74 | android:layout_width="0dp" |
68 | android:layout_height="match_parent" | 75 | android:layout_height="match_parent" |
76 | + android:layout_margin="@dimen/size_dp_2" | ||
69 | android:layout_weight="2" | 77 | android:layout_weight="2" |
70 | android:src="@color/xueqing_blue" /> | 78 | android:src="@color/xueqing_blue" /> |
71 | </LinearLayout> | 79 | </LinearLayout> |
app/src/main/res/layout/layout_textandimgshow.xml
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | android:layout_height="wrap_content" | 4 | android:layout_height="wrap_content" |
5 | android:orientation="horizontal" | 5 | android:orientation="horizontal" |
6 | + android:background="@drawable/report_white" | ||
6 | android:scrollbars="none"> | 7 | android:scrollbars="none"> |
7 | 8 | ||
8 | <HorizontalScrollView | 9 | <HorizontalScrollView |