中建365-二期开发-商城开发

develop
wlh 1 year ago
parent 35996556a9
commit 1faf1b65e5

@ -342,6 +342,10 @@
android:launchMode="singleTop"
android:screenOrientation="portrait"/>
<activity android:name="com.zj365.mime.act.EnterpriseInformationForTypeAct"
android:launchMode="singleTop"
android:screenOrientation="portrait"/>
<activity android:name="com.xty.base.act.RichTextAct"
android:launchMode="singleTop"
android:screenOrientation="portrait"/>

@ -0,0 +1,56 @@
package com.zj365.dc.activity.shop
import android.view.View
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.zj365.dc.BuildConfig
import com.zj365.dc.databinding.ActCreateGoodsOrderBinding
import com.zj365.dc.vm.ShopMallVm
class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
val binding by lazy { ActCreateGoodsOrderBinding.inflate(layoutInflater) }
override fun liveObserver() {
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "创建订单"
binding.title.mIvBack.setOnClickListener {
finish()
}
onClickedListener()
}
fun onClickedListener(){
binding.tvPay.setOnClickListener {
}
binding.tvChooseAddress.setOnClickListener {
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=address&type=order"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
binding.tvDiscounts.setOnClickListener {
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=coupon&type=order"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
}
override fun setLayout()=binding.root
}

@ -10,7 +10,10 @@ import com.xty.base.act.BaseVmAct
import com.xty.common.Const
import com.xty.common.R
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.network.model.GoodsRecordsBean
import com.xty.network.model.ShopCategoryBean
import com.zj365.dc.BuildConfig
import com.zj365.dc.adapter.shop.ShopCategoryAdapter
import com.zj365.dc.adapter.shop.ShopChildCategoryAdapter
import com.zj365.dc.adapter.shop.ShopGoodsTwoAdapter
@ -73,6 +76,16 @@ class ShopCategoryActivity : BaseVmAct<ShopMallVm>() {
binding.mRefresh.finishLoadMore(1000)
}
mGoodsAdapter.setOnItemClickListener { adapter, view, position ->
var bean = adapter.data[position] as GoodsRecordsBean.GoodsBean
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=commodityDetail&id=${bean.id}"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
}
fun loadData(){

@ -127,7 +127,13 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=coupon"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
// CommonToastUtils.showToast("敬请期待")
}
}
@ -135,7 +141,13 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=wallet"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
// CommonToastUtils.showToast("敬请期待")
}
}
@ -195,7 +207,13 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=appreciation"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
// CommonToastUtils.showToast("敬请期待")
}
}
@ -203,7 +221,9 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
RouteManager.goAct(ARouterUrl.FAMILY_RECORD_ACT)
// CommonToastUtils.showToast("敬请期待")
}
}
@ -318,7 +338,13 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=address"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
// CommonToastUtils.showToast("敬请期待")
}
}
@ -326,7 +352,11 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
bundle.clear()
bundle.putString("title", "操作手册")
bundle.putBoolean("isAgree", false)
bundle.putString("url", "https://mp.weixin.qq.com/s?__biz=MzkxMzI0NzU3NA==&mid=2247487161&idx=1&sn=ed2fca4f04beb00b16f1b7e6c922d40a&chksm=c101d280f6765b967665df1c3e3c5cc609f1fcf7f0434c3bb26fbc13f7806cd9a2b37048f9e8#rd")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
}
@ -334,7 +364,8 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
RouteManager.goAct(ARouterUrl.SHOP_ORDER_LIST_ACT)
//CommonToastUtils.showToast("敬请期待")
}
}
@ -394,7 +425,7 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
private fun refresh() {
refresh.setRefresh(binding.mRefresh) {
mViewModel.getMySetting()
mViewModel.getUserEquity()
mViewModel.getAllInfo(showIdInfo,false)
mViewModel.searchInviteInfo()
}
@ -412,6 +443,8 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
mViewModel.getAllInfo(showIdInfo,false)
// mViewModel.getScore(1)
mViewModel.searchInviteInfo()
mViewModel.getUserEquity()
// }
}
@ -419,6 +452,9 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
/* mViewModel.familyLive.observe(this) {
binding.mFamily.text = it.data.size.toString()
}*/
mViewModel.userEqualityLiveData.observe(this){
binding.tvMemberValidity.text ="有效期至:${it.data}"
}
mViewModel.scoreLive.observe(this) {
binding.mIntegral.text = (if (it.data.num.isNullOrEmpty()) "0" else it.data.num!!)
}

