appointmentHistory.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div class="historyListBody">
  3. <div class="historyItem" v-for="item in historyList">
  4. <div class="tags">{{item.resourceTypeStr}}</div>
  5. <div class="historyItemTitle">{{item.subject}}</div>
  6. <div class="historyItemInfo">使用日期:{{item.useTime}}</div>
  7. <div class="historyItemInfo">资源名称:{{item.resourceName}}</div>
  8. <div class="historyItemInfo">位置:{{item.position}}</div>
  9. <div class="historyItemInfo">预约时间:{{item.appointTime}}</div>
  10. <div class="historyItemBottom">
  11. <span class="typeInfo" :class="item.stateStr==='已通过'?'tgType':item.stateStr==='已取消'?'qxType':''">{{item.stateStr}}</span>
  12. <button @tap="toAdd(item)" class="btn" :class="item.stateStr==='暂存'?'zcBtn':''" v-if="item.stateStr !=='已取消'">{{item.stateStr==='暂存'?'编辑':'取消'}}</button>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import {getByCodes, getMeetingAppointListApp, getUserLocalStorageInfo} from "@/js_sdk/http";
  19. export default {
  20. name: "appointmentHistory",
  21. data(){
  22. return{
  23. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  24. historyList:[
  25. {stateStr:'审核中'},
  26. {stateStr:'已通过'},
  27. {stateStr:'已取消'},
  28. {stateStr:'暂存'},
  29. ]
  30. }
  31. },
  32. created() {
  33. this.getList()
  34. },
  35. onShow() {
  36. },
  37. methods:{
  38. getList() {
  39. const _this = this
  40. _this.historyList = []
  41. const data = {
  42. pageNum : 1,
  43. pageSize : 100,
  44. createdId : getUserLocalStorageInfo().userId,
  45. states: '1,5,6,7'
  46. }
  47. getMeetingAppointListApp(data).then(res => {
  48. if (res.data) {
  49. res.data.forEach(function (item) {
  50. const jsonMap = _this.getItemJson(item)
  51. _this.historyList.push(jsonMap)
  52. })
  53. }
  54. })
  55. },
  56. getItemJson(item) {
  57. return item
  58. },
  59. toAdd(data) {
  60. if(data.stateStr == '暂存'){
  61. uni.navigateTo({
  62. url: '/pages/subPackages/resourceReservation_manage/add?id=' + data.id
  63. })
  64. }else if(data.stateStr == '审核中'){
  65. }
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. .historyListBody{
  72. margin-top: 24rpx;
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. padding-bottom: 100rpx;
  77. .historyItem{
  78. width: 686rpx;
  79. padding: 24rpx 0;
  80. background: white;
  81. box-sizing: border-box;
  82. position: relative;
  83. border-radius: 16rpx;
  84. margin-bottom: 24rpx;
  85. .tags{
  86. width: 148rpx;
  87. height: 56rpx;
  88. position: absolute;
  89. top: 0;
  90. right: 0;
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. font-size: 26rpx;
  95. color: rgba(3, 101, 249, 1);
  96. background: url('https://www.idea-co-sf.com/gardenProduct/image/bj04.png') no-repeat;
  97. background-size: 100%;
  98. }
  99. .historyItemTitle{
  100. padding: 8rpx 32rpx;
  101. width: 480rpx;
  102. color: rgba(34, 34, 34, 1);
  103. font-size: 32rpx;
  104. line-height: 40rpx;
  105. font-weight: 500;
  106. }
  107. .historyItemInfo{
  108. color: rgba(102, 102, 102, 1);
  109. font-size: 28rpx;
  110. padding: 10rpx 32rpx;
  111. }
  112. .historyItemBottom{
  113. display: flex;
  114. justify-content: space-between;
  115. align-items: center;
  116. padding: 28rpx 32rpx 0 32rpx;
  117. border-top: 1px solid rgba(232, 237, 245, 1);
  118. margin-top: 22rpx;
  119. .typeInfo{
  120. font-size: 28rpx;
  121. color: rgba(226, 81, 0, 1);
  122. }
  123. .tgType{
  124. color: rgba(3, 101, 249, 1);
  125. }
  126. .qxType{
  127. color:rgba(242, 25, 18, 1);
  128. }
  129. .btn{
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. font-size: 28rpx;
  134. width: 160rpx;
  135. height: 60rpx;
  136. border-radius: 32rpx;
  137. border: 2rpx solid rgba(255, 107, 24, 1);
  138. color:rgba(255, 107, 24, 1);
  139. &::after{
  140. border: none;
  141. }
  142. }
  143. .zcBtn{
  144. background: linear-gradient( 316deg, #84AAFF 0%, #0365F9 100%);
  145. color: white;
  146. border: none;
  147. }
  148. }
  149. }
  150. }
  151. </style>