my-calendar.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <view class="page-calendar">
  3. <view class="calendar-out">
  4. <view class="top-header"> </view>
  5. <view class="top-content">
  6. <uni-calendar ref="calendar" :selected="selectedData" />
  7. </view>
  8. <view class="mid-bg"> </view>
  9. <view class="mid-data">
  10. <view class="data-list">
  11. <block v-for="(it,index) in tripList">
  12. <view class="item" @click="onViewArticle(index)">
  13. <view class="image">
  14. <image :src="it.image" class="img" mode="scaleToFill"></image>
  15. </view>
  16. <view class="news">
  17. <view class="title">
  18. <view class="text">{{it.intro}}</view>
  19. <view class="date"></view>
  20. </view>
  21. <view class="intro">
  22. {{it.content}}
  23. </view>
  24. </view>
  25. </view>
  26. </block>
  27. <block v-for="(it,index) in orderList">
  28. <view class="item" @click="onView(it,index)">
  29. <view class="image">
  30. <image :src="setInfo+it.events.mainImg" class="img" mode="scaleToFill"></image>
  31. </view>
  32. <view class="news">
  33. <view class="title" style="height: auto;">
  34. <view class="text">{{it.events.title}}</view>
  35. <view class="date"></view>
  36. </view>
  37. <view class="intro">
  38. {{it.orderDate+" "+it.orderTime}}
  39. </view>
  40. </view>
  41. </view>
  42. </block>
  43. </view>
  44. </view>
  45. </view>
  46. <uni-popup ref="calendarForm">
  47. <CalendarForm :info="currentArticle"></CalendarForm>
  48. </uni-popup>
  49. </view>
  50. </template>
  51. <script>
  52. import {
  53. mapState,
  54. mapMutations
  55. } from 'vuex'
  56. import CalendarForm from "@/components/CalendarForm/CalendarForm.vue"
  57. import setInfo from "../../siteinfo.js"
  58. export default {
  59. components:{
  60. CalendarForm
  61. },
  62. computed: {
  63. ...mapState(['systemInfo', 'store_id', 'userInfo']),
  64. },
  65. data() {
  66. return {
  67. tripList:[],
  68. selectedData:[],
  69. currentArticle:null,
  70. orderList:[],
  71. setInfo:setInfo.siteroot
  72. };
  73. },
  74. onShow(){
  75. this.initTrip();
  76. },
  77. methods:{
  78. initTrip(){
  79. let _this=this;
  80. _this.$http.request('account/getUserTrip', {
  81. user_id:_this.userInfo.id,
  82. }, "", "", true).then(res => {
  83. _this.tripList=res.data;
  84. _this.selectedData=_this.tripList.map(mapRes=>{
  85. return {
  86. date:mapRes.tripDate,
  87. info:mapRes.intro,
  88. }
  89. })
  90. }).catch(err => {})
  91. _this.$http.request('Events/searchOrder', {
  92. user_id:_this.userInfo.id,
  93. }, "", "", true).then(res => {
  94. console.log(res);
  95. _this.orderList=res.data;
  96. _this.selectedData=_this.orderList.map(mapRes=>{
  97. return {
  98. date:mapRes.orderDate,
  99. info:"预订场地",
  100. }
  101. })
  102. }).catch(err => {})
  103. },
  104. onView(item,index){
  105. uni.navigateTo({
  106. url:'/pages/home/detail/detail?id='+item.eventId,
  107. })
  108. },
  109. //打开查看详情
  110. onViewArticle(index){
  111. this.currentArticle=this.tripList[index];
  112. this.$refs.calendarForm.open("bottom");
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss">
  118. @import './my-calendar.scss'
  119. </style>