email.blade.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. @extends('layouts.base')
  2. @section('content')
  3. <style>
  4. .panel {
  5. margin-bottom: 10px !important;
  6. padding-left: 20px;
  7. border-radius: 10px;
  8. }
  9. .panel .active a {
  10. background-color: #29ba9c !important;
  11. border-radius: 18px !important;
  12. color: #fff;
  13. }
  14. .panel a {
  15. border: none !important;
  16. background-color: #fff !important;
  17. }
  18. .content {
  19. background: #eff3f6;
  20. padding: 10px !important;
  21. }
  22. .con {
  23. padding-bottom: 40px;
  24. position: relative;
  25. min-height: 100vh;
  26. background-color: #fff;
  27. }
  28. .con .setting .block {
  29. padding: 10px;
  30. margin-bottom: 10px;
  31. border-radius: 8px;
  32. }
  33. .con .setting .block .title {
  34. display: flex;
  35. align-items: center;
  36. margin-bottom: 15px;
  37. }
  38. .confirm-btn {
  39. width: calc(100% - 266px);
  40. position: fixed;
  41. bottom: 0;
  42. right: 0;
  43. margin-right: 10px;
  44. line-height: 63px;
  45. background-color: #ffffff;
  46. box-shadow: 0px 8px 23px 1px rgba(51, 51, 51, 0.3);
  47. background-color: #fff;
  48. text-align: center;
  49. }
  50. b {
  51. font-size: 14px;
  52. }
  53. </style>
  54. <div id='re_content'>
  55. @include('layouts.newTabs')
  56. <div class="con">
  57. <div class="setting">
  58. <el-form ref="form" :model="form" label-width="15%">
  59. <div class="block">
  60. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>配置信息</b></div>
  61. <br>
  62. <el-form-item label="邮箱类型">
  63. <template>
  64. <el-radio-group v-model="form.email_type">
  65. <el-radio label="0">qq邮箱</el-radio>
  66. <el-radio label="1">163邮箱</el-radio>
  67. </el-radio-group>
  68. </template>
  69. </el-form-item>
  70. <el-form-item label="发件人邮箱">
  71. <el-input v-model="form.send_email" style="width:70%;" placeholder="请输入发件人邮箱"></el-input>
  72. </el-form-item>
  73. <el-form-item label="邮箱授权码">
  74. <el-input v-model="form.password" style="width:70%;" placeholder="请输入邮箱授权码"></el-input>
  75. </el-form-item>
  76. </div>
  77. </div>
  78. <div class="confirm-btn">
  79. <el-button type="primary" @click="submit">提交</el-button>
  80. </div>
  81. </el-form>
  82. </div>
  83. </div>
  84. <script>
  85. var vm = new Vue({
  86. el: "#re_content",
  87. delimiters: ['[[', ']]'],
  88. data() {
  89. return {
  90. form: {
  91. send_email: '',
  92. password: '',
  93. email_type: '0'
  94. },
  95. }
  96. },
  97. mounted() {
  98. this.getData();
  99. },
  100. methods: {
  101. getData() {
  102. this.$http.post('{!! yzWebFullUrl('setting.shop.email') !!}').then(function (response) {
  103. if (response.data.result) {
  104. for (let i in response.data.data.set) {
  105. this.form[i] = response.data.data.set[i]
  106. }
  107. } else {
  108. this.$message({message: response.data.msg, type: 'error'});
  109. }
  110. }, function (response) {
  111. this.$message({message: response.data.msg, type: 'error'});
  112. })
  113. },
  114. submit() {
  115. let loading = this.$loading({
  116. target: document.querySelector(".content"),
  117. background: 'rgba(0, 0, 0, 0)'
  118. });
  119. this.$http.post('{!! yzWebFullUrl('setting.shop.email') !!}', {'email': this.form}).then(function (response) {
  120. if (response.data.result) {
  121. this.$message({message: response.data.msg, type: 'success'});
  122. } else {
  123. this.$message({message: response.data.msg, type: 'error'});
  124. }
  125. loading.close();
  126. location.reload();
  127. }, function (response) {
  128. this.$message({message: response.data.msg, type: 'error'});
  129. })
  130. },
  131. },
  132. });
  133. </script>
  134. @endsection