Commit 4ceae26e by mReturn

share&fix

parent d5a53df8
Showing with 297 additions and 140 deletions
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<module fileurl="file://$PROJECT_DIR$/IDCardLib/IDCardLib.iml" filepath="$PROJECT_DIR$/IDCardLib/IDCardLib.iml" /> <module fileurl="file://$PROJECT_DIR$/IDCardLib/IDCardLib.iml" filepath="$PROJECT_DIR$/IDCardLib/IDCardLib.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/baseSDK/baseSDK.iml" filepath="$PROJECT_DIR$/baseSDK/baseSDK.iml" /> <module fileurl="file://$PROJECT_DIR$/baseSDK/baseSDK.iml" filepath="$PROJECT_DIR$/baseSDK/baseSDK.iml" />
<module fileurl="file://$PROJECT_DIR$/dayu-saas-android00.iml" filepath="$PROJECT_DIR$/dayu-saas-android00.iml" /> <module fileurl="file://$PROJECT_DIR$/dayu-saas-android.iml" filepath="$PROJECT_DIR$/dayu-saas-android.iml" />
<module fileurl="file://$PROJECT_DIR$/locationComponent/locationComponent.iml" filepath="$PROJECT_DIR$/locationComponent/locationComponent.iml" /> <module fileurl="file://$PROJECT_DIR$/locationComponent/locationComponent.iml" filepath="$PROJECT_DIR$/locationComponent/locationComponent.iml" />
<module fileurl="file://$PROJECT_DIR$/managercenter/managercenter.iml" filepath="$PROJECT_DIR$/managercenter/managercenter.iml" /> <module fileurl="file://$PROJECT_DIR$/managercenter/managercenter.iml" filepath="$PROJECT_DIR$/managercenter/managercenter.iml" />
<module fileurl="file://$PROJECT_DIR$/messageCenter/messageCenter.iml" filepath="$PROJECT_DIR$/messageCenter/messageCenter.iml" /> <module fileurl="file://$PROJECT_DIR$/messageCenter/messageCenter.iml" filepath="$PROJECT_DIR$/messageCenter/messageCenter.iml" />
......
...@@ -90,6 +90,7 @@ repositories { ...@@ -90,6 +90,7 @@ repositories {
dependencies { dependencies {
api fileTree(include: ['*.jar'], dir: 'libs') api fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
//ARouter //ARouter
annotationProcessor "com.alibaba:arouter-compiler:$arouter_compiler_version" annotationProcessor "com.alibaba:arouter-compiler:$arouter_compiler_version"
......
...@@ -79,12 +79,14 @@ public class InitializeActivity extends DataBindingActivity<ActivityInitializeMa ...@@ -79,12 +79,14 @@ public class InitializeActivity extends DataBindingActivity<ActivityInitializeMa
switch (UserManager.getInstance().getRole()) { switch (UserManager.getInstance().getRole()) {
case Constants.MANAGER: case Constants.MANAGER:
case Constants.MANAGER_NOSITE_ENGINEER: case Constants.MANAGER_NOSITE_ENGINEER:
if (StationManager.getInstance().haveData()) { // if (StationManager.getInstance().haveData()) {
Intent intent1 = new Intent(InitializeActivity.this, ManagerActivity.class); // Intent intent1 = new Intent(InitializeActivity.this, ManagerActivity.class);
startActivity(intent1); // startActivity(intent1);
} else { // } else {
ARouter.getInstance().build(RouterPath.PATH_SERVICESTATION).navigation(); // ARouter.getInstance().build(RouterPath.PATH_SERVICESTATION).navigation();
} // }
Intent mainIntent = new Intent(InitializeActivity.this, MainActivity.class);
startActivity(mainIntent);
break; break;
case Constants.ENGINEER: case Constants.ENGINEER:
case Constants.MANAGER_ENGINEER: case Constants.MANAGER_ENGINEER:
......
...@@ -8,6 +8,7 @@ import android.content.res.Resources; ...@@ -8,6 +8,7 @@ import android.content.res.Resources;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull;
import com.dayu.bigfish.ui.service.LocationService; import com.dayu.bigfish.ui.service.LocationService;
import com.dayu.bigfish.utils.HxManager; import com.dayu.bigfish.utils.HxManager;
...@@ -16,6 +17,14 @@ import com.dayu.common.Constants; ...@@ -16,6 +17,14 @@ import com.dayu.common.Constants;
import com.dayu.location.base.LocationUtils; import com.dayu.location.base.LocationUtils;
import com.dayu.order.greendao.GreenDaoManager; import com.dayu.order.greendao.GreenDaoManager;
import com.dayu.utils.NetworkConnectChangedReceiver; import com.dayu.utils.NetworkConnectChangedReceiver;
import com.scwang.smartrefresh.header.MaterialHeader;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator;
import com.scwang.smartrefresh.layout.api.RefreshFooter;
import com.scwang.smartrefresh.layout.api.RefreshHeader;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import com.umeng.analytics.MobclickAgent.EScenarioType; import com.umeng.analytics.MobclickAgent.EScenarioType;
import com.umeng.commonsdk.UMConfigure; import com.umeng.commonsdk.UMConfigure;
...@@ -68,6 +77,28 @@ public class MyApplication extends BaseApplication { ...@@ -68,6 +77,28 @@ public class MyApplication extends BaseApplication {
} }
//初始化刷新框架 static 代码段可以防止内存泄露
static {
//设置全局的Header构建器
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
@NonNull
@Override
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
layout.setPrimaryColorsId(R.color.text_common_blue, android.R.color.white);//全局设置主题颜色
layout.setHeaderTriggerRate(0.6f);
return new MaterialHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
}
});
//设置全局的Footer构建器
SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() {
@Override
public RefreshFooter createRefreshFooter(Context context, RefreshLayout layout) {
//指定为经典Footer,默认是 BallPulseFooter
return new ClassicsFooter(context).setDrawableSize(20);
}
});
}
/** /**
* 初始化友盟. * 初始化友盟.
*/ */
...@@ -78,7 +109,7 @@ public class MyApplication extends BaseApplication { ...@@ -78,7 +109,7 @@ public class MyApplication extends BaseApplication {
UMConfigure.setEncryptEnabled(true); UMConfigure.setEncryptEnabled(true);
MobclickAgent.setScenarioType(mContext, EScenarioType.E_UM_NORMAL); MobclickAgent.setScenarioType(mContext, EScenarioType.E_UM_NORMAL);
PlatformConfig.setWeixin("wx44e10dbfc2ae4a52", "6107b1b7da9ed2eb3bcb3852c1ea4391"); PlatformConfig.setWeixin("wx06c380c64a0adb8d", "1fc353c2d33202b314b9fa89155528b7");
} }
/** /**
...@@ -110,9 +141,8 @@ public class MyApplication extends BaseApplication { ...@@ -110,9 +141,8 @@ public class MyApplication extends BaseApplication {
} }
//解决在Android P上的调用非官方api提醒弹窗 (Detected problems with API compatibility(visit g.co/dev/appcompat for more info) //解决在Android P上的调用非官方api提醒弹窗 (Detected problems with API compatibility(visit g.co/dev/appcompat for more info)
private void closeAndroidPDialog(){ private void closeAndroidPDialog() {
try { try {
Class aClass = Class.forName("android.content.pm.PackageParser$Package"); Class aClass = Class.forName("android.content.pm.PackageParser$Package");
Constructor declaredConstructor = aClass.getDeclaredConstructor(String.class); Constructor declaredConstructor = aClass.getDeclaredConstructor(String.class);
......
...@@ -76,6 +76,8 @@ dependencies { ...@@ -76,6 +76,8 @@ dependencies {
api 'com.badoo.mobile:android-weak-handler:1.1' api 'com.badoo.mobile:android-weak-handler:1.1'
api 'com.youth.banner:banner:1.4.10' api 'com.youth.banner:banner:1.4.10'
api 'com.github.PhilJay:MPAndroidChart:v3.1.0' api 'com.github.PhilJay:MPAndroidChart:v3.1.0'
api 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0' //1.0.5及以前版本的老用户升级需谨慎,API改动过大
api 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0'
// api 'tv.danmaku.ijk.media:ijkplayer-java:0.8.4' // api 'tv.danmaku.ijk.media:ijkplayer-java:0.8.4'
// api 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.4' // api 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.4'
......
package com.dayu.base.api; package com.dayu.base.api;
import android.os.Build;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -7,6 +8,8 @@ import com.dayu.base.api.protocol.BaseResponse; ...@@ -7,6 +8,8 @@ import com.dayu.base.api.protocol.BaseResponse;
import com.dayu.common.BaseConstant; import com.dayu.common.BaseConstant;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.event.UserInfo; import com.dayu.event.UserInfo;
import com.dayu.utils.AppUtils;
import com.dayu.utils.CommonUtils;
import com.dayu.utils.LogUtils; import com.dayu.utils.LogUtils;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -102,18 +105,21 @@ public class Api { ...@@ -102,18 +105,21 @@ public class Api {
* 统一加上token. * 统一加上token.
*/ */
public static class TokenInterceptord implements Interceptor { public static class TokenInterceptord implements Interceptor {
@Override @Override
public Response intercept(@NonNull Chain chain) throws IOException { public Response intercept(@NonNull Chain chain) throws IOException {
Request request = chain.request(); Request request = chain.request();
UserInfo userInfo = UserManager.getInstance().getUser(); UserInfo userInfo = UserManager.getInstance().getUser();
String token = ""; String token = "";
String brand = Build.BRAND+"_"+Build.MODEL+"_"+Build.VERSION.RELEASE;
if (userInfo != null) { if (userInfo != null) {
token = userInfo.getToken(); token = userInfo.getToken();
} }
if (!TextUtils.isEmpty(token) && !request.url().toString().contains(Constants.BASE_URL + Constants.LOGIN_URL)) { if (!TextUtils.isEmpty(token) && !request.url().toString().contains(Constants.BASE_URL + Constants.LOGIN_URL)) {
request = request.newBuilder() request = request.newBuilder()
.header(BaseConstant.TOKEN, token) .header(BaseConstant.TOKEN, token)
.header(BaseConstant.DEVIVCE,brand)
.header(BaseConstant.SYSTEM,"Android")
.header(BaseConstant.APPVERSION,AppUtils.getPackageNum())
.build(); .build();
} }
return chain.proceed(request); return chain.proceed(request);
......
...@@ -7,6 +7,9 @@ package com.dayu.common; ...@@ -7,6 +7,9 @@ package com.dayu.common;
public class BaseConstant { public class BaseConstant {
public static final String TOKEN ="token"; public static final String TOKEN ="token";
public static final String DEVIVCE ="Device";
public static final String APPVERSION ="App_version";
public static final String SYSTEM ="System";
public static final String PATH_LOGIN ="/user/login"; public static final String PATH_LOGIN ="/user/login";
/** /**
* 友盟统计,有fagment的activity去除. * 友盟统计,有fagment的activity去除.
......
...@@ -22,7 +22,7 @@ public class BannerImgLoader extends ImageLoader { ...@@ -22,7 +22,7 @@ public class BannerImgLoader extends ImageLoader {
@Override @Override
public void displayImage(Context context, Object path, ImageView imageView) { public void displayImage(Context context, Object path, ImageView imageView) {
RequestOptions options = new RequestOptions() RequestOptions options = new RequestOptions()
.centerCrop() .fitCenter()
.placeholder(R.drawable.icon_app_logo) .placeholder(R.drawable.icon_app_logo)
.diskCacheStrategy(DiskCacheStrategy.ALL); .diskCacheStrategy(DiskCacheStrategy.ALL);
// Glide.with(context).load(path) // Glide.with(context).load(path)
......
...@@ -170,10 +170,11 @@ public class CommonUtils { ...@@ -170,10 +170,11 @@ public class CommonUtils {
/** /**
* 分享小程序 * 分享小程序
**/ **/
public static void shareProgram(Activity activity, String url, String imgUrl, String title, public static void shareProgram(Activity activity, String imgUrl, String title, String description,
String description,int uid,int gid, SHARE_MEDIA platform, UMShareListener callBack) { int uid,int gid, SHARE_MEDIA platform, UMShareListener callBack) {
//兼容低版本的网页链接 //兼容低版本的网页链接
UMMin umMin = new UMMin(url); String mUrl = "http://www.kf.ai/";
UMMin umMin = new UMMin(mUrl);
// 小程序消息封面图片 // 小程序消息封面图片
umMin.setThumb(new UMImage(activity, imgUrl)); umMin.setThumb(new UMImage(activity, imgUrl));
// 小程序消息title // 小程序消息title
...@@ -184,7 +185,7 @@ public class CommonUtils { ...@@ -184,7 +185,7 @@ public class CommonUtils {
umMin.setPath(Constants.PROGRAM_PATH.replace("uid",uid+"").replace("gid",gid+"")); umMin.setPath(Constants.PROGRAM_PATH.replace("uid",uid+"").replace("gid",gid+""));
// 小程序原始id,在微信平台查询 // 小程序原始id,在微信平台查询
umMin.setUserName("gh_0e5cd0cdbf46"); umMin.setUserName("gh_0e5cd0cdbf46");
// Config.setMiniPreView(); //设置预览版 Config.setMiniPreView(); //设置预览版
// Config.setMiniTest(); //设置测试版 // Config.setMiniTest(); //设置测试版
new ShareAction(activity) new ShareAction(activity)
.withMedia(umMin) .withMedia(umMin)
......
...@@ -59,6 +59,16 @@ public class GlideImageLoader { ...@@ -59,6 +59,16 @@ public class GlideImageLoader {
.apply(options) .apply(options)
.into(view); .into(view);
} }
public static void loadFit(Context context, ImageView view, String imageRes, int defaultRes) {
RequestOptions options = new RequestOptions()
.placeholder(defaultRes)
.fitCenter()
.diskCacheStrategy(DiskCacheStrategy.ALL);
Glide.with(context)
.load(imageRes)
.apply(options)
.into(view);
}
public static void loadDrawable(Context context, String imageRes, ImageView view) { public static void loadDrawable(Context context, String imageRes, ImageView view) {
RequestOptions options = new RequestOptions() RequestOptions options = new RequestOptions()
.centerCrop() .centerCrop()
......
...@@ -919,7 +919,8 @@ C) 在甲方使用大鱼平å°æœåŠ¡è¿‡ç¨‹ä¸­äº§ç”Ÿçš„业务数æ®ï¼Œå®¢æˆ·æ•°æ ...@@ -919,7 +919,8 @@ C) 在甲方使用大鱼平å°æœåŠ¡è¿‡ç¨‹ä¸­äº§ç”Ÿçš„业务数æ®ï¼Œå®¢æˆ·æ•°æ
按每单服务质量评价星级收取服务费佣金(含依法代扣代缴的个人劳务收入所得税)。</string> 按每单服务质量评价星级收取服务费佣金(含依法代扣代缴的个人劳务收入所得税)。</string>
<string name="user_info_rule3">3、严禁任何违反国家法律法规和平台规则的行为。一经发现, <string name="user_info_rule3">3、严禁任何违反国家法律法规和平台规则的行为。一经发现,
大鱼公司有权停止APP系统服务、并采取相应处罚措施、追究经济赔偿责任、依法移交司法机关处理。</string> 大鱼公司有权停止APP系统服务、并采取相应处罚措施、追究经济赔偿责任、依法移交司法机关处理。</string>
<string name="customer_hot_line">大鱼客服热线:400-0086-898</string> <string name="customer_hot_line1">大鱼客服热线:</string>
<string name="customer_hot_line2">400-0086-898</string>
<string name="commission_str">佣金</string> <string name="commission_str">佣金</string>
<string name="user_rule_star">星级</string> <string name="user_rule_star">星级</string>
<string name="user_rule_star1">一星</string> <string name="user_rule_star1">一星</string>
......
package com.dayu.order.ui.adapter; package com.dayu.order.ui.adapter;
import android.text.Html;
import android.view.View; import android.view.View;
import com.dayu.base.ui.adapter.CoreAdapter; import com.dayu.base.ui.adapter.CoreAdapter;
...@@ -31,6 +32,9 @@ public class CommentAdapter extends CoreAdapter<CommentBean, ItemCommentBinding> ...@@ -31,6 +32,9 @@ public class CommentAdapter extends CoreAdapter<CommentBean, ItemCommentBinding>
GlideImageLoader.load(mContext,holder.ivAvatar2,item.getMessageAvatarUrl(),R.drawable.icon_user_default); GlideImageLoader.load(mContext,holder.ivAvatar2,item.getMessageAvatarUrl(),R.drawable.icon_user_default);
holder.tvTime.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime())); holder.tvTime.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime()));
holder.tvTime2.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime())); holder.tvTime2.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime()));
String replyStr = mContext.getString(R.string.reply_str)+"<font color='#3e96e2'>"+"@"+item.getBeName()+
"</font>"+": "+item.getContent();
holder.tvReply.setText(Html.fromHtml(replyStr));
} }
} }
...@@ -88,13 +88,23 @@ ...@@ -88,13 +88,23 @@
android:layout_height="35dp" android:layout_height="35dp"
android:src="@drawable/icon_user_default" /> android:src="@drawable/icon_user_default" />
<TextView <LinearLayout
android:id="@+id/tv_name2" android:id="@+id/ll_user2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:orientation="horizontal"
android:layout_marginRight="35dp"
android:layout_toRightOf="@id/iv_avatar2" android:layout_toRightOf="@id/iv_avatar2"
>
<TextView
android:id="@+id/tv_name2"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="@{item.accountName}" android:text="@{item.accountName}"
android:textColor="@color/cl_home_title_text_color" android:textColor="@color/cl_home_title_text_color"
android:textSize="13sp" /> android:textSize="13sp" />
...@@ -103,19 +113,18 @@ ...@@ -103,19 +113,18 @@
android:id="@+id/tv_time2" android:id="@+id/tv_time2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/tv_name2"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/tv_name2"
android:text="time" android:text="time"
android:textColor="@color/tv_cl" android:textColor="@color/tv_cl"
android:textSize="13sp" /> android:textSize="13sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_content" android:id="@+id/ll_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/tv_name2" android:layout_below="@id/ll_user2"
android:layout_alignLeft="@id/tv_name2" android:layout_alignLeft="@id/ll_user2"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -125,24 +134,25 @@ ...@@ -125,24 +134,25 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/reply_str" android:text="@string/reply_str"
android:lineSpacingExtra="2dp"
android:textColor="@color/cl_home_title_text_color" android:textColor="@color/cl_home_title_text_color"
android:textSize="13sp" /> android:textSize="13sp" />
<TextView <!--<TextView-->
android:id="@+id/tv_reply_name" <!--android:id="@+id/tv_reply_name"-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:text='@{"@"+item.beName}' <!--android:text='@{"@"+item.beName}'-->
android:textColor="@color/cl_home_button" <!--android:textColor="@color/cl_home_button"-->
android:textSize="13sp" /> <!--android:textSize="13sp" />-->
<TextView <!--<TextView-->
android:id="@+id/tv_content2" <!--android:id="@+id/tv_content2"-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:text='@{": "+item.content}' <!--android:text='@{": "+item.content}'-->
android:textColor="@color/cl_home_title_text_color" <!--android:textColor="@color/cl_home_title_text_color"-->
android:textSize="13sp" /> <!--android:textSize="13sp" />-->
</LinearLayout> </LinearLayout>
<ImageView <ImageView
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true"> android:supportsRtl="true">
<activity android:name=".ui.activity.ProductDetailActivity" <activity android:name=".ui.activity.ProductDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" android:screenOrientation="portrait"
/> />
<activity android:name=".ui.activity.SaleOrderDetailActivity" <activity android:name=".ui.activity.SaleOrderDetailActivity"
......
package com.bigfish.salecenter.adapter; package com.bigfish.salecenter.adapter;
import android.text.Html;
import android.view.View; import android.view.View;
import com.bigfish.salecenter.R; import com.bigfish.salecenter.R;
...@@ -26,5 +27,8 @@ public class CommentAdapter extends CoreAdapter<CommentBean,ItemSaleCommentBindi ...@@ -26,5 +27,8 @@ public class CommentAdapter extends CoreAdapter<CommentBean,ItemSaleCommentBindi
GlideImageLoader.load(mContext,holder.ivAvatar2,item.getMessageAvatarUrl(),R.drawable.icon_user_default); GlideImageLoader.load(mContext,holder.ivAvatar2,item.getMessageAvatarUrl(),R.drawable.icon_user_default);
holder.tvTime.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime())); holder.tvTime.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime()));
holder.tvTime2.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime())); holder.tvTime2.setText(CommonUtils.getTimeDesc(mContext,item.getCreateTime()));
String replyStr = mContext.getString(R.string.reply_str)+"<font color='#3e96e2'>"+"@"+item.getBeName()+
"</font>"+": "+item.getContent();
holder.tvReply.setText(Html.fromHtml(replyStr));
} }
} }
...@@ -5,6 +5,7 @@ import com.bigfish.salecenter.databinding.ItemSaleOrderBinding; ...@@ -5,6 +5,7 @@ import com.bigfish.salecenter.databinding.ItemSaleOrderBinding;
import com.bigfish.salecenter.model.OrdersBean; import com.bigfish.salecenter.model.OrdersBean;
import com.dayu.base.ui.adapter.CoreAdapter; import com.dayu.base.ui.adapter.CoreAdapter;
import com.dayu.utils.CommonUtils; import com.dayu.utils.CommonUtils;
import com.dayu.utils.GlideImageLoader;
/** /**
* Created by mReturn * Created by mReturn
...@@ -21,6 +22,7 @@ public class SaleOrderAdapter extends CoreAdapter<OrdersBean,ItemSaleOrderBindin ...@@ -21,6 +22,7 @@ public class SaleOrderAdapter extends CoreAdapter<OrdersBean,ItemSaleOrderBindin
@Override @Override
protected void onBind(ItemSaleOrderBinding holder, OrdersBean item, int position) { protected void onBind(ItemSaleOrderBinding holder, OrdersBean item, int position) {
super.onBind(holder, item, position); super.onBind(holder, item, position);
GlideImageLoader.loadFit(mContext, holder.ivImg, item.getGoodsFirstUrl(),R.drawable.icon_img_default);
holder.tvBrandModel.setText(item.getGoodsModel()); holder.tvBrandModel.setText(item.getGoodsModel());
holder.tvPrice.setText(CommonUtils.getMoneyStr(mContext,item.getPrice())); holder.tvPrice.setText(CommonUtils.getMoneyStr(mContext,item.getPrice()));
holder.tvCommision.setText(CommonUtils.getMoneyStr(mContext,item.getSalesPrice())); holder.tvCommision.setText(CommonUtils.getMoneyStr(mContext,item.getSalesPrice()));
......
...@@ -3,14 +3,11 @@ package com.bigfish.salecenter.adapter; ...@@ -3,14 +3,11 @@ package com.bigfish.salecenter.adapter;
import com.bigfish.salecenter.R; import com.bigfish.salecenter.R;
import com.bigfish.salecenter.databinding.ItemSaleProductBinding; import com.bigfish.salecenter.databinding.ItemSaleProductBinding;
import com.bigfish.salecenter.event.CollectChangedEvent; import com.bigfish.salecenter.event.CollectChangedEvent;
import com.bigfish.salecenter.model.CollectProductData;
import com.bigfish.salecenter.model.ProductListBean; import com.bigfish.salecenter.model.ProductListBean;
import com.bigfish.salecenter.presenter.saleproduct.SaleProductPresent; import com.bigfish.salecenter.presenter.saleproduct.SaleProductPresent;
import com.dayu.base.ui.adapter.CoreAdapter; import com.dayu.base.ui.adapter.CoreAdapter;
import com.dayu.utils.CommonUtils; import com.dayu.utils.CommonUtils;
import com.dayu.utils.GlideImageLoader; import com.dayu.utils.GlideImageLoader;
import com.dayu.utils.LogUtils;
import com.dayu.utils.ToastUtils;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -29,7 +26,7 @@ public class SaleProductAdapter extends CoreAdapter<ProductListBean,ItemSaleProd ...@@ -29,7 +26,7 @@ public class SaleProductAdapter extends CoreAdapter<ProductListBean,ItemSaleProd
protected void onBind(ItemSaleProductBinding holder, ProductListBean item, int position) { protected void onBind(ItemSaleProductBinding holder, ProductListBean item, int position) {
super.onBind(holder, item, position); super.onBind(holder, item, position);
holder.tvBrandModel.setText(item.getGoodsModel()); holder.tvBrandModel.setText(item.getGoodsModel());
GlideImageLoader.load(mContext, holder.ivImg, item.getFirstUrl(),R.drawable.icon_img_default); GlideImageLoader.loadFit(mContext, holder.ivImg, item.getFirstUrl(),R.drawable.icon_img_default);
holder.tvSinglePrice.setText(CommonUtils.getMoneyStr(mContext,item.getPrice())); holder.tvSinglePrice.setText(CommonUtils.getMoneyStr(mContext,item.getPrice()));
holder.tvCommision.setText(CommonUtils.getMoneyStr(mContext,item.getSalesPrice())); holder.tvCommision.setText(CommonUtils.getMoneyStr(mContext,item.getSalesPrice()));
if (item.getCollectionStatus() == 1){ if (item.getCollectionStatus() == 1){
......
...@@ -36,6 +36,7 @@ public interface SaleService { ...@@ -36,6 +36,7 @@ public interface SaleService {
@GET(kaApi+"/goods/mobileGoods") @GET(kaApi+"/goods/mobileGoods")
Observable<BaseResponse<BasePageBean<ProductListBean>>> getProducts(@Query("engineerId") int engineerId, Observable<BaseResponse<BasePageBean<ProductListBean>>> getProducts(@Query("engineerId") int engineerId,
@Query("key") String key, @Query("key") String key,
@Query("status") int status,
@Query("page") int page, @Query("page") int page,
@Query("pageSize") int pageSize); @Query("pageSize") int pageSize);
......
...@@ -46,7 +46,7 @@ public class ProductDetailBean implements Serializable { ...@@ -46,7 +46,7 @@ public class ProductDetailBean implements Serializable {
private String pn; private String pn;
private double price; private double price;
private double salesPrice; private double salesPrice;
private int customerRebate; private double customerRebate;
private String brief; private String brief;
private String sellingPoint1; private String sellingPoint1;
private String sellingPoint2; private String sellingPoint2;
...@@ -117,11 +117,11 @@ public class ProductDetailBean implements Serializable { ...@@ -117,11 +117,11 @@ public class ProductDetailBean implements Serializable {
this.salesPrice = salesPrice; this.salesPrice = salesPrice;
} }
public int getCustomerRebate() { public double getCustomerRebate() {
return customerRebate; return customerRebate;
} }
public void setCustomerRebate(int customerRebate) { public void setCustomerRebate(double customerRebate) {
this.customerRebate = customerRebate; this.customerRebate = customerRebate;
} }
......
...@@ -64,7 +64,7 @@ public class SaleProductPresent extends SaleProductContract.Presenter { ...@@ -64,7 +64,7 @@ public class SaleProductPresent extends SaleProductContract.Presenter {
//商品列表 //商品列表
private void getProducts() { private void getProducts() {
Api.getService(SaleService.class).getProducts(mUserId, keyStr, mPage, Constants.PAGESIZE).compose(Api.applySchedulers()) Api.getService(SaleService.class).getProducts(mUserId, keyStr,1, mPage, Constants.PAGESIZE).compose(Api.applySchedulers())
.subscribe(baseObserver( .subscribe(baseObserver(
products -> { products -> {
// ToastUtils.showShortToast(products.getData().size() + " "); // ToastUtils.showShortToast(products.getData().size() + " ");
......
...@@ -17,6 +17,7 @@ import com.umeng.analytics.MobclickAgent; ...@@ -17,6 +17,7 @@ import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList; import java.util.ArrayList;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd; import cn.jzvd.JzvdStd;
/** /**
...@@ -124,4 +125,11 @@ public class ProductDetailActivity extends BaseActivity<SImplePresenter, Activit ...@@ -124,4 +125,11 @@ public class ProductDetailActivity extends BaseActivity<SImplePresenter, Activit
MobclickAgent.onPause(this); MobclickAgent.onPause(this);
JzvdStd.goOnPlayOnPause(); JzvdStd.goOnPlayOnPause();
} }
@Override
public void onBackPressed() {
if (!Jzvd.backPress()) {
super.onBackPressed();
}
}
} }
...@@ -19,6 +19,7 @@ import com.dayu.utils.CommonUtils; ...@@ -19,6 +19,7 @@ import com.dayu.utils.CommonUtils;
import com.dayu.utils.GlideImageLoader; import com.dayu.utils.GlideImageLoader;
import com.dayu.utils.ToastUtils; import com.dayu.utils.ToastUtils;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.youth.banner.BannerConfig; import com.youth.banner.BannerConfig;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -68,12 +69,16 @@ public class ProductInstructionFragment extends BaseFragment<SImplePresenter, Fr ...@@ -68,12 +69,16 @@ public class ProductInstructionFragment extends BaseFragment<SImplePresenter, Fr
//点击分享按钮 //点击分享按钮
public void onShareClick() { public void onShareClick() {
Api.getService(SaleService.class).canShare(mDetail.getId(), mUserId).compose(Api.applySchedulers()) // Api.getService(SaleService.class).canShare(mDetail.getId(), mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(success -> { // .subscribe(mPresenter.baseObserver(success -> {
ToastUtils.showShortToast("canShare: " + success); // ToastUtils.showShortToast("canShare: " + success);
}) // })
//
); // );
if (mDetail != null){
CommonUtils.shareProgram(mActivity,mDetail.getFirstUrl(),mDetail.getGoodsModel(),
mDetail.getBrief(),mUserId,mDetail.getId(),SHARE_MEDIA.WEIXIN,null);
}
} }
private void initDataView() { private void initDataView() {
......
...@@ -2,6 +2,7 @@ package com.bigfish.salecenter.ui.fragment; ...@@ -2,6 +2,7 @@ package com.bigfish.salecenter.ui.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -28,6 +29,8 @@ import com.dayu.utils.LogUtils; ...@@ -28,6 +29,8 @@ import com.dayu.utils.LogUtils;
import com.dayu.utils.ProgressUtil; import com.dayu.utils.ProgressUtil;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
import com.dayu.widgets.KeyboardStateObserver; import com.dayu.widgets.KeyboardStateObserver;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -45,7 +48,7 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm ...@@ -45,7 +48,7 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm
private UserInfo userInfo; private UserInfo userInfo;
private CommentBean selectedItem; private CommentBean selectedItem;
private int page = 1; private int page = 1;
private int pageSize = 2000; private int pageSize = 20;
private CommentAdapter mCommentAdapter; private CommentAdapter mCommentAdapter;
private List<CommentBean> commentList = new ArrayList<>(); private List<CommentBean> commentList = new ArrayList<>();
private WeakHandler weakHandler = new WeakHandler(); private WeakHandler weakHandler = new WeakHandler();
...@@ -80,9 +83,21 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm ...@@ -80,9 +83,21 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm
initDataView(); initDataView();
initCommentListener(); initCommentListener();
} }
showDialog();
getCommentData(); getCommentData();
initRefreshView();
}
//下拉刷新
private void initRefreshView() {
mBind.refreshLayout.setEnableLoadMore(false);
mBind.refreshLayout.setOnRefreshListener(refreshLayout -> {
page = 1;
getCommentData();
});
mBind.refreshLayout.setOnLoadMoreListener(refreshLayout -> {
getCommentData();
});
} }
//设置基本信息 //设置基本信息
...@@ -101,7 +116,7 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm ...@@ -101,7 +116,7 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm
} }
//填充卖点数据 //填充卖点数据
private void fillPointList(String pointStr){ private void fillPointList(String pointStr) {
if (!TextUtils.isEmpty(pointStr)) if (!TextUtils.isEmpty(pointStr))
pointList.add(pointStr); pointList.add(pointStr);
...@@ -220,18 +235,24 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm ...@@ -220,18 +235,24 @@ public class SaleInstructionFragment extends BaseFragment<SImplePresenter, Fragm
}); });
} }
//获取评论数据
private void getCommentData() { private void getCommentData() {
showDialog();
Api.getService(SaleService.class).getComment(mDetail.getId(), 1, 4, 1, page, pageSize).compose(Api.applySchedulers()) Api.getService(SaleService.class).getComment(mDetail.getId(), 1, 4, 1, page, pageSize).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data -> { .subscribe(mPresenter.baseObserver(data -> {
mBind.refreshLayout.finishRefresh();
mBind.refreshLayout.finishLoadMore();
if (page == 1) { if (page == 1) {
commentList.clear(); commentList.clear();
mBind.refreshLayout.setEnableLoadMore(data.getData().size() > 0);
} }
// commentList = transData(data.getData()); // commentList = transData(data.getData());
commentList = data.getData(); commentList.addAll(data.getData());
mBind.tvComponent.setText("留言. " + commentList.size()); mBind.tvComponent.setText("留言. " + data.getTotalRows());
mCommentAdapter.setData(commentList); mCommentAdapter.setData(commentList);
if (page == data.getTotalPages()){
mBind.refreshLayout.setEnableLoadMore(false);
}
page += 1;
})); }));
} }
......
...@@ -23,13 +23,9 @@ import com.dayu.base.ui.fragment.BaseFragment; ...@@ -23,13 +23,9 @@ import com.dayu.base.ui.fragment.BaseFragment;
import com.dayu.common.MyTextWatcher; import com.dayu.common.MyTextWatcher;
import com.dayu.event.UserInfo; import com.dayu.event.UserInfo;
import com.dayu.utils.CommonUtils; import com.dayu.utils.CommonUtils;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
import com.dayu.widgets.listener.OnItemClickListener; import com.dayu.widgets.listener.OnItemClickListener;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA; import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
...@@ -89,6 +85,7 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme ...@@ -89,6 +85,7 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme
}); });
} }
//搜索
private void initSearchView() { private void initSearchView() {
mBind.edtSeacher.setHint(mActivity.getString(R.string.input_sale_product)); mBind.edtSeacher.setHint(mActivity.getString(R.string.input_sale_product));
mBind.edtSeacher.addTextChangedListener(new MyTextWatcher(){ mBind.edtSeacher.addTextChangedListener(new MyTextWatcher(){
...@@ -125,13 +122,8 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme ...@@ -125,13 +122,8 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme
}); });
} }
private void hideBoard(){
InputMethodManager imm = (InputMethodManager) mActivity
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mActivity.getCurrentFocus().getWindowToken(), 0);
}
//跳转详情页
private void toDetail(ProductListBean item) { private void toDetail(ProductListBean item) {
Intent intent = new Intent(mActivity, ProductDetailActivity.class); Intent intent = new Intent(mActivity, ProductDetailActivity.class);
intent.putExtra("id", item.getId()); intent.putExtra("id", item.getId());
...@@ -192,8 +184,7 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme ...@@ -192,8 +184,7 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme
@Override @Override
public void share(ProductListBean item) { public void share(ProductListBean item) {
String shareUrl = "http://www.baidu.com"; CommonUtils.shareProgram(mActivity,item.getFirstUrl(),item.getGoodsModel(),
CommonUtils.shareProgram(mActivity,shareUrl,item.getFirstUrl(),item.getGoodsModel(),
item.getBrief(),mUserId,item.getId(),SHARE_MEDIA.WEIXIN,null); item.getBrief(),mUserId,item.getId(),SHARE_MEDIA.WEIXIN,null);
} }
} }
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<cn.jzvd.JzvdStd <cn.jzvd.JzvdStd
android:id="@+id/jz_video" android:id="@+id/jz_video"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp" /> android:layout_height="150dp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -9,11 +9,17 @@ ...@@ -9,11 +9,17 @@
android:paddingLeft="@dimen/dp_20" android:paddingLeft="@dimen/dp_20"
android:paddingRight="@dimen/dp_20"> android:paddingRight="@dimen/dp_20">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_marginBottom="55dp"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView <android.support.v4.widget.NestedScrollView
android:id="@+id/nsv_operate" android:id="@+id/nsv_operate"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="55dp"> >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -43,8 +49,7 @@ ...@@ -43,8 +49,7 @@
android:id="@+id/rv_scene" android:id="@+id/rv_scene"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:overScrollMode="never" android:overScrollMode="never" />
/>
</LinearLayout> </LinearLayout>
<LinearLayout style="@style/sale_linearlayout_detail"> <LinearLayout style="@style/sale_linearlayout_detail">
...@@ -69,15 +74,14 @@ ...@@ -69,15 +74,14 @@
android:id="@+id/rv_sell_point" android:id="@+id/rv_sell_point"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:overScrollMode="never" android:overScrollMode="never" />
/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_weight="1"
android:background="@color/cl_white" android:background="@color/cl_white"
android:orientation="vertical"> android:orientation="vertical">
...@@ -91,11 +95,12 @@ ...@@ -91,11 +95,12 @@
android:textColor="@color/cl_home_title_text_color" android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" /> android:textStyle="bold" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/color_ee" android:background="@color/color_ee" />
/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -134,14 +139,18 @@ ...@@ -134,14 +139,18 @@
android:textSize="13sp" /> android:textSize="13sp" />
</LinearLayout> </LinearLayout>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rv_component" android:id="@+id/rv_component"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<Button <Button
android:id="@+id/btn_comment" android:id="@+id/btn_comment"
......
...@@ -11,5 +11,6 @@ ...@@ -11,5 +11,6 @@
android:checked="true" android:checked="true"
android:clickable="false" android:clickable="false"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:layout_marginTop="5dp"
/> />
...@@ -88,13 +88,23 @@ ...@@ -88,13 +88,23 @@
android:layout_height="35dp" android:layout_height="35dp"
android:src="@drawable/icon_user_default" /> android:src="@drawable/icon_user_default" />
<TextView <LinearLayout
android:id="@+id/tv_name2" android:id="@+id/ll_user2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:orientation="horizontal"
android:layout_marginRight="35dp"
android:layout_toRightOf="@id/iv_avatar2" android:layout_toRightOf="@id/iv_avatar2"
>
<TextView
android:id="@+id/tv_name2"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="@{item.accountName}" android:text="@{item.accountName}"
android:textColor="@color/cl_home_title_text_color" android:textColor="@color/cl_home_title_text_color"
android:textSize="13sp" /> android:textSize="13sp" />
...@@ -103,19 +113,19 @@ ...@@ -103,19 +113,19 @@
android:id="@+id/tv_time2" android:id="@+id/tv_time2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/tv_name2"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/tv_name2"
android:text="time" android:text="time"
android:textColor="@color/tv_cl" android:textColor="@color/tv_cl"
android:textSize="13sp" /> android:textSize="13sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_content" android:id="@+id/ll_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/tv_name2" android:layout_below="@id/ll_user2"
android:layout_alignLeft="@id/tv_name2" android:layout_alignLeft="@id/ll_user2"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -125,24 +135,25 @@ ...@@ -125,24 +135,25 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/reply_str" android:text="@string/reply_str"
android:lineSpacingExtra="2dp"
android:textColor="@color/cl_home_title_text_color" android:textColor="@color/cl_home_title_text_color"
android:textSize="13sp" /> android:textSize="13sp" />
<TextView <!--<TextView-->
android:id="@+id/tv_reply_name" <!--android:id="@+id/tv_reply_name"-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:text='@{"@"+item.beName}' <!--android:text='@{"@"+item.beName}'-->
android:textColor="@color/cl_home_button" <!--android:textColor="@color/cl_home_button"-->
android:textSize="13sp" /> <!--android:textSize="13sp" />-->
<TextView <!--<TextView-->
android:id="@+id/tv_content2" <!--android:id="@+id/tv_content2"-->
android:layout_width="wrap_content" <!--android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!--android:layout_height="wrap_content"-->
android:text='@{": "+item.content}' <!--android:text='@{": "+item.content}'-->
android:textColor="@color/cl_home_title_text_color" <!--android:textColor="@color/cl_home_title_text_color"-->
android:textSize="13sp" /> <!--android:textSize="13sp" />-->
</LinearLayout> </LinearLayout>
<ImageView <ImageView
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:id="@+id/iv_img" android:id="@+id/iv_img"
android:layout_width="@dimen/dp_89" android:layout_width="@dimen/dp_89"
android:layout_height="@dimen/dp_89" android:layout_height="@dimen/dp_89"
android:src="@drawable/icon_img_default" /> />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
......
...@@ -74,7 +74,7 @@ public class HomeUserPresenter extends HomeUserContract.Presenter { ...@@ -74,7 +74,7 @@ public class HomeUserPresenter extends HomeUserContract.Presenter {
@Override @Override
public void dumpToOrderRecord() { public void dumpToOrderRecord() {
mView.startActivity(ServiceRecordActivity.class); // mView.startActivity(ServiceRecordActivity.class);
} }
@Override @Override
......
...@@ -64,7 +64,8 @@ public class CertificationResultActivity extends DataBindingActivity<ActivityCer ...@@ -64,7 +64,8 @@ public class CertificationResultActivity extends DataBindingActivity<ActivityCer
if (UserManager.getInstance().getRole() == Constants.ENGINEER) { if (UserManager.getInstance().getRole() == Constants.ENGINEER) {
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation(); ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
} else if (UserManager.getInstance().getRole() == Constants.MANAGER_ENGINEER) { } else if (UserManager.getInstance().getRole() == Constants.MANAGER_ENGINEER) {
ARouter.getInstance().build(RouterPath.PATH_SERVICESTATION).navigation(); ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
// ARouter.getInstance().build(RouterPath.PATH_SERVICESTATION).navigation();
} }
} }
}); });
......
...@@ -47,25 +47,15 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity ...@@ -47,25 +47,15 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity
public void initView() { public void initView() {
initUser(); initUser();
mBind.receivingBack.setOnClickListener(v -> dumpBack()); mBind.receivingBack.setOnClickListener(v -> dumpBack());
mBind.tvSubmit.setOnClickListener(v-> saveData()); mBind.tvSubmit.setOnClickListener(v -> saveData());
initData(); initData();
} }
private void initData() { private void initData() {
showDialog(); showDialog();
//已保存场景 // initSceneData();
Api.getService(UserService2.class).getSavedSecne(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(datas -> {
savedSceneDatas = datas;
setSceneAdapter();
}));
//业务场景数据
Api.getService(UserService2.class).getBusinessScene().compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(datas -> {
sceneDatas = datas;
setSceneAdapter();
}));
//已保存服务类型数据 //已保存服务类型数据
Api.getService(UserService2.class).getSavedServiceType(mUserId).compose(Api.applySchedulers()) Api.getService(UserService2.class).getSavedServiceType(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(datas -> { .subscribe(mPresenter.baseObserver(datas -> {
...@@ -80,6 +70,21 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity ...@@ -80,6 +70,21 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity
})); }));
} }
private void initSceneData() {
//已保存场景
Api.getService(UserService2.class).getSavedSecne(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(datas -> {
savedSceneDatas = datas;
setSceneAdapter();
}));
//业务场景数据
Api.getService(UserService2.class).getBusinessScene().compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(datas -> {
sceneDatas = datas;
setSceneAdapter();
}));
}
//销售业务场景 //销售业务场景
private void setSceneAdapter() { private void setSceneAdapter() {
for (int i = 0; i < savedSceneDatas.size(); i++) { for (int i = 0; i < savedSceneDatas.size(); i++) {
...@@ -137,36 +142,38 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity ...@@ -137,36 +142,38 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity
} }
//保存数据 //保存数据
private void saveData() { private void saveData() {
//业务场景
List<SaveSceneData> sceneList = new ArrayList<>(); List<SaveSceneData> sceneList = new ArrayList<>();
List<Long> typeList = new ArrayList<>(); List<Long> typeList = new ArrayList<>();
for (BusinessSceneBean sceneBean : sceneDatas){ for (BusinessSceneBean sceneBean : sceneDatas) {
if (sceneBean.isSelected()) if (sceneBean.isSelected())
sceneList.add(new SaveSceneData(mUserId,sceneBean.getId(),sceneBean.getName(),sceneBean.getId())); sceneList.add(new SaveSceneData(mUserId, sceneBean.getId(), sceneBean.getName(), sceneBean.getId()));
} }
for (ServiceTypeBean typeBean : typeDatas){ //服务类型
for (ServiceTypeBean typeBean : typeDatas) {
if (typeBean.isSelected()) if (typeBean.isSelected())
typeList.add(typeBean.getId()); typeList.add(typeBean.getId());
} }
if (sceneList.size()>0){ // if (sceneList.size() > 0) {
saveScene(sceneList,typeList); // saveScene(sceneList, typeList);
}else{ // } else {
// saveType(typeList);
// }
saveType(typeList); saveType(typeList);
} }
}
//保存业务场景数据 //保存业务场景数据
private void saveScene(List<SaveSceneData> datas,List<Long> typeList ) { private void saveScene(List<SaveSceneData> datas, List<Long> typeList) {
showDialog(); showDialog();
Api.getService(UserService2.class).saveBusinessScene(datas).compose(Api.applySchedulers()) Api.getService(UserService2.class).saveBusinessScene(datas).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(bool -> { .subscribe(mPresenter.baseObserver(bool -> {
ToastUtils.showShortToast(bool?R.string.save_success:R.string.save_fail); ToastUtils.showShortToast(bool ? R.string.save_success : R.string.save_fail);
if (bool){ if (bool) {
saveType(typeList); saveType(typeList);
}else{ } else {
ToastUtils.showShortToast(R.string.save_fail); ToastUtils.showShortToast(R.string.save_fail);
} }
})); }));
...@@ -174,13 +181,13 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity ...@@ -174,13 +181,13 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity
//保存服务类型数据 //保存服务类型数据
private void saveType(List<Long> ids) { private void saveType(List<Long> ids) {
if (ids.size() ==0) if (ids.size() == 0)
return; return;
showDialog(); showDialog();
Api.getService(UserService2.class).saveServiceType(ids, mUserId).compose(Api.applySchedulers()) Api.getService(UserService2.class).saveServiceType(ids, mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(bool -> { .subscribe(mPresenter.baseObserver(bool -> {
ToastUtils.showShortToast(bool?R.string.save_success:R.string.save_fail); ToastUtils.showShortToast(bool ? R.string.save_success : R.string.save_fail);
if (bool){ if (bool) {
EventBus.getDefault().post(new RefreshUserRecordEvent()); EventBus.getDefault().post(new RefreshUserRecordEvent());
finish(); finish();
} }
......
...@@ -69,6 +69,7 @@ public class EditAddressActivity extends BaseActivity<SImplePresenter, ActivityE ...@@ -69,6 +69,7 @@ public class EditAddressActivity extends BaseActivity<SImplePresenter, ActivityE
//选择地址点击事件 //选择地址点击事件
private void initData() { private void initData() {
showDialog();
Api.getService(UserService2.class).getAddressInfo(mUserId).compose(Api.applySchedulers()) Api.getService(UserService2.class).getAddressInfo(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data -> { .subscribe(mPresenter.baseObserver(data -> {
getTreeAddrData(data.getProvinceId(), 2, false); getTreeAddrData(data.getProvinceId(), 2, false);
...@@ -81,6 +82,9 @@ public class EditAddressActivity extends BaseActivity<SImplePresenter, ActivityE ...@@ -81,6 +82,9 @@ public class EditAddressActivity extends BaseActivity<SImplePresenter, ActivityE
mBind.tvArea.setText(areaName = data.getDistrictName()); mBind.tvArea.setText(areaName = data.getDistrictName());
mBind.llCity.setVisibility(View.VISIBLE); mBind.llCity.setVisibility(View.VISIBLE);
mBind.llArea.setVisibility(View.VISIBLE); mBind.llArea.setVisibility(View.VISIBLE);
provinceId = data.getProvinceId();
cityId = data.getCityId();
areaId = data.getDistrictId();
isAddrSetted = true; isAddrSetted = true;
})); }));
} }
...@@ -248,8 +252,8 @@ public class EditAddressActivity extends BaseActivity<SImplePresenter, ActivityE ...@@ -248,8 +252,8 @@ public class EditAddressActivity extends BaseActivity<SImplePresenter, ActivityE
showDialog(); showDialog();
AddressInfoBean addressData = new AddressInfoBean(mUserId, detailAddr, cityId AddressInfoBean addressData = new AddressInfoBean(mUserId, detailAddr, cityId
, cityName, areaId, areaName, phone, name, provinceId, provinceName); , cityName, areaId, areaName, phone, name, provinceId, provinceName);
addressData.setCreateBy(mUserId+""); addressData.setCreateBy(mUserInfo.getAccountName());
addressData.setModifyBy(mUserId+""); addressData.setModifyBy(mUserInfo.getAccountName());
if (isAddrSetted){ if (isAddrSetted){
Api.getService(UserService2.class).updateAddressInfo(addressData).compose(Api.applySchedulers()) Api.getService(UserService2.class).updateAddressInfo(addressData).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(this::submitDone)); .subscribe(mPresenter.baseObserver(this::submitDone));
......
...@@ -18,6 +18,7 @@ import com.dayu.usercenter.model.bean.StarRatioBean; ...@@ -18,6 +18,7 @@ import com.dayu.usercenter.model.bean.StarRatioBean;
import com.dayu.usercenter.presenter.userinfo.UserInfoContract; import com.dayu.usercenter.presenter.userinfo.UserInfoContract;
import com.dayu.usercenter.presenter.userinfo.UserInfoPresenter; import com.dayu.usercenter.presenter.userinfo.UserInfoPresenter;
import com.dayu.usercenter.ui.activity.PersonInfoActivity; import com.dayu.usercenter.ui.activity.PersonInfoActivity;
import com.dayu.utils.CommonUtils;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -50,6 +51,7 @@ public class UserInfoActivity extends BaseActivity<UserInfoPresenter, ActivityUs ...@@ -50,6 +51,7 @@ public class UserInfoActivity extends BaseActivity<UserInfoPresenter, ActivityUs
mBind.cvHeader.setOnClickListener(view -> startActivity(PersonInfoActivity.class)); mBind.cvHeader.setOnClickListener(view -> startActivity(PersonInfoActivity.class));
mBind.btnEditBank.setOnClickListener(view -> startActivity(EditBankActivity.class)); mBind.btnEditBank.setOnClickListener(view -> startActivity(EditBankActivity.class));
mBind.btnEditAddr.setOnClickListener(view -> startActivity(EditAddressActivity.class)); mBind.btnEditAddr.setOnClickListener(view -> startActivity(EditAddressActivity.class));
mBind.tvHotLine.setOnClickListener(view -> CommonUtils.dialPhone(this,getString(R.string.customer_hot_line2)));
} }
private void setUserRule2(String rulr2) { private void setUserRule2(String rulr2) {
......
...@@ -83,7 +83,7 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo ...@@ -83,7 +83,7 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
@Override @Override
protected void lazyLoad() { protected void lazyLoad() {
super.lazyLoad(); super.lazyLoad();
ProgressUtil.startLoad(mActivity); showDialog();
mPresenter.getAllData(userId, siteId); mPresenter.getAllData(userId, siteId);
// mPresenter.getAlipayAccount(userId); // mPresenter.getAlipayAccount(userId);
} }
...@@ -140,9 +140,9 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo ...@@ -140,9 +140,9 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
mScore = record.getScore() + ""; mScore = record.getScore() + "";
drawStars(mBind.tvStar, mScore, "5"); drawStars(mBind.tvStar, mScore, "5");
mBind.tvSaleReward.setText(""+record.getSalesPrice()); mBind.tvSaleReward.setText(""+record.getSalesPrice());
mBind.tvSaleRecord.setText(record.getSalesCount() + ""); mBind.tvSaleRecord.setText(record.getSalesCount() + "");
mBind.tvServiceIncome.setText(""+record.getServiceTotalPrice()); mBind.tvServiceIncome.setText(""+record.getServiceTotalPrice());
mBind.tvBusinessType.setText(record.getCategoryCounts()+""); mBind.tvBusinessType.setText(record.getCategoryCounts()+"");
} }
......
...@@ -43,10 +43,12 @@ ...@@ -43,10 +43,12 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:visibility="gone"
style="@style/sale_item_text" style="@style/sale_item_text"
android:text="@string/business_choose_scene" /> android:text="@string/business_choose_scene" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:visibility="gone"
android:id="@+id/rv_scene" android:id="@+id/rv_scene"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -46,8 +46,7 @@ ...@@ -46,8 +46,7 @@
<android.support.v4.widget.NestedScrollView <android.support.v4.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -299,10 +298,31 @@ ...@@ -299,10 +298,31 @@
android:maxLines="15" android:maxLines="15"
android:text="@string/user_info_rule3" /> android:text="@string/user_info_rule3" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout
android:id="@+id/ll_hot_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView <TextView
style="@style/sale_item_text" style="@style/sale_item_text"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:text="@string/customer_hot_line" /> android:text="@string/customer_hot_line1" />
<TextView
android:id="@+id/tv_hot_line"
style="@style/sale_item_text"
android:layout_gravity="center_horizontal"
android:text="@string/customer_hot_line2"
android:textColor="@color/text_common_blue" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
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