editDetail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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 v-if="globalImages" :src="globalImages + 'imgs/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 v-if="globalImages" :src="globalImages + 'imgs/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. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  75. export default {
  76. data() {
  77. return {
  78. driverPlate: '',
  79. params: {
  80. year: true,
  81. month: true,
  82. day: true,
  83. hour: true,
  84. minute: true,
  85. second: false
  86. },
  87. Timeshow: false,
  88. order: {},
  89. driverRouteId: '',
  90. shangxian: '是',
  91. globalImages: '',
  92. }
  93. },
  94. onLoad(d) {
  95. waitForGlobalImages().then((path) => {
  96. console.log('✅ 全局图片路径:', path)
  97. this.globalImages = path
  98. })
  99. this.shangxian = uni.getStorageSync('shangxian')
  100. if (this.shangxian === '否') {
  101. uni.setNavigationBarTitle({
  102. title: '编辑行程'
  103. })
  104. }
  105. if (d.driverRouteId) {
  106. this.driverRouteId = d.driverRouteId;
  107. this.getDetail();
  108. }
  109. },
  110. methods: {
  111. checkBZGS(index) {
  112. this.order.isHighSpeedPrice = index;
  113. },
  114. goBack() {
  115. uni.navigateBack();
  116. },
  117. goEdit() {
  118. this.$queue.showLoading('修改中...')
  119. this.$Request.postJson('/app/driverRoute/updateDriverRoute', this.order).then(
  120. res => {
  121. uni.hideLoading();
  122. if (res.code == 0) {
  123. this.$queue.showToast('修改成功!');
  124. setTimeout(d => {
  125. uni.navigateBack();
  126. }, 1500)
  127. } else {
  128. this.$queue.showToast(res.msg);
  129. }
  130. })
  131. },
  132. checkBZQY(index) {
  133. this.order.isFriends = index;
  134. },
  135. checkBZFB(index) {
  136. this.order.seatNum = index;
  137. },
  138. timeConfirm(e) {
  139. this.order.startTime = e.month + '月' + e.day + '日' + ' ' + e.hour + ':' + e.minute
  140. },
  141. openTime() {
  142. this.Timeshow = true
  143. },
  144. getDetail() {
  145. this.$Request.getT('/app/driverRoute/selectDriverRouteById?driverRouteId=' + this.driverRouteId).then(
  146. res => {
  147. if (res.code == 0) {
  148. this.order = res.data;
  149. }
  150. });
  151. let userId = this.$queue.getData('userId');
  152. this.$Request.getT('/app/driver/selectDriverByUserId?userId=' + userId).then(res => {
  153. if (res.code == 0 && res.data) {
  154. this.driverPlate = res.data.driverPlate
  155. }
  156. })
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. page {
  163. background: #F5F5F5;
  164. }
  165. .center_view {
  166. width: 686rpx;
  167. background: #FFFFFF;
  168. border-radius: 32rpx;
  169. padding: 40rpx 30rpx;
  170. margin: 0 auto;
  171. margin-top: 38rpx;
  172. .center_name {
  173. font-family: Source Han Sans CN;
  174. font-weight: 600;
  175. font-size: 28rpx;
  176. color: #333333;
  177. }
  178. .addbox {
  179. width: 626rpx;
  180. height: 94rpx;
  181. background: #FFFFFF;
  182. border-radius: 24rpx;
  183. border: 2rpx solid #CCCCCC;
  184. font-family: Source Han Sans CN;
  185. font-weight: 500;
  186. font-size: 28rpx;
  187. color: #282828;
  188. line-height: 94rpx;
  189. display: flex;
  190. align-items: center;
  191. margin-top: 30rpx;
  192. padding: 0rpx 30rpx;
  193. }
  194. .green {
  195. width: 16rpx;
  196. height: 16rpx;
  197. background: #1FC657;
  198. border-radius: 50%;
  199. margin-right: 20rpx;
  200. }
  201. .orgin {
  202. width: 16rpx;
  203. height: 16rpx;
  204. background: #FBAC04;
  205. border-radius: 50%;
  206. margin-right: 20rpx;
  207. }
  208. .bz_item {
  209. width: fit-content;
  210. padding: 18rpx 30rpx;
  211. // height: 71rpx;
  212. background: #FFFFFF;
  213. border-radius: 24rpx;
  214. border: 1px solid #CCCCCC;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. font-size: 24rpx;
  218. color: #030303;
  219. margin-top: 20rpx;
  220. margin-right: 20rpx;
  221. }
  222. .bz_item_sel {
  223. width: fit-content;
  224. padding: 18rpx 30rpx;
  225. // height: 71rpx;
  226. background: #FFFFFF;
  227. border-radius: 24rpx;
  228. border: 1px solid #346EF6;
  229. font-family: PingFang SC;
  230. font-weight: 500;
  231. font-size: 24rpx;
  232. color: #030303;
  233. margin-top: 20rpx;
  234. margin-right: 20rpx;
  235. }
  236. }
  237. .remkbtnc {
  238. width: 333rpx;
  239. height: 98rpx;
  240. background: #CCCCCC;
  241. border-radius: 50rpx;
  242. line-height: 50rpx;
  243. text-align: center;
  244. font-family: PingFang SC;
  245. font-weight: bold;
  246. line-height: 98rpx;
  247. font-size: 32rpx;
  248. color: #FFFFFF;
  249. }
  250. .remkbtn {
  251. width: 333rpx;
  252. height: 98rpx;
  253. background: #346EF6;
  254. border-radius: 50rpx;
  255. line-height: 50rpx;
  256. text-align: center;
  257. font-family: PingFang SC;
  258. font-weight: bold;
  259. font-size: 32rpx;
  260. line-height: 98rpx;
  261. color: #FFFFFF;
  262. }
  263. </style>