<template>
  <BasicLayout>
    <view class="p-15">
      <view class="white-bg-color p-15 r-md">
        <view> 各位家长：</view>
        <view class="notice-text">
          随着素质教育的不断深入，学生各项素质、能力的培养越来越受到学校、家庭的重视。我校根据教育局的有关精神，继续举办兴趣班。请各位家长根据实际情况，遵照"孩子自主，家长自愿"的原则，选择兴趣班，请点击下一步确认知晓告知内容。
        </view>
      </view>
      <BasicSign ref="signCompRef" title="签名"></BasicSign>
    </view>
    <template #bottom>
      <view class="white-bg-color py-5">
        <view class="flex-row items-center pb-10 pt-5">
          <u-button
            text="下一步"
            class="mx-15"
            type="primary"
            @click="submit"
          />
        </view>
      </view>
    </template>
  </BasicLayout>
</template>

<script lang="ts" setup>
import { xkListApi } from "@/api/base/server";
import { useDataStore } from "@/store/modules/data";
import { useUserStore } from "@/store/modules/user";

const signCompRef = ref<any>(null);
const sign_file = ref<any>(null);
const { setData, getGlobal } = useDataStore();
async function submit() {
  // 显示加载中
  const data = await signCompRef.value.getSyncSignature();
  sign_file.value = data.base64;
  setData({
    sign_file: sign_file.value,
  });
  if (getGlobal.type == 1) {
    uni.reLaunch({
      url: "/pages/base/course-selection/index",
    });
  }
  if (getGlobal.type == 2) {
    uni.reLaunch({
      url: "/pages/base/course-selection/club-selection",
    });
  }
}
</script>

<style lang="scss" scoped>
.notice-text {
  margin-top: 10px;
  text-indent: 2em; /* 添加两个中文字符的缩进 */
}
</style>
