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