| | |
| | | import cn.ptaxi.yuekeduocx.driver.bean.SeatBean |
| | | import cn.ptaxi.yuekeduocx.driver.bean.ShiftDetail |
| | | import cn.ptaxi.yuekeduocx.driver.bean.ShiftDetailData |
| | | import cn.ptaxi.yuekeduocx.driver.bean.UserBean |
| | | import cn.ptaxi.yuekeduocx.driver.bean.WxBean |
| | | import cn.ptaxi.yuekeduocx.driver.netUtls.Api |
| | | import cn.ptaxi.yuekeduocx.driver.netUtls.callNet |
| | |
| | | } |
| | | }) |
| | | getData() |
| | | ll_seat.visibility = |
| | | if (CacheKey.getUserInfo().couldSelectSeat()) View.VISIBLE else View.GONE |
| | | ll_edit_price.visibility = |
| | | if (CacheKey.getUserInfo().couldModifyAmount()) View.VISIBLE else View.GONE |
| | | |
| | | } |
| | | |
| | | private fun queryUserData() { |
| | | callNet(Api.queryInfo, getMapByAny()) { |
| | | val user = gson.fromJson<UserBean>(it, UserBean::class.java) |
| | | CacheKey.saveUserInfo(user.data) |
| | | if (isFinishing || isDestroy) { |
| | | return@callNet |
| | | } |
| | | ll_seat.visibility = |
| | | if (CacheKey.getUserInfo().couldSelectSeat()) View.VISIBLE else View.GONE |
| | | ll_edit_price.visibility = |
| | | if (CacheKey.getUserInfo().couldModifyAmount()) View.VISIBLE else View.GONE |
| | | } |
| | | } |
| | | |
| | | private fun getData() { |
| | | val map = HashMap<String, String>() |
| | | map["lineShiftDriverId"] = id |
| | | callNetGet(this, Api.queryDriverShifDetail, map) { |
| | | if (isFinishing || isDestroy) { |
| | | return@callNetGet |
| | | } |
| | | shiftDetail = gson.fromJson(it, ShiftDetail::class.java).data |
| | | shiftDetail?.apply { |
| | | tv_start.text = lineName.split("-")[0] |