myEvaluate.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="container">
  3. <!-- 分段器区域 -->
  4. <view class="segmented">
  5. <uni-segmented-control :current="activeCurrent" :values="headerList" style-type="text" active-color="#096562" @clickItem="onClickItem" />
  6. </view>
  7. <!-- 列表区域 -->
  8. <scroll-view class="body" scroll-y @scrolltolower="handlePull">
  9. <!-- 每一个盒子区域 -->
  10. <view class="box" v-for="item in list" :key="item.id">
  11. <!-- 头部区域 -->
  12. <view class="box_top">
  13. <img mode="aspectFill" src="../../static/my/hotel.png" />
  14. <view class="top_name">{{ item.name }}</view>
  15. <view class="box_type">{{ item.type }}</view>
  16. </view>
  17. <!-- 房间信息区域 -->
  18. <view class="box_center">
  19. <img mode="aspectFill" :src="item.imgUrl" />
  20. <view class="center_info">
  21. <view>{{ item.count }}间,{{ item.roomType }}</view>
  22. <view>{{ item.time }}</view>
  23. <view>总价:¥{{ item.total }}</view>
  24. </view>
  25. </view>
  26. <!-- 按钮区域 -->
  27. <view class="box_btn">
  28. <view class="btn_eva">去评价</view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. // 分段器当前激活索引
  39. activeCurrent: 0,
  40. // 分段器数组
  41. headerList: ['待评价', '已评价'],
  42. // 列表数据
  43. list: [
  44. {
  45. id: 1,
  46. name: '民宿名称',
  47. type: '已消费',
  48. imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
  49. count: 1,
  50. roomType: '大床房',
  51. time: '2023-07-26 - 2023-07-27',
  52. total: 229
  53. },
  54. {
  55. id: 2,
  56. name: '开心民宿',
  57. type: '已消费',
  58. imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
  59. count: 2,
  60. roomType: '双人房',
  61. time: '2023-07-27 - 2023-07-27',
  62. total: 299
  63. },
  64. {
  65. id: 3,
  66. name: '开心民宿',
  67. type: '已消费',
  68. imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
  69. count: 2,
  70. roomType: '双人房',
  71. time: '2023-07-27 - 2023-07-27',
  72. total: 299
  73. },
  74. {
  75. id: 4,
  76. name: '开心民宿',
  77. type: '已消费',
  78. imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
  79. count: 2,
  80. roomType: '双人房',
  81. time: '2023-07-27 - 2023-07-27',
  82. total: 299
  83. }
  84. ]
  85. }
  86. },
  87. methods: {
  88. // 切换分段器回调
  89. onClickItem(e) {
  90. if (this.current !== e.currentIndex) {
  91. this.current = e.currentIndex
  92. }
  93. },
  94. // 列表下拉到底部回调
  95. handlePull() {
  96. console.log(111)
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .container {
  103. height: 100vh;
  104. background-color: #f2f3f5;
  105. overflow: hidden;
  106. .segmented {
  107. box-sizing: border-box;
  108. padding-bottom: 28rpx;
  109. height: 100rpx;
  110. background-color: #fff;
  111. }
  112. .body {
  113. box-sizing: border-box;
  114. padding: 20rpx 0;
  115. height: calc(100vh - 100rpx);
  116. overflow-y: auto;
  117. .box {
  118. padding: 0 20rpx;
  119. margin-bottom: 20rpx;
  120. height: 341rpx;
  121. background-color: #fff;
  122. .box_top {
  123. display: flex;
  124. align-items: center;
  125. height: 94rpx;
  126. img {
  127. width: 47rpx;
  128. height: 47rpx;
  129. border-radius: 50%;
  130. }
  131. .top_name {
  132. margin-left: 18rpx;
  133. font-size: 32rpx;
  134. font-weight: bold;
  135. }
  136. .box_type {
  137. margin-left: auto;
  138. color: #808080;
  139. font-size: 28rpx;
  140. }
  141. }
  142. .box_center {
  143. display: flex;
  144. img {
  145. width: 100rpx;
  146. height: 100rpx;
  147. border-radius: 10rpx;
  148. }
  149. .center_info {
  150. margin-top: -5rpx;
  151. margin-left: 18rpx;
  152. color: #808080;
  153. font-size: 28rpx;
  154. }
  155. }
  156. .box_btn {
  157. display: flex;
  158. justify-content: flex-end;
  159. margin-top: 35rpx;
  160. .btn_eva {
  161. display: flex;
  162. justify-content: center;
  163. align-items: center;
  164. margin-left: 20rpx;
  165. width: 178rpx;
  166. height: 68rpx;
  167. color: #808080;
  168. font-size: 28rpx;
  169. border-radius: 64rpx;
  170. border: 1rpx solid #808080;
  171. }
  172. }
  173. }
  174. }
  175. }
  176. </style>