mySupply.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="content">
  3. <view class="supply-box">
  4. <view class="supply-item-box">
  5. <view
  6. v-for="(item, idx) in titleList"
  7. :key="idx"
  8. :class="{ active: active === idx }"
  9. class="supply-item-name"
  10. @click="active = idx"
  11. >
  12. {{ item }}
  13. </view>
  14. </view>
  15. <view class="supply-content">
  16. <view
  17. class="supplyCard"
  18. v-for="(supply, i) in supplyList"
  19. :key="i"
  20. @tap="toDetail(i)"
  21. >
  22. <view class="image_content">
  23. <image :src="supply.image" />
  24. </view>
  25. <view class="info">
  26. <view class="title">
  27. {{ supply.title }}
  28. </view>
  29. <view class="time">发布时间:{{ supply.time }}</view>
  30. </view>
  31. <view class="state">
  32. <image src="/static/appeal/waited.svg" />
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. titleList: ["我的供需", "我的需求"],
  44. active: 0,
  45. supplyList: new Array(5).fill({
  46. image: "/static/supply/u1779.png",
  47. title: "移动式空气消毒机",
  48. time: "2021-08-30 14:50:00",
  49. state: 1,
  50. }),
  51. };
  52. },
  53. onLoad() {},
  54. methods: {
  55. toDetail(index) {
  56. uni.navigateTo({
  57. url: "/pages/supply/supply_detail?id=" + index,
  58. });
  59. },
  60. },
  61. };
  62. </script>
  63. <style lang="scss">
  64. .content {
  65. display: flex;
  66. flex-direction: column;
  67. align-items: center;
  68. justify-content: center;
  69. box-sizing: border-box;
  70. padding: 5%;
  71. .supply-box {
  72. width: 100%;
  73. display: flex;
  74. flex-direction: column;
  75. .supply-title {
  76. width: 100%;
  77. p {
  78. background-color: #02a7f0;
  79. width: 190rpx;
  80. height: 70rpx;
  81. color: #ffffff;
  82. border-radius: 0 40rpx 40rpx 0rpx;
  83. font-size: 28rpx;
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. }
  88. }
  89. .supply-item-box {
  90. display: flex;
  91. justify-content: space-evenly;
  92. margin: 0 20rpx;
  93. margin-top: 10rpx;
  94. .supply-item-name {
  95. padding-bottom: 10rpx;
  96. font-size: 27rpx;
  97. }
  98. .active {
  99. font-weight: 600;
  100. border-bottom: 7rpx solid #02a7f0;
  101. }
  102. }
  103. .supply-content {
  104. width: 100%;
  105. display: flex;
  106. box-sizing: border-box;
  107. flex-direction: column;
  108. font-size: 25rpx;
  109. .supplyCard {
  110. display: flex;
  111. width: 92%;
  112. margin: 2% 0;
  113. padding: 2% 4%;
  114. height: 5%;
  115. border-radius: 30rpx;
  116. box-shadow: rgba(100, 100, 111, 0.2) 0rpx 14rpx 50rpx 0rpx;
  117. .image_content {
  118. margin-right: 5%;
  119. image {
  120. width: 100rpx;
  121. height: 100rpx;
  122. border-radius: 20rpx;
  123. background-color: rgb(228, 228, 228);
  124. }
  125. }
  126. .state {
  127. margin-left: 100rpx;
  128. image {
  129. width: 100rpx;
  130. height: 80rpx;
  131. }
  132. }
  133. .info {
  134. display: flex;
  135. flex-flow: column;
  136. justify-content: space-around;
  137. .time {
  138. font-weight: 100;
  139. font-size: 25rpx;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>