|
@@ -89,7 +89,14 @@ class MainViewModel : BaseViewModel() {
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
|
GlobalDataCollection.instance?.accountDataList = respData
|
|
GlobalDataCollection.instance?.accountDataList = respData
|
|
|
getUserAccount()//请求成功就继续请求用户账号信息
|
|
getUserAccount()//请求成功就继续请求用户账号信息
|
|
|
- isSuccess(true)
|
|
|
|
|
|
|
+ // 查询所有商品盘面
|
|
|
|
|
+ queryQuoteDay(false) {
|
|
|
|
|
+ if (it) {
|
|
|
|
|
+ isSuccess(true)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ loadingDialogStatus.postValue(TaskUiModel.idel())
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
loadingDialogStatus.postValue(TaskUiModel.idel())
|
|
loadingDialogStatus.postValue(TaskUiModel.idel())
|
|
|
}
|
|
}
|
|
@@ -104,6 +111,7 @@ class MainViewModel : BaseViewModel() {
|
|
|
|
|
|
|
|
if (SPUtils.getInstance().getString(Constant.oem) == "yrdz" || SPUtils.getInstance().getString(Constant.oem) == "tjmd"){
|
|
if (SPUtils.getInstance().getString(Constant.oem) == "yrdz" || SPUtils.getInstance().getString(Constant.oem) == "tjmd"){
|
|
|
queryWrMarketTradeConfig()
|
|
queryWrMarketTradeConfig()
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
queryUserFavoriteGoodses()
|
|
queryUserFavoriteGoodses()
|
|
@@ -166,6 +174,45 @@ class MainViewModel : BaseViewModel() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 请求盘面信息
|
|
|
|
|
+ * @param first Int
|
|
|
|
|
+ * @param last Int
|
|
|
|
|
+ * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
|
|
|
|
|
+ */
|
|
|
|
|
+ fun queryQuoteDay(
|
|
|
|
|
+ isShowLoading: Boolean,
|
|
|
|
|
+ callback: (isCompleted: Boolean) -> Unit
|
|
|
|
|
+ ) {
|
|
|
|
|
+ if (isShowLoading) {
|
|
|
|
|
+ loadingDialogStatus.postValue(TaskUiModel.inFlight())
|
|
|
|
|
+ }
|
|
|
|
|
+ // 查所有
|
|
|
|
|
+ val params = mutableMapOf<String, String>()
|
|
|
|
|
+ MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
|
|
|
|
|
+ if (isSuccess) {
|
|
|
|
|
+ if (respData?.isEmpty()?.not() == true) {
|
|
|
|
|
+ MyApplication.getInstance()?.futureManager?.quoteDayList = respData
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isShowLoading) {
|
|
|
|
|
+ loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功"))
|
|
|
|
|
+ }
|
|
|
|
|
+ callback(true)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (isShowLoading) {
|
|
|
|
|
+ loadingDialogStatus.postValue(
|
|
|
|
|
+ TaskUiModel.failed(
|
|
|
|
|
+ InteractiveException(
|
|
|
|
|
+ errorMessage = "数据请求失败"
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ callback(false)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 查询我的自选
|
|
* 查询我的自选
|
|
|
*/
|
|
*/
|
|
|
fun queryUserFavoriteGoodses() {
|
|
fun queryUserFavoriteGoodses() {
|