index.vue 3.8 KB

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