index.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. ?>
  3. <style>
  4. .el-tabs__header {
  5. padding: 0 20px;
  6. height: 56px;
  7. line-height: 56px;
  8. background-color: #fff;
  9. margin-bottom: 0;
  10. }
  11. .form-body {
  12. background-color: #fff;
  13. padding: 20px 50% 20px 0;
  14. }
  15. .button-item {
  16. padding: 9px 25px;
  17. }
  18. .form-body .item {
  19. width: 300px;
  20. margin-bottom: 50px;
  21. margin-right: 25px;
  22. }
  23. .item .el-form-item {
  24. width: 300px;
  25. margin: 20px auto;
  26. }
  27. .form_box {
  28. background-color: #f3f3f3;
  29. padding: 0 0 20px;
  30. }
  31. .button-item {
  32. /* margin-top: 12px; */
  33. padding: 9px 25px;
  34. }
  35. .el-input-group__append {
  36. background-color: #fff;
  37. color: #353535;
  38. }
  39. .el-radio-group {
  40. font-size: 13px;
  41. line-height: 32px;
  42. }
  43. </style>
  44. <div id="app" v-cloak>
  45. <div style="display:flex;justify-content:space-between;align-items:center;background-color:#FFF;padding: 10px 20px;font-weight:800px;font-size:15px;margin-bottom:10px;">
  46. <div>基础设置</div>
  47. <div>
  48. <el-button :loading="btnLoading" class="button-item" type="primary" @click="store('ruleForm')" size="small">
  49. 保存
  50. </el-button>
  51. </div>
  52. </div>
  53. <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 0px;">
  54. <el-form :model="ruleForm" size="small" :rules="rules" ref="ruleForm" label-width="160px">
  55. <el-card shadow="never">
  56. <div>
  57. <el-row>
  58. <el-col :span="16">
  59. <el-form-item label="限制收货信息">
  60. <div>
  61. <el-switch v-model="ruleForm.is_limit_address" :active-value="1" :inactive-value="0">
  62. </el-switch>
  63. </div>
  64. </el-form-item>
  65. </el-col>
  66. </el-row>
  67. </div>
  68. </el-card>
  69. </el-form>
  70. </el-card>
  71. </div>
  72. <script>
  73. const app = new Vue({
  74. el: '#app',
  75. data() {
  76. return {
  77. loading: false,
  78. btnLoading: false,
  79. ruleForm: {
  80. is_limit_address: 0, //是否启用 限制收货地址
  81. },
  82. rules: {
  83. },
  84. }
  85. },
  86. mounted: function() {
  87. this.loadData()
  88. },
  89. watch: {
  90. },
  91. methods: {
  92. loadData() {
  93. this.loading = true;
  94. request({
  95. params: {
  96. r: 'score-mall/setting/index',
  97. },
  98. method: 'get'
  99. }).then(e => {
  100. this.loading = false;
  101. if (e.data.code == 0) {
  102. Object.assign(this.ruleForm, e.data.data);
  103. }
  104. }).catch(e => {
  105. this.loading = false;
  106. })
  107. },
  108. store(formName) {
  109. this.btnLoading = true;
  110. request({
  111. params: {
  112. r: 'score-mall/setting/index',
  113. },
  114. method: 'post',
  115. data: this.ruleForm
  116. }).then(e => {
  117. this.btnLoading = false;
  118. if (e.data.code == 0) {
  119. this.$message.success(e.data.msg);
  120. } else {
  121. this.$message.error(e.data.msg);
  122. }
  123. }).catch(e => {
  124. this.$message.error(e);
  125. this.btnLoading = false;
  126. })
  127. },
  128. }
  129. });
  130. </script>