混凝土运输管理微信小程序、替班
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.

223 lines
5.4 KiB

1 week ago
  1. <template>
  2. <view class="content">
  3. <view class="head">
  4. <image v-if="o.car_image" class="head" :src="o.car_image" mode="scaleToFill"/>
  5. <image v-else class="head" src="/static/re/center.png" mode="scaleToFill"/>
  6. </view>
  7. <view class="item-card b-relative">
  8. <view>
  9. <view class="title">
  10. <span class="title-span">·</span>计划信息
  11. </view>
  12. </view>
  13. <view class="tips" style="line-height: 48rpx;font-size: 28rpx;">
  14. <view>到场时间{{ $timeUtils.formatTime2Day(o.in_time) }}</view>
  15. <view>计划数量{{ o.mi || '-- ' }} 立方或者趟</view>
  16. <view>合同类型{{ +o.type===1?'现金单':'合同单' }}</view>
  17. <view @click="openMap()">
  18. <span>施工地址{{ o.address || '--' }}</span>
  19. <image src="/static/icons/icon1.png" class="square40" style="margin: 0 0 -8rpx;"/>
  20. </view>
  21. </view>
  22. <view class="tips ti">{{ $timeUtils.formatTime(o.create_time) || '--'}}发布</view>
  23. </view>
  24. <view class="item-card">
  25. <view>
  26. <view class="title">
  27. <span class="title-span">·</span>车辆信息
  28. </view>
  29. </view>
  30. <view class="tips" style="line-height: 48rpx;font-size: 28rpx;">
  31. <view>车辆牌照{{ o.car_no }}</view>
  32. <view>车辆轴数{{ o.car_mi }}</view>
  33. <view @click="clickCar(o.car_id)">
  34. <span>证照信息点击查看证件信息</span>
  35. <image src="/static/icons/icon1.png" class="square40" style="margin: 0 0 -8rpx;"/>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="item-card">
  40. <view>
  41. <view class="title">
  42. <span class="title-span">·</span>接单须知
  43. </view>
  44. </view>
  45. <view class="tips">
  46. <p>1.您需要预交保证金进行接单接单后如有特殊情况请及时与平台沟通协调可通过个人中心-我要拒单联系客服</p>
  47. <p>2.为了保障工作顺利开展建议您提前一定时间到达现场请规划您的合理出行时间</p>
  48. <p>3.施工完成取车前后请您按照平台要求及时准确的拍摄报以便出现合同争议时通过您提交的信息保证您的利益</p>
  49. </view>
  50. </view>
  51. <view class="re-end-pand" v-if="+role===0 && +o.status===0">
  52. <button @click="loadOnline">确认接单</button>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. id: "",
  61. role: "1",
  62. o: {}
  63. }
  64. },
  65. onLoad(opn) {
  66. this.id = opn.id
  67. console.log(opn);
  68. this.role = uni.getStorageSync("role");
  69. this.loadOrder()
  70. if(!uni.getStorageSync("userid")){
  71. uni.showModal({
  72. title: "登陆检测",
  73. content: "查看和接单需要识别您的用户身份,请先登陆",
  74. success: (res) => {
  75. if(res.confirm === true){
  76. uni.navigateTo({
  77. url: "/pages/login/login"
  78. })
  79. } else {
  80. uni.navigateBack({delta: 1})
  81. }
  82. }
  83. })
  84. }
  85. },
  86. methods: {
  87. clickBanner(){ uni.navigateTo({ url: '/pages/login/login' }) },
  88. clickCar(id){
  89. uni.navigateTo({ url: `/pages/base/showcar?id=${id}`})
  90. },
  91. loadOnline(){
  92. const _this = this
  93. this.$httpGet("/api/online/get", {}, (res) => {
  94. console.log('[/online/get]', res);
  95. if(res.data && +res.data===1){
  96. uni.showModal({
  97. title: "在线检测",
  98. content: "请上线后再接单,点击确认自动上线",
  99. success: (res) => {
  100. if(res.confirm === true){
  101. _this.$httpGet("/api/online/set", {online: '0'}, (res) => {
  102. console.log('[/online/set]', res);
  103. if(res.data || res.data == 0){
  104. _this.clickRecrive()
  105. }
  106. })
  107. }
  108. }
  109. })
  110. } else {
  111. _this.checkDriver()
  112. }
  113. })
  114. },
  115. checkDriver(){
  116. const _this = this
  117. this.$httpGet("/api/driver/checkOrder", {}, function(res) {
  118. console.log('[/driver/checkOrder]', res);
  119. if(res.data>0){
  120. uni.showModal({
  121. title: "订单检测",
  122. content: "您还有正在进行中的订单,请完成后在试",
  123. success: (res) => {
  124. uni.navigateBack({
  125. delta: 1
  126. });
  127. }
  128. })
  129. } else {
  130. _this.clickRecrive()
  131. }
  132. })
  133. },
  134. clickRecrive() {
  135. this.$httpGet("/api/order/receive", {id: this.id}, function(res) {
  136. console.log('[/order/receive]', res);
  137. if(res.data){
  138. uni.showToast({ icon: "success", title: "接单成功" })
  139. setTimeout(()=>{
  140. uni.navigateBack({
  141. delta: 1
  142. });
  143. }, 1500)
  144. }
  145. })
  146. },
  147. loadOrder(){
  148. const _this = this
  149. this.$httpGet("/api/order/get", {id: this.id}, function(res) {
  150. console.log('[/order/get]', res);
  151. if(res.data){
  152. _this.o = res.data
  153. }
  154. })
  155. },
  156. openMap(){
  157. uni.openLocation({
  158. latitude: parseFloat(this.o.latitude),
  159. longitude:parseFloat(this.o.longitude),
  160. scale: 18,
  161. name: this.o.address || '未命名地址'
  162. })
  163. },
  164. }
  165. }
  166. </script>
  167. <style>
  168. page {
  169. background-color: #f5f5f5;
  170. }
  171. .head{
  172. height: 460rpx;
  173. width: 100vw;
  174. }
  175. .item-card{
  176. width: calc(100vw - 40rpx);
  177. min-height: 176rpx;
  178. padding: 30rpx 20rpx;
  179. background-color: #fff;
  180. margin-bottom: 10rpx;
  181. }
  182. .title{
  183. font-size: 30rpx;
  184. font-weight: 400;
  185. line-height: 36rpx;
  186. letter-spacing: 0px;
  187. color: #000000;
  188. }
  189. .title-span {
  190. font-size: 30rpx;
  191. font-weight: bolder;
  192. margin-right: 10rpx;
  193. }
  194. .tips{
  195. font-size: 24rpx;
  196. font-weight: 350;
  197. line-height: 36rpx;
  198. letter-spacing: 0px;
  199. color: #333333;
  200. padding: 20rpx;
  201. }
  202. .tips.ti{
  203. position: absolute;
  204. top: 10rpx;right: 20rpx;
  205. color: #999;
  206. }
  207. </style>