// 拍摄页与表单页之间的内存中转：blob 无法走路由 query，返回时由表单页取出并清空
export default {
  namespaced: true,
  state: {
    result: null,   // 拍照确认结果 { type, blob, dataURL }
    fallback: null  // 相机不可用降级信息 { type, error }
  },
  mutations: {
    setResult(state, payload) {
      state.result = payload
      state.fallback = null
    },
    setFallback(state, payload) {
      state.fallback = payload
      state.result = null
    },
    clear(state) {
      state.result = null
      state.fallback = null
    }
  }
}
