|
|
|
@ -5,10 +5,7 @@ import androidx.lifecycle.MutableLiveData |
|
|
|
|
import androidx.lifecycle.ViewModel |
|
|
|
|
import androidx.lifecycle.viewModelScope |
|
|
|
|
import com.gyf.csams.NOT_IMPL_TIP |
|
|
|
|
import com.gyf.csams.uikit.ActivityDetailMenu |
|
|
|
|
import com.gyf.csams.uikit.ScrollList |
|
|
|
|
import com.gyf.csams.uikit.StringForm |
|
|
|
|
import com.gyf.csams.uikit.TopMenuInterface |
|
|
|
|
import com.gyf.csams.uikit.* |
|
|
|
|
import com.gyf.csams.util.randomChinese |
|
|
|
|
import com.gyf.csams.util.randomDateTime |
|
|
|
|
import com.gyf.csams.util.randomNum |
|
|
|
@ -218,29 +215,26 @@ data class BBSVo(val studentId:String,val name:String,val createTime:Date,val co |
|
|
|
|
* 交流区数据状态管理 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
class BBSViewModel:ScrollList<BBSVo>(){ |
|
|
|
|
class BBSViewModel:ScrollList<BBSVo>(), SendInterface { |
|
|
|
|
override val initSize: Int = 10 |
|
|
|
|
|
|
|
|
|
val title="发送评论" |
|
|
|
|
|
|
|
|
|
val newContent = StringForm(formDesc = "评论内容",textLength = 80) |
|
|
|
|
override val newContent = StringForm(formDesc = "评论内容",textLength = 80) |
|
|
|
|
|
|
|
|
|
private val _openDialog=MutableLiveData<Boolean>() |
|
|
|
|
val openDialog:LiveData<Boolean> = _openDialog |
|
|
|
|
override val _openDialog=MutableLiveData<Boolean>() |
|
|
|
|
override val openDialog:LiveData<Boolean> = _openDialog |
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
load() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 打开评论弹窗 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
fun openDialog(){ |
|
|
|
|
|
|
|
|
|
override fun openDialog(){ |
|
|
|
|
_openDialog.value=true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun closeDialog(){ |
|
|
|
|
override fun closeDialog(){ |
|
|
|
|
_openDialog.value=false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -249,7 +243,7 @@ class BBSViewModel:ScrollList<BBSVo>(){ |
|
|
|
|
* |
|
|
|
|
* @param callback |
|
|
|
|
*/ |
|
|
|
|
fun send(callback: (message: String) -> Unit){ |
|
|
|
|
override fun send(callback: (message: String) -> Unit){ |
|
|
|
|
callback(NOT_IMPL_TIP) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|