1 文件已重命名
23个文件已添加
48个文件已修改
| | |
| | | <uses-permission android:name="android.permission.READ_CONTACTS"/> |
| | | <uses-permission android:name="android.permission.RECORD_AUDIO"/> |
| | | <application |
| | | android:name=".OkApplication" |
| | | android:name=".KuanzhaiApplication" |
| | | android:allowBackup="true" |
| | | android:icon="@mipmap/ic_launcher" |
| | | android:label="@string/app_name" |
| | |
| | | <activity android:name=".ui.mine.TicketRecordActivity" android:label="开票历史"/> |
| | | <activity android:name=".ui.trip.PinPriceRuleActivity" /> |
| | | <activity android:name=".ui.trip.PriceRuleActivity" /> |
| | | <activity android:name=".ui.charter.CharterActivity" /> |
| | | <activity android:name=".ui.charter.CharterActivity" android:windowSoftInputMode="adjustPan"/> |
| | | <activity android:name=".ui.mine.MyCompanyActivity" android:label="企业认证" android:launchMode="singleTask"/> |
| | | <activity android:name=".ui.mine.VerifyCompanyActivity" android:label="企业认证"/> |
| | | <activity android:name=".ui.mine.MemberActivity" android:label="企业成员"/> |
| | |
| | | <activity android:name=".ui.mine.CreditApplyListActivity" android:label="额度申请"/> |
| | | <activity android:name=".ui.mine.MyCreditActivity" /> |
| | | <activity android:name=".ui.mine.ApplyDetailActivity" android:label="申请详情"/> |
| | | <activity android:name=".ui.mine.OrderCheckListActivity" android:label="订单审核"/> |
| | | <activity android:name=".ui.mine.OrderCheckDetailActivity" android:label="订单审核"/> |
| | | <activity android:name=".ui.mine.VoiceRecordActivity" android:label="车内录音设置"/> |
| | | </application> |
| | | |
| | | </manifest> |
File was renamed from app/src/main/java/com/kuanzhai/user/OkApplication.kt |
| | |
| | | import java.lang.Exception |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | class OkApplication :BaseApplication(), Application.ActivityLifecycleCallbacks { |
| | | override fun getSPName() = "OkSp" |
| | | class KuanzhaiApplication :BaseApplication(), Application.ActivityLifecycleCallbacks { |
| | | override fun getSPName() = "KuanzhaiSp" |
| | | private var heartSubscribe: Disposable? = null |
| | | private val listeners = ArrayList<OrderStateChangeListener>() |
| | | private val activities = ArrayList<Activity>() |
| | |
| | | var phone = "" //我的手机号 |
| | | var avatar = "" //我的头像 |
| | | var phoneService = "" //客服电话号 |
| | | var officialPermission = false //公务用车权限 |
| | | } |
| | | |
| | | override fun onActivityPaused(p0: Activity) { |
| | |
| | | dismiss() |
| | | } |
| | | } |
| | | private var startTime = System.currentTimeMillis() + 21L * 60 * 1000 //预约开始时间从20分钟之后 |
| | | private var startTime = System.currentTimeMillis() + 5L * 60 * 1000 //预约开始时间从20分钟之后 |
| | | |
| | | private fun setDay() { |
| | | val calendar = Calendar.getInstance() |
| | |
| | | import android.webkit.WebChromeClient |
| | | import androidx.fragment.app.DialogFragment |
| | | import cn.sinata.xldutils.utils.screenWidth |
| | | import cn.sinata.xldutils.visible |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.dialog_h5.* |
| | |
| | | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| | | super.onViewCreated(view, savedInstanceState) |
| | | tv_title.text = arguments?.getString("title") |
| | | val ok: String = arguments?.getString("ok") ?: "我已阅读" |
| | | tv_ok.text = ok |
| | | if (ok == "去开启"){ |
| | | tv_cancel.visible() |
| | | tv_cancel.setOnClickListener { dismissAllowingStateLoss() } |
| | | } |
| | | val settings = sc_content.settings |
| | | settings.javaScriptEnabled = true |
| | | settings.javaScriptCanOpenWindowsAutomatically = true |
New file |
| | |
| | | package com.kuanzhai.user.dialog |
| | | |
| | | import android.os.Bundle |
| | | import android.view.Gravity |
| | | import android.view.LayoutInflater |
| | | import android.view.View |
| | | import android.view.ViewGroup |
| | | import androidx.fragment.app.DialogFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.parserTime |
| | | import cn.sinata.xldutils.utils.toTime |
| | | import com.kuanzhai.user.R |
| | | import kotlinx.android.synthetic.main.dialog_time_wheel.* |
| | | import org.jetbrains.anko.matchParent |
| | | import org.jetbrains.anko.wrapContent |
| | | import java.util.* |
| | | |
| | | /** |
| | | * 包车起止时间选择 |
| | | */ |
| | | class OfficialCharterTimeDialog : DialogFragment() { |
| | | override fun onCreateView( |
| | | inflater: LayoutInflater, |
| | | container: ViewGroup?, |
| | | savedInstanceState: Bundle? |
| | | ): View? { |
| | | return inflater.inflate(R.layout.dialog_time_wheel, container, false) |
| | | } |
| | | |
| | | private val selectedStartTime by lazy { arguments?.getString("startTime")?:"" } //选择的开始时间 |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | setStyle(STYLE_NO_FRAME, R.style.Dialog) |
| | | } |
| | | |
| | | override fun onActivityCreated(savedInstanceState: Bundle?) { |
| | | super.onActivityCreated(savedInstanceState) |
| | | dialog?.window?.setLayout(matchParent, wrapContent) |
| | | dialog?.window?.setGravity(Gravity.BOTTOM) |
| | | dialog?.setCanceledOnTouchOutside(true) |
| | | } |
| | | |
| | | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| | | super.onViewCreated(view, savedInstanceState) |
| | | tv_title.text = "选择用车时间" |
| | | |
| | | wv_4.gone() |
| | | wv_5.gone() |
| | | |
| | | setDay() |
| | | setHour() |
| | | setMin() |
| | | |
| | | wv_1.setOnWheelViewListener { _, item -> |
| | | setHour() |
| | | setMin() |
| | | } |
| | | wv_2.setOnWheelViewListener { _, _ -> |
| | | setMin() |
| | | } |
| | | |
| | | tv_cancel.setOnClickListener { |
| | | dismiss() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | val nowMonth = Calendar.getInstance().get(Calendar.MONTH) + 1 |
| | | val nowYear = Calendar.getInstance().get(Calendar.YEAR) |
| | | val s = (if (wv_1.seletedItem.substring(0, 2).toInt() < nowMonth)//翻年 |
| | | nowYear + 1 else nowYear).toString() + "-" + |
| | | (wv_1.seletedItem.replace("月", "-").replace("日", " ")) + |
| | | wv_2.seletedItem.replace("点", ":") + wv_3.seletedItem.replace("分", "") |
| | | |
| | | callback?.onOk(s) |
| | | dismiss() |
| | | } |
| | | } |
| | | |
| | | private val startTime by lazy {//预约开始时间从20分钟之后 |
| | | if (selectedStartTime.isEmpty()) //用车开始时间 |
| | | System.currentTimeMillis() + 6L * 60 * 1000 |
| | | else //用车结束时间,至少用车0.5天,所以在开始时间基础上加12小时 |
| | | selectedStartTime.parserTime("yyyy-MM-dd HH:mm")+ 12L * 60 * 60 * 1000 |
| | | } |
| | | |
| | | private fun setDay() { |
| | | val calendar = Calendar.getInstance() |
| | | calendar.set(Calendar.HOUR_OF_DAY,23) |
| | | calendar.set(Calendar.MINUTE,56) |
| | | val todayLastTime = calendar.timeInMillis //今天11点56分的时间,今天最晚可预约时间 |
| | | if (selectedStartTime.isEmpty()&&startTime >= todayLastTime){ |
| | | wv_1.setItems(listOf((startTime+24*60*60*1000).toTime("MM月dd日"), (startTime+48*60*60*1000).toTime("MM月dd日"))) |
| | | } |
| | | else{ |
| | | wv_1.setItems(listOf(startTime.toTime("MM月dd日"),(startTime+24*60*60*1000).toTime("MM月dd日"),(startTime+48*60*60*1000).toTime("MM月dd日"))) |
| | | } |
| | | wv_1.setSeletion(0) |
| | | } |
| | | |
| | | private fun setHour() { |
| | | val i = if (wv_1.seletedIndex == 0) startTime.toTime("HH").toInt() else 0 |
| | | wv_2.setItems( |
| | | (i..23).map { |
| | | String.format("%02d点",it) |
| | | } |
| | | ) |
| | | wv_2.setSeletion(0) |
| | | } |
| | | |
| | | private fun setMin() { |
| | | if (wv_1.seletedIndex == 0&&wv_2.seletedIndex == 0){ |
| | | wv_3.setItems((startTime.toTime("mm").toInt()..59).map { |
| | | String.format("%02d分",it) |
| | | }) |
| | | }else{ |
| | | wv_3.setItems((0..59).map { |
| | | String.format("%02d分",it) |
| | | }) |
| | | } |
| | | wv_3.setSeletion(0) |
| | | } |
| | | |
| | | interface Callback { |
| | | fun onOk(formatS:String) |
| | | } |
| | | |
| | | private var callback: Callback? = null |
| | | |
| | | fun setCallback(callback: Callback) { |
| | | this.callback = callback |
| | | } |
| | | } |
| | |
| | | import androidx.fragment.app.FragmentManager |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.activity.BaseActivity |
| | | import cn.sinata.xldutils.fragment.BaseDialogFragment |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.Passenger |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.MainActivity |
| | | import com.kuanzhai.user.ui.official.adapter.PassengerAdapter |
| | | import com.kuanzhai.user.ui.official.adapter.ReasonAdapter |
| | | import kotlinx.android.synthetic.main.dialog_reason.* |
| | |
| | | private val passengerAdapter by lazy { PassengerAdapter(passenger,tv_count) } |
| | | private val reason by lazy { arguments?.getStringArrayList("reason")?: arrayListOf() } |
| | | private val reasonAdapter by lazy { ReasonAdapter(reason) } |
| | | private val passengers by lazy { arguments?.getParcelableArrayList<Passenger>("passenger")?: arrayListOf() } |
| | | |
| | | private var callback:StringCallback? = null |
| | | private var callback:ReasonCallback? = null |
| | | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | |
| | | override fun initView() { |
| | | rv_passenger.layoutManager = LinearLayoutManager(requireContext()) |
| | | passenger.add(Passenger(arguments?.getString("name")?:"")) |
| | | passenger.addAll(passengers) |
| | | if (passenger.isEmpty()) |
| | | passenger.add(Passenger((requireActivity() as MainActivity).userInfo?.name?:"",(requireActivity() as MainActivity).userInfo?.phone?:"")) |
| | | tv_count.text = "出行人数 ${passenger.size}" |
| | | |
| | | rv_passenger.adapter = passengerAdapter |
| | | passengerAdapter.callback = object :PassengerAdapter.MoreCallback{ |
| | | override fun onClick(position: Int) { |
| | | HttpManager.queryStaff().request(requireActivity() as BaseActivity){_,data-> |
| | | val list = (data ?: arrayListOf()).filter { it.name.isNotEmpty() } |
| | | if (list.isEmpty()) |
| | | myToast("暂无常用乘车人") |
| | | else{ |
| | | val singleWheelDialog = SingleWheelDialog() |
| | | val arrayListOf = arrayListOf<String>() |
| | | val nameList = list.map { it.name } |
| | | arrayListOf.addAll(nameList) |
| | | singleWheelDialog.arguments = bundleOf("title" to "常用乘车人","data" to arrayListOf) |
| | | singleWheelDialog.show(childFragmentManager,"p") |
| | | singleWheelDialog.setCallback(object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | passenger[position].name = list[nameList.indexOf(rlt)].name |
| | | passenger[position].phone = list[nameList.indexOf(rlt)].phone |
| | | passengerAdapter.notifyItemChanged(position) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | iv_add.setOnClickListener { |
| | | if (passenger.size == 4) |
| | | myToast("最多可添加4人") |
| | |
| | | } |
| | | } |
| | | |
| | | val checkReason = arguments?.getString("checkReason")?:"" |
| | | val checkIndex = checkReason.split(",").map { reason.indexOf(it) } |
| | | if (checkReason!= "事由出行") |
| | | reasonAdapter.checked.addAll(checkIndex) |
| | | val payWay = arguments?.getInt("payWay",0)?:0 |
| | | if (payWay == 1) |
| | | rb_self.isChecked = true |
| | | else if (payWay == 2) |
| | | rb_company.isChecked = true |
| | | |
| | | et_content.setText(arguments?.getString("content")) |
| | | |
| | | rv_reason.layoutManager = GridLayoutManager(requireContext(),4) |
| | | rv_reason.adapter = reasonAdapter |
| | | tv_action.setOnClickListener { |
| | |
| | | myToast("出行人姓名不能为空") |
| | | return@setOnClickListener |
| | | } |
| | | if (reasonAdapter.checked == -1){ |
| | | if (reasonAdapter.checked.isEmpty()){ |
| | | myToast("请选择出行事由") |
| | | return@setOnClickListener |
| | | } |
| | |
| | | myToast("请选择付费方式") |
| | | return@setOnClickListener |
| | | } |
| | | callback?.onRlt(reason[reasonAdapter.checked]) |
| | | callback?.onResult(passenger,reasonAdapter.checked.joinToString (","){ reason[it] },if (rb_company.isChecked) 2 else 1,et_content.text.toString()) |
| | | dismissAllowingStateLoss() |
| | | } |
| | | } |
| | | |
| | | interface ReasonCallback{ |
| | | fun onResult(passengers:List<Passenger>,reason:String,payWay:Int,remark:String) |
| | | } |
| | | |
| | | companion object{ |
| | | fun show(fm: FragmentManager, name:String,reason:ArrayList<String>,callback: StringCallback){ |
| | | fun show(fm: FragmentManager,payWay:Int,reason:ArrayList<String>,passenger:ArrayList<Passenger>,checkReason:String,content:String,callback: ReasonCallback){ |
| | | val reasonDialog = ReasonDialog() |
| | | reasonDialog.arguments = bundleOf("name" to name,"reason" to reason) |
| | | reasonDialog.arguments = bundleOf("payWay" to payWay,"reason" to reason,"passenger" to passenger,"checkReason" to checkReason,"content" to content) |
| | | reasonDialog.callback = callback |
| | | reasonDialog.showAllowingStateLoss(fm,"reason") |
| | | } |
New file |
| | |
| | | package com.kuanzhai.user.dialog |
| | | |
| | | import android.os.Bundle |
| | | import android.os.CountDownTimer |
| | | import android.view.Gravity |
| | | import android.view.LayoutInflater |
| | | import android.view.View |
| | | import android.view.ViewGroup |
| | | import androidx.fragment.app.DialogFragment |
| | | import com.kuanzhai.user.R |
| | | import kotlinx.android.synthetic.main.dialog_voice_set_success.* |
| | | import org.jetbrains.anko.matchParent |
| | | import org.jetbrains.anko.wrapContent |
| | | |
| | | class VoiceSetSuccessDialog: DialogFragment() { |
| | | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? = |
| | | inflater.inflate(R.layout.dialog_voice_set_success,container,false) |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | setStyle(STYLE_NO_FRAME,R.style.FadeDialog) |
| | | } |
| | | |
| | | override fun onActivityCreated(savedInstanceState: Bundle?) { |
| | | super.onActivityCreated(savedInstanceState) |
| | | dialog?.window?.setLayout(matchParent, wrapContent) |
| | | dialog?.window?.setGravity(Gravity.CENTER) |
| | | dialog?.setCanceledOnTouchOutside(false) |
| | | } |
| | | |
| | | |
| | | |
| | | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| | | super.onViewCreated(view, savedInstanceState) |
| | | tv_msg.text = arguments?.getString("msg") |
| | | object :CountDownTimer(1500,1000){ |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | |
| | | } |
| | | |
| | | override fun onFinish() { |
| | | if (!isDetached) |
| | | dismissAllowingStateLoss() |
| | | } |
| | | }.start() |
| | | } |
| | | |
| | | } |
| | |
| | | @FormUrlEncoded |
| | | @POST(Apis.companyLimitApprove) |
| | | fun companyLimitApprove(@Field("id") id:String,@Field("status") status:Int, @Field("remark") remark:String?): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.validPermission) |
| | | fun validPermission(): Flowable<ResultData<JsonObject>> |
| | | |
| | | @POST(Apis.getBusinessReason) |
| | | fun getBusinessReason(): Flowable<ResultData<List<Reason>>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.queryBusinessCarModel) |
| | | fun queryBusinessCarModel(@Field("startLonLat")startLonLat:String,@Field("endLonLat")endLonLat:String, @Field("calType") calType :Int, |
| | | @Field("endTime") endTime :String?, @Field("startTime") startTime :String?): Flowable<ResultData<ArrayList<CarPrice>>> |
| | | |
| | | @POST(Apis.queryStaff) |
| | | fun queryStaff(): Flowable<ResultData<List<Passenger>>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.setSound) |
| | | fun setSound(@Field("soundSet")soundSet:Int): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.saveOrderBusiness) |
| | | fun saveOrderBusiness(@Field("calType") calType:Int,@Field("endAddress") endAddress:String,@Field("endLat") endLat:Double, |
| | | @Field("endLon") endLon:Double,@Field("isNotice") isNotice:Int,@Field("orderSource") orderSource:Int, |
| | | @Field("orderType") orderType:Int,@Field("payWay") payWay:Int,@Field("people") people:String, |
| | | @Field("reason") reason:String?,@Field("reasonTypeNames") reasonTypeNames:String?, |
| | | @Field("peopleNum") peopleNum:Int,@Field("placementLat") placementLat:Double,@Field("placementLon") placementLon:Double, |
| | | @Field("serverCarModelId") serverCarModelId:Int?,@Field("startLat") startLat:Double, @Field("startLon") startLon:Double, |
| | | @Field("startAddress") startAddress:String,@Field("substitute") substitute:Int,@Field("travelEndTime") travelEndTime:String?, |
| | | @Field("travelTime") travelTime:String, @Field("type") type :Int, @Field("driverId") driverId :Int?): Flowable<ResultData<JsonObject>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.approveOrderList) |
| | | fun approveOrderList(@Field("pageNum") page:Int, @Field("size") size:Int = Const.PAGE_SIZE): Flowable<ResultData<List<OrderCheckListBean>>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.approveOrderDetail) |
| | | fun approveOrderDetail(@Field("id") id:String): Flowable<ResultData<OrderCheckDetail>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.approveOrder) |
| | | fun approveOrder(@Field("id") id:String,@Field("auditStatus") auditStatus:Int,@Field("auditRemark") auditRemark:String?): Flowable<ResultData<Any>> |
| | | } |
| | |
| | | const val getCompanyLimitList = "api/user/getCompanyLimitList" |
| | | const val getMineLimitList = "api/user/getMineLimitList" |
| | | const val companyLimitApprove = "api/user/companyLimitApprove" |
| | | const val validPermission = "api/business/validPermission" |
| | | const val getBusinessReason = "api/business/getBusinessReason" |
| | | const val queryBusinessCarModel = "api/business/queryBusinessCarModel" |
| | | const val saveOrderBusiness = "api/business/saveOrderBusiness" |
| | | const val approveOrderList = "api/business/approveOrderList" |
| | | const val approveOrderDetail = "api/business/approveOrderDetail" |
| | | const val approveOrder = "api/business/approveOrder" |
| | | const val queryStaff = "api/business/queryStaff" |
| | | const val setSound = "api/user/setSound" |
| | | |
| | | } |
| | |
| | | fun companyLimitApprove(id: String,state: Int,reason: String?): Flowable<ResultData<Any>> { |
| | | return request().companyLimitApprove(id,state,reason) |
| | | } |
| | | |
| | | /** |
| | | * 公务用车权限检测 |
| | | */ |
| | | fun validPermission(): Flowable<ResultData<JsonObject>> { |
| | | return request().validPermission() |
| | | } |
| | | |
| | | /** |
| | | * 出行事由 |
| | | */ |
| | | fun getBusinessReason(): Flowable<ResultData<List<Reason>>> { |
| | | return request().getBusinessReason() |
| | | } |
| | | |
| | | /** |
| | | * 查询价格和车型 |
| | | */ |
| | | fun queryBusinessCarModel(start:String,end:String,type: Int,startTime: String?,endTime: String?): Flowable<ResultData<ArrayList<CarPrice>>> { |
| | | return request().queryBusinessCarModel(start, end, type,endTime, startTime) |
| | | } |
| | | |
| | | /** |
| | | * 查询常用乘车人 |
| | | */ |
| | | fun queryStaff(): Flowable<ResultData<List<Passenger>>> { |
| | | return request().queryStaff() |
| | | } |
| | | |
| | | /** |
| | | * 公务下单 |
| | | */ |
| | | fun saveOrderBusiness(calType:Int,endAddress:String,endLat:Double, endLon:Double,isNotice:Int,orderSource:Int, orderType:Int,payWay:Int,people:String, |
| | | reason:String?,reasonTypeNames:String?, peopleNum:Int,placementLat:Double,placementLon:Double, serverCarModelId:Int?,startLat:Double,startLon:Double, |
| | | startAddress:String,substitute:Int,travelEndTime:String?, travelTime:String, type :Int, driverId: Int?): Flowable<ResultData<JsonObject>> { |
| | | return request().saveOrderBusiness(calType, endAddress, endLat, endLon, isNotice, orderSource, orderType, payWay, people, reason, reasonTypeNames, peopleNum, placementLat, |
| | | placementLon, serverCarModelId, startLat, startLon, startAddress, substitute, travelEndTime, travelTime, type,driverId) |
| | | } |
| | | |
| | | /** |
| | | * 公务订单审核列表 |
| | | */ |
| | | fun approveOrderList(page: Int): Flowable<ResultData<List<OrderCheckListBean>>> { |
| | | return request().approveOrderList(page) |
| | | } |
| | | |
| | | /** |
| | | * 公务订单审核详情 |
| | | */ |
| | | fun approveOrderDetail(id: String): Flowable<ResultData<OrderCheckDetail>> { |
| | | return request().approveOrderDetail(id) |
| | | } |
| | | |
| | | /** |
| | | * 订单审核 |
| | | */ |
| | | fun approveOrder(id: String,state:Int,reason: String?): Flowable<ResultData<Any>> { |
| | | return request().approveOrder(id,state,reason) |
| | | } |
| | | |
| | | /** |
| | | * 设置录音 |
| | | * @param state 1开 0关 |
| | | */ |
| | | fun setSound(state:Int): Flowable<ResultData<Any>> { |
| | | return request().setSound(state) |
| | | } |
| | | } |
| | |
| | | val approveOrder: Int = 0, //审核订单权限(1=有,0=无) |
| | | val integral: String = "", |
| | | val isAuth: Int = 0, |
| | | val soundSet: String = "", //是否开启录音(1是 0否) |
| | | val companyCount: String, |
| | | val orderCount: String, |
| | | val name: String = "", |
| | | val nickName: String = "", |
| | | val phone: String = "", |
New file |
| | |
| | | package com.kuanzhai.user.network.entity |
| | | |
| | | data class OrderCheckDetail( |
| | | val auditRemark: String, |
| | | val auditStatus: Int, |
| | | val calType: Int, |
| | | val endAddress: String, |
| | | val id: Int, |
| | | val passengers: String, |
| | | val passengersPhone: String, |
| | | val payWay: Int, |
| | | val peopleItems: List<Passenger>, |
| | | val peopleNum: Int, |
| | | val reasonTypeNames: String, |
| | | val serverCardName: String, |
| | | val startAddress: String |
| | | ) |
New file |
| | |
| | | package com.kuanzhai.user.network.entity |
| | | |
| | | data class OrderCheckListBean( |
| | | val auditStatus: Int, |
| | | val id: String, |
| | | val insertTime: String, |
| | | val serverCardName: String, |
| | | val useDay: Int, |
| | | val useHour: Int, |
| | | val useTime: String |
| | | ) |
| | |
| | | val startCity: String = "", |
| | | val endCity: String = "", |
| | | var state: Int = 0, //订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中,12=取消待支付)加个15作为改派成功 |
| | | var auditStatus: Int = -1, //审核状态(-1 其他正常订单 -2取消订单 0待审核 1审核通过 2拒绝) |
| | | val auditRemark: String = "", |
| | | val time: String = "", |
| | | val travelMoney: Double = 0.0, |
| | | val roadTollMoney: Double = 0.0, |
| | |
| | | package com.kuanzhai.user.network.entity |
| | | |
| | | import android.os.Parcelable |
| | | import kotlinx.android.parcel.Parcelize |
| | | |
| | | @Parcelize |
| | | data class Passenger( |
| | | var name:String = "", |
| | | var phone:String = "" |
| | | ) |
| | | ):Parcelable |
New file |
| | |
| | | package com.kuanzhai.user.network.entity |
| | | |
| | | data class Reason( |
| | | val companyId: String, |
| | | val createTime: String, |
| | | val id: String, |
| | | val name: String |
| | | ) |
| | |
| | | import android.view.inputmethod.EditorInfo |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.view.SwipeRefreshRecyclerLayout |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.OpenCity |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.trip.adapter.OpenCityAdapter |
| | | import kotlinx.android.synthetic.main.activity_choose_city.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class ChooseCityActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_choose_city |
| | |
| | | setResult(Activity.RESULT_OK,intent.putExtra("name" , datas[position].name).putExtra("lat" , datas[position].lat).putExtra("lon" , datas[position].lon)) |
| | | finish() |
| | | }else{ |
| | | OkApplication.chooseCityName = datas[position].name |
| | | OkApplication.chooseCityCode = datas[position].content |
| | | KuanzhaiApplication.chooseCityName = datas[position].name |
| | | KuanzhaiApplication.chooseCityCode = datas[position].content |
| | | showDialog() |
| | | HttpManager.queryBusinessById(datas[position].id).request(this){_,data-> |
| | | data?.let { |
| | |
| | | |
| | | override fun initView() { |
| | | title = "切换城市" |
| | | tv_current.text = String.format("当前选择:%s",OkApplication.chooseCityName) |
| | | tv_current.text = String.format("当前选择:%s",KuanzhaiApplication.chooseCityName) |
| | | lv_city.setLayoutManager(LinearLayoutManager(this)) |
| | | lv_city.setMode(SwipeRefreshRecyclerLayout.Mode.None) |
| | | lv_city.setAdapter(adapter) |
| | |
| | | import cn.sinata.xldutils.utils.* |
| | | import cn.sinata.xldutils.visible |
| | | import com.flyco.tablayout.listener.OnTabSelectListener |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.* |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.* |
| | | import com.kuanzhai.user.network.entity.Function |
| | |
| | | import com.kuanzhai.user.utils.PlaceHolderFragment |
| | | import com.kuanzhai.user.utils.event.BaseEvent |
| | | import com.tbruyelle.rxpermissions2.RxPermissions |
| | | import kotlinx.android.synthetic.main.activity_confirm_cross_order.* |
| | | import kotlinx.android.synthetic.main.activity_main.* |
| | | import kotlinx.android.synthetic.main.drawer_mine.* |
| | | import kotlinx.android.synthetic.main.drawer_mine.tv_name |
| | | import kotlinx.android.synthetic.main.drawer_mine.tv_score |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivity |
| | |
| | | var phoneEmergency = "" //报警电话 |
| | | var isTripping = false //是否有进行中的订单,如果没有 拖动地图才查询附近司机数量 |
| | | |
| | | private var checkVoiceRecord = true //检查是否开起行程录音,1.首次进入检查2.切换账号检查 |
| | | |
| | | private val menus = arrayListOf<NewFunBean>() |
| | | private val adapter = MenuAdapter(menus) |
| | | |
| | |
| | | if (iv_mine.isSelected){ |
| | | if (fragments[mViewPager.currentItem] is MapTripFragment){ |
| | | taxiFragment.back() |
| | | }else if (fragments[mViewPager.currentItem] is OfficialFragment){ |
| | | officialFragment.back() |
| | | }else{ |
| | | logisticsFragment.back(false) |
| | | } |
| | |
| | | startActivity<OrderActivity>() |
| | | } |
| | | tv_setting.setOnClickListener { |
| | | startActivityForResult<SettingActivity>(500,"phone" to (userInfo?.phone?:"")) |
| | | startActivityForResult<SettingActivity>(500,"phone" to (userInfo?.phone?:""),"voice" to (userInfo?.soundSet?:"")) |
| | | } |
| | | tv_city.setOnClickListener { |
| | | startActivityForResult<ChooseCityActivity>(501) |
| | |
| | | } |
| | | tv_company.setOnClickListener { |
| | | HttpManager.queryCompany().request(this){_,data-> |
| | | startActivity<MyCompanyActivity>("data" to data,"orderPermission" to (userInfo?.approveOrder == 1)) |
| | | startActivity<MyCompanyActivity>("data" to data) |
| | | } |
| | | } |
| | | tv_order_check.setOnClickListener { |
| | | startActivity<OrderCheckListActivity>() |
| | | } |
| | | tv_safe.setOnClickListener { |
| | | userInfo?.let { |
| | |
| | | } |
| | | tv_join.setOnClickListener { |
| | | if (businessInfo?.state == "2"){//冻结 |
| | | myToast("您的商家账号已冻结,请联系平台${OkApplication.phoneService}") |
| | | myToast("您的商家账号已冻结,请联系平台${KuanzhaiApplication.phoneService}") |
| | | return@setOnClickListener |
| | | } |
| | | if (businessInfo?.auditStatus == "2") //已通过 |
| | |
| | | private val fragments = arrayListOf<Fragment>() |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | tv_city.text = OkApplication.chooseCityName |
| | | tv_city.text = KuanzhaiApplication.chooseCityName |
| | | if (isOpen&&func.isNotEmpty()){ |
| | | getPhone() |
| | | getAgreement() |
| | |
| | | Log.e(Const.Tag,"当前模块为:公务出行") |
| | | mViewPager.currentItem = fragments.indexOf(officialFragment) |
| | | taxiFragment.checkBack() |
| | | officialFragment.checkPermission() |
| | | } |
| | | Const.OrderType.TYPE_CALL-> { |
| | | Log.e(Const.Tag,"当前模块为:电召") |
| | |
| | | } |
| | | |
| | | private fun getPhone(){ |
| | | HttpManager.getPhone(OkApplication.chooseCityCode).request(this,false){_,data-> |
| | | HttpManager.getPhone(KuanzhaiApplication.chooseCityCode).request(this,false){ _, data-> |
| | | data?.let { |
| | | it.forEach { |
| | | if (it.type == 1) |
| | | phoneEmergency = it.phone |
| | | else if (it.type == 2) |
| | | OkApplication.phoneService = it.phone |
| | | KuanzhaiApplication.phoneService = it.phone |
| | | } |
| | | } |
| | | } |
| | |
| | | HttpManager.queryUserInfo().request(this,false){_,data-> |
| | | userInfo = data |
| | | data?.run { |
| | | OkApplication.avatar = avatar |
| | | KuanzhaiApplication.avatar = avatar |
| | | iv_header_home.setImageURI(avatar) |
| | | tv_name.text = nickName |
| | | tv_company.text = "企业认证($companyCount)" |
| | | tv_order_check.visibility = if (approveOrder == 1) View.VISIBLE else View.GONE |
| | | tv_order_check.text = "订单审核(${orderCount})" |
| | | tv_score.text = String.format("当前积分%s",if (integral.isEmpty()) "0" else integral) |
| | | OkApplication.emergency = emergencyContactNumber |
| | | OkApplication.phone = phone |
| | | KuanzhaiApplication.emergency = emergencyContactNumber |
| | | KuanzhaiApplication.phone = phone |
| | | if (checkVoiceRecord&&userInfo?.soundSet == "0"){ |
| | | HttpManager.getH5(24).request(this@MainActivity,success = {_,data-> |
| | | data?.apply { |
| | | checkVoiceRecord = false |
| | | val h5Dialog = H5Dialog() |
| | | h5Dialog.arguments = bundleOf("ok" to "去开启","title" to "“宽窄优行”需要使用车内录音权限","content" to optString("content")) |
| | | h5Dialog.setCallback(object : StringCallback { |
| | | override fun onRlt(rlt: String) { |
| | | startActivity<VoiceRecordActivity>("voice" to false) |
| | | } |
| | | }) |
| | | h5Dialog.show(supportFragmentManager,"h5") |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | private fun updateTip(orderType:Int) { |
| | | if (orderType > Const.OrderType.TYPE_TAXI) |
| | | if (orderType > Const.OrderType.TYPE_TAXI&&orderType!=Const.OrderType.TYPE_OFFICIAL) |
| | | tv_tip.gone() |
| | | else |
| | | tv_tip.visible() |
| | |
| | | } |
| | | |
| | | private fun getAds(){ |
| | | HttpManager.getAds(1,OkApplication.chooseCityCode).request(this,false){_,data-> |
| | | HttpManager.getAds(1,KuanzhaiApplication.chooseCityCode).request(this,false){ _, data-> |
| | | data?.let { |
| | | if (it.isNotEmpty()){ |
| | | val bannerDialog = BannerDialog() |
| | |
| | | bannerDialog.show(supportFragmentManager,"banner") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun getOfficialPermission(){ |
| | | HttpManager.validPermission().request(this,false){_,data-> |
| | | KuanzhaiApplication.officialPermission = data?.optBoolean("permission",false)?:false |
| | | } |
| | | } |
| | | |
| | |
| | | * 恢复未登录状态 |
| | | */ |
| | | fun resetLogin(){ |
| | | checkVoiceRecord = true |
| | | drawer_main.closeDrawer(GravityCompat.START) |
| | | isTripping = false |
| | | if (fragments.contains(taxiFragment)) |
| | |
| | | queryCoupon() |
| | | if (menus.isEmpty()) |
| | | getNewFun() |
| | | getOfficialPermission() |
| | | } |
| | | } |
| | | |
| | |
| | | drawer_main.closeDrawer(GravityCompat.START) |
| | | else if (iv_mine.isSelected&&fragments[mViewPager.currentItem] is LogisticsFragment) |
| | | logisticsFragment.back(false) |
| | | else if (iv_mine.isSelected&&fragments[mViewPager.currentItem] is OfficialFragment) |
| | | officialFragment.back() |
| | | else if(taxiFragment.checkBack()) |
| | | super.onBackPressed() |
| | | } |
| | |
| | | import com.amap.api.location.AMapLocationClient |
| | | import com.amap.api.location.AMapLocationClientOption |
| | | import com.kuanzhai.user.BuildConfig |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.TipDialog |
| | | import com.kuanzhai.user.dialog.UserRuleDialog |
| | |
| | | } |
| | | |
| | | private val app by lazy { |
| | | application as OkApplication |
| | | application as KuanzhaiApplication |
| | | } |
| | | |
| | | private fun initApplication() { |
| | |
| | | aMapLocationClient.setLocationOption(option) |
| | | aMapLocationClient.setLocationListener { |
| | | if (it.errorCode == 0) { |
| | | OkApplication.cityCode = it.adCode |
| | | OkApplication.cityName = it.city |
| | | OkApplication.lat = it.latitude |
| | | OkApplication.lon = it.longitude |
| | | KuanzhaiApplication.cityCode = it.adCode |
| | | KuanzhaiApplication.cityName = it.city |
| | | KuanzhaiApplication.lat = it.latitude |
| | | KuanzhaiApplication.lon = it.longitude |
| | | HttpManager.isOpenCity(it.adCode).request(this, success = { _, data -> |
| | | data?.run { |
| | | if (optInt("open") == 1) {//当前城市开通 |
| | | OkApplication.chooseCityName = it.city |
| | | OkApplication.chooseCityCode = it.adCode |
| | | KuanzhaiApplication.chooseCityName = it.city |
| | | KuanzhaiApplication.chooseCityCode = it.adCode |
| | | HttpManager.queryBusiness(it.city, it.province, it.district) |
| | | .request(this@SplashActivity, success = { _, data -> |
| | | Log.e( |
| | |
| | | HttpManager.isOpenCity(defaultCityCode).request(this, success = { _, data -> |
| | | data?.run { |
| | | if (optInt("open") == 1) {//当前城市开通 |
| | | OkApplication.chooseCityName = defaultCity |
| | | OkApplication.chooseCityCode = defaultCityCode |
| | | KuanzhaiApplication.chooseCityName = defaultCity |
| | | KuanzhaiApplication.chooseCityCode = defaultCityCode |
| | | HttpManager.queryBusiness(defaultCity, defaultProvince, defaultDistrict) |
| | | .request(this@SplashActivity, success = { _, data -> |
| | | Log.e( |
| | |
| | | package com.kuanzhai.user.ui.charter |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import androidx.core.os.bundleOf |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.callPhone |
| | | import cn.sinata.xldutils.clickDelay |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.optString |
| | | import com.kuanzhai.user.OkApplication |
| | | import cn.sinata.xldutils.utils.parserTime |
| | | import com.google.gson.Gson |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.OfficialCharterTimeDialog |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.Passenger |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.network.requestByF |
| | | import com.kuanzhai.user.ui.H5Activity |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import com.kuanzhai.user.ui.official.adapter.CharterPassengerAdapter |
| | | import com.kuanzhai.user.ui.trip.ChoosePositionActivity |
| | | import kotlinx.android.synthetic.main.fragment_charter.* |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.startActivityForResult |
| | | |
| | | class CharterActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.fragment_charter |
| | | |
| | | private var start = "" |
| | | private var startLat = 0.0 |
| | | private var startLon = 0.0 |
| | | private var end = "" |
| | | private var endLat = 0.0 |
| | | private var endLon = 0.0 |
| | | |
| | | private val passenger = arrayListOf<Passenger>() |
| | | private val adapter by lazy { CharterPassengerAdapter(passenger,tv_count) } |
| | | |
| | | override fun initClick() { |
| | | tv_start_time.clickDelay { |
| | | val chooseReserveTimeDialog = OfficialCharterTimeDialog() |
| | | chooseReserveTimeDialog.setCallback(object : OfficialCharterTimeDialog.Callback { |
| | | override fun onOk(formatS: String) { |
| | | tv_start_time.text = formatS |
| | | tv_end_time.text = "" |
| | | tv_duration.text = "0天" |
| | | } |
| | | }) |
| | | chooseReserveTimeDialog.show(supportFragmentManager, "time") |
| | | } |
| | | tv_end_time.clickDelay { |
| | | if (tv_start_time.text.isEmpty()){ |
| | | myToast("请选择开始时间") |
| | | return@clickDelay |
| | | } |
| | | val chooseReserveTimeDialog = OfficialCharterTimeDialog() |
| | | chooseReserveTimeDialog.arguments = bundleOf("startTime" to tv_start_time.text.toString()) |
| | | chooseReserveTimeDialog.setCallback(object : OfficialCharterTimeDialog.Callback { |
| | | override fun onOk(formatS: String) { |
| | | tv_end_time.text = formatS |
| | | tv_duration.text = "%.1f天".format((formatS.parserTime("yyyy-MM-dd HH:mm") - tv_start_time.text.toString().parserTime("yyyy-MM-dd HH:mm")).toDouble()/(24L*60*60*1000)) |
| | | } |
| | | }) |
| | | chooseReserveTimeDialog.show(supportFragmentManager, "time") |
| | | } |
| | | tv_start.setOnClickListener { |
| | | startActivityForResult<ChoosePositionActivity>(1) |
| | | } |
| | | tv_end.setOnClickListener { |
| | | startActivityForResult<ChoosePositionActivity>(2,"isStart" to false) |
| | | } |
| | | tv_add.setOnClickListener { |
| | | if (passenger.size == 4) |
| | | myToast("最多可添加4人") |
| | | else{ |
| | | passenger.add(Passenger()) |
| | | tv_count.text = "${passenger.size}" |
| | | adapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | tv_action.setOnClickListener { |
| | | val startTime = tv_start_time.text.toString() |
| | | if (startTime.isEmpty()){ |
| | | myToast("请选择用车开始时间") |
| | | return@setOnClickListener |
| | | } |
| | | val endTime = tv_end_time.text.toString() |
| | | if (endTime.isEmpty()){ |
| | | myToast("请选择用车结束时间") |
| | | return@setOnClickListener |
| | | } |
| | | if (startLat == 0.0){ |
| | | myToast("请选择出发地") |
| | | return@setOnClickListener |
| | | } |
| | | if (endLat == 0.0){ |
| | | myToast("请选择目的地") |
| | | return@setOnClickListener |
| | | } |
| | | if (passenger.filter { it.name.isEmpty() }.isNotEmpty()){ |
| | | myToast("乘车人姓名不能为空") |
| | | return@setOnClickListener |
| | | } |
| | | val rst = Intent() |
| | | rst.putExtra("startTime",startTime).putExtra("endTime",endTime) |
| | | .putExtra("startName",start).putExtra("startLat",startLat).putExtra("startLon",startLon) |
| | | .putExtra("endName",end).putExtra("endLat",endLat).putExtra("endLon",endLon) |
| | | .putExtra("isRemind",sw_remind.isChecked).putExtra("passenger",passenger) |
| | | setResult(Activity.RESULT_OK,rst) |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | title = "包车" |
| | | |
| | | val startTime = intent.getStringExtra("startTime") |
| | | tv_start_time.text = startTime |
| | | val endTime = intent.getStringExtra("endTime") |
| | | tv_end_time.text = endTime |
| | | if (startTime.isNotEmpty()&&endTime.isNotEmpty()) |
| | | tv_duration.text = "%.1f天".format((endTime.parserTime("yyyy-MM-dd HH:mm") - startTime.parserTime("yyyy-MM-dd HH:mm")).toDouble()/(24L*60*60*1000)) |
| | | |
| | | start = intent.getStringExtra("start") |
| | | startLat = intent.getDoubleExtra("startLat",0.0) |
| | | startLon = intent.getDoubleExtra("startLon",0.0) |
| | | tv_start.text = start |
| | | |
| | | end = intent.getStringExtra("end") |
| | | endLat = intent.getDoubleExtra("endLat",0.0) |
| | | endLon = intent.getDoubleExtra("endLon",0.0) |
| | | tv_end.text = end |
| | | |
| | | sw_remind.isChecked = intent.getBooleanExtra("isRemind",false) |
| | | passenger.addAll(intent.getParcelableArrayListExtra("passenger")) |
| | | |
| | | rv_passenger.layoutManager = LinearLayoutManager(this) |
| | | rv_passenger.adapter = adapter |
| | | getPhone() |
| | | getRule() |
| | | } |
| | | |
| | | private fun getPhone(){ |
| | | HttpManager.queryPhones(OkApplication.chooseCityCode).request(this){ _, data-> |
| | | HttpManager.queryPhones(KuanzhaiApplication.chooseCityCode).request(this){ _, data-> |
| | | data?.filter { it.type == 3 }?.forEach { |
| | | tv_phone.text = "包车调度电话:%s".format(it.phone) |
| | | tv_phone.onClick {_-> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == Activity.RESULT_OK&&data!=null){ |
| | | if (requestCode == 1){ |
| | | startLat = data.getDoubleExtra("lat", 0.0) |
| | | startLon = data.getDoubleExtra("lon", 0.0) |
| | | start = data.getStringExtra("name") ?: "" |
| | | tv_start.text = start |
| | | }else{ |
| | | endLat = data.getDoubleExtra("lat", 0.0) |
| | | endLon = data.getDoubleExtra("lon", 0.0) |
| | | end = data.getStringExtra("name") ?: "" |
| | | tv_end.text = end |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import cn.sinata.xldutils.utils.isValidPhone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.optString |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.AlertDialog |
| | | import com.kuanzhai.user.dialog.CharterReserveTimeDialog |
| | | import com.kuanzhai.user.dialog.SingleWheelDialog |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.requestByF |
| | | import com.kuanzhai.user.ui.H5Activity |
| | | import com.kuanzhai.user.ui.MainActivity |
| | | import com.kuanzhai.user.utils.Const |
| | | import com.kuanzhai.user.utils.IntegerInputFilter |
| | | import kotlinx.android.synthetic.main.fragment_charter.* |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.support.v4.startActivityForResult |
| | | |
| | | class CharterFragment:BaseFragment() { |
| | | override fun contentViewId() = R.layout.fragment_charter |
| | |
| | | |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | et_count.filters = arrayOf(IntegerInputFilter(999)) |
| | | |
| | | getPhone() |
| | | tv_rule.onClick { getRule() } |
| | | |
| | | tv_time.onClick { |
| | | val charterReserveTimeDialog = CharterReserveTimeDialog() |
| | | charterReserveTimeDialog.setCallback(object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | tv_time.text = rlt |
| | | } |
| | | }) |
| | | charterReserveTimeDialog.show(fragmentManager!!,"time") |
| | | } |
| | | |
| | | tv_duration.onClick { |
| | | if (!singleWheelDialog.isAdded) |
| | | singleWheelDialog.show(fragmentManager!!,"count") |
| | | } |
| | | tv_type.onClick { |
| | | startActivityForResult<CharterTypeActivity>(Const.RequestCode.CHAPTER_TYPE) |
| | | } |
| | | tv_usage.onClick { |
| | | startActivityForResult<ChooseUsageActivity>(Const.RequestCode.CHAPTER_USAGE, |
| | | "data" to arrayListOf("旅游","商务","会议")) |
| | | } |
| | | |
| | | tv_action.onClick { |
| | | if (mainActivity.checkLogin()){ |
| | | val time = tv_time.text.toString() |
| | | if (time.isEmpty()){ |
| | | myToast("请选择用车时间") |
| | | return@onClick |
| | | } |
| | | |
| | | if (day == 0){ |
| | | myToast("请选择用车时长") |
| | | return@onClick |
| | |
| | | myToast("请选择车型") |
| | | return@onClick |
| | | } |
| | | val usage = tv_usage.text.toString() |
| | | if (usage.isEmpty()){ |
| | | myToast("请选择车辆用途") |
| | | return@onClick |
| | | } |
| | | val countS = et_count.text.toString() |
| | | if(countS.isEmpty()){ |
| | | myToast("请填写乘车人数") |
| | | return@onClick |
| | | } |
| | | val name = et_name.text.toString() |
| | | if (name.isEmpty()){ |
| | | myToast("请填写联系人姓名") |
| | | return@onClick |
| | | } |
| | | val phone = et_phone.text.toString() |
| | | if (!phone.isValidPhone()){ |
| | | myToast("请填写正确的联系电话") |
| | | return@onClick |
| | | } |
| | | showDialog() |
| | | tv_action.isEnabled = false |
| | | HttpManager.orderCharteredCar(day,"$time 00:00:00","${OkApplication.lon},${OkApplication.lat}",name, |
| | | phone,usage,countS.toInt(),carTypeId).requestByF(this@CharterFragment,success = {_,_-> |
| | | successDialog.show(fragmentManager!!,"suc") |
| | | tv_action.isEnabled = true |
| | | }){_,_-> tv_action.isEnabled = true} |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun getPhone(){ |
| | | HttpManager.queryPhones(OkApplication.chooseCityCode).requestByF(this){_,data-> |
| | | HttpManager.queryPhones(KuanzhaiApplication.chooseCityCode).requestByF(this){ _, data-> |
| | | data?.filter { it.type == 3 }?.forEach { |
| | | tv_phone.text = "旅游包车调度电话:%s".format(it.phone) |
| | | tv_phone.onClick {_-> |
| | |
| | | } |
| | | |
| | | private fun clearData(){ |
| | | tv_time.text = "" |
| | | tv_duration.text = "" |
| | | tv_type.text = "" |
| | | tv_usage.text = "" |
| | | et_count.setText("") |
| | | et_name.setText("") |
| | | et_phone.setText("") |
| | | |
| | | tv_price.text = "" |
| | | day = 0 |
| | | carTypeId = 0 |
| | | et_phone.clearFocus() |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == Activity.RESULT_OK&&data!=null){ |
| | | if (requestCode == Const.RequestCode.CHAPTER_TYPE){ |
| | | tv_type.text = data.getStringExtra("name") |
| | | carTypeId = data.getIntExtra("id",0) |
| | | min = data.getIntExtra("min",0) |
| | | max = data.getIntExtra("max",0) |
| | | calculate() |
| | | }else if (requestCode == Const.RequestCode.CHAPTER_USAGE){ |
| | | tv_usage.text = data.getStringExtra("data") |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.os.Bundle |
| | | import android.os.Looper |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.ioScheduler |
| | | import cn.sinata.xldutils.rxutils.ResultException |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.amap.api.maps.AMap |
| | | import com.amap.api.maps.CameraUpdateFactory |
| | |
| | | import com.amap.api.services.geocoder.* |
| | | import com.amap.api.services.help.Tip |
| | | import com.amap.api.services.poisearch.PoiResult |
| | | import com.amap.api.services.poisearch.PoiSearch |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.Anchor |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import com.kuanzhai.user.ui.trip.ChoosePositionActivity |
| | | import com.kuanzhai.user.ui.trip.adapter.PositionAdapter |
| | | import io.reactivex.Flowable |
| | | import io.reactivex.subscribers.DisposableSubscriber |
| | | import kotlinx.android.synthetic.main.activity_choose_map_position.* |
| | | import kotlinx.android.synthetic.main.activity_choose_map_position.iv_center |
| | | import kotlinx.android.synthetic.main.activity_choose_map_position.mMapView |
| | | import kotlinx.android.synthetic.main.fragment_map_trip.* |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivityForResult |
| | | |
| | |
| | | if (data.isNotEmpty()) |
| | | data[0].apply { |
| | | if (type == 1){ //行政区域 |
| | | if (districtCode == OkApplication.cityCode) |
| | | aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(OkApplication.lat, OkApplication.lon),15f)) |
| | | if (districtCode == KuanzhaiApplication.cityCode) |
| | | aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(KuanzhaiApplication.lat, KuanzhaiApplication.lon),15f)) |
| | | else |
| | | getCityLatlng(province+city+district,cityCode) |
| | | }else{ //电子围栏,移动到第一个坐标 |
| | |
| | | import android.view.View |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.utils.* |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | |
| | | tv_action.isEnabled = true |
| | | data?.apply { |
| | | val h5Dialog = H5Dialog() |
| | | h5Dialog.arguments = bundleOf("title" to "《${if (type == Const.OrderType.TYPE_CROSS_CITY) "机场专线" else "景区直通车"}乘车须知》","content" to optString("content")) |
| | | h5Dialog.arguments = bundleOf("title" to "《${if (type == Const.OrderType.TYPE_CROSS_CITY) "跨城出行" else if (type == Const.OrderType.TYPE_AIRBUS) "机场专线" else "景区直通车"}乘车须知》","content" to optString("content")) |
| | | h5Dialog.setCallback(object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | makeOrder() |
| | |
| | | endLat, |
| | | endLon, |
| | | tv_time.text.toString().substring(0,16) + ":00", |
| | | OkApplication.lat, |
| | | OkApplication.lon, |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon, |
| | | tv_start.text.toString(), |
| | | tv_end.text.toString(), |
| | | OkApplication.address, |
| | | KuanzhaiApplication.address, |
| | | remarks.filter { it.isChecked }.joinToString(",") { it.text }, |
| | | passengerCount, |
| | | tv_seat.text.toString(), |
| | |
| | | } |
| | | } |
| | | activity?.registerReceiver(receiver, IntentFilter("crossOrderSuccess")) |
| | | iv_img.setImageResource(if (type == Const.OrderType.TYPE_THROUGH_BUS) R.mipmap.banner_cross else R.mipmap.banner_air) |
| | | iv_img.setImageResource(if (type == Const.OrderType.TYPE_AIRBUS) R.mipmap.banner_air else R.mipmap.banner_cross) |
| | | } |
| | | |
| | | private fun initClick() { |
| | |
| | | import cn.sinata.xldutils.visible |
| | | import com.haibin.calendarview.Calendar |
| | | import com.haibin.calendarview.CalendarView |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.Line |
| | |
| | | tipDialog.arguments = bundleOf("msg" to "是否需要为您调度车辆?","ok" to "是") |
| | | tipDialog.setCallback(object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | callPhone(OkApplication.phoneService) |
| | | callPhone(KuanzhaiApplication.phoneService) |
| | | } |
| | | |
| | | override fun onCancel() { |
| | |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.optInt |
| | | import cn.sinata.xldutils.visible |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.CarPrice |
| | |
| | | return@onClick |
| | | } |
| | | tv_action.isEnabled = false |
| | | HttpManager.saveOrderFerry(endName,endLat,endLon,1,OkApplication.lat,OkApplication.lon,startName, |
| | | HttpManager.saveOrderFerry(endName,endLat,endLon,1,KuanzhaiApplication.lat,KuanzhaiApplication.lon,startName, |
| | | startLat,startLon,time,ids,order.orderId,if (isStart) 1 else 2) |
| | | .request(this@ShuttleBusActivity,success = {_,data-> |
| | | myToast("下单成功") |
| | |
| | | import android.view.View |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.utils.* |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | |
| | | endLat, |
| | | endLon, |
| | | tv_shift.text.toString().substring(0,16) + ":00", |
| | | OkApplication.lat, |
| | | OkApplication.lon, |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon, |
| | | tv_start.text.toString(), |
| | | tv_end.text.toString(), |
| | | OkApplication.address, |
| | | KuanzhaiApplication.address, |
| | | remarks.filter { it.isChecked }.joinToString(",") { it.text }, |
| | | passengerCount, |
| | | tv_seat.text.toString(), |
| | |
| | | import cn.sinata.xldutils.visible |
| | | import com.flyco.tablayout.listener.CustomTabEntity |
| | | import com.flyco.tablayout.listener.OnTabSelectListener |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.request |
| | |
| | | } |
| | | showDialog("登录中...",false) |
| | | tv_action.isEnabled = false |
| | | HttpManager.codeLogin(phone,code,OkApplication.chooseCityCode, ip).request(this,success = { _, data-> |
| | | HttpManager.codeLogin(phone,code,KuanzhaiApplication.chooseCityCode, ip).request(this,success = { _, data-> |
| | | data?.let { |
| | | SPUtils.instance().put(Const.User.APP_ID,it.optString("appid")) |
| | | .put(Const.User.TOKEN,it.optString("token")) |
| | |
| | | |
| | | override fun onComplete(p0: SHARE_MEDIA?, p1: Int, p2: MutableMap<String, String>?) { |
| | | showDialog() |
| | | HttpManager.wxLogin(p2?.get("openid"),OkApplication.chooseCityCode,p2?.get("unionid"),p2?.get("iconurl"), |
| | | HttpManager.wxLogin(p2?.get("openid"),KuanzhaiApplication.chooseCityCode,p2?.get("unionid"),p2?.get("iconurl"), |
| | | p2?.get("name"),if (p2?.get("gender") == "男") 1 else 2).request(this){_,data-> |
| | | data?.let { |
| | | SPUtils.instance().put(Const.User.APP_ID, it.optString("appid")) |
| | |
| | | import com.amap.api.services.poisearch.PoiResult |
| | | import com.amap.api.services.poisearch.PoiSearch |
| | | import com.autonavi.amap.mapcore.Inner_3dMap_location |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.* |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | |
| | | aMap.animateCamera( |
| | | CameraUpdateFactory.newLatLngZoom( |
| | | LatLng( |
| | | OkApplication.lat, |
| | | OkApplication.lon |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon |
| | | ), DEFAULT_SCALE_LEVEL |
| | | ) |
| | | ) |
| | |
| | | aMap.setOnMyLocationChangeListener { |
| | | it as Inner_3dMap_location |
| | | Log.e(Const.Tag, "物流:lat:" + it.latitude + ",lon:" + it.longitude) |
| | | OkApplication.lat = it.latitude |
| | | OkApplication.lon = it.longitude |
| | | OkApplication.address = it.address |
| | | OkApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | KuanzhaiApplication.lat = it.latitude |
| | | KuanzhaiApplication.lon = it.longitude |
| | | KuanzhaiApplication.address = it.address |
| | | KuanzhaiApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | if (locCount < 1) { |
| | | if (mainActivity.lat != 0.0) |
| | | aMap.animateCamera( |
| | |
| | | goodsNum, |
| | | goodsType, |
| | | "$receiveRegion${receiveAddress}", |
| | | OkApplication.lat, |
| | | OkApplication.lon, |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon, |
| | | receiveName, |
| | | receivePhone, |
| | | remark, |
| | |
| | | import cn.sinata.xldutils.clickDelay |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.view.SwipeRefreshRecyclerLayout |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.CommentDialog |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | |
| | | getData() |
| | | } |
| | | }) |
| | | iv_avatar.setImageURI(OkApplication.avatar) |
| | | iv_avatar.setImageURI(KuanzhaiApplication.avatar) |
| | | tv_comment.clickDelay { |
| | | val commentDialog = CommentDialog() |
| | | commentDialog.arguments = bundleOf("id" to id,"type" to type) |
| | |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.view.SwipeRefreshRecyclerLayout |
| | | import cn.sinata.xldutils.visible |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.interfaces.OnDelCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | |
| | | } |
| | | }) |
| | | swipeRefreshLayout.isRefreshing = true |
| | | tv_empty.text = "您还没有优惠券信息\n您可以和平台联系,建立合作哦~\n平台电话:${OkApplication.phoneService}" |
| | | tv_empty.text = "您还没有优惠券信息\n您可以和平台联系,建立合作哦~\n平台电话:${KuanzhaiApplication.phoneService}" |
| | | getData() |
| | | } |
| | | |
| | |
| | | override fun setContentView() = R.layout.activity_order |
| | | |
| | | private val titles = arrayOf( |
| | | "快车/专车", "出租车" |
| | | ,"机场专线" |
| | | ,"景区直通车" |
| | | "快车/专车" |
| | | ,"公务出行" |
| | | , "出租车" |
| | | ,"跨城出行" |
| | | ,"景区直通车" |
| | | ,"机场专线" |
| | | ) |
| | | private val fragments = arrayListOf<Fragment>() |
| | | override fun initClick() { |
| | |
| | | override fun initView() { |
| | | title = "我的行程" |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_SPECIAL)) |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_OFFICIAL)) |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_TAXI)) |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_CROSS)) |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_THROUGH_BUS)) |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_OFFICIAL)) |
| | | fragments.add(TripOrderFragment.newInstance(TripOrderFragment.TYPE_AIR)) |
| | | tab_type.setViewPager(view_pager,titles,this,fragments) |
| | | view_pager.offscreenPageLimit = fragments.size |
| | | view_pager.currentItem = intent.getIntExtra("type",1)-1 |
| | | |
| | | view_pager.currentItem = arrayListOf(TripOrderFragment.TYPE_SPECIAL,TripOrderFragment.TYPE_OFFICIAL,TripOrderFragment.TYPE_TAXI,TripOrderFragment.TYPE_CROSS,TripOrderFragment.TYPE_THROUGH_BUS,TripOrderFragment.TYPE_AIR).indexOf(intent.getIntExtra("type",1)) |
| | | PayUtil.addPayListener(this) |
| | | PayUtil.initWeChatPay(this, Const.WX_APP_ID) |
| | | } |
New file |
| | |
| | | package com.kuanzhai.user.ui.mine |
| | | |
| | | import android.app.Activity |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import cn.sinata.xldutils.clickDelay |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.visible |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.RefuseDialog |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_order_check_detail.* |
| | | |
| | | class OrderCheckDetailActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_order_check_detail |
| | | |
| | | private val id by lazy { intent.getStringExtra("id") } |
| | | |
| | | override fun initClick() { |
| | | tv_refuse.clickDelay { |
| | | val reason = et_content.text.toString() |
| | | if (reason.isEmpty()){ |
| | | myToast("请输入拒绝原因") |
| | | }else |
| | | HttpManager.approveOrder(id,2,reason).request(this) { _, _ -> |
| | | myToast("操作成功") |
| | | setResult(Activity.RESULT_OK) |
| | | finish() |
| | | } |
| | | } |
| | | tv_action.clickDelay { |
| | | HttpManager.approveOrder(id,1,null).request(this) { _, _ -> |
| | | myToast("操作成功") |
| | | setResult(Activity.RESULT_OK) |
| | | finish() |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | et_content.addTextChangedListener(object :TextWatcher{ |
| | | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
| | | |
| | | } |
| | | |
| | | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
| | | } |
| | | |
| | | override fun afterTextChanged(s: Editable?) { |
| | | tv_limit.text = "${s?.length?:0}/50" |
| | | } |
| | | }) |
| | | showDialog() |
| | | getDetail() |
| | | } |
| | | |
| | | private fun getDetail(){ |
| | | HttpManager.approveOrderDetail(id).request(this){_,data-> |
| | | data?.apply { |
| | | tv_start.text = startAddress |
| | | tv_end.text = endAddress |
| | | tv_pay_way.text = if (calType == 1) "单程计费" else "包车计费" |
| | | tv_passenger.text = "${peopleNum}\n${peopleItems.filter { it.name.isNotEmpty() }.joinToString ("\n"){ "${it.name} ${it.phone}" }}" |
| | | tv_reason.text = reasonTypeNames |
| | | tv_pay_type.text = if (payWay == 1) "自费" else "企业支付" |
| | | tv_car.text = serverCardName |
| | | when (auditStatus){ |
| | | 1->{ |
| | | et_content.isEnabled = false |
| | | tv_refuse.gone() |
| | | tv_action.gone() |
| | | tv_result.visible() |
| | | tv_result.text = "审核通过" |
| | | } |
| | | 2->{ |
| | | gp_refuse.visible() |
| | | et_content.isEnabled = false |
| | | tv_refuse.gone() |
| | | tv_action.gone() |
| | | tv_result.visible() |
| | | tv_result.text = "审核拒绝" |
| | | et_content.setText(auditRemark) |
| | | } |
| | | else->{ |
| | | gp_refuse.visible() |
| | | tv_refuse.visible() |
| | | tv_action.visible() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.kuanzhai.user.ui.mine |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.view.SwipeRefreshRecyclerLayout |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.OrderCheckListBean |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import com.kuanzhai.user.ui.mine.adapter.OrderCheckAdapter |
| | | import org.jetbrains.anko.find |
| | | import org.jetbrains.anko.startActivityForResult |
| | | |
| | | class OrderCheckListActivity:TransparentStatusBarActivity(),SwipeRefreshRecyclerLayout.OnRefreshListener { |
| | | override fun setContentView() = R.layout.base_recyclerview_layout |
| | | |
| | | private val rvList by lazy { find<SwipeRefreshRecyclerLayout>(R.id.swipeRefreshLayout) } |
| | | private var page = 1 |
| | | private val list = arrayListOf<OrderCheckListBean>() |
| | | private val adapter = OrderCheckAdapter(list) |
| | | |
| | | override fun initClick() { |
| | | adapter.setOnItemClickListener { view, position -> |
| | | startActivityForResult<OrderCheckDetailActivity>(1,"id" to list[position].id) |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | rvList.setLayoutManager(LinearLayoutManager(this)) |
| | | rvList.setMode(SwipeRefreshRecyclerLayout.Mode.Both) |
| | | rvList.setAdapter(adapter) |
| | | rvList.setOnRefreshListener(this) |
| | | rvList.isRefreshing = true |
| | | onRefresh() |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.approveOrderList(page).request(this,success = {_,data-> |
| | | rvList.isRefreshing = false |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | }){_,_-> |
| | | rvList.isRefreshing = false |
| | | } |
| | | } |
| | | |
| | | override fun onRefresh() { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | |
| | | override fun onLoadMore() { |
| | | page++ |
| | | getData() |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == Activity.RESULT_OK) |
| | | onRefresh() |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.sinata.xldutils.callPhone |
| | | import cn.sinata.xldutils.utils.optString |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.request |
| | |
| | | } |
| | | |
| | | private fun getData() { |
| | | HttpManager.queryCustomerPhone(OkApplication.chooseCityCode).request(this){_,data-> |
| | | HttpManager.queryCustomerPhone(KuanzhaiApplication.chooseCityCode).request(this){ _, data-> |
| | | data?.let { |
| | | tv_platform.text = it.optString("platform") |
| | | tv_company.text = it.optString("company") |
| | |
| | | override fun setContentView() = R.layout.activity_setting |
| | | |
| | | private lateinit var phone:String |
| | | private val voice by lazy { intent.getStringExtra("voice") } |
| | | |
| | | override fun initClick() { |
| | | tv_account.setOnClickListener { |
| | | startActivityForResult<AccountSafeActivity>(1,"phone" to phone) |
| | | } |
| | | tv_voice.setOnClickListener { |
| | | startActivityForResult<VoiceRecordActivity>(2,"voice" to (voice == "1")) |
| | | } |
| | | tv_guide.setOnClickListener { |
| | | HttpManager.getH5(3).request(this){ _, data-> |
| | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == Activity.RESULT_OK){ |
| | | SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).remove(Const.User.NO_PHONE).apply() |
| | | val intent = Intent() |
| | | intent.putExtra("toLogin",true) |
| | | setResult(Activity.RESULT_OK, intent) |
| | | if (requestCode == 1){ |
| | | SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).remove(Const.User.NO_PHONE).apply() |
| | | val intent = Intent() |
| | | intent.putExtra("toLogin",true) |
| | | setResult(Activity.RESULT_OK, intent) |
| | | } |
| | | finish() |
| | | } |
| | | } |
| | |
| | | private val datas = arrayListOf<Order>() |
| | | private val adapter by lazy { |
| | | when (type) { |
| | | in (1..3) -> TripOrderAdapter(datas,object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | val payThankDialog = PayThankDialog() |
| | | payThankDialog.setCallback(object : PayThankDialog.Callback { |
| | | override fun onOk(way: Int,money:Double) { |
| | | pay(way, rlt.toInt(),money = money) |
| | | } |
| | | }) |
| | | payThankDialog.show(childFragmentManager, "thank") |
| | | } |
| | | }) |
| | | TYPE_CHARTER -> CharterOrderAdapter(datas, object : OrderCallback { |
| | | override fun onDel(position: Int) { |
| | | cancelCharterOrder(position) |
| | |
| | | ) |
| | | } |
| | | } |
| | | Const.OrderType.TYPE_CROSS_CITY,Const.OrderType.TYPE_THROUGH_BUS -> { |
| | | Const.OrderType.TYPE_CROSS_CITY,Const.OrderType.TYPE_THROUGH_BUS,Const.OrderType.TYPE_AIRBUS -> { |
| | | when (order.state) { |
| | | in (1..6) -> startActivityForResult<TripActivity>( |
| | | 1, |
| | |
| | | const val TYPE_LOGISTICS_SAME = 4 |
| | | const val TYPE_LOGISTICS_CROSS = 5 |
| | | const val TYPE_CHARTER = 6 |
| | | const val TYPE_THROUGH_BUS = 7 |
| | | const val TYPE_OFFICIAL = 8 |
| | | const val TYPE_THROUGH_BUS = 8 |
| | | const val TYPE_AIR = 9 |
| | | const val TYPE_OFFICIAL = 10 |
| | | fun newInstance(type: Int): TripOrderFragment { |
| | | val tripOrderFragment = TripOrderFragment() |
| | | tripOrderFragment.arguments = bundleOf("type" to type) |
New file |
| | |
| | | package com.kuanzhai.user.ui.mine |
| | | |
| | | import android.app.Activity |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.clickDelay |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.TipDialog |
| | | import com.kuanzhai.user.dialog.VoiceSetSuccessDialog |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_voice_record.* |
| | | import org.jetbrains.anko.backgroundColorResource |
| | | |
| | | class VoiceRecordActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_voice_record |
| | | |
| | | private var voice = true |
| | | |
| | | override fun initClick() { |
| | | tv_action.clickDelay { |
| | | val tipDialog = TipDialog() |
| | | val operation = if (voice) "关闭" else "开启" |
| | | tipDialog.arguments = bundleOf("title" to "是否${operation}车内录音?","msg" to if (voice) "关闭后立即生效" else "开启后下一订单生效","ok" to "确认$operation") |
| | | tipDialog.setCallback(object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | HttpManager.setSound(if (voice) 0 else 1).request(this@VoiceRecordActivity){_,_-> |
| | | setResult(Activity.RESULT_OK) |
| | | voice = !voice |
| | | val voiceSetSuccessDialog = VoiceSetSuccessDialog() |
| | | voiceSetSuccessDialog.arguments = bundleOf("msg" to if (voice) "车内录音将在下一单开启" else "已关闭车内录音功能") |
| | | voiceSetSuccessDialog.show(supportFragmentManager,"suc") |
| | | showState() |
| | | } |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | }) |
| | | tipDialog.show(supportFragmentManager,"voice") |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | voice = intent.getBooleanExtra("voice",false) |
| | | showState() |
| | | } |
| | | |
| | | private fun showState(){ |
| | | if (!voice){ |
| | | bg.backgroundColorResource = R.color.textColor66 |
| | | tv_state.text = "车内录音功能已关闭" |
| | | tv_action.text = "立即开启车内录音" |
| | | }else{ |
| | | bg.backgroundColorResource = R.color.colorPrimary |
| | | tv_state.text = "车内录音功能已开启" |
| | | tv_action.text = "立即关闭车内录音" |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.kuanzhai.user.ui.mine.adapter |
| | | |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.entity.OrderCheckListBean |
| | | import org.jetbrains.anko.textColorResource |
| | | import java.util.ArrayList |
| | | |
| | | class OrderCheckAdapter(list: ArrayList<OrderCheckListBean>):HFRecyclerAdapter<OrderCheckListBean>(list, R.layout.item_order_check) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: OrderCheckListBean) { |
| | | holder.setText(R.id.tv_time,data.insertTime) |
| | | holder.setText(R.id.tv_travel_time,"用车时间:${data.useTime}") |
| | | holder.setText(R.id.tv_duration,"用车时长:${if (data.useDay == 0&&data.useHour == 0) "—" else "${data.useDay}天${data.useHour}小时"}") |
| | | holder.setText(R.id.tv_type,"车型要求:${data.serverCardName}") |
| | | holder.setText(R.id.tv_state,if (data.auditStatus == 0) "待处理" else "已处理") |
| | | holder.bind<TextView>(R.id.tv_state).textColorResource = if (data.auditStatus == 0) R.color.colorPrimary else R.color.textColor99 |
| | | } |
| | | |
| | | } |
| | |
| | | import android.widget.TextView |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.amaplib.overlay.DrivingRouteOverlay |
| | | import cn.sinata.xldutils.clickDelay |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.ioScheduler |
| | | import cn.sinata.xldutils.rxutils.ResultException |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.optInt |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import cn.sinata.xldutils.visible |
| | | import com.amap.api.maps.AMap |
| | |
| | | import com.autonavi.amap.mapcore.Inner_3dMap_location |
| | | import com.flyco.tablayout.listener.CustomTabEntity |
| | | import com.flyco.tablayout.listener.OnTabSelectListener |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.google.gson.Gson |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.ChooseReserveTimeDialog |
| | | import com.kuanzhai.user.dialog.ReasonDialog |
| | | import com.kuanzhai.user.dialog.SingleWheelDialog |
| | | import com.kuanzhai.user.dialog.* |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.CarPrice |
| | | import com.kuanzhai.user.network.entity.Passenger |
| | | import com.kuanzhai.user.network.requestByF |
| | | import com.kuanzhai.user.ui.MainActivity |
| | | import com.kuanzhai.user.ui.charter.CharterActivity |
| | | import com.kuanzhai.user.ui.mine.VerifyCompanyActivity |
| | | import com.kuanzhai.user.ui.trip.ChoosePositionActivity |
| | | import com.kuanzhai.user.ui.trip.PinPriceRuleActivity |
| | | import com.kuanzhai.user.ui.trip.PriceRuleActivity |
| | | import com.kuanzhai.user.ui.trip.TripActivity |
| | | import com.kuanzhai.user.utils.Const |
| | | import com.kuanzhai.user.views.textbanner.TextBannerView |
| | | import com.tbruyelle.rxpermissions2.RxPermissions |
| | |
| | | private var endLat = 0.0 |
| | | private var endName = "" |
| | | |
| | | private var time = "选择时间" //预约时间 |
| | | private var timeParam = "现在" //预约时间请求参数 |
| | | private var timeParam = "" //预约时间请求参数 |
| | | private var endTimeParam = "" //包车结束时间请求参数 |
| | | private var drivingRouteOverlay: DrivingRouteOverlay? = null |
| | | |
| | | private var carTypeId = 0 //快车/专车车型id |
| | | private var calType = 0 //计费方式(1单程计费,2=包车计费) |
| | | |
| | | private var carTypeId = 0 //车型id |
| | | private var carTypeIndex = 0 //选中的位置 |
| | | |
| | | private val passenger = arrayListOf<Passenger>() |
| | | private var payType = 0 //付费方式(1=自费,2=企业支付) |
| | | private var reason = "" |
| | | |
| | | private var isNotice = 0 //包车:是否提醒用户(0不提醒,1提醒) |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | mMapView.onCreate(savedInstanceState) |
| | |
| | | chooseReserveTimeDialog.setCallback(object : ChooseReserveTimeDialog.Callback { |
| | | override fun onOk(s: String, formatS: String) { |
| | | tv_time.text = s |
| | | time = s |
| | | timeParam = formatS |
| | | } |
| | | }) |
| | | chooseReserveTimeDialog.show(fragmentManager!!, "time") |
| | | } |
| | | tv_reason.setOnClickListener { |
| | | val reason = arrayListOf<String>() |
| | | reason.add("出差") |
| | | reason.add("出差1") |
| | | reason.add("出差3") |
| | | reason.add("出差4") |
| | | reason.add("出差5") |
| | | reason.add("采购") |
| | | ReasonDialog.show(childFragmentManager,(requireActivity() as MainActivity).userInfo?.name?:"",reason,object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | tv_reason.text = rlt |
| | | } |
| | | }) |
| | | showDialog() |
| | | HttpManager.getBusinessReason().requestByF(this){_,data-> |
| | | val reason = arrayListOf<String>() |
| | | reason.addAll(data?.map { it.name }?: arrayListOf()) |
| | | ReasonDialog.show(childFragmentManager,payType,reason,passenger,tv_reason.text.toString(),this@OfficialFragment.reason,object :ReasonDialog.ReasonCallback{ |
| | | override fun onResult( |
| | | passengers: List<Passenger>, |
| | | reason: String, |
| | | payWay: Int, |
| | | remark: String |
| | | ) { |
| | | tv_reason.text = reason |
| | | passenger.clear() |
| | | passenger.addAll(passengers) |
| | | payType = payWay |
| | | this@OfficialFragment.reason = remark |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | tv_way.setOnClickListener { |
| | | val singleWheelDialog = SingleWheelDialog() |
| | | singleWheelDialog.arguments = bundleOf("data" to arrayListOf("单程计费","包车计费"),"title" to "选择用车计费") |
| | | singleWheelDialog.setCallback(object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | if (rlt == "包车计费") |
| | | startActivity<CharterActivity>() |
| | | else |
| | | tv_way.text = rlt |
| | | } |
| | | }) |
| | | singleWheelDialog.showAllowingStateLoss(childFragmentManager,"way") |
| | | if (checkPermission()){ |
| | | val singleWheelDialog = SingleWheelDialog() |
| | | singleWheelDialog.arguments = bundleOf("data" to arrayListOf("单程计费","包车计费"),"title" to "选择用车计费") |
| | | singleWheelDialog.setCallback(object :StringCallback{ |
| | | override fun onRlt(rlt: String) { |
| | | if (rlt == "包车计费"){ |
| | | if (passenger.isEmpty()) |
| | | passenger.add(Passenger((requireActivity() as MainActivity).userInfo?.name?:"",(requireActivity() as MainActivity).userInfo?.phone?:"")) |
| | | startActivityForResult<CharterActivity>(3,"startTime" to timeParam,"passenger" to passenger,"start" to startName,"startLat" to startLat,"startLon" to startLon, |
| | | "end" to endName,"endLat" to endLat,"endLon" to endLon,"endTime" to endTimeParam,"isRemind" to (isNotice == 1)) |
| | | }else{ |
| | | if (calType!=1&&sc_type.visibility == View.VISIBLE){ //之前请求过车型并且计费方式发生变化,需重新请求车型 |
| | | calType = 1 |
| | | getCarType() |
| | | } |
| | | tv_way.text = rlt |
| | | calType = 1 |
| | | } |
| | | } |
| | | }) |
| | | singleWheelDialog.showAllowingStateLoss(childFragmentManager,"way") |
| | | } |
| | | } |
| | | tv_start.setOnClickListener { |
| | | startActivityForResult<ChoosePositionActivity>(1,"isOfficial" to true) |
| | | if (checkPermission()) |
| | | startActivityForResult<ChoosePositionActivity>(1,"isOfficial" to true) |
| | | } |
| | | tv_end.setOnClickListener { |
| | | startActivityForResult<ChoosePositionActivity>(2,"isOfficial" to true,"isStart" to false) |
| | | if (checkPermission()) |
| | | startActivityForResult<ChoosePositionActivity>(2,"isOfficial" to true,"isStart" to false) |
| | | } |
| | | tv_action.clickDelay { |
| | | tv_action.setOnClickListener { |
| | | if (tv_action.text == "预约出行"){ |
| | | //todo 下单 |
| | | }else{ |
| | | if (tv_time.text == "时间"){ |
| | | if (timeParam.isEmpty()){ |
| | | myToast("请选择用车时间") |
| | | return@clickDelay |
| | | return@setOnClickListener |
| | | } |
| | | if (tv_reason.text == "事由出行"){ |
| | | myToast("请选择出行事由") |
| | | return@clickDelay |
| | | return@setOnClickListener |
| | | } |
| | | if (tv_way.text == "计费方式"){ |
| | | myToast("请选择计费方式") |
| | | return@clickDelay |
| | | if (calType == 2&&endTimeParam.isEmpty()){ |
| | | myToast("请选择用车结束时间") |
| | | return@setOnClickListener |
| | | } |
| | | tv_action.isEnabled = false |
| | | HttpManager.saveOrderBusiness(calType,endName,endLat,endLon,isNotice,1,if (tab_type.currentTab == 0) 2 else 1,payType, |
| | | Gson().toJson(passenger),reason,tv_reason.text.toString(),passenger.size,KuanzhaiApplication.lat,KuanzhaiApplication.lon,carTypeId,startLat, |
| | | startLon,startName,tab_type.currentTab,if (calType == 1) null else endTimeParam,timeParam,1,null).requestByF(this,success = {_,data-> |
| | | startActivity<TripActivity>("type" to type, "id" to data?.optInt("id")) |
| | | back() |
| | | } |
| | | ){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | }else{ |
| | | if (startLat == 0.0){ |
| | | myToast("请选择出发地") |
| | | return@clickDelay |
| | | return@setOnClickListener |
| | | } |
| | | if (endLat == 0.0){ |
| | | myToast("请选择目的地") |
| | | return@clickDelay |
| | | return@setOnClickListener |
| | | } |
| | | if (calType == 2){ |
| | | if (timeParam.isEmpty()){ |
| | | myToast("请选择用车时间") |
| | | return@setOnClickListener |
| | | } |
| | | if (endTimeParam.isEmpty()){ |
| | | myToast("请选择用车结束时间") |
| | | return@setOnClickListener |
| | | } |
| | | } |
| | | if (calType == 0){ |
| | | myToast("请选择计费方式") |
| | | return@setOnClickListener |
| | | } |
| | | tv_action.isEnabled = false |
| | | getCarType() |
| | | } |
| | | } |
| | | iv_back.setOnClickListener { |
| | | back() |
| | | } |
| | | } |
| | | |
| | |
| | | private var nowCarType: CarPrice? = null |
| | | private fun getCarType() { |
| | | showDialog() |
| | | HttpManager.queryServerCarModel("$startLon,$startLat", "$endLon,$endLat", type) //todo 接口替换 |
| | | HttpManager.queryBusinessCarModel("$startLon,$startLat", "$endLon,$endLat", calType,if (calType == 1) null else "$timeParam:00",if (calType == 1) null else "$endTimeParam:00") |
| | | .requestByF(this, success = { _, data -> |
| | | sc_type.visible() |
| | | cl_1.gone() |
| | | tv_action.text = "预约出行" |
| | | tv_action.isEnabled = true |
| | | mainActivity.updateTitleVisibility(false, true) |
| | | |
| | | data?.let { list -> |
| | | ll_type.removeAllViews() |
| | | if (list.isEmpty()) { |
| | | val content = "当前暂无可用车\n请拨打平台电话(023-88888888)预约用车" |
| | | tv_empty.text = SpanBuilder(content).color(requireContext(),content.indexOf("("),content.indexOf(")"),R.color.color_text_price).build() |
| | | tv_empty.visible() |
| | | tv_action.gone() |
| | | } else { |
| | | tv_error.gone() |
| | | tv_retry.gone() |
| | |
| | | sc_type.visible() |
| | | cl_1.gone() |
| | | tv_action.text = "预约出行" |
| | | tv_action.isEnabled = true |
| | | mainActivity.updateTitleVisibility(false, true) |
| | | } |
| | | } |
| | | |
| | |
| | | aMap.setOnMyLocationChangeListener { |
| | | it as Inner_3dMap_location |
| | | Log.e(Const.Tag, "出租车:lat:" + it.latitude + ",lon:" + it.longitude) |
| | | OkApplication.lat = it.latitude |
| | | OkApplication.lon = it.longitude |
| | | OkApplication.address = it.address |
| | | OkApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | KuanzhaiApplication.lat = it.latitude |
| | | KuanzhaiApplication.lon = it.longitude |
| | | KuanzhaiApplication.address = it.address |
| | | KuanzhaiApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | if (locCount < 1) { |
| | | if (mainActivity.lat != 0.0) |
| | | aMap.animateCamera( |
| | |
| | | startName = data.getStringExtra("name") ?: "" |
| | | tv_start.text = startName |
| | | showConfirmOrder() |
| | | }else{ |
| | | }else if (requestCode == 2){ |
| | | endLat = data.getDoubleExtra("lat", 0.0) |
| | | endLon = data.getDoubleExtra("lon", 0.0) |
| | | endName = data.getStringExtra("name") ?: "" |
| | | tv_end.text = endName |
| | | showConfirmOrder() |
| | | }else{ |
| | | tv_way.text = "包车计费" |
| | | calType = 2 |
| | | timeParam = data.getStringExtra("startTime")?:"" |
| | | endTimeParam = data.getStringExtra("endTime")?:"" |
| | | startName = data.getStringExtra("startName")?:"" |
| | | tv_start.text = startName |
| | | startLat = data.getDoubleExtra("startLat",0.0) |
| | | startLon = data.getDoubleExtra("startLon",0.0) |
| | | endName = data.getStringExtra("endName")?:"" |
| | | tv_end.text = endName |
| | | endLat = data.getDoubleExtra("endLat",0.0) |
| | | endLon = data.getDoubleExtra("endLon",0.0) |
| | | isNotice = if (data.getBooleanExtra("isRemind",false)) 1 else 0 |
| | | passenger.clear() |
| | | passenger.addAll(data.getParcelableArrayListExtra("passenger")?: arrayListOf()) |
| | | showConfirmOrder() |
| | | if (sc_type.visibility == View.VISIBLE) //之前请求过车型,现在可能订单参数发生变化 |
| | | getCarType() |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun showConfirmOrder(){ |
| | | if (startLat!=0.0&&endLat!=0.0){ |
| | | tv_action.visible() |
| | | searchRoute(LatLonPoint(startLat, startLon), LatLonPoint(endLat, endLon)) |
| | | iv_center.gone() |
| | | } |
| | |
| | | routeSearch.setRouteSearchListener(this) |
| | | } |
| | | |
| | | private fun back(){ |
| | | tv_action.gone() |
| | | fun back(){ |
| | | tv_action.isEnabled = true |
| | | tv_end.text = "" |
| | | endLat = 0.0 |
| | | endLon = 0.0 |
| | | endName = "" |
| | | tv_time.text = "时间" |
| | | timeParam = "" |
| | | endTimeParam = "" |
| | | tv_reason.text = "事由出行" |
| | | drivingRouteOverlay?.removeFromMap() |
| | | startMarker?.remove() |
| | | endMarker?.remove() |
| | | aMap.animateCamera( |
| | | CameraUpdateFactory.newLatLngZoom( |
| | | LatLng( |
| | | OkApplication.lat, |
| | | OkApplication.lon |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon |
| | | ), 15f |
| | | ) |
| | | ) |
| | | passenger.clear() |
| | | mainActivity.updateTitleVisibility(false, false) |
| | | mainActivity.updateTipAlpha(1f) |
| | | sc_type.gone() |
| | | cl_1.visible() |
| | | tv_action.text = "确定" |
| | | calType = 0 |
| | | tv_way.text = "计费方式" |
| | | } |
| | | |
| | | fun checkPermission():Boolean{ |
| | | if (!KuanzhaiApplication.officialPermission){ |
| | | val alertDialog = TipDialog() |
| | | alertDialog.arguments = bundleOf("msg" to "未通过企业认证","ok" to "立即认证","isAlert" to true) |
| | | alertDialog.setCallback(object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | HttpManager.queryCompany().requestByF(this@OfficialFragment){_,data-> |
| | | startActivity<VerifyCompanyActivity>("data" to data) |
| | | } |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | }) |
| | | alertDialog.show(childFragmentManager,"no") |
| | | } |
| | | return KuanzhaiApplication.officialPermission |
| | | } |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | |
| | | drivingRouteOverlay!!.addToMap(Color.parseColor("#00C47A")) |
| | | drivingRouteOverlay!!.zoomToSpan(40, 120, 40, 300) |
| | | val args = drivePath.duration / 60 |
| | | setMarker(LatLng(startLat,startLon)) |
| | | setMarker( |
| | | LatLng(endLat, endLon), |
| | | String.format("大约行驶%d分钟", if (args == 0L) 1 else args) |
New file |
| | |
| | | package com.kuanzhai.user.ui.official.adapter |
| | | |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import android.view.View |
| | | import android.widget.EditText |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.entity.Passenger |
| | | import java.util.ArrayList |
| | | |
| | | class CharterPassengerAdapter(data: ArrayList<Passenger>, private val tvCount:TextView? = null) : HFRecyclerAdapter<Passenger>(data, R.layout.item_passenger_chater) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Passenger) { |
| | | holder.bind<View>(R.id.iv_del).apply { |
| | | setOnClickListener { |
| | | mData.removeAt(position) |
| | | notifyDataSetChanged() |
| | | tvCount?.text = "${mData.size}" |
| | | } |
| | | visibility = if (position == 0) View.INVISIBLE else View.VISIBLE |
| | | } |
| | | |
| | | holder.bind<EditText>(R.id.et_name).apply { |
| | | setText(data.name) |
| | | setSelection(data.name.length) |
| | | val watcher = object : TextWatcher { |
| | | override fun beforeTextChanged( |
| | | s: CharSequence?, |
| | | start: Int, |
| | | count: Int, |
| | | after: Int |
| | | ) { |
| | | } |
| | | |
| | | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
| | | } |
| | | |
| | | override fun afterTextChanged(s: Editable?) { |
| | | data.name = s.toString() |
| | | } |
| | | } |
| | | setOnFocusChangeListener { v, hasFocus -> |
| | | if (hasFocus) |
| | | addTextChangedListener(watcher) |
| | | else |
| | | removeTextChangedListener(watcher) |
| | | } |
| | | } |
| | | holder.bind<EditText>(R.id.et_phone).apply { |
| | | setText(data.phone) |
| | | setSelection(data.phone.length) |
| | | val watcher = object : TextWatcher { |
| | | override fun beforeTextChanged( |
| | | s: CharSequence?, |
| | | start: Int, |
| | | count: Int, |
| | | after: Int |
| | | ) { |
| | | } |
| | | |
| | | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
| | | } |
| | | |
| | | override fun afterTextChanged(s: Editable?) { |
| | | data.phone = s.toString() |
| | | } |
| | | } |
| | | setOnFocusChangeListener { v, hasFocus -> |
| | | if (hasFocus) |
| | | addTextChangedListener(watcher) |
| | | else |
| | | removeTextChangedListener(watcher) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import cn.sinata.xldutils.clickDelay |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.entity.Passenger |
| | | import java.util.ArrayList |
| | | |
| | | class PassengerAdapter(data: ArrayList<Passenger>,private val tvCount:TextView? = null) : |
| | | HFRecyclerAdapter<Passenger>(data, R.layout.item_passenger) { |
| | | class PassengerAdapter(data: ArrayList<Passenger>,private val tvCount:TextView? = null) : HFRecyclerAdapter<Passenger>(data, R.layout.item_passenger) { |
| | | var callback:MoreCallback? = null |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Passenger) { |
| | | holder.bind<View>(R.id.iv_del).apply { |
| | | setOnClickListener { |
| | |
| | | } |
| | | holder.bind<View>(R.id.iv_more).apply { |
| | | visibility = if (position == mData.lastIndex) View.VISIBLE else View.INVISIBLE |
| | | setOnClickListener { |
| | | //todo 选择历史乘客 |
| | | clickDelay { |
| | | callback?.onClick(position) |
| | | } |
| | | } |
| | | holder.bind<EditText>(R.id.et_name).apply { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | interface MoreCallback{ |
| | | fun onClick(position:Int) |
| | | } |
| | | } |
| | |
| | | import java.util.ArrayList |
| | | |
| | | class ReasonAdapter(data: ArrayList<String>) : HFRecyclerAdapter<String>(data, R.layout.item_reason) { |
| | | var checked = -1 |
| | | var checked = arrayListOf<Int>() |
| | | override fun onBind(holder: ViewHolder, position: Int, data: String) { |
| | | holder.bind<TextView>(R.id.tv_reason).apply { |
| | | text = data |
| | | setOnClickListener { |
| | | checked = position |
| | | if (position in checked) |
| | | checked.remove(position) |
| | | else |
| | | checked.add(position) |
| | | notifyDataSetChanged() |
| | | } |
| | | isSelected = position == checked |
| | | isSelected = position in checked |
| | | } |
| | | } |
| | | } |
| | |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.view.SwipeRefreshRecyclerLayout |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.CardDetailDialog |
| | | import com.kuanzhai.user.network.HttpManager |
| | |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.getTaxiCardList(OkApplication.lat,OkApplication.lon,type).requestByF(this,success = { _, data-> |
| | | HttpManager.getTaxiCardList(KuanzhaiApplication.lat,KuanzhaiApplication.lon,type).requestByF(this,success = { _, data-> |
| | | lvList.isRefreshing = false |
| | | if (page == 1) |
| | | datas.clear() |
| | |
| | | |
| | | import cn.sinata.xldutils.callPhone |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.network.requestByF |
| | | import kotlinx.android.synthetic.main.fragment_call_order.* |
| | | |
| | |
| | | } |
| | | |
| | | private fun getPhone(){ |
| | | HttpManager.getPhone(OkApplication.chooseCityCode).requestByF(this,false){ _, data-> |
| | | HttpManager.getPhone(KuanzhaiApplication.chooseCityCode).requestByF(this,false){ _, data-> |
| | | data?.let { |
| | | it.forEach { |
| | | if (it.type == 4) |
| | |
| | | import com.amap.api.services.help.Inputtips |
| | | import com.amap.api.services.help.InputtipsQuery |
| | | import com.amap.api.services.help.Tip |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.db.HistoryDBManager |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import com.kuanzhai.user.dialog.TipDialog |
| | |
| | | }) |
| | | tipDialog.show(supportFragmentManager,"tip") |
| | | } |
| | | headerView.setOnClickListener { |
| | | //todo 回传 |
| | | } |
| | | // headerView.setOnClickListener { |
| | | // } |
| | | } |
| | | |
| | | override fun initView() { |
| | | tv_city.text = if (cityName.isNullOrEmpty()) OkApplication.chooseCityName else cityName |
| | | tv_city.text = if (cityName.isNullOrEmpty()) KuanzhaiApplication.chooseCityName else cityName |
| | | if (siteId!=0){ //跨城 |
| | | tv_city.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0) |
| | | } |
| | |
| | | if (mTips.isNotEmpty()) |
| | | adapter.setFooterView(footerView) |
| | | et_search.requestFocus() |
| | | if (isOfficial){ //todo && if 有常用地址 |
| | | adapter.setHeaderView(headerView) |
| | | } |
| | | } |
| | | |
| | | private fun search(keyword: String) { |
| | |
| | | import com.amap.api.services.poisearch.PoiResult |
| | | import com.amap.api.services.poisearch.PoiSearch |
| | | import com.autonavi.amap.mapcore.Inner_3dMap_location |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.db.HistoryDBManager |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import com.kuanzhai.user.dialog.TipDialog |
| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | tv_city.text = if (cityName.isNullOrEmpty()) OkApplication.chooseCityName else cityName |
| | | tv_city.text = if (cityName.isNullOrEmpty()) KuanzhaiApplication.chooseCityName else cityName |
| | | if (siteId!=0){ //跨城 |
| | | tv_city.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0) |
| | | } |
| | |
| | | aMap.setOnMyLocationChangeListener { |
| | | it as Inner_3dMap_location |
| | | Log.e(Const.Tag, "选择定位:lat:" + it.latitude + ",lon:" + it.longitude) |
| | | OkApplication.lat = it.latitude |
| | | OkApplication.lon = it.longitude |
| | | OkApplication.address = it.address |
| | | OkApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | KuanzhaiApplication.lat = it.latitude |
| | | KuanzhaiApplication.lon = it.longitude |
| | | KuanzhaiApplication.address = it.address |
| | | KuanzhaiApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | if (locCount < 1) { |
| | | aMap.animateCamera( |
| | | CameraUpdateFactory.newLatLngZoom( |
| | |
| | | import com.flyco.tablayout.listener.CustomTabEntity |
| | | import com.flyco.tablayout.listener.OnTabSelectListener |
| | | import com.google.android.material.bottomsheet.BottomSheetBehavior |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.requestByF |
| | |
| | | import com.kuanzhai.user.dialog.SpecialCountDialog |
| | | import com.kuanzhai.user.dialog.TipDialog |
| | | import com.kuanzhai.user.network.entity.CarPrice |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.ChooseCityActivity |
| | | import com.kuanzhai.user.ui.mine.EditEmergencyActivity |
| | | import com.kuanzhai.user.ui.mine.SetEmergencyActivity |
| | |
| | | var mLocationOption = AMapLocationClientOption() |
| | | mlocationClient.setLocationListener{p0 -> |
| | | p0?.let { |
| | | if (!p0.city.isNullOrEmpty() && p0.city != OkApplication.chooseCityName && !isChangeCity) { |
| | | if (!p0.city.isNullOrEmpty() && p0.city != KuanzhaiApplication.chooseCityName && !isChangeCity) { |
| | | isChangeCity = true |
| | | showChangeCity() |
| | | mlocationClient.stopLocation() |
| | |
| | | aMap.animateCamera( |
| | | CameraUpdateFactory.newLatLngZoom( |
| | | LatLng( |
| | | OkApplication.lat, |
| | | OkApplication.lon |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon |
| | | ), 15f |
| | | ) |
| | | ) |
| | |
| | | callPhone(mainActivity.phoneEmergency) |
| | | } |
| | | tv_service.setOnClickListener { |
| | | callPhone(OkApplication.phoneService) |
| | | callPhone(KuanzhaiApplication.phoneService) |
| | | } |
| | | tv_start.setOnClickListener { |
| | | startActivityForResult<ChoosePositionActivity>(1) |
| | |
| | | |
| | | private fun makeOrder() { |
| | | if (mainActivity.checkLogin() && mainActivity.checkPhone()) { |
| | | if (OkApplication.emergency.isEmpty()) { |
| | | if (KuanzhaiApplication.emergency.isEmpty()) { |
| | | myToast("请设置紧急联系人") |
| | | startActivity<SetEmergencyActivity>( |
| | | "name" to "no", |
| | |
| | | endLon, |
| | | 1, |
| | | orderType, |
| | | OkApplication.lat, |
| | | OkApplication.lon, |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon, |
| | | startName, |
| | | startLat, |
| | | startLon, |
| | |
| | | aMap.setOnMyLocationChangeListener { |
| | | it as Inner_3dMap_location |
| | | Log.e(Const.Tag, "出租车:lat:" + it.latitude + ",lon:" + it.longitude) |
| | | OkApplication.lat = it.latitude |
| | | OkApplication.lon = it.longitude |
| | | OkApplication.address = it.address |
| | | OkApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | KuanzhaiApplication.lat = it.latitude |
| | | KuanzhaiApplication.lon = it.longitude |
| | | KuanzhaiApplication.address = it.address |
| | | KuanzhaiApplication.cityCode = it.extras.getString("adcode") ?: "" |
| | | if (locCount < 1) { |
| | | if (mainActivity.lat != 0.0) |
| | | aMap.animateCamera( |
| | |
| | | */ |
| | | private fun getBottomAds() { |
| | | if (mainActivity.isOpen) |
| | | HttpManager.getAds(2, OkApplication.chooseCityCode).requestByF(this,false) { _, data -> |
| | | HttpManager.getAds(2, KuanzhaiApplication.chooseCityCode).requestByF(this,false) { _, data -> |
| | | data?.let { |
| | | it.forEach { |
| | | val view = layoutInflater.inflate(R.layout.item_img_ads, null) |
| | |
| | | aMap.animateCamera( |
| | | CameraUpdateFactory.newLatLngZoom( |
| | | LatLng( |
| | | OkApplication.lat, |
| | | OkApplication.lon |
| | | KuanzhaiApplication.lat, |
| | | KuanzhaiApplication.lon |
| | | ), 15f |
| | | ) |
| | | ) |
| | | mainActivity.updateTipAlpha(1f) |
| | | |
| | | //出租车重置 |
| | | cl_taxi.gone() |
| | |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.* |
| | | import cn.sinata.xldutils.utils.* |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.dialog.* |
| | | import com.kuanzhai.user.interfaces.StringCallback |
| | |
| | | } |
| | | |
| | | private fun getAds(){ |
| | | HttpManager.getAds(3, OkApplication.chooseCityCode).request(this,false){ _, data-> |
| | | HttpManager.getAds(3, KuanzhaiApplication.chooseCityCode).request(this,false){ _, data-> |
| | | data?.let { |
| | | it.forEach { |
| | | val view = layoutInflater.inflate(R.layout.item_img_ads, null) |
| | |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import android.view.View |
| | | import cn.sinata.xldutils.callPhone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.optInt |
| | | import cn.sinata.xldutils.utils.toTime |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.network.HttpManager |
| | | import com.kuanzhai.user.network.entity.DriverInfo |
| | | import com.kuanzhai.user.network.request |
| | | import com.kuanzhai.user.ui.TransparentStatusBarActivity |
| | | import com.kuanzhai.user.ui.mine.MsgActivity |
| | | import kotlinx.android.synthetic.main.activity_target_order.* |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.startActivityForResult |
| | |
| | | myToast("请选择目的地") |
| | | }else{ |
| | | tv_action.isEnabled = false |
| | | HttpManager.addTaxiOrder(endName,endLat,endLon,2,type,OkApplication.lat,OkApplication.lon, startName, |
| | | HttpManager.addTaxiOrder(endName,endLat,endLon,2,type,KuanzhaiApplication.lat,KuanzhaiApplication.lon, startName, |
| | | startLat,startLon,0,0, System.currentTimeMillis().toTime("yyyy-MM-dd HH:mm"), |
| | | driver.id,null,null,null,1,1,businessType = type).request(this,success = {_,data-> |
| | | data?.let { |
| | |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import android.content.res.Resources |
| | | import android.graphics.Color |
| | | import android.os.Bundle |
| | | import android.os.Handler |
| | |
| | | import com.amap.api.services.core.LatLonPoint |
| | | import com.amap.api.services.route.* |
| | | import com.google.android.material.bottomsheet.BottomSheetBehavior |
| | | import com.kuanzhai.user.OkApplication |
| | | import com.kuanzhai.user.KuanzhaiApplication |
| | | import com.kuanzhai.user.R |
| | | import com.kuanzhai.user.interfaces.OrderStateChangeListener |
| | | import com.kuanzhai.user.network.Apis |
| | |
| | | mMapView.map |
| | | } |
| | | private val app by lazy { |
| | | application as OkApplication |
| | | application as KuanzhaiApplication |
| | | } |
| | | private val handler by lazy { |
| | | Handler(this) |
| | |
| | | shareDialog.setCallback(object :ShareDialog.Callback{ |
| | | override fun onOk(way: Int) { |
| | | ShareUtils.share(this@TripActivity,if (way == 0) SHARE_MEDIA.WEIXIN else if (way == 1) SHARE_MEDIA.QQ else |
| | | SHARE_MEDIA.MORE, String.format(Const.Share.TRIP_CONTENT,OkApplication.phone,if (type == 1) "快车/专车" else "出租车",order!!.licensePlate), |
| | | Const.Share.TITLE,String.format(Apis.TRIP_URL,id,type),this@TripActivity,OkApplication.emergency) |
| | | SHARE_MEDIA.MORE, String.format(Const.Share.TRIP_CONTENT,KuanzhaiApplication.phone,if (type == 1) "快车/专车" else "出租车",order!!.licensePlate), |
| | | Const.Share.TITLE,String.format(Apis.TRIP_URL,id,type),this@TripActivity,KuanzhaiApplication.emergency) |
| | | shareDialog.dismiss() |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | iv_location.setOnClickListener { |
| | | aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(OkApplication.lat,OkApplication.lon),15f)) |
| | | aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(KuanzhaiApplication.lat,KuanzhaiApplication.lon),15f)) |
| | | } |
| | | } |
| | | |
| | |
| | | aMap.uiSettings.isRotateGesturesEnabled = false |
| | | aMap.uiSettings.isTiltGesturesEnabled = false |
| | | aMap.isMyLocationEnabled = true |
| | | aMap.moveCamera(CameraUpdateFactory.newLatLng(LatLng(OkApplication.lat,OkApplication.lon))) |
| | | aMap.moveCamera(CameraUpdateFactory.newLatLng(LatLng(KuanzhaiApplication.lat,KuanzhaiApplication.lon))) |
| | | } |
| | | |
| | | |
| | | private fun getPhone(){ |
| | | HttpManager.getPhone(OkApplication.chooseCityCode).request(this,false){_,data-> |
| | | HttpManager.getPhone(KuanzhaiApplication.chooseCityCode).request(this,false){ _, data-> |
| | | data?.let { |
| | | it.forEach { |
| | | if (it.type == 1) |
| | |
| | | tv_passenger_num.text = String.format("%d人 座位:%s号",it.peopleNumber,it.seatNumber).replace(",","号,") |
| | | tv_remark.visibility = if (it.remark.isNotEmpty()) View.VISIBLE else View.GONE |
| | | tv_remark.text = it.remark |
| | | } |
| | | if (type == Const.OrderType.TYPE_OFFICIAL){ |
| | | tv_passenger_num.visible() |
| | | tv_passenger_num.text = String.format("%d人",it.peopleNumber) |
| | | } |
| | | if (it.state !=1){ //有司机 |
| | | handler.removeMessages(0) |
| | |
| | | */ |
| | | private fun setStateUI(){ |
| | | order?.let { |
| | | fl_official_check.gone() |
| | | when(it.state){ |
| | | 1->{ |
| | | title = "等待应答" |
| | | if (!handler.hasMessages(0)) |
| | | handler.sendEmptyMessage(0) |
| | | tv_action.visible() |
| | | aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(it.startLat,it.startLon),15f)) |
| | | queryEndPush() |
| | | when(it.auditStatus){ |
| | | 0->{ |
| | | title = "等待审核" |
| | | fl_official_check.visibility = View.VISIBLE |
| | | tv_action.visible() |
| | | } |
| | | 2->{ |
| | | fl_official_check.visibility = View.VISIBLE |
| | | title = "审核失败" |
| | | tv_action.gone() |
| | | tv_check_state.text = "审核失败" |
| | | tv_check_tip.text = it.auditRemark |
| | | } |
| | | -2->{ |
| | | startActivity<OrderDetailActivity>("id" to id,"type" to type) |
| | | finish() |
| | | } |
| | | else->{ |
| | | fl_official_check.gone() |
| | | title = "等待应答" |
| | | if (!handler.hasMessages(0)) |
| | | handler.sendEmptyMessage(0) |
| | | tv_action.visible() |
| | | aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(it.startLat,it.startLon),15f)) |
| | | queryEndPush() |
| | | } |
| | | } |
| | | } |
| | | 2->{ |
| | | title = "等待接驾" |
| | |
| | | * 获取行程中的数据:主要是司机位置,订单状态变化,距离、时间等预算信息 |
| | | */ |
| | | private fun getTrippingData(){ |
| | | OkApplication.intervalCount = 0 |
| | | KuanzhaiApplication.intervalCount = 0 |
| | | HttpManager.trippingInfo(id,type).request(this){_,data-> |
| | | data?.let { |
| | | if (it.lat.isNotEmpty()) |
| | |
| | | * 获取是否有司机接单 |
| | | */ |
| | | private fun queryEndPush(){ |
| | | OkApplication.intervalCount = 0 |
| | | KuanzhaiApplication.intervalCount = 0 |
| | | HttpManager.queryEndPush(id,type).request(this){_,data-> |
| | | data?.let { |
| | | if (it.state == 2){ //无人接单 |
| | |
| | | val c = String.format("正为您寻找车辆 等待%02d:%02d", i / 1000 / 60, i / 1000 % 60) |
| | | setMarker(latLon, SpanBuilder(c) |
| | | .color(this,10,c.length,R.color.colorRed).build()) |
| | | OkApplication.intervalCount ++ |
| | | if (OkApplication.intervalCount>7){ |
| | | KuanzhaiApplication.intervalCount ++ |
| | | if (KuanzhaiApplication.intervalCount>7){ |
| | | queryEndPush() |
| | | getTrippingData() |
| | | } |
| | | Log.e("timer","事件0:"+OkApplication.intervalCount) |
| | | Log.e("timer","事件0:"+KuanzhaiApplication.intervalCount) |
| | | handler.sendEmptyMessageDelayed(0, 1000) |
| | | } |
| | | } |
| | |
| | | val c = String.format("司机到达预约地点,已等您%02d:%02d", i / 1000 / 60, i / 1000 % 60) |
| | | tv_state.text = SpanBuilder(c).color(this,12,c.length,R.color.colorOrange).build() |
| | | tv_state_pin.text = SpanBuilder(c).color(this,12,c.length,R.color.colorOrange).build() |
| | | OkApplication.intervalCount ++ |
| | | if (OkApplication.intervalCount>7){ |
| | | KuanzhaiApplication.intervalCount ++ |
| | | if (KuanzhaiApplication.intervalCount>7){ |
| | | getTrippingData() |
| | | } |
| | | Log.e("timer","事件1:"+OkApplication.intervalCount) |
| | | Log.e("timer","事件1:"+KuanzhaiApplication.intervalCount) |
| | | handler.sendEmptyMessageDelayed(1, 1000) |
| | | } |
| | | } |
| | | 2->{ |
| | | OkApplication.intervalCount ++ |
| | | if (OkApplication.intervalCount>7){ |
| | | KuanzhaiApplication.intervalCount ++ |
| | | if (KuanzhaiApplication.intervalCount>7){ |
| | | getTrippingData() |
| | | } |
| | | Log.e("timer","事件2:"+OkApplication.intervalCount) |
| | | Log.e("timer","事件2:"+KuanzhaiApplication.intervalCount) |
| | | if (order?.state == 2) |
| | | fl_reserve.visibility = if (order!!.travelTime1.isNotEmpty()&&order!!.travelTime1.parserTime()-System.currentTimeMillis()>(30L*60*1000)) View.VISIBLE else View.GONE |
| | | handler.sendEmptyMessageDelayed(2, 1000) |
| | |
| | | } |
| | | |
| | | //1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车,7=95128电召,8=景区直通车,9=机场专线,10=公务用车 |
| | | object OrderType{ //1=快车/专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车,7=景区直通车,8=公务出行,9=电召 |
| | | object OrderType{ |
| | | const val TYPE_SPECIAL = 1 |
| | | const val TYPE_TAXI = 2 |
| | | const val TYPE_CROSS_CITY = 3 |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="@color/colorPrimary"/> |
| | | <corners android:radius="4dp"/> |
| | | <size android:width="6dp" android:height="6dp"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_refuse" |
| | | android:text="拒绝" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_action" |
| | | android:layout_marginBottom="19dp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:visibility="gone" |
| | | android:paddingVertical="10dp" |
| | | android:paddingHorizontal="49dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@drawable/bg_refuse"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_result" |
| | | android:text="拒绝" |
| | | android:visibility="gone" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="19dp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:paddingVertical="10dp" |
| | | android:paddingHorizontal="49dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@drawable/bg_refuse"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | android:text="同意" |
| | | android:visibility="gone" |
| | | app:layout_constraintStart_toEndOf="@id/tv_refuse" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_refuse" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:paddingVertical="10dp" |
| | | android:paddingHorizontal="49dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@drawable/bg_dark_4dp"/> |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginBottom="90dp"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_start" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:layout_marginEnd="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_start" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="始发地:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_start" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_end" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_start" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:layout_marginEnd="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_end" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="目的地:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_end" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_pay_way" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_end" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:layout_marginEnd="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_pay_way" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="计费方式:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_pay_way" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_passenger" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_pay_way" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:gravity="end" |
| | | android:layout_marginEnd="14dp" |
| | | android:lineSpacingExtra="10dp" |
| | | android:text="1"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_passenger" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="出行人数:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_passenger" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_reason" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_passenger" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:layout_marginEnd="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_reason" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="出行事由:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_reason" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_pay_type" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:layout_marginEnd="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_pay_type" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="付费方式:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_pay_type" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_car" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_pay_type" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | style="@style/style_form_text_mine" |
| | | android:layout_marginEnd="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_car" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="14dp" |
| | | android:text="选择车型:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_car" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv1" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="14dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_car" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:layout_marginTop="21dp" |
| | | android:text="拒绝理由:"/> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="100dp" |
| | | android:id="@+id/et_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv1" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="10dp" |
| | | android:hint="请输入拒绝理由" |
| | | android:gravity="top" |
| | | android:background="@null" |
| | | android:maxLength="50" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp"/> |
| | | <View |
| | | android:id="@+id/line" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_content" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="12dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_limit" |
| | | android:text="0/50" |
| | | android:textSize="12sp" |
| | | app:layout_constraintEnd_toEndOf="@id/et_content" |
| | | app:layout_constraintBottom_toBottomOf="@id/et_content"/> |
| | | <androidx.constraintlayout.widget.Group |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/gp_refuse" |
| | | android:visibility="gone" |
| | | app:constraint_referenced_ids="tv1,et_content,line,tv_limit"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </ScrollView> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_voice" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:drawableEnd="@mipmap/icon_more_black" |
| | | android:text="车内录音设置" |
| | | style="@style/style_form_text_setting"/> |
| | | <View |
| | | style="@style/style_form_divider_line" |
| | | android:layout_marginStart="14dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_question" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginEnd="14dp" |
| | |
| | | android:id="@+id/tv_state" |
| | | android:layout_margin="8dp" |
| | | android:background="@drawable/bg_white_4dp_line"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | style="@style/style_tv_action" |
| | | android:background="@drawable/bg_deep_grey_4dp" |
| | | android:visibility="gone" |
| | | android:layout_marginBottom="14dp" |
| | | android:text="取消订单"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/icon_service" /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/fl_official_check" |
| | | android:visibility="gone" |
| | | android:orientation="vertical" |
| | | app:layout_constraintTop_toBottomOf="@id/ll_trip" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@color/page_bg"> |
| | | <TextView |
| | | android:id="@+id/tv_check_state" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="部门审核中" |
| | | android:layout_marginTop="90dp" |
| | | android:layout_gravity="center_horizontal" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/colorDark"/> |
| | | <TextView |
| | | android:id="@+id/tv_check_tip" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="超出15分钟未审核完成请联系部门负责人" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_gravity="center_horizontal" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/colorDark"/> |
| | | |
| | | </LinearLayout> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | style="@style/style_tv_action" |
| | | android:background="@drawable/bg_deep_grey_4dp" |
| | | android:visibility="gone" |
| | | android:layout_marginBottom="14dp" |
| | | android:text="取消订单"/> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout |
| | | xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/page_bg"> |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="36dp" |
| | | android:background="@color/colorPrimary" |
| | | android:id="@+id/bg"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_state" |
| | | android:layout_centerInParent="true" |
| | | android:textColor="@color/white" |
| | | android:drawableStart="@mipmap/notice_white" |
| | | android:drawablePadding="7dp" |
| | | android:text="车内录音功能已关闭"/> |
| | | </RelativeLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:layout_marginTop="11dp" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@drawable/bg_white_6dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="若您选择开启车内录音" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | android:drawableStart="@mipmap/clock_on" |
| | | android:drawablePadding="6dp" |
| | | android:gravity="center" |
| | | android:layout_marginVertical="7dp" |
| | | android:layout_marginStart="6dp"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginStart="6dp" |
| | | android:background="@color/dividing_line_color"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="开启后下一订单即生效" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66" |
| | | android:drawablePadding="6dp" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginTop="6dp" |
| | | android:drawableStart="@drawable/dot_green"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="为保障您的出行安全,建议您全程开启车" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66" |
| | | android:drawablePadding="6dp" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginBottom="17dp" |
| | | android:layout_marginTop="6dp" |
| | | android:drawableStart="@drawable/dot_green"/> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:layout_marginTop="11dp" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@drawable/bg_white_6dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="若您选择关闭车内录音" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | android:drawableStart="@mipmap/clock_on" |
| | | android:drawablePadding="6dp" |
| | | android:gravity="center" |
| | | android:layout_marginVertical="7dp" |
| | | android:layout_marginStart="6dp"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginStart="6dp" |
| | | android:background="@color/dividing_line_color"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="关闭后立即生效/拼车订单不生效" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66" |
| | | android:drawablePadding="6dp" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginTop="6dp" |
| | | android:drawableStart="@drawable/dot_green"/> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <View |
| | | android:layout_width="6dp" |
| | | android:layout_height="6dp" |
| | | android:background="@drawable/dot_green" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginStart="6dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="由于录制设备不同,录音、录像功能需单独设置。若您想关闭车内录像功能,请前往“我的-设置-车内录像设置”进行关闭" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66" |
| | | android:drawablePadding="6dp" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginBottom="17dp" |
| | | android:layout_marginTop="6dp"/> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | <Space |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_tv_action" |
| | | android:layout_marginBottom="10dp" |
| | | android:id="@+id/tv_action"/> |
| | | </LinearLayout> |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:paddingBottom="10dp" |
| | | android:layout_height="match_parent" |
| | | android:background="@drawable/bg_white_8dp"> |
| | | <TextView |
| | |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_cancel" |
| | | android:layout_width="0dp" |
| | | android:layout_height="45dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="关闭" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="14sp" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_ok" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="16dp" |
| | | android:layout_marginEnd="4dp" |
| | | android:textStyle="bold" |
| | | android:visibility="gone" |
| | | android:background="@drawable/bg_grey_4dp" |
| | | app:layout_constraintTop_toTopOf="@id/tv_ok" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_ok" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_width="0dp" |
| | | android:layout_height="45dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="我已阅读" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | android:background="@drawable/bg_orange_bottom_8dp" |
| | | app:layout_constraintTop_toBottomOf="@id/sc_content" |
| | | android:layout_marginTop="14dp"/> |
| | | android:layout_marginEnd="16dp" |
| | | android:layout_marginStart="4dp" |
| | | app:layout_goneMarginStart="16dp" |
| | | android:layout_marginTop="35dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_cancel" |
| | | android:background="@drawable/bg_dark_4dp" |
| | | app:layout_constraintTop_toBottomOf="@id/sc_content"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:id="@+id/iv_add"/> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_passenger" |
| | | android:layout_width="match_parent" |
| | |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" /> |
| | | <EditText |
| | | android:id="@+id/et_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="110dp" |
| | | android:layout_marginTop="10dp" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <TextView |
| | | android:id="@+id/tv_msg" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="18sp" |
| | | android:textStyle="bold" |
| | | android:drawableStart="@mipmap/voice_suc" |
| | | android:drawablePadding="15dp" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_white_6dp" |
| | | android:paddingVertical="20dp" |
| | | android:paddingHorizontal="22dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:text="钱包" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_order_check" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:drawableStart="@mipmap/ic_shenhe" |
| | | android:layout_marginStart="11dp" |
| | | style="@style/style_form_text_mine" |
| | | android:text="订单审核" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_close_account" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:id="@+id/tv1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="选择时间:" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginBottom="10dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv1" |
| | | app:layout_constraintStart_toEndOf="@id/tv1" |
| | | android:textColor="@color/colorDark" |
| | | android:textSize="12sp" |
| | | android:text="(选择时长最短不能低于0.5天)"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_time" |
| | | android:id="@+id/tv_start_time" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="用车时间" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_time" |
| | | android:textColor="@color/colorDark" |
| | | android:textSize="14sp" |
| | | android:text="用车开始时间" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_start_time" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_duration" |
| | | android:id="@+id/tv_end_time" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_time" /> |
| | | app:layout_constraintTop_toBottomOf="@id/tv_start_time" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:textColor="@color/colorDark" |
| | | android:textSize="14sp" |
| | | android:drawablePadding="8dp" |
| | | android:text="用车结束时间" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_end_time" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_duration" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:drawablePadding="10dp" |
| | | android:gravity="end" |
| | | android:textColor="@color/colorOrange" |
| | | android:paddingTop="12dp" |
| | | android:text="0天" |
| | | android:paddingBottom="12dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_end_time" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_type" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:id="@+id/tv_2" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="10dp" |
| | | android:gravity="end" |
| | | android:hint="选择车型要求" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:text="选择地址:" |
| | | android:paddingTop="20dp" |
| | | android:paddingBottom="10dp" |
| | | android:background="@color/page_bg" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | android:paddingHorizontal="14dp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_duration" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_start" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="车型要求" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_type" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_usage" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="10dp" |
| | | android:gravity="end" |
| | | android:hint="选择车辆用途" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_type" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="车辆用途" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_usage" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | android:layout_width="match_parent" |
| | | android:layout_height="49dp" |
| | | android:layout_marginStart="3dp" |
| | | android:drawableStart="@mipmap/icon_starting_point" |
| | | android:drawablePadding="4dp" |
| | | android:gravity="center_vertical" |
| | | android:hint="请选择起点" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="4dp" |
| | | android:background="@color/page_bg" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_usage" /> |
| | | android:layout_height="1px" |
| | | android:layout_marginStart="23dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_start" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_count" |
| | | <TextView |
| | | android:id="@+id/tv_end" |
| | | style="@style/style_common_text" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="49dp" |
| | | android:layout_marginStart="3dp" |
| | | android:drawableStart="@mipmap/icon_end_point" |
| | | android:drawablePadding="6dp" |
| | | android:gravity="center_vertical" |
| | | android:hint="您要去哪儿" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_start" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_3" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="乘车人信息:" |
| | | android:paddingTop="20dp" |
| | | android:paddingBottom="40dp" |
| | | android:background="@color/page_bg" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | android:paddingHorizontal="14dp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_end" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_4" |
| | | android:text="是否需要提醒乘车人?" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/colorDark" |
| | | android:textSize="12sp" |
| | | android:layout_marginEnd="5dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_3" |
| | | app:layout_constraintEnd_toStartOf="@id/sw_remind"/> |
| | | <Switch |
| | | android:id="@+id/sw_remind" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/tv_4" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_4"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_add" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/sw_remind" |
| | | android:textColor="@color/colorPrimary" |
| | | android:drawableEnd="@mipmap/add_passenger" |
| | | android:drawablePadding="8dp" |
| | | android:textSize="12sp" |
| | | android:paddingVertical="8dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="12dp" |
| | | android:text="新增乘车人"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_count" |
| | | style="@style/style_common_text" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="100dp" |
| | | android:layout_marginTop="4dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:gravity="end" |
| | | android:hint="填写乘车人数" |
| | | android:text="1" |
| | | android:inputType="number" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | android:singleLine="true" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_usage" /> |
| | | app:layout_constraintTop_toBottomOf="@id/tv_3" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="乘车人数" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_count" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_count" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_name" |
| | | style="@style/style_common_text" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="100dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:gravity="end" |
| | | android:hint="填写联系人姓名" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | android:singleLine="true" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/et_count" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="联系人" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_name" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_phone" |
| | | style="@style/style_common_text" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="100dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:gravity="end" |
| | | android:hint="填写联系人电话" |
| | | android:inputType="number" |
| | | android:maxLength="11" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | android:singleLine="true" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/et_name" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="联系电话" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_phone" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | app:layout_constraintTop_toBottomOf="@id/tv_count" |
| | | android:id="@+id/rv_passenger"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <TextView |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/cl_back" |
| | | android:background="@color/white" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" > |
| | | <ImageView |
| | | android:id="@+id/iv_back" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="44dp" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_marginTop="35dp" |
| | | android:paddingStart="10dp" |
| | | android:src="@mipmap/back"/> |
| | | </FrameLayout> |
| | | |
| | | <com.amap.api.maps.TextureMapView |
| | | android:id="@+id/mMapView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | app:layout_constraintTop_toBottomOf="@id/cl_back" /> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_center" |
| | |
| | | android:background="@drawable/bg_white_8dp" |
| | | android:elevation="2dp" |
| | | app:layout_constraintBottom_toBottomOf="parent"> |
| | | |
| | | <HorizontalScrollView |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_width="match_parent" |
| | | android:scrollbars="none" |
| | | <LinearLayout |
| | | android:id="@+id/sc_type" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:visibility="gone" |
| | | android:layout_height="wrap_content"> |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="121dp" |
| | | android:orientation="horizontal" |
| | | android:id="@+id/ll_type"/> |
| | | </HorizontalScrollView> |
| | | android:orientation="vertical"> |
| | | <HorizontalScrollView |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_width="match_parent" |
| | | android:scrollbars="none" |
| | | android:layout_height="wrap_content"> |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="121dp" |
| | | android:orientation="horizontal" |
| | | android:id="@+id/ll_type"/> |
| | | </HorizontalScrollView> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="20dp"/> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_type" /> |
| | | |
| | | <View |
| | | android:id="@+id/vertical_1" |
| | | android:layout_width="1dp" |
| | | android:layout_height="20dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toStartOf="@id/vertical_2" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/tv_reason" /> |
| | | |
| | | <View |
| | | android:id="@+id/vertical_2" |
| | | android:layout_width="1dp" |
| | | android:layout_height="20dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/vertical_1" |
| | | app:layout_constraintTop_toTopOf="@id/vertical_1" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="3dp" |
| | | android:paddingTop="14dp" |
| | | android:paddingBottom="14dp" |
| | | android:text="时间" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toStartOf="@id/vertical_1" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_reason" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="3dp" |
| | | android:paddingTop="14dp" |
| | | android:paddingBottom="14dp" |
| | | android:text="事由出行" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | app:layout_constraintEnd_toStartOf="@id/vertical_2" |
| | | app:layout_constraintStart_toEndOf="@id/vertical_1" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_type" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_way" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="3dp" |
| | | android:paddingTop="14dp" |
| | | android:paddingBottom="14dp" |
| | | android:text="计费方式" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/vertical_2" /> |
| | | |
| | | <View |
| | | android:id="@+id/line" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_reason" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_start" |
| | |
| | | android:gravity="center_vertical" |
| | | android:hint="请选择起点" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_reason" /> |
| | | app:layout_constraintTop_toBottomOf="@id/tab_type" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | |
| | | android:hint="您要去哪儿" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_start" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginStart="23dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_end" /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <androidx.constraintlayout.widget.Barrier |
| | | android:layout_width="wrap_content" |
| | |
| | | android:id="@+id/barrier" |
| | | app:constraint_referenced_ids="cl_1,sc_type" |
| | | app:barrierDirection="bottom"/> |
| | | <View |
| | | android:id="@+id/vertical_1" |
| | | android:layout_width="1dp" |
| | | android:layout_height="20dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toStartOf="@id/vertical_2" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/tv_reason" /> |
| | | |
| | | <View |
| | | android:id="@+id/vertical_2" |
| | | android:layout_width="1dp" |
| | | android:layout_height="20dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/vertical_1" |
| | | app:layout_constraintTop_toTopOf="@id/vertical_1" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="3dp" |
| | | android:paddingTop="14dp" |
| | | android:paddingBottom="14dp" |
| | | android:text="时间" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toStartOf="@id/vertical_1" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_reason" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="3dp" |
| | | android:paddingTop="14dp" |
| | | android:paddingBottom="14dp" |
| | | android:text="事由出行" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | app:layout_constraintEnd_toStartOf="@id/vertical_2" |
| | | app:layout_constraintStart_toEndOf="@id/vertical_1" |
| | | app:layout_constraintTop_toBottomOf="@id/barrier" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_way" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:drawableEnd="@mipmap/icon_more_grey" |
| | | android:drawablePadding="3dp" |
| | | android:paddingTop="14dp" |
| | | android:paddingBottom="14dp" |
| | | android:text="计费方式" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_reason" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/vertical_2" /> |
| | | |
| | | <View |
| | | android:id="@+id/line" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_reason" /> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | app:layout_constraintTop_toBottomOf="@id/barrier" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_way" |
| | | style="@style/style_tv_action" |
| | | android:text="确定" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginStart="40dp" |
| | | android:layout_marginEnd="40dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginBottom="12dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="6dp" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@drawable/bg_white_2dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_time" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="9dp" |
| | | android:layout_marginStart="20dp" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:text="2022-06-05 07:16"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_state" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_time" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | android:textSize="12sp" |
| | | android:text="待处理"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_time" |
| | | android:layout_marginTop="6dp" |
| | | android:layout_marginStart="20dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_travel_time" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_time" |
| | | android:layout_marginTop="15dp" |
| | | android:text="用车时间:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor66" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="20dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_duration" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_travel_time" |
| | | android:layout_marginTop="9dp" |
| | | android:text="用车时长:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor66" |
| | | android:layout_marginStart="20dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_type" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_duration" |
| | | android:layout_marginTop="9dp" |
| | | android:text="车型要求:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor66" |
| | | android:layout_marginStart="20dp"/> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_type" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginStart="20dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="详情" |
| | | android:textColor="@color/colorPrimary" |
| | | android:textSize="15sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:background="@drawable/bg_orange_line_4dp" |
| | | android:paddingVertical="7dp" |
| | | android:paddingHorizontal="28dp" |
| | | android:layout_marginTop="34dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="15dp" |
| | | android:layout_marginEnd="7dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_type"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <EditText |
| | | android:id="@+id/et_name" |
| | | style="@style/style_common_text" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="130dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:hint="填写联系人姓名" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | android:maxLength="20" |
| | | android:singleLine="true" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="联系人" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_name" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_phone" |
| | | style="@style/style_common_text" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="130dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:hint="填写联系人电话" |
| | | android:inputType="number" |
| | | android:maxLength="11" |
| | | android:paddingTop="12dp" |
| | | android:paddingBottom="12dp" |
| | | android:singleLine="true" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/et_name" /> |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:drawablePadding="8dp" |
| | | android:text="联系电话" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_phone" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="4dp" |
| | | android:background="@color/page_bg" |
| | | app:layout_constraintTop_toBottomOf="@id/et_phone"/> |
| | | <ImageView |
| | | android:id="@+id/iv_del" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="@id/et_name" |
| | | app:layout_constraintBottom_toBottomOf="@id/et_name" |
| | | app:layout_constraintEnd_toEndOf="@id/et_name" |
| | | android:src="@mipmap/delete_passenger" |
| | | android:padding="10dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |