log.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="content">
  3. <scroll-view id="scroll" scroll-y="true">
  4. <view v-for="(item,key) in list" :key="key" class="cu-list menu card-menu margin-top-sm">
  5. <!-- <ad :unit-id="ad.log_banner" v-if="ad.log_type == 1"></ad>
  6. <ad :unit-id="ad.log_gezi" ad-type="grid" grid-opacity="0.8" grid-count="5" ad-theme="white" v-else-if="ad.log_type == 2"></ad>
  7. <ad :unit-id="ad.log_video" ad-type="video" ad-theme="white" v-else-if="ad.log_type == 3"></ad> -->
  8. <view class="cu-item">
  9. <view class="content padding-tb-sm">
  10. <view style="display: flex;flex-direction: row;">
  11. <view>分数:{{item.score}}</view>
  12. </view>
  13. <view class="text-gray">考试用时:{{item.grade_time}}秒</view>
  14. <view class="text-gray">考试时间:{{item.createtime|format_date}}</view>
  15. </view>
  16. <view class="action" v-if="false">
  17. <template v-if="key==0">
  18. <image class="rankIcon" src="/static/img/rank-01.png" mode=""></image>
  19. </template>
  20. <template v-if="key==1">
  21. <image class="rankIcon" src="/static/img/rank-02.png" mode=""></image>
  22. </template>
  23. <template v-if="key==2">
  24. <image class="rankIcon" src="/static/img/rank-03.png" mode=""></image>
  25. </template>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 加载状态条 -->
  30. <tui-nomore></tui-nomore>
  31. <view class="fix-bottom"></view>
  32. </scroll-view>
  33. </view>
  34. </template>
  35. <script>
  36. let interstitialAd = null
  37. export default {
  38. data() {
  39. return {
  40. list: [],
  41. page: 1,
  42. over: 0,
  43. ad: this.utils.getData('ad')
  44. }
  45. },
  46. onLoad() {
  47. this.getList()
  48. if (wx.createInterstitialAd && this.ad && this.ad.log_cp) {
  49. interstitialAd = wx.createInterstitialAd({
  50. adUnitId: this.ad.log_cp
  51. });
  52. interstitialAd.onLoad(() => {});
  53. interstitialAd.onError(err => {});
  54. interstitialAd.onClose(() => {});
  55. if (interstitialAd) {
  56. interstitialAd.show().catch(err => {
  57. console.error(err);
  58. });
  59. }
  60. }
  61. },
  62. onReachBottom() {
  63. if (this.over == 0) {
  64. this.getList()
  65. }
  66. },
  67. onShareAppMessage() {
  68. return {
  69. title: '在线考试',
  70. path: '/pages/index/index',
  71. };
  72. },
  73. onShareTimeline() {
  74. return {
  75. title: '在线考试',
  76. // query: '/pages/index/index',
  77. // imageUrl: '',
  78. };
  79. },
  80. methods: {
  81. getList(pageNum){
  82. this.http('grade/index', {user_id:this.utils.getData('user_id'),page:this.page}, 'get').then(res => {
  83. var list = res.data.list.data;
  84. this.list = this.list || [];
  85. this.list = this.list.concat(list);
  86. this.page++;
  87. if (!res.data.list.has_more) {
  88. this.over = 1;
  89. }
  90. });
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. .rankIcon{
  97. width: 70upx;
  98. height: 90upx;
  99. }
  100. </style>