Commit 890c41fc by YKai

feat:确认服务订单、订单完成后自动跳转评价页面,登录页面协议提到登录按钮下方

parent 2f001161
...@@ -8,9 +8,9 @@ ext { ...@@ -8,9 +8,9 @@ ext {
"m-confide" : "0.0.49.09", "m-confide" : "0.0.49.09",
"m-consultant" : "0.0.59.78", "m-consultant" : "0.0.59.78",
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user" : "0.0.61.31", "m-user" : "0.0.61.33",
"m-home" : "0.0.22.61", "m-home" : "0.0.22.61",
"m-im" : "0.0.19.11", "m-im" : "0.0.19.12",
"m-dynamic" : "0.0.7.22", "m-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -91,9 +91,9 @@ ext { ...@@ -91,9 +91,9 @@ ext {
"m-confide" : "0.0.49.09", "m-confide" : "0.0.49.09",
"m-consultant" : "0.0.59.78", "m-consultant" : "0.0.59.78",
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.31", "m-user" : "0.0.61.33",
"m-home" : "0.0.22.61", "m-home" : "0.0.22.61",
"m-im" : "0.0.19.11", "m-im" : "0.0.19.12",
"m-dynamic" : "0.0.7.22", "m-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.6", "m-article" : "0.0.0.6",
......
...@@ -49,6 +49,9 @@ class ImConstants { ...@@ -49,6 +49,9 @@ class ImConstants {
const val KEFUXIAOYI = "14" const val KEFUXIAOYI = "14"
// 服务单或者订单评价h5链接
val PLAY_SCORE_URL = HttpConfig.MH5_URL +"comment/submit/"
} }
} }
\ No newline at end of file
...@@ -58,6 +58,7 @@ object IMChatUtil { ...@@ -58,6 +58,7 @@ object IMChatUtil {
private const val USER_TYPE_EXPERT=2//专家 private const val USER_TYPE_EXPERT=2//专家
private const val USER_TYPE_ASSISTANT=3//助理 private const val USER_TYPE_ASSISTANT=3//助理
private const val USER_TYPE_USER=1//用户 private const val USER_TYPE_USER=1//用户
lateinit var doctorId:String
/** /**
* 接口数据请求完成回调 * 接口数据请求完成回调
*/ */
...@@ -278,6 +279,7 @@ object IMChatUtil { ...@@ -278,6 +279,7 @@ object IMChatUtil {
expert.shareData.cover expert.shareData.cover
) )
listener.onSuccess(expert) listener.onSuccess(expert)
doctorId = expert.shareData.doctorId
} else { } else {
upLoadLog("consult/get-expert", resp.code, resp.msg) upLoadLog("consult/get-expert", resp.code, resp.msg)
if (resp.code == ImConstants.HTTP_CODE_UNLOGIN) { if (resp.code == ImConstants.HTTP_CODE_UNLOGIN) {
......
...@@ -23,6 +23,7 @@ import com.yidianling.common.tools.ToastUtil; ...@@ -23,6 +23,7 @@ import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.bean.OrderStatusBean; import com.yidianling.im.bean.OrderStatusBean;
import com.yidianling.im.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.helper.IMChatUtil;
import com.yidianling.im.http.ImRetrofitApi; import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder; import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter; import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
...@@ -39,7 +40,7 @@ import okhttp3.MediaType; ...@@ -39,7 +40,7 @@ import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
/** /**
* 确认单 消息类型 38 * 确认服务单 消息类型 38
*/ */
public class MsgViewHolderConfirmOrder extends MsgViewHolderBase { public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
...@@ -134,8 +135,12 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase { ...@@ -134,8 +135,12 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
.subscribe(it -> { .subscribe(it -> {
//确认完成,按钮置灰,更新本地消息 //确认完成,按钮置灰,更新本地消息
updateLocalMsg(); updateLocalMsg();
// 跳转服务单评价页
H5Params orderParams = new H5Params(ImConstants.Companion.getPLAY_SCORE_URL() + IMChatUtil.doctorId + "/" + serviceId, null);
NewH5Activity.start(context, orderParams);
}, throwable -> }, throwable ->
ToastUtil.toastShort(throwable.getMessage()) ToastUtil.toastShort(throwable.getMessage())
); );
}); });
...@@ -213,16 +218,16 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase { ...@@ -213,16 +218,16 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
if (customAttachConsultSubScript.orderId.equals(orderId)) { if (customAttachConsultSubScript.orderId.equals(orderId)) {
//修改历史消息状态为已失效 //修改历史消息状态为已失效
Map map1 = msg.getLocalExtension(); Map map1 = msg.getLocalExtension();
if (map1==null){ if (map1 == null) {
map1 = new HashMap(); map1 = new HashMap();
map1.put("isExpired",true); map1.put("isExpired", true);
msg.setLocalExtension(map1); msg.setLocalExtension(map1);
NIMClient.getService(MsgService.class).updateIMMessage(msg); NIMClient.getService(MsgService.class).updateIMMessage(msg);
//通知ui刷新 //通知ui刷新
getMsgAdapter().updateItemAtLocalExtension(msg); getMsgAdapter().updateItemAtLocalExtension(msg);
}else{ } else {
map1 = new HashMap(); map1 = new HashMap();
map1.put("isExpired",true); map1.put("isExpired", true);
msg.setLocalExtension(map1); msg.setLocalExtension(map1);
NIMClient.getService(MsgService.class).updateIMMessage(msg); NIMClient.getService(MsgService.class).updateIMMessage(msg);
//通知ui刷新 //通知ui刷新
......
...@@ -21,6 +21,7 @@ import com.yidianling.common.tools.LogUtil; ...@@ -21,6 +21,7 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.helper.IMChatUtil;
import com.yidianling.im.http.ImRetrofitApi; import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder; import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone; import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone;
...@@ -36,7 +37,7 @@ import io.reactivex.disposables.Disposable; ...@@ -36,7 +37,7 @@ import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
/** /**
* 已完成订单 消息类型39 * 确认订单 消息类型39
*/ */
public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
...@@ -128,42 +129,46 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { ...@@ -128,42 +129,46 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
.subscribe(it -> { .subscribe(it -> {
//确认完成,按钮置灰,更新本地消息 //确认完成,按钮置灰,更新本地消息
updateLocalMsg(); updateLocalMsg();
// 跳转订单评价页
H5Params orderParams = new H5Params(ImConstants.Companion.getPLAY_SCORE_URL() + IMChatUtil.doctorId + "/" + orderId, null);
NewH5Activity.start(context, orderParams);
}, throwable -> }, throwable ->
ToastUtil.toastShort(throwable.getMessage()) ToastUtil.toastShort(throwable.getMessage())
); );
}); });
} }
try { try {
Map<String,Object> map = message.getLocalExtension(); Map<String, Object> map = message.getLocalExtension();
if (map!=null){ if (map != null) {
Object obj = map.get("isSure"); Object obj = map.get("isSure");
Object exp = map.get("isExpired"); Object exp = map.get("isExpired");
if (obj!=null){ if (obj != null) {
boolean b = (boolean) obj; boolean b = (boolean) obj;
if (flag == 1 || b){ if (flag == 1 || b) {
updateSureView("已确认"); updateSureView("已确认");
} }
}else if (exp!=null){ } else if (exp != null) {
boolean expb = (boolean) exp; boolean expb = (boolean) exp;
if (expb){ if (expb) {
updateSureView("已确认"); updateSureView("已确认");
} }
}else { } else {
isSureed = false; isSureed = false;
tv_submit.setText("确认"); tv_submit.setText("确认");
tv_submit.setEnabled(true); tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context,R.drawable.bg_radius_green_linear_12)); tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
} }
}else { } else {
isSureed = false; isSureed = false;
tv_submit.setText("确认"); tv_submit.setText("确认");
tv_submit.setEnabled(true); tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context,R.drawable.bg_radius_green_linear_12)); tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
} }
}catch (Exception e){} } catch (Exception e) {
}
hideItemBg(); hideItemBg();
} }
...@@ -205,16 +210,16 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { ...@@ -205,16 +210,16 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
if (customAttachConsultSubScript.orderId.equals(orderId)) { if (customAttachConsultSubScript.orderId.equals(orderId)) {
//修改历史消息状态为已失效 //修改历史消息状态为已失效
Map map1 = msg.getLocalExtension(); Map map1 = msg.getLocalExtension();
if (map1==null){ if (map1 == null) {
map1 = new HashMap(); map1 = new HashMap();
map1.put("isExpired",true); map1.put("isExpired", true);
msg.setLocalExtension(map1); msg.setLocalExtension(map1);
NIMClient.getService(MsgService.class).updateIMMessage(msg); NIMClient.getService(MsgService.class).updateIMMessage(msg);
//通知ui刷新 //通知ui刷新
getMsgAdapter().updateItemAtLocalExtension(msg); getMsgAdapter().updateItemAtLocalExtension(msg);
}else{ } else {
map1 = new HashMap(); map1 = new HashMap();
map1.put("isExpired",true); map1.put("isExpired", true);
msg.setLocalExtension(map1); msg.setLocalExtension(map1);
NIMClient.getService(MsgService.class).updateIMMessage(msg); NIMClient.getService(MsgService.class).updateIMMessage(msg);
//通知ui刷新 //通知ui刷新
......
...@@ -86,19 +86,14 @@ class ExpertConsultServiceItemView : LinearLayout { ...@@ -86,19 +86,14 @@ class ExpertConsultServiceItemView : LinearLayout {
service_item_time.text = "/${bean.productDto.minOrderTime}分钟" service_item_time.text = "/${bean.productDto.minOrderTime}分钟"
} }
if (bean.productDto.feedbackRate > 0) { //好评率,*20后 保留1位小数
//好评率,*20后 保留1位小数 service_item_feddbackrate.visibility = VISIBLE
service_item_feddbackrate.visibility = VISIBLE tv_feedbackRate.visibility = VISIBLE
tv_feedbackRate.visibility = VISIBLE
service_item_feddbackrate.text = String.format(
service_item_feddbackrate.text = String.format( "%.1f",
"%.1f", (bean.productDto.feedbackRate) * 100f
(bean.productDto.feedbackRate) * 100f ) + "%"
) + "%"
} else {
service_item_feddbackrate.visibility = GONE
tv_feedbackRate.visibility = GONE
}
//销量 //销量
......
...@@ -63,29 +63,4 @@ ...@@ -63,29 +63,4 @@
android:src="@drawable/user_login_qq_new" /> android:src="@drawable/user_login_qq_new" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_30"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/other_login_ll">
<ImageView
android:id="@+id/iv_select_protocol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/user_login_protocol_unselected_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_4"
android:textSize="12sp"
android:includeFontPadding="false"
android:id="@+id/tv_protocol"
android:textColor="@color/platform_color_BFBFBF"
android:text="同意壹点灵用户注册协议" />
</LinearLayout>
</merge> </merge>
\ No newline at end of file
...@@ -168,6 +168,32 @@ ...@@ -168,6 +168,32 @@
android:id="@+id/ll_next" android:id="@+id/ll_next"
android:textColor="@color/white" android:textColor="@color/white"
/> />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_next">
<ImageView
android:id="@+id/iv_select_protocol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/user_login_protocol_unselected_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_4"
android:textSize="12sp"
android:includeFontPadding="false"
android:id="@+id/tv_protocol"
android:textColor="@color/platform_color_BFBFBF"
android:text="同意壹点灵用户注册协议" />
</LinearLayout>
<include layout="@layout/user_activity_register_and_login_bottom" /> <include layout="@layout/user_activity_register_and_login_bottom" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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 to comment