Commit f2f0882b by 刘鹏

Merge branch 'fix/lp/lp_fix_sub_pay' into 'release'

咨询支付流程代码合并

See merge request app_android_lib/YDL-Component!282
parents b6b30d3c 25a80428
...@@ -58,7 +58,11 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -58,7 +58,11 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override @Override
public void contactYi() { public void contactYi() {
try {
ModularServiceManager.INSTANCE.provide(IImService.class)
.startP2PSession(mContext, -1, "14", "14", "客服小壹", "14");
} catch (Exception e) {
}
} }
@Override @Override
...@@ -108,7 +112,17 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -108,7 +112,17 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override @Override
public void chat(int id, int toUid, int canTalk, String accessToken, int isFromQingShu) { public void chat(int id, int toUid, int canTalk, String accessToken, int isFromQingShu) {
if ((toUid + "").equals("14")) {
//找客服私聊不需要积分
contactYi();
} else {
try {
ModularServiceManager.INSTANCE.provide(IImService.class)
.startChatCloseReplaceChat(mContext, String.valueOf(toUid));
} catch (Exception e) {
e.printStackTrace();
}
}
} }
@Override @Override
......
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.12" componentVersion = "0.3.0.12-SNAPSHOT"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -72,7 +72,6 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.* ...@@ -72,7 +72,6 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject import org.json.JSONObject
import java.util.concurrent.Executors import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import kotlin.collections.ArrayList
@Route(path = "/consultant/consultant") @Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(), class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
...@@ -1485,20 +1484,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1485,20 +1484,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
needRefresh = true needRefresh = true
} }
// val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime") val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime")
//
// var timeLimit = if (TextUtils.isEmpty(orderToPayTime)) { val timeLimit = if (TextUtils.isEmpty(orderToPayTime)) {
// 0L 0L
// } else { } else {
// orderToPayTime.toLong() orderToPayTime.toLong()
// } }
//
//
// if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) { if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) {
// if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) { if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) {
// getPresenter().fetchPromptPayment() getPresenter().fetchPromptPayment()
// } }
// } }
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT) ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6") ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6")
......
...@@ -60,7 +60,8 @@ class ConsultSubPayDialog( ...@@ -60,7 +60,8 @@ class ConsultSubPayDialog(
findViewById<TextView>(R.id.priceTv).text = "¥$price" findViewById<TextView>(R.id.priceTv).text = "¥$price"
var format = SimpleDateFormat("HH:mm:ss"); var format = SimpleDateFormat("HH:mm:ss");
format.timeZone = TimeZone.getTimeZone("GMT+0"); format.timeZone = TimeZone.getTimeZone("GMT+0");
var millisInFuture = promptPaymentBean.currentTime?:0 - (promptPaymentBean.toPayTime?:0L) var millisInFuture =
promptPaymentBean.toPayTime?.minus(promptPaymentBean.currentTime ?: 0) ?: 0
mTimer = CountDownTimerSupport(millisInFuture, 1000) mTimer = CountDownTimerSupport(millisInFuture, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener { mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
...@@ -69,7 +70,8 @@ class ConsultSubPayDialog( ...@@ -69,7 +70,8 @@ class ConsultSubPayDialog(
} }
override fun onFinish() { override fun onFinish() {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
dismiss() dismiss()
} }
...@@ -80,7 +82,8 @@ class ConsultSubPayDialog( ...@@ -80,7 +82,8 @@ class ConsultSubPayDialog(
}) })
mTimer?.start() mTimer?.start()
findViewById<TextView>(R.id.tv_close).setOnClickListener { findViewById<TextView>(R.id.tv_close).setOnClickListener {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
mTimer?.stop() mTimer?.stop()
dismiss() dismiss()
...@@ -96,7 +99,8 @@ class ConsultSubPayDialog( ...@@ -96,7 +99,8 @@ class ConsultSubPayDialog(
ToastUtil.toastShort("跳转失败") ToastUtil.toastShort("跳转失败")
dismiss() dismiss()
} }
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
} }
} }
......
...@@ -71,7 +71,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -71,7 +71,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
if (ActionHandlerStorage.getL(contactId) != null) { if (ActionHandlerStorage.getL(contactId) != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
} else if (contactId.equals(ImConstants.KEFUXIAOYI)) { } else if (contactId.equals(ImConstants.KEFUXIAOYI)) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} }
ActionHandlerStorage.setL(contactId, l); ActionHandlerStorage.setL(contactId, l);
......
...@@ -168,7 +168,7 @@ class ExpertConsultServiceItemView : LinearLayout { ...@@ -168,7 +168,7 @@ class ExpertConsultServiceItemView : LinearLayout {
NewH5Activity.start( NewH5Activity.start(
mContext, mContext,
H5Params( H5Params(
HttpConfig.MH5_URL + "consult/#/pages/jieyou/DownOrder?product_id=" + bean.productDto.id, HttpConfig.MH5_URL + "consult/#/pages/jieyou/DownOrder?product_id=${bean.productDto.id}&hideNavBar=1",
null null
) )
) )
......
...@@ -212,28 +212,29 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -212,28 +212,29 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
val orderNum = response.data?.consultOrderNum ?: 0 val orderNum = response.data?.consultOrderNum ?: 0
if (orderNum > 0) { if (orderNum > 0) {
iv_order_tip.visibility = View.VISIBLE iv_order_tip.visibility = View.VISIBLE
if (orderNum > 99) { val numberStr = if (orderNum > 99) {
iv_order_tip.text = "99+" "99+"
} else { } else {
iv_order_tip.text = "$orderNum" "$orderNum"
} }
getLocal().setConsult(true) iv_order_tip.text = numberStr
getLocal().setConsult(orderNum)
} else { } else {
iv_order_tip.visibility = View.GONE iv_order_tip.visibility = View.GONE
getLocal().setConsult(false) getLocal().setConsult(0)
} }
}else{ }else{
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(0)
} }
}else{ }else{
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(0)
} }
},{ },{
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(0)
}) })
} }
...@@ -245,7 +246,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -245,7 +246,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
private fun refreshCouponData() { private fun refreshCouponData() {
getLocal().setCoupon(false) getLocal().setCoupon(false)
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(0)
val userInfo = getUserInfo() val userInfo = getUserInfo()
......
...@@ -22,9 +22,9 @@ interface AppLocal { ...@@ -22,9 +22,9 @@ interface AppLocal {
fun setCoupon(have:Boolean) fun setCoupon(have:Boolean)
fun getConsult():Boolean fun getConsult(): Int
fun setConsult(have: Boolean) fun setConsult(have: Int)
fun getConfide():Boolean fun getConfide():Boolean
......
...@@ -50,12 +50,12 @@ internal class AppLocalImpl private constructor(): AppLocal { ...@@ -50,12 +50,12 @@ internal class AppLocalImpl private constructor(): AppLocal {
getAppSP().edit().putBoolean(COUPON, have).apply() getAppSP().edit().putBoolean(COUPON, have).apply()
} }
override fun getConsult(): Boolean { override fun getConsult(): Int {
return getAppSP().getBoolean(CONSULT, false) return getAppSP().getInt(CONSULT, 0)
} }
override fun setConsult(have: Boolean) { override fun setConsult(have: Int) {
getAppSP().edit().putBoolean(CONSULT, have).apply() getAppSP().edit().putInt(CONSULT, have).apply()
} }
override fun getConfide(): Boolean { override fun getConfide(): Boolean {
......
...@@ -417,18 +417,18 @@ ...@@ -417,18 +417,18 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
tools:text="11"
android:id="@+id/iv_order_tip" android:id="@+id/iv_order_tip"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:background="@drawable/user_mine_background_red_point_new_coupon"
android:gravity="center" android:gravity="center"
android:textSize="8dp"
android:textColor="@color/white" android:textColor="@color/white"
android:background="@drawable/user_mine_background_red_point_new_coupon" android:textSize="6sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintCircle="@id/iv_trade_order" app:layout_constraintCircle="@id/iv_trade_order"
app:layout_constraintCircleAngle="45" app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="10dp" app:layout_constraintCircleRadius="10dp"
tools:text="9"
tools:visibility="visible" /> tools:visibility="visible" />
<TextView <TextView
......
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