中建365-优化/bug修复
parent
e4ad478c07
commit
5c35bc4bbb
@ -0,0 +1 @@
|
|||||||
|
package com.xty.base.model;
import android.text.TextUtils;
import java.util.Map;
public class PayBaseResult {
private String resultStatus;
private String result;
private String memo;
public PayBaseResult(Map<String, String> rawResult) {
if (rawResult == null) {
return;
}
for (String key : rawResult.keySet()) {
if (TextUtils.equals(key, "resultStatus")) {
resultStatus = rawResult.get(key);
} else if (TextUtils.equals(key, "result")) {
result = rawResult.get(key);
} else if (TextUtils.equals(key, "memo")) {
memo = rawResult.get(key);
}
}
}
@Override
public String toString() {
return "resultStatus={" + resultStatus + "};memo={" + memo
+ "};result={" + result + "}";
}
/**
* @return the resultStatus
*/
public String getResultStatus() {
return resultStatus;
}
/**
* @return the memo
*/
public String getMemo() {
return memo;
}
/**
* @return the result
*/
public String getResult() {
return result;
}
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.xty.base.model
|
||||||
|
|
||||||
|
class WatchReChangeBean (
|
||||||
|
var orderId:String,
|
||||||
|
var pay_price:Float
|
||||||
|
){
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.xty.base.vm
|
||||||
|
|
||||||
|
import androidx.lifecycle.LifecycleObserver
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.xty.network.model.PayBean
|
||||||
|
import com.xty.network.model.RespBody
|
||||||
|
import org.json.JSONObject
|
||||||
|
|
||||||
|
class PayVm : BaseVm() , LifecycleObserver {
|
||||||
|
|
||||||
|
val payObservable by lazy { MutableLiveData<RespBody<PayBean>>() }
|
||||||
|
|
||||||
|
|
||||||
|
fun payWatch(orderNo:String,channelName:String){
|
||||||
|
startHttp {
|
||||||
|
var json = JSONObject()
|
||||||
|
json.put("orderNo", orderNo)
|
||||||
|
json.put("channelName", channelName)
|
||||||
|
|
||||||
|
var response = apiInterface().toPay(retrofits.getRequestBody(json.toString()))
|
||||||
|
response.getCodeStatus(payObservable, nowData)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,182 @@
|
|||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:background="@drawable/shape_radio_bg"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 顶部布局 -->
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_15"
|
||||||
|
android:paddingLeft="@dimen/dp_20"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
android:paddingRight="@dimen/dp_20">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/cancel_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:padding="@dimen/dp_6"
|
||||||
|
android:text="订单总金额"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_17"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<!-- 确定按钮 -->
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/close_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:padding="@dimen/dp_6"
|
||||||
|
android:src="@mipmap/ic_close"
|
||||||
|
tools:ignore="RtlHardcoded" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvPrice"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginBottom="@dimen/dp_27"
|
||||||
|
tools:text="68.8"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="@dimen/sp_20"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="ObsoleteLayoutParam" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="@dimen/dp_31"
|
||||||
|
android:paddingRight="@dimen/dp_31">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_18"
|
||||||
|
android:text="选择支付方式"
|
||||||
|
android:textColor="@color/col_C7C"
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llWeixin"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_18"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="@dimen/dp_10"
|
||||||
|
android:paddingBottom="@dimen/dp_10">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/ic_weixinzhif"
|
||||||
|
android:drawablePadding="@dimen/dp_9"
|
||||||
|
android:text="微信"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gouxuan_weixin"
|
||||||
|
android:layout_width="@dimen/dp_14"
|
||||||
|
android:layout_height="@dimen/dp_14"
|
||||||
|
android:background="@drawable/selector_zhifu" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llZhifu"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_18"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="@dimen/dp_10"
|
||||||
|
android:paddingBottom="@dimen/dp_10">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/ic_zhifubao"
|
||||||
|
android:drawablePadding="@dimen/dp_9"
|
||||||
|
android:text="支付宝"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gouxuan_zhifubao"
|
||||||
|
android:layout_width="@dimen/dp_14"
|
||||||
|
android:layout_height="@dimen/dp_14"
|
||||||
|
android:background="@drawable/selector_zhifu" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llDuihuan"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_85"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="@dimen/dp_10"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:paddingBottom="@dimen/dp_10">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableStart="@mipmap/ic_duihuanma"
|
||||||
|
android:drawablePadding="@dimen/dp_9"
|
||||||
|
android:text="兑换码"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="UseCompatTextViewDrawableXml" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gouxuan_duihuanma"
|
||||||
|
android:layout_width="@dimen/dp_14"
|
||||||
|
android:layout_height="@dimen/dp_14"
|
||||||
|
android:background="@drawable/selector_zhifu" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvZhifu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_marginTop="@dimen/dp_80"
|
||||||
|
android:layout_marginBottom="@dimen/dp_10"
|
||||||
|
android:background="@drawable/shape_button_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="确认支付"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_18" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,58 @@
|
|||||||
|
package com.zj365.health.act.familyhealth
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.xty.base.act.BaseListAct
|
||||||
|
import com.xty.common.arouter.ARouterUrl
|
||||||
|
import com.xty.network.model.FamilyHealthBean
|
||||||
|
import com.zj365.health.R
|
||||||
|
import com.zj365.health.adapter.familyhealth.FamilyHealthGuardianAdapter
|
||||||
|
import com.zj365.health.databinding.ActFamilyHealthGuardianBinding
|
||||||
|
import com.zj365.health.vm.FamilyHealthVm
|
||||||
|
|
||||||
|
@Route(path = ARouterUrl.FAMILY_GUARDIAN_LIST_ACT)
|
||||||
|
class FamilyHealthGuardianListAct : BaseListAct<FamilyHealthVm>() {
|
||||||
|
val binding by lazy { ActFamilyHealthGuardianBinding.inflate(layoutInflater) }
|
||||||
|
|
||||||
|
val adapter by lazy { FamilyHealthGuardianAdapter() }
|
||||||
|
override fun initAdapter() {
|
||||||
|
|
||||||
|
setRecycleRefresh(binding.recyclerView, binding.mRefresh, true)
|
||||||
|
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||||
|
binding.recyclerView.adapter = adapter
|
||||||
|
adapter.addChildClickViewIds(R.id.cb_frist, R.id.img_delete)
|
||||||
|
adapter.setOnItemChildClickListener { adapter, view, position ->
|
||||||
|
val familyHealthBean = adapter.data[position] as FamilyHealthBean
|
||||||
|
when (view.id) {
|
||||||
|
R.id.img_delete -> {
|
||||||
|
mViewModel.exitCustody(familyHealthBean.id.toString())
|
||||||
|
}
|
||||||
|
R.id.cb_frist->{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun initView() {
|
||||||
|
super.initView()
|
||||||
|
statusBar(binding.title.mView)
|
||||||
|
binding.title.mTvTitle.text = "监护人列表"
|
||||||
|
binding.title.mIvBack.setOnClickListener {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun loadData() {
|
||||||
|
mViewModel.getFamilyHealthGuardianList()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun liveObserver() {
|
||||||
|
mViewModel.familyGuardianLiveData.observe(this){
|
||||||
|
adapter.setNewInstance(it.data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setLayout()= binding.root
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.zj365.health.adapter.familyhealth
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.widget.CheckBox
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||||
|
import com.xty.base.adapter.BaseAdapter
|
||||||
|
import com.xty.common.setImageUser
|
||||||
|
import com.xty.network.model.FamilyGuardianBean
|
||||||
|
import com.zj365.health.R
|
||||||
|
import de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
|
||||||
|
class FamilyHealthGuardianAdapter : BaseAdapter<FamilyGuardianBean>(R.layout.item_health_family_guardian) {
|
||||||
|
override fun convert(holder: BaseViewHolder, item: FamilyGuardianBean) {
|
||||||
|
holder.getView<CircleImageView>(R.id.img_avatar).setImageUser(context,item.avatarUrl)
|
||||||
|
holder.setText(R.id.tv_relation,item.relation)
|
||||||
|
holder.setText(R.id.tv_phone,item.phone)
|
||||||
|
if(item.isFirst == 1){
|
||||||
|
holder.getView<CheckBox>(R.id.cb_frist).isChecked = true
|
||||||
|
holder.getView<TextView>(R.id.desc).setTextColor(Color.parseColor("#02C191"))
|
||||||
|
}else{
|
||||||
|
holder.getView<CheckBox>(R.id.cb_frist).isChecked = false
|
||||||
|
holder.getView<TextView>(R.id.desc).setTextColor(Color.parseColor("#7C7C7C"))
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/col_6f7">
|
||||||
|
|
||||||
|
<include layout="@layout/title_white_bar"
|
||||||
|
android:id="@+id/title"/>
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/mRefresh"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/col_f4f">
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/dp_3"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:layout_height="@dimen/dp_70">
|
||||||
|
|
||||||
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
android:id="@+id/img_avatar"
|
||||||
|
android:layout_width="@dimen/dp_49"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_height="@dimen/dp_49"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@+id/img_avatar"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginLeft="@dimen/dp_13"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_relation"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="大哥"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
android:textColor="@color/col_7c7"
|
||||||
|
android:id="@+id/tv_phone"
|
||||||
|
tools:text="13652458945"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_10"
|
||||||
|
android:layout_height="@dimen/dp_10"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:id="@+id/img_delete"
|
||||||
|
android:background="@mipmap/icon_close_delet"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="@dimen/dp_15"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/cb_frist"
|
||||||
|
android:layout_width="@dimen/dp_13"
|
||||||
|
android:layout_height="@dimen/dp_13"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_toLeftOf="@+id/desc"
|
||||||
|
android:layout_marginTop="@dimen/dp_5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:background="@drawable/selctor_check_niaosuan"
|
||||||
|
android:button="@null"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/desc"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="第一监护人"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_13"
|
||||||
|
android:layout_toLeftOf="@+id/img_delete"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.xty.network.model
|
||||||
|
|
||||||
|
data class FamilyGuardianBean(
|
||||||
|
var id:Long,
|
||||||
|
var userId:Long,
|
||||||
|
var name:String,
|
||||||
|
var phone:String,
|
||||||
|
var relation:String,
|
||||||
|
var avatarUrl:String,
|
||||||
|
var isMy:Int,
|
||||||
|
var isFirst:Int
|
||||||
|
) {
|
||||||
|
}
|
Loading…
Reference in New Issue