schedule.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view style="padding: 0 32rpx">
  3. <u-class title="日程安排">
  4. <view v-if="list.length" class="timeline">
  5. <view v-for="(item,index) in list" :key="index" class="item-container">
  6. <view class="item-main u-flex" @click="toQuery(item)">
  7. <view class="left">
  8. <view class="left-label">{{item.labelTitle}}</view>
  9. <view class="left-time">{{item.labelStartDate}} ~ {{item.labelEndDate}}</view>
  10. </view>
  11. <!-- labelStatus 日程状态:-1:已结束,0-未开始,1-进行中 -->
  12. <view class="right-label">
  13. <image v-if="item.labelStatus==1" class="right-icon" src="/static/index/into_icon.png" />
  14. <view>{{item.labeltatusName ||item.labelStatusName || '--'}}</view>
  15. </view>
  16. </view>
  17. <view class="line" />
  18. <image v-if="item.labelStatus==-1" class="head-icon" src="/static/index/end_state_choose.png" />
  19. <image v-else-if="item.labelStatus==1" class="head-icon"
  20. src="/static/index/start_state_choose.png" />
  21. <image v-else class="head-icon not_state" src="/static/index/end_state_choose.png" />
  22. </view>
  23. </view>
  24. <view v-else class="no-data">
  25. <image class="icon" src="/static/no_list.png" mode="widthFix"></image>
  26. <view class="tip">暂无日程安排哦~</view>
  27. </view>
  28. </u-class>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. activeIndex: 1,
  36. list: [],
  37. }
  38. },
  39. mounted() {
  40. this.init()
  41. },
  42. methods: {
  43. async init() {
  44. this.$ajax.post('/shunt/schedule').then(res => {
  45. this.list = res.data || []
  46. }).catch(error => {
  47. this.list = []
  48. })
  49. },
  50. toQuery(item) {
  51. const {
  52. path,
  53. labelStatus,
  54. } = item || {}
  55. if(labelStatus!==1) {
  56. console.log(item)
  57. return
  58. }
  59. if (path && path.indexOf('/')>=0) {
  60. ['/', '/pages/index/index', '/pages/my/my'].indexOf(path) >= 0 ?
  61. uni.switchTab({
  62. url: path
  63. }) :
  64. uni.navigateTo({
  65. url: path // `/pages/apps/progress-query/progress-query`
  66. })
  67. }
  68. },
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .timeline {
  74. max-width: 400px;
  75. margin: 0 auto;
  76. .item-container {
  77. padding-left: 56rpx;
  78. position: relative;
  79. .item-main {
  80. width: 100%;
  81. height: 209rpx;
  82. background: url('/static/schedule_list_bg.png');
  83. background-size: 100% 100%;
  84. background-repeat: no-repeat;
  85. background-position: right center;
  86. background-origin: content-box;
  87. }
  88. .left {
  89. padding-left: 60rpx;
  90. }
  91. .left-label {
  92. font-size: 30rpx;
  93. font-weight: bold;
  94. color: #333333;
  95. margin-bottom: 36rpx;
  96. }
  97. .left-time {
  98. font-size: 24rpx;
  99. font-weight: 400;
  100. color: #A3ABBF;
  101. }
  102. .right-label {
  103. font-size: 28rpx;
  104. font-weight: 400;
  105. color: #FFFFFF;
  106. text-align: center;
  107. padding-right: 60rpx;
  108. }
  109. .right-icon {
  110. cursor: pointer;
  111. width: 52rpx;
  112. height: 52rpx;
  113. margin-bottom: 22rpx;
  114. }
  115. .line {
  116. position: absolute;
  117. top: 0;
  118. left: 16rpx;
  119. width: 6rpx;
  120. height: 100%;
  121. background: #D1E3FA;
  122. transform: translateX(-50%);
  123. }
  124. &:nth-child(1) {
  125. .line {
  126. top: 50%;
  127. height: 50%;
  128. }
  129. }
  130. &:nth-last-child(1) {
  131. .line {
  132. height: 50%;
  133. }
  134. }
  135. .head-icon {
  136. position: absolute;
  137. top: 50%;
  138. left: 0;
  139. transform: translateY(-50%);
  140. z-index: 1;
  141. width: 32rpx;
  142. height: 32rpx;
  143. &.not_state {
  144. width: 22rpx;
  145. height: 22rpx;
  146. left: 5rpx
  147. }
  148. }
  149. }
  150. }
  151. .no-data {
  152. text-align: center;
  153. .icon {
  154. width: 183rpx;
  155. height: 167rpx;
  156. margin-top: 80rpx;
  157. margin-bottom: 40rpx;
  158. }
  159. font-size: 20rpx;
  160. font-weight: 400;
  161. color: #A3ABBF;
  162. }
  163. </style>