Commit 6f3b25be by mReturn

公开课拆分

parent 3730bc0c
......@@ -5,6 +5,7 @@ import com.dayu.base.api.protocol.AddShareRecordData;
import com.dayu.base.api.protocol.AddressInfoBean;
import com.dayu.base.api.protocol.BaseResponse;
import com.dayu.base.api.protocol.BankInfoBean;
import com.dayu.base.api.protocol.EngineerBean;
import com.dayu.base.api.protocol.OpenRedPacketBean;
import com.dayu.base.api.protocol.RedPacketBean;
import com.dayu.base.api.protocol.TreeAddressBean;
......@@ -138,4 +139,14 @@ public interface APIService {
*/
@POST(Constants.API_7900 + "/shareRecord")
Observable<BaseResponse<Boolean>> addShareRecord(@Body AddShareRecordData data);
/**
* 获取师傅信息.
*
* @param accountId
* @return
*/
@GET(Constants.API_7100+"/engineerInfo/mobile/accountId/{accountId}")
Observable<BaseResponse<EngineerBean>> getEngineerInfo(@Path("accountId") int accountId);
}
package com.dayu.base.api.protocol;
import android.databinding.BaseObservable;
import android.databinding.Bindable;
import java.io.Serializable;
public class EngineerBean extends BaseObservable implements Serializable {
private int id;
private int accountId;
private String realName;
private String identity;
private String identityUrl;
private String accountUrl;
private int auditStatus;
private String createTime;
private Object created;
private Object updateTime;
private Object updated;
private int gender;
private int age;
private String mobile;
private Object siteId;
private Object password;
private Object categorys;
private Object providerTypeList;
private Object messageCheckcode;
private String invitationCode;
private int liveStatus;
private int lianmaiStatus;
public int getLianmaiStatus() {
return lianmaiStatus;
}
public void setLianmaiStatus(int lianmaiStatus) {
this.lianmaiStatus = lianmaiStatus;
}
public int getLiveStatus() {
return liveStatus;
}
public void setLiveStatus(int liveStatus) {
this.liveStatus = liveStatus;
}
public String getInvitationCode() {
return invitationCode;
}
public void setInvitationCode(String invitationCode) {
this.invitationCode = invitationCode;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
@Bindable
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
@Bindable
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
@Bindable
public String getIdentityUrl() {
return identityUrl;
}
public void setIdentityUrl(String identityUrl) {
this.identityUrl = identityUrl;
}
@Bindable
public String getAccountUrl() {
return accountUrl;
}
public void setAccountUrl(String accountUrl) {
this.accountUrl = accountUrl;
}
@Bindable
public int getAduitStatus() {
return auditStatus;
}
public void setAduitStatus(int aduitStatus) {
this.auditStatus = aduitStatus;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public Object getCreated() {
return created;
}
public void setCreated(Object created) {
this.created = created;
}
public Object getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Object updateTime) {
this.updateTime = updateTime;
}
public Object getUpdated() {
return updated;
}
public void setUpdated(Object updated) {
this.updated = updated;
}
public int getGender() {
return gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Object getSiteId() {
return siteId;
}
public void setSiteId(Object siteId) {
this.siteId = siteId;
}
public Object getPassword() {
return password;
}
public void setPassword(Object password) {
this.password = password;
}
public Object getCategorys() {
return categorys;
}
public void setCategorys(Object categorys) {
this.categorys = categorys;
}
public Object getProviderTypeList() {
return providerTypeList;
}
public void setProviderTypeList(Object providerTypeList) {
this.providerTypeList = providerTypeList;
}
public Object getMessageCheckcode() {
return messageCheckcode;
}
public void setMessageCheckcode(Object messageCheckcode) {
this.messageCheckcode = messageCheckcode;
}
}
......@@ -42,18 +42,18 @@ public class Constants {
/**
* dev环境配置.
*/
// public static String ENVIROMENT = "debug";
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
// public static String BASE_URL = "http://47.94.101.239:3112";
// public static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
// public static String CHECK_MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manyServiceResult";
// public static String MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manySop";
// public static String WEB_SOP_DETAIL = "http://47.94.101.239:9004/#/sopdetail";
// public static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
// public static final String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
// public static final String UP_VIDEO = "/file/uploadVideoOne?targetPath=dev/video";
// public static final boolean IS_DEBUG = true;
// public static String VIDEO_SHARE_URL = "http://uat.kf.ai:9099/#/shareVideo?type=_type&id="; //uat 学习视频分享链接 type(课程: course 直播: live)
public static String ENVIROMENT = "debug";
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static String BASE_URL = "http://47.94.101.239:3112";
public static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
public static String CHECK_MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manyServiceResult";
public static String MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manySop";
public static String WEB_SOP_DETAIL = "http://47.94.101.239:9004/#/sopdetail";
public static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
public static final String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public static final String UP_VIDEO = "/file/uploadVideoOne?targetPath=dev/video";
public static final boolean IS_DEBUG = true;
public static String VIDEO_SHARE_URL = "http://uat.kf.ai:9099/#/shareVideo?type=_type&id="; //uat 学习视频分享链接 type(课程: course 直播: live)
/**
......@@ -77,18 +77,18 @@ public class Constants {
/**
* 正式环境.
*/
public static String ENVIROMENT = "release";
public static int LOG_LEVEL = LogUtils.LEVEL_OFF;
public static String BASE_URL = "https://mobile.kf.ai";
public static String WEB_SOP = "https://sop.kf.ai/#/sop";
public static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
public static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
public static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
public static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
public static final String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
public static final String UP_VIDEO = "/file/uploadVideoOne?targetPath=online/video";
public static final boolean IS_DEBUG = false;
public static String VIDEO_SHARE_URL = "http://app.dl.kf.ai/ext/#/shareVideo?type=_type&id="; //学习视频分享链接 type(课程: course 直播: live)
// public static String ENVIROMENT = "release";
// public static int LOG_LEVEL = LogUtils.LEVEL_OFF;
// public static String BASE_URL = "https://mobile.kf.ai";
// public static String WEB_SOP = "https://sop.kf.ai/#/sop";
// public static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
// public static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
// public static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
// public static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
// public static final String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public static final String UP_VIDEO = "/file/uploadVideoOne?targetPath=online/video";
// public static final boolean IS_DEBUG = false;
// public static String VIDEO_SHARE_URL = "http://app.dl.kf.ai/ext/#/shareVideo?type=_type&id="; //学习视频分享链接 type(课程: course 直播: live)
/**
......
......@@ -38,6 +38,15 @@ public class UserInfo {
private String mobile;
private int liveStatus; //1.开启主播权限
private int ianmaiStatus; //1.开启连麦权限
public int getIanmaiStatus() {
return ianmaiStatus;
}
public void setIanmaiStatus(int ianmaiStatus) {
this.ianmaiStatus = ianmaiStatus;
}
public int getLiveStatus() {
return liveStatus;
......
......@@ -4,22 +4,23 @@
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tabtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:textSize="30sp"
android:layout_height="40dp"
android:gravity="center|bottom"
android:textColor="#585858"
/>
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tabicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#585858"
android:textSize="13.3sp"
android:layout_gravity="center"/>
android:textSize="13.3sp" />
</LinearLayout>
\ No newline at end of file
......@@ -1000,6 +1000,7 @@ C) 在甲方使用大鱼平台服务过程中产生的业务数据,客户数
<string name="find_course">查找课程</string>
<array name="learn_top_tab_item">
<item>公开课</item>
<item>经验交流</item>
<item>直播</item>
<item>已学习</item>
<item>已发布</item>
......
......@@ -43,6 +43,11 @@ public class LearnAdapter extends CoreAdapter<CommonLearnBean, ItemCommonLearnBi
holder.tvProgress.setVisibility(View.VISIBLE);
holder.tvProgress.setText(mContext.getString(R.string.learn_progress) + item.getProgressPercentage() + "%");
}
if ((type == 1 || type == 4) && item.getTopStatus() == 1) {
holder.tvTop.setVisibility(View.VISIBLE);
}else{
holder.tvTop.setVisibility(View.GONE);
}
holder.ivLike.setImageResource(item.getPointStatus() == 1 ? R.drawable.icon_like_red : R.drawable.icon_like_gray);
holder.tvDisable.setVisibility(type == 3 && item.getStatus() != 1 ? View.VISIBLE : View.GONE);
// holder.rlCover.setVisibility(item.isShowCover()? View.VISIBLE : View.GONE);
......
......@@ -176,4 +176,18 @@ public interface LearnService {
*/
@GET(Constants.API_7900 + "/live/watcher/{liveId}")
Observable<BaseResponse<Boolean>> playBackVideo(@Path("liveId") int liveId);
/**
* 获取已发布的视频
*
* @param type 1.服务商 2.师傅
*/
@GET(Constants.API_7900 + "/courses/engineer")
Observable<BaseResponse<BasePageBean<CommonLearnBean>>> getLearnVideos(@Query("engineerId") int engineerId,
@Query("type") int type,
@Query("status") int status,
@Query("key") String key,
@Query("page") int page,
@Query("pageSize") int pageSize);
}
......@@ -50,7 +50,15 @@ public class CommonLearnBean {
private boolean showCover = true;
private int shares;
private int shareWatchs;
private int topStatus;
public int getTopStatus() {
return topStatus;
}
public void setTopStatus(int topStatus) {
this.topStatus = topStatus;
}
public int getShareWatchs() {
return shareWatchs;
......
......@@ -12,6 +12,24 @@ public class LearnTabBean {
private int publishes;
private int totalCourses;
private int lives;
private int totalEngineerCourses;
private int totalProviderCourses;
public int getTotalEngineerCourses() {
return totalEngineerCourses;
}
public void setTotalEngineerCourses(int totalEngineerCourses) {
this.totalEngineerCourses = totalEngineerCourses;
}
public int getTotalProviderCourses() {
return totalProviderCourses;
}
public void setTotalProviderCourses(int totalProviderCourses) {
this.totalProviderCourses = totalProviderCourses;
}
public int getLives() {
return lives;
......
......@@ -59,7 +59,12 @@ public class CommonLearnPresenter extends CommonLearnContract.Presenter {
Observable<BaseResponse<BasePageBean<CommonLearnBean>>> observable = null;
switch (type) {
case 1:
observable = Api.getService(LearnService.class).getAllCourse(mUserId, keyStr, mPage, Constants.PAGESIZE);
// observable = Api.getService(LearnService.class).getAllCourse(mUserId, keyStr, mPage, Constants.PAGESIZE);
observable = Api.getService(LearnService.class).getLearnVideos(mUserId,1,1, keyStr, mPage, Constants.PAGESIZE);
break;
case 4:
// observable = Api.getService(LearnService.class).getAllCourse(mUserId, keyStr, mPage, Constants.PAGESIZE);
observable = Api.getService(LearnService.class).getLearnVideos(mUserId,2,1, keyStr, mPage, Constants.PAGESIZE);
break;
case 2:
observable = Api.getService(LearnService.class).getLearnedCourse(mUserId, keyStr, mPage, Constants.PAGESIZE);
......
......@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.dayu.base.api.APIService;
import com.dayu.base.api.Api;
import com.dayu.base.ui.adapter.FragmentAdapter;
import com.dayu.base.ui.fragment.BaseFragment;
......@@ -23,6 +24,7 @@ import com.dayu.learncenter.ui.activity.PubCourseActivity;
import com.dayu.livemodule.event.StartPushEvent;
import com.dayu.utils.TabLayoutUtils;
import com.dayu.utils.UIUtils;
import com.dayu.utils.UserManager;
import com.umeng.analytics.MobclickAgent;
import com.youth.banner.WeakHandler;
......@@ -64,6 +66,21 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
initTabPage();
getTabData();
EventBus.getDefault().register(this);
getUserInfo();
}
//获取用户信息
private void getUserInfo() {
Api.getService(APIService.class).getEngineerInfo(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(info->{
if (mUserInfo != null){
mUserInfo.setLiveStatus(info.getLiveStatus());
mUserInfo.setLiveStatus(info.getLianmaiStatus());
UserManager.getInstance().saveUser(mUserInfo);
}
}));
}
//获取tab数量
......@@ -79,6 +96,7 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
private void initTabPage() {
list_fragments = new ArrayList<>();
list_fragments.add(CommonLearnFragment.newInstance(1));
list_fragments.add(CommonLearnFragment.newInstance(4));
list_fragments.add(new LiveListFragment());
list_fragments.add(CommonLearnFragment.newInstance(2));
list_fragments.add(CommonLearnFragment.newInstance(3));
......@@ -100,10 +118,10 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
}
mTabNumTv = tab.getCustomView().findViewById(R.id.tabtext);
mTabTextTv = tab.getCustomView().findViewById(R.id.tabicon);
if (temp == 1){
if (temp == 2) {
mTabNumTv.setTextColor(getResources().getColor(R.color.common_red));
mTabTextTv.setTextColor(getResources().getColor(R.color.common_red));
}else{
} else {
mTabNumTv.setTextColor(getResources().getColor(R.color.bg_button));
mTabTextTv.setTextColor(getResources().getColor(R.color.bg_button));
}
......@@ -134,9 +152,10 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
// EventBus.getDefault().post(new LearnTabNumEvent(1));
int[] tabNum;
if (tabBean != null) {
tabNum = new int[]{tabBean.getTotalCourses(),tabBean.getLives(), tabBean.getLeaners(), tabBean.getPublishes()};
tabNum = new int[]{tabBean.getTotalProviderCourses(),tabBean.getTotalEngineerCourses(),tabBean.getLives(), tabBean.getLeaners(), tabBean.getPublishes()};
// tabNum = new int[]{99, 999, 9999, 99999, 999999};
} else {
tabNum = new int[]{0, 0, 0,0};
tabNum = new int[]{0, 0, 0, 0, 0};
}
if (isFirstAddTab) {
mBind.tabLearn.removeAllTabs();
......@@ -144,6 +163,7 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
mBind.tabLearn.addTab(mBind.tabLearn.newTab().setCustomView(CreatTab(1, tabNum[1], tabDesc[1])));
mBind.tabLearn.addTab(mBind.tabLearn.newTab().setCustomView(CreatTab(2, tabNum[2], tabDesc[2])));
mBind.tabLearn.addTab(mBind.tabLearn.newTab().setCustomView(CreatTab(3, tabNum[3], tabDesc[3])));
mBind.tabLearn.addTab(mBind.tabLearn.newTab().setCustomView(CreatTab(3, tabNum[4], tabDesc[4])));
isFirstAddTab = false;
} else {
for (int i = 0; i < mBind.tabLearn.getTabCount(); i++) {
......@@ -151,15 +171,15 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
TextView tvIcon = mBind.tabLearn.getTabAt(i).getCustomView().findViewById(R.id.tabicon);
tvIcon.setText(tabDesc[i]);
int count = tabNum[i];
tv.setText(count+"");
tv.setText(count + "");
tv.setTextSize(28);
if (count>999){
if (count > 999) {
tv.setTextSize(24);
}
if (count>9999){
if (count > 9999) {
tv.setTextSize(20);
}
if (count>99999){
if (count > 99999) {
tv.setTextSize(16);
}
}
......@@ -202,14 +222,14 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
sendLiveData(event);
weakHandler.postDelayed(() -> {
sendLiveData(event);
},10000);
}, 10000);
}
private void sendLiveData(StartPushEvent event) {
int type = event.isMain?1:2;
LiveData liveData = new LiveData(type,event.pushUrl);
if (!TextUtils.isEmpty(event.roomInfo)){
int type = event.isMain ? 1 : 2;
LiveData liveData = new LiveData(type, event.pushUrl);
if (!TextUtils.isEmpty(event.roomInfo)) {
try {
JSONObject jsonRoomInfo = new JSONObject(event.roomInfo);
liveData.title = jsonRoomInfo.optString("title");
......@@ -220,6 +240,7 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
}
Api.getService(LearnService.class).sendLiveData(liveData).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(result->{}));
.subscribe(mPresenter.baseObserver(result -> {
}));
}
}
......@@ -54,14 +54,26 @@
<TextView
android:id="@+id/tv_disable"
style="@style/common_text_style"
android:layout_alignParentRight="true"
android:height="36dp"
android:background="#99ffffff"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:layout_alignParentRight="true"
android:text="@string/already_disable" />
<TextView
android:id="@+id/tv_top"
style="@style/common_text_style"
android:layout_alignParentRight="true"
android:height="36dp"
android:background="#99ffffff"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="@string/video_top"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
......@@ -111,9 +123,10 @@
<ImageButton
android:id="@+id/ib_share"
android:layout_width="35dp"
android:background="@color/transparent"
android:layout_height="match_parent"
android:background="@color/transparent"
android:src="@drawable/icon_share_gray" />
<TextView
android:id="@+id/tv_shares"
style="@style/common_text_style"
......
......@@ -13,4 +13,5 @@
<string name="learn_progress">学习进度</string>
<string name="already_disable">已下架</string>
<string name="delete_str">删除</string>
<string name="video_top">置顶</string>
</resources>
......@@ -7,19 +7,19 @@
<TextView
android:id="@+id/tabtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:textSize="30sp"
android:layout_height="40dp"
android:gravity="center|bottom"
android:textColor="#585858"
/>
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tabicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#585858"
android:textSize="13.3sp"
android:layout_gravity="center"/>
android:textSize="13.3sp" />
</LinearLayout>
\ No newline at end of file
......@@ -7,19 +7,19 @@
<TextView
android:id="@+id/tabtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:textSize="30sp"
android:layout_height="40dp"
android:gravity="center|bottom"
android:textColor="#585858"
/>
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tabicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#585858"
android:textSize="13.3sp"
android:layout_gravity="center"/>
android:textSize="13.3sp" />
</LinearLayout>
\ No newline at end of file
......@@ -35,6 +35,15 @@ public class EngineerInfo extends BaseObservable implements Serializable {
private Object messageCheckcode;
private String invitationCode;
private int liveStatus;
private int lianmaiStatus;
public int getLianmaiStatus() {
return lianmaiStatus;
}
public void setLianmaiStatus(int lianmaiStatus) {
this.lianmaiStatus = lianmaiStatus;
}
public int getLiveStatus() {
return liveStatus;
......
......@@ -194,7 +194,8 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
mBind.tvSex.setText(mActivity.getString(R.string.unknown));
mBind.tvAge.setText(mActivity.getString(R.string.unknown));
}
if (UserManager.getInstance().getUser().getDetectStatus() == 1 && !TextUtils.isEmpty((String) SPUtils.get("USER_IDENTITY", ""))) {
if (UserManager.getInstance().getUser().getDetectStatus() == 1
&& !TextUtils.isEmpty((String) SPUtils.get("USER_IDENTITY", ""))) {
mBind.ivAudited.setImageResource(R.drawable.icon_authentication);
} else {
mBind.ivAudited.setImageResource(R.drawable.icon_unauthentication);
......@@ -208,6 +209,7 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
if (userInfo != null) {
userInfo.setHeaderImg(info.getAccountUrl());
userInfo.setLiveStatus(info.getLiveStatus());
userInfo.setLiveStatus(info.getLianmaiStatus());
UserManager.getInstance().saveUser(userInfo);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment