openkemu.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view>
  3. <!--#ifdef APP-PLUS-->
  4. <view class="lz-status_bar">
  5. <view class="lz-top_view"></view>
  6. </view>
  7. <!--#endif-->
  8. <!-- #ifndef MP-WEIXIN -->
  9. <view class="kaoshi-head">
  10. <view class="kaoshi-head-top">
  11. <view class="kaoshi-head-left" @tap="$navigateBack">
  12. <view class="iconfont icon-zuojiantou"></view>
  13. </view>
  14. <view class="kaoshi-head-m">已开通科目</view>
  15. </view>
  16. </view>
  17. <!--#endif-->
  18. <view class="kemulist" v-if="myexchange.length > 0">
  19. <view class="kemubox" v-for="(item,index) in myexchange">
  20. <view class="kemutitle">{{item.subject_name}}</view>
  21. <view class="kemutime">到期时间:{{$myUtils.$common.formatDate(item.end_time * 1000,"Y年M月D日 h:m:s")}}</view>
  22. </view>
  23. </view>
  24. <view class="nokemu" v-else>
  25. <image src="../../static/img/mescroll-empty.png" mode="aspectFit" class="nokemuimg"></image>
  26. <view class="nokemutitle">暂无已开通科目</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. myexchange: [],
  35. }
  36. },
  37. onLoad() {
  38. this.getmyexchange()
  39. },
  40. methods: {
  41. async getmyexchange() {
  42. let res = await this.$myHttp.post({
  43. url: this.$myHttp.urlMap.myexchange,
  44. data: {
  45. page: 1,
  46. limit: 999,
  47. },
  48. needLogin: true
  49. })
  50. if (res.code == 1) {
  51. this.myexchange = res.data.data
  52. }
  53. },
  54. }
  55. }
  56. </script>
  57. <style>
  58. page {
  59. background: #f6f6f6;
  60. }
  61. .nokemu {
  62. display: flex;
  63. flex-direction: column;
  64. justify-content: center;
  65. align-items: center;
  66. }
  67. .nokemuimg {
  68. width: 150px;
  69. height: 150px;
  70. margin-top: 30px;
  71. }
  72. .nokemutitle {
  73. margin-top: 10px;
  74. font-size: 12px;
  75. color: gray;
  76. }
  77. .kemulist {
  78. margin: 0 15px;
  79. }
  80. .kemubox {
  81. margin: 15px 0;
  82. padding: 15px;
  83. border-radius: 8px;
  84. background-color: #fff;
  85. box-shadow: 2px 4px 10px rgb(0 0 0 / 8%);
  86. }
  87. .kemutitle {
  88. width: 100%;
  89. white-space: nowrap;
  90. text-overflow: ellipsis;
  91. overflow: hidden;
  92. margin-bottom: 6px;
  93. color: #333;
  94. }
  95. .kemutime {
  96. color: #999;
  97. font-size: 13px;
  98. }
  99. </style>