index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 style="flex:1;" @click="goResult">模拟考试讲解直播</view>
  20. <view class="desc" @click="goLive()" v-if="livingInfo"><text class="num">{{livingInfo.name}}讲解正在直播中,立即前往查看</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 {WEBVIEW_URL} from '@/common/request.js'
  33. import { mapGetters } from 'vuex';
  34. export default {
  35. components: {
  36. },
  37. data() {
  38. return {
  39. yyNum:0,
  40. total1:0,
  41. total2:0,
  42. livingInfo:null
  43. };
  44. },
  45. onLoad(){
  46. this.getCount()
  47. this.mockApplyMockLiving();
  48. },
  49. onShow() {
  50. // this.getInfo()
  51. },
  52. methods: {
  53. goLive() {
  54. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+this.livingInfo.liveUrl)
  55. uni.navigateTo({
  56. url:`../../pages/webview/index?url=`+encode
  57. })
  58. },
  59. mockApplyMockLiving() {
  60. this.$api.mockApplyMockLiving().then(res => {
  61. if(res.data.data) {
  62. this.livingInfo = res.data.data;
  63. }
  64. })
  65. },
  66. mockRecord() {
  67. uni.navigateTo({
  68. url:'../mockRecord/mock_record'
  69. })
  70. },
  71. getCount() {
  72. this.$api.mockSubscribeListSubscribe({
  73. pageNum:1,
  74. pageSize:10,
  75. mockStatus:0,
  76. endTime:'',
  77. startTime:''
  78. }).then(res => {
  79. this.total1 = res.data.total
  80. })
  81. this.$api.mockSubscribeListSubscribe({
  82. pageNum:1,
  83. pageSize:10,
  84. mockStatus:1,
  85. endTime:'',
  86. startTime:''
  87. }).then(res => {
  88. this.total2 = res.data.total
  89. })
  90. },
  91. getInfo(){
  92. this.$api.getinfoAttached().then(res => {
  93. if (res.data.code === 200) {
  94. this.yyNum = res.data.data.subscribeSum;
  95. }
  96. });
  97. },
  98. goAppointment(){
  99. this.$navTo.togo('/pages5/examAppointList/index');
  100. },
  101. goList(state) {
  102. this.$navTo.togo('/pages5/examList/index?state='+state);
  103. },
  104. goResult(){
  105. console.log(111)
  106. this.$navTo.togo('/pages5/liveList/index');
  107. }
  108. },
  109. onReachBottom() {},
  110. computed: { ...mapGetters(['userInfo']) }
  111. };
  112. </script>
  113. <style >
  114. page {
  115. background: #EAEEF1;
  116. }
  117. </style>
  118. <style scoped lang="scss">
  119. .examWrap{
  120. padding: 16rpx;
  121. .examItem{
  122. padding:24rpx;
  123. background: #FFFFFF;
  124. box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
  125. border-radius: 16rpx;
  126. display: flex;
  127. justify-content: space-between;
  128. font-size: 32rpx;
  129. font-family: PingFang SC;
  130. font-weight: 500;
  131. color: #333333;
  132. margin-bottom: 16rpx;
  133. .num{
  134. color:#007AFF;
  135. text-decoration: underline;
  136. margin-right: 5rpx;
  137. }
  138. .desc {
  139. margin-top:30rpx;
  140. font-size: 28rpx;
  141. }
  142. .note {
  143. font-size: 24rpx;
  144. color:#999;
  145. }
  146. }
  147. }
  148. </style>