setting.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <div id="app" v-cloak>
  2. <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1250px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div class="form_body">
  4. <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
  5. <el-card shadow="never">
  6. <div slot="header">
  7. <div>
  8. <span>基础设置</span>
  9. </div>
  10. </div>
  11. <div>
  12. <el-row>
  13. <el-col :span="16">
  14. <el-form-item label="是否启用插件" style="margin-bottom: 20px;">
  15. <div>
  16. <el-switch v-model="ruleForm.is_enable" :active-value="1" :inactive-value="0"></el-switch>
  17. </div>
  18. <br/>
  19. <div class="tips-text" style="line-height: 24px;">
  20. 启用亲友卡,会员升级才会赠送
  21. </div>
  22. </el-form-item>
  23. <el-form-item prop="settlement_method" label="佣金结算方式">
  24. <el-col :span="8" style="width: 100%;">
  25. <el-radio-group v-model="ruleForm.settlement_method" size="small">
  26. <el-radio :label="0" border>订单完成后</el-radio>
  27. <el-radio :label="1" border>订单付款后</el-radio>
  28. </el-radio-group>
  29. </el-col>
  30. <br/>
  31. <div class="tips-text" style="line-height: 24px;">
  32. 子卡消费,母卡能拿到的佣金结算方式
  33. </div>
  34. </el-form-item>
  35. <el-form-item label="提醒通知设置" style="margin-bottom: 20px;">
  36. <div>
  37. <el-switch v-model="ruleForm.is_remind" :active-value="1" :inactive-value="0"></el-switch>
  38. </div>
  39. </el-form-item>
  40. <el-form-item prop="remind_days" label="亲友卡剩余" v-if="ruleForm.is_remind">
  41. <el-col :span="20" style="display: flex;align-items: flex-start;">
  42. <el-input type="number" v-model="ruleForm.remind_days" :min="0" class="member-money" placeholder="" style="width: 200px;margin-right: 20px;">
  43. <template slot="append">天</template>
  44. </el-input>
  45. <div>发送提醒通知</div>
  46. </el-col>
  47. </el-form-item>
  48. <el-form-item label="领取说明" prop="description">
  49. <el-input type="textarea" :rows="3" placeholder="领取说明"
  50. v-model="ruleForm.description" maxlength="20" show-word-limit></el-input>
  51. </el-form-item>
  52. </el-col>
  53. </el-row>
  54. </div>
  55. </el-card>
  56. </el-form>
  57. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;"
  58. @click="store('ruleForm')" size="small">保存
  59. </el-button>
  60. </div>
  61. </el-card>
  62. </div>
  63. <script>
  64. const app = new Vue({
  65. el: '#app',
  66. data() {
  67. return {
  68. loading: false,
  69. btnLoading: false,
  70. ruleForm: {
  71. is_enable: 0,
  72. management_fee:0,
  73. settlement_method:0,
  74. is_remind:0,
  75. remind_days:0,
  76. description:'',
  77. },
  78. }
  79. },
  80. mounted: function () {
  81. this.loadData();
  82. },
  83. methods: {
  84. loadData() {
  85. this.loading = true;
  86. request({
  87. params: {
  88. r: 'members-card/default/setting',
  89. },
  90. method: 'get'
  91. }).then(e => {
  92. this.loading = false;
  93. if (e.data.code == 0 && !isEmpty(e.data.data)) {
  94. this.ruleForm = e.data.data;
  95. }
  96. }).catch(e => {
  97. this.loading = false;
  98. })
  99. },
  100. store(formName) {
  101. this.$refs[formName].validate((valid) => {
  102. if (valid) {
  103. this.btnLoading = true;
  104. request({
  105. params: {
  106. r: 'members-card/default/setting',
  107. },
  108. method: 'post',
  109. data: this.ruleForm
  110. }).then(e => {
  111. this.btnLoading = false;
  112. if (e.data.code == 0) {
  113. this.$message.success(e.data.msg);
  114. } else {
  115. this.$message.error(e.data.msg);
  116. }
  117. }).catch(e => {
  118. this.$message.error(e);
  119. this.btnLoading = false;
  120. })
  121. } else {
  122. this.btnLoading = false;
  123. console.log('error submit!!');
  124. return false;
  125. }
  126. });
  127. },
  128. }
  129. });
  130. </script>
  131. <style>
  132. .form-body {
  133. padding: 20px;
  134. background-color: #fff;
  135. margin-bottom: 20px;
  136. padding-right: 20%;
  137. min-width: 900px;
  138. }
  139. .form-body .el-form-item {
  140. padding-right: 25%;
  141. min-width: 850px;
  142. }
  143. .form-button {
  144. margin: 0;
  145. }
  146. .form-button .el-form-item__content {
  147. margin-left: 0 !important;
  148. }
  149. .button-item {
  150. padding: 9px 25px;
  151. }
  152. .check-group {
  153. font-size: 14px !important;
  154. }
  155. .check-group .el-col {
  156. display: flex;
  157. }
  158. .check-group .el-input {
  159. margin: 0 5px;
  160. }
  161. .check-group .el-col .el-checkbox {
  162. display: flex;
  163. align-items: center;
  164. }
  165. .check-group .el-col .el-input {
  166. width: 100px;
  167. }
  168. .check-group .el-col .el-input .el-input__inner {
  169. height: 30px;
  170. width: 100px;
  171. }
  172. .el-checkbox-group .el-col {
  173. margin-bottom: 10px;
  174. }
  175. .condition_common {
  176. display: flex;
  177. align-items: center;
  178. }
  179. .condition_common_five {
  180. display: flex;
  181. }
  182. </style>