@ -15,7 +15,9 @@ import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.util.CommonToastUtils
import com.xty.network.model.GoodsRecordsBean
import com.xty.network.model.ShopCategoryBean
import com.zj365.dc.BuildConfig
import com.zj365.dc.adapter.shop.ShopCategoryAdapter
import com.zj365.dc.adapter.shop.ShopGoodsAdapter
import com.zj365.dc.databinding.FragShopBinding
@ -47,6 +49,16 @@ class ShopFragment: BaseFragList<ShopMallVm>() {
}
setRecycleRefresh(binding.recyclerView,binding.mRefresh,true)
mGoodsAdapter.setOnItemClickListener { adapter, view, position ->
var bean = adapter.data[position] as GoodsRecordsBean.GoodsBean
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=commodityDetail&id=${bean.id}"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
}
override fun refresh() {

@ -13,6 +13,8 @@ class ShopMallVm : BaseVm() {
val goodsLiveData by lazy { MutableLiveData<RespBody<GoodsRecordsBean>>() }
val createOrderLiveData by lazy { MutableLiveData<RespBody<Any>>() }
fun getGoodsCategory(parentId:Long){
startHttp {
var code = apiInterface().getGoodsCategory(parentId)
@ -34,4 +36,18 @@ class ShopMallVm : BaseVm() {
code.getCodeStatus(goodsLiveData, nowData)
}
}
fun createOrder(skuId:String,num:Int,addrId:String,couponsId:String){
startHttp {
var json = JSONObject()
json.put("skuId",skuId)
json.put("num",num)
json.put("addrId",addrId)
json.put("couponsId",couponsId)
var code = apiInterface().createOrder(retrofits.getRequestBody(json.toString()))
code.getCodeStatus(createOrderLiveData, nowData)
}
}
}

@ -0,0 +1,251 @@
<?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:layout_height="match_parent"
android:background="@color/col_6f7">
<include layout="@layout/title_white_bar"
android:id="@+id/title"/>
<RelativeLayout
android:id="@+id/rx_address"
android:layout_below="@+id/title"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_62"
android:background="@drawable/shape_round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_14"
>
<TextView
android:id="@+id/tv_address_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收货地址"
android:textColor="@color/col_313"
android:textStyle="bold"
android:textSize="@dimen/sp_15"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_16"
/>
<TextView
android:id="@+id/tv_choose_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="请选择收货地址"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_16"
android:drawableRight="@mipmap/icon_arrow_right"
android:drawablePadding="@dimen/dp_5"
android:gravity="right"
android:maxLines="1"
android:ellipsize="end"
android:textColorHint="@color/col_6B6"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
android:layout_toRightOf="@+id/tv_address_desc"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rx_goods"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_135"
android:layout_below="@+id/rx_address"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_14"
android:background="@drawable/shape_round_white"
>
<com.ruffian.library.widget.RImageView
android:id="@+id/img_goods"
android:layout_width="@dimen/dp_96"
android:layout_height="@dimen/dp_96"
app:is_circle="false"
app:corner_radius="5dp"
android:scaleType="fitXY"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_16"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_96"
android:layout_toRightOf="@+id/img_goods"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_12"
android:layout_centerVertical="true">
<TextView
android:id="@+id/tv_goods_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
tools:text="健康智能手表血糖血脂尿酸风险评估长时间续健康智能手表血糖血脂尿酸风险评估长时间续航航"
android:maxLines="2"
android:ellipsize="end"/>
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_c7c"
android:layout_below="@+id/tv_goods_name"
android:layout_above="@+id/tv_price"
android:gravity="center"
tools:text="白色 "
/>
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_13"
android:layout_alignParentBottom="true"
tools:text="商品原价¥2860.00"
/>
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_13"
tools:text="数量1"
android:gravity="right"
android:layout_toRightOf="@+id/tv_price"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_150"
android:orientation="vertical"
android:layout_below="@+id/rx_goods"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_14"
android:paddingTop="@dimen/dp_22"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_16"
android:background="@drawable/shape_round_white">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="价格明细"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
android:textStyle="bold"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_26">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="平台优惠"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
android:textStyle="bold"/>
<TextView
android:id="@+id/tv_platform_discounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
tools:text="¥100"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_26">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="优惠券"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
android:textStyle="bold"/>
<TextView
android:id="@+id/tv_discounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
android:drawableRight="@mipmap/icon_arrow_right"
android:drawablePadding="@dimen/dp_5"
android:text="暂无优惠券"/>
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
android:background="@color/white"
android:layout_alignParentBottom="true">
<TextView
android:id="@+id/tv_price_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单总额:"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_16"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_C7C"/>
<TextView
android:id="@+id/tv_total_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_18"
android:textColor="@color/col_2621"
android:textStyle="bold"
android:layout_toRightOf="@+id/tv_price_desc"
android:layout_centerVertical="true"
tools:text="¥2760.00"
/>
<TextView
android:id="@+id/tv_pay"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_38"
android:background="@drawable/shape_r25_02c"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_16"
android:text="立即支付"
android:textColor="@color/white"
android:textSize="@dimen/sp_17"
android:textStyle="bold"
android:gravity="center"/>
</RelativeLayout>
</RelativeLayout>

@ -661,9 +661,8 @@
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_daily_poster"
android:id="@+id/ll_wearable_device"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
@ -673,40 +672,43 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_daily_poster"
android:background="@mipmap/icon_wearable_device"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="今日海报"
android:text="穿戴设备"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_wearable_device"
android:id="@+id/ll_daily_poster"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:visibility="invisible"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_wearable_device"
android:background="@mipmap/icon_daily_poster"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="穿戴设备"
android:text="今日海报"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"

@ -83,6 +83,25 @@ open class CloudJSBridge(val context: Context, val listener: IJsBridge) {
}
}
@JavascriptInterface
fun createOrder(str: String?){
str?.let {
}
}
@JavascriptInterface
fun selectAdd(str: String?){
str?.let {
}
}
@JavascriptInterface
fun selectCoupon(str: String?){
str?.let {
}
}
}

