points.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="app-container ">
  3. <el-form ref="form" size="small" :model="form" :rules="rules" label-width="180px">
  4. <el-tabs v-model="activeName">
  5. <el-tab-pane style="padding-top:10px" :label="'送'+lang.points+'设置'" :name="'送'+lang.points+'设置'">
  6. <el-row>
  7. <el-col :span="24">
  8. <el-form-item :label="'开启统一送'+lang.points+'设置'" prop="status">
  9. <el-switch v-model="form.status" active-value="1" inactive-value="0" />
  10. </el-form-item>
  11. </el-col>
  12. </el-row>
  13. <el-row>
  14. <el-col :span="24">
  15. <el-form-item label="邀请新用户">
  16. <el-input-number
  17. v-model="form.addmember"
  18. controls-position="right"
  19. style="width:300px;"
  20. auto-complete="off"
  21. clearable
  22. :min="0"
  23. placeholder="邀请新用户加多少分"
  24. />
  25. </el-form-item>
  26. </el-col>
  27. </el-row>
  28. <el-row>
  29. <el-col :span="24">
  30. <el-form-item label="邀请分销达人">
  31. <el-input-number
  32. v-model="form.addagent"
  33. controls-position="right"
  34. style="width:300px;"
  35. auto-complete="off"
  36. clearable
  37. :min="0"
  38. placeholder="邀请分销达人加多少分"
  39. />
  40. </el-form-item>
  41. </el-col>
  42. </el-row>
  43. <el-row>
  44. <el-col :span="24">
  45. <el-form-item :label="'邀请'+lang.technical+'入驻'">
  46. <el-input-number
  47. v-model="form.addtechnical"
  48. controls-position="right"
  49. style="width:300px;"
  50. auto-complete="off"
  51. clearable
  52. :min="0"
  53. :placeholder="'邀请'+lang.technical+'入驻加多少分'"
  54. />
  55. </el-form-item>
  56. </el-col>
  57. </el-row>
  58. <el-row>
  59. <el-col :span="24">
  60. <el-form-item label="邀请商户入驻">
  61. <el-input-number
  62. v-model="form.addstore"
  63. controls-position="right"
  64. style="width:300px;"
  65. auto-complete="off"
  66. clearable
  67. :min="0"
  68. placeholder="邀请商户入驻加多少分"
  69. />
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. </el-tab-pane>
  74. </el-tabs>
  75. <el-form-item>
  76. <el-button size="small" type="primary" @click="submit">保存设置</el-button>
  77. </el-form-item>
  78. </el-form>
  79. </div>
  80. </template>
  81. <script>
  82. export default {
  83. name: 'Configpoints',
  84. components: {
  85. },
  86. data() {
  87. return {
  88. lang: {},
  89. form: {
  90. addcustomer: '',
  91. adddongtai: '',
  92. upjieduan: '',
  93. deal: '',
  94. status: 0
  95. },
  96. loading: false,
  97. activeName: '',
  98. rules: {
  99. }
  100. }
  101. },
  102. mounted() {
  103. this.$api.post('/Lang/getlang').then(res => {
  104. this.lang = res.data
  105. this.activeName = '送'+this.lang.points +"设置";
  106. })
  107. this.$api.post('/config/getInfo', { mo: 'points' }).then(res => {
  108. this.form = JSON.stringify(res.data) == '[]' ? {} : res.data
  109. this.setDefaultVal('keyword')
  110. })
  111. },
  112. methods: {
  113. submit() {
  114. this.$refs['form'].validate(valid => {
  115. if (valid) {
  116. this.loading = true
  117. this.$api.post('/config/update', this.form).then(res => {
  118. this.$message({ message: '操作成功', type: 'success' })
  119. }).catch(() => {
  120. this.loading = false
  121. })
  122. }
  123. })
  124. },
  125. setDefaultVal(key) {
  126. if (this.form[key] == null || this.form[key] == '') {
  127. this.form[key] = []
  128. }
  129. }
  130. }
  131. }
  132. </script>