Commit d64a88799ac90e499ab08345c04f661e50625247
Exists in
yxb_dev
and in
2 other branches
Merge branch 'developer' of http://git.shunzhi.net/taohd/parentwork into developer
Showing
38 changed files
with
639 additions
and
138 deletions
Show diff stats
app/src/main/AndroidManifest.xml
| ... | ... | @@ -112,17 +112,18 @@ |
| 112 | 112 | android:name="com.amap.api.v2.apikey" |
| 113 | 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 | 117 | <intent-filter> |
| 117 | 118 | <action android:name="android.intent.action.MAIN"/> |
| 118 | 119 | |
| 119 | 120 | <category android:name="android.intent.category.LAUNCHER"/> |
| 120 | 121 | </intent-filter> |
| 121 | 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 | 127 | <activity |
| 127 | 128 | android:name=".ui.activity.MyChildActivity" |
| 128 | 129 | android:screenOrientation="portrait"/> |
| ... | ... | @@ -142,9 +143,10 @@ |
| 142 | 143 | android:name=".ui.activity.binding.SelectSchoolActivity" |
| 143 | 144 | android:screenOrientation="portrait" |
| 144 | 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 | 150 | <activity |
| 149 | 151 | android:name=".ui.activity.PersonInfoActivity" |
| 150 | 152 | android:screenOrientation="portrait" | ... | ... |
app/src/main/java/com/shunzhi/parent/AppConfig.java
| ... | ... | @@ -22,13 +22,14 @@ public class AppConfig { |
| 22 | 22 | public static String USER_SEX = "user_sex"; |
| 23 | 23 | public static String USER_IMAGE = "user_image"; |
| 24 | 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 | 34 | //http://campus.myjxt.com/ |
| 34 | 35 | public static String BASE_URL="http://60.190.202.57:1000/"; |
| ... | ... | @@ -36,7 +37,6 @@ public class AppConfig { |
| 36 | 37 | public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; |
| 37 | 38 | |
| 38 | 39 | |
| 39 | - | |
| 40 | 40 | //默认日志保存的路径 |
| 41 | 41 | public final static String DEFAULT_SAVE_LOG_PATH = Environment |
| 42 | 42 | .getExternalStorageDirectory() | ... | ... |
app/src/main/java/com/shunzhi/parent/adapter/ContextAdapter.java
0 → 100644
| ... | ... | @@ -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 | 3 | import com.google.gson.JsonObject; |
| 4 | 4 | |
| 5 | 5 | import io.reactivex.Observable; |
| 6 | +import retrofit2.http.Field; | |
| 7 | +import retrofit2.http.FormUrlEncoded; | |
| 6 | 8 | import retrofit2.http.GET; |
| 9 | +import retrofit2.http.POST; | |
| 7 | 10 | import retrofit2.http.Query; |
| 8 | 11 | |
| 9 | 12 | /** |
| ... | ... | @@ -12,9 +15,13 @@ import retrofit2.http.Query; |
| 12 | 15 | |
| 13 | 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 | 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 | 42 | @GET("api/Account/ChangePhoneCaptcha") |
| 37 | 43 | Observable<JsonObject> getidCodeResult( |
| 38 | 44 | @Query("mobile") String username); | ... | ... |
app/src/main/java/com/shunzhi/parent/api/MineApi.java
| ... | ... | @@ -32,7 +32,7 @@ public interface MineApi { |
| 32 | 32 | @FormUrlEncoded |
| 33 | 33 | @POST("/api/ParentHelper/BindlingChildren") |
| 34 | 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 | 36 | , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId); |
| 37 | 37 | |
| 38 | 38 | @GET("/api/ParentHelper/GetClassOrGrade") | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/channel/ChannelBean.java
0 → 100644
| ... | ... | @@ -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 @@ |
| 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 @@ |
| 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 | 7 | import com.share.mvpsdk.base.IBaseFragment; |
| 8 | 8 | import com.share.mvpsdk.base.IBaseModel; |
| 9 | 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 | 13 | import java.util.List; |
| 12 | 14 | |
| ... | ... | @@ -18,23 +20,31 @@ import io.reactivex.Observable; |
| 18 | 20 | |
| 19 | 21 | public interface ConsultContract { |
| 20 | 22 | |
| 21 | - abstract class ConsultPresenter extends BasePresenter<IConsultModel,IConsultView>{ | |
| 23 | + abstract class ConsultPresenter extends BasePresenter<IConsultModel, IConsultView> { | |
| 22 | 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 | 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 | 41 | void showTools(); |
| 36 | 42 | |
| 37 | 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 | 21 | abstract class ConsultOnePresenter extends BasePresenter<IConsultOneModel,IConsultOneView>{ |
| 22 | 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 | 29 | interface IConsultOneModel extends IBaseModel{ |
| 30 | 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 | 37 | interface IConsultOneView extends IBaseFragment{ | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
| ... | ... | @@ -25,6 +25,7 @@ public interface LoginAndRegisterContract { |
| 25 | 25 | public abstract void getUserInfo(String mobile,int school_id,String captcha); |
| 26 | 26 | |
| 27 | 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 | 31 | interface ILoginModel extends IBaseModel{ |
| ... | ... | @@ -38,6 +39,7 @@ public interface LoginAndRegisterContract { |
| 38 | 39 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); |
| 39 | 40 | |
| 40 | 41 | Observable<NIMLoginResultBean> nimLoginResult(String account, String token); |
| 42 | + Observable<JsonObject> reSetpass(String adminName,String idCode,String password); | |
| 41 | 43 | } |
| 42 | 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 | 21 | |
| 22 | 22 | abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> { |
| 23 | 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 | 25 | , int schoolId,int classId,int studentId,String studentUserId); |
| 26 | 26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); |
| 27 | 27 | |
| ... | ... | @@ -31,7 +31,7 @@ public interface MyChildContract { |
| 31 | 31 | |
| 32 | 32 | interface IMyChildModel extends IBaseModel { |
| 33 | 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 | 35 | , int schoolId,int classId,int studentId,String studentUserId); |
| 36 | 36 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); |
| 37 | 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 | import com.share.mvpsdk.helper.RxHelper; |
| 7 | 7 | import com.shunzhi.parent.AppConfig; |
| 8 | 8 | import com.shunzhi.parent.api.Consult; |
| 9 | +import com.shunzhi.parent.api.LoginRegisterApi; | |
| 10 | +import com.shunzhi.parent.bean.UserInfo; | |
| 9 | 11 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 10 | 12 | |
| 11 | 13 | import io.reactivex.Observable; |
| ... | ... | @@ -23,9 +25,17 @@ public class ConsultModel extends BaseModel implements ConsultContract.IConsultM |
| 23 | 25 | } |
| 24 | 26 | |
| 25 | 27 | @Override |
| 26 | - public Observable<JsonObject> getBanners(String position) { | |
| 28 | + public Observable<JsonObject> getBanners(String position,String areaName) { | |
| 27 | 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 | 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 | 27 | } |
| 28 | 28 | |
| 29 | 29 | @Override |
| 30 | - public Observable<JsonObject> getBanners(String position) { | |
| 30 | + public Observable<JsonObject> getBanners(String position,String areaName) { | |
| 31 | 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 | 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
| ... | ... | @@ -54,4 +54,9 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste |
| 54 | 54 | return MessageManager.getInstance().login(account, token); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + public Observable<JsonObject> reSetpass(String adminName, String idCode, String password) { | |
| 58 | + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class, LoginRegisterApi.url).reSetpassResult(adminName, idCode, password) | |
| 59 | + .compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
| 60 | + } | |
| 61 | + | |
| 57 | 62 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/model/mine/MyChildModel.java
| ... | ... | @@ -11,6 +11,7 @@ import com.shunzhi.parent.bean.UserInfo; |
| 11 | 11 | import com.shunzhi.parent.contract.mine.MyChildContract; |
| 12 | 12 | |
| 13 | 13 | import io.reactivex.Observable; |
| 14 | +import retrofit2.http.Field; | |
| 14 | 15 | |
| 15 | 16 | /** |
| 16 | 17 | * Created by Administrator on 2018/3/8 0008. |
| ... | ... | @@ -30,9 +31,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM |
| 30 | 31 | |
| 31 | 32 | |
| 32 | 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 | 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 | 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 | 9 | import com.google.gson.Gson; |
| 10 | 10 | import com.google.gson.JsonArray; |
| 11 | 11 | import com.google.gson.JsonObject; |
| 12 | +import com.share.mvpsdk.utils.OkHttpExceptionUtil; | |
| 12 | 13 | import com.share.mvpsdk.utils.ToastUtils; |
| 13 | 14 | import com.shunzhi.parent.R; |
| 14 | 15 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 15 | 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 | 20 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 17 | 21 | import com.shunzhi.parent.model.consult.ConsultModel; |
| 18 | 22 | import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity; |
| 19 | 23 | import com.shunzhi.parent.util.AttrsUtils; |
| 20 | 24 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 21 | 25 | |
| 26 | +import org.json.JSONObject; | |
| 27 | + | |
| 22 | 28 | import java.util.ArrayList; |
| 23 | 29 | import java.util.List; |
| 24 | 30 | |
| 25 | 31 | import io.reactivex.functions.Consumer; |
| 32 | +import retrofit2.HttpException; | |
| 26 | 33 | |
| 27 | 34 | /** |
| 28 | 35 | * Created by ToaHanDong on 2018/3/14. |
| ... | ... | @@ -31,18 +38,18 @@ import io.reactivex.functions.Consumer; |
| 31 | 38 | public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
| 32 | 39 | @Override |
| 33 | 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 | 46 | for (int i = 0; i < toolBeanList.size(); i++) { |
| 40 | - TextAndImgShowView textAndImgShowView=new TextAndImgShowView(mIView.getBindActivity()); | |
| 47 | + TextAndImgShowView textAndImgShowView = new TextAndImgShowView(mIView.getBindActivity()); | |
| 41 | 48 | textAndImgShowView.setTextColor(R.color.textColor); |
| 42 | 49 | textAndImgShowView.setText(toolBeanList.get(i).toolName); |
| 43 | 50 | textAndImgShowView.setImgs(R.drawable.play, Integer.parseInt(toolBeanList.get(i).toolImage)); |
| 44 | 51 | textAndImgShowView.setSelect(true); |
| 45 | - textAndImgShowView.setWidth(mIView.getBindActivity(),layout_control); | |
| 52 | + textAndImgShowView.setWidth(mIView.getBindActivity(), layout_control); | |
| 46 | 53 | textAndImgShowView.setBackground(AttrsUtils.getAttrs(mIView.getBindActivity()).getDrawable(0)); |
| 47 | 54 | textAndImgShowView.setOnClickListener(new View.OnClickListener() { |
| 48 | 55 | @Override |
| ... | ... | @@ -56,29 +63,58 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
| 56 | 63 | } |
| 57 | 64 | |
| 58 | 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 | 69 | @Override |
| 63 | 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 | 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 | 76 | guangGaoBeanList.add(guangGaoBean); |
| 70 | 77 | } |
| 71 | 78 | mIView.showBanners(guangGaoBeanList); |
| 72 | - }else { | |
| 79 | + } else { | |
| 73 | 80 | ToastUtils.showToast(jsonObject.get("message").getAsString()); |
| 74 | 81 | } |
| 75 | 82 | } |
| 76 | 83 | }, new Consumer<Throwable>() { |
| 77 | 84 | @Override |
| 78 | 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 | 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 | 54 | } |
| 55 | 55 | |
| 56 | 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 | 59 | @Override |
| 60 | 60 | public void accept(JsonObject jsonObject) throws Exception { |
| 61 | 61 | if (jsonObject.get("status").getAsString().equals("1")){ |
| ... | ... | @@ -79,10 +79,11 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 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 | 87 | @Override |
| 87 | 88 | public ConsultOneContract.IConsultOneModel getModel() { |
| 88 | 89 | return ConsultOneModel.newInstance(); | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| ... | ... | @@ -52,6 +52,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 52 | 52 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); |
| 53 | 53 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); |
| 54 | 54 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); |
| 55 | + AppConfig.ISLOGIN = true; | |
| 55 | 56 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); |
| 56 | 57 | getUserInfo(loginName, 0, ""); |
| 57 | 58 | } else { |
| ... | ... | @@ -91,7 +92,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 91 | 92 | //TODO 注册成功返回 |
| 92 | 93 | Log.e("1111", jsonObject.toString()); |
| 93 | 94 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); |
| 94 | - AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); | |
| 95 | +// AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); | |
| 95 | 96 | mIView.getUserInfo(1); |
| 96 | 97 | } |
| 97 | 98 | }, new Consumer<Throwable>() { |
| ... | ... | @@ -146,6 +147,8 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 146 | 147 | String account = currentBean.getUserid(); |
| 147 | 148 | String token = Utils.MD5(account); |
| 148 | 149 | nimLogin(account, token); |
| 150 | + mIView.getUserInfo(0); | |
| 151 | + | |
| 149 | 152 | } else { |
| 150 | 153 | LoginAndRegistFragment.progressDialog.dismiss(); |
| 151 | 154 | ToastUtils.showToast("错误"); |
| ... | ... | @@ -170,6 +173,21 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 170 | 173 | } |
| 171 | 174 | })); |
| 172 | 175 | } |
| 176 | + public void reSetpassResult(final String adminName, String idCode, String password) { | |
| 177 | + mRxManager.register(mIModel.reSetpass(adminName, idCode, password).subscribe(new Consumer<JsonObject>() { | |
| 178 | + @Override | |
| 179 | + public void accept(JsonObject jsonObject) throws Exception { | |
| 180 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); | |
| 181 | + mIView.getUserInfo(2); | |
| 182 | + } | |
| 183 | + }, new Consumer<Throwable>() { | |
| 184 | + @Override | |
| 185 | + public void accept(Throwable throwable) throws Exception { | |
| 186 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 187 | + } | |
| 188 | + })); | |
| 189 | + | |
| 190 | + } | |
| 173 | 191 | |
| 174 | 192 | |
| 175 | 193 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
| ... | ... | @@ -64,8 +64,8 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 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 | 69 | @Override |
| 70 | 70 | public void accept(JsonObject jsonObject) throws Exception { |
| 71 | 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 | 25 | import com.shunzhi.parent.contract.mine.MyChildContract; |
| 26 | 26 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
| 27 | 27 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
| 28 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 28 | 29 | |
| 29 | 30 | import java.util.List; |
| 30 | 31 | |
| ... | ... | @@ -81,9 +82,9 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC |
| 81 | 82 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(child_sex.getText()) |
| 82 | 83 | && !TextUtils.isEmpty(child_grade.getText()) && !TextUtils.isEmpty(child_class.getText())) { |
| 83 | 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 | 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 | 89 | } else { |
| 89 | 90 | final PopupWindow popupWindow = new PopupWindow(); |
| ... | ... | @@ -150,7 +151,11 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC |
| 150 | 151 | @Override |
| 151 | 152 | public void addChildSuccess() { |
| 152 | 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 | 157 | finish(); |
| 158 | + | |
| 154 | 159 | } |
| 155 | 160 | |
| 156 | 161 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java
| 1 | 1 | package com.shunzhi.parent.ui.activity.binding; |
| 2 | 2 | |
| 3 | -import android.content.Intent; | |
| 4 | 3 | import android.os.Bundle; |
| 5 | 4 | import android.support.annotation.NonNull; |
| 6 | 5 | import android.support.v4.util.ArrayMap; |
| 7 | 6 | import android.text.TextUtils; |
| 7 | +import android.util.Log; | |
| 8 | 8 | import android.view.ContextMenu; |
| 9 | 9 | import android.view.MenuItem; |
| 10 | 10 | import android.view.View; |
| ... | ... | @@ -21,7 +21,7 @@ import com.shunzhi.parent.bean.ChildClass; |
| 21 | 21 | import com.shunzhi.parent.bean.CurrentBean; |
| 22 | 22 | import com.shunzhi.parent.contract.mine.MyChildContract; |
| 23 | 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 | 26 | import java.util.ArrayList; |
| 27 | 27 | import java.util.List; |
| ... | ... | @@ -62,6 +62,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 62 | 62 | } |
| 63 | 63 | }); |
| 64 | 64 | add_child = findViewById(R.id.add_child); |
| 65 | + add_child.setOnClickListener(this); | |
| 65 | 66 | child_name = findViewById(R.id.child_name); |
| 66 | 67 | select_sex = findViewById(R.id.select_sex); |
| 67 | 68 | select_grade = findViewById(R.id.select_grade); |
| ... | ... | @@ -70,6 +71,8 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 70 | 71 | select_grade.setOnClickListener(this); |
| 71 | 72 | select_class.setOnClickListener(this); |
| 72 | 73 | registerForContextMenu(select_sex); |
| 74 | + registerForContextMenu(select_grade); | |
| 75 | + registerForContextMenu(select_class); | |
| 73 | 76 | sexList.add("男"); |
| 74 | 77 | sexList.add("女"); |
| 75 | 78 | |
| ... | ... | @@ -90,7 +93,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 90 | 93 | if (v == add_child) { |
| 91 | 94 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(select_sex.getText()) |
| 92 | 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 | 97 | , true, false, school_id, classId, 0, ""); |
| 95 | 98 | } else { |
| 96 | 99 | ToastUtils.showToast("请填写完整的孩子信息"); |
| ... | ... | @@ -128,19 +131,22 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 128 | 131 | |
| 129 | 132 | @Override |
| 130 | 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 | 135 | finish(); |
| 133 | 136 | } |
| 134 | 137 | |
| 135 | 138 | @Override |
| 136 | 139 | public void showClass(List<ChildClass> list) { |
| 137 | 140 | if (list.size() > 0 && list != null) { |
| 141 | + Log.e("111-===",list.get(0).getGradeName()); | |
| 138 | 142 | if (list.get(0).getGradeId() == 0) { |
| 139 | 143 | //班级列表 |
| 140 | - classList = list; | |
| 144 | + classList.clear(); | |
| 145 | + classList.addAll(list); | |
| 141 | 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 | 181 | } else if (type == 1) { |
| 176 | 182 | for (int i = 0; i < gradeList.size(); i++) { |
| 177 | 183 | try { |
| 178 | - final String title = gradeList.get(i).getClassName(); | |
| 184 | + final String title = gradeList.get(i).getGradeName(); | |
| 179 | 185 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { |
| 180 | 186 | @Override |
| 181 | 187 | public boolean onMenuItemClick(MenuItem item) { |
| ... | ... | @@ -192,7 +198,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra |
| 192 | 198 | } else if (type == 2) { |
| 193 | 199 | for (int i = 0; i < classList.size(); i++) { |
| 194 | 200 | try { |
| 195 | - final String title = classList.get(i).getGradeName(); | |
| 201 | + final String title = classList.get(i).getClassName(); | |
| 196 | 202 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { |
| 197 | 203 | @Override |
| 198 | 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 | 186 | @Override |
| 187 | 187 | public void showList(List<SchoolBean> list) { |
| 188 | 188 | final List<SortBean> schoolList = OrderedSortSmodel(list); |
| 189 | + if(schoolListAdapter==null){ | |
| 189 | 190 | schoolListAdapter = new SchoolListAdapter(this, schoolList); |
| 190 | 191 | schoolListAdapter.addAll(schoolList); |
| 191 | 192 | schoollist.setAdapter(schoolListAdapter); |
| 193 | + }else{ | |
| 194 | + schoolListAdapter.addAll(schoolList); | |
| 195 | + schoolListAdapter.notifyDataSetChanged(); | |
| 196 | + } | |
| 192 | 197 | } |
| 193 | 198 | |
| 194 | 199 | @Override |
| ... | ... | @@ -208,6 +213,9 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra |
| 208 | 213 | |
| 209 | 214 | @Override |
| 210 | 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/activity/mywebview/WebViewActivity.java
| ... | ... | @@ -25,9 +25,10 @@ public class WebViewActivity extends BaseCompatActivity { |
| 25 | 25 | |
| 26 | 26 | private ProgressBar pvWeb; |
| 27 | 27 | |
| 28 | - public static void getInstance(Context context,String url) { | |
| 28 | + public static void getInstance(Context context,String url,int type) { | |
| 29 | 29 | Intent intent = new Intent(context, WebViewActivity.class); |
| 30 | 30 | intent.putExtra("url", url); |
| 31 | + intent.putExtra("type",type); | |
| 31 | 32 | context.startActivity(intent); |
| 32 | 33 | } |
| 33 | 34 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| ... | ... | @@ -8,7 +8,6 @@ import android.os.Bundle; |
| 8 | 8 | import android.support.annotation.NonNull; |
| 9 | 9 | import android.support.annotation.Nullable; |
| 10 | 10 | import android.support.design.widget.FloatingActionButton; |
| 11 | -import android.util.Log; | |
| 12 | 11 | import android.view.View; |
| 13 | 12 | import android.widget.FrameLayout; |
| 14 | 13 | import android.widget.ImageView; |
| ... | ... | @@ -17,13 +16,12 @@ import android.widget.TextView; |
| 17 | 16 | |
| 18 | 17 | import com.share.mvpsdk.base.BasePresenter; |
| 19 | 18 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 20 | -import com.share.mvpsdk.utils.DisplayUtils; | |
| 21 | 19 | import com.share.mvpsdk.utils.ToastUtils; |
| 22 | 20 | import com.shunzhi.parent.AppContext; |
| 23 | 21 | import com.shunzhi.parent.R; |
| 24 | 22 | import com.shunzhi.parent.contract.ceping.CepingContract; |
| 25 | 23 | import com.shunzhi.parent.presenter.ceping.CePingPresenter; |
| 26 | -import com.shunzhi.parent.views.DragFloatActionButton; | |
| 24 | +import com.shunzhi.parent.ui.activity.MyChildActivity; | |
| 27 | 25 | import com.shunzhi.parent.views.TextAndImgShowView; |
| 28 | 26 | |
| 29 | 27 | import me.leefeng.citypicker.CityPicker; |
| ... | ... | @@ -80,7 +78,7 @@ public class CePingFragment extends BaseMVPCompatFragment<CepingContract.CePingP |
| 80 | 78 | floatingActionButton.setOnClickListener(new View.OnClickListener() { |
| 81 | 79 | @Override |
| 82 | 80 | public void onClick(View view) { |
| 83 | - | |
| 81 | + startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); | |
| 84 | 82 | } |
| 85 | 83 | }); |
| 86 | 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 | 7 | import android.os.Bundle; |
| 8 | 8 | import android.support.annotation.NonNull; |
| 9 | 9 | import android.support.annotation.Nullable; |
| 10 | +import android.support.v7.widget.LinearLayoutManager; | |
| 11 | +import android.support.v7.widget.RecyclerView; | |
| 10 | 12 | import android.view.View; |
| 11 | 13 | import android.widget.ImageView; |
| 12 | 14 | import android.widget.LinearLayout; |
| ... | ... | @@ -18,14 +20,17 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 18 | 20 | import com.shunzhi.parent.AppConfig; |
| 19 | 21 | import com.shunzhi.parent.AppContext; |
| 20 | 22 | import com.shunzhi.parent.R; |
| 23 | +import com.shunzhi.parent.adapter.ContextAdapter; | |
| 21 | 24 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 25 | +import com.shunzhi.parent.bean.channel.ChannelBean; | |
| 26 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 22 | 27 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 23 | 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 | 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 | 34 | import java.util.ArrayList; |
| 30 | 35 | import java.util.List; |
| 31 | 36 | |
| ... | ... | @@ -33,15 +38,20 @@ import cn.jzvd.JZVideoPlayerStandard; |
| 33 | 38 | import me.leefeng.citypicker.CityPicker; |
| 34 | 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 | 44 | ImageView ivSearch; |
| 40 | 45 | |
| 41 | 46 | XBanner xBanner; |
| 42 | 47 | |
| 48 | + RecyclerView recycler_context; | |
| 49 | + | |
| 50 | + ContextAdapter contextAdapter; | |
| 51 | + | |
| 43 | 52 | List<String> imgesUrl = new ArrayList<>(); |
| 44 | 53 | List<String> describeList = new ArrayList<>(); |
| 54 | + List<ChannelContextBean> contextList = new ArrayList<>(); | |
| 45 | 55 | |
| 46 | 56 | JZVideoPlayerStandard videoplayer; |
| 47 | 57 | |
| ... | ... | @@ -49,8 +59,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 49 | 59 | |
| 50 | 60 | LinearLayout layout_control; |
| 51 | 61 | |
| 52 | - CityPicker cityPicker=null; | |
| 53 | - | |
| 62 | + CityPicker cityPicker = null; | |
| 63 | + | |
| 54 | 64 | @Override |
| 55 | 65 | public int getLayoutId() { |
| 56 | 66 | return R.layout.fragment_zi_xun; |
| ... | ... | @@ -59,25 +69,36 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 59 | 69 | @Override |
| 60 | 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 | 76 | ivSearch = view.findViewById(R.id.ivSearch); |
| 63 | 77 | xBanner = view.findViewById(R.id.xBanner); |
| 64 | 78 | videoplayer = view.findViewById(R.id.videoplayer); |
| 65 | 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 | 82 | tvLocalAddress.setText(AppContext.getInstance().cityName); |
| 69 | 83 | videoplayer.batteryLevel.setVisibility(View.GONE); |
| 70 | 84 | videoplayer.replayTextView.setVisibility(View.GONE); |
| 71 | 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 | 91 | initBroadCast(); |
| 77 | 92 | |
| 78 | 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 | 102 | private void initListeners() { |
| 82 | 103 | ivSearch.setOnClickListener(this); |
| 83 | 104 | tvLocalAddress.setOnClickListener(this); |
| ... | ... | @@ -118,8 +139,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 118 | 139 | switch (view.getId()) { |
| 119 | 140 | case R.id.tvLocalAddress: |
| 120 | 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 | 144 | else cityPicker.show(); |
| 124 | 145 | break; |
| 125 | 146 | case R.id.ivSearch://搜索按钮 |
| ... | ... | @@ -149,8 +170,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 149 | 170 | @Override |
| 150 | 171 | public void onDestroy() { |
| 151 | 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 | 177 | @Override |
| ... | ... | @@ -161,13 +182,48 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 161 | 182 | @Override |
| 162 | 183 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
| 163 | 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 | 186 | describeList.add(guangGaoBeanList.get(i).describe); |
| 166 | 187 | } |
| 167 | 188 | initBanners(); |
| 168 | 189 | } |
| 169 | 190 | |
| 170 | 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 | 227 | public void getCity(String name) { |
| 172 | 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 | 20 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
| 21 | 21 | import com.shunzhi.parent.contract.mine.MineContract; |
| 22 | 22 | import com.shunzhi.parent.presenter.mine.MinePresenter; |
| 23 | +import com.shunzhi.parent.ui.activity.LoginAndRegistActivity; | |
| 23 | 24 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
| 24 | 25 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; |
| 25 | -import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | |
| 26 | 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; |
| 27 | +import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | |
| 27 | 28 | |
| 28 | 29 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
| 29 | 30 | implements MineContract.IMineView, View.OnClickListener { |
| 30 | - LinearLayout childlayout, personinfo,layout_orderDetail,layout_order; | |
| 31 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; | |
| 31 | 32 | RoundedImageView user_photo; |
| 32 | 33 | TextView user_name, user_mobile; |
| 33 | 34 | |
| ... | ... | @@ -46,8 +47,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
| 46 | 47 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 47 | 48 | childlayout = view.findViewById(R.id.childlayout); |
| 48 | 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 | 52 | childlayout.setOnClickListener(this); |
| 52 | 53 | personinfo.setOnClickListener(this); |
| 53 | 54 | layout_order.setOnClickListener(this); |
| ... | ... | @@ -59,19 +60,21 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 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 | 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 | 85 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); |
| 83 | 86 | break; |
| 84 | 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 | 92 | break; |
| 87 | 93 | case R.id.layout_orderDetail: |
| 88 | 94 | startNewActivity(OrderDetailActivity.class); |
| 89 | 95 | break; |
| 90 | 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 | 102 | break; |
| 96 | 103 | default: |
| 97 | 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 | 14 | import com.shunzhi.parent.AppConfig; |
| 15 | 15 | import com.shunzhi.parent.R; |
| 16 | 16 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 17 | +import com.shunzhi.parent.bean.channel.ChannelBean; | |
| 18 | +import com.shunzhi.parent.bean.channel.ChannelContextBean; | |
| 17 | 19 | import com.shunzhi.parent.contract.consult.ConsultContract; |
| 18 | 20 | import com.shunzhi.parent.presenter.consult.ConsultPresenter; |
| 19 | 21 | import com.shunzhi.parent.ui.MainActivity; |
| ... | ... | @@ -36,9 +38,9 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 36 | 38 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 37 | 39 | xBanner = view.findViewById(R.id.xBanner); |
| 38 | 40 | if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.APP_IS_START))) { |
| 39 | - mPresenter.getBanners("0"); | |
| 41 | + mPresenter.getBanners("0","杭州"); | |
| 40 | 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 | 46 | @NonNull |
| ... | ... | @@ -57,6 +59,16 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult |
| 57 | 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 | 72 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
| 61 | 73 | final List<String> imgUrl = new ArrayList<>(); |
| 62 | 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 | 23 | import com.shunzhi.parent.AppConfig; |
| 24 | 24 | import com.shunzhi.parent.R; |
| 25 | 25 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 26 | -import com.shunzhi.parent.bean.GrallyBean; | |
| 27 | 26 | import com.shunzhi.parent.bean.GuangGaoBean; |
| 28 | 27 | import com.shunzhi.parent.bean.MyConsultBean; |
| 29 | 28 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; |
| ... | ... | @@ -82,7 +81,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 82 | 81 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
| 83 | 82 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
| 84 | 83 | |
| 85 | - mPresenter.getBanners("3"); | |
| 84 | + mPresenter.getBanners("3","杭州"); | |
| 86 | 85 | initRecyclerViewConsult(); |
| 87 | 86 | } |
| 88 | 87 | |
| ... | ... | @@ -128,7 +127,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 128 | 127 | |
| 129 | 128 | @Override |
| 130 | 129 | public void showConsultContent() { |
| 131 | - | |
| 132 | 130 | } |
| 133 | 131 | |
| 134 | 132 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { |
| ... | ... | @@ -167,7 +165,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 167 | 165 | public void onBindViewHolder(GuangGaoBean object, int position) { |
| 168 | 166 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); |
| 169 | 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 | 106 | et_password_new = view.findViewById(R.id.et_password_new); |
| 107 | 107 | et_password_new.addTextChangedListener(textWatcher); |
| 108 | 108 | |
| 109 | - | |
| 110 | 109 | if ("登录".equals(typepage)) { |
| 111 | 110 | idCodeLayout.setVisibility(View.GONE); |
| 112 | 111 | passwordLayout_new.setVisibility(View.GONE); |
| ... | ... | @@ -133,7 +132,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
| 133 | 132 | roundedImageView.setOnClickListener(new View.OnClickListener() { |
| 134 | 133 | @Override |
| 135 | 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 | 172 | |
| 174 | 173 | popupWindow.setContentView(view); |
| 175 | 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 | 192 | mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString()); |
| 190 | 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 | 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 | 4 | import android.content.Context; |
| 5 | 5 | import android.support.annotation.DrawableRes; |
| 6 | 6 | import android.support.annotation.Nullable; |
| 7 | -import android.text.Layout; | |
| 8 | 7 | import android.util.AttributeSet; |
| 9 | 8 | import android.util.Log; |
| 10 | 9 | import android.view.View; | ... | ... |
4.53 KB
app/src/main/res/layout/fragment_login_and_regist.xml
| ... | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | android:layout_height="50dp" |
| 57 | 57 | android:background="@null" |
| 58 | 58 | android:hint="请输入手机号码" |
| 59 | - android:text="18358585335" | |
| 59 | + android:text="" | |
| 60 | 60 | android:maxLength="11" |
| 61 | 61 | android:textColorHint="@color/hintTextColor" |
| 62 | 62 | android:textSize="@dimen/sp_16" /> |
| ... | ... | @@ -129,7 +129,7 @@ |
| 129 | 129 | android:layout_weight="1" |
| 130 | 130 | android:background="@null" |
| 131 | 131 | android:hint="请设置密码:6~16个字符" |
| 132 | - android:text="123456" | |
| 132 | + android:text="" | |
| 133 | 133 | android:maxLength="16" |
| 134 | 134 | android:inputType="textPassword" |
| 135 | 135 | android:textColorHint="@color/hintTextColor" | ... | ... |
app/src/main/res/layout/fragment_mine.xml
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | android:layout_width="60dp" |
| 41 | 41 | android:layout_height="60dp" |
| 42 | 42 | android:layout_margin="20dp" |
| 43 | - android:src="@color/white" | |
| 43 | + android:src="@drawable/user_imge_defult" | |
| 44 | 44 | app:riv_corner_radius="10dp" /> |
| 45 | 45 | |
| 46 | 46 | <LinearLayout |
| ... | ... | @@ -48,13 +48,14 @@ |
| 48 | 48 | android:layout_height="wrap_content" |
| 49 | 49 | android:layout_marginTop="25dp" |
| 50 | 50 | android:layout_weight="1" |
| 51 | + android:gravity="center_vertical" | |
| 51 | 52 | android:orientation="vertical"> |
| 52 | 53 | |
| 53 | 54 | <TextView |
| 54 | 55 | android:id="@+id/user_name" |
| 55 | 56 | android:layout_width="wrap_content" |
| 56 | 57 | android:layout_height="wrap_content" |
| 57 | - android:text="马铂賽" | |
| 58 | + android:text="登录/注册" | |
| 58 | 59 | android:textColor="@color/white" |
| 59 | 60 | android:textSize="@dimen/txtsize_headline" /> |
| 60 | 61 | |
| ... | ... | @@ -65,6 +66,7 @@ |
| 65 | 66 | android:text="账号:12345678991" |
| 66 | 67 | android:textColor="@color/white" |
| 67 | 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 | 31 | android:orientation="vertical"> |
| 32 | 32 | |
| 33 | 33 | <TextView |
| 34 | - android:layout_width="wrap_content" | |
| 34 | + android:layout_width="match_parent" | |
| 35 | 35 | android:layout_height="wrap_content" |
| 36 | 36 | android:text="@string/consult_huati" |
| 37 | 37 | android:textColor="@color/xueqing_blue" |
| 38 | 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 | 51 | </LinearLayout> |
| 43 | 52 | |
| 44 | 53 | ... | ... |
app/src/main/res/layout/layout_consult_content.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | 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 | 7 | <LinearLayout |
| 7 | 8 | android:layout_width="match_parent" |
| 8 | 9 | android:layout_height="match_parent" |
| ... | ... | @@ -45,27 +46,34 @@ |
| 45 | 46 | android:layout_height="wrap_content" |
| 46 | 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 | 68 | </FrameLayout> |
| 69 | + | |
| 62 | 70 | </LinearLayout> |
| 63 | 71 | |
| 64 | 72 | <ImageView |
| 65 | - android:layout_margin="@dimen/size_dp_2" | |
| 66 | 73 | android:id="@+id/iv_consult" |
| 67 | 74 | android:layout_width="0dp" |
| 68 | 75 | android:layout_height="match_parent" |
| 76 | + android:layout_margin="@dimen/size_dp_2" | |
| 69 | 77 | android:layout_weight="2" |
| 70 | 78 | android:src="@color/xueqing_blue" /> |
| 71 | 79 | </LinearLayout> | ... | ... |
app/src/main/res/layout/layout_textandimgshow.xml