detailDriver.vue 6.2 KB

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