index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="safeArea">
  3. <nav-bar title="我的考试"></nav-bar>
  4. <view class="examWrap">
  5. <view class="examItem" @click="goAppointment">
  6. <view class="item">模拟考试预约</view>
  7. <view class="item"><text class="note">去预约模拟考试</text><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  8. </view>
  9. <view class="examItem" @click="goList(0)">
  10. <view class="item">未考试</view>
  11. <view class="item"><text class="num">{{total1}}</text>个<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  12. </view>
  13. <view class="examItem" @click="goList(1)">
  14. <view class="item">已结束</view>
  15. <view class="item"><text class="num">{{total2}}</text>个<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  16. </view>
  17. <view class="examItem">
  18. <view class="item">
  19. <view @click="goResult">模拟考试讲解直播</view>
  20. <view class="desc" v-if="livingInfo"><text class="num">二建模考-法律讲解正在直播中,立即前往查看</text></view>
  21. </view>
  22. <view class="item"><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  23. </view>
  24. <view class="examItem" @click="mockRecord()">
  25. <view class="item">模考记录</view>
  26. <view class="item"><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import { mapGetters } from 'vuex';
  33. export default {
  34. components: {
  35. },
  36. data() {
  37. return {
  38. yyNum:0,
  39. total1:0,
  40. total2:0,
  41. livingInfo:null
  42. };
  43. },
  44. onLoad(){
  45. this.getCount()
  46. this.mockApplyMockLiving();
  47. },
  48. onShow() {
  49. // this.getInfo()
  50. },
  51. methods: {
  52. mockApplyMockLiving() {
  53. this.$api.mockApplyMockLiving().then(res => {
  54. if(res.data.data) {
  55. this.livingInfo = res.data.data;
  56. }
  57. })
  58. },
  59. mockRecord() {
  60. uni.navigateTo({
  61. url:'../mockRecord/mock_record'
  62. })
  63. },
  64. getCount() {
  65. this.$api.mockSubscribeListSubscribe({
  66. pageNum:1,
  67. pageSize:10,
  68. mockStatus:0,
  69. endTime:'',
  70. startTime:''
  71. }).then(res => {
  72. this.total1 = res.data.total
  73. })
  74. this.$api.mockSubscribeListSubscribe({
  75. pageNum:1,
  76. pageSize:10,
  77. mockStatus:1,
  78. endTime:'',
  79. startTime:''
  80. }).then(res => {
  81. this.total2 = res.data.total
  82. })
  83. },
  84. getInfo(){
  85. this.$api.getinfoAttached().then(res => {
  86. if (res.data.code === 200) {
  87. this.yyNum = res.data.data.subscribeSum;
  88. }
  89. });
  90. },
  91. goAppointment(){
  92. this.$navTo.togo('/pages5/examAppointList/index');
  93. },
  94. goList(state) {
  95. this.$navTo.togo('/pages5/examList/index?state='+state);
  96. },
  97. goResult(){
  98. console.log(111)
  99. this.$navTo.togo('/pages5/liveList/index');
  100. }
  101. },
  102. onReachBottom() {},
  103. computed: { ...mapGetters(['userInfo']) }
  104. };
  105. </script>
  106. <style >
  107. page {
  108. background: #EAEEF1;
  109. }
  110. </style>
  111. <style scoped lang="scss">
  112. .examWrap{
  113. padding: 16rpx;
  114. .examItem{
  115. padding:24rpx;
  116. background: #FFFFFF;
  117. box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
  118. border-radius: 16rpx;
  119. display: flex;
  120. justify-content: space-between;
  121. font-size: 32rpx;
  122. font-family: PingFang SC;
  123. font-weight: 500;
  124. color: #333333;
  125. margin-bottom: 16rpx;
  126. .num{
  127. color:#007AFF;
  128. text-decoration: underline;
  129. margin-right: 5rpx;
  130. }
  131. .desc {
  132. margin-top:30rpx;
  133. font-size: 28rpx;
  134. }
  135. .note {
  136. font-size: 24rpx;
  137. color:#999;
  138. }
  139. }
  140. }
  141. </style>