1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package com.quansu.heifengwuliu.vmodel
- import android.app.Application
- import android.graphics.Color
- import com.quansu.heifengwuliu.utils.net.NetEngine
- import com.ysnows.base.base.BRRepository
- import com.ysnows.base.base.BRViewModel
- import com.ysnows.base.net.IResp
- import io.reactivex.Observable
- class InvoiceVModel(application: Application) : BRViewModel<BRRepository>(application) {
- //state:1:开票中 2通过(已邮寄) 3系统拒绝 9取消
- fun getInvoiceStatus(status: Int): String {
- return when (status) {
- 1 -> "开票中"
- 2 -> "发票已邮寄"
- 3 -> "系统拒绝"
- 9 -> "已取消申请"
- else -> ""
- }
- }
- fun getInvoiceColor(status: Int): Int {
- return when (status) {
- 1 -> Color.parseColor("#FFBC00")
- 2 -> Color.parseColor("#FF6029")
- 3 -> Color.parseColor("#979899")
- 9 ->Color.parseColor("#979899")
- else -> Color.parseColor("#979899")
- }
- }
- override fun apiFunc(): suspend () -> IResp<*> {
- return {NetEngine.service.invoiceList(repository().page)}
- }
- fun goInvoice(){
- //申请开票
- }
- }
|