detailDriver.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. <view class="list-title">
  61. <view class="list-title-left">人员名单({{ typeList[result_state].text }}{{ listData.length }}人)</view>
  62. <picker style="width: 38%;" :range="typeList" range-key="text" @change="bindPickerChange">
  63. <view class="list-title-right">
  64. {{ typeList[result_state].text }}
  65. <view class="right-img"><img src="../../static/bottom.png" /></view>
  66. </view>
  67. </picker>
  68. </view>
  69. <view class="list-item" v-for="(item, index) in listData" :key="index">
  70. <view class="item-img"><img src="../../static/man.png" /></view>
  71. <view class="item-info">
  72. <view class="info-name">
  73. <view>{{ item.user_name }}</view>
  74. </view>
  75. <view class="info-mes">
  76. {{ item.user_zz }}
  77. <span>{{ item.yy_time }}</span>
  78. </view>
  79. </view>
  80. <view v-if="item.yy_state === '1'" class="item-type"><img src="../../static/subscribe.png" /></view>
  81. <view v-else class="item-type"><img src="../../static/pass2.png" /></view>
  82. </view>
  83. <!-- 无数据时展示的区域 -->
  84. <view class="list-nodata" v-if="listData.length == 0">
  85. <img src="../../static/no-bus.png" />
  86. <view>暂无数据</view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. <script setup>
  92. import { ref } from 'vue'
  93. import { onLoad } from '@dcloudio/uni-app'
  94. import { myRequest } from '@/util/api.js'
  95. import { isWeixin } from '@/util/isWeixin.js'
  96. onLoad(options => {
  97. if (isWeixin()) {
  98. let userInfo = JSON.parse(uni.getStorageSync('bus-userInfo'))
  99. if (userInfo.user_zz !== '司机') {
  100. uni.redirectTo({
  101. url: '/pages/404/404?message=暂无权限'
  102. })
  103. } else {
  104. info.value = JSON.parse(options.info)
  105. idRef.value = info.value.id
  106. // 获取人员列表
  107. getData()
  108. }
  109. } else {
  110. uni.redirectTo({
  111. url: '/pages/404/404?message=请在微信客户端打开链接'
  112. })
  113. }
  114. })
  115. // 带过来的预约详情数据
  116. const info = ref({})
  117. // 参数id
  118. const idRef = ref(null)
  119. // 人员列表数组
  120. const listData = ref([])
  121. // 人员名单筛选状态
  122. const result_state = ref(0)
  123. const typeList = ref([
  124. {
  125. text: '全部',
  126. value: 0
  127. },
  128. {
  129. text: '已预约未上车',
  130. value: 1
  131. },
  132. {
  133. text: '已上车',
  134. value: 2
  135. }
  136. ])
  137. // 获取人员名单请求
  138. const getData = async () => {
  139. const res = await myRequest({
  140. url: '/appqueryAppointeds.action',
  141. data: {
  142. id: idRef.value,
  143. result_state: result_state.value
  144. }
  145. })
  146. // console.log(res)
  147. listData.value = res.data
  148. }
  149. // 下拉框的选择回调事件
  150. const bindPickerChange = e => {
  151. result_state.value = e.detail.value
  152. getData()
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .container {
  157. background-color: #fff;
  158. .box {
  159. display: flex;
  160. justify-content: space-between;
  161. align-items: center;
  162. padding: 0 30rpx;
  163. height: 98rpx;
  164. font-size: 28rpx;
  165. border-bottom: 1rpx solid #e6e6e6;
  166. .left {
  167. flex: 1;
  168. color: #999999;
  169. }
  170. .right {
  171. flex: 1;
  172. display: flex;
  173. justify-content: flex-end;
  174. }
  175. .right2 {
  176. flex: 3;
  177. display: flex;
  178. justify-content: flex-end;
  179. }
  180. }
  181. .list {
  182. padding: 13rpx 30rpx;
  183. .list-title {
  184. display: flex;
  185. margin-top: 20rpx;
  186. height: 41rpx;
  187. color: #999999;
  188. font-size: 28rpx;
  189. .list-title-left {
  190. flex: 1;
  191. }
  192. .list-title-right {
  193. flex: 1;
  194. display: flex;
  195. justify-content: flex-end;
  196. color: #000;
  197. .right-img {
  198. margin-left: 27rpx;
  199. margin-top: -5rpx;
  200. width: 17rpx;
  201. height: 12rpx;
  202. img {
  203. width: 100%;
  204. height: 100%;
  205. }
  206. }
  207. }
  208. }
  209. .list-item {
  210. display: flex;
  211. align-items: center;
  212. box-sizing: border-box;
  213. padding: 29rpx 0 26rpx 0;
  214. height: 155rpx;
  215. border-bottom: 1rpx solid #e6e6e6;
  216. .item-img {
  217. width: 100rpx;
  218. height: 100rpx;
  219. border-radius: 50%;
  220. img {
  221. width: 100%;
  222. height: 100%;
  223. }
  224. }
  225. .item-info {
  226. flex: 1;
  227. display: flex;
  228. flex-direction: column;
  229. justify-content: space-evenly;
  230. margin-left: 6rpx;
  231. height: 100rpx;
  232. .info-name {
  233. display: flex;
  234. align-items: center;
  235. font-size: 32rpx;
  236. .info-name-img {
  237. margin-left: 26rpx;
  238. width: 30rpx;
  239. height: 35rpx;
  240. img {
  241. width: 100%;
  242. height: 100%;
  243. }
  244. }
  245. }
  246. .info-mes {
  247. font-size: 24rpx;
  248. color: #999999;
  249. span {
  250. margin-left: 26rpx;
  251. color: #a6a6a6;
  252. }
  253. }
  254. }
  255. .item-type {
  256. width: 104rpx;
  257. height: 41rpx;
  258. img {
  259. width: 100%;
  260. height: 100%;
  261. }
  262. }
  263. }
  264. .list-nodata {
  265. padding: 50rpx 0;
  266. background-color: #fff;
  267. text-align: center;
  268. color: #999999;
  269. img {
  270. width: 500rpx;
  271. }
  272. }
  273. }
  274. }
  275. </style>