index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>产品服务
  5. </h2>
  6. <div class="m-core">
  7. <!-- navMenu -->
  8. <div class="descriptions-container">
  9. <div class="descriptions">
  10. <div class="title">服务信息</div>
  11. <el-row>
  12. <el-col :span="15">当前版本:<span class="color">{{ dataInfo.serverName }}</span></el-col>
  13. <el-col :span="9">学员上限:<span class="color">{{ dataInfo.studentNum }}</span> / {{ dataInfo.studentUpLimit }}人</el-col>
  14. <el-col :span="15">服务有效期:<span class="color" v-if="dataInfo.expiryDate && dataInfo.expiryDateEnd">{{ dataInfo.expiryDate }} ~ {{ dataInfo.expiryDateEnd }}</span></el-col>
  15. <el-col :span="9">有效期剩余:<span class="color">{{ dataInfo.validRemaining }}天</span></el-col>
  16. </el-row>
  17. </div>
  18. <div class="descriptions small">
  19. <div class="title">云教室余额 <el-button type="text" size="small" @click="onDetail">扣费记录 >></el-button></div>
  20. <el-row>
  21. <el-col :span="24">云教室总余额:<span class="color">{{ dataInfo.sumBalance | hasMoneyFormat }}</span></el-col>
  22. <!-- <el-col :span="24">冻结余额<el-tooltip placement="top" popper-class="mTooltip">
  23. <div slot="content">已排线上课预计服务费用总和,课程结束后扣减</div>
  24. <i
  25. class="el-icon-question micon el-tooltip"
  26. style="
  27. font-size: 18px;
  28. color: #f56c6c;
  29. top: 2px;
  30. position: relative;
  31. "
  32. ></i>
  33. </el-tooltip>:<span class="color">{{ dataInfo.frozenAmount | hasMoneyFormat }}</span></el-col>
  34. <el-col :span="24">可用余额<el-tooltip placement="top" popper-class="mTooltip">
  35. <div slot="content">排线上课时系统计算预计服务费用,从该余额中进行冻结,若预计服务费用大于该余额则不可排线上课</div>
  36. <i
  37. class="el-icon-question micon el-tooltip"
  38. style="
  39. font-size: 18px;
  40. color: #f56c6c;
  41. top: 2px;
  42. position: relative;
  43. "
  44. ></i>
  45. </el-tooltip>:<span class="color">{{ dataInfo.balance | hasMoneyFormat }}</span></el-col> -->
  46. </el-row>
  47. </div>
  48. </div>
  49. <tab-router
  50. v-model="activeIndex"
  51. ref="tab"
  52. >
  53. <!-- <el-tab-pane
  54. label="服务续费"
  55. lazy
  56. v-if="permission('/serviceRenew')"
  57. name="1"
  58. >
  59. </el-tab-pane> -->
  60. <el-tab-pane
  61. label="云教室充值"
  62. lazy
  63. v-if="permission('/cloudRecharge')"
  64. name="2"
  65. >
  66. <cloud-recharge v-if="activeIndex == 2" />
  67. </el-tab-pane>
  68. </tab-router>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import cloudRecharge from '@/views/productService/components/cloudRecharge'
  74. import { permission } from "@/utils/directivePage";
  75. import { queryTenantInfoSumm } from "./api";
  76. import dayjs from 'dayjs'
  77. // forecastName,
  78. export default {
  79. components: {
  80. cloudRecharge
  81. },
  82. name: "productService",
  83. data() {
  84. return {
  85. activeIndex: "2",
  86. dataInfo: {
  87. serverName: null,
  88. expiryDate: null,
  89. expiryDateEnd: null,
  90. studentNum: 0,
  91. studentUpLimit: 0,
  92. validRemaining: 0,
  93. sumBalance: 0,
  94. frozenAmount: 0,
  95. balance: 0
  96. }
  97. };
  98. },
  99. mounted() {
  100. this.__init();
  101. },
  102. methods: {
  103. permission,
  104. async __init() {
  105. try {
  106. const res = await queryTenantInfoSumm()
  107. console.log(res)
  108. this.dataInfo = res.data || {}
  109. this.dataInfo.expiryDate = res.data.expiryDate ? dayjs(res.data.expiryDate).format('YYYY-MM-DD') : null
  110. this.dataInfo.expiryDateEnd = res.data.expiryDateEnd ? dayjs(res.data.expiryDateEnd).format('YYYY-MM-DD') : null
  111. this.dataInfo.validRemaining = res.data.validRemaining || 0
  112. } catch(e) { }
  113. },
  114. onDetail() {
  115. this.$router.push('/federationManager/chargingRecord')
  116. }
  117. }
  118. };
  119. </script>
  120. <style lang="scss" scoped>
  121. .descriptions-container {
  122. display: flex;
  123. align-items: center;
  124. .descriptions {
  125. width: 600px;
  126. min-height: 170px;
  127. background-color: #f7f7f7;
  128. border-radius: 5px;
  129. &.small {
  130. margin-left: 15px;
  131. width: 300px;
  132. }
  133. .title {
  134. display: flex;
  135. align-items: center;
  136. justify-content: space-between;
  137. padding: 12px 15px;
  138. line-height: 1.5;
  139. font-size: 18px;
  140. font-weight: bold;
  141. }
  142. }
  143. .el-row {
  144. padding: 0 12px;
  145. }
  146. .el-col {
  147. height: 30px;
  148. line-height: 30px;
  149. }
  150. .color {
  151. color: var(--color-primary);
  152. font-weight: bold;
  153. }
  154. }
  155. </style>