agreement.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-rich-text');
  4. ?>
  5. <style>
  6. .my-img {
  7. height: 50px;
  8. border: 1px solid #d7dae2;
  9. border-radius: 2px;
  10. margin-top: 10px;
  11. background-color: #e2e2e2;
  12. overflow: hidden;
  13. }
  14. .form-body {
  15. justify-content: center;
  16. }
  17. .form-body .el-form {
  18. margin-top: 10px;
  19. }
  20. .currency-width {
  21. width: 300px;
  22. }
  23. .currency-width .el-input__inner {
  24. height: 35px;
  25. line-height: 35px;
  26. border-radius: 8px;
  27. }
  28. .isAppend .el-input__inner {
  29. border-top-right-radius: 0;
  30. border-bottom-right-radius: 0;
  31. }
  32. .form-body .currency-width .el-input-group__append {
  33. width: 80px;
  34. background-color: #2E9FFF;
  35. color: #fff;
  36. padding: 0;
  37. line-height: 35px;
  38. height: 35px;
  39. text-align: center;
  40. border-radius: 8px;
  41. border-top-left-radius: 0;
  42. border-bottom-left-radius: 0;
  43. border: 0;
  44. }
  45. .preview {
  46. height: 75px;
  47. line-height: 75px;
  48. text-align: center;
  49. width: 200px;
  50. background-color: #F7F7F7;
  51. color: #BBBBBB;
  52. margin-top: 10px;
  53. font-size: 12px;
  54. }
  55. .qr-title:first-of-type {
  56. margin-top: 0;
  57. }
  58. .qr-title {
  59. color: #BBBBBB;
  60. font-size: 13px;
  61. margin-top: 10px;
  62. }
  63. .line {
  64. border: none;
  65. border-bottom: 1px solid #e2e2e2;
  66. margin: 40px 0;
  67. }
  68. .title {
  69. margin-bottom: 20px;
  70. }
  71. .submit-btn {
  72. height: 32px;
  73. width: 65px;
  74. line-height: 32px;
  75. text-align: center;
  76. border-radius: 16px;
  77. padding: 0;
  78. }
  79. </style>
  80. <div id="app" v-cloak>
  81. <el-card shadow="never" v-loading="loading" style="min-width: 1000px;">
  82. <div style="margin-bottom: 20px">签到规则</div>
  83. <div class='form-body' ref="body">
  84. <el-form label-position="left" label-width="150px" :model="form" ref="form">
  85. <el-form-item label="签到规则">
  86. <com-rich-text style="width: 750px" :simple-attachment="true" v-model="form.rule"></com-rich-text>
  87. </el-form-item>
  88. <!-- 分割线 -->
  89. <!-- <hr :style="line" class="line"> -->
  90. <el-form-item>
  91. <el-button class="submit-btn" type="primary" @click="submit" :loading="submitLoading">保存</el-button>
  92. </el-form-item>
  93. </el-form>
  94. </div>
  95. </el-card>
  96. </div>
  97. <script>
  98. new Vue({
  99. el: '#app',
  100. data() {
  101. return {
  102. loading: false,
  103. submitLoading: false,
  104. rule:'',
  105. line: {
  106. width: '450px',
  107. marginLeft: '-150px'
  108. },
  109. form: {
  110. rule: '',
  111. },
  112. params: {
  113. r: 'sign-in/default/agreement'
  114. },
  115. };
  116. },
  117. created() {
  118. this.loadData();
  119. this.$nextTick(function () {
  120. this.line.width = this.$refs.body.clientWidth + 'px';
  121. this.line.marginLeft = -(this.$refs.body.clientWidth - 450) / 2 + 'px';
  122. })
  123. },
  124. methods: {
  125. loadData() {
  126. this.loading = true;
  127. this.$request({
  128. params: {
  129. r: 'sign-in/default/agreement',
  130. },
  131. }).then(e => {
  132. console.log(e);
  133. this.loading = false;
  134. if (e.data.code === 0) {
  135. if (e.data.data.centent) {
  136. this.form.rule = e.data.data.centent;
  137. }
  138. } else {
  139. this.$message.error(e.data.msg);
  140. }
  141. }).catch(e => {
  142. });
  143. },
  144. submit() {
  145. this.submitLoading = true;
  146. this.$request({
  147. params: {
  148. r: 'sign-in/default/agreement',
  149. },
  150. method: 'post',
  151. data: {
  152. setting: this.form.rule,
  153. },
  154. }).then(e => {
  155. this.submitLoading = false;
  156. if (e.data.code === 0) {
  157. this.$message.success(e.data.msg);
  158. } else {
  159. this.$message.error(e.data.msg);
  160. }
  161. }).catch(e => {
  162. });
  163. },
  164. updateSuccess(e) {
  165. this.$message.success('上传成功')
  166. }
  167. }
  168. });
  169. </script>