import Taro from "@tarojs/taro";
import dayjs from "dayjs";
import { createSlice } from "@reduxjs/toolkit";

const otherSettingReducer = createSlice({
  name: "otherSetting", // store的名字
  initialState: {
    id: "",
    skipAppid: "", // 跳转商城id
    skipPath: "", // 跳转商城地址
    sysVersion: "", // 小程序系统版本(跳转的版本？)
    status: "", // 状态
  },
  reducers: {
    otherSettingRefresh(state, { payload }) {
      state.id = payload.id || "";
      state.skipAppid = payload.skipAppid || "";
      state.skipPath = payload.skipPath || "";
      state.sysVersion = payload.sysVersion || 0;
      state.status = payload.status || "";
    },
  },
});

export const { otherSettingRefresh } = otherSettingReducer.actions;
export default otherSettingReducer.reducer;
