index.vue 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view>
  3. <uni-calendar range @change="change"></uni-calendar>
  4. <navigator class="back" open-type="navigateBack" hover-class="none">{{$t(`取消`)}}</navigator>
  5. </view>
  6. </template>
  7. <script>
  8. import uniCalendar from '../components/uni-calendar/uni-calendar.vue';
  9. export default {
  10. components: {
  11. uniCalendar
  12. },
  13. data() {
  14. return {
  15. type: ''
  16. };
  17. },
  18. onLoad(options) {
  19. this.type = options.type;
  20. },
  21. methods: {
  22. change(e) {
  23. const {
  24. before,
  25. after
  26. } = e.range;
  27. if (before && after) {
  28. uni.navigateTo({
  29. url: `/pages/admin/statistics/index?type=${this.type}&before=${before}&after=${after}&time=date`
  30. });
  31. }
  32. }
  33. },
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .back {
  38. height: 86rpx;
  39. border: 1rpx solid #E93323;
  40. border-radius: 43rpx;
  41. margin: 60rpx 30rpx;
  42. font-size: 30rpx;
  43. line-height: 84rpx;
  44. text-align: center;
  45. color: #E93323;
  46. }
  47. </style>