<script setup>
import { useConfigStore } from '@/stores/config'
import { storeToRefs } from 'pinia'

const store = useConfigStore()

const { conf } = storeToRefs(store)
</script>

<template>
  <n-card title="每日任务">
    <n-flex vertical>
      <n-checkbox v-model:checked="conf.skland_enable">
        <div class="item">森空岛签到</div>
      </n-checkbox>
      <div v-for="account_info in conf.skland_info" :key="account_info.account">
        <n-flex>
          <n-checkbox v-model:checked="account_info.isCheck" style="margin-right: 12px">
            森空岛账号：{{ account_info.account }}
          </n-checkbox>
          <n-checkbox v-model:checked="account_info.sign_in_official" style="margin-right: 12px">
            官服签到
          </n-checkbox>
          <n-checkbox v-model:checked="account_info.sign_in_bilibili" style="margin-right: 12px">
            B服签到
          </n-checkbox>
        </n-flex>
      </div>
      <n-divider />
      <n-flex>
        <n-checkbox v-model:checked="conf.check_mail_enable">
          <div class="item">领取邮件</div>
        </n-checkbox>
        <n-checkbox v-model:checked="conf.delete_read_mail">删除已读邮件</n-checkbox>
      </n-flex>
      <n-divider />
      <n-checkbox v-model:checked="conf.visit_friend">
        <div class="item">访问好友</div>
      </n-checkbox>
      <n-divider />
      <n-flex>
        <n-checkbox v-model:checked="conf.report_enable">
          <div class="item">读取基报</div>
        </n-checkbox>
      </n-flex>
      <n-divider />
      <n-flex>
        <n-checkbox v-model:checked="conf.sign_in.enable">
          <div class="item">签到活动</div>
        </n-checkbox>
        <help-text>游戏内签到、矿区、限定池每日单抽等</help-text>
      </n-flex>
      <n-divider />
      <n-flex>
        <n-checkbox v-model:checked="conf.switch_assistants">
          <div class="item">基建副手</div>
        </n-checkbox>
        <n-input-number
          style="max-width: 220px"
          v-model:value="conf.trust_limit"
          :min="100"
          :max="200"
          :precision="0"
        >
          <template #prefix>信赖值阈值(≥)</template>
          <template #suffix>%</template>
        </n-input-number>
      </n-flex>
      <n-divider />
      <n-flex>
        <n-checkbox v-model:checked="conf.trade_token">
          <div class="item">信物兑换</div>
        </n-checkbox>
      </n-flex>
    </n-flex>
  </n-card>
</template>

<style scoped>
.item {
  font-weight: 500;
  font-size: 16px;
}

.n-divider:not(.n-divider--vertical) {
  margin: 6px 0;
}
</style>
