lmw
2023-06-25 a988e7c15f5ce63785b77e01c89bec2565668982
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.kuanzhai.driver.ui.merchant
 
import android.view.View
import com.driver.emanagercar.ui.base.BaseRecyclerFragment
import com.kuanzhai.driver.base.BaseEvent
import com.kuanzhai.driver.bean.BaseBean
import com.kuanzhai.driver.bean.CouponData
import com.kuanzhai.driver.bean.CouponListBean
import com.kuanzhai.driver.bean.UserInfoBean
import com.kuanzhai.driver.netUtls.Api
import com.kuanzhai.driver.netUtls.getMapByAny
import com.kuanzhai.driver.ui.adapter.ConponMerchantListAdapter
import org.greenrobot.eventbus.EventBus
import java.util.HashMap
 
/**
 * @ClassName ConponMerchantListFragment
 * @Description TODO
 * @Author Administrator
 * @Date 2022/2/9 15:56
 * @Version 1.0
 */
class ConponMerchantListFragment: BaseRecyclerFragment<CouponData>(ConponMerchantListAdapter()) {
 
    var type = 1 //1=进行中,2=已结束
 
    override fun pathUrl(): String? {
        return Api.getMerchantCoupon
    }
 
    override fun mapObject(): HashMap<String?, Any?>? {
        var map = getMapByAny()
        map["type"] = type
       return map
    }
 
    override fun mapString(): HashMap<String?, String?>? {
        return null
    }
 
    override fun getDatas(t: String?): List<CouponData> {
       return gson.fromJson<CouponListBean>(t,CouponListBean::class.java).data
    }
 
    override fun onItemClick(view: View?, position: Int) {
 
    }
 
    override fun initView() {
 
    }
 
    override fun refresh() {
        (adapter as ConponMerchantListAdapter).type = type
        super.refresh()
    }
 
    override fun noShowNothing() {
        super.noShowNothing()
        EventBus.getDefault().post(BaseEvent(BaseEvent.MER_SHOW_BACK, (adapter as ConponMerchantListAdapter).data.isEmpty()))
    }
}