backlog.vue 7.6 KB

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