grade.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="content">
  3. <view class="main">
  4. <view class="main-item flex" v-for="(item,index) in list" :key="index">
  5. <view class="main-left">
  6. {{item.name}}
  7. </view>
  8. <view class="main-right">
  9. <text class="num">{{item.score}}</text>分
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. mapState,
  18. mapMutations
  19. } from 'vuex';
  20. import {
  21. new_project,
  22. my_point
  23. } from '@/api/project.js'
  24. export default {
  25. data() {
  26. return {
  27. list: [],
  28. };
  29. },
  30. computed: {
  31. ...mapState('user', ['userInfo', 'hasLogin', 'urlFile'])
  32. },
  33. onLoad() {},
  34. onShow() {
  35. if (this.userInfo.user_type != 2) {
  36. uni.setTabBarItem({
  37. index: 1,
  38. "pagePath": "pages/user/grade",
  39. "iconPath": "../../static/tabbar/tab-grade.png",
  40. "selectedIconPath": "../../static/tabbar/tab-grade-current.png",
  41. "text": "我的成绩",
  42. "visible": true
  43. });
  44. }
  45. this.loadData()
  46. },
  47. onReachBottom() {},
  48. onReady() {},
  49. methods: {
  50. loadData() {
  51. new_project().then(e => {
  52. console.log(e);
  53. my_point({}, e.data.new.id).then(({
  54. data
  55. }) => {
  56. this.list = data;
  57. console.log(data);
  58. })
  59. })
  60. }
  61. }
  62. };
  63. </script>
  64. <style lang="scss">
  65. page,
  66. .content {
  67. min-height: 100%;
  68. height: auto;
  69. }
  70. .main {
  71. width: 702rpx;
  72. background: #FFFFFF;
  73. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  74. border-radius: 20rpx;
  75. margin: 20rpx auto;
  76. padding: 0 25rpx;
  77. .main-item {
  78. padding: 36rpx 0;
  79. border-bottom: 1px solid #F0F0F0;
  80. .main-left {
  81. font-size: 30rpx;
  82. font-family: PingFang SC;
  83. font-weight: 500;
  84. color: #333333;
  85. }
  86. .main-right {
  87. font-size: 30rpx;
  88. font-family: PingFang SC;
  89. font-weight: bold;
  90. color: #000000;
  91. .num {
  92. display: inline-block;
  93. margin-right: 10rpx;
  94. color: #FF4C4C;
  95. }
  96. }
  97. }
  98. }
  99. </style>