唐浩
1 天以前 3d631dbadf98f3f77c6e955cb36219217ef73ab5
app/src/main/java/com/ziang/driver/ui/adapter/OrderHallAdapter.kt
@@ -27,7 +27,6 @@
        return R.layout.item_hall
    }
    private val audioRecoderUtils by lazy { AudioRecoderUtils() }
    override fun onBindItem(holder: BaseViewHolder?, view: View?, item: OrderHall) {
        holder?.let {
@@ -49,19 +48,20 @@
                )
                it.itemView.tv_play.visible()
                it.itemView.tv_play.setOnClickListener {
                    val intent = Intent(context, VoiceOrderFragment::class.java)
                    intent.putExtra("audio", item.audioLinkUrl)
                    intent.putExtra("orderId", item.id)
                    intent.putExtra("orderType", item.type.toString())
                    intent.putExtra("time", item.audioTime.toInt()+3)
                    intent.putExtra("type", 1)
                    intent.putExtra("needPlayRing", false)
                    intent.putExtra("fromList", true)
                    context.startActivity(intent)
                    AudioRecoderUtils.getInstance().startplayMusic(context, item.audioLinkUrl)
//                    val intent = Intent(context, VoiceOrderFragment::class.java)
//                    intent.putExtra("audio", item.audioLinkUrl)
//                    intent.putExtra("orderId", item.id)
//                    intent.putExtra("orderType", item.type.toString())
//                    intent.putExtra("time", item.audioTime.toInt()+3)
//                    intent.putExtra("type", 1)
//                    intent.putExtra("needPlayRing", false)
//                    intent.putExtra("fromList", true)
//                    context.startActivity(intent)
                }
            }
            it.itemView.tv_action.setOnClickListener {
                getOrder(item.id, item.type, context, !item.audioLinkUrl.isNullOrEmpty())
                getOrder(item,item.id, item.type, context, !item.audioLinkUrl.isNullOrEmpty())
            }
            val l = TimeUtils.parseTimeMillisecond(item.endTime) - System.currentTimeMillis()
            it.itemView.tv_timer.text = if (l>0) "%02d:%02d".format(
@@ -71,7 +71,7 @@
        }
    }
    private fun getOrder(orderId: String, orderType: Int, context: Context, isCall: Boolean) {
    private fun getOrder( item: OrderHall,orderId: String, orderType: Int, context: Context, isCall: Boolean) {
        var map = getMapByAny()
        map["orderId"] = orderId
        map["orderType"] = orderType
@@ -82,7 +82,7 @@
                    "orderId" to orderId,
                    "orderType" to orderType.toString()
                )
                audioRecoderUtils.stopPlayMusic()
                AudioRecoderUtils.getInstance().stopPlayMusic()
            }else{
                when (orderType) {
                    2 -> {
@@ -105,7 +105,9 @@
                    }
                }
            }
            (context as OrderHallActivity).finish()
            data.remove(item)
            notifyDataSetChanged()
//            (context as OrderHallActivity).finish()
        }
    }