常用工具->司机课堂,评价管理
This commit is contained in:
parent
5a8ee8afc6
commit
125722c03d
@ -188,6 +188,32 @@
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".ui.mine.activity.QuesActivity"
|
||||
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.activity.ComProDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.mine.activity.QueDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".ui.mine.activity.ChoiceFleetActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
|
31
app/src/main/java/com/dhsd/glowner/adapter/PagersAdapter.kt
Normal file
31
app/src/main/java/com/dhsd/glowner/adapter/PagersAdapter.kt
Normal file
@ -0,0 +1,31 @@
|
||||
package com.dhsd.glowner.adapter
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName PagersAdapter
|
||||
* @Author john
|
||||
* @Date 2024/2/7 10:26
|
||||
* @Description TODO
|
||||
*/
|
||||
class PagersAdapter(fragmentActivity: FragmentActivity,list:MutableList<Fragment>) : FragmentStateAdapter(fragmentActivity) {
|
||||
private var fragmentList : MutableList<Fragment> =ArrayList()
|
||||
init {
|
||||
this.fragmentList = list
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return fragmentList.size
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return fragmentList[position]
|
||||
}
|
||||
|
||||
fun addFragment(fragment: Fragment){
|
||||
fragmentList.add(fragment)
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.dhsd.glowner.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import com.chad.library.adapter4.BaseQuickAdapter
|
||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||
import com.dahe.gldriver.bean.QuestionBean
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dhsd.glowner.R
|
||||
|
||||
/**
|
||||
* @ClassName QuestionAdatper
|
||||
* @Author john
|
||||
* @Date 2024/3/25 17:04
|
||||
* @Description TODO
|
||||
*/
|
||||
class QuestionAdatper : BaseQuickAdapter<QuestionBean, QuickViewHolder>() {
|
||||
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: QuestionBean?) {
|
||||
holder.run {
|
||||
setText(R.id.tvTitle, item?.classroomName)
|
||||
setText(R.id.tvDate, item?.updateTime)
|
||||
ImageLoader.getInstance().loadImage(context,item?.classroomUrl,getView(R.id.ivBg))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
context: Context,
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
) = QuickViewHolder(R.layout.item_question, parent)
|
||||
}
|
48
app/src/main/java/com/dhsd/glowner/adapter/RateAdapter.kt
Normal file
48
app/src/main/java/com/dhsd/glowner/adapter/RateAdapter.kt
Normal file
@ -0,0 +1,48 @@
|
||||
package com.dhsd.glowner.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter4.BaseQuickAdapter
|
||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dhsd.glowner.R
|
||||
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.shipperTransactionVolume} 好评率${item.shipperPositiveReviewRate.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)
|
||||
}
|
||||
}
|
@ -20,5 +20,6 @@ object AppConfig {
|
||||
const val PWD = "DA_HE_PHONE"
|
||||
const val CODE = "DA_HE_PHONE"
|
||||
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"
|
||||
const val RATE_TYPE = "DA_HE_RATE_TYPE"//0:收到的评价 1:发表的评价
|
||||
|
||||
}
|
@ -83,3 +83,50 @@ data class Material(
|
||||
var materialUrl: String="",
|
||||
var sortValue: String=""
|
||||
)
|
||||
|
||||
data class QuestionBean(
|
||||
val classroomDesc: String,
|
||||
val classroomId: String,
|
||||
val classroomName: String,
|
||||
val classroomUrl: String,
|
||||
val createTime: String,
|
||||
val isRecommend: String,
|
||||
val isTop: String,
|
||||
val sortValue: String,
|
||||
val status: String,
|
||||
val updateTime: String
|
||||
)
|
||||
|
||||
data class QueDetail(
|
||||
val classroomId: String,
|
||||
val contentData: String
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
)
|
||||
|
@ -1,4 +1,7 @@
|
||||
import com.dahe.gldriver.bean.ProBean
|
||||
import com.dahe.gldriver.bean.QueDetail
|
||||
import com.dahe.gldriver.bean.QuestionBean
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.gldriver.bean.UpPart
|
||||
import com.dahe.glex.bean.*
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
@ -217,4 +220,36 @@ interface Api {
|
||||
*/
|
||||
@GET(BASE_URL + "driver/app/info/getLastAppVersion")
|
||||
fun getLastAppVersion(): Observable<CommonResponseBean<AppVersion>>
|
||||
|
||||
|
||||
/**
|
||||
* 安全课堂列表
|
||||
* @return Observable<CommonResponseBean<AppVersion>>
|
||||
*/
|
||||
@GET(BASE_URL + "driver/app/info/safeClassroomList")
|
||||
fun safeClassroomList(): Observable<CommonResponseBean<MutableList<QuestionBean>>>
|
||||
|
||||
/**
|
||||
* 安全课堂详情
|
||||
* @param problemId String
|
||||
* @return Observable<CommonResponseBean<QueDetail>>
|
||||
*/
|
||||
@GET(BASE_URL + "driver/app/info/safeClassroomDetail")
|
||||
fun safeClassroomDetail(@Query("classroomId") problemId: String): Observable<CommonResponseBean<QueDetail>>
|
||||
|
||||
|
||||
/**
|
||||
* 查询运单评价信息列表
|
||||
* 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>>
|
||||
}
|
@ -24,6 +24,8 @@ import com.dhsd.glowner.databinding.FragmentMineBinding
|
||||
import com.dhsd.glowner.ui.WebActivity
|
||||
import com.dhsd.glowner.ui.mine.activity.AuthPartyActivity
|
||||
import com.dhsd.glowner.ui.mine.activity.ComProActivity
|
||||
import com.dhsd.glowner.ui.mine.activity.QuesActivity
|
||||
import com.dhsd.glowner.ui.mine.activity.RateManActivity
|
||||
import com.dhsd.glowner.ui.mine.activity.RulesActivity
|
||||
import com.dhsd.glowner.ui.mine.activity.SettingActivity
|
||||
import com.dhsd.glowner.utils.AppVersionUtils
|
||||
@ -119,6 +121,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
|
||||
}
|
||||
|
||||
2 -> {
|
||||
ActivityUtils.startActivity(mContext, QuesActivity::class.java)
|
||||
// var bundle = Bundle()
|
||||
// bundle.putString("title","我的百度")
|
||||
// bundle.putString("url","www.baidu.com")
|
||||
@ -127,7 +130,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
|
||||
}
|
||||
|
||||
3 -> {
|
||||
ToastUtils.showToast(mContext, tools[pos].title)
|
||||
ActivityUtils.startActivity(mContext, RateManActivity::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
|
87
app/src/main/java/com/dhsd/glowner/ui/mine/RateFragment.kt
Normal file
87
app/src/main/java/com/dhsd/glowner/ui/mine/RateFragment.kt
Normal file
@ -0,0 +1,87 @@
|
||||
package com.dhsd.glowner.ui.mine
|
||||
|
||||
import BaseObserver
|
||||
import RxHttpCallBack
|
||||
import android.graphics.Color
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
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 com.dhsd.glowner.R
|
||||
import com.dhsd.glowner.adapter.RateAdapter
|
||||
import com.dhsd.glowner.databinding.FragmentWaybillList2Binding
|
||||
import com.dhsd.glowner.databinding.FragmentWaybillListBinding
|
||||
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<FragmentWaybillList2Binding>(), 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()
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.dhsd.glowner.ui.mine.activity
|
||||
|
||||
import BaseObserver
|
||||
import RxHttpCallBack
|
||||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
import android.webkit.WebView
|
||||
import android.widget.FrameLayout
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.QueDetail
|
||||
import com.dahe.gldriver.bean.QuestionBean
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dhsd.glowner.R
|
||||
import com.dhsd.glowner.databinding.ActivityQueDetailBinding
|
||||
import com.google.gson.Gson
|
||||
import com.just.agentweb.AgentWeb
|
||||
import com.just.agentweb.AgentWebUIControllerImplBase
|
||||
import com.just.agentweb.WebChromeClient
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
|
||||
/**
|
||||
* @ClassName ComProActivity
|
||||
* @Author john
|
||||
* @Date 2024/3/25 16:42
|
||||
* @Description 安全课堂详情
|
||||
*/
|
||||
class QueDetailActivity : BaseActivity<ActivityQueDetailBinding>() {
|
||||
private var mAgentWeb: AgentWeb? = null
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("安全课堂", true)
|
||||
mAgentWeb = AgentWeb.with(this)
|
||||
.setAgentWebParent(binding.WebViewLayout, FrameLayout.LayoutParams(-1, -1))
|
||||
.useDefaultIndicator()
|
||||
.setWebChromeClient(mWebChromeClient)
|
||||
.setSecurityType(AgentWeb.SecurityType.DEFAULT_CHECK)
|
||||
.setAgentWebUIController(AgentWebUIControllerImplBase())
|
||||
.createAgentWeb()
|
||||
.ready()
|
||||
.go("")
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
var proBean = Gson().fromJson<QuestionBean>(intent.extras?.getString(AppConfig.BEAN), QuestionBean::class.java)
|
||||
|
||||
|
||||
DataManager.getInstance().safeClassroomDetail(proBean.classroomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<QueDetail>() {
|
||||
override fun onSuccess(t: CommonResponseBean<QueDetail>) {
|
||||
super.onSuccess(t)
|
||||
binding.run {
|
||||
// tvContent.text = Html.fromHtml(t.data.contentData)
|
||||
mAgentWeb?.webCreator?.webView?.loadDataWithBaseURL(null,t.data.contentData,"text/html" , "utf-8", null)
|
||||
}
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
private val mWebChromeClient: WebChromeClient = object : WebChromeClient() {
|
||||
override fun onProgressChanged(view: WebView, newProgress: Int) {
|
||||
super.onProgressChanged(view, newProgress)
|
||||
}
|
||||
|
||||
override fun onReceivedTitle(view: WebView, title: String) {
|
||||
super.onReceivedTitle(view, title)
|
||||
// setTitleBar(
|
||||
// if (TextUtils.isEmpty(mTitle)) title else mTitle
|
||||
// ) { if (!mAgentWeb!!.back()) finish() }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.dhsd.glowner.ui.mine.activity
|
||||
|
||||
import BaseObserver
|
||||
import RxHttpCallBack
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.QuestionBean
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
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 com.dhsd.glowner.R
|
||||
import com.dhsd.glowner.adapter.QuestionAdatper
|
||||
import com.dhsd.glowner.databinding.ActivityQuesBinding
|
||||
import com.google.gson.Gson
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
|
||||
/**
|
||||
* @ClassName QuesActivity
|
||||
* @Author john
|
||||
* @Date 2024/3/27 16:00
|
||||
* @Description 安全课堂
|
||||
*/
|
||||
class QuesActivity : BaseActivity<ActivityQuesBinding>() {
|
||||
|
||||
lateinit var adapter: QuestionAdatper
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("安全课堂", true)
|
||||
|
||||
binding.run {
|
||||
adapter = recycler.run {
|
||||
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
|
||||
addItemDecoration(
|
||||
RecycleViewDivider(
|
||||
LinearLayout.VERTICAL,
|
||||
ConvertUtils.dp2px(10.0f),
|
||||
Color.TRANSPARENT
|
||||
)
|
||||
)
|
||||
adapter = QuestionAdatper()
|
||||
adapter as QuestionAdatper
|
||||
}.apply {
|
||||
setOnItemClickListener { _, _, position ->
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
QueDetailActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.BEAN, Gson().toJson(items[position]))
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
DataManager.getInstance().safeClassroomList()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<QuestionBean>>() {
|
||||
override fun onSuccess(t: CommonResponseBean<MutableList<QuestionBean>>) {
|
||||
super.onSuccess(t)
|
||||
adapter.submitList(t.data)
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package com.dhsd.glowner.ui.mine.activity
|
||||
|
||||
import BaseObserver
|
||||
import RxHttpCallBack
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.RateBean
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dhsd.glowner.R
|
||||
import com.dhsd.glowner.adapter.PagersAdapter
|
||||
import com.dhsd.glowner.databinding.ActivityRateManBinding
|
||||
import com.dhsd.glowner.ui.mine.RateFragment
|
||||
import com.dhsd.glowner.utils.SPUtils
|
||||
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 评价管理
|
||||
*/
|
||||
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.userName
|
||||
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
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/bg_que.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/bg_que.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 226 KiB |
27
app/src/main/res/layout/activity_que_detail.xml
Normal file
27
app/src/main/res/layout/activity_que_detail.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?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:background="@color/color_F5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/common_toolbar"></include>
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tvContent"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_12"-->
|
||||
<!-- android:padding="@dimen/dp_12"-->
|
||||
<!-- />-->
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/WebViewLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_12">
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
25
app/src/main/res/layout/activity_ques.xml
Normal file
25
app/src/main/res/layout/activity_ques.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?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:background="@color/color_F5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/common_toolbar"></include>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_170"
|
||||
android:background="@drawable/bg_que" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
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>
|
44
app/src/main/res/layout/fragment_waybill_list2.xml
Normal file
44
app/src/main/res/layout/fragment_waybill_list2.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?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:background="@color/color_F5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_12"></androidx.recyclerview.widget.RecyclerView>
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/llOk"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnOk"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_btn"
|
||||
android:text="邀请队员"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17">
|
||||
|
||||
</Button>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
59
app/src/main/res/layout/item_question.xml
Normal file
59
app/src/main/res/layout/item_question.xml
Normal file
@ -0,0 +1,59 @@
|
||||
<?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="wrap_content"
|
||||
android:background="@drawable/shape_bg8"
|
||||
android:gravity="center_vertical"
|
||||
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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBg"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:background="@color/color_c" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:maxLines="2"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:text="安全提示"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:lines="1"
|
||||
android:text="2023年10月3日"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</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>
|
@ -99,6 +99,9 @@ dependencies {
|
||||
api 'com.github.jenly1314.AppUpdater:app-updater:1.2.0'
|
||||
api 'com.github.jenly1314.AppUpdater:app-dialog:1.2.0'
|
||||
|
||||
//评价星星
|
||||
api 'me.zhanghai.android.materialratingbar:library:1.4.0'
|
||||
|
||||
|
||||
// api 'com.gyf.cactus:cactus:1.1.3-beta13'
|
||||
|
||||
|
@ -12,6 +12,15 @@ public class CommonResponseBean<T> implements Serializable {
|
||||
private int code;
|
||||
private String msg;
|
||||
|
||||
private int total;
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
|
Loading…
Reference in New Issue
Block a user