package com.lukouguoji.aerologic.page.gnj.move.stash.photo

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityGnjMoveStashPhotoBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.addOnItemClickListener

/**
 * 国内进港移库「拍照上传」（5.5 寸手持端专属页面，无平板变体）
 *
 * 由列表卡片长按浮层「拍照」或运单详情「异常照片」加号槽位进入。
 * 已有照片经 DomImpMove/detail 回填，提交走 DomImpMove/modify
 * （mawbId + pic/originalPic/picNumber 三字段规范，与平板移交编辑页同一链路）。
 */
class GnjMoveStashPhotoActivity :
    BaseBindingActivity<ActivityGnjMoveStashPhotoBinding, GnjMoveStashPhotoViewModel>() {

    override fun layoutId() = R.layout.activity_gnj_move_stash_photo
    override fun viewModelClass() = GnjMoveStashPhotoViewModel::class.java

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("拍照上传")
        binding.viewModel = viewModel

        viewModel.rv = binding.rv
        binding.rv.addOnItemClickListener(viewModel)

        viewModel.initOnCreated(intent)
    }

    companion object {
        @JvmStatic
        fun start(context: Context, mawbId: String, wbNo: String) {
            context.startActivity(
                Intent(context, GnjMoveStashPhotoActivity::class.java)
                    .putExtra(Constant.Key.ID, mawbId)
                    .putExtra(Constant.Key.CODE, wbNo)
            )
        }
    }
}
