index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 config from '@/common/config'
  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. this.getCount()
  52. this.mockApplyMockLiving();
  53. },
  54. methods: {
  55. goLive() {
  56. let uuid = new Date().valueOf() + ""
  57. // buyCourse 是否购买课程:1是 0否
  58. let encode = encodeURIComponent(config.WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  59. +this.livingInfo.liveUrl+'&buyCourse=1'+'&ident='+uuid)
  60. uni.navigateTo({
  61. url:`../../pages/webview/index?url=`+encode
  62. })
  63. },
  64. mockApplyMockLiving() {
  65. this.$api.mockApplyMockLiving().then(res => {
  66. if(res.data.data) {
  67. this.livingInfo = res.data.data;
  68. }
  69. })
  70. },
  71. mockRecord() {
  72. uni.navigateTo({
  73. url:'../mockRecord/mock_record'
  74. })
  75. },
  76. getCount() {
  77. this.$api.mockSubscribeListSubscribe({
  78. pageNum:1,
  79. pageSize:10,
  80. mockStatus:0,
  81. endTime:'',
  82. startTime:''
  83. }).then(res => {
  84. this.total1 = res.data.total
  85. })
  86. this.$api.mockSubscribeListSubscribe({
  87. pageNum:1,
  88. pageSize:10,
  89. mockStatus:1,
  90. endTime:'',
  91. startTime:''
  92. }).then(res => {
  93. this.total2 = res.data.total
  94. })
  95. },
  96. getInfo(){
  97. this.$api.getinfoAttached().then(res => {
  98. if (res.data.code === 200) {
  99. this.yyNum = res.data.data.subscribeSum;
  100. }
  101. });
  102. },
  103. goAppointment(){
  104. this.$navTo.togo('/pages5/examAppointList/index');
  105. },
  106. goList(state) {
  107. this.$navTo.togo('/pages5/examList/index?state='+state);
  108. },
  109. goResult(){
  110. this.$navTo.togo('/pages5/liveList/index');
  111. }
  112. },
  113. onReachBottom() {},
  114. computed: { ...mapGetters(['userInfo']) }
  115. };
  116. </script>
  117. <style >
  118. page {
  119. background: #EAEEF1;
  120. }
  121. </style>
  122. <style scoped lang="scss">
  123. .examWrap{
  124. padding: 16rpx;
  125. .examItem{
  126. padding:24rpx;
  127. background: #FFFFFF;
  128. box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
  129. border-radius: 16rpx;
  130. display: flex;
  131. justify-content: space-between;
  132. font-size: 32rpx;
  133. font-family: PingFang SC;
  134. font-weight: 500;
  135. color: #333333;
  136. margin-bottom: 16rpx;
  137. .num{
  138. color:#007AFF;
  139. text-decoration: underline;
  140. margin-right: 5rpx;
  141. }
  142. .desc {
  143. margin-top:30rpx;
  144. font-size: 28rpx;
  145. }
  146. .note {
  147. font-size: 24rpx;
  148. color:#999;
  149. }
  150. }
  151. }
  152. </style>