混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

293 lines
6.4 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <navbar title="订单详情" leftClick @leftClick="$utils.navigateBack" />
  4. <!-- 头部图片 -->
  5. <view class="head">
  6. <image v-if="orderDetail.headerImage" class="head" :src="orderDetail.headerImage" mode="scaleToFill" />
  7. <image v-else class="head" src="/static/re/center.png" mode="scaleToFill" />
  8. </view>
  9. <!-- 计划信息 -->
  10. <view class="item-card b-relative">
  11. <view class="title">
  12. <label class="title-span">·</label>计划信息
  13. </view>
  14. <view class="tips" style="line-height:48rpx;font-size:28rpx">
  15. <view>到场时间{{ orderDetail.arrivalTime }}</view>
  16. <view>计划数量{{ orderDetail.quantity }} 立方或者趟</view>
  17. <view>合同类型{{ orderDetail.contractType }}</view>
  18. <view @click="openMap">
  19. <label>施工地址{{ orderDetail.address }}</label>
  20. <image src="/static/icons/icon1.png" class="square40" style="margin:0 0 -8rpx" />
  21. </view>
  22. </view>
  23. <view class="tips ti">{{ orderDetail.publisher }}发布</view>
  24. </view>
  25. <!-- 车辆信息 -->
  26. <view class="item-card">
  27. <view class="title">
  28. <label class="title-span">·</label>车辆信息
  29. </view>
  30. <view class="tips" style="line-height:48rpx;font-size:28rpx">
  31. <view>车辆牌照{{ orderDetail.plateNumber }}</view>
  32. <view>车辆轴数{{ orderDetail.axleCount }}</view>
  33. <view @click="viewCertificates">
  34. <label>证照信息点击查看证件信息</label>
  35. <image src="/static/icons/icon1.png" class="square40" style="margin:0 0 -8rpx" />
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 接单须知 -->
  40. <view class="item-card">
  41. <view class="title">
  42. <label class="title-span">·</label>接单须知
  43. </view>
  44. <view class="tips">
  45. <view>1.您需要预交保证金进行接单接单后如有特殊情况请及时与平台沟通协调可通过个人中心-我要拒单联系客服</view>
  46. <view>2.为了保障工作顺利开展建议您提前一定时间到达现场请规划您的合理出行时间</view>
  47. <view>3.施工完成取车前后请您按照平台要求及时准确的拍摄报以便出现合同争议时通过您提交的信息保证您的利益</view>
  48. </view>
  49. </view>
  50. <!-- 确认接单按钮 -->
  51. <view v-if="showConfirmBtn" class="re-end-pand">
  52. <button @click="confirmOrder">确认接单</button>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import navbar from '@/components/base/navbar.vue'
  58. export default {
  59. name: 'UserOrderd',
  60. components: {
  61. navbar
  62. },
  63. data() {
  64. return {
  65. orderId: '',
  66. showConfirmBtn: true,
  67. orderDetail: {
  68. headerImage: '',
  69. arrivalTime: '2024-01-15 08:00',
  70. quantity: '200',
  71. contractType: '按方计费',
  72. address: '长沙市雨花区建设工地A区',
  73. publisher: '湖南建设集团',
  74. plateNumber: '湘A12345',
  75. axleCount: '4轴',
  76. longitude: 112.9388,
  77. latitude: 28.2282
  78. }
  79. }
  80. },
  81. onLoad(options) {
  82. if (options.id) {
  83. this.orderId = options.id;
  84. this.loadOrderDetail();
  85. }
  86. uni.setNavigationBarTitle({
  87. title: '订单详情'
  88. });
  89. },
  90. methods: {
  91. // 加载订单详情
  92. loadOrderDetail() {
  93. // 模拟加载订单详情数据
  94. console.log('加载订单详情:', this.orderId);
  95. // 这里可以调用API获取真实数据
  96. },
  97. // 打开地图
  98. openMap() {
  99. uni.openLocation({
  100. latitude: this.orderDetail.latitude,
  101. longitude: this.orderDetail.longitude,
  102. name: '施工地址',
  103. address: this.orderDetail.address,
  104. success: () => {
  105. console.log('打开地图成功');
  106. },
  107. fail: (err) => {
  108. console.error('打开地图失败:', err);
  109. uni.showToast({
  110. title: '打开地图失败',
  111. icon: 'none'
  112. });
  113. }
  114. });
  115. },
  116. // 查看证件信息
  117. viewCertificates() {
  118. uni.navigateTo({
  119. url: '/pages_order/base/showcar?id=' + this.orderId
  120. });
  121. },
  122. // 确认接单
  123. confirmOrder() {
  124. uni.showModal({
  125. title: '确认接单',
  126. content: '确定要接取这个订单吗?接单后需要按时到达现场。',
  127. success: (res) => {
  128. if (res.confirm) {
  129. this.submitOrder();
  130. }
  131. }
  132. });
  133. },
  134. // 提交接单
  135. submitOrder() {
  136. uni.showLoading({
  137. title: '接单中...'
  138. });
  139. // 模拟接单请求
  140. setTimeout(() => {
  141. uni.hideLoading();
  142. uni.showToast({
  143. title: '接单成功',
  144. icon: 'success'
  145. });
  146. // 跳转到我的订单页面
  147. setTimeout(() => {
  148. uni.navigateTo({
  149. url: '/pages_order/user/orders'
  150. });
  151. }, 1500);
  152. }, 2000);
  153. },
  154. goBack() {
  155. uni.navigateBack();
  156. }
  157. }
  158. }
  159. </script>
  160. <style scoped lang="scss">
  161. .content {
  162. min-height: 100vh;
  163. background-color: #f5f5f5;
  164. }
  165. .head {
  166. height: 460rpx;
  167. width: 100vw;
  168. }
  169. .item-card {
  170. width: calc(100vw - 40rpx);
  171. min-height: 176rpx;
  172. padding: 30rpx 20rpx;
  173. background-color: #fff;
  174. margin-bottom: 10rpx;
  175. }
  176. .title {
  177. font-size: 30rpx;
  178. font-weight: 400;
  179. line-height: 36rpx;
  180. letter-spacing: 0px;
  181. color: #000000;
  182. margin-bottom: 20rpx;
  183. }
  184. .title-span {
  185. font-size: 30rpx;
  186. font-weight: bolder;
  187. margin-right: 10rpx;
  188. color: #F40000;
  189. }
  190. .tips {
  191. font-size: 24rpx;
  192. font-weight: 350;
  193. line-height: 36rpx;
  194. letter-spacing: 0px;
  195. color: #333333;
  196. padding: 20rpx;
  197. &.ti {
  198. position: absolute;
  199. top: 10rpx;
  200. right: 20rpx;
  201. color: #999;
  202. padding: 0;
  203. }
  204. view {
  205. margin-bottom: 10rpx;
  206. &:last-child {
  207. margin-bottom: 0;
  208. }
  209. }
  210. }
  211. .square40 {
  212. width: 40rpx;
  213. height: 40rpx;
  214. vertical-align: middle;
  215. margin-left: 10rpx;
  216. }
  217. .re-end-pand {
  218. position: fixed;
  219. bottom: 0;
  220. left: 0;
  221. width: 100vw;
  222. padding: 30rpx;
  223. background-color: #fff;
  224. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
  225. button {
  226. width: 100%;
  227. height: 88rpx;
  228. line-height: 88rpx;
  229. background-color: #F40000;
  230. color: #fff;
  231. border-radius: 44rpx;
  232. font-size: 32rpx;
  233. font-weight: bold;
  234. border: none;
  235. }
  236. }
  237. .b-relative {
  238. position: relative;
  239. }
  240. .placeholder-icon {
  241. font-size: 120rpx;
  242. margin-bottom: 30rpx;
  243. }
  244. .placeholder-title {
  245. font-size: 36rpx;
  246. font-weight: bold;
  247. color: #333;
  248. margin-bottom: 20rpx;
  249. }
  250. .placeholder-text {
  251. font-size: 28rpx;
  252. color: #666;
  253. margin-bottom: 40rpx;
  254. }
  255. .back-btn {
  256. padding: 20rpx 40rpx;
  257. background-color: #007AFF;
  258. color: #fff;
  259. border-radius: 25rpx;
  260. font-size: 28rpx;
  261. border: none;
  262. }
  263. </style>