|
@@ -51,7 +51,7 @@ class FragmentPayScanCode private constructor() : FragmentBasic() {
|
|
|
private lateinit var posTrx: PosTrx
|
|
|
|
|
|
override val title = StringUtil.get(R.string.pay_by_qr)
|
|
|
- override val countdownTime: Int = -1
|
|
|
+ override val countdownTime: Int = 80
|
|
|
|
|
|
private lateinit var binding: FragmentPayScanCodeBinding
|
|
|
private val viewModel = PayScanCodeViewModel()
|
|
@@ -71,7 +71,11 @@ class FragmentPayScanCode private constructor() : FragmentBasic() {
|
|
|
(requireActivity() as MainActivity).fragmentRouter.pop()
|
|
|
}
|
|
|
|
|
|
- lifecycleScope.launchWhenCreated { scanCodeManager.create() }
|
|
|
+ lifecycleScope.launchWhenCreated {
|
|
|
+ //开启倒计时,倒计时结束返回主页
|
|
|
+ (requireActivity() as MainActivity).fragmentRouter.resumeFragmentToolbarTimer()
|
|
|
+ scanCodeManager.create()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
|
@@ -149,6 +153,9 @@ class FragmentPayScanCode private constructor() : FragmentBasic() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //扫到码停止倒计时,免得刚好扫到码发起支付,这边又返回首页
|
|
|
+ (requireActivity() as MainActivity).fragmentRouter.stopFragmentToolbarTimer()
|
|
|
+
|
|
|
val dialog = loading(R.string.in_pay,false)
|
|
|
|
|
|
val discount = SystemApi.getDiscount(posTrx, scanValue)
|