cloudRecharge.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div class="cloudRecharge">
  3. <div class="descriptions-container">
  4. <div class="descriptions">
  5. <div class="title">云教室扣费规则</div>
  6. <div class="tips" style="line-height: 30px;">
  7. 1.系统根据线上课课程人数(含老师)进行扣费;<br />
  8. 2.每节线上课平台赠送10分钟免费时长,分别为课前5分钟及课后5分钟,赠送时长不计算费用;<br />
  9. 3.扣费金额按排课人数计算,无论实际到课人数是否为排课人数,都会按照排课人数扣费;<br />
  10. 4.课程结束后费用立即结算;<br />
  11. 5.云教室余额不足时,老师及学员将无法进入云教室,为了保障老师及学员能够正常上课,请及时对云教室进行充值。
  12. </div>
  13. </div>
  14. <div class="descriptions">
  15. <div class="title">云教室扣费标准</div>
  16. <div class="tips">
  17. <p style="padding-bottom: 10px">以1v1课程,既老师学员1对1教学,45分钟课程为例,每分钟收费标准0.2元,则该课程结束后将扣除云教室费用45分钟*0.2元/分钟=9元</p>
  18. <el-table
  19. :data="tableData"
  20. border
  21. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  22. style="width: 100%;"
  23. >
  24. <el-table-column align="center" label="云教室扣费标准" width="180">
  25. <template slot-scope="scope">
  26. {{ scope.row.num }}人
  27. </template>
  28. </el-table-column>
  29. <el-table-column align="center" label="云教室扣费标准">
  30. <template slot-scope="scope">
  31. {{ scope.row.minute }}元/分钟
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. </div>
  36. </div>
  37. </div>
  38. <el-form inline ref="form" :model="form" label-width="80px">
  39. <el-form-item label="充值金额"
  40. prop="amount"
  41. :rules="[{ required: true, message: '请输入充值金额', trigger: 'blur' },
  42. { required: true, validator: validPrice, trigger: 'blur' }]">
  43. <el-input v-model="form.amount" placeholder="请输入充值金额"
  44. oninput="value=value.indexOf('.') > -1?value.slice(0, value.indexOf('.') + 3):value"
  45. type="number">
  46. <div slot="append">元</div>
  47. </el-input>
  48. </el-form-item>
  49. <el-form-item>
  50. <el-button type="primary" @click="onRecharge" v-if="$helpers.permission('tenantInfo/recharge')">确认充值</el-button>
  51. </el-form-item>
  52. </el-form>
  53. <el-dialog
  54. title="服务订单"
  55. :visible.sync="cloudVisible"
  56. width="1000px"
  57. v-if="cloudVisible"
  58. append-to-body
  59. >
  60. <rechargeModel :amount="form.amount" v-on="$listeners" @close="cloudVisible = false" />
  61. </el-dialog>
  62. </div>
  63. </template>
  64. <script>
  65. import rechargeModel from '@/views/productService/model/rechargeModel'
  66. export default {
  67. name: 'cloudRecharge',
  68. components: {
  69. rechargeModel
  70. },
  71. data() {
  72. return {
  73. cloudVisible: false,
  74. form: {
  75. amount: null
  76. },
  77. tableData: [{
  78. num: 2,
  79. minute: 0.5
  80. }, {
  81. num: 3,
  82. minute: 0.5
  83. }]
  84. }
  85. },
  86. methods: {
  87. onRecharge() {
  88. this.$refs.form.validate(async (_) => {
  89. if(_) {
  90. this.cloudVisible = true
  91. }
  92. })
  93. },
  94. validPrice (rule, value, callback) {
  95. if ((value == "" && typeof value == "string") || value == null) {
  96. callback(new Error("请输入金额"));
  97. } else if (value <= 0) {
  98. callback(new Error("输入金额必须大于0"));
  99. } else if (value >= 100000) {
  100. callback(new Error("输入金额必须小于100000"));
  101. } else {
  102. callback();
  103. }
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="less" scoped>
  109. .descriptions-container {
  110. display: flex;
  111. // align-items: center;
  112. justify-content: space-between;
  113. margin-bottom: 15px;
  114. .descriptions {
  115. width: 49%;
  116. min-height: 170px;
  117. background-color: #f8f8f8;
  118. border-radius: 6px;
  119. border: 1px solid rgba(0, 0, 0, 0.1);
  120. .title {
  121. display: flex;
  122. align-items: center;
  123. justify-content: space-between;
  124. padding: 20px 0 15px;
  125. margin: 0 20px 5px;
  126. line-height: 30px;
  127. font-size: 21px;
  128. font-weight: 500;
  129. border-bottom: 1px solid #979797;
  130. }
  131. }
  132. .tips {
  133. padding: 10px 20px 18px;
  134. font-size: 16px;
  135. font-weight: 400;
  136. color: #212121;
  137. line-height: 22px;
  138. }
  139. }
  140. .el-input, .el-select {
  141. width: 300px !important;
  142. }
  143. </style>