Commit ed125fcb authored by shiyl's avatar shiyl

修改门店选择回显效果

parent 99fd8e41
......@@ -18,7 +18,7 @@ import com.yidian.shenghuoquan.newscontent.ui.store.EditStoreActivity
class ChooseStoreApter : BaseQuickAdapter<GetShopListBean, BaseViewHolder>(R.layout.layout_choose_store_list_item) {
override fun convert(holder: BaseViewHolder, item: GetShopListBean) {
val position = holder.adapterPosition
val position = holder.layoutPosition
holder.getView<TextView>(R.id.tv_store_name).text = item.shop_name
holder.getView<TextView>(R.id.tv_store_address).text = item.address
val ivStoreSelect = holder.getView<ImageView>(R.id.iv_store_select)
......
......@@ -49,16 +49,14 @@ class ChooseStoreActivity : BaseActivity<ActivityChooseStoreBinding>() {
private fun requestStoreList() {
val requestParams = HashMap<String, String?>()
requestParams["life_account_id"] = StorageUtil.getLifeAccountId()
ApiService.getShopList(requestParams) {
ApiService.getShopList(requestParams) { shopList ->
// 勾选上次选中的门店的
if (!lastSelectStoreList.isNullOrEmpty()) {
it.forEach { getShopListBean ->
lastSelectStoreList?.forEach { storeId ->
getShopListBean.isSelected = getShopListBean.shop_id == storeId
shopList.forEach { shopListBean ->
shopListBean.isSelected = lastSelectStoreList!!.contains(shopListBean.sub_shop_id)
}
}
}
chooseStoreAdapter.setList(it)
chooseStoreAdapter.setList(shopList)
}
}
......@@ -74,7 +72,7 @@ class ChooseStoreActivity : BaseActivity<ActivityChooseStoreBinding>() {
val storeList = chooseStoreAdapter.data
val filterList = storeList.filter { it.isSelected }
filterList.forEach {
selectStoreIdList.add(it.shop_id)
selectStoreIdList.add(it.sub_shop_id)
}
// 关闭选择类目页面
XEventManager.post(XBaseEvent(XEventConfig.CHOOSE_STORE_SUCCESS, selectStoreIdList))
......
......@@ -186,11 +186,13 @@ class YdSubwayApplication : YdBaseApplication() {
val params = data.optJSONObject("params")
val options = data.optJSONObject("options")
// Native调用JS传递的数据
// 发送JS传递的数据到Service,并监听服务返回的结果回传JS
ZapTicket(request.name).withAction(action).withServiceParams(params).withServiceOptions(options).withIdentifier(identifier)
.onResult { result ->
Timber.tag("xbrid").e("回传JS的结果码: ${result.code} + 结果信息: ${result.result}")
response.result(result.code, result.result ?: "", "")
}.onLost { result ->
Timber.tag("xbrid").e("回传JS的错误码: ${result.code} + 错误信息: ${result.mesg}")
response.result(result.code, "", result.mesg)
}.ship()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment