Commit 90d4fba270751bb16e42920d0579d2fa31857dfe

Authored by guzijian
1 parent 32854707

新增处置场所逻辑

garbage-removal/src/apis/order.js
1 import { request } from "@/utils/request"; 1 import { request } from "@/utils/request";
2 2
3 /** 3 /**
4 - * @method 保存 4 + * @method 保存
5 */ 5 */
6 export async function saveOrder(params, config) { 6 export async function saveOrder(params, config) {
7 return await request.post(`/order/add`, params, config); 7 return await request.post(`/order/add`, params, config);
8 } 8 }
9 9
10 /** 10 /**
11 - * @method 单详情 11 + * @method 单详情
12 */ 12 */
13 export async function queryOrderDetail(id) { 13 export async function queryOrderDetail(id) {
14 return await request.get(`/order/detail/${id}`); 14 return await request.get(`/order/detail/${id}`);
15 } 15 }
16 16
17 /** 17 /**
18 - * @method 单列表 18 + * @method 单列表
19 */ 19 */
20 export async function queryOrderList(data) { 20 export async function queryOrderList(data) {
21 return await request.get( 21 return await request.get(
@@ -24,7 +24,7 @@ export async function queryOrderList(data) { @@ -24,7 +24,7 @@ export async function queryOrderList(data) {
24 } 24 }
25 25
26 /** 26 /**
27 - * @method 修改单状态 27 + * @method 修改单状态
28 */ 28 */
29 export async function updateOrder(params, config) { 29 export async function updateOrder(params, config) {
30 return await request.put(`/order/update`, params, config); 30 return await request.put(`/order/update`, params, config);
@@ -54,7 +54,7 @@ export async function queryGuestOrderDetail(orderId) { @@ -54,7 +54,7 @@ export async function queryGuestOrderDetail(orderId) {
54 } 54 }
55 55
56 /** 56 /**
57 - * 查询公司下运输驾驶员 57 + * 查询公司下清运车辆驾驶员
58 * @param {*} companyId 58 * @param {*} companyId
59 */ 59 */
60 export async function queryOrderDispatch(orderId) { 60 export async function queryOrderDispatch(orderId) {
@@ -66,6 +66,14 @@ export async function dispatchOrders(params,config) { @@ -66,6 +66,14 @@ export async function dispatchOrders(params,config) {
66 return await request.put('/order/dispatch', params,config); 66 return await request.put('/order/dispatch', params,config);
67 } 67 }
68 68
  69 +export async function dispatchDisposalOrders(params,config) {
  70 + return await request.put('/order/dispatch/disposal', params,config);
  71 +}
  72 +
69 export async function queryOrderHandlerStatus(orderId, config) { 73 export async function queryOrderHandlerStatus(orderId, config) {
70 return await request.get(`/order/queryOrderHandlerStatus/${orderId}`, config); 74 return await request.get(`/order/queryOrderHandlerStatus/${orderId}`, config);
71 } 75 }
  76 +
  77 +export async function queryDisposalDispatch(orderId) {
  78 + return await request.get(`/order/queryDisposalDispatch/${orderId}`);
  79 +}
garbage-removal/src/components/clash-disposal-dispatch/index.vue 0 → 100644
  1 +<template>
  2 + <next-tree :changeVerify="changeVerify" :title="getTitle" ref="nextTreeRef" :checkStrictly="checkStrictly"
  3 + :selectParent="selectParent" :multiple="multiple" :treeData="treeData" @cancel="close" @confirm="onconfirm">
  4 + </next-tree>
  5 +</template>
  6 +
  7 +<script setup>
  8 +import { nextTick, ref, unref } from 'vue';
  9 +// @ts-ignore
  10 +import nextTree from '../next-tree/next-tree.vue';
  11 +const props = defineProps({
  12 + dataList: {
  13 + type: Array,
  14 + default: []
  15 + },
  16 + valueKey: {
  17 + type: String,
  18 + default: 'id'
  19 + },
  20 + multiple: {
  21 + type: Boolean,
  22 + default: true
  23 + },
  24 + selectParent: {
  25 + type: Boolean,
  26 + default: false
  27 + },
  28 + checkStrictly: {
  29 + type: Boolean,
  30 + default: false
  31 + },
  32 + onconfirm: {
  33 + type: Function,
  34 + default: () => { }
  35 + }
  36 +
  37 +})
  38 +const treeData = ref([])
  39 +const nextTreeRef = ref()
  40 +function getTitle(checked) {
  41 + return `已选:${checked.length}位处置场所负责人`
  42 +}
  43 +function changeVerify(current, chooseList) {
  44 + // 注意:返回非空字符串会阻止原有行为,并提示返回的字符串
  45 + // 如果函数体不做return返回值,即验证通过,控件正常处理业务
  46 + // 限制条件
  47 + if (chooseList) {
  48 + for (let index = 0; index < chooseList.length; index++) {
  49 + const element = chooseList[index];
  50 + if (current.id.indexOf(element.id) === -1 && element.label.indexOf(current.label) != -1) {
  51 + return "该处置场所负责人已经被选中了"
  52 + }
  53 + }
  54 + }
  55 +}
  56 +function open(dataList) {
  57 + treeData.value = handlerTreeData(dataList)
  58 + treeData.value = treeData.value.filter(item => {
  59 + return item.children[0].id
  60 + })
  61 + setTimeout(() => {
  62 + nextTick(() => {
  63 + unref(nextTreeRef).showTree = true
  64 + })
  65 + }, 0)
  66 +}
  67 +
  68 +function handlerTreeData(dataList) {
  69 + return dataList
  70 + .map((item, index) => {
  71 + return {
  72 + "id": (index + 1),
  73 + "companyName": item.garOrderDisposalCompanyName,
  74 + "label": item.garOrderDisposalCompanyName,
  75 + "children": item.personnelInfo.map((childrenItem, childrenIndex) => {
  76 + return {
  77 + "id": (index + 1) + '-' + (childrenIndex + 1),
  78 + "tel": childrenItem.tel,
  79 + "name": childrenItem.name,
  80 + "label": childrenItem.tel,
  81 + "checked": childrenItem.checked,
  82 + "disabled": childrenItem.checked ? true : childrenItem.tel ? false : true
  83 + }
  84 + })
  85 + }
  86 + })
  87 +}
  88 +function cleanTreeData(treeData) {
  89 + treeData.map(item => {
  90 + item.checked = false
  91 + if (item.children && item.children.length) {
  92 + cleanTreeData(item.children)
  93 + }
  94 + })
  95 +}
  96 +function close() {
  97 + // 清除treeData的选中状态
  98 + cleanTreeData(unref(treeData))
  99 +}
  100 +defineExpose({
  101 + open, close, nextTreeRef
  102 +})
  103 +</script>
  104 +<style lang="scss">
  105 +.line-block {
  106 + display: flex;
  107 + flex-direction: row;
  108 + justify-content: flex-start;
  109 + align-items: center;
  110 +
  111 + .img {
  112 + width: 40rpx;
  113 + height: 40rpx;
  114 + border-radius: 10rpx;
  115 + margin: 0 20rpx;
  116 + }
  117 +}
  118 +</style>
garbage-removal/src/components/clash-dispatch/index.vue renamed to garbage-removal/src/components/clash-driver-dispatch/index.vue
garbage-removal/src/pages.json
@@ -33,6 +33,24 @@ @@ -33,6 +33,24 @@
33 } 33 }
34 }, 34 },
35 { 35 {
  36 + "path": "pages/order/handler-home/transport-detail/index",
  37 + "style": {
  38 + "navigationBarTitleText": "收运单详情",
  39 + "enablePullDownRefresh": false,
  40 + "navigationBarBackgroundColor":"#53c21d",
  41 + "navigationBarTextStyle": "white"
  42 + }
  43 + },
  44 + {
  45 + "path": "pages/order/handler-home/scan-detail/index",
  46 + "style": {
  47 + "navigationBarTitleText": "收运单扫描",
  48 + "enablePullDownRefresh": false,
  49 + "navigationBarBackgroundColor":"#53c21d",
  50 + "navigationBarTextStyle": "white"
  51 + }
  52 + },
  53 + {
36 "path": "pages/login/index", 54 "path": "pages/login/index",
37 "style": { 55 "style": {
38 "navigationBarTitleText": "装饰装修垃圾智慧功能模块登录", 56 "navigationBarTitleText": "装饰装修垃圾智慧功能模块登录",
@@ -47,7 +65,7 @@ @@ -47,7 +65,7 @@
47 },{ 65 },{
48 "path": "pages/order/other-home/detail/index", 66 "path": "pages/order/other-home/detail/index",
49 "style": { 67 "style": {
50 - "navigationBarTitleText": "单详情", 68 + "navigationBarTitleText": "单详情",
51 "navigationBarTextStyle": "white", 69 "navigationBarTextStyle": "white",
52 "navigationBarBackgroundColor": "#53c21d", 70 "navigationBarBackgroundColor": "#53c21d",
53 "enablePullDownRefresh": false 71 "enablePullDownRefresh": false
@@ -55,7 +73,7 @@ @@ -55,7 +73,7 @@
55 },{ 73 },{
56 "path": "pages/order/other-home/success/index", 74 "path": "pages/order/other-home/success/index",
57 "style": { 75 "style": {
58 - "navigationBarTitleText": "完成单", 76 + "navigationBarTitleText": "完成单",
59 "navigationBarTextStyle": "white", 77 "navigationBarTextStyle": "white",
60 "navigationBarBackgroundColor": "#53c21d", 78 "navigationBarBackgroundColor": "#53c21d",
61 "enablePullDownRefresh": false 79 "enablePullDownRefresh": false
@@ -134,7 +152,7 @@ @@ -134,7 +152,7 @@
134 },{ 152 },{
135 "path": "pages/order/index", 153 "path": "pages/order/index",
136 "style": { 154 "style": {
137 - "navigationBarTitleText": "单详情", 155 + "navigationBarTitleText": "单详情",
138 "navigationBarTextStyle":"white", 156 "navigationBarTextStyle":"white",
139 "navigationBarBackgroundColor":"#53c21d", 157 "navigationBarBackgroundColor":"#53c21d",
140 "enablePullDownRefresh": false 158 "enablePullDownRefresh": false
@@ -162,7 +180,7 @@ @@ -162,7 +180,7 @@
162 "pagePath": "pages/order/index", 180 "pagePath": "pages/order/index",
163 "iconPath": "static/tabbar/icon/order.png", 181 "iconPath": "static/tabbar/icon/order.png",
164 "selectedIconPath": "static/tabbar/icon/order-green.png", 182 "selectedIconPath": "static/tabbar/icon/order-green.png",
165 - "text": "单" 183 + "text": "单"
166 }, { 184 }, {
167 "pagePath": "pages/wode/index", 185 "pagePath": "pages/wode/index",
168 "iconPath": "static/tabbar/icon/wode.png", 186 "iconPath": "static/tabbar/icon/wode.png",
garbage-removal/src/pages/home/clean/index.vue
@@ -174,7 +174,7 @@ @@ -174,7 +174,7 @@
174 </view> 174 </view>
175 </view> 175 </view>
176 <view class="company-clean-bottom-right"> 176 <view class="company-clean-bottom-right">
177 - <u-button @click="handleOderSure" shape="square" color="#a9e08f" text="立即单"></u-button> 177 + <u-button @click="handleOderSure" shape="square" color="#a9e08f" text="立即单"></u-button>
178 </view> 178 </view>
179 </view> 179 </view>
180 </view> 180 </view>
@@ -295,15 +295,20 @@ const handlePopupClick = (val) =&gt; { @@ -295,15 +295,20 @@ const handlePopupClick = (val) =&gt; {
295 * 初始化信息 295 * 初始化信息
296 */ 296 */
297 onLoad((options) => { 297 onLoad((options) => {
  298 + initOptions(options);
  299 +})
  300 +
  301 +const initOptions = async (options) => {
298 companyObj.value = JSON.parse(options.companyObj); 302 companyObj.value = JSON.parse(options.companyObj);
299 tel.value = options.tel; 303 tel.value = options.tel;
300 if (options.userAddress == 'undefined') { 304 if (options.userAddress == 'undefined') {
301 - queryAddress('CURRENT').then(res => { 305 + await queryAddress('CURRENT').then(res => {
302 try { 306 try {
303 if (res.data.data && res.data.data[0]) { 307 if (res.data.data && res.data.data[0]) {
304 console.log(res); 308 console.log(res);
305 userAddress.value = res.data.data[0] ? res.data.data[0] : {} 309 userAddress.value = res.data.data[0] ? res.data.data[0] : {}
306 - console.log(userAddress.value); 310 + } else {
  311 + userAddress.value = {};
307 } 312 }
308 } catch (error) { 313 } catch (error) {
309 userAddress.value = {}; 314 userAddress.value = {};
@@ -312,6 +317,14 @@ onLoad((options) =&gt; { @@ -312,6 +317,14 @@ onLoad((options) =&gt; {
312 } else { 317 } else {
313 userAddress.value = JSON.parse(options.userAddress); 318 userAddress.value = JSON.parse(options.userAddress);
314 } 319 }
  320 + if (!userAddress.value.garLongitude) {
  321 + uni.$u.toast("请设置清运地址!")
  322 + // 返回上级
  323 + uni.navigateBack({
  324 + delta: 1
  325 + })
  326 + return
  327 + }
315 queryCarList({ companyId: companyObj.value.id }).then(res => { 328 queryCarList({ companyId: companyObj.value.id }).then(res => {
316 // 设置车辆类型 329 // 设置车辆类型
317 candidates.value = [[...new Set(res.data.rows 330 candidates.value = [[...new Set(res.data.rows
@@ -332,7 +345,7 @@ onLoad((options) =&gt; { @@ -332,7 +345,7 @@ onLoad((options) =&gt; {
332 paramFrom.value.carType = candidates.value[0][0]; 345 paramFrom.value.carType = candidates.value[0][0];
333 garCarLabelInfoNow.value = garCarLabelInfoList.value[paramFrom.value.carType] 346 garCarLabelInfoNow.value = garCarLabelInfoList.value[paramFrom.value.carType]
334 }) 347 })
335 -}) 348 +}
336 349
337 const handleInCarClick = () => { 350 const handleInCarClick = () => {
338 paramFrom.value.garInCarStore = !paramFrom.value.garInCarStore 351 paramFrom.value.garInCarStore = !paramFrom.value.garInCarStore
@@ -410,17 +423,17 @@ const handleOderSure = () =&gt; { @@ -410,17 +423,17 @@ const handleOderSure = () =&gt; {
410 423
411 let params = { 424 let params = {
412 /** 425 /**
413 - * 单地址 426 + * 单地址
414 */ 427 */
415 garOrderAddress: userAddress.value.garUserAddress, 428 garOrderAddress: userAddress.value.garUserAddress,
416 429
417 /** 430 /**
418 - * 单详细地址 431 + * 单详细地址
419 */ 432 */
420 garOrderAddressDetails: userAddress.value.garRemark, 433 garOrderAddressDetails: userAddress.value.garRemark,
421 434
422 /** 435 /**
423 - * 单姓名 436 + * 单姓名
424 */ 437 */
425 garOrderContactName: userAddress.value.garUserContactName, 438 garOrderContactName: userAddress.value.garUserContactName,
426 garCarInfoList: garCarInfos, 439 garCarInfoList: garCarInfos,
@@ -431,7 +444,7 @@ const handleOderSure = () =&gt; { @@ -431,7 +444,7 @@ const handleOderSure = () =&gt; {
431 garOrderTrashType: paramFrom.value.garbageType[0], 444 garOrderTrashType: paramFrom.value.garbageType[0],
432 445
433 /** 446 /**
434 - * 单人电话 447 + * 单人电话
435 */ 448 */
436 garOrderContactTel: userAddress.value.garUserContactTel, 449 garOrderContactTel: userAddress.value.garUserContactTel,
437 450
@@ -473,10 +486,10 @@ const handleOderSure = () =&gt; { @@ -473,10 +486,10 @@ const handleOderSure = () =&gt; {
473 } 486 }
474 487
475 saveOrder(params).then(res => { 488 saveOrder(params).then(res => {
476 - // TODO 单详情 489 + // TODO 单详情
477 if (res.data.success) { 490 if (res.data.success) {
478 - if (userType.value === "运输驾驶员") {  
479 - uni.$u.toast("派单成功,请切换成且角色查看派单详情") 491 + if (userType.value === "清运车辆驾驶员") {
  492 + uni.$u.toast("订单成功,请切换成且角色查看订单详情")
480 setTimeout(() => { 493 setTimeout(() => {
481 uni.$u.route({ 494 uni.$u.route({
482 type: 'navigateBack', 495 type: 'navigateBack',
garbage-removal/src/pages/order/handler-home/index.vue
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 <script setup> 16 <script setup>
17 import { ref } from 'vue'; 17 import { ref } from 'vue';
18 import swiperListItem from './swiper-list-item/index.vue'; 18 import swiperListItem from './swiper-list-item/index.vue';
19 -const list = ref([{ name: '待清运' }, { name: '清运中' }, { name: '全部' }, { name: '已完成' }]) 19 +const list = ref([{ name: '处理中' }, { name: '已完成' }])
20 const current = ref(0); 20 const current = ref(0);
21 const swiperCurrent = ref(0); 21 const swiperCurrent = ref(0);
22 const uTabsElement = ref(); 22 const uTabsElement = ref();
23 uni.setNavigationBarTitle({ 23 uni.setNavigationBarTitle({
24 - title: "处场所" 24 + title: "处场所"
25 }) 25 })
26 const tabsChange = (el) => { 26 const tabsChange = (el) => {
27 swiperCurrent.value = Number(el.index) 27 swiperCurrent.value = Number(el.index)
@@ -35,10 +35,6 @@ const translation = (e) =&gt; { @@ -35,10 +35,6 @@ const translation = (e) =&gt; {
35 } 35 }
36 </script> 36 </script>
37 <style lang="scss" scoped> 37 <style lang="scss" scoped>
38 -::v-deep .u-tabs__wrapper__scroll-view {  
39 - background-color: #53c21d;  
40 -}  
41 -  
42 .swiper { 38 .swiper {
43 height: 100%; 39 height: 100%;
44 background: linear-gradient(to bottom, $u-success-dark, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color); 40 background: linear-gradient(to bottom, $u-success-dark, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color);
garbage-removal/src/pages/order/handler-home/scan-detail/index.vue 0 → 100644
  1 +<template>
  2 + <view class="scan-detail-container">
  3 + <view class="scan-detail-box">
  4 + <view class="scan-time">
  5 + <view class="scan-label">
  6 + 分发时间
  7 + </view>
  8 + <view class="scan-time">
  9 + {{ details.scanTime }}
  10 + </view>
  11 + <view class="scan-icon">
  12 + <up-icon name="calendar" color="#53c21d" size="40"></up-icon>
  13 + </view>
  14 + </view>
  15 + <view class="scan-time">
  16 + <view class="scan-label">
  17 + 司机姓名
  18 + </view>
  19 + <view class="scan-time">
  20 + {{ details.name }}
  21 + </view>
  22 + <view class="scan-icon">
  23 + <up-icon name="account" color="#53c21d" size="40"></up-icon>
  24 + </view>
  25 + </view>
  26 + <view class="scan-time">
  27 + <view class="scan-label">
  28 + 司机电话
  29 + </view>
  30 + <view class="scan-time" style="color: #a0cfff">
  31 + {{ details.driverTel }}
  32 + </view>
  33 + <view class="scan-icon">
  34 + <up-icon name="phone" color="#53c21d" size="40"></up-icon>
  35 + </view>
  36 + </view>
  37 + <view class="scan-time">
  38 + <view class="scan-label">
  39 + 所属公司
  40 + </view>
  41 + <view class="scan-time">
  42 + {{ details.companyName }}
  43 + </view>
  44 + <view class="scan-icon">
  45 + <up-icon name="map" color="#53c21d" size="40"></up-icon>
  46 + </view>
  47 + </view>
  48 + </view>
  49 + <view class="scan-submit-info">
  50 + <view class="scan-submit-title-box">
  51 + <up-badge :isDot="true" type="success"></up-badge><text>提交信息</text>
  52 + </view>
  53 + <view class="scan-car-num">
  54 + <view class="scan-car-num-label">
  55 + 车牌号
  56 + </view>
  57 + <view class="scan-car-num-content">
  58 + {{ details.carNum }}
  59 + </view>
  60 + </view>
  61 + <view class="scan-upload-fill-image-box">
  62 + <view class="scan-upload-fill-image-label">
  63 + <view>
  64 + 全景照片
  65 + </view>
  66 + <view>
  67 + {{ fileList.length }}/3
  68 + </view>
  69 + </view>
  70 + <view class="scan-upload-fill-image-btn">
  71 + <u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="3"
  72 + :previewFullImage="true" width="200" height="150"></u-upload>
  73 + </view>
  74 + </view>
  75 + </view>
  76 + <view class="scan-submit-button-box">
  77 + <view class="scan-submit-button-btn">
  78 + <u-button type="primary" @click="handlerSubmit" text="确认"></u-button>
  79 + </view>
  80 + </view>
  81 + </view>
  82 +</template>
  83 +
  84 +<script setup>
  85 +import { uploadFilePromise } from '@/apis/common.js';
  86 +import { ref } from 'vue';
  87 +const details = ref({
  88 + scanTime: '2022-09-09 12:00:00',
  89 + carNum: '湘A12345',
  90 + name: "里斯",
  91 + driverTel: "13888888888",
  92 + companyName: "测试公司",
  93 + fillImageList: [],
  94 +})
  95 +const fileList = ref([])
  96 +// 删除图片
  97 +const deletePic = (event) => {
  98 + fileList.value.splice(event.index, 1);
  99 +};
  100 +
  101 +
  102 +// 新增图片
  103 +const afterRead = async (event) => {
  104 + // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  105 + let lists = [].concat(event.file);
  106 + let fileListLen = fileList.value.length;
  107 + lists.map((item) => {
  108 + fileList.value.push({
  109 + ...item,
  110 + status: 'uploading',
  111 + message: '上传中',
  112 + });
  113 + });
  114 + for (let i = 0; i < lists.length; i++) {
  115 + let requestPath = import.meta.env.VITE_BASE_URL + import.meta.env.VITE_BASE_FILE_UPLOAD_PREFIX;
  116 + const result = await uploadFilePromise(requestPath, lists[i].url);
  117 + let item = fileList.value[fileListLen];
  118 + fileList.value.splice(fileListLen, 1, {
  119 + ...item,
  120 + status: 'success',
  121 + message: '',
  122 + url: result.data.fileName,
  123 + });
  124 + fileListLen++;
  125 + }
  126 +};
  127 +const handlerSubmit = () => {
  128 + console.log("确认提交");
  129 + uni.$u.toast("确认提交了")
  130 +}
  131 +</script>
  132 +
  133 +<style lang="scss" scoped>
  134 +$l-h-8: 80rpx;
  135 +
  136 +.scan-detail-container {
  137 + width: 100%;
  138 + height: 100%;
  139 + box-sizing: border-box;
  140 + padding: 20rpx;
  141 +
  142 + .scan-detail-box {
  143 + background-color: white;
  144 + margin-bottom: 40rpx;
  145 + color: $u-main-color;
  146 +
  147 + .scan-time {
  148 + display: flex;
  149 + width: 100%;
  150 + // 底部阴影 向内发散
  151 + border-bottom: 1rpx solid #f5f5f5;
  152 + line-height: 100rpx;
  153 +
  154 + .scan-label {
  155 + width: 30%;
  156 + display: flex;
  157 + align-items: center;
  158 + justify-content: center;
  159 + }
  160 +
  161 + .scan-time {
  162 + width: 60%;
  163 + }
  164 +
  165 + .scan-icon {
  166 + width: 10%;
  167 + display: flex;
  168 + }
  169 + }
  170 +
  171 + }
  172 +
  173 + .scan-submit-info {
  174 + width: 100%;
  175 + background-color: white;
  176 + box-sizing: border-box;
  177 + padding: 20rpx;
  178 + color: $u-content-color;
  179 +
  180 + .scan-submit-title-box {
  181 + display: flex;
  182 + align-items: center;
  183 +
  184 + text {
  185 + margin-left: 15rpx;
  186 + }
  187 + }
  188 +
  189 + .scan-car-num {
  190 + display: flex;
  191 + line-height: $l-h-8;
  192 + align-items: center;
  193 +
  194 + .scan-car-num-label {
  195 + width: 20%;
  196 + // 文字不换行
  197 + white-space: nowrap;
  198 + }
  199 +
  200 + .scan-car-num-content {
  201 + width: auto;
  202 + display: flex;
  203 + justify-content: center;
  204 + align-items: center;
  205 + }
  206 + }
  207 +
  208 + .scan-upload-fill-image-box {
  209 + line-height: $l-h-8;
  210 + width: 100%;
  211 +
  212 + .scan-upload-fill-image-label {
  213 + display: flex;
  214 + justify-content: space-between;
  215 + }
  216 +
  217 + .scan-upload-fill-image-btn {
  218 + u-upload {}
  219 + }
  220 + }
  221 + }
  222 +
  223 + .scan-submit-button-box {
  224 + margin-top: 40rpx;
  225 + background-color: white;
  226 + padding: 20rpx;
  227 + }
  228 +}
  229 +</style>
garbage-removal/src/pages/order/handler-home/swiper-list-item/index.vue
@@ -5,18 +5,11 @@ @@ -5,18 +5,11 @@
5 <view class="page-box"> 5 <view class="page-box">
6 <view class="order" v-for="(item, index) in dataList" :key="index"> 6 <view class="order" v-for="(item, index) in dataList" :key="index">
7 <view class="top"> 7 <view class="top">
8 - <view class="left"> 8 + <view class="left" @click="goDetail(item)">
9 <u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon> 9 <u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon>
10 <view class="store">{{ item.garOrderCompanyName }}</view> 10 <view class="store">{{ item.garOrderCompanyName }}</view>
11 <u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon> 11 <u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
12 </view> 12 </view>
13 - <view style="display: flex;align-items: center;">  
14 - <text v-if="item.garOrderHandlerStatus != 3 && item.garOrderStatus === 3 && userType === '运输驾驶员'"  
15 - style="font-size: small;color: #f56c6c;">派单已经完成了。</text>  
16 - <view v-if="item.garOrderHandlerStatus === 0 && item.garCancelFlag === 0" class="right">待清运 </view>  
17 - <view v-if="item.garOrderHandlerStatus === 1 && item.garCancelFlag === 0" class="right">清运中 </view>  
18 - <view v-if="item.garOrderHandlerStatus === 3 && userType === '运输驾驶员'" class="right">已完成 </view>  
19 - </view>  
20 </view> 13 </view>
21 <view class="item" @click="handleClick(item.garOrderId)"> 14 <view class="item" @click="handleClick(item.garOrderId)">
22 <view class="left"> 15 <view class="left">
@@ -25,12 +18,20 @@ @@ -25,12 +18,20 @@
25 <view class="content"> 18 <view class="content">
26 <view class="title u-line-2">{{ item.garOrderAddress + item.garOrderAddressDetails }}</view> 19 <view class="title u-line-2">{{ item.garOrderAddress + item.garOrderAddressDetails }}</view>
27 <view class="type">垃圾类型: {{ item.garOrderTrashType }}</view> 20 <view class="type">垃圾类型: {{ item.garOrderTrashType }}</view>
28 - <view class="delivery-time">预约时间 {{ item.garOrderAgreementTime }}</view> 21 + <view class="delivery-time">创建时间 {{ item.createTime }}</view>
  22 + <view class="transport-num">载运量 {{ item.transportNum }}</view>
29 </view> 23 </view>
30 </view> 24 </view>
31 </view> 25 </view>
32 </view> 26 </view>
33 </z-paging> 27 </z-paging>
  28 + <view class="scan-box">
  29 + <view class="scan-btn">
  30 + <view class="scan-icon">
  31 + <u-icon @click="handleScan" name="scan" :size="80" color="#fff"></u-icon>
  32 + </view>
  33 + </view>
  34 + </view>
34 </view> 35 </view>
35 </template> 36 </template>
36 37
@@ -54,15 +55,30 @@ const dataList = ref([]); @@ -54,15 +55,30 @@ const dataList = ref([]);
54 const paging = ref(null); 55 const paging = ref(null);
55 const firstLoaded = ref(false) 56 const firstLoaded = ref(false)
56 57
57 -const handleClick = (orderId) => { 58 +const handleClick = (companyId) => {
58 uni.$u.route({ 59 uni.$u.route({
59 - url: `pages/order/other-home/detail/index`, 60 + url: `pages/order/handler-home/transport-detail/index`,
60 params: { 61 params: {
61 - orderId: orderId 62 + companyId
62 } 63 }
63 }) 64 })
64 } 65 }
65 66
  67 +const handleScan = () => {
  68 + // 调用uniapi开启二维码扫描
  69 + // 允许从相机和相册扫码
  70 + uni.$u.route({
  71 + url: `pages/order/handler-home/scan-detail/index`
  72 + })
  73 + uni.scanCode({
  74 + success: function (res) {
  75 + console.log('条码类型:' + res.scanType);
  76 + console.log('条码内容:' + res.result);
  77 + }
  78 + });
  79 +
  80 +}
  81 +
66 // list集合 82 // list集合
67 const queryList = (pageNo, pageSize) => { 83 const queryList = (pageNo, pageSize) => {
68 //这里的pageNo和pageSize会自动计算好,直接传给服务器即可 84 //这里的pageNo和pageSize会自动计算好,直接传给服务器即可
@@ -73,6 +89,8 @@ const queryList = (pageNo, pageSize) =&gt; { @@ -73,6 +89,8 @@ const queryList = (pageNo, pageSize) =&gt; {
73 paging.value.complete([ 89 paging.value.complete([
74 { 90 {
75 garOrderId: 1, 91 garOrderId: 1,
  92 + garOrderCompanyName: '长沙',
  93 + garOrderCompanyId: '3',
76 garOrderAddress: '广东省广州市天河区', 94 garOrderAddress: '广东省广州市天河区',
77 garOrderAddressDetails: '天河北路168号', 95 garOrderAddressDetails: '天河北路168号',
78 garOrderTrashType: '可回收垃圾', 96 garOrderTrashType: '可回收垃圾',
@@ -80,18 +98,24 @@ const queryList = (pageNo, pageSize) =&gt; { @@ -80,18 +98,24 @@ const queryList = (pageNo, pageSize) =&gt; {
80 garOrderHandlerStatus: 0, 98 garOrderHandlerStatus: 0,
81 garCancelFlag: 0, 99 garCancelFlag: 0,
82 garOrderStatus: 0, 100 garOrderStatus: 0,
83 - goodsUrl: 'https://cdn.uviewui.com/uview/swiper/1.jpg' 101 + goodsUrl: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  102 + createTime: '2022-08-01 10:00',
  103 + transportNum: 0
84 }, 104 },
85 { 105 {
86 garOrderId: 2, 106 garOrderId: 2,
  107 + garOrderCompanyName: '长沙',
87 garOrderAddress: '广东省广州市天河区', 108 garOrderAddress: '广东省广州市天河区',
88 garOrderAddressDetails: '天河北路168号', 109 garOrderAddressDetails: '天河北路168号',
  110 + garOrderCompanyId: '3',
89 garOrderTrashType: '可回收垃圾', 111 garOrderTrashType: '可回收垃圾',
90 garOrderAgreementTime: '2022-08-01 10:00', 112 garOrderAgreementTime: '2022-08-01 10:00',
91 garOrderHandlerStatus: 0, 113 garOrderHandlerStatus: 0,
92 garCancelFlag: 0, 114 garCancelFlag: 0,
93 garOrderStatus: 0, 115 garOrderStatus: 0,
94 - goodsUrl: 'https://cdn.uviewui.com/uview/swiper/2.jpg' 116 + goodsUrl: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  117 + createTime: '2022-08-01 10:00',
  118 + transportNum: "0"
95 } 119 }
96 ]); 120 ]);
97 firstLoaded.value = true 121 firstLoaded.value = true
@@ -102,7 +126,15 @@ const queryList = (pageNo, pageSize) =&gt; { @@ -102,7 +126,15 @@ const queryList = (pageNo, pageSize) =&gt; {
102 paging.value.complete(false); 126 paging.value.complete(false);
103 }) 127 })
104 } 128 }
105 - 129 +/**
  130 + * 跳转公司详情
  131 + * @param {*} val
  132 + */
  133 +const goDetail = (val) => {
  134 + uni.$u.route({
  135 + url: `pages/home/clean/company-detail/index?companyId=${val.garOrderCompanyId}`,
  136 + })
  137 +}
106 onShow(() => { 138 onShow(() => {
107 if (props.currentIndex == props.tabIndex) { 139 if (props.currentIndex == props.tabIndex) {
108 if (firstLoaded.value) { 140 if (firstLoaded.value) {
@@ -192,9 +224,15 @@ watch(() =&gt; props.currentIndex, (val1, val2) =&gt; { @@ -192,9 +224,15 @@ watch(() =&gt; props.currentIndex, (val1, val2) =&gt; {
192 } 224 }
193 225
194 .delivery-time { 226 .delivery-time {
195 - color: #e5d001; 227 + color: $u-tips-color;
196 font-size: 24rpx; 228 font-size: 24rpx;
197 } 229 }
  230 +
  231 + .transport-num {
  232 + font-size: 24rpx;
  233 + color: #e5d001;
  234 + text-align: end;
  235 + }
198 } 236 }
199 237
200 238
@@ -266,5 +304,38 @@ watch(() =&gt; props.currentIndex, (val1, val2) =&gt; { @@ -266,5 +304,38 @@ watch(() =&gt; props.currentIndex, (val1, val2) =&gt; {
266 background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%); 304 background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
267 } 305 }
268 } 306 }
  307 +
  308 + .scan-box {
  309 + position: fixed;
  310 + bottom: 100rpx;
  311 + right: 30rpx;
  312 + width: 90rpx;
  313 + height: 90rpx;
  314 + border-radius: 15rpx;
  315 + box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
  316 + display: flex;
  317 + justify-content: center;
  318 + align-items: center;
  319 + padding: 2rpx;
  320 + box-sizing: border-box;
  321 + background-color: #ffffff71;
  322 +
  323 + .scan-btn {
  324 + width: 80rpx;
  325 + height: 80rpx;
  326 + border-radius: 50%;
  327 + display: flex;
  328 + justify-content: center;
  329 + align-items: center;
  330 + background-color: #82e455b1;
  331 + @include handleClick;
  332 +
  333 + .scan-icon {
  334 + display: flex;
  335 + justify-content: center;
  336 + align-items: center;
  337 + }
  338 + }
  339 + }
269 } 340 }
270 </style> 341 </style>
garbage-removal/src/pages/order/handler-home/transport-detail/index.vue 0 → 100644
  1 +<template>
  2 + <view class="order-detail-container" v-if="dataGram != null || dataGram != undefined">
  3 + <view class="order-detail-container-box">
  4 + <!-- 订单信息 -->
  5 + <view class="order-detail-container-box-card">
  6 + <view class="order-detail-container-header-card-title">
  7 + <view class="order-detail-container-header-card-uicon"></view>
  8 + 订单信息
  9 + </view>
  10 + <view class="order-detail-container-header-item"
  11 + @click.stop="handlerJumpOtherApp(dataGram.garLatitude, dataGram.garLongitude, dataGram.garCoordinate)">
  12 + <text class="order-detail-container-header-title">订单地点:</text>
  13 + <view class="order-detail-container-header-content" style="text-decoration: underline">
  14 + <text selectable='true'>{{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }}</text>
  15 + </view>
  16 + </view>
  17 + <view class="order-detail-container-header-item">
  18 + <text class="order-detail-container-header-title">现场图片:</text>
  19 + <view class="order-detail-container-header-content">
  20 + <u-upload width="180" height="130" :fileList="currentImages" name="3" multiple :maxCount="10"
  21 + :previewFullImage="true" :isReadOnly="true"></u-upload>
  22 + </view>
  23 + </view>
  24 + <view class="order-detail-container-header-item">
  25 + <text class="order-detail-container-header-title">负责单位:</text>
  26 + <view class="order-detail-container-header-content">
  27 + {{ dataGram.garOrderCompanyName }}
  28 + </view>
  29 + </view>
  30 + <view class="order-detail-container-header-item">
  31 + <text class="order-detail-container-header-title">垃圾类型:</text>
  32 + <view class="order-detail-container-header-content">
  33 + {{ dataGram.garOrderTrashType }}
  34 + </view>
  35 + </view>
  36 + <view class="order-detail-container-header-item">
  37 + <text class="order-detail-container-header-title">订单号:</text>
  38 + <view class="order-detail-container-header-content">
  39 + <text selectable="true">{{ orderId }}</text>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <!-- 收运进度 -->
  44 + <view class="order-detail-container-box-card">
  45 + <view class="order-detail-container-header-card-title">
  46 + <view class="order-detail-container-header-card-uicon"></view>
  47 + 收运清单
  48 + </view>
  49 + <view v-if="dataGram.garTransportList" v-for="item in dataGram.garTransportList"
  50 + style="width: 100%; box-sizing: border-box;">
  51 + <view class="transport-process-item" style="display: flex;width: 100%; margin: 20rpx 0 ;">
  52 + <view style="width: 150rpx;">
  53 + <up-image :show-loading="true" :src="item.fillImage" width="80rpx" height="80rpx"></up-image>
  54 + </view>
  55 + <view style="display: flex;align-items: center;width: 100%;justify-content: center;">
  56 + <text style=" transform: rotateY(180deg);">
  57 + <up-icon name="car-fill" size="40" color="#a9e08f"></up-icon></text>
  58 + <text style="margin-left:15rpx;font-size: 25rpx;">{{ item.garCarNum }}</text>
  59 + </view>
  60 + <view style="display: flex; align-items: center;width: 150rpx; justify-content: flex-end;"
  61 + @click="goTransportDetail(item)">
  62 + <text style="font-size: 30rpx;white-space: nowrap;margin-right: 15rpx;color: #3c9cff;">详情</text>
  63 + <up-icon name="arrow-right" size="30" color="#3c9cff"></up-icon>
  64 + </view>
  65 + </view>
  66 + </view>
  67 + <view v-else class="empty-image"
  68 + style="width: 100%; display: flex; justify-content: center; align-items: center;">
  69 + <image class="image-style" style="width: 200rpx; height: 200rpx;" :src="emptyBase64Image"></image>
  70 + </view>
  71 + </view>
  72 + <view class="space-box">{{ spaceStr }}</view>
  73 + </view>
  74 + <!-- 占位符 -->
  75 + <view class="order-detail-bottom">
  76 + <view class="order-detail-bottom-box">
  77 + <view class=" order-detail-bottom-left">
  78 + </view>
  79 + </view>
  80 + </view>
  81 + </view>
  82 +</template>
  83 +
  84 +<script setup>
  85 +import { dispatchOrders } from "@/apis/order.js";
  86 +import zStatic from '@/components/z-paging/js/z-paging-static';
  87 +import { useMainStore } from '@/stores/index.js';
  88 +import { onLoad, onShow } from '@dcloudio/uni-app';
  89 +import { computed, ref } from 'vue';
  90 +const isOnloadIn = ref(false)
  91 +const clashDispatchRef = ref()
  92 +const personnelList = ref([])
  93 +const store = useMainStore();
  94 +const userType = computed(() => store.userType)
  95 +const dataGram = ref({
  96 + garOrderId: "1",
  97 + garOrderCompanyId: "3",
  98 + garOrderCompanyName: "测试公司",
  99 + garOrderHandlerName: "张三",
  100 + garOrderAddress: "测试地址",
  101 + garOrderAddressDetails: "测试地址详情",
  102 + garOrderTrashType: "测试类型",
  103 + garOrderId: "3",
  104 + garOrderTime: "2022-08-01 12:00:00",
  105 + garOrderType: "1",
  106 + garRemark: "测试",
  107 + garTransportList: [{
  108 + fillImage: "https://img1.baidu.com/it/u=1846112660,2512843120&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=450",
  109 + garCarNum: "湘AT123456",
  110 + garTransportId: "1"
  111 + }, {
  112 + fillImage: "https://img1.baidu.com/it/u=1846112660,2512843120&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=450",
  113 + garCarNum: "湘AT123456",
  114 + garTransportId: "2"
  115 + }, {
  116 + fillImage: "https://img1.baidu.com/it/u=1846112660,2512843120&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=450",
  117 + garCarNum: "湘AT123456",
  118 + garTransportId: "3"
  119 + }
  120 + ]
  121 +});
  122 +const orderId = ref(null)
  123 +const currentImages = ref([])
  124 +const putOnImages = ref([])
  125 +const putDownImages = ref([])
  126 +const emptyBase64Image = ref(zStatic.base64Empty)
  127 +const showUQRcode = ref(false)
  128 +const spaceStr = ref("")
  129 +const qrCodeRef = ref()
  130 +const qrCodeText = ref()
  131 +
  132 +// 创建二维码
  133 +const createQrCodeLocal = (orderId) => {
  134 + // 获取本地地址拼接订单id
  135 + showUQRcode.value = true;
  136 + const hostname = window.location.hostname;
  137 + const port = window.location.port;
  138 + const protocol = window.location.protocol;
  139 + const localAddress = `${protocol}//${hostname}:${port}`;
  140 + // const localAddress = `http://localhost:5173`;
  141 + qrCodeText.value = localAddress + "/pages/order/other-home/guest/index?orderId=" + orderId;
  142 + console.log(qrCodeRef.value);
  143 +}
  144 +const goTransportDetail = (val) => {
  145 + uni.$u.route({
  146 + url: `pages/order/handler-home/scan-detail/index`
  147 + })
  148 +}
  149 +
  150 +const handleOrderDetail = (orderId) => {
  151 + // queryOrderDetail(orderId).then(res => {
  152 + // dataGram.value = res.data.data;
  153 + // console.log(res.data.data);
  154 + // currentImages.value = res.data.data.currentImages.map(item => {
  155 + // return { url: import.meta.env.VITE_BASE_URL + item };
  156 + // });
  157 + // putOnImages.value = res.data.data.putOnImages.map(item => {
  158 + // return { url: import.meta.env.VITE_BASE_URL + item };
  159 + // });
  160 + // putDownImages.value = res.data.data.putDownImages.map(item => {
  161 + // return { url: import.meta.env.VITE_BASE_URL + item };
  162 + // });
  163 + // })
  164 +}
  165 +/**
  166 + * 拨打电话回调
  167 + */
  168 +const handleContactClick = (val) => {
  169 + uni.makePhoneCall({ phoneNumber: val }).then(res => {
  170 + }).catch(err => { });
  171 +}
  172 +
  173 +const handlerJumpOtherApp = (latitude, longitude, garCoordinate) => {
  174 + // 给出提示确定要跳转吗
  175 + uni.showModal({
  176 + title: '提示',
  177 + content: '是否跳转到app定位进行导航?',
  178 + success: function (res) {
  179 + if (res.confirm) {
  180 + uni.openLocation({
  181 + latitude: latitude,
  182 + longitude: longitude,
  183 + success: function () {
  184 + console.log('success');
  185 + }
  186 + });
  187 + }
  188 + }
  189 + })
  190 +}
  191 +
  192 +const handleDispatchConfirm = (val) => {
  193 + console.log(val);
  194 + if (!val) {
  195 + return
  196 + }
  197 + let data = {
  198 + garOrderId: orderId.value,
  199 + dispatchList: []
  200 + }
  201 + for (const key in val) {
  202 + data.dispatchList.push({
  203 + ...val[key]
  204 + });
  205 + }
  206 + console.log(data);
  207 + dispatchOrders(data).then(res => {
  208 + if (res.data.success) {
  209 + uni.$u.toast(res.data.msg)
  210 + } else {
  211 + uni.$u.toast("订单下发失败,请重试")
  212 + }
  213 + clashDispatchRef.value.close()
  214 + })
  215 +}
  216 +
  217 +/**
  218 + * 初始化信息
  219 + */
  220 +onLoad((options) => {
  221 + orderId.value = options.orderId
  222 + handleOrderDetail(orderId.value)
  223 +})
  224 +
  225 +onShow(() => {
  226 + try {
  227 + if (isOnloadIn.value) {
  228 + handleOrderDetail(orderId.value)
  229 + } else {
  230 + isOnloadIn.value = true
  231 + }
  232 + } catch (error) {
  233 + console.log(error);
  234 + }
  235 +})
  236 +</script>
  237 +
  238 +<style lang="scss" scoped>
  239 +$custom-marin-bottom: 20rpx;
  240 +$custom-page-padding: 20rpx;
  241 +$custom-border-radio: 20rpx;
  242 +$custom-bottom-height: 200rpx;
  243 +
  244 +@mixin card {
  245 + padding: $custom-page-padding;
  246 + box-sizing: border-box;
  247 + background-color: #ffffff;
  248 + border-radius: $custom-border-radio;
  249 + margin-bottom: $custom-marin-bottom;
  250 +}
  251 +
  252 +.order-detail-container {
  253 + height: 100%;
  254 + width: 100%;
  255 + background-color: $u-info-light;
  256 + box-sizing: border-box;
  257 + overflow-y: scroll;
  258 + background: linear-gradient(to bottom, $u-success-dark, $u-info-light, $u-info-light, $u-info-light);
  259 +
  260 +
  261 + .order-detail-container-box {
  262 + height: 100%;
  263 + width: 100%;
  264 + padding: $custom-page-padding;
  265 + box-sizing: border-box;
  266 +
  267 + .order-detail-top {
  268 + @include card();
  269 +
  270 + .order-detail-top-box {
  271 + .order-detail-top-box-step {
  272 + u-steps {
  273 + u-steps-item {}
  274 + }
  275 + }
  276 + }
  277 + }
  278 +
  279 + .order-detail-container-box-card {
  280 + @include card();
  281 +
  282 + .order-detail-container-header-card-title {
  283 + font-weight: bold;
  284 + line-height: 80rpx;
  285 + border-bottom: 3rpx solid $u-info-light;
  286 + margin-bottom: $custom-marin-bottom;
  287 + color: $u-primary;
  288 + display: flex;
  289 + align-items: center;
  290 +
  291 + .order-detail-container-header-card-uicon {
  292 + background-color: $u-primary;
  293 + margin-right: 10rpx;
  294 + height: 35rpx;
  295 + width: 15rpx;
  296 + }
  297 + }
  298 +
  299 + .order-detail-container-header-item {
  300 + display: flex;
  301 + margin-bottom: $custom-marin-bottom;
  302 +
  303 + // font-size: 30rpx;
  304 + // font-weight: bold;
  305 + // color: $u-main-color;
  306 + .order-detail-container-header-title {
  307 + color: $u-main-color;
  308 + white-space: nowrap; //溢出不换行
  309 + color: $u-info;
  310 + }
  311 +
  312 + .order-detail-container-header-content {
  313 + display: flex;
  314 + }
  315 + }
  316 + }
  317 + }
  318 +
  319 +
  320 + .space-box {
  321 + padding-bottom: $custom-bottom-height;
  322 + margin-bottom: 40rpx;
  323 + }
  324 +
  325 +
  326 + .order-detail-bottom {
  327 + position: absolute;
  328 + width: 100%;
  329 + // height: 100%;
  330 + bottom: 0;
  331 + left: 0;
  332 +
  333 + .movableAreaDetail {
  334 + pointer-events: none;
  335 + position: fixed;
  336 + left: 0;
  337 + top: 0;
  338 + width: 100%;
  339 + height: calc(100% - $custom-bottom-height);
  340 + z-index: 999;
  341 +
  342 + .movableView {
  343 + pointer-events: auto;
  344 + min-height: 60rpx;
  345 + min-width: 60rpx;
  346 +
  347 + .order-detail-call-box-container {
  348 + min-height: 60rpx;
  349 + min-width: 60rpx;
  350 + display: flex;
  351 + align-items: center;
  352 + justify-content: center;
  353 + background-color: #a9e08f;
  354 + border-radius: 100%;
  355 + }
  356 + }
  357 + }
  358 +
  359 + .order-detail-bottom-box {
  360 + height: $custom-bottom-height;
  361 + padding: 50rpx;
  362 + box-sizing: border-box;
  363 + display: flex;
  364 + justify-content: space-between;
  365 + align-items: center;
  366 +
  367 + .order-detail-bottom-left {
  368 + min-width: 200rpx;
  369 + }
  370 +
  371 + .order-detail-bottom-right {
  372 + min-width: 200rpx;
  373 + }
  374 + }
  375 + }
  376 +}
  377 +
  378 +.mask-container {
  379 + position: fixed;
  380 + top: 0;
  381 + left: 0;
  382 + width: 100%;
  383 + height: 100%;
  384 + z-index: 999;
  385 + background-color: rgba(0, 0, 0, 0.5);
  386 + display: flex;
  387 + align-items: center;
  388 + justify-content: center;
  389 +}
  390 +</style>
garbage-removal/src/pages/order/index.vue
1 <template> 1 <template>
2 <view class="container" style="width: 100%;height: 100%;"> 2 <view class="container" style="width: 100%;height: 100%;">
3 - <other-home v-if="userType != '处场所负责人'"></other-home> 3 + <other-home v-if="userType != '处场所负责人'"></other-home>
4 <handler-home v-else></handler-home> 4 <handler-home v-else></handler-home>
5 </view> 5 </view>
6 </template> 6 </template>
@@ -13,4 +13,8 @@ const mainStore = useMainStore() @@ -13,4 +13,8 @@ const mainStore = useMainStore()
13 const userType = computed(() => mainStore.userType) 13 const userType = computed(() => mainStore.userType)
14 console.log(userType.value); 14 console.log(userType.value);
15 </script> 15 </script>
16 -<style lang="scss" scoped></style> 16 +<style lang="scss" scoped>
  17 +::v-deep .u-tabs__wrapper__scroll-view {
  18 + background-color: #53c21d;
  19 +}
  20 +</style>
garbage-removal/src/pages/order/other-home/detail/index.vue
1 <template> 1 <template>
2 - <clashDispatch ref="clashDispatchRef" :valueKey="'licensePlateNumber'" :onconfirm="handleDispatchConfirm"  
3 - :dataList="personnelList">  
4 - </clashDispatch> 2 + <clashDriverDispatch ref="clashDriverDispatchRef" :valueKey="'licensePlateNumber'"
  3 + :onconfirm="handleDriverDispatchConfirm" :dataList="driverPersonnelList">
  4 + </clashDriverDispatch>
  5 + <clashDisposalDispatch ref="clashDisposalDispatchRef" :valueKey="'companyName'"
  6 + :onconfirm="handleDisposalDispatchConfirm" :dataList="driverPersonnelList">
  7 + </clashDisposalDispatch>
5 <view class="order-detail-container" v-if="dataGram != null || dataGram != undefined"> 8 <view class="order-detail-container" v-if="dataGram != null || dataGram != undefined">
6 <view class="order-detail-container-box"> 9 <view class="order-detail-container-box">
7 <view class="order-detail-top"> 10 <view class="order-detail-top">
@@ -20,18 +23,18 @@ @@ -20,18 +23,18 @@
20 <text v-if="dataGram.garCancelFlag == 0" style="color: red;">请于交易完成后线下支付!!</text> 23 <text v-if="dataGram.garCancelFlag == 0" style="color: red;">请于交易完成后线下支付!!</text>
21 <view v-else style="display: flex; color:red;"> 24 <view v-else style="display: flex; color:red;">
22 <u-icon name="close-circle" color="red"></u-icon> 25 <u-icon name="close-circle" color="red"></u-icon>
23 - <text> &nbsp;&nbsp;单已被取消!原因:{{ dataGram.garReason }}</text> 26 + <text> &nbsp;&nbsp;单已被取消!原因:{{ dataGram.garReason }}</text>
24 </view> 27 </view>
25 </view> 28 </view>
26 - <!-- 单信息 --> 29 + <!-- 单信息 -->
27 <view class="order-detail-container-box-card"> 30 <view class="order-detail-container-box-card">
28 <view class="order-detail-container-header-card-title"> 31 <view class="order-detail-container-header-card-title">
29 <view class="order-detail-container-header-card-uicon"></view> 32 <view class="order-detail-container-header-card-uicon"></view>
30 - 单信息 33 + 单信息
31 </view> 34 </view>
32 <view class="order-detail-container-header-item" 35 <view class="order-detail-container-header-item"
33 @click.stop="handlerJumpOtherApp(dataGram.garLatitude, dataGram.garLongitude, dataGram.garCoordinate)"> 36 @click.stop="handlerJumpOtherApp(dataGram.garLatitude, dataGram.garLongitude, dataGram.garCoordinate)">
34 - <text class="order-detail-container-header-title">单地点:</text> 37 + <text class="order-detail-container-header-title">单地点:</text>
35 <view class="order-detail-container-header-content" style="text-decoration: underline"> 38 <view class="order-detail-container-header-content" style="text-decoration: underline">
36 <text selectable='true'>{{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }}</text> 39 <text selectable='true'>{{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }}</text>
37 </view> 40 </view>
@@ -56,7 +59,7 @@ @@ -56,7 +59,7 @@
56 </view> 59 </view>
57 </view> 60 </view>
58 <view class="order-detail-container-header-item"> 61 <view class="order-detail-container-header-item">
59 - <text class="order-detail-container-header-title">单号:</text> 62 + <text class="order-detail-container-header-title">单号:</text>
60 <view class="order-detail-container-header-content"> 63 <view class="order-detail-container-header-content">
61 <text selectable="true">{{ orderId }}</text> 64 <text selectable="true">{{ orderId }}</text>
62 </view> 65 </view>
@@ -83,14 +86,14 @@ @@ -83,14 +86,14 @@
83 </view> 86 </view>
84 </view> 87 </view>
85 </view> 88 </view>
86 - <!-- 单记录 --> 89 + <!-- 单记录 -->
87 <view class="order-detail-container-box-card"> 90 <view class="order-detail-container-box-card">
88 <view class="order-detail-container-header-card-title"> 91 <view class="order-detail-container-header-card-title">
89 <view class="order-detail-container-header-card-uicon"></view> 92 <view class="order-detail-container-header-card-uicon"></view>
90 - 单人员 93 + 单人员
91 </view> 94 </view>
92 <!-- <view class="order-detail-container-header-item"> 95 <!-- <view class="order-detail-container-header-item">
93 - <text class="order-detail-container-header-title">单时间:</text> 96 + <text class="order-detail-container-header-title">单时间:</text>
94 <view class="order-detail-container-header-content"> 97 <view class="order-detail-container-header-content">
95 {{ dataGram.garCreateTime }} 98 {{ dataGram.garCreateTime }}
96 </view> 99 </view>
@@ -112,7 +115,7 @@ @@ -112,7 +115,7 @@
112 </view> 115 </view>
113 </view> 116 </view>
114 <view class="order-detail-container-header-item"> 117 <view class="order-detail-container-header-item">
115 - <text class="order-detail-container-header-title">单人:</text> 118 + <text class="order-detail-container-header-title">单人:</text>
116 <view class="order-detail-container-header-content"> 119 <view class="order-detail-container-header-content">
117 {{ dataGram.garOrderContactName }} 120 {{ dataGram.garOrderContactName }}
118 </view> 121 </view>
@@ -169,56 +172,50 @@ @@ -169,56 +172,50 @@
169 <view class="order-detail-bottom"> 172 <view class="order-detail-bottom">
170 <view class="order-detail-bottom-box"> 173 <view class="order-detail-bottom-box">
171 <view class=" order-detail-bottom-left"> 174 <view class=" order-detail-bottom-left">
172 - <u-button v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.garCancelFlag === 0 && userType === '运输驾驶员'"  
173 - @click="handleSubmitSuccess(orderId)" shape="square" color="#a9e08f" text="完成派单"></u-button>  
174 - <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '企业负责人' && dataGram.garCancelFlag === 0"  
175 - @click="handleOderCancelClick()" shape="square" color="#a9e08f" text="取消派单"></u-button>  
176 - <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输驾驶员' && dataGram.garCancelFlag === 0"  
177 - @click="handleOderCancelClick()" shape="square" color="#a9e08f" text="取消派单"></u-button>  
178 - <u-button v-if="dataGram.garOrderHandlerStatus === 1 && userType == '企业负责人'"  
179 - @click="handleOrderDispatchClick(orderId)" shape="square" color="#a9e08f"  
180 - :text="dataGram.garOrderMatchFlag === 0 ? '派单下发' : '继续下发'"></u-button> 175 + <u-button
  176 + v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.garCancelFlag === 0 && userType === '清运车辆驾驶员'"
  177 + @click="createQrCodeValid(dataGram.validCode)" shape="square" color="#a9e08f" text="出示二维码"></u-button>
  178 + <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.garCancelFlag === 0"
  179 + @click="handleOderCancelClick()" shape="square" color="#a9e08f" text="取消订单"></u-button>
  180 + <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '清运车辆驾驶员' && dataGram.garCancelFlag === 0"
  181 + @click="handleOderCancelClick()" shape="square" color="#a9e08f" text="取消订单"></u-button>
  182 + <u-button v-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人'"
  183 + @click="handleOrderDispatchClick(orderId)" shape="square" color="#a9e08f" text="分配驾驶员"></u-button>
181 </view> 184 </view>
182 <view class="order-detail-bottom-right"> 185 <view class="order-detail-bottom-right">
183 - <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '居民用户' && dataGram.garCancelFlag === 0"  
184 - @click="handleOderCancelClick()" shape="square" color="#a9e08f" text="取消派单"></u-button> 186 + <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '用户' && dataGram.garCancelFlag === 0"
  187 + @click="handleOderCancelClick()" shape="square" color="#a9e08f" text="取消订单"></u-button>
185 <u-button @click="driverHandleOrder(orderId)" 188 <u-button @click="driverHandleOrder(orderId)"
186 - v-if="dataGram.garOrderHandlerStatus === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '运输驾驶员'"  
187 - shape="square" color="#a9e08f" text="处理派单"></u-button> 189 + v-if="dataGram.garOrderHandlerStatus === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '清运车辆驾驶员'"
  190 + shape="square" color="#a9e08f" text="处理订单"></u-button>
188 <u-button @click="handleOrder(orderId)" 191 <u-button @click="handleOrder(orderId)"
189 - v-if="dataGram.garOrderHandlerStatus === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '企业负责人'"  
190 - shape="square" color="#a9e08f" text="处理派单"></u-button> 192 + v-if="dataGram.garOrderHandlerStatus === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '运输企业负责人'"
  193 + shape="square" color="#a9e08f" text="处理订单"></u-button>
191 <u-button @click="handleUploadImage(orderId, 'putOnImages')" 194 <u-button @click="handleUploadImage(orderId, 'putOnImages')"
192 - v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.garCancelFlag === 0 && userType === '运输驾驶员'" 195 + v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.garCancelFlag === 0 && userType === '清运车辆驾驶员'"
193 shape="square" color="#a9e08f" text="上传图片"></u-button> 196 shape="square" color="#a9e08f" text="上传图片"></u-button>
194 - <!-- <u-button @click="handleUploadImage(orderId, 'putOnImages')"  
195 - v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.putOnImages.length === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '运输驾驶员'"  
196 - shape="square" color="#a9e08f" text="装车照片"></u-button>  
197 - <u-button @click="handleUploadImage(orderId, 'putDownImages')"  
198 - v-else-if="dataGram.garOrderHandlerStatus === 1 && dataGram.putDownImages.length === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '运输驾驶员'"  
199 - shape="square" color="#a9e08f" text="卸车照片"></u-button> -->  
200 - <!-- <u-button @click="handleUploadImage(orderId, 'putDownImages')"  
201 - v-else-if="dataGram.garOrderHandlerStatus === 1 && dataGram.putDownImages.length === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '企业负责人'"  
202 - shape="square" color="#a9e08f" text="上传照片"></u-button> -->  
203 <u-button @click="handleEvaluate(orderId, userType)" 197 <u-button @click="handleEvaluate(orderId, userType)"
204 - v-if="dataGram.garEvaluateFlag === 0 && userType === '居民用户'" shape="square" color="#a9e08f" 198 + v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#a9e08f"
205 text="去评价"></u-button> 199 text="去评价"></u-button>
206 <u-button @click="handleEvaluate(orderId, userType)" 200 <u-button @click="handleEvaluate(orderId, userType)"
207 - v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '企业负责人'" shape="square" color="#a9e08f" 201 + v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人'" shape="square" color="#a9e08f"
208 text="去评价"></u-button> 202 text="去评价"></u-button>
209 <u-button @click="handleEvaluateDetail(orderId, userType)" 203 <u-button @click="handleEvaluateDetail(orderId, userType)"
210 - v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '企业负责人'" shape="square" color="#a9e08f" 204 + v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人'" shape="square" color="#a9e08f"
211 text="查看评价"></u-button> 205 text="查看评价"></u-button>
212 <u-button @click="handleEvaluateDetail(orderId, userType)" 206 <u-button @click="handleEvaluateDetail(orderId, userType)"
213 - v-if="dataGram.garEvaluateFlag === 1 && userType === '居民用户'" shape="square" color="#a9e08f" 207 + v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#a9e08f"
214 text="查看评价"></u-button> 208 text="查看评价"></u-button>
215 - <u-button v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.garCancelFlag === 0 && userType != '运输驾驶员'"  
216 - @click="handleSubmitSuccess(orderId)" shape="square" color="#a9e08f" text="完成派单"></u-button> 209 + <u-button v-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人'"
  210 + @click="handleDisposalDispatchClick(orderId)" shape="square" color="#a9e08f" text="分配处置场所"></u-button>
  211 +
  212 + <!-- <u-button v-if="dataGram.garOrderHandlerStatus === 1 && dataGram.garCancelFlag === 0 && userType != '清运车辆驾驶员'"
  213 + @click="handleSubmitSuccess(orderId)" shape="square" color="#a9e08f" text="完成订单"></u-button> -->
217 </view> 214 </view>
218 </view> 215 </view>
219 </view> 216 </view>
220 <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose" 217 <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose"
221 - @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消单" :show="cancelShow"> 218 + @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消单" :show="cancelShow">
222 </u-action-sheet> 219 </u-action-sheet>
223 </view> 220 </view>
224 <view v-if="showUQRcode" class="mask-container" @click="showUQRcode = false"> 221 <view v-if="showUQRcode" class="mask-container" @click="showUQRcode = false">
@@ -228,17 +225,20 @@ @@ -228,17 +225,20 @@
228 </template> 225 </template>
229 226
230 <script setup> 227 <script setup>
231 -import { dispatchOrders, queryOrderDetail, queryOrderDispatch, updateOrder } from "@/apis/order.js"; 228 +import { dispatchDisposalOrders, dispatchOrders, queryDisposalDispatch, queryOrderDetail, queryOrderDispatch, updateOrder } from "@/apis/order.js";
232 import { createQrCode } from '@/apis/qrcode.js'; 229 import { createQrCode } from '@/apis/qrcode.js';
233 import uqrcode from '@/components/Sansnn-uQRCode_4.0.6/components/uqrcode/uqrcode.vue'; 230 import uqrcode from '@/components/Sansnn-uQRCode_4.0.6/components/uqrcode/uqrcode.vue';
234 -import clashDispatch from '@/components/clash-dispatch/index.vue'; 231 +import clashDisposalDispatch from '@/components/clash-disposal-dispatch/index.vue';
  232 +import clashDriverDispatch from '@/components/clash-driver-dispatch/index.vue';
235 import zStatic from '@/components/z-paging/js/z-paging-static'; 233 import zStatic from '@/components/z-paging/js/z-paging-static';
236 import { useMainStore } from '@/stores/index.js'; 234 import { useMainStore } from '@/stores/index.js';
237 import { onLoad, onShow } from '@dcloudio/uni-app'; 235 import { onLoad, onShow } from '@dcloudio/uni-app';
238 import { computed, ref } from 'vue'; 236 import { computed, ref } from 'vue';
239 const isOnloadIn = ref(false) 237 const isOnloadIn = ref(false)
240 -const clashDispatchRef = ref()  
241 -const personnelList = ref([]) 238 +const clashDriverDispatchRef = ref()
  239 +const clashDisposalDispatchRef = ref()
  240 +const driverPersonnelList = ref([])
  241 +const disposalPersonnelList = ref([])
242 const store = useMainStore(); 242 const store = useMainStore();
243 const userType = computed(() => store.userType) 243 const userType = computed(() => store.userType)
244 const dataGram = ref(); 244 const dataGram = ref();
@@ -256,7 +256,7 @@ const qrCodeText = ref() @@ -256,7 +256,7 @@ const qrCodeText = ref()
256 const list = computed(() => { 256 const list = computed(() => {
257 let reason = [ 257 let reason = [
258 { 258 {
259 - name: '单信息填写有误', 259 + name: '单信息填写有误',
260 }, 260 },
261 { 261 {
262 name: '线下协商有问题', 262 name: '线下协商有问题',
@@ -271,7 +271,7 @@ const list = computed(() =&gt; { @@ -271,7 +271,7 @@ const list = computed(() =&gt; {
271 name: '提交', 271 name: '提交',
272 } 272 }
273 ] 273 ]
274 - if (userType.value === '居民用户') { 274 + if (userType.value === '用户') {
275 reason.unshift({ 275 reason.unshift({
276 name: '长时间无人接单', 276 name: '长时间无人接单',
277 }) 277 })
@@ -285,7 +285,7 @@ const list = computed(() =&gt; { @@ -285,7 +285,7 @@ const list = computed(() =&gt; {
285 285
286 // 创建二维码 286 // 创建二维码
287 const createQrCodeLocal = (orderId) => { 287 const createQrCodeLocal = (orderId) => {
288 - // 获取本地地址拼接单id 288 + // 获取本地地址拼接单id
289 showUQRcode.value = true; 289 showUQRcode.value = true;
290 const hostname = window.location.hostname; 290 const hostname = window.location.hostname;
291 const port = window.location.port; 291 const port = window.location.port;
@@ -323,18 +323,28 @@ const handleQrCodeClick = (orderId) =&gt; { @@ -323,18 +323,28 @@ const handleQrCodeClick = (orderId) =&gt; {
323 } 323 }
324 324
325 const handleOrderDispatchClick = (orderId) => { 325 const handleOrderDispatchClick = (orderId) => {
326 - // 获取单人员 326 + // 获取单人员
327 queryOrderDispatch(orderId).then(res => { 327 queryOrderDispatch(orderId).then(res => {
328 if (res.data.success) { 328 if (res.data.success) {
329 - personnelList.value = res.data.data  
330 - clashDispatchRef.value.open(res.data.data)  
331 -  
332 - handleOrderDetail(orderId) 329 + driverPersonnelList.value = res.data.data
  330 + clashDriverDispatchRef.value.open(res.data.data)
333 } else { 331 } else {
334 uni.$u.toast(res.data.message) 332 uni.$u.toast(res.data.message)
335 } 333 }
336 }) 334 })
337 } 335 }
  336 +const handleDisposalDispatchClick = (orderId) => {
  337 + // 获取订单人员
  338 + queryDisposalDispatch(orderId).then(res => {
  339 + if (res.data.success) {
  340 + disposalPersonnelList.value = res.data.data
  341 + clashDisposalDispatchRef.value.open(res.data.data)
  342 + } else {
  343 + uni.$u.toast(res.data.message)
  344 + }
  345 + })
  346 +}
  347 +
338 348
339 349
340 const handleClose = (e) => { 350 const handleClose = (e) => {
@@ -390,7 +400,7 @@ const handlerJumpOtherApp = (latitude, longitude, garCoordinate) =&gt; { @@ -390,7 +400,7 @@ const handlerJumpOtherApp = (latitude, longitude, garCoordinate) =&gt; {
390 } 400 }
391 401
392 /** 402 /**
393 - * 取消 403 + * 取消
394 * @param {*} orderId 404 * @param {*} orderId
395 */ 405 */
396 const handleOderCancelClick = () => { 406 const handleOderCancelClick = () => {
@@ -398,7 +408,7 @@ const handleOderCancelClick = () =&gt; { @@ -398,7 +408,7 @@ const handleOderCancelClick = () =&gt; {
398 } 408 }
399 409
400 /** 410 /**
401 - * 提交取消 411 + * 提交取消
402 */ 412 */
403 const submitFunction = (otherReason) => { 413 const submitFunction = (otherReason) => {
404 let reason = otherReason 414 let reason = otherReason
@@ -406,7 +416,7 @@ const submitFunction = (otherReason) =&gt; { @@ -406,7 +416,7 @@ const submitFunction = (otherReason) =&gt; {
406 reason = currentCancelName.value 416 reason = currentCancelName.value
407 } 417 }
408 if (!reason) { 418 if (!reason) {
409 - uni.$u.toast("请提供取消单的原因") 419 + uni.$u.toast("请提供取消单的原因")
410 return 420 return
411 } 421 }
412 let params = { 422 let params = {
@@ -429,7 +439,7 @@ const submitFunction = (otherReason) =&gt; { @@ -429,7 +439,7 @@ const submitFunction = (otherReason) =&gt; {
429 const handleSubmitSuccess = (orderId) => { 439 const handleSubmitSuccess = (orderId) => {
430 uni.showModal({ 440 uni.showModal({
431 title: '提示', 441 title: '提示',
432 - content: '单已经清运完成了吗?', 442 + content: '单已经清运完成了吗?',
433 success: function (res) { 443 success: function (res) {
434 if (res.confirm) { 444 if (res.confirm) {
435 updateOrder({ garOrderId: orderId, handleType: 3 }).then(res => { 445 updateOrder({ garOrderId: orderId, handleType: 3 }).then(res => {
@@ -449,11 +459,11 @@ const handleEvaluate = (orderId, userType) =&gt; { @@ -449,11 +459,11 @@ const handleEvaluate = (orderId, userType) =&gt; {
449 uni.$u.route(`pages/order/other-home/evaluate/index?orderId=${orderId}&userType=${userType}`) 459 uni.$u.route(`pages/order/other-home/evaluate/index?orderId=${orderId}&userType=${userType}`)
450 } 460 }
451 461
452 -// 接收 462 +// 接收
453 const handleOrder = (orderId) => { 463 const handleOrder = (orderId) => {
454 updateOrder({ garOrderId: orderId, handleType: 0 }).then(res => { 464 updateOrder({ garOrderId: orderId, handleType: 0 }).then(res => {
455 if (res.data.success) { 465 if (res.data.success) {
456 - if (res.data.data === "单已经被别人接受啦") { 466 + if (res.data.data === "单已经被别人接受啦") {
457 uni.$u.toast(res.data.data) 467 uni.$u.toast(res.data.data)
458 uni.$u.route({ 468 uni.$u.route({
459 type: "reLaunch", 469 type: "reLaunch",
@@ -467,11 +477,11 @@ const handleOrder = (orderId) =&gt; { @@ -467,11 +477,11 @@ const handleOrder = (orderId) =&gt; {
467 }) 477 })
468 } 478 }
469 479
470 -// 接收 480 +// 接收
471 const driverHandleOrder = (orderId) => { 481 const driverHandleOrder = (orderId) => {
472 updateOrder({ garOrderId: orderId, handleType: 0 }).then(res => { 482 updateOrder({ garOrderId: orderId, handleType: 0 }).then(res => {
473 if (res.data.success) { 483 if (res.data.success) {
474 - if (res.data.data === "单已经被别人接受啦") { 484 + if (res.data.data === "单已经被别人接受啦") {
475 uni.$u.toast(res.data.data) 485 uni.$u.toast(res.data.data)
476 uni.$u.route({ 486 uni.$u.route({
477 type: "reLaunch", 487 type: "reLaunch",
@@ -510,16 +520,12 @@ const cleanStatus = (status) =&gt; { @@ -510,16 +520,12 @@ const cleanStatus = (status) =&gt; {
510 return '清运完成'; 520 return '清运完成';
511 } 521 }
512 } 522 }
513 -  
514 -// /**  
515 -// * 上传图片  
516 -// * @param {string} orderId  
517 -// * @param {string} putType  
518 -// */  
519 -// const handleUploadImage = (orderId, putType) => {  
520 -// uni.$u.route(`pages/order/upload/index?orderId=${orderId}&putType=${putType}`)  
521 -// }  
522 - 523 +const createQrCodeValid = (val) => {
  524 + // 获取本地地址拼接订单id
  525 + showUQRcode.value = true;
  526 + // const localAddress = `http://localhost:5173`;
  527 + qrCodeText.value = val;
  528 +}
523 /** 529 /**
524 * 上传图片 530 * 上传图片
525 * @param {string} orderId 531 * @param {string} orderId
@@ -528,9 +534,32 @@ const cleanStatus = (status) =&gt; { @@ -528,9 +534,32 @@ const cleanStatus = (status) =&gt; {
528 const handleUploadImage = (orderId, putType) => { 534 const handleUploadImage = (orderId, putType) => {
529 uni.$u.route(`pages/order/other-home/upload/index?orderId=${orderId}`) 535 uni.$u.route(`pages/order/other-home/upload/index?orderId=${orderId}`)
530 } 536 }
531 -  
532 -  
533 -const handleDispatchConfirm = (val) => { 537 +const handleDisposalDispatchConfirm = (val) => {
  538 + console.log(val);
  539 + if (!val) {
  540 + return
  541 + }
  542 + let data = {
  543 + garOrderId: orderId.value,
  544 + dispatchList: []
  545 + }
  546 + for (const key in val) {
  547 + data.dispatchList.push({
  548 + ...val[key]
  549 + });
  550 + }
  551 + console.log(data);
  552 + dispatchDisposalOrders(data).then(res => {
  553 + if (res.data.success) {
  554 + uni.$u.toast(res.data.msg)
  555 + } else {
  556 + uni.$u.toast("指定人员失败,请重试")
  557 + }
  558 + clashDriverDispatchRef.value.close()
  559 + })
  560 +}
  561 +// 指定人员
  562 +const handleDriverDispatchConfirm = (val) => {
534 console.log(val); 563 console.log(val);
535 if (!val) { 564 if (!val) {
536 return 565 return
@@ -549,9 +578,9 @@ const handleDispatchConfirm = (val) =&gt; { @@ -549,9 +578,9 @@ const handleDispatchConfirm = (val) =&gt; {
549 if (res.data.success) { 578 if (res.data.success) {
550 uni.$u.toast(res.data.msg) 579 uni.$u.toast(res.data.msg)
551 } else { 580 } else {
552 - uni.$u.toast("派单下发失败,请重试") 581 + uni.$u.toast("指定人员失败,请重试")
553 } 582 }
554 - clashDispatchRef.value.close() 583 + clashDriverDispatchRef.value.close()
555 }) 584 })
556 } 585 }
557 586
garbage-removal/src/pages/order/other-home/evaluate-info/index.vue
@@ -4,13 +4,13 @@ @@ -4,13 +4,13 @@
4 <view class="user-info-title"> 4 <view class="user-info-title">
5 <u-avatar :src="pic" size="70"></u-avatar> 5 <u-avatar :src="pic" size="70"></u-avatar>
6 <view class="user-name"> 6 <view class="user-name">
7 - 居民用户 7 + 用户
8 </view> 8 </view>
9 </view> 9 </view>
10 <view v-if="evaluateUser" class="evaluate-content"> 10 <view v-if="evaluateUser" class="evaluate-content">
11 <view class="evaluate-score"> 11 <view class="evaluate-score">
12 - <u-icon v-for="todo in maxStar" :name="evaluateUser.garEvaluateScore > todo ? 'star-fill' : 'star'" :key="todo"  
13 - color="#f9ae3d" size="28"></u-icon> 12 + <u-icon v-for="todo in maxStar" :name="evaluateUser.garEvaluateScore > todo ? 'star-fill' : 'star'"
  13 + :key="todo" color="#f9ae3d" size="28"></u-icon>
14 </view> 14 </view>
15 <view class="evaluate-txt"> 15 <view class="evaluate-txt">
16 {{ evaluateUser.garEvaluateContent }} 16 {{ evaluateUser.garEvaluateContent }}
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 <view class="user-info-title"> 24 <view class="user-info-title">
25 <u-avatar :src="pic" size="70"></u-avatar> 25 <u-avatar :src="pic" size="70"></u-avatar>
26 <view class="user-name"> 26 <view class="user-name">
27 - 企业负责人 27 + 运输企业负责人
28 </view> 28 </view>
29 </view> 29 </view>
30 <view v-if="evaluateManager" class="evaluate-content"> 30 <view v-if="evaluateManager" class="evaluate-content">
@@ -55,7 +55,7 @@ const maxStar = ref([]) @@ -55,7 +55,7 @@ const maxStar = ref([])
55 55
56 // 用户评价对象 56 // 用户评价对象
57 const evaluateUser = ref() 57 const evaluateUser = ref()
58 -// 企业负责人评价 58 +// 运输企业负责人评价
59 const evaluateManager = ref() 59 const evaluateManager = ref()
60 onLoad((options) => { 60 onLoad((options) => {
61 for (let index = 0; index < maxScore; index++) { 61 for (let index = 0; index < maxScore; index++) {
garbage-removal/src/pages/order/other-home/evaluate/index.vue
1 <template> 1 <template>
2 <view class='issue'> 2 <view class='issue'>
3 <view class="issue-head"> 3 <view class="issue-head">
4 - <text class="issue-head-title">单评价</text> 4 + <text class="issue-head-title">单评价</text>
5 <view class="issue-head-star-box"> 5 <view class="issue-head-star-box">
6 <u-icon v-for="(todo, index) in maxStar" :name="score > todo ? 'star-fill' : 'star'" :key="todo" color="#f9ae3d" 6 <u-icon v-for="(todo, index) in maxStar" :name="score > todo ? 'star-fill' : 'star'" :key="todo" color="#f9ae3d"
7 size="28" @click="setScore(index + 1)"></u-icon> 7 size="28" @click="setScore(index + 1)"></u-icon>
@@ -47,7 +47,7 @@ const blur = (e) =&gt; { @@ -47,7 +47,7 @@ const blur = (e) =&gt; {
47 } 47 }
48 onLoad((options) => { 48 onLoad((options) => {
49 orderId.value = options.orderId 49 orderId.value = options.orderId
50 - evaluateType.value = options.userType === "居民用户" ? 0 : 1 50 + evaluateType.value = options.userType === "用户" ? 0 : 1
51 // 积分初始化 51 // 积分初始化
52 for (let index = 0; index < maxScore.value; index++) { 52 for (let index = 0; index < maxScore.value; index++) {
53 maxStar.value.push(index); 53 maxStar.value.push(index);
garbage-removal/src/pages/order/other-home/guest/index.vue
@@ -17,17 +17,17 @@ @@ -17,17 +17,17 @@
17 <text v-if="dataGram.garCancelFlag == 0" style="color: red;">请于交易完成后线下支付!!</text> 17 <text v-if="dataGram.garCancelFlag == 0" style="color: red;">请于交易完成后线下支付!!</text>
18 <view v-else style="display: flex; color:red;"> 18 <view v-else style="display: flex; color:red;">
19 <u-icon name="close-circle" color="red"></u-icon> 19 <u-icon name="close-circle" color="red"></u-icon>
20 - <text> &nbsp;&nbsp;单已被取消!原因:{{ dataGram.garReason }}</text> 20 + <text> &nbsp;&nbsp;单已被取消!原因:{{ dataGram.garReason }}</text>
21 </view> 21 </view>
22 </view> 22 </view>
23 - <!-- 单信息 --> 23 + <!-- 单信息 -->
24 <view class="order-detail-container-box-card"> 24 <view class="order-detail-container-box-card">
25 <view class="order-detail-container-header-card-title"> 25 <view class="order-detail-container-header-card-title">
26 <view class="order-detail-container-header-card-uicon"></view> 26 <view class="order-detail-container-header-card-uicon"></view>
27 - 单信息 27 + 单信息
28 </view> 28 </view>
29 <view class="order-detail-container-header-item"> 29 <view class="order-detail-container-header-item">
30 - <text class="order-detail-container-header-title">单地点:</text> 30 + <text class="order-detail-container-header-title">单地点:</text>
31 <view class="order-detail-container-header-content"> 31 <view class="order-detail-container-header-content">
32 {{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }} 32 {{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }}
33 </view> 33 </view>
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 </view> 58 </view>
59 </view> 59 </view>
60 <view class="order-detail-container-header-item"> 60 <view class="order-detail-container-header-item">
61 - <text class="order-detail-container-header-title">单号:</text> 61 + <text class="order-detail-container-header-title">单号:</text>
62 <view class="order-detail-container-header-content"> 62 <view class="order-detail-container-header-content">
63 {{ orderId }} 63 {{ orderId }}
64 </view> 64 </view>
@@ -66,14 +66,14 @@ @@ -66,14 +66,14 @@
66 </view> 66 </view>
67 67
68 </view> 68 </view>
69 - <!-- 单记录 --> 69 + <!-- 单记录 -->
70 <view class="order-detail-container-box-card"> 70 <view class="order-detail-container-box-card">
71 <view class="order-detail-container-header-card-title"> 71 <view class="order-detail-container-header-card-title">
72 <view class="order-detail-container-header-card-uicon"></view> 72 <view class="order-detail-container-header-card-uicon"></view>
73 - 单人员 73 + 单人员
74 </view> 74 </view>
75 <!-- <view class="order-detail-container-header-item"> 75 <!-- <view class="order-detail-container-header-item">
76 - <text class="order-detail-container-header-title">单时间:</text> 76 + <text class="order-detail-container-header-title">单时间:</text>
77 <view class="order-detail-container-header-content"> 77 <view class="order-detail-container-header-content">
78 {{ dataGram.garCreateTime }} 78 {{ dataGram.garCreateTime }}
79 </view> 79 </view>
@@ -93,7 +93,7 @@ @@ -93,7 +93,7 @@
93 </view> 93 </view>
94 </view> 94 </view>
95 <view class="order-detail-container-header-item"> 95 <view class="order-detail-container-header-item">
96 - <text class="order-detail-container-header-title">单人:</text> 96 + <text class="order-detail-container-header-title">单人:</text>
97 <view class="order-detail-container-header-content"> 97 <view class="order-detail-container-header-content">
98 {{ dataGram.garOrderContactName }} 98 {{ dataGram.garOrderContactName }}
99 </view> 99 </view>
garbage-removal/src/pages/order/other-home/index.vue
@@ -31,10 +31,6 @@ const translation = (e) =&gt; { @@ -31,10 +31,6 @@ const translation = (e) =&gt; {
31 } 31 }
32 </script> 32 </script>
33 <style lang="scss" scoped> 33 <style lang="scss" scoped>
34 -::v-deep .u-tabs__wrapper__scroll-view {  
35 - background-color: #53c21d;  
36 -}  
37 -  
38 .swiper { 34 .swiper {
39 height: 100%; 35 height: 100%;
40 background: linear-gradient(to bottom, $u-success-dark, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color); 36 background: linear-gradient(to bottom, $u-success-dark, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color);
garbage-removal/src/pages/order/other-home/swiper-list-item/index.vue
@@ -11,20 +11,20 @@ @@ -11,20 +11,20 @@
11 <u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon> 11 <u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
12 </view> 12 </view>
13 <view style="display: flex;align-items: center;"> 13 <view style="display: flex;align-items: center;">
14 - <text v-if="item.garOrderHandlerStatus != 3 && item.garOrderStatus === 3 && userType === '运输驾驶员'"  
15 - style="font-size: small;color: #f56c6c;">派单已经完成了。</text> 14 + <text v-if="item.garOrderHandlerStatus != 3 && item.garOrderStatus === 3 && userType === '清运车辆驾驶员'"
  15 + style="font-size: small;color: #f56c6c;">订单已经完成了。</text>
16 <view v-if="item.garOrderHandlerStatus === 0 && item.garCancelFlag === 0" class="right">待清运 </view> 16 <view v-if="item.garOrderHandlerStatus === 0 && item.garCancelFlag === 0" class="right">待清运 </view>
17 <view v-if="item.garCancelFlag === 1" class="right">已取消 </view> 17 <view v-if="item.garCancelFlag === 1" class="right">已取消 </view>
18 <view v-if="item.garOrderHandlerStatus === 1 && item.garCancelFlag === 0" class="right">清运中 </view> 18 <view v-if="item.garOrderHandlerStatus === 1 && item.garCancelFlag === 0" class="right">清运中 </view>
19 - <view v-if="item.garOrderHandlerStatus === 3 && userType === '运输驾驶员'" class="right">已完成 </view> 19 + <view v-if="item.garOrderHandlerStatus === 3 && userType === '清运车辆驾驶员'" class="right">已完成 </view>
20 </view> 20 </view>
21 - <view v-if="item.garEvaluateFlag === 0 && userType === '居民用户'" class="right">待评价 21 + <view v-if="item.garEvaluateFlag === 0 && userType === '用户'" class="right">待评价
22 </view> 22 </view>
23 - <view v-if="item.garHandlerEvaluateFlag === 0 && userType === '企业负责人'" class="right">待评价 23 + <view v-if="item.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人'" class="right">待评价
24 </view> 24 </view>
25 - <view v-if="item.garEvaluateFlag === 1 && userType === '居民用户'" class="right">已评价 25 + <view v-if="item.garEvaluateFlag === 1 && userType === '用户'" class="right">已评价
26 </view> 26 </view>
27 - <view v-if="item.garHandlerEvaluateFlag === 1 && userType === '企业负责人'" class="right">已评价 27 + <view v-if="item.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人'" class="right">已评价
28 </view> 28 </view>
29 </view> 29 </view>
30 <view class="item" @click="handleClick(item.garOrderId)"> 30 <view class="item" @click="handleClick(item.garOrderId)">
@@ -41,11 +41,11 @@ @@ -41,11 +41,11 @@
41 <view class="more"> 41 <view class="more">
42 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> 42 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> -->
43 </view> 43 </view>
44 - <view hover-class="btn-hover" class="logistics btn" @click="handleCancelOrder(item.garOrderId)">取消单</view> 44 + <view hover-class="btn-hover" class="logistics btn" @click="handleCancelOrder(item.garOrderId)">取消单</view>
45 </view> 45 </view>
46 <!-- 用户对公司评价 --> 46 <!-- 用户对公司评价 -->
47 <view class="bottom" 47 <view class="bottom"
48 - v-if="item.garEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '居民用户'"> 48 + v-if="item.garEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '用户'">
49 <view class="more"> 49 <view class="more">
50 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> 50 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> -->
51 </view> 51 </view>
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 </view> 55 </view>
56 <!-- 公司对用户评价 --> 56 <!-- 公司对用户评价 -->
57 <view class="bottom" 57 <view class="bottom"
58 - v-if="item.garHandlerEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '企业负责人'"> 58 + v-if="item.garHandlerEvaluateFlag === 0 && item.garOrderHandlerStatus === 3 && userType === '运输企业负责人'">
59 <view class="more"> 59 <view class="more">
60 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> --> 60 <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> -->
61 </view> 61 </view>
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 </view> 67 </view>
68 </z-paging> 68 </z-paging>
69 <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose" 69 <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose"
70 - @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消单" :show="cancelShow"> 70 + @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消单" :show="cancelShow">
71 </u-action-sheet> 71 </u-action-sheet>
72 </view> 72 </view>
73 </template> 73 </template>
@@ -96,7 +96,7 @@ const list = ref([ @@ -96,7 +96,7 @@ const list = ref([
96 name: '长时间无人接单', 96 name: '长时间无人接单',
97 }, 97 },
98 { 98 {
99 - name: '单信息填写有误', 99 + name: '单信息填写有误',
100 }, 100 },
101 { 101 {
102 name: '线下协商有问题', 102 name: '线下协商有问题',
@@ -115,7 +115,7 @@ const dataList = ref([]); @@ -115,7 +115,7 @@ const dataList = ref([]);
115 const paging = ref(null); 115 const paging = ref(null);
116 const firstLoaded = ref(false) 116 const firstLoaded = ref(false)
117 /** 117 /**
118 - * 取消 118 + * 取消
119 * @param {string} orderId 119 * @param {string} orderId
120 */ 120 */
121 const handleCancelOrder = (orderId) => { 121 const handleCancelOrder = (orderId) => {
@@ -140,7 +140,7 @@ const selectClick = (index) =&gt; { @@ -140,7 +140,7 @@ const selectClick = (index) =&gt; {
140 currentCancelName.value = index.name; 140 currentCancelName.value = index.name;
141 } 141 }
142 /** 142 /**
143 - * 提交取消 143 + * 提交取消
144 */ 144 */
145 const submitFunction = (otherReason) => { 145 const submitFunction = (otherReason) => {
146 let reason = otherReason 146 let reason = otherReason
@@ -148,7 +148,7 @@ const submitFunction = (otherReason) =&gt; { @@ -148,7 +148,7 @@ const submitFunction = (otherReason) =&gt; {
148 reason = currentCancelName.value 148 reason = currentCancelName.value
149 } 149 }
150 if (!reason) { 150 if (!reason) {
151 - uni.$u.toast("请提供取消单的原因") 151 + uni.$u.toast("请提供取消单的原因")
152 return 152 return
153 } 153 }
154 let params = { 154 let params = {
@@ -174,7 +174,7 @@ const handleClick = (orderId) =&gt; { @@ -174,7 +174,7 @@ const handleClick = (orderId) =&gt; {
174 } 174 }
175 175
176 /** 176 /**
177 - * 单评价 177 + * 单评价
178 * @param {*} orderId 178 * @param {*} orderId
179 */ 179 */
180 const handleUserEvaluate = (orderId, userType) => { 180 const handleUserEvaluate = (orderId, userType) => {
garbage-removal/src/pages/wode/choose/index.vue
@@ -80,7 +80,7 @@ const typeList = ref([{ @@ -80,7 +80,7 @@ const typeList = ref([{
80 order: 2, 80 order: 2,
81 isNow: false, 81 isNow: false,
82 }, { 82 }, {
83 - label: "处场所负责人", 83 + label: "处场所负责人",
84 info: '负责现场指导', 84 info: '负责现场指导',
85 company: '', 85 company: '',
86 image: handleImage, 86 image: handleImage,
garbage-removal/src/pages/wode/index.vue
@@ -6,13 +6,13 @@ @@ -6,13 +6,13 @@
6 </view> 6 </view>
7 <view class="u-flex-1"> 7 <view class="u-flex-1">
8 <view class="u-font-18 u-p-b-20">{{ userInfo.userType }}</view> 8 <view class="u-font-18 u-p-b-20">{{ userInfo.userType }}</view>
9 - <view class="manager-info" v-if="userInfo.userType === '运输驾驶员'"> 9 + <view class="manager-info" v-if="userInfo.userType === '清运车辆驾驶员'">
10 <view class="manager-info-transport-company-name"> 10 <view class="manager-info-transport-company-name">
11 <text style="margin-right: 20rpx;">所属运输公司:</text> 11 <text style="margin-right: 20rpx;">所属运输公司:</text>
12 <text>{{ userInfo.transportCompanyName }}</text> 12 <text>{{ userInfo.transportCompanyName }}</text>
13 </view> 13 </view>
14 </view> 14 </view>
15 - <view class="manager-info" v-if="userInfo.userType === '企业负责人'"> 15 + <view class="manager-info" v-if="userInfo.userType === '运输企业负责人'">
16 <view class="manager-info-transport-company-name"> 16 <view class="manager-info-transport-company-name">
17 <text style="margin-right: 20rpx;">所属运输公司:</text> 17 <text style="margin-right: 20rpx;">所属运输公司:</text>
18 <text>{{ userInfo.transportCompanyName }}</text> 18 <text>{{ userInfo.transportCompanyName }}</text>
@@ -48,6 +48,7 @@ @@ -48,6 +48,7 @@
48 import { loginOut } from "@/apis/user"; 48 import { loginOut } from "@/apis/user";
49 import headImg from "@/static/image/st_pic.png"; 49 import headImg from "@/static/image/st_pic.png";
50 import { useMainStore } from "@/stores/index"; 50 import { useMainStore } from "@/stores/index";
  51 +import { setRequestToken } from '@/utils/request/request.js';
51 import { computed, ref } from "vue"; 52 import { computed, ref } from "vue";
52 const store = useMainStore(); 53 const store = useMainStore();
53 const pic = ref(headImg) 54 const pic = ref(headImg)
@@ -67,6 +68,7 @@ const handleLoginOut = () =&gt; { @@ -67,6 +68,7 @@ const handleLoginOut = () =&gt; {
67 loginOut().then(res => { 68 loginOut().then(res => {
68 if (res.data.success) { 69 if (res.data.success) {
69 store.token = null; 70 store.token = null;
  71 + setRequestToken();
70 uni.$u.toast("已退出") 72 uni.$u.toast("已退出")
71 uni.$u.route({ 73 uni.$u.route({
72 type: "reLaunch", 74 type: "reLaunch",
garbage-removal/src/static/icon/download.zip deleted 100644 → 0
No preview for this file type
garbage-removal/src/utils/request/request.js
@@ -52,7 +52,7 @@ const instance = axios.create({ @@ -52,7 +52,7 @@ const instance = axios.create({
52 // 请求拦截器 52 // 请求拦截器
53 instance.interceptors.request.use((config) => { 53 instance.interceptors.request.use((config) => {
54 if (requestUrlCheck(config.url)) { 54 if (requestUrlCheck(config.url)) {
55 - setRequestToken(null); 55 + setRequestToken();
56 } 56 }
57 if (config.method.toLocaleLowerCase() == "get") { 57 if (config.method.toLocaleLowerCase() == "get") {
58 handleGet(config); 58 handleGet(config);
@@ -95,11 +95,15 @@ instance.interceptors.response.use((response) =&gt; { @@ -95,11 +95,15 @@ instance.interceptors.response.use((response) =&gt; {
95 export default instance; 95 export default instance;
96 96
97 export function setRequestToken(token) { 97 export function setRequestToken(token) {
98 - instance.defaults.headers.common["Authorization"] = `${token}`; 98 + if (token) {
  99 + instance.defaults.headers.common["Authorization"] = `${token}`;
  100 + } else {
  101 + delete instance.defaults.headers.common["Authorization"];
  102 + }
99 } 103 }
100 104
101 const reSetLoginStatus = () => { 105 const reSetLoginStatus = () => {
102 - setRequestToken(null); 106 + setRequestToken();
103 107
104 // uni确定是否需要跳转登录页 108 // uni确定是否需要跳转登录页
105 uni.showModal({ 109 uni.showModal({
garbage-removal/src/uview-plus/components/u-empty/u-empty.vue
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 <u-icon v-if="!isSrc" :name="mode === 'message' ? 'chat' : `empty-${mode}`" :size="iconSize" :color="iconColor" 3 <u-icon v-if="!isSrc" :name="mode === 'message' ? 'chat' : `empty-${mode}`" :size="iconSize" :color="iconColor"
4 margin-top="14"></u-icon> 4 margin-top="14"></u-icon>
5 <image v-else :style="{ 5 <image v-else :style="{
6 - width: $u.addUnit(width),  
7 - height: $u.addUnit(height),  
8 - }" :src="icon" mode="widthFix"></image>  
9 - <text class="u-empty__text" :style="[textStyle]">{{text ? text : icons[mode]}}</text> 6 + width: $u.addUnit(width),
  7 + height: $u.addUnit(height),
  8 + }" :src="icon" mode="widthFix"></image>
  9 + <text class="u-empty__text" :style="[textStyle]">{{ text ? text : icons[mode] }}</text>
10 <view class="u-empty__wrap" v-if="$slots.default || $slots.$default"> 10 <view class="u-empty__wrap" v-if="$slots.default || $slots.$default">
11 <slot /> 11 <slot />
12 </view> 12 </view>
@@ -14,75 +14,75 @@ @@ -14,75 +14,75 @@
14 </template> 14 </template>
15 15
16 <script> 16 <script>
17 - import mixin from '../../libs/mixin/mixin.js'; 17 +import mixin from '../../libs/mixin/mixin.js';
18 import mpMixin from '../../libs/mixin/mpMixin.js'; 18 import mpMixin from '../../libs/mixin/mpMixin.js';
19 import props from './props.js'; 19 import props from './props.js';
20 - /**  
21 - * empty 内容为空  
22 - * @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。  
23 - * @tutorial https://ijry.github.io/uview-plus/components/empty.html  
24 - * @property {String} icon 内置图标名称,或图片路径,建议绝对路径  
25 - * @property {String} text 提示文字  
26 - * @property {String} textColor 文字颜色 (默认 '#c0c4cc' )  
27 - * @property {String | Number} textSize 文字大小 (默认 14 )  
28 - * @property {String} iconColor 图标的颜色 (默认 '#c0c4cc' )  
29 - * @property {String | Number} iconSize 图标的大小 (默认 90 )  
30 - * @property {String} mode 选择预置的图标类型 (默认 'data' )  
31 - * @property {String | Number} width 图标宽度,单位px (默认 160 )  
32 - * @property {String | Number} height 图标高度,单位px (默认 160 )  
33 - * @property {Boolean} show 是否显示组件 (默认 true )  
34 - * @property {String | Number} marginTop 组件距离上一个元素之间的距离,默认px单位 (默认 0 )  
35 - * @property {Object} customStyle 定义需要用到的外部样式  
36 - *  
37 - * @event {Function} click 点击组件时触发  
38 - * @event {Function} close 点击关闭按钮时触发  
39 - * @example <u-empty text="所谓伊人,在水一方" mode="list"></u-empty>  
40 - */  
41 - export default {  
42 - name: "u-empty",  
43 - mixins: [mpMixin, mixin, props],  
44 - data() {  
45 - return {  
46 - icons: {  
47 - car: '购物车为空',  
48 - page: '页面不存在',  
49 - search: '没有搜索结果',  
50 - address: '没有收货地址',  
51 - wifi: '没有WiFi',  
52 - order: '派单为空',  
53 - coupon: '没有优惠券',  
54 - favor: '暂无收藏',  
55 - permission: '无权限',  
56 - history: '无历史记录',  
57 - news: '无新闻列表',  
58 - message: '消息列表为空',  
59 - list: '列表为空',  
60 - data: '数据为空',  
61 - comment: '暂无评论',  
62 - } 20 +/**
  21 + * empty 内容为空
  22 + * @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。
  23 + * @tutorial https://ijry.github.io/uview-plus/components/empty.html
  24 + * @property {String} icon 内置图标名称,或图片路径,建议绝对路径
  25 + * @property {String} text 提示文字
  26 + * @property {String} textColor 文字颜色 (默认 '#c0c4cc' )
  27 + * @property {String | Number} textSize 文字大小 (默认 14 )
  28 + * @property {String} iconColor 图标的颜色 (默认 '#c0c4cc' )
  29 + * @property {String | Number} iconSize 图标的大小 (默认 90 )
  30 + * @property {String} mode 选择预置的图标类型 (默认 'data' )
  31 + * @property {String | Number} width 图标宽度,单位px (默认 160 )
  32 + * @property {String | Number} height 图标高度,单位px (默认 160 )
  33 + * @property {Boolean} show 是否显示组件 (默认 true )
  34 + * @property {String | Number} marginTop 组件距离上一个元素之间的距离,默认px单位 (默认 0 )
  35 + * @property {Object} customStyle 定义需要用到的外部样式
  36 + *
  37 + * @event {Function} click 点击组件时触发
  38 + * @event {Function} close 点击关闭按钮时触发
  39 + * @example <u-empty text="所谓伊人,在水一方" mode="list"></u-empty>
  40 + */
  41 +export default {
  42 + name: "u-empty",
  43 + mixins: [mpMixin, mixin, props],
  44 + data() {
  45 + return {
  46 + icons: {
  47 + car: '购物车为空',
  48 + page: '页面不存在',
  49 + search: '没有搜索结果',
  50 + address: '没有收货地址',
  51 + wifi: '没有WiFi',
  52 + order: '订单为空',
  53 + coupon: '没有优惠券',
  54 + favor: '暂无收藏',
  55 + permission: '无权限',
  56 + history: '无历史记录',
  57 + news: '无新闻列表',
  58 + message: '消息列表为空',
  59 + list: '列表为空',
  60 + data: '数据为空',
  61 + comment: '暂无评论',
63 } 62 }
  63 + }
  64 + },
  65 + computed: {
  66 + // 组件样式
  67 + emptyStyle() {
  68 + const style = {}
  69 + style.marginTop = uni.$u.addUnit(this.marginTop)
  70 + // 合并customStyle样式,此参数通过mixin中的props传递
  71 + return uni.$u.deepMerge(uni.$u.addStyle(this.customStyle), style)
64 }, 72 },
65 - computed: {  
66 - // 组件样式  
67 - emptyStyle() {  
68 - const style = {}  
69 - style.marginTop = uni.$u.addUnit(this.marginTop)  
70 - // 合并customStyle样式,此参数通过mixin中的props传递  
71 - return uni.$u.deepMerge(uni.$u.addStyle(this.customStyle), style)  
72 - },  
73 - // 文本样式  
74 - textStyle() {  
75 - const style = {}  
76 - style.color = this.textColor  
77 - style.fontSize = uni.$u.addUnit(this.textSize)  
78 - return style  
79 - },  
80 - // 判断icon是否图片路径  
81 - isSrc() {  
82 - return this.icon.indexOf('/') >= 0  
83 - } 73 + // 文本样式
  74 + textStyle() {
  75 + const style = {}
  76 + style.color = this.textColor
  77 + style.fontSize = uni.$u.addUnit(this.textSize)
  78 + return style
  79 + },
  80 + // 判断icon是否图片路径
  81 + isSrc() {
  82 + return this.icon.indexOf('/') >= 0
84 } 83 }
85 } 84 }
  85 +}
86 </script> 86 </script>
87 87
88 <style lang="scss" scoped> 88 <style lang="scss" scoped>