detailDriver.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <view class="container">
  3. <!-- 车牌号区域 -->
  4. <view class="box">
  5. <view class="left">车牌号</view>
  6. <view class="right">{{ info.car_number }}</view>
  7. </view>
  8. <!-- 人数区域 -->
  9. <view class="box">
  10. <view class="left">容量</view>
  11. <view class="right">{{ info.contain }}</view>
  12. </view>
  13. <!-- 发车日期区域 -->
  14. <view class="box">
  15. <view class="left">发车日期</view>
  16. <view class="right">{{ info.yy_date }}</view>
  17. </view>
  18. <!-- 发车时间区域 -->
  19. <view class="box">
  20. <view class="left">发车时间</view>
  21. <view class="right">{{ info.ci_time }}</view>
  22. </view>
  23. <!-- 扫码开始时间区域 -->
  24. <view class="box">
  25. <view class="left">扫码开始时间</view>
  26. <view class="right">{{ info.sm_start }}</view>
  27. </view>
  28. <!-- 扫码结束时间区域 -->
  29. <view class="box">
  30. <view class="left">扫码结束时间</view>
  31. <view class="right">{{ info.sm_end }}</view>
  32. </view>
  33. <!-- 预约截止时间区域 -->
  34. <view class="box">
  35. <view class="left">预约截止时间</view>
  36. <view class="right">{{ info.yy_end }}</view>
  37. </view>
  38. <!-- 路线区域 -->
  39. <view class="box">
  40. <view class="left">路线</view>
  41. <view class="right2">{{ info.route }}</view>
  42. </view>
  43. <!-- 终点站区域 -->
  44. <view class="box">
  45. <view class="left">站点</view>
  46. <view class="right2">{{ info.route_end }}</view>
  47. </view>
  48. <!-- 状态区域 -->
  49. <view class="box">
  50. <view class="left">状态</view>
  51. <view class="right">{{ info.state_str }}</view>
  52. </view>
  53. <!-- 提前一天预约区域 -->
  54. <view class="box">
  55. <view class="left">可否提前一天预约</view>
  56. <view class="right">{{ info.before_state === '0' ? '不可以' : '可以' }}</view>
  57. </view>
  58. <!-- 人员名单区域 -->
  59. <view class="list">
  60. <!-- 标题区域 -->
  61. <view class="list-title" v-if="info.user_num !== '0'">人员名单({{ listData.length }}人)</view>
  62. <!-- 筛选区域 -->
  63. <view class="list-search" v-if="info.user_num !== '0'">
  64. <!-- 身份筛选区域 -->
  65. <picker style="width: 50%" :range="statusList" range-key="text" @change="bindPickerChange($event, 1)">
  66. <view class="list-search-item">
  67. {{ statusList[result_status].text }}
  68. <view class="right-img"><img src="../../static/bottom.png" /></view>
  69. </view>
  70. </picker>
  71. <!-- 上车状态筛选区域 -->
  72. <picker style="width: 50%" :range="typeList" range-key="text" @change="bindPickerChange($event, 2)">
  73. <view class="list-search-item2">
  74. {{ typeList[result_state].text }}
  75. <view class="right-img"><img src="../../static/bottom.png" /></view>
  76. </view>
  77. </picker>
  78. </view>
  79. <view class="list-item" v-for="(item, index) in listData" :key="index">
  80. <view class="item-img"><img src="../../static/man.png" /></view>
  81. <view class="item-info">
  82. <view class="info-name">
  83. <view>{{ item.user_name }}</view>
  84. </view>
  85. <view class="info-mes">
  86. {{ item.user_zz }}
  87. <span>{{ item.yy_time }}</span>
  88. </view>
  89. </view>
  90. <view v-if="item.yy_state === '1'" class="item-type"><img src="../../static/subscribe.png" /></view>
  91. <view v-else class="item-type"><img src="../../static/pass2.png" /></view>
  92. </view>
  93. <!-- 无数据时展示的区域 -->
  94. <view class="list-nodata" v-if="listData.length == 0">
  95. <img src="../../static/no-bus.png" />
  96. <view>暂无数据</view>
  97. </view>
  98. </view>
  99. </view>
  100. </template>
  101. <script setup>
  102. import { ref } from 'vue'
  103. import { onLoad } from '@dcloudio/uni-app'
  104. import { myRequest } from '@/util/api.js'
  105. import { isWeixin } from '@/util/isWeixin.js'
  106. import { filterIdentity } from '@/util/filterIdentity.js'
  107. onLoad((options) => {
  108. if (isWeixin()) {
  109. filterIdentity()
  110. info.value = JSON.parse(options.info)
  111. idRef.value = info.value.id
  112. // 获取人员列表
  113. getData()
  114. } else {
  115. uni.redirectTo({
  116. url: '/pages/404/404?message=请在微信客户端打开链接'
  117. })
  118. }
  119. })
  120. // 带过来的预约详情数据
  121. const info = ref({})
  122. // 参数id
  123. const idRef = ref(null)
  124. // 人员列表数组
  125. const listData = ref([])
  126. // 人员名单上车状态
  127. const result_state = ref(0)
  128. const typeList = ref([
  129. {
  130. text: '全部',
  131. value: 0
  132. },
  133. {
  134. text: '已预约未上车',
  135. value: 1
  136. },
  137. {
  138. text: '已上车',
  139. value: 2
  140. }
  141. ])
  142. // 人员名单身份类型
  143. const result_status = ref(0)
  144. const statusList = ref([
  145. {
  146. text: '全部',
  147. value: 0
  148. },
  149. {
  150. text: '教师',
  151. value: 1
  152. },
  153. {
  154. text: '临时人员',
  155. value: 2
  156. }
  157. ])
  158. // 获取人员名单请求
  159. const getData = async () => {
  160. const res = await myRequest({
  161. url: '/appqueryAppointeds.action',
  162. data: {
  163. id: idRef.value,
  164. result_state: result_state.value,
  165. userzz_state: result_status.value
  166. }
  167. })
  168. // console.log(res)
  169. listData.value = res.data
  170. }
  171. // 下拉框的选择回调事件
  172. const bindPickerChange = (e, type) => {
  173. if (type === 1) {
  174. result_status.value = e.detail.value
  175. } else if (type === 2) {
  176. result_state.value = e.detail.value
  177. }
  178. getData()
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. .container {
  183. background-color: #fff;
  184. .box {
  185. display: flex;
  186. justify-content: space-between;
  187. align-items: center;
  188. padding: 0 30rpx;
  189. height: 98rpx;
  190. font-size: 28rpx;
  191. border-bottom: 1rpx solid #e6e6e6;
  192. .left {
  193. flex: 1;
  194. color: #999999;
  195. }
  196. .right {
  197. flex: 1;
  198. display: flex;
  199. justify-content: flex-end;
  200. }
  201. .right2 {
  202. flex: 3;
  203. display: flex;
  204. justify-content: flex-end;
  205. }
  206. }
  207. .list {
  208. padding: 13rpx 30rpx;
  209. .list-title {
  210. display: flex;
  211. margin-top: 20rpx;
  212. height: 41rpx;
  213. color: #999999;
  214. font-size: 28rpx;
  215. }
  216. .list-search {
  217. display: flex;
  218. padding: 20rpx 0;
  219. .list-search-item,
  220. .list-search-item2 {
  221. flex: 1;
  222. display: flex;
  223. justify-content: flex-start;
  224. .right-img {
  225. margin-left: 27rpx;
  226. margin-top: -5rpx;
  227. width: 17rpx;
  228. height: 12rpx;
  229. img {
  230. width: 100%;
  231. height: 100%;
  232. }
  233. }
  234. }
  235. .list-search-item2 {
  236. justify-content: flex-end;
  237. }
  238. }
  239. .list-item {
  240. display: flex;
  241. align-items: center;
  242. box-sizing: border-box;
  243. padding: 29rpx 0 26rpx 0;
  244. height: 155rpx;
  245. border-bottom: 1rpx solid #e6e6e6;
  246. .item-img {
  247. width: 100rpx;
  248. height: 100rpx;
  249. border-radius: 50%;
  250. img {
  251. width: 100%;
  252. height: 100%;
  253. }
  254. }
  255. .item-info {
  256. flex: 1;
  257. display: flex;
  258. flex-direction: column;
  259. justify-content: space-evenly;
  260. margin-left: 6rpx;
  261. height: 100rpx;
  262. .info-name {
  263. display: flex;
  264. align-items: center;
  265. font-size: 32rpx;
  266. .info-name-img {
  267. margin-left: 26rpx;
  268. width: 30rpx;
  269. height: 35rpx;
  270. img {
  271. width: 100%;
  272. height: 100%;
  273. }
  274. }
  275. }
  276. .info-mes {
  277. font-size: 24rpx;
  278. color: #999999;
  279. span {
  280. margin-left: 26rpx;
  281. color: #a6a6a6;
  282. }
  283. }
  284. }
  285. .item-type {
  286. width: 104rpx;
  287. height: 41rpx;
  288. img {
  289. width: 100%;
  290. height: 100%;
  291. }
  292. }
  293. }
  294. .list-nodata {
  295. padding: 50rpx 0;
  296. background-color: #fff;
  297. text-align: center;
  298. color: #999999;
  299. img {
  300. width: 500rpx;
  301. }
  302. }
  303. }
  304. }
  305. </style>