editDetail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view style="padding-bottom: 150rpx;" v-if="shangxian === '否'">
  3. <view class="center_view">
  4. <view class="center_name">行程地址</view>
  5. <view class="addbox">
  6. <view class="green"></view>
  7. <view class="center_name">{{order.shipAddress}}出发</view>
  8. </view>
  9. <view class="addbox">
  10. <view class="orgin"></view>
  11. <view class="center_name">{{order.deliveryAddress}}目的地</view>
  12. </view>
  13. <view class="center_name margin-top-lg">预约时间</view>
  14. <view class="addbox justify-between" @click="openTime()">
  15. <view class="flex align-center">
  16. <image src="/static/upload/time.png" style="width: 34rpx;height: 34rpx;"></image>
  17. <view class="center_name margin-left-xs" v-if="!order.startTime">选择预约时间</view>
  18. <view class="center_name margin-left-xs" v-else>{{order.startTime}}</view>
  19. </view>
  20. <view class="margin-left-xs">
  21. <image src="/static/image/right.png" style="width: 12rpx;height: 20rpx;">
  22. </image>
  23. </view>
  24. </view>
  25. <view class="center_name margin-top-lg">出行车辆</view>
  26. <view>
  27. <view class="bz_item_sel">
  28. {{driverPlate}}
  29. </view>
  30. <view class="center_name margin-top">乘车人数</view>
  31. <view class="flex">
  32. <view :class="order.seatNum === '1' ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB('1')">
  33. 1座
  34. </view>
  35. <view :class="order.seatNum === '2' ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB('2')">
  36. 2座
  37. </view>
  38. <view :class="order.seatNum === '3' ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB('3')">
  39. 3座
  40. </view>
  41. <view :class="order.seatNum === '4' ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB('4')">
  42. 4座
  43. </view>
  44. </view>
  45. <view class="center_name margin-top">是否有同行亲友</view>
  46. <view class="flex">
  47. <view :class="order.isFriends === '1' ? 'bz_item_sel' : 'bz_item'" @tap="checkBZQY('1')">
  48. </view>
  49. <view :class="order.isFriends === '2' ? 'bz_item_sel' : 'bz_item'" @tap="checkBZQY('2')">
  50. </view>
  51. </view>
  52. <view class="center_name margin-top">高速费用</view>
  53. <view class="flex">
  54. <view :class="order.isHighSpeedPrice == 1 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZGS(1)">
  55. 司机承担
  56. </view>
  57. <view :class="order.isHighSpeedPrice == 2 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZGS(2)">
  58. 乘客承担
  59. </view>
  60. <view :class="order.isHighSpeedPrice == 3 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZGS(3)">
  61. 费用AA
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="flex justify-between margin-top padding-lr">
  67. <view class="remkbtnc" @tap="goBack">返回</view>
  68. <view class="remkbtn" @tap="goEdit">修改</view>
  69. </view>
  70. <u-picker v-model="Timeshow" mode="time" :params="params" @confirm="timeConfirm"></u-picker>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. driverPlate: '',
  78. params: {
  79. year: true,
  80. month: true,
  81. day: true,
  82. hour: true,
  83. minute: true,
  84. second: false
  85. },
  86. Timeshow: false,
  87. order: {},
  88. driverRouteId: '',
  89. shangxian: '是'
  90. }
  91. },
  92. onLoad(d) {
  93. this.shangxian = uni.getStorageSync('shangxian')
  94. if (this.shangxian === '否') {
  95. uni.setNavigationBarTitle({
  96. title: '编辑行程'
  97. })
  98. }
  99. if (d.driverRouteId) {
  100. this.driverRouteId = d.driverRouteId;
  101. this.getDetail();
  102. }
  103. },
  104. methods: {
  105. checkBZGS(index) {
  106. this.order.isHighSpeedPrice = index;
  107. },
  108. goBack() {
  109. uni.navigateBack();
  110. },
  111. goEdit() {
  112. this.$queue.showLoading('修改中...')
  113. this.$Request.postJson('/app/driverRoute/updateDriverRoute', this.order).then(
  114. res => {
  115. uni.hideLoading();
  116. if (res.code == 0) {
  117. this.$queue.showToast('修改成功!');
  118. setTimeout(d => {
  119. uni.navigateBack();
  120. }, 1500)
  121. } else {
  122. this.$queue.showToast(res.msg);
  123. }
  124. })
  125. },
  126. checkBZQY(index) {
  127. this.order.isFriends = index;
  128. },
  129. checkBZFB(index) {
  130. this.order.seatNum = index;
  131. },
  132. timeConfirm(e) {
  133. this.order.startTime = e.month + '月' + e.day + '日' + ' ' + e.hour + ':' + e.minute
  134. },
  135. openTime() {
  136. this.Timeshow = true
  137. },
  138. getDetail() {
  139. this.$Request.getT('/app/driverRoute/selectDriverRouteById?driverRouteId=' + this.driverRouteId).then(
  140. res => {
  141. if (res.code == 0) {
  142. this.order = res.data;
  143. }
  144. });
  145. let userId = this.$queue.getData('userId');
  146. this.$Request.getT('/app/driver/selectDriverByUserId?userId=' + userId).then(res => {
  147. if (res.code == 0 && res.data) {
  148. this.driverPlate = res.data.driverPlate
  149. }
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss">
  156. page {
  157. background: #F5F5F5;
  158. }
  159. .center_view {
  160. width: 686rpx;
  161. background: #FFFFFF;
  162. border-radius: 32rpx;
  163. padding: 40rpx 30rpx;
  164. margin: 0 auto;
  165. margin-top: 38rpx;
  166. .center_name {
  167. font-family: Source Han Sans CN;
  168. font-weight: 600;
  169. font-size: 28rpx;
  170. color: #333333;
  171. }
  172. .addbox {
  173. width: 626rpx;
  174. height: 94rpx;
  175. background: #FFFFFF;
  176. border-radius: 24rpx;
  177. border: 2rpx solid #CCCCCC;
  178. font-family: Source Han Sans CN;
  179. font-weight: 500;
  180. font-size: 28rpx;
  181. color: #282828;
  182. line-height: 94rpx;
  183. display: flex;
  184. align-items: center;
  185. margin-top: 30rpx;
  186. padding: 0rpx 30rpx;
  187. }
  188. .green {
  189. width: 16rpx;
  190. height: 16rpx;
  191. background: #1FC657;
  192. border-radius: 50%;
  193. margin-right: 20rpx;
  194. }
  195. .orgin {
  196. width: 16rpx;
  197. height: 16rpx;
  198. background: #FBAC04;
  199. border-radius: 50%;
  200. margin-right: 20rpx;
  201. }
  202. .bz_item {
  203. width: fit-content;
  204. padding: 18rpx 30rpx;
  205. // height: 71rpx;
  206. background: #FFFFFF;
  207. border-radius: 24rpx;
  208. border: 1px solid #CCCCCC;
  209. font-family: PingFang SC;
  210. font-weight: 500;
  211. font-size: 24rpx;
  212. color: #030303;
  213. margin-top: 20rpx;
  214. margin-right: 20rpx;
  215. }
  216. .bz_item_sel {
  217. width: fit-content;
  218. padding: 18rpx 30rpx;
  219. // height: 71rpx;
  220. background: #FFFFFF;
  221. border-radius: 24rpx;
  222. border: 1px solid #346EF6;
  223. font-family: PingFang SC;
  224. font-weight: 500;
  225. font-size: 24rpx;
  226. color: #030303;
  227. margin-top: 20rpx;
  228. margin-right: 20rpx;
  229. }
  230. }
  231. .remkbtnc {
  232. width: 333rpx;
  233. height: 98rpx;
  234. background: #CCCCCC;
  235. border-radius: 50rpx;
  236. line-height: 50rpx;
  237. text-align: center;
  238. font-family: PingFang SC;
  239. font-weight: bold;
  240. line-height: 98rpx;
  241. font-size: 32rpx;
  242. color: #FFFFFF;
  243. }
  244. .remkbtn {
  245. width: 333rpx;
  246. height: 98rpx;
  247. background: #346EF6;
  248. border-radius: 50rpx;
  249. line-height: 50rpx;
  250. text-align: center;
  251. font-family: PingFang SC;
  252. font-weight: bold;
  253. font-size: 32rpx;
  254. line-height: 98rpx;
  255. color: #FFFFFF;
  256. }
  257. </style>