Account.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="account">
  3. <m-header v-if="headerStatus" />
  4. <!-- <div class="accountHeader">
  5. <div class="bgColor"></div>
  6. <van-row class="content" type="flex" justify="center" align="center">
  7. <van-col span="24">
  8. 剩余时间<span>{{ availableMinutes }}</span>
  9. </van-col>
  10. <van-col span="12">
  11. <i class="icon icon_lock"></i>冻结时间<span class="lock">{{ frozenMinutes }}</span>
  12. </van-col>
  13. </van-row>
  14. </div> -->
  15. <van-cell-group style="margin-bottom: .15rem;">
  16. <van-cell title="剩余时间" >
  17. <i class="icon icon_times" slot="icon"></i>
  18. <div slot="default" class="available">
  19. {{ availableMinutes | calcMinute }}
  20. </div>
  21. </van-cell>
  22. </van-cell-group>
  23. <van-cell-group>
  24. <van-cell title="课时兑换" is-link to="periodExchange" >
  25. <i class="icon icon_change" slot="icon"></i>
  26. </van-cell>
  27. <van-cell title="兑换记录" is-link to="exchangeRecord" >
  28. <i class="icon icon_record" slot="icon"></i>
  29. </van-cell>
  30. <van-cell title="课时使用记录" is-link to="periodRecord" >
  31. <i class="icon icon_use" slot="icon"></i>
  32. </van-cell>
  33. </van-cell-group>
  34. </div>
  35. </template>
  36. <script>
  37. /* eslint-disable */
  38. import MHeader from '@/components/MHeader'
  39. import { browser, calcMinute } from '@/common/common'
  40. import { sysTenantAccountGet } from '@/api/app'
  41. export default {
  42. name: 'courseApply',
  43. components: { MHeader },
  44. data() {
  45. return {
  46. headerStatus: true,
  47. availableMinutes: 0,
  48. frozenMinutes: 0
  49. }
  50. },
  51. mounted() {
  52. let params = this.$route.query
  53. if(params.Authorization) {
  54. localStorage.setItem('Authorization', decodeURI(params.Authorization))
  55. localStorage.setItem('userInfo', decodeURI(params.Authorization))
  56. }
  57. document.title = '我的账户'
  58. if(browser().android || browser().iPhone) {
  59. this.headerStatus = false
  60. }
  61. this.__init()
  62. },
  63. methods: {
  64. __init() {
  65. this.$toast.loading({
  66. duration: 0,
  67. message: '加载中...',
  68. forbidClick: true,
  69. loadingType: 'spinner'
  70. })
  71. sysTenantAccountGet().then(res => {
  72. let result = res.data
  73. this.$toast.clear()
  74. if(result.code == 200) {
  75. let tempResult = result.data
  76. if(tempResult) {
  77. this.availableMinutes = (tempResult.availableMinutes ? tempResult.availableMinutes : 0)
  78. }
  79. } else {
  80. this.$toast(result.msg)
  81. }
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang='less' scoped>
  88. @import url("../../assets/commonLess/variable.less");
  89. .account {
  90. min-height: 100vh;
  91. }
  92. // .accountHeader {
  93. // background: #fff;
  94. // padding-bottom: .2rem;
  95. // .bgColor {
  96. // margin-top: -1px;
  97. // height: .9rem;
  98. // background: #14928A;
  99. // }
  100. // .content {
  101. // height:74px;
  102. // background: rgba(255,255,255,1);
  103. // box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.19);
  104. // border-radius: .08rem;
  105. // margin: -.5rem .16rem 0;
  106. // text-align: center;
  107. // .van-col {
  108. // color: #1A1A1A;
  109. // display: flex;
  110. // align-items: center;
  111. // // justify-content: center;
  112. // padding-left: .2rem;
  113. // // &:first-child {
  114. // // border-right: 1px solid #CCCCCC;
  115. // // }
  116. // span {
  117. // padding-left: .1rem;
  118. // color: #FF0909;
  119. // &.lock {
  120. // color: #999999;
  121. // }
  122. // }
  123. // }
  124. // }
  125. // }
  126. .icon {
  127. display: inline-block;
  128. width: 0.2rem;
  129. height: 0.22rem;
  130. margin-right: .05rem;
  131. margin-top: -0.02rem;
  132. }
  133. .icon_times {
  134. background: url('../../assets/images/app/icon_times.png') no-repeat center center;
  135. background-size: contain;
  136. }
  137. .icon_lock {
  138. background: url('../../assets/images/app/icon_lock.png') no-repeat center center;
  139. background-size: contain;
  140. }
  141. .icon_change {
  142. background: url('../../assets/images/app/icon_change.png') no-repeat center center;
  143. background-size: contain;
  144. }
  145. .icon_record {
  146. background: url('../../assets/images/app/icon_record.png') no-repeat center center;
  147. background-size: contain;
  148. }
  149. .icon_use {
  150. background: url('../../assets/images/app/icon_use.png') no-repeat center center;
  151. background-size: contain;
  152. }
  153. /deep/.van-cell-group {
  154. &::after {
  155. border-width: 0;;
  156. }
  157. /deep/.van-cell {
  158. padding: .16rem;
  159. align-items: center;
  160. .available {
  161. color: #FF0909;
  162. font-size: .17rem;
  163. }
  164. }
  165. }
  166. /deep/.van-cell__title {
  167. flex: 1 auto;
  168. font-size: .16rem;
  169. color: #1A1A1A;
  170. }
  171. </style>