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 { 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. this.getCount()
  51. this.mockApplyMockLiving();
  52. },
  53. methods: {
  54. goLive() {
  55. let uuid = new Date().valueOf() + ""
  56. // buyCourse 是否购买课程:1是 0否
  57. let encode = encodeURIComponent(this.other.hostLive+'/pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  58. +this.livingInfo.liveUrl+'&buyCourse=1'+'&ident='+uuid)
  59. uni.navigateTo({
  60. url:`/pages5/webview/index?url=`+encode
  61. })
  62. },
  63. mockApplyMockLiving() {
  64. this.$api.mockApplyMockLiving().then(res => {
  65. if(res.data.data) {
  66. this.livingInfo = res.data.data;
  67. }
  68. })
  69. },
  70. mockRecord() {
  71. uni.navigateTo({
  72. url:'../mockRecord/mock_record'
  73. })
  74. },
  75. getCount() {
  76. this.$api.mockSubscribeListSubscribe({
  77. pageNum:1,
  78. pageSize:10,
  79. mockStatus:0,
  80. endTime:'',
  81. startTime:''
  82. }).then(res => {
  83. this.total1 = res.data.total
  84. })
  85. this.$api.mockSubscribeListSubscribe({
  86. pageNum:1,
  87. pageSize:10,
  88. mockStatus:1,
  89. endTime:'',
  90. startTime:''
  91. }).then(res => {
  92. this.total2 = res.data.total
  93. })
  94. },
  95. getInfo(){
  96. this.$api.getinfoAttached().then(res => {
  97. if (res.data.code === 200) {
  98. this.yyNum = res.data.data.subscribeSum;
  99. }
  100. });
  101. },
  102. goAppointment(){
  103. this.$navTo.togo('/pages5/examAppointList/index');
  104. },
  105. goList(state) {
  106. this.$navTo.togo('/pages5/examList/index?state='+state);
  107. },
  108. goResult(){
  109. this.$navTo.togo('/pages5/liveList/index');
  110. }
  111. },
  112. onReachBottom() {},
  113. computed: { ...mapGetters(['userInfo','other']) }
  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>