<!--
 * @Author: chris
 * @Date: 2026-01-19 17:59:19
 * @LastEditors: chris
 * @LastEditTime: 2026-01-19 18:18:52
-->
<script setup>
definePage({
  style: {
    navigationBarTitleText: '预警推送设置',
  },
})

const pushPlatform = ref('')
const pushTemplate = ref('')

const platformTypes = [
  {
    label: '公众号',
    value: 'wechat',
  },
  {
    label: '短信',
    value: 'sms',
  },
]

const templateTypes = [
  {
    label: '模板1',
    value: 'template1',
  },
  {
    label: '模板2',
    value: 'template2',
  },
]

function handleChange(item, type) {
  if (type === 'platform') {
    pushPlatform.value = item.value
  }
  else if (type === 'template') {
    pushTemplate.value = item.value
  }
}
</script>

<template>
  <view class="warning-setting">
    <wd-select-picker v-model="pushPlatform" value-key="value" label-key="label" label="推送平台" type="radio" :columns="platformTypes" @change="handleChange($event, 'platform')" />
    <wd-select-picker v-model="pushTemplate" value-key="value" label-key="label" label="推送模板" type="radio" :columns="templateTypes" @change="handleChange($event, 'template')" />
  </view>
</template>

<style scoped lang="scss">
.warning-setting {
  @apply bg-[#f8f8f8] h-[100vh] py-[20rpx];
}
</style>
