<template>
  <div class='right_con'>
    <Tabs type='card' class='mar_T_15'>
      <TabPane label='阿里云短信'>
        <div class='page_summary' style='margin-bottom:20px'>
          <p>阿里云短信为第三方短信平台，如需使用可至阿里云官网进行购买。</p>
          <p>阿里云地址：<a href="https://www.aliyun.com" class="a_text" id="textset-intotext" target="_blank">https://www.aliyun.com</a></p>
        </div>
        <Form ref='textSetInfo' :model='textSetInfo' :label-width='165'>
          <FormItem label='accessKeyId：'>
            <Input v-model='textSetInfo.access_key_id' class='wid_275'></Input>
          </FormItem>
          <FormItem label='accessKeySecret：'>
            <Input v-model='textSetInfo.access_key_secret' class='wid_275'></Input>
          </FormItem>
          <FormItem label='签名名称：'>
            <Input v-model='textSetInfo.sign_name' class='wid_275 fl zd1'></Input>
          </FormItem>
          <FormItem label='修改密码模板code：'>
            <Input v-model='textSetInfo.change_password_code' class='wid_275 fl zd1'></Input>
          </FormItem>
          <FormItem label='发送工资通知模板code：'>
            <Input v-model='textSetInfo.wage_code' class='wid_275 fl zd1'></Input>
          </FormItem>
          <FormItem label='荣誉等级短信通知模板code：'>
            <Input v-model='textSetInfo.honor_code' class='wid_275 fl zd1'></Input>
          </FormItem>
          <FormItem label='特权奖励短信通知模板code：'>
            <Input v-model='textSetInfo.privilege_code' class='wid_275 fl zd1'></Input>
          </FormItem>
          <FormItem label='每日发送数量：'>
            <Input v-model='textSetInfo.number' class='wid_275 fl zd1'></Input>
            <p class='text_set_text'>0或不填表示不做限制</p>
          </FormItem>
            <FormItem label='客服手机号：'>
            <Input v-model='textSetInfo.service_mobile' class='wid_275 fl zd1'></Input>
          </FormItem>
          <FormItem label='状态：'>
            <RadioGroup v-model="textSetInfo.status">
              <Radio :label="1">开启</Radio>
              <Radio :label="0">关闭</Radio>
            </RadioGroup>
          </FormItem>
          <FormItem class='form_btn'>
            <Button type='primary' @click='saveTextSetInfo'>确认</Button>
          </FormItem>
        </Form>
      </TabPane>
    </Tabs>
  </div>
</template>
<script>
export default {
  name: 'text_set',
  data() {
    return {
      textSetInfo: {
        appaccess_key_id: '',
        access_key_secret: '',
        sign_name: '',
        change_password_code: '',
        wage_code: '',
        honor_code: '',
        privilege_code: '',
        number: '',
        status:1,
         service_mobile:''
      },
      textSet:{
        honor_msg: 1,
        wage_msg: 1,
        privilege_msg: 1,
        achievements_msg: 1,
        notice_msg: 1,
        change_password_msg: 1,
        status: 1
      }
    };
  },
  watch: {},
  methods: {
    saveTextSetInfo() {
      this.$api.setSMSInfo({ ...this.textSetInfo }).then(data => {
        if (data.code == 200) {
          this.getSMSInfo();
          this.$Message.info(data.msg);
        } else {
          this.$Message.info(data.msg);
        }
      });
    },
    getSMSInfo() {
      this.$api.getSMSInfo().then(data => {
        if (data.code == 200) {
          this.textSetInfo = { ...data.data };
        }else{
          this.$Message.info(data.msg)
        }
      });
    }
  },
  created() {
    this.getSMSInfo();
  }
};
</script>
<style>
.text_set_text {
  width: 40%;
}
#textset-intotext:hover{
  text-decoration:underline
}
</style>



