"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  __name: "change",
  setup(__props) {
    common_vendor.onLoad((options) => {
      list.value = JSON.parse(options.list) || [];
      currentId.value = options.id;
      list.value.forEach((ele) => {
        if (ele.id == currentId.value) {
          ele.isCheck = true;
        }
      });
    });
    const currentId = common_vendor.ref();
    const list = common_vendor.ref([]);
    const change = (item) => {
      list.value.forEach((ele) => {
        ele.isCheck = false;
      });
      item.isCheck = !item.isCheck;
    };
    const handleConfirm = () => {
      const temObj = list.value.find((ele) => ele.isCheck);
      common_vendor.index.$emit("updateObj", temObj);
      common_vendor.index.navigateBack(1);
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(list.value, (item, k0, i0) => {
          return {
            a: item.isCheck,
            b: common_vendor.t(item.name),
            c: common_vendor.t(item.cardNo),
            d: item.id,
            e: common_vendor.o(($event) => change(item), item.id)
          };
        }),
        b: common_vendor.o(handleConfirm)
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7835c6a4"], ["__file", "E:/workSpace/WanZai_School_app/pages/change/change.vue"]]);
wx.createPage(MiniProgramPage);
