statistics.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="statistics">
  3. <custom-nav :title="pageTitle"></custom-nav>
  4. <view class="content">
  5. <scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
  6. <view @tap="toself" class="item self" v-if="userServerInfo.type === 1">
  7. <image src="https://api.jiuweiyun.cn/public/uploads/icon/self.png" mode="scaleToFill"></image>
  8. </view>
  9. <view @tap="tosold" class="item sold" v-if="userServerInfo.type === 2 || userServerInfo.type === 3">
  10. <image src="https://api.jiuweiyun.cn/public/uploads/icon/sold.png" mode="scaleToFill"></image>
  11. </view>
  12. <view @tap="tojionnum" class="item num" v-if="userServerInfo.type === 2 || userServerInfo.type === 3">
  13. <image src="https://api.jiuweiyun.cn/public/uploads/icon/num.png" mode="scaleToFill"></image>
  14. </view>
  15. <view v-if="userServerInfo.end_time && userServerInfo.end_time < now" @tap="toChengJiDan" class="item num">
  16. <image src="https://api.jiuweiyun.cn/public/uploads/icon/cjd.png" mode="scaleToFill"></image>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. pageTitle: '数据统计',
  27. scrollViewHeight: 0,
  28. now: Date.now()
  29. };
  30. },
  31. computed: {
  32. userServerInfo () {
  33. return this.$store.state.userServerInfo
  34. }
  35. },
  36. methods: {
  37. toChengJiDan() {
  38. uni.navigateTo({
  39. url: '../schoolReport/index'
  40. })
  41. },
  42. toself () { //去个人数据页面
  43. uni.navigateTo({ //已登录跳转到用户中心
  44. url: `../self/self?id=${this.userServerInfo.id}&from=index`
  45. })
  46. },
  47. tosold () { //去销售统计页面
  48. uni.navigateTo({
  49. url: '../sold/sold'
  50. })
  51. },
  52. tojionnum () { //去参赛人数页面
  53. uni.navigateTo({
  54. url: '../joinnum/joinnum'
  55. })
  56. }
  57. },
  58. created() {
  59. this.$scrollViewHeight('.content') //设置页面内 scroll view 的高度
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .statistics {
  65. @include page();
  66. // border-top:none;
  67. .content {
  68. // border-top: $custom-nav-borderbot-height solid $custom-nav-borderbot-color;
  69. .item {
  70. width: 656rpx;
  71. height: 301rpx;
  72. box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(127,127,127,0.2);
  73. border-radius: 20rpx;
  74. overflow: hidden;
  75. margin: 20rpx auto 0;
  76. position: relative;
  77. image {
  78. width: 100%;
  79. height: 100%;
  80. }
  81. &.self {
  82. margin-top: 28rpx;
  83. }
  84. }
  85. }
  86. }
  87. </style>