shareResources.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div class="shareResources">
  3. <div style="width: 82%">
  4. <van-tabs :active="active" @change="onChange">
  5. <!-- <van-tab title="会议室" :name="0"></van-tab>-->
  6. <!-- <van-tab title="打印机" :name="1"></van-tab>-->
  7. <!-- <van-tab title="办公桌" :name="2"></van-tab>-->
  8. <!-- <van-tab title="其他" :name="3"></van-tab>-->
  9. <van-tab :title="item.label" :name="item.value" v-for="item in resourceTypeList"></van-tab>
  10. </van-tabs>
  11. </div>
  12. <div class="shareListBody">
  13. <div class="shareItem" v-for="item in meetingList" @tap="toDetail(item)">
  14. <img :src="item.url" class="shareItemImg">
  15. <div class="shareItemRight">
  16. <span class="shareItemTitle">{{ item.roomName }}</span>
  17. <span class="shareItemInfo">位置:{{ item.position }}</span>
  18. <span class="shareItemInfo">容纳人数:<span style="color: rgba(3, 101, 249, 1)">{{ item.seatNumber }}人</span></span>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import {getByCodes, getMeetingRoomList} from "@/js_sdk/http";
  26. import dayjs from "dayjs";
  27. export default {
  28. name: "shareResources",
  29. data() {
  30. return {
  31. dc_key: ['RESOURCE_TYPE'],
  32. active: 1,
  33. resourceTypeList: [],
  34. dic_SelectList: [],
  35. meetingList: []
  36. }
  37. },
  38. created() {
  39. this.getByCodes()
  40. this.getList()
  41. },
  42. onLoad(options){
  43. },
  44. methods: {
  45. async getByCodes() {
  46. let data = await getByCodes(JSON.stringify(this.dc_key));
  47. this.dic_SelectList = this.$common.handleDicList(data);
  48. this.resourceTypeList = this.dic_SelectList.RESOURCE_TYPE
  49. },
  50. getList() {
  51. const _this = this
  52. _this.meetingList = []
  53. const data = {
  54. pageNum : 1,
  55. pageSize : 100,
  56. useRange : 2, // 1 内部 2 园区企业
  57. resourceType : this.active
  58. }
  59. getMeetingRoomList(data).then(res => {
  60. console.log('res', res)
  61. if (res.rows) {
  62. res.rows.forEach(function (item) {
  63. const jsonMap = _this.getItemJson(item)
  64. _this.meetingList.push(jsonMap)
  65. })
  66. }
  67. })
  68. },
  69. getItemJson(item) {
  70. item.url = JSON.parse(item.roomImg)[0].url
  71. console.log(item.url)
  72. return item
  73. },
  74. onChange(e) {
  75. console.log('e', e)
  76. this.active = e.detail.name
  77. this.getList()
  78. },
  79. toDetail(item) {
  80. uni.navigateTo({
  81. url: '/pages/subPackages/resourceReservation_manage/detail?id=' + item.id
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .shareResources {
  89. margin-top: 24rpx;
  90. background: white;
  91. min-height: 1344rpx;
  92. padding-bottom: 100rpx;
  93. .shareListBody {
  94. display: flex;
  95. flex-direction: column;
  96. align-items: center;
  97. margin-top: 16rpx;
  98. .shareItem {
  99. width: 686rpx;
  100. height: 224rpx;
  101. background: rgba(245, 247, 250, 1);
  102. box-sizing: border-box;
  103. display: flex;
  104. align-items: center;
  105. padding: 32rpx 24rpx;
  106. border-radius: 16rpx;
  107. margin-bottom: 24rpx;
  108. .shareItemImg {
  109. width: 220rpx;
  110. height: 160rpx;
  111. }
  112. .shareItemRight {
  113. display: flex;
  114. flex-direction: column;
  115. margin-left: 24rpx;
  116. .shareItemTitle {
  117. color: rgba(24, 23, 42, 1);
  118. font-size: 32rpx;
  119. font-weight: 600;
  120. margin-bottom: 16rpx;
  121. }
  122. .shareItemInfo {
  123. color: rgba(102, 102, 102, 1);
  124. font-size: 26rpx;
  125. line-height: 40rpx;
  126. }
  127. }
  128. }
  129. }
  130. }
  131. </style>