评价管理
This commit is contained in:
parent
32ff64e91f
commit
e7f173fde2
@ -272,6 +272,11 @@
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.mine.activity.RateManActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.mine.InviteDriverActivity"
|
||||
|
52
app/src/main/java/com/dahe/gldriver/adapter/RateAdapter.kt
Normal file
52
app/src/main/java/com/dahe/gldriver/adapter/RateAdapter.kt
Normal file
@ -0,0 +1,52 @@
|
||||
package com.dahe.gldriver.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter4.BaseQuickAdapter
|
||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.bean.DriverBean
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.glex.bean.WayBillBean
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import me.zhanghai.android.materialratingbar.MaterialRatingBar
|
||||
|
||||
/**
|
||||
* @ClassName WaybillAdapter
|
||||
* @Author 用户
|
||||
* @Date 2024/3/18 16:27
|
||||
* @Description 评价管理adapter
|
||||
*/
|
||||
class RateAdapter(var isInvite: Boolean = false) :
|
||||
BaseQuickAdapter<RateBean, QuickViewHolder>() {
|
||||
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: RateBean?) {
|
||||
item?.let {
|
||||
holder.run {
|
||||
setText(R.id.tvDate, item.createTime)
|
||||
setText(R.id.tvContent, item.opinionsContent)
|
||||
setText(R.id.tvComName, item.realCompanyName)
|
||||
setText(
|
||||
R.id.tvRate,
|
||||
"""交易${item.shipperPositiveReviewRate} 好评率${item.shipperTransactionVolume.toInt() * 100}%"""
|
||||
)
|
||||
|
||||
val rating = getView<MaterialRatingBar>(R.id.rating)
|
||||
rating.rating = item.opinionsStarRating.toFloat() / 2
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(context, it.avatar, 6, getView<ImageView>(R.id.ivHead))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
context: Context,
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): QuickViewHolder {
|
||||
// 返回一个 ViewHolder
|
||||
return QuickViewHolder(R.layout.item_rate, parent)
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ object AppConfig {
|
||||
const val IS_FIRST_OPEN = "DA_HE_IS_FIRST_OPEN"
|
||||
const val WAYBILL_ID = "DA_HE_WAYBILL_ID"
|
||||
const val CHILDRE_ID = "DA_HE_CHILDRE_ID"
|
||||
const val RATE_TYPE = "DA_HE_RATE_TYPE"//0:收到的评价 1:发表的评价
|
||||
const val CODE = "DA_HE_PHONE"
|
||||
const val REFRSH = "DA_HE_REFRSH"
|
||||
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"
|
||||
|
31
app/src/main/java/com/dahe/gldriver/bean/ApiBean.kt
Normal file
31
app/src/main/java/com/dahe/gldriver/bean/ApiBean.kt
Normal file
@ -0,0 +1,31 @@
|
||||
package com.dahe.gldriver.bean
|
||||
|
||||
/**
|
||||
* @ClassName ApiBean
|
||||
* @Author john
|
||||
* @Date 2024/3/18 09:59
|
||||
* @Description TODO
|
||||
*/
|
||||
data class RateBean(
|
||||
val createBy: String,
|
||||
val createTime: String,
|
||||
val driverId: Int,
|
||||
val operatorType: String,
|
||||
val opinionsContent: String,
|
||||
val positiveReviewRate: String,
|
||||
val totalNumberOfOrders: String,
|
||||
val numberOfEvaluations1: String,
|
||||
val numberOfEvaluations2: String,
|
||||
val numberOfEvaluations3: String,
|
||||
val opinionsId: Int,
|
||||
val opinionsStarRating: Int,
|
||||
val opinionsStatus: String,
|
||||
val opinionsType: String,
|
||||
val realCompanyName: String,
|
||||
val shipperPositiveReviewRate: String,
|
||||
val shipperTransactionVolume: String,
|
||||
val avatar: String,
|
||||
val orderId: Int,
|
||||
val updateBy: String
|
||||
)
|
||||
|
@ -30,7 +30,7 @@ data class UserBean(
|
||||
var qrcodeUrl :String,
|
||||
var expires_in :Int,
|
||||
var credit :String,
|
||||
var isCarCaptain :String,
|
||||
var isCarCaptain :String,//是否是车队长(0=否,1=是,9=未选择)
|
||||
var contactName :String,
|
||||
var idcardName :String,
|
||||
var avatar :String,
|
||||
|
@ -11,6 +11,7 @@ import com.dahe.gldriver.bean.InviteRecord
|
||||
import com.dahe.gldriver.bean.OcrPersonBean
|
||||
import com.dahe.gldriver.bean.OrderDetailBean
|
||||
import com.dahe.gldriver.bean.OssBean
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.gldriver.bean.UpBankInfoBean
|
||||
import com.dahe.gldriver.bean.UpCaptain
|
||||
import com.dahe.gldriver.bean.UpDriverInfoBean
|
||||
@ -72,8 +73,8 @@ interface Api {
|
||||
* @param token String
|
||||
* @return Observable<CommonResponseBean<UserBean>>
|
||||
*/
|
||||
@GET(BASE_URL+"auth/driver/oneClickLogin")
|
||||
fun oneClickLogin(@Query("token") token : String) :Observable<CommonResponseBean<UserBean>>
|
||||
@GET(BASE_URL + "auth/driver/oneClickLogin")
|
||||
fun oneClickLogin(@Query("token") token: String): Observable<CommonResponseBean<UserBean>>
|
||||
|
||||
|
||||
/**
|
||||
@ -175,7 +176,7 @@ interface Api {
|
||||
* @param upPart UpPart
|
||||
* @return Observable<CommonResponseBean<String>>
|
||||
*/
|
||||
@POST(BASE_URL+"driver/driver/submitToCpcAuthentication")
|
||||
@POST(BASE_URL + "driver/driver/submitToCpcAuthentication")
|
||||
fun submitToCpcAuthentication(@Body upPart: UpPart): Observable<CommonResponseBean<Any>>
|
||||
|
||||
/**
|
||||
@ -183,7 +184,7 @@ interface Api {
|
||||
* @param upPart UpPart
|
||||
* @return Observable<CommonResponseBean<String>>
|
||||
*/
|
||||
@GET(BASE_URL+"driver/driver/getCpcAuthenticationInfo")
|
||||
@GET(BASE_URL + "driver/driver/getCpcAuthenticationInfo")
|
||||
fun getCpcAuthenticationInfo(): Observable<CommonResponseBean<UpPart>>
|
||||
|
||||
|
||||
@ -235,8 +236,8 @@ interface Api {
|
||||
* @param upRate UpRate
|
||||
* @return Observable<CommonResponseBean<Any>>
|
||||
*/
|
||||
@POST(BASE_URL+"driver/opinions/submitComments")
|
||||
fun submitComments(@Body upRate: UpRate):Observable<CommonResponseBean<Any>>
|
||||
@POST(BASE_URL + "driver/opinions/submitComments")
|
||||
fun submitComments(@Body upRate: UpRate): Observable<CommonResponseBean<Any>>
|
||||
|
||||
|
||||
/**
|
||||
@ -359,6 +360,22 @@ interface Api {
|
||||
fun getCaptainById(@Query("captainId") captainId: String): Observable<CommonResponseBean<CaptainBean>>
|
||||
|
||||
|
||||
/**
|
||||
* 查询运单评价信息列表
|
||||
* opinionsType 评价类型(0=司机评价,1=货主评价)
|
||||
* @return Observable<CommonResponseBean<CaptainBean>>
|
||||
*/
|
||||
@GET(BASE_URL + "driver/opinions/list")
|
||||
fun waybillRate(@Query("opinionsType") opinionsType : String): Observable<CommonResponseBean<MutableList<RateBean>>>
|
||||
|
||||
/**
|
||||
* 查询司机总评价信息
|
||||
* @return Observable<CommonResponseBean<CaptainBean>>
|
||||
*/
|
||||
@GET(BASE_URL + "driver/opinions/getDriverOpinionsStatInfo")
|
||||
fun driverRate(): Observable<CommonResponseBean<RateBean>>
|
||||
|
||||
|
||||
companion object {
|
||||
// String BASE_URL = "https://tmstest.dahehuoyun.com/";
|
||||
const val BASE_URL = BuildConfig.BASE_URL
|
||||
|
@ -74,10 +74,19 @@ class CodeLoginActivity : BaseActivity<ActivityCodeBinding>(), View.OnClickListe
|
||||
override fun onSuccess(t: CommonResponseBean<UserBean>) {
|
||||
super.onSuccess(t)
|
||||
SPUtils.instance.setUserInfo(mContext, Gson().toJson(t.data))
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
HomeActivity::class.java
|
||||
)
|
||||
if (t.data.isCarCaptain == "9") {//是否是车队长(0=否,1=是,9=未选择)
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
SelectRoleActivity::class.java
|
||||
)
|
||||
} else {
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
HomeActivity::class.java
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
ActivityUtils.finishToActivity(LoginActivity::class.java, true)
|
||||
}
|
||||
}))
|
||||
|
@ -28,17 +28,17 @@ class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
|
||||
binding.rlPerson.setOnClickListener {
|
||||
|
||||
|
||||
ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||
|
||||
// DataManager.getInstance().setUpDriverRole("0")
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>(this) {
|
||||
// override fun onSuccess(t: CommonResponseBean<String>) {
|
||||
// super.onSuccess(t)
|
||||
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||
// }
|
||||
// }))
|
||||
DataManager.getInstance().setUpDriverRole("0")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>(this) {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||
super.onSuccess(t)
|
||||
ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||
}
|
||||
}))
|
||||
|
||||
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import com.dahe.gldriver.ui.mine.activity.CarTeamActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.CarsManActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.DriverTeamsActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.RateManActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.WalletActivity
|
||||
import com.dahe.gldriver.utils.SPUtils
|
||||
import com.dahe.mylibrary.base.BaseFragment
|
||||
@ -136,7 +137,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener {
|
||||
}
|
||||
|
||||
3 -> {
|
||||
ToastUtils.showToast(mContext, tools[pos].title)
|
||||
ActivityUtils.startActivity(mContext,RateManActivity::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
@ -156,11 +157,11 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener {
|
||||
}
|
||||
|
||||
2 -> {
|
||||
ToastUtils.showToast(mContext, tools[pos].title)
|
||||
ToastUtils.showToast(mContext, plats[pos].title)
|
||||
}
|
||||
|
||||
3 -> {
|
||||
ToastUtils.showToast(mContext, tools[pos].title)
|
||||
ToastUtils.showToast(mContext, plats[pos].title)
|
||||
}
|
||||
|
||||
4 -> {
|
||||
@ -168,11 +169,11 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener {
|
||||
}
|
||||
|
||||
5 -> {
|
||||
ToastUtils.showToast(mContext, tools[pos].title)
|
||||
ToastUtils.showToast(mContext, plats[pos].title)
|
||||
}
|
||||
|
||||
6 -> {
|
||||
ToastUtils.showToast(mContext, tools[pos].title)
|
||||
ToastUtils.showToast(mContext, plats[pos].title)
|
||||
}
|
||||
|
||||
7 -> {
|
||||
|
@ -0,0 +1,154 @@
|
||||
package com.dahe.gldriver.ui.mine.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.adapter.PagersAdapter
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.gldriver.databinding.ActivityRateManBinding
|
||||
import com.dahe.gldriver.net.BaseObserver
|
||||
import com.dahe.gldriver.net.DataManager
|
||||
import com.dahe.gldriver.net.RxHttpCallBack
|
||||
import com.dahe.gldriver.ui.mine.fragment.CarsManFragment
|
||||
import com.dahe.gldriver.ui.mine.fragment.DriversManFragment
|
||||
import com.dahe.gldriver.ui.mine.fragment.RateFragment
|
||||
import com.dahe.gldriver.utils.SPUtils
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.PhoneFormatCheckUtils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import net.lucode.hackware.magicindicator.FragmentContainerHelper
|
||||
import net.lucode.hackware.magicindicator.buildins.UIUtil
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView
|
||||
|
||||
/**
|
||||
* @ClassName RateManActivity
|
||||
* @Author john
|
||||
* @Date 2024/3/18 08:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class RateManActivity : BaseActivity<ActivityRateManBinding>() {
|
||||
|
||||
private val mFragmentContainerHelper = FragmentContainerHelper()
|
||||
var mFragments = mutableListOf<Fragment>()
|
||||
val titles = mutableListOf(
|
||||
"收到的评价", "发表的评价"
|
||||
)
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("评价管理", true)
|
||||
|
||||
mFragments.run {
|
||||
add(RateFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putInt(AppConfig.RATE_TYPE, 0)
|
||||
}
|
||||
})
|
||||
add(RateFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putInt(AppConfig.RATE_TYPE, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var pagerAdapter = PagersAdapter(this, mFragments)
|
||||
|
||||
|
||||
mFragmentContainerHelper.handlePageSelected(0, true)
|
||||
|
||||
binding.viewPager.adapter = pagerAdapter
|
||||
binding.viewPager.currentItem = 0
|
||||
binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
mFragmentContainerHelper.handlePageSelected(position, true)
|
||||
}
|
||||
});
|
||||
|
||||
var commonNavigator = CommonNavigator(mContext)
|
||||
commonNavigator.run {
|
||||
isAdjustMode = true
|
||||
adapter = object : CommonNavigatorAdapter() {
|
||||
override fun getCount(): Int {
|
||||
return titles.size
|
||||
}
|
||||
|
||||
override fun getTitleView(context: Context?, index: Int): IPagerTitleView {
|
||||
val colorTransitionPagerTitleView = ColorTransitionPagerTitleView(context)
|
||||
colorTransitionPagerTitleView.normalColor = Color.BLACK
|
||||
colorTransitionPagerTitleView.selectedColor = Color.RED
|
||||
colorTransitionPagerTitleView.text = titles[index]
|
||||
colorTransitionPagerTitleView.setOnClickListener {
|
||||
mFragmentContainerHelper.handlePageSelected(index)
|
||||
switchPages(index)
|
||||
}
|
||||
return colorTransitionPagerTitleView
|
||||
}
|
||||
|
||||
override fun getIndicator(context: Context?): IPagerIndicator {
|
||||
val indicator = LinePagerIndicator(context)
|
||||
indicator.mode = LinePagerIndicator.MODE_WRAP_CONTENT
|
||||
indicator.yOffset = UIUtil.dip2px(context, 3.0).toFloat()
|
||||
indicator.setColors(Color.RED)
|
||||
return indicator
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
binding.magicIndicator.navigator = commonNavigator
|
||||
mFragmentContainerHelper.attachMagicIndicator(binding.magicIndicator)
|
||||
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
val userInfo = SPUtils.instance.getUserInfo(mContext)
|
||||
if (userInfo != null) {
|
||||
binding.run {
|
||||
tvName.text = userInfo.idcardName
|
||||
ImageLoader.getInstance()
|
||||
.loadCircleImage(mContext, userInfo.avatar, ivHead, R.drawable.head_defaut)
|
||||
}
|
||||
}
|
||||
DataManager.getInstance().driverRate().subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<RateBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<RateBean>) {
|
||||
super.onSuccess(t)
|
||||
t.data?.let {
|
||||
binding.run {
|
||||
tvRating.text = if (it.positiveReviewRate.isNullOrEmpty()) "0%" else """${(it.positiveReviewRate.toInt() * 100)}%"""
|
||||
pbOne.progress =
|
||||
if (it.numberOfEvaluations1.isNullOrEmpty()) 0 else (it.numberOfEvaluations1.toInt() * 100 / it.totalNumberOfOrders.toInt())
|
||||
|
||||
pbTwo.progress =
|
||||
if (it.numberOfEvaluations2.isNullOrEmpty()) 0 else (it.numberOfEvaluations2.toInt() * 100 / it.totalNumberOfOrders.toInt())
|
||||
|
||||
pbThree.progress =
|
||||
if (it.numberOfEvaluations3.isNullOrEmpty()) 0 else (it.numberOfEvaluations3.toInt() * 100 / it.totalNumberOfOrders.toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun switchPages(index: Int) {
|
||||
binding.viewPager.currentItem = index
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.dahe.gldriver.ui.mine.fragment
|
||||
|
||||
import android.graphics.Color
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.adapter.DriversAdapter
|
||||
import com.dahe.gldriver.adapter.RateAdapter
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.gldriver.databinding.FragmentWaybillListBinding
|
||||
import com.dahe.gldriver.net.BaseObserver
|
||||
import com.dahe.gldriver.net.DataManager
|
||||
import com.dahe.gldriver.net.RxHttpCallBack
|
||||
import com.dahe.gldriver.ui.mine.InviteDriverActivity
|
||||
import com.dahe.mylibrary.base.BaseFragment
|
||||
import com.dahe.mylibrary.callback.RefreshCallBack
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ConvertUtils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
|
||||
/**
|
||||
* @ClassName RateFragment
|
||||
* @Author john
|
||||
* @Date 2024/3/18 09:34
|
||||
* @Description TODO
|
||||
*/
|
||||
class RateFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack {
|
||||
var rateType: Int = 0
|
||||
|
||||
lateinit var adapter: RateAdapter
|
||||
override fun onFragmentVisibleChange(isVisible: Boolean) {
|
||||
}
|
||||
|
||||
override fun onFragmentFirstVisible() {
|
||||
setRefresh(binding.refresh,this)
|
||||
arguments?.let {
|
||||
rateType = it.getInt(AppConfig.RATE_TYPE, 0)
|
||||
}
|
||||
|
||||
adapter = binding.recyclerView.run {
|
||||
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
|
||||
addItemDecoration(
|
||||
RecycleViewDivider(
|
||||
LinearLayout.VERTICAL,
|
||||
ConvertUtils.dp2px(16.0f),
|
||||
Color.TRANSPARENT
|
||||
)
|
||||
)
|
||||
adapter = RateAdapter()
|
||||
adapter as RateAdapter
|
||||
}.apply {
|
||||
isStateViewEnable = true
|
||||
}
|
||||
|
||||
binding.btnOk.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, InviteDriverActivity::class.java)
|
||||
}
|
||||
initData()
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
DataManager.getInstance().waybillRate(rateType.toString())
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<RateBean>>() {
|
||||
override fun onSuccess(t: CommonResponseBean<MutableList<RateBean>>) {
|
||||
super.onSuccess(t)
|
||||
if (t.data ==null || t.data.size == 0) {
|
||||
adapter.submitList(null)
|
||||
adapter.setStateViewLayout(mContext, R.layout.empty_view)
|
||||
} else {
|
||||
adapter?.submitList(t.data)
|
||||
}
|
||||
setFinishRefresh(
|
||||
binding.refresh,
|
||||
t.total > mRefreshPage * mRefreshCount
|
||||
)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
|
||||
initData()
|
||||
}
|
||||
}
|
@ -64,10 +64,18 @@ class OneKeyLoginUtils private constructor() {
|
||||
super.onSuccess(t)
|
||||
mPhoneNumberAuthHelper.quitLoginPage()
|
||||
SPUtils.instance.setUserInfo(context, Gson().toJson(t.data))
|
||||
ActivityUtils.startActivity(
|
||||
context,
|
||||
HomeActivity::class.java
|
||||
)
|
||||
|
||||
if (t.data.isCarCaptain == "9") {//是否是车队长(0=否,1=是,9=未选择)
|
||||
ActivityUtils.startActivity(
|
||||
context,
|
||||
SelectRoleActivity::class.java
|
||||
)
|
||||
} else {
|
||||
ActivityUtils.startActivity(
|
||||
context,
|
||||
HomeActivity::class.java
|
||||
)
|
||||
}
|
||||
ActivityUtils.finishToActivity(LoginActivity::class.java,true)
|
||||
}
|
||||
}))
|
||||
|
245
app/src/main/res/layout/activity_rate_man.xml
Normal file
245
app/src/main/res/layout/activity_rate_man.xml
Normal file
@ -0,0 +1,245 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<include layout="@layout/common_toolbar"></include>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/dp_12">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHead"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:background="@drawable/head_defaut" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_8">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
tools:text="王师傅的车队"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:id="@+id/tvStatu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_6"
|
||||
android:paddingLeft="@dimen/dp_4"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:text="好评率低于90%将影响成交"
|
||||
android:textColor="#FF4A02"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRating"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100%"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_30" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="运单好评率%"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:background="@color/color_e5" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_weight="2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:layout_marginRight="@dimen/dp_24"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="好评"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbOne"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
android:indeterminateTint="@color/color_F5"
|
||||
android:progress="100"
|
||||
android:progressTint="@color/main_red"></ProgressBar>
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvOne"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:layout_marginRight="@dimen/dp_24"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="中评"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbTwo"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
android:indeterminateTint="@color/color_F5"
|
||||
android:progress="0"
|
||||
android:progressTint="@color/main_red"></ProgressBar>
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvTwo"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
android:layout_marginRight="@dimen/dp_24"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="差评"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbThree"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
android:indeterminateTint="@color/color_F5"
|
||||
android:progress="0"
|
||||
android:progressTint="@color/main_red"></ProgressBar>
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvThree"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/magicIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@color/white" />
|
||||
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/llTop"
|
||||
android:layout_marginTop="@dimen/dp_12" />
|
||||
|
||||
|
||||
</LinearLayout>
|
125
app/src/main/res/layout/item_rate.xml
Normal file
125
app/src/main/res/layout/item_rate.xml
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_bg8"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dp_12">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="评价:"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<me.zhanghai.android.materialratingbar.MaterialRatingBar
|
||||
android:id="@+id/rating"
|
||||
style="@style/Widget.MaterialRatingBar.RatingBar"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_marginLeft="@dimen/dp_6"
|
||||
android:numStars="5"
|
||||
android:stepSize="1"
|
||||
android:isIndicator="true"
|
||||
app:mrb_fillBackgroundStars="true"
|
||||
app:mrb_progressTint="@color/main_red"
|
||||
app:mrb_secondaryProgressTint="@color/main_red" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvStatu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:layout_toRightOf="@+id/tvName"
|
||||
android:background="@drawable/shape_orange_5"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:text="好评"
|
||||
android:textColor="#FF4A02"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2023-12-19"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:text="运输很有效率,按时到达卸货点,并按照要求上 传卸货照片和卸货回单。给司机师傅点赞!"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:background="@color/color_c"
|
||||
android:layout_marginTop="@dimen/dp_14" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHead"
|
||||
android:layout_width="@dimen/dp_41"
|
||||
android:layout_height="@dimen/dp_41"
|
||||
android:background="@drawable/head_defaut" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvComName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:text="安徽东阳矿业科技有限公司"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/imgHead"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_toRightOf="@+id/imgHead"
|
||||
android:text="交易 200 好评率80%"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_12"></TextView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user