record.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="container">
  3. <!-- 分段器区域 -->
  4. <uni-segmented-control :current="activeCurrent" :values="controlList" @clickItem="onClickItem" styleType="text" activeColor="#0061FF"></uni-segmented-control>
  5. <!-- 预约记录区域 -->
  6. <view class="body">
  7. <!-- 每一条预约记录区域 -->
  8. <view class="body_box" v-for="item in list" :key="item.id" @click="handleClick(item)">
  9. <view class="box_title">
  10. <view class="title_msg">
  11. <view class="msg_name">{{ item.name }}</view>
  12. <view class="msg_time">/{{ item.time }}</view>
  13. </view>
  14. <view class="title_type" v-if="item.type == '待审核'">{{ item.type }}</view>
  15. <view class="title_type red" v-if="item.type == '已拒绝'">{{ item.type }}</view>
  16. <view class="title_type green" v-if="item.type == '已推送'">{{ item.type }}</view>
  17. </view>
  18. <view class="box_info">
  19. <view class="info_box">
  20. <view class="box_key">来访时间</view>
  21. <view class="box_value">{{ item.time }}</view>
  22. </view>
  23. <view class="info_box">
  24. <view class="box_key">访问事由</view>
  25. <view class="box_value">{{ item.desc }}</view>
  26. </view>
  27. </view>
  28. <view class="box_btn" v-if="item.type == '待审核'">
  29. <view class="button" @click.stop="handleCancel">取消预约</view>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 详情弹窗区域 -->
  34. <uni-popup ref="popup" type="center" :is-mask-click="false">
  35. <view class="popup_box">
  36. <!-- 弹窗标题区域 -->
  37. <view class="pop_header">
  38. 预约详情
  39. <view class="header_icon" @click="closePop">×</view>
  40. </view>
  41. <!-- 弹窗详细信息区域 -->
  42. <view class="pop_info">
  43. <view class="info_key">状态:</view>
  44. <view class="info_value blue" v-if="popObj.type == '待审核'">{{ popObj.type }}</view>
  45. <view class="info_value red" v-if="popObj.type == '已拒绝'">{{ popObj.type }}</view>
  46. <view class="info_value green" v-if="popObj.type == '已推送'">{{ popObj.type }}</view>
  47. </view>
  48. <view class="pop_info">
  49. <view class="info_key">访客姓名:</view>
  50. <view class="info_value">{{ popObj.name }}</view>
  51. </view>
  52. <view class="pop_info">
  53. <view class="info_key">访客手机号:</view>
  54. <view class="info_value">136562262626</view>
  55. </view>
  56. <view class="pop_info">
  57. <view class="info_key">来访时间:</view>
  58. <view class="info_value">{{ popObj.time }}</view>
  59. </view>
  60. <view class="pop_info">
  61. <view class="info_key">证件号:</view>
  62. <view class="info_value">2662626262626262626</view>
  63. </view>
  64. <view class="pop_info">
  65. <view class="info_key">访问事由:</view>
  66. <view class="info_value">{{ popObj.desc }}</view>
  67. </view>
  68. <view class="pop_info">
  69. <view class="info_key">车牌号:</view>
  70. <view class="info_value">无</view>
  71. </view>
  72. <view class="pop_info">
  73. <view class="info_key">同行人数:</view>
  74. <view class="info_value">无</view>
  75. </view>
  76. <view class="pop_info">
  77. <view class="info_key">受访学生:</view>
  78. <view class="info_value">张三(262626)</view>
  79. </view>
  80. </view>
  81. </uni-popup>
  82. <!-- 底部导航栏区域 -->
  83. <tabber />
  84. </view>
  85. </template>
  86. <script setup>
  87. import { ref } from 'vue'
  88. import { onLoad } from '@dcloudio/uni-app'
  89. import tabber from '@/components/tabber.vue'
  90. // 分段器当前索引
  91. const activeCurrent = ref(0)
  92. // 分段器数组
  93. const controlList = ['全部', '待审核', '已拒绝', '已推送']
  94. // 预约记录数组
  95. const list = ref([
  96. {
  97. id: 1,
  98. name: '张三',
  99. time: '2023-12-13 10:23',
  100. type: '待审核',
  101. desc: '给孩子送棉被'
  102. },
  103. {
  104. id: 2,
  105. name: '张三',
  106. time: '2023-12-13 10:23',
  107. type: '已拒绝',
  108. desc: '给孩子送棉被'
  109. },
  110. {
  111. id: 3,
  112. name: '张三',
  113. time: '2023-12-13 10:23',
  114. type: '已推送',
  115. desc: '给孩子送棉被'
  116. }
  117. ])
  118. // 弹窗元素标记
  119. const popup = ref(null)
  120. // 弹窗详细信息
  121. const popObj = ref({})
  122. onLoad(() => {})
  123. // 点击每一条预约记录时的回调
  124. const handleClick = (item) => {
  125. popObj.value = item
  126. popup.value.open()
  127. }
  128. // 切换分段器时的回调
  129. const onClickItem = (e) => {
  130. console.log(e)
  131. }
  132. // 点击取消按钮回调
  133. const handleCancel = () => {
  134. console.log('取消')
  135. }
  136. // 点击弹窗 x 图标时的回调
  137. const closePop = () => {
  138. popup.value.close()
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .container {
  143. min-height: 100vh;
  144. background-color: #f1f6fe;
  145. .body {
  146. padding: 0 20rpx;
  147. .body_box {
  148. padding: 0 20rpx 0 30rpx;
  149. box-sizing: border-box;
  150. margin-top: 20rpx;
  151. width: 710rpx;
  152. border-radius: 15rpx;
  153. background-color: #fff;
  154. .box_title {
  155. display: flex;
  156. justify-content: space-between;
  157. align-items: center;
  158. height: 83rpx;
  159. font-size: 28rpx;
  160. border-bottom: 1rpx solid #e6e6e6;
  161. .title_msg {
  162. display: flex;
  163. align-items: center;
  164. .msg_name {
  165. font-weight: bold;
  166. }
  167. .msg_time {
  168. margin-left: 15rpx;
  169. color: #a6a6a6;
  170. font-size: 24rpx;
  171. }
  172. }
  173. .title_type {
  174. color: #0061ff;
  175. }
  176. .red {
  177. color: #d43030;
  178. }
  179. .green {
  180. color: #00baad;
  181. }
  182. }
  183. .box_info {
  184. display: flex;
  185. flex-direction: column;
  186. justify-content: space-evenly;
  187. height: 140rpx;
  188. .info_box {
  189. display: flex;
  190. align-items: center;
  191. font-size: 24rpx;
  192. .box_key {
  193. color: #a6a6a6;
  194. }
  195. .box_value {
  196. margin-left: 95rpx;
  197. }
  198. }
  199. }
  200. .box_btn {
  201. display: flex;
  202. justify-content: flex-end;
  203. align-items: center;
  204. height: 130rpx;
  205. border-top: 1rpx solid #e6e6e6;
  206. .button {
  207. display: flex;
  208. justify-content: center;
  209. align-items: center;
  210. width: 160rpx;
  211. height: 80rpx;
  212. color: #0061ff;
  213. font-size: 28rpx;
  214. border-radius: 10rpx;
  215. border: 1rpx solid #0061ff;
  216. }
  217. }
  218. }
  219. }
  220. .popup_box {
  221. padding-bottom: 50rpx;
  222. width: 710rpx;
  223. border-radius: 22rpx;
  224. background-color: #fff;
  225. .pop_header {
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. position: relative;
  230. height: 94rpx;
  231. font-size: 28rpx;
  232. border-bottom: 1rpx solid #e6e6e6;
  233. .header_icon {
  234. position: absolute;
  235. top: 18rpx;
  236. right: 25rpx;
  237. font-size: 40rpx;
  238. }
  239. }
  240. .pop_info {
  241. display: flex;
  242. align-items: center;
  243. margin-top: 22rpx;
  244. padding: 0 35rpx;
  245. font-size: 28rpx;
  246. .info_key {
  247. color: #999999;
  248. }
  249. .info_value {
  250. }
  251. .blue {
  252. color: #0061ff;
  253. }
  254. .red {
  255. color: #d43030;
  256. }
  257. .green {
  258. color: #00baad;
  259. }
  260. }
  261. }
  262. }
  263. // 修改顶部分段器样式
  264. ::v-deep {
  265. .segmented-control {
  266. height: 100rpx;
  267. background-color: #fff;
  268. }
  269. }
  270. </style>