From 710c5ca67b1c2e658ec5495c01136540fcfd21c3 Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期五, 21 四月 2023 10:07:22 +0800
Subject: [PATCH] 登录添加用户协议

---
 app/src/main/java/com/fuban/driver/ui/main/add_order/AddCityOrderActivity.kt |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/app/src/main/java/com/fuban/driver/ui/main/add_order/AddCityOrderActivity.kt b/app/src/main/java/com/fuban/driver/ui/main/add_order/AddCityOrderActivity.kt
index 2763997..ad8a074 100644
--- a/app/src/main/java/com/fuban/driver/ui/main/add_order/AddCityOrderActivity.kt
+++ b/app/src/main/java/com/fuban/driver/ui/main/add_order/AddCityOrderActivity.kt
@@ -19,10 +19,7 @@
 import com.fuban.driver.ui.DialogUtil
 import com.fuban.driver.ui.adapter.PopPeopleNUmAdapter
 import com.fuban.driver.ui.adapter.SelectNumberAdapter
-import com.fuban.driver.utils.Cache.CacheKey
-import com.fuban.driver.utils.DateUtil
 import com.fuban.driver.utils.PhoneCheckUtil
-import com.fuban.driver.wxapi.WXPayEntryActivity
 
 import kotlinx.android.synthetic.main.activity_add_city_order.*
 import kotlinx.android.synthetic.main.pop_pay_city.view.*
@@ -46,10 +43,12 @@
         SelectNumberAdapter()
     }
 
-    var startCityName: String = "" //开始站点名称 ->选择起点
+    var startCityName: String = "" //开始城市
+    var startSiteName: String = "" //开始站点名称 ->选择起点
     var startCityId: String = "" //开始站点id ->选择起点
 
-    var endCityName: String = "" // 结束站点名称 ->选择终点
+    var endCityName: String = "" // 结束城市
+    var endSiteName: String = "" // 结束站点名称 ->选择终点
     var endCityId: String = "" //结束站点id ->选择终点
 
     var lineId = "" //线路id ->选择线路
@@ -85,6 +84,8 @@
     var travelMode = -1 // 不包车或包车
     var currentSiteType = 0 //1:上车点 2:下车点
     var selectCityLocation = 0 //1:起点 2:2终点
+
+    var money = 0.0//订单金额
 
 
     override fun setContentView() {
@@ -153,9 +154,10 @@
                 map["startLon"] = startLon
                 map["totalSeat"] = totalSeat
                 map["travelMode"] = travelMode
-                map["travelTime"] = DateUtil.getTime(DateUtil.TYPE0, System.currentTimeMillis())
+                map["travelTime"] = tv_select_class.text.toString()+":00"
                 callNet(Api.orderCrossCity, map) {
                     var bean = gson.fromJson<AddOrderBean>(it, AddOrderBean::class.java)
+                    money = bean.data.amount
                     showPatTypeDialog(bean.data.id.toString())
                 }
             }
@@ -184,7 +186,7 @@
 
         ll_select_city_end.clickDelay {
             selectCityLocation = 2
-            if (startCityName.isEmpty()) {
+            if (startSiteName.isEmpty()) {
                 toast("请先选择起点")
                 return@clickDelay
             }
@@ -201,7 +203,7 @@
                 toast("请先选择线路")
                 return@clickDelay
             }
-            startActivity<SelectClassActivity>("lineId" to lineId, "startCityName" to startCityName, "endCityName" to endCityName)
+            startActivity<SelectClassActivity>("lineId" to lineId, "startCityName" to startSiteName, "endCityName" to endSiteName)
         }
 
         ll_select_car_line.clickDelay {
@@ -219,8 +221,7 @@
             }
             currentSiteType = 1
             startActivity<SelectStartPointActivity>(
-                    "startCityId" to startCityId,
-                    "name" to startCityName
+                    "startCityId" to startCityId, "name" to startCityName
             )
         }
 
@@ -374,7 +375,7 @@
             }
             if (paytype == "3" || paytype.isEmpty()) {
                 var data = gson.fromJson<AlipayBean2>(it, AlipayBean2::class.java)
-                startActivity<PayQrCodeActivity>("url" to data.data.code_url)
+                startActivity<PayQrCodeActivity>("url" to data.data.code_url,"money" to money)
                 finish()
             }
         }
@@ -416,15 +417,17 @@
         when (event!!.code) {
             BaseEvent.SELECT_POINT_SITE -> {
                 if (selectCityLocation == 1) {
-                    startCityName = event.msg
+                    startSiteName = event.msg
                     startCityId = event.msgTwo
-                    tv_start_point.text = startCityName
+                    startCityName = event.msgthree
+                    tv_start_point.text = startSiteName
                     clearByType(1)
                 }
                 if (selectCityLocation == 2) {
-                    endCityName = event.msg
+                    endSiteName = event.msg
                     endCityId = event.msgTwo
-                    tv_end_point.text = endCityName
+                    endCityName = event.msgthree
+                    tv_end_point.text = endSiteName
                     clearByType(2)
                     callLine()
                 }
@@ -528,7 +531,7 @@
             tv_down_point.text = ""
         }
         if (i < 2) {
-            endCityName = ""
+            endSiteName = ""
             endCityId = ""
             tv_end_point.text = ""
             endAddress = ""

--
Gitblit v1.7.1