<template>
  <view class="information_template">
    <view class="information_head">
      <up-icon name="error-circle" size="19" color="#2d75ff" />
      <text> 通知对象默认为常用联系人，如无则通知产权人 </text>
    </view>
    <view class="information_template_card">
      <view class="card_head_info">
        <view class="border_left"> </view>
        请选择通知方式
      </view>

      <view
        v-for="(i, index) in useModel?.selectType?.value"
        :key="`items_${index}`"
        class="card_select_cell"
        @click="method?.handleSelect(index, i)"
      >
        <view class="cell_title">
          <view class="sending_message">
            {{ i?.label }} <text v-if="i?.tab"> {{ i?.tab }} </text>
          </view>
          <uni-icons
            v-if="i?.is_select"
            type="checkbox-filled"
            size="20"
            color="#0082FA"
          ></uni-icons>
          <uni-icons v-else type="circle" size="20" color="#999"></uni-icons>
        </view>
        <view class="cell_des">
          {{ i?.des }}
          <text v-if="i?.subDes"> {{ i?.subDes }} </text>
        </view>
      </view>

      <view v-if="useModel?.selectEdType?.value?.length" class="template_info">
        <!-- <view class="template_info_item">
          <view class="label"> 短信内容预览 </view>
          <view class="template_info_text">
            【XX物业】尊敬的住户：您有待缴物业账单，请点击xxxxxxxx及时缴纳。如已缴费请忽略。
          </view>
        </view> -->

        <view class="template_info_item">
          <view class="label"> 公众号/小程序通知内容预览 </view>
          <view class="template_info_text">
            【XX物业】您名下房产存在待缴账单，可点击详情缴纳。如已缴费请忽略。
          </view>
        </view>

        <view class="template_info_item">
          <view class="label"> 企微批量发送内容预览 </view>
          <view class="enterprise_wechat_content">
            <view class="enterprise_wechat">
              <view class="cover_img">
                <image
                  class=""
                  src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01K5B5RY2TQQAJ1GT2RZSK426V.jpg"
                  mode="heightFix"
                  lazy-load="false"
                />
              </view>
              <view class="label"> 您的物业费账单已生成，请点击此处进行缴费！ </view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <MyPopupSubmitTemplate
      :formData="useModel?.formData?.value"
      :type="useModel?.selectEdType?.value"
    />
  </view>
</template>
<script setup lang="ts">
import method from './method'
import { onLoad, onShow } from '@dcloudio/uni-app'
import MyPopupSubmitTemplate from './components/PopupSubmitTemplate.vue'
import useModel from './model'

onShow(() => {
  method?.handleInit()
})

onLoad(e => {
  useModel.formData.value = {
    houses: e?.data ? JSON.parse(e?.data) : []
  }
})
</script>

<style lang="scss">
@import './style.scss';
</style>
