<style>
  .logistics .form-box {
    background: #fff;
    padding: 20px 10% 20px 0;
    margin-top: 10px;
  }
  .logistics .prompt{
    margin: -10px 20px 20px;
    background-color: #F4F4F5;
    padding: 10px 15px;
    color: #909399;
    display: inline-block;
    font-size: 13px;
  }
</style>
<template>
  <div class="logistics">
    <div id="pane-first">
      <div class="form-box">
        <el-form :model="msg" style="padding:0 50px;" ref="msg" label-width="130px">
          <el-form-item label="查询类型选择">
            <el-radio-group v-model="msg.LogisticsType" >
              <el-radio :label="1">快递鸟</el-radio>
              <el-radio :label="2">阿里云接口</el-radio>
            </el-radio-group>
          </el-form-item>

          <el-form-item label="阿里云APPCODE" v-if="msg.LogisticsType==2">
            <el-input v-model="msg.AliyunAppCode"/>
            <span><span style="color: rgb(102, 102, 102);">用户获取物流信息,</span> <a href="https://market.aliyun.com/products/56928004/cmapi023201.html" target="_blank" class="el-link el-link--primary"><!----><span class="el-link--inner">阿里云接口申请</span><!----></a></span>
          </el-form-item>
          <div class="prompt" v-if="msg.LogisticsType==2">温馨提示：以下为电子面单配置，只能填写快递鸟参数</div>


          <el-form-item label="快递鸟用户ID" >
            <el-input v-model="msg.ExpressBirdID"/>
          </el-form-item>
          <el-form-item label="快递鸟API KEY" >
            <el-input v-model="msg.ExpressBirdAPIKey"/>
          </el-form-item>
        </el-form>


      </div>
      <el-button type="primary" style="margin: 12px 0 " @click="preserve">保存</el-button>

    </div>
  </div>

</template>

<script>
    export default {
        name: "logistics",
      data(){
          return{
            msg:{
              ID:0,
              LogisticsType:1,
              AliyunAppCode:'',
              ExpressBirdID:'',
              ExpressBirdAPIKey:'',
            }
          }
      },
      methods:{
        GetLogistics(){
          this.apipost("/api/MallBase/GetLogistics", {}, res => {
            if (res.data.resultCode == 1) {
              this.msg = res.data.data;
            } else {
              this.Info(res.data.message);
            }
          })
        },
        preserve(){

          this.apipost("/api/MallBase/AddOrUpdateLogistics", this.msg, res => {
            if (res.data.resultCode == 1) {
              this.Info(res.data.message);

            } else {
              this.Info(res.data.message);
            }
          })
        }
      },
      mounted(){
          this.GetLogistics()
      }
    }
</script>

<style scoped>

</style>