@ -24,6 +24,8 @@ class ARouterUrl {
//商城
const val SHOP_CATEGORY = "/com/zj365/dc/activity/shop/ShopCategoryActivity"
const val SHOP_ORDER_LIST_ACT = "/health/com/zj365/health/act/ShopOrderListAct"
const val SHOP_ORDER_DETAIL_ACT = "/health/com/zj365/health/act/ShopOrderDetailAct"
// const val FAMILY_INFO="/com/zj365/dc/act/FamilyMainAct"
@ -209,6 +211,7 @@ class ARouterUrl {
const val PERSON_INFO = "/mine/com/zj365/dc/mime/act/PersonInfoAct"
const val INVITE_FRIENDS = "/mine/com/zj365/dc/mime/act/InviteFriendsAct" //邀请好友
const val ENTERPRISE_INFO = "/mine/com/zj365/dc/mime/act/EnterpriseInformationAct" //企业资料
const val ENTERPRISE_TYPE_INFO = "/mine/com/zj365/dc/mime/act/EnterpriseInformationForTypeAct" //企业资料
const val NOTICE_SETTING = "/mine/com/zj365/dc/mime/act/NoticeSettingAct"

@ -120,5 +120,19 @@ object SpannableUtils {
txtView.paint.isAntiAlias = true
}
fun setMoney(startIndex:Int,endIndex:Int,fontColor: Int = -1,str:SpannableString): SpannableString {
str.setSpan(
ForegroundColorSpan(
//设置字体颜色
fontColor
), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
//设置字体大小(绝对值,单位:像素),第二个参数boolean dip如果为true表示前面的字体大小单位为dip否则为像素
return str
}
}

@ -146,7 +146,7 @@
android:launchMode="singleInstance"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.health.act.OrderListAct"
android:name="com.zj365.health.act.ShopOrderListAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
@ -327,6 +327,9 @@
<activity android:name=".act.healthcode.HealthBodyPartAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.ShopOrderDetailAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
</application>

@ -0,0 +1,57 @@
package com.zj365.health.act
import android.content.ClipData
import android.content.ClipboardManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.network.model.ShopOrderDetailBean
import com.zj365.health.databinding.ActShopOrderDetailBinding
import com.zj365.health.vm.ShopOrderVm
@Route(path = ARouterUrl.SHOP_ORDER_DETAIL_ACT)
class ShopOrderDetailAct: BaseVmAct<ShopOrderVm>() {
val binding by lazy { ActShopOrderDetailBinding.inflate(layoutInflater) }
var orderDetailBean:ShopOrderDetailBean? = null
override fun liveObserver() {
mViewModel.orderDetailLiveData.observe(this){
it.data?.let {
orderDetailBean = it
binding.imgGoods.setImage(this@ShopOrderDetailAct,it.goods_pic)
binding.tvPrice.text = "¥ ${it.pay_price}"
binding.tvGoodsName.text = it.goods_name
binding.tvStatus.text = it.status_name
binding.tvTotalPrice.text = "商品总价:¥ ${it.pay_price}"
binding.tvOrderNo.text = "订单编号:${it.order_no}"
binding.tvPayTime.text = "支付时间:${it.pay_time}"
binding.tvCompleteTime.text = "成交时间:${it.create_time}"
binding.tvPayType.text ="支付类型:${it.pay_type_name}"
}
}
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "订单详情"
binding.title.mIvBack.setOnClickListener {
finish()
}
var id = intent.getLongExtra("id",0)
mViewModel.getOrderDetail(id)
binding.tvCopy.setOnClickListener {
orderDetailBean?.let {
val clipboard: ClipboardManager =
getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
val clipData = ClipData.newPlainText("date", it.order_no)
clipboard.setPrimaryClip(clipData);
}
}
}
override fun setLayout() = binding.root
}

@ -0,0 +1,152 @@
package com.zj365.health.act
import android.graphics.Rect
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.androidkun.xtablayout.XTabLayout
import com.xty.base.act.BaseListAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.network.model.ShopOrderListBean
import com.zj365.health.R
import com.zj365.health.adapter.GoodsOrderAdapter
import com.zj365.health.databinding.ActShopOrderListBinding
import com.zj365.health.vm.ShopOrderVm
@Route(path = ARouterUrl.SHOP_ORDER_LIST_ACT)
class ShopOrderListAct : BaseListAct<ShopOrderVm>() {
val binding by lazy { ActShopOrderListBinding.inflate(layoutInflater) }
var orderType: Int = 0
val mAdapter by lazy { GoodsOrderAdapter() }
private val mTitles = mutableListOf<String>()
override fun initAdapter() {
binding.mRecycle.adapter = mAdapter
binding.mRecycle.layoutManager = LinearLayoutManager(this)
binding.mRecycle.addItemDecoration(object : RecyclerView.ItemDecoration() {
override fun getItemOffsets(outRect: Rect, itemPosition: Int, parent: RecyclerView) {
super.getItemOffsets(outRect, itemPosition, parent)
outRect.bottom = 12
outRect.right = 14
outRect.left = 14
}
})
setRecycleRefresh(binding.mRecycle,binding.mRefresh,true)
mAdapter.addChildClickViewIds(R.id.tv_confirm_receive_goods,R.id.tv_logistics,R.id.tv_refund)
mAdapter.setOnItemClickListener { adapter, view, position ->
var bean = adapter.data[position] as ShopOrderListBean.ShopOrderBean
bundle.clear()
bundle.putLong("id",bean.id)
RouteManager.goAct(ARouterUrl.SHOP_ORDER_DETAIL_ACT,bundle)
}
mAdapter.setOnItemChildClickListener { adapter, view, position ->
var bean = adapter.data[position] as ShopOrderListBean.ShopOrderBean
when(view.id){
R.id.tv_confirm_receive_goods ->{
mViewModel.receiveGoods(bean.id)
}
R.id.tv_logistics->{
if (bean.status == 1){
mViewModel.cancelOrder(bean.id)
}
}
R.id.tv_refund ->{
}
}
}
}
override fun loadData() {
mViewModel.getOrderList(page,orderType)
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "我的订单"
binding.title.mIvBack.setOnClickListener {
finish()
}
initTab()
}
fun initTab() {
mTitles.add("全部订单")
mTitles.add("待发货")
mTitles.add("待收货")
mTitles.add("已完成")
mTitles.add("已取消")
//设置tab
mTitles.forEach { tabData ->
val tab = binding.xTablayout.newTab()
tab.text = tabData
binding.xTablayout.addTab(tab)
}
binding.xTablayout.setOnTabSelectedListener(object : XTabLayout.OnTabSelectedListener{
override fun onTabSelected(tab: XTabLayout.Tab?) {
when(tab!!.position){
0->{
orderType = 0
}
1->{
orderType = 2
}
2->{
orderType = 3
}
3->{
orderType = 4
}
4->{
orderType = 5
}
}
page = 1
mViewModel.getOrderList(page,orderType)
}
override fun onTabUnselected(tab: XTabLayout.Tab?) {
}
override fun onTabReselected(tab: XTabLayout.Tab?) {
}
})
}
override fun liveObserver() {
mViewModel.shopOrderLiveDate.observe(this){
setDate(mAdapter,it.data.list)
}
mViewModel.cancelOrderLiveData.observe(this){
page = 1
mViewModel.getOrderList(page,orderType)
}
mViewModel.receiveGoodsLiveData.observe(this){
page = 1
mViewModel.getOrderList(page,orderType)
}
}
override fun setLayout() = binding.root
}

@ -0,0 +1,78 @@
package com.zj365.health.adapter
import android.graphics.Color
import android.graphics.Typeface
import android.text.SpannableString
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ruffian.library.widget.RImageView
import com.xty.base.adapter.BaseAdapter
import com.xty.common.setImage
import com.xty.common.util.SpannableUtils
import com.xty.network.model.ShopOrderListBean
import com.zj365.health.R
class GoodsOrderAdapter : BaseAdapter<ShopOrderListBean.ShopOrderBean>(R.layout.item_shop_order_list) {
override fun convert(holder: BaseViewHolder, item: ShopOrderListBean.ShopOrderBean) {
holder.setText(R.id.tv_order_no,"订单 ${item.order_no}")
holder.setText(R.id.tv_goods_name,item.goods_name)
holder.setText(R.id.tv_spec,item.goods_sku)
holder.getView<RImageView>(R.id.img_goods).setImage(context,item.goods_pic)
var priceTxt = holder.getView<TextView>(R.id.tv_price)
var fontStr = "订单金额:"
var str = SpannableString("¥ ${item.pay_price}")
priceTxt.text = SpannableUtils.setStrSpan(
"${fontStr}${str}",
-1,
ContextCompat.getColor(
context, R.color.col_2621
),
-1,
"${fontStr}${str}".length -"${str}".length,
"${fontStr}${str}".length
)
holder.setText(R.id.tv_num,"数量:${item.goods_num}")
var status = holder.getView<TextView>(R.id.tv_order_status)
status.text = item.status_name
when(item.status){ //1待支付 2已支付(待发货) 3待收货 4已完成5已取消6退款中7退款成功8退款失败
1 ->{
status.setTextColor(context.getColor(R.color.col_9BD))
holder.setGone(R.id.tv_confirm_receive_goods,true)
holder.setText(R.id.tv_logistics,"取消订单")
holder.setText(R.id.tv_refund,"立即支付")
}
3->{
status.setTextColor(context.getColor(R.color.col_9BD))
holder.setGone(R.id.tv_confirm_receive_goods,false)
holder.setText(R.id.tv_logistics,"查看物流")
holder.setText(R.id.tv_refund,"申请退款")
}
4->{
status.setTextColor(context.getColor(R.color.col_02c))
holder.setGone(R.id.tv_confirm_receive_goods,true)
holder.setGone(R.id.tv_logistics,true)
holder.setGone(R.id.tv_refund,true)
holder.setGone(R.id.line,true)
}
else ->{
status.setTextColor(context.getColor(R.color.col_9BD))
holder.setGone(R.id.tv_confirm_receive_goods,true)
holder.setGone(R.id.tv_logistics,true)
holder.setGone(R.id.tv_refund,true)
holder.setGone(R.id.line,true)
}
}
}
}

@ -0,0 +1,57 @@
package com.zj365.health.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.RespBody
import com.xty.network.model.ShopOrderDetailBean
import com.xty.network.model.ShopOrderListBean
import org.json.JSONObject
class ShopOrderVm : BaseVm() {
val shopOrderLiveDate by lazy { MutableLiveData<RespBody<ShopOrderListBean>>() }
val orderDetailLiveData by lazy { MutableLiveData<RespBody<ShopOrderDetailBean>>() }
val receiveGoodsLiveData by lazy { MutableLiveData<RespBody<Any>>() }
val cancelOrderLiveData by lazy { MutableLiveData<RespBody<Any>>() }
fun getOrderList(pageNum:Int,status:Int){
startHttp {
val json = JSONObject()
json.put("pageNum",pageNum)
json.put("pageSize", 10)
json.put("status",status)
val response = apiInterface().getShopOrderList(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(shopOrderLiveDate, nowData)
}
}
fun getOrderDetail(id:Long){
startHttp {
val response = apiInterface().getOrderDetail(id)
response.getCodeStatus(orderDetailLiveData, nowData)
}
}
fun receiveGoods(id:Long){
startHttp {
val response = apiInterface().receiveGoods(id)
response.getCodeStatus(receiveGoodsLiveData, nowData)
}
}
fun cancelOrder(id:Long){
startHttp {
val response = apiInterface().cancelOrder(id)
response.getCodeStatus(cancelOrderLiveData, nowData)
}
}
}

@ -0,0 +1,149 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
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"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/shape_round_white"
android:layout_margin="@dimen/dp_14"
android:paddingTop="@dimen/dp_19"
android:paddingLeft="@dimen/dp_16"
android:paddingRight="@dimen/dp_16"
android:paddingBottom="@dimen/dp_19">
<RelativeLayout
android:id="@+id/rx_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/rx_address"
>
<com.ruffian.library.widget.RImageView
android:id="@+id/img_goods"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_90"
app:is_circle="false"
app:corner_radius="5dp"
android:scaleType="fitXY"
android:layout_centerVertical="true"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_96"
android:layout_toRightOf="@+id/img_goods"
android:layout_marginLeft="@dimen/dp_14"
android:layout_centerVertical="true">
<TextView
android:id="@+id/tv_goods_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
tools:text="健康智能手表血糖血脂尿酸风险评估长时间续健康智能手表血糖血脂尿酸风险评估长时间续航航"
android:maxLines="2"
android:ellipsize="end"/>
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_2621"
android:layout_below="@+id/tv_goods_name"
android:layout_above="@+id/tv_status"
android:gravity="center"
tools:text="¥2868.00 "
/>
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_13"
android:layout_alignParentBottom="true"
tools:text="已完成"
android:textColor="@color/col_9BDd"
/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/tv_total_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15"
tools:text="商品总价¥2868.00"
android:layout_marginTop="@dimen/dp_35"/>
<TextView
android:id="@+id/tv_pay_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15"
tools:text="支付类型:支付宝"
android:layout_marginTop="@dimen/dp_22"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_22">
<TextView
android:id="@+id/tv_order_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15"
tools:text="订单编号202307114545412"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_copy"
android:text="复制"
android:textColor="@color/col_02c"
android:textSize="@dimen/sp_15"
android:layout_marginLeft="@dimen/dp_12"/>
</LinearLayout>
<TextView
android:id="@+id/tv_pay_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15"
tools:text="支付时间2023-07-11 22:02:03"
android:layout_marginTop="@dimen/dp_22"/>
<TextView
android:id="@+id/tv_complete_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15"
tools:text="成交时间2023-07-11 22:02:03"
android:layout_marginTop="@dimen/dp_22"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,50 @@
<?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: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.androidkun.xtablayout.XTabLayout
android:background="@color/col_6f7"
android:id="@+id/xTablayout"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
app:xTabMode="scrollable"
app:xTabSelectedTextColor="@color/col_02c"
app:xTabTextColor="@color/col_c7c"
app:xTabTextSize="@dimen/sp_15"
app:xTabDisplayNum="5"
app:xTabSelectedTextSize="@dimen/sp_15"
app:xTabIndicatorWidth="@dimen/dp_20"
app:xTabIndicatorHeight="@dimen/dp_3"
app:xTabIndicatorColor="@color/col_02c"
app:xTabIndicatorRoundY="@dimen/dp_3"/>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecycle"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<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,165 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_round_white"
android:paddingTop="@dimen/dp_15"
android:paddingBottom="@dimen/dp_9"
android:paddingLeft="@dimen/dp_16"
android:paddingRight="@dimen/dp_16">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/tv_order_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_13"
tools:text="订单 ZJ20240102384UJH"/>
<TextView
android:id="@+id/tv_order_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_13"
android:textColor="@color/col_02c"
android:layout_alignParentEnd="true"
tools:text="待收货"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rx_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_12"
android:layout_below="@+id/rx_address"
>
<com.ruffian.library.widget.RImageView
android:id="@+id/img_goods"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_90"
app:is_circle="false"
app:corner_radius="5dp"
android:scaleType="fitXY"
android:layout_centerVertical="true"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_96"
android:layout_toRightOf="@+id/img_goods"
android:layout_marginLeft="@dimen/dp_14"
android:layout_centerVertical="true">
<TextView
android:id="@+id/tv_goods_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
tools:text="健康智能手表血糖血脂尿酸风险评估长时间续健康智能手表血糖血脂尿酸风险评估长时间续航航"
android:maxLines="2"
android:ellipsize="end"/>
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_c7c"
android:layout_below="@+id/tv_goods_name"
android:layout_above="@+id/tv_price"
android:gravity="center"
tools:text="白色 "
/>
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_13"
android:layout_alignParentBottom="true"
android:textColor="@color/col_c7c"
tools:text="商品原价¥2860.00"
/>
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_13"
tools:text="数量1"
android:gravity="right"
android:layout_toRightOf="@+id/tv_price"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</RelativeLayout>
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:background="@color/col_0f2"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginTop="@dimen/dp_9">
<TextView
android:id="@+id/tv_refund"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_24"
android:background="@drawable/shape_stoke_25c"
android:text="申请退款"
android:textColor="@color/col_02c"
android:gravity="center"
android:textStyle="bold"
android:textSize="@dimen/sp_12"
/>
<TextView
android:id="@+id/tv_logistics"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_24"
android:background="@drawable/shape_stoke_25c"
android:text="查看物流"
android:textColor="@color/col_02c"
android:gravity="center"
android:textStyle="bold"
android:textSize="@dimen/sp_12"
android:layout_marginLeft="@dimen/dp_8"/>
<TextView
android:id="@+id/tv_confirm_receive_goods"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_24"
android:background="@drawable/shape_r25_02c"
android:text="确认收货"
android:gravity="center"
android:textSize="@dimen/sp_12"
android:layout_marginLeft="@dimen/dp_8"
android:textColor="@color/white"
android:textStyle="bold"
/>
</LinearLayout>
</LinearLayout>

@ -6,6 +6,9 @@ import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseListAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.network.model.EnterpriseInfoHomeBean
import com.zj365.mime.R
import com.zj365.mime.adapter.EnterpriseInformationAdapter
import com.zj365.mime.databinding.ActEnterpriseInformationBinding
import com.zj365.mime.vm.EnterpriseInformationVm
@ -28,6 +31,18 @@ class EnterpriseInformationAct : BaseListAct<EnterpriseInformationVm>() {
outRect.bottom = 12
}
})
mAdapter.addChildClickViewIds(R.id.tv_more)
mAdapter.setOnItemChildClickListener { adapter, view, position ->
var bean = adapter.data[position] as EnterpriseInfoHomeBean
when(view.id){
R.id.tv_more ->{
bundle.clear()
bundle.putInt("type",bean.type)
RouteManager.goAct(ARouterUrl.ENTERPRISE_TYPE_INFO,bundle)
}
}
}
}
override fun loadData() {

@ -0,0 +1,50 @@
package com.zj365.mime.act
import android.view.View
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.zj365.mime.adapter.EnterpriseInformationChildAdapter
import com.zj365.mime.databinding.ActEnterpriseInformationTypeBinding
import com.zj365.mime.vm.EnterpriseInformationVm
@Route(path = ARouterUrl.ENTERPRISE_TYPE_INFO)
class EnterpriseInformationForTypeAct : BaseListAct<EnterpriseInformationVm>() {
val binding by lazy { ActEnterpriseInformationTypeBinding.inflate(layoutInflater) }
val mAdapter by lazy { EnterpriseInformationChildAdapter(1) }
var type = 0
override fun initAdapter() {
binding.mRecycle.adapter = mAdapter
binding.mRecycle.layoutManager = LinearLayoutManager(this@EnterpriseInformationForTypeAct)
setRecycleRefresh(binding.mRecycle,binding.mRefresh,true)
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "企业资料"
binding.title.mIvBack.setOnClickListener {
finish()
}
}
override fun loadData() {
type = intent.getIntExtra("type",0)
mViewModel.getEnterpriseInformationForType(type,page)
}
override fun liveObserver() {
mViewModel.enterpriseInfoForTypeLiveData.observe(this){
setDate(mAdapter,it.data.list)
}
}
override fun setLayout() = binding.root
}

@ -13,7 +13,7 @@ class EnterpriseInformationAdapter : BaseAdapter<EnterpriseInfoHomeBean>(R.layou
holder.setText(R.id.tv_info_name,item.typeName)
var mAdapter = EnterpriseInformationChildAdapter()
var mAdapter = EnterpriseInformationChildAdapter(0)
var recyclerView = holder.getView<RecyclerView>(R.id.recycler)
recyclerView.layoutManager = LinearLayoutManager(context)

@ -1,5 +1,7 @@
package com.zj365.mime.adapter
import android.widget.LinearLayout
import androidx.constraintlayout.widget.ConstraintLayout
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ruffian.library.widget.RImageView
import com.xty.base.adapter.BaseAdapter
@ -7,8 +9,11 @@ import com.xty.common.setImage
import com.xty.network.model.EnterpriseInfoHomeBean
import com.zj365.mime.R
class EnterpriseInformationChildAdapter : BaseAdapter<EnterpriseInfoHomeBean.EnterpriseInfoChildBean>(R.layout.item_enterprise_info_child) {
class EnterpriseInformationChildAdapter (var type : Int = 0): BaseAdapter<EnterpriseInfoHomeBean.EnterpriseInfoChildBean>(R.layout.item_enterprise_info_child) {
override fun convert(holder: BaseViewHolder, item: EnterpriseInfoHomeBean.EnterpriseInfoChildBean) {
if (type != 0){
holder.getView<ConstraintLayout>(R.id.root).setPadding(16,28,16,20)
}
holder.setText(R.id.tv_info_title,item.title)
holder.setText(R.id.mTime,item.createTime)
holder.getView<RImageView>(R.id.img_cover).setImage(context,item.pic)

@ -1,14 +1,18 @@
package com.zj365.mime.vm
import android.graphics.pdf.PdfDocument.Page
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.EnterpriseInfoHomeBean
import com.xty.network.model.RespBody
import org.json.JSONObject
class EnterpriseInformationVm : BaseVm() {
val enterpriseInfoHomeLiveData by lazy { MutableLiveData<RespBody<MutableList<EnterpriseInfoHomeBean>>>() }
val enterpriseInfoForTypeLiveData by lazy { MutableLiveData<RespBody<EnterpriseInfoHomeBean>>() }
fun getEnterpriseInformationHomeList(){
startHttp {
var response=apiInterface().getEnterpriseInfoHomeList()
@ -16,4 +20,16 @@ class EnterpriseInformationVm : BaseVm() {
}
}
fun getEnterpriseInformationForType(type:Int,pageNum:Int){
startHttp {
var json = JSONObject()
json.put("type",type)
json.put("pageNum",pageNum)
json.put("pageSize","10")
var response=apiInterface().getEnterpriseInfoForType(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(enterpriseInfoForTypeLiveData,nowData)
}
}
}

@ -34,6 +34,8 @@ class SettingVm : BaseVm() {
val confirmInviteLiveData by lazy { MutableLiveData<RespBody<Any>>() }
val userEqualityLiveData by lazy { MutableLiveData<RespBody<String>>() }
fun getNesProg(id: String) {
startHttp {
@ -184,4 +186,11 @@ class SettingVm : BaseVm() {
}
}
fun getUserEquity(){
startHttp {
val response = apiInterface().getUserEquity()
response.getCodeStatus(userEqualityLiveData,nowData)
}
}
}

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/col_6f7"
tools:ignore="MissingDefaultResource">
<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">
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecycle"
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:overScrollMode="never" />
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

@ -50,7 +50,6 @@
android:text="更多"
android:layout_toLeftOf="@+id/img_right"
android:layout_centerVertical="true"
android:textSize="@dimen/sp_13"
android:textColor="@color/col_6B6"/>

@ -3,7 +3,9 @@
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:id="@+id/root"
android:background="@drawable/shape_round_white">
<com.ruffian.library.widget.RImageView
android:layout_width="@dimen/dp_100"

@ -1834,6 +1834,11 @@ interface ApiInterface {
*/
@POST("customer/family/confirmInfo")
suspend fun confirmInvited(@Body rb:RequestBody):RespBody<Any>
/**
* 获取用户权益
*/
@POST("customer/user/getUserEquity")
suspend fun getUserEquity():RespBody<String>
/**
* 获取设备型号
@ -1847,6 +1852,12 @@ interface ApiInterface {
@POST("customer/material/index")
suspend fun getEnterpriseInfoHomeList():RespBody<MutableList<EnterpriseInfoHomeBean>>
/**
* 企业资料列表
*/
@POST("customer/material/list")
suspend fun getEnterpriseInfoForType(@Body rb: RequestBody):RespBody<EnterpriseInfoHomeBean>
/**
* 商城分类
*/
@ -1858,4 +1869,34 @@ interface ApiInterface {
*/
@POST("customer/mall/prod/getProdList")
suspend fun getGoodsList(@Body rb: RequestBody):RespBody<GoodsRecordsBean>
/**
* 商城订单
*/
@POST("customer/mall/order/orderList")
suspend fun getShopOrderList(@Body rb:RequestBody) : RespBody<ShopOrderListBean>
/**
* 订单详情
*/
@GET("customer/mall/order/getOrderInfo")
suspend fun getOrderDetail(@Query("orderId") orderId:Long): RespBody<ShopOrderDetailBean>
/**
* 创建订单
*/
@POST("customer/mall/order/createOrder")
suspend fun createOrder(@Body rb: RequestBody):RespBody<Any>
/**
* 确认收货
*/
@GET("customer/mall/order/receiptOrder")
suspend fun receiveGoods(@Query("orderId") orderId:Long) : RespBody<Any>
/**
* 取消订单
*/
@GET("customer/mall/order/cancelOrder")
suspend fun cancelOrder(@Query("orderId") orderId:Long): RespBody<Any>
}

@ -1,8 +1,11 @@
package com.xty.network.model
import com.google.gson.annotations.SerializedName
data class EnterpriseInfoHomeBean(
var typeName:String,
var type:Int,
@SerializedName("list", alternate = ["records"])
var list:ArrayList<EnterpriseInfoChildBean>
) {

@ -0,0 +1,16 @@
package com.xty.network.model
data class ShopOrderDetailBean(
var order_no:String,
var goods_sku:String,
var goods_name:String,
var pay_price:String,
var create_time:String,
var goods_pic:String,
var status_name:String,
var pay_type_name:String,
var goods_num:String,
var pay_type:Int,
var pay_time:String,
var status:Int
)

@ -0,0 +1,17 @@
package com.xty.network.model
data class ShopOrderListBean(
var list:ArrayList<ShopOrderBean>
){
data class ShopOrderBean(
var order_no:String,
var goods_sku:String,
var goods_name:String,
var pay_price:String,
var goods_pic:String,
var status_name:String,
var goods_num:Int,
var id:Long,
var status:Int //1待支付 2已支付(待发货) 3待收货 4已完成5已取消6退款中7退款成功8退款失败
)
}
Loading…
Cancel
Save