Commit c125194fa836ddd000f63f960c2e579d80ecef1e

Authored by guzijian
1 parent 20917ce1

feat: 超时取消,封装picker组件

garbage-removal/src/apis/order.js
... ... @@ -106,6 +106,11 @@ export async function queryOrderMessageCount() {
106 106 export async function queryOrderMessageList(pageNo,pageSize) {
107 107 return await request.get(`/order/query/message/list/${pageNo}/${pageSize}`);
108 108 }
  109 +
109 110 export async function readMessage(data) {
110 111 return await request.put(`/order/read/message`,data);
111 112 }
  113 +
  114 +export async function successOrder(data) {
  115 + return await request.put(`/order/update`,data);
  116 +}
... ...
garbage-removal/src/components/my-piker/index.vue 0 → 100644
  1 +<template>
  2 + <view style="width: 100%;">
  3 + <view @click="openUnit" style="width: 100%;" hover-class="hoverClickStyle">
  4 + {{ parentValue }}
  5 + </view>
  6 + <!-- 弹框 -->
  7 + <u-popup :show="visible" :round="10" mode="bottom" :closeable="true" @close="closeUnit" @open="openUnit">
  8 + <view style="height: 700rpx">
  9 + <h4 style="text-align: center; margin-top: 56rpx; letter-spacing: 5rpx">{{ title }}</h4>
  10 + <picker-view :indicator-style="'height: 50px;'" :value="unitValue" @change="bindPickerChange"
  11 + class="picker-view">
  12 + <picker-view-column>
  13 + <view class="item" v-for="(item, index) in array" :key="index">{{ item }}</view>
  14 + </picker-view-column>
  15 + </picker-view>
  16 + </view>
  17 + </u-popup>
  18 + </view>
  19 +</template>
  20 +<script setup>
  21 +import { ref } from 'vue';
  22 +const emit = defineEmits(['change'])
  23 +const props = defineProps({
  24 + parentValue: {
  25 + type: String,
  26 + required: true,
  27 + },
  28 + title: {
  29 + type: String,
  30 + default: '请选择',
  31 + },
  32 + array: {
  33 + type: Array,
  34 + default: [],
  35 + },
  36 +})
  37 +const visible = ref(false)
  38 +const index = ref(0);
  39 +// 摆设 不能没有
  40 +const unitValue = ref([])
  41 +const closeUnit = () => {
  42 + visible.value = false
  43 +}
  44 +const openUnit = () => {
  45 + visible.value = true
  46 + console.log('open');
  47 +}
  48 +const bindPickerChange = (e) => {
  49 + console.log('picker发送选择改变,携带值为', e.detail.value)
  50 + index.value = e.detail.value
  51 + emit('change', props.array[index.value])
  52 +}
  53 +</script>
  54 +<style lang="scss" scoped>
  55 +.picker-view {
  56 + width: 750rpx;
  57 + height: 600rpx;
  58 + margin-top: 20rpx;
  59 +}
  60 +
  61 +.item {
  62 + line-height: 100rpx;
  63 + text-align: center;
  64 +}
  65 +
  66 +.hoverClickStyle {
  67 + @include handleClick;
  68 +}
  69 +</style>
... ...
garbage-removal/src/pages.json
... ... @@ -158,13 +158,6 @@
158 158 "navigationBarBackgroundColor":"#19a97c",
159 159 "enablePullDownRefresh": false
160 160 }
161   - },
162   - {
163   - "path": "pages/home/search/index",
164   - "style": {
165   - "navigationBarTitleText": "公司搜索",
166   - "enablePullDownRefresh": false
167   - }
168 161 },{
169 162 "path": "pages/order/index",
170 163 "style": {
... ...
garbage-removal/src/pages/home/clean/company-detail/index.vue
... ... @@ -3,8 +3,9 @@
3 3 <view class="company-content-box">
4 4 <view class="company-content-header">
5 5 <view class="company-content-left">
6   - <image class="company-content-left-image"
7   - :src="headerData.carParkPanorama ? headerData.carParkPanorama : 'https://ijry.github.io/uview-plus/h5/assets/logo-8d54bbeb.png'" />
  6 + <up-image :show-loading="true"
  7 + :src="headerData.companyLogo ? headerData.companyLogo : '../../../../static/image/freecompress-swiper-2.jpg'"
  8 + width="150rpx" height="150rpx"></up-image>
8 9 </view>
9 10 <view class="company-content-right">
10 11 <view class="company-content-right-name">
... ... @@ -84,8 +85,9 @@
84 85 </view>
85 86 </view>
86 87 <view class="company-bottom-button-right">
87   - <u-button icon="car-fill" :custom-style="customStyle" @click="handleCleanGarbage(companyInfo, tel, userAddress)"
88   - type="success" :hairline="true" size="normal" shape="circle" text="垃圾清运"></u-button>
  88 + <u-button v-if="userType == '用户'" icon="car-fill" :custom-style="customStyle"
  89 + @click="handleCleanGarbage(companyInfo, tel, userAddress)" type="success" :hairline="true" size="normal"
  90 + shape="circle" text="垃圾清运"></u-button>
89 91 </view>
90 92 </view>
91 93 </view>
... ... @@ -94,8 +96,11 @@
94 96 <script setup>
95 97 import { queryCarList } from '@/apis/carinfo.js';
96 98 import { queryEnterpriseById } from '@/apis/company.js';
  99 +import { useMainStore } from "@/stores/index.js";
97 100 import { onLoad } from '@dcloudio/uni-app';
98   -import { ref } from 'vue';
  101 +import { computed, ref } from 'vue';
  102 +const mainStore = useMainStore()
  103 +const userType = computed(() => mainStore.userType)
99 104 const baseDataList = ref([{ label: '法人' }, { label: '负责人' }, { label: '业务联系电话' }, { label: '道路运输许可证' }, { label: '核准有效期' }, { label: '注册地址' }]);
100 105 const customStyle = ref({
101 106 fontSize: '30rpx',
... ... @@ -108,7 +113,7 @@ const userAddress = ref()
108 113 const headerData = ref({
109 114 name: "",
110 115 registrationArea: "",
111   - carParkPanorama: ""
  116 + companyLogo: ""
112 117 })
113 118 const serverData = ref([
114 119 {
... ... @@ -185,7 +190,7 @@ const initData = (baseData) =&gt; {
185 190 baseDataList.value[5].value = baseData.officeAddress
186 191 headerData.value.name = baseData.name;
187 192 headerData.value.registrationArea = baseData.registrationArea;
188   - headerData.value.carParkPanorama = baseData.carParkPanorama;
  193 + headerData.value.companyLogo = baseData.companyLogo;
189 194 }
190 195 </script>
191 196  
... ...
garbage-removal/src/pages/home/clean/index.vue
1 1 <template>
2 2 <view class="mask-box">
3 3 <liu-delivery-time :isMask="true" :change="changeTime" ref="chooseTime" title="请选择预约时间"></liu-delivery-time>
4   - <u-picker closeOnClickOverlay :show="carTypeShowFlag" :columns="candidates" :itemHeight="100"
5   - @confirm="handlePickerCarInfoConfirm" @cancel="handleCarInfoClick(false)"
6   - @close="handleCarInfoClick(false)"></u-picker>
7 4 <u-picker closeOnClickOverlay :show="garbageTypeShowFlag" :columns="garbageTypeList" :itemHeight="100"
8 5 @confirm="handlePickerGarbageTypeConfirm" @close="handleGarbageTypeClick(false)"
9 6 @cancel="handleGarbageTypeClick(false)"></u-picker>
10   - <!-- <u-popup :zIndex="10074" closeOnClickOverlay :show="carPopupShowFlag" :round="10" @close="handlePopupClick(false)"
11   - @open="handlePopupClick(true)">
12   - <view class="company-clean-container-car-popup">
13   - <view class="company-clean-container-car-popup-content">
14   - <view class="company-clean-container-car-popup-content-title">
15   - <view style="text-align: center;">
16   - 车辆类型
17   - </view>
18   - </view>
19   - <view class="company-clean-container-car-popup-content-box">
20   - <view class="company-clean-container-car-popup-content-box-item" v-for="(item, index) in garCarInfoList"
21   - :key="index">
22   - <view class="company-clean-container-car-popup-content-box-item-text">
23   - {{ item.garOrderCarType }}
24   - </view>
25   - <view class="company-clean-container-car-popup-content-box-item-number" hover-class="hoverClickStyle">
26   - <u-number-box :min="0" :max="9999" integer buttonSize="46" :inputWidth="100"
27   - v-model="garCarInfoList[item.garOrderCarType].garOrderCarNumber" :disabledInput="true"></u-number-box>
28   - </view>
29   - </view>
30   - </view>
31   - </view>
32   - <view class="company-clean-container-car-popup-button-safe">
33   - &nbsp;
34   - </view>
35   - </view>
36   - </u-popup> -->
37 7 </view>
38 8 <view class="company-clean-container">
39 9 <view class="company-clean-container-box">
... ... @@ -56,7 +26,23 @@
56 26 </view>
57 27 <view class="company-clean-container-car-main">
58 28 <view class="company-clean-container-car-main-content">
59   - <view class="company-clean-container-car-main-content">
  29 + <view v-if="paramFrom.carType" class="company-clean-container-car-main-content-type">
  30 + <view class="company-clean-container-car-main-content-type-price-area">
  31 + <text style="color: red;">*</text>车辆信息:
  32 + </view>
  33 + <view style=" width:100%;display:flex; color:#909399; align-items: center;">
  34 + <myPiker :parentValue="paramFrom.carType" @change="handlePickerCarInfoConfirm"
  35 + :modelValue="paramFrom.carType" :array="candidates" :title="'车辆信息'">
  36 + </myPiker>
  37 + </view>
  38 + </view>
  39 + <view class="company-clean-container-car-main-content-img">
  40 + <image class="company-clean-container-car-main-content-img" :src="carFront" />
  41 + </view>
  42 + <view class="company-clean-container-car-main-content-remark" style="margin: 20rpx 0; font-size: 23rpx;">
  43 + {{ garCarTransportInfo }}
  44 + </view>
  45 + <view class=" company-clean-container-car-main-content">
60 46 <view class="company-clean-container-car-popup">
61 47 <!-- 主要内容 -->
62 48 <view class="company-clean-container-car-popup-content">
... ... @@ -82,22 +68,22 @@
82 68 </view>
83 69 </view>
84 70 </view>
85   -
86 71 <view class="company-clean-container-car-main-content-type">
87 72 <view class="company-clean-container-car-main-content-type-price-area">
88 73 <text style="color: red;">*</text>垃圾类型:
89 74 </view>
90   - <view hover-class="hoverClickStyle" @click.stop="handleGarbageTypeClick(true)">
91   - <u--input color="#909399" border="none" style="pointer-events:none" :modelValue="paramFrom.garbageType"
92   - type="text" placeholder-class="line" readonly />
  75 + <view style=" width:100%;display:flex; color:#909399; align-items: center;">
  76 + <myPiker :parentValue="paramFrom.garbageType" :title="'垃圾类型'" @change="handlePickerGarbageTypeConfirm"
  77 + :array="garbageTypeList">
  78 + </myPiker>
93 79 </view>
94 80 </view>
95 81 <view class="company-clean-container-car-main-content-type">
96 82 <view class="company-clean-container-car-main-content-type-price-area">
97 83 <text style="color: red;">*</text>是否进入车库:
98 84 </view>
99   - <view style="width:100%;display: flex;justify-content: center;align-items: center; ">
100   - <view style="display: flex;">
  85 + <view style="width:100%;display: flex;justify-content: flex-start;align-items: center; ">
  86 + <view style="display: flex; align-items: center;">
101 87 <up-radio-group shape="square" size="30" v-model="paramFrom.garInCarStore" placement="row"
102 88 @change="handleInCarClick">
103 89 <up-radio activeColor="#19a97c" labelSize="30"
... ... @@ -118,23 +104,6 @@
118 104 提示:需要进入车库需要写车辆限高,部门车库限高2.3m,如果装修垃圾在车库,要考虑车辆是否能进入。
119 105 </view>
120 106 </view>
121   - <view v-if="paramFrom.carType" class="company-clean-container-car-main-content-type">
122   - <view class="company-clean-container-car-main-content-type-price-area">
123   - <text style="color: red;">*</text>车辆信息:
124   - </view>
125   - <!-- <scrollText :candidates="candidates" /> -->
126   - <view style="display:flex; align-items: center;" hover-class="hoverClickStyle"
127   - @click.stop="handleCarInfoClick(true)">
128   - <u--input color="#909399" border="none" style="pointer-events:none" :modelValue="paramFrom.carType"
129   - type="text" placeholder-class="line" readonly />
130   - </view>
131   - </view>
132   - <view class="company-clean-container-car-main-content-img">
133   - <image class="company-clean-container-car-main-content-img" :src="carFront" />
134   - </view>
135   - <view class="company-clean-container-car-main-content-remark">
136   - {{ garCarTransportInfo }}
137   - </view>
138 107 <view class="company-clean-container-car-main-content-prompt">
139 108 温馨提示:垃圾类型不符合,企业有权拒绝清运。
140 109 </view>
... ... @@ -195,6 +164,7 @@ import { queryCarList } from &#39;@/apis/carinfo.js&#39;;
195 164 import { uploadFilePromise } from '@/apis/common.js';
196 165 import { saveOrder } from '@/apis/order.js';
197 166 import liuDeliveryTime from "@/components/liu-delivery-time/liu-delivery-time.vue";
  167 +import myPiker from '@/components/my-piker/index.vue';
198 168 import garbageUrl from '@/static/image/garbage.png';
199 169 import { useMainStore } from '@/stores/index.js';
200 170 import { onLoad } from '@dcloudio/uni-app';
... ... @@ -260,14 +230,14 @@ const garCarNumberCount = computed(() =&gt; {
260 230 console.log(count);
261 231 return count;
262 232 })
263   -const garbageTypeList = ref([["装修垃圾", "建筑垃圾"]])
  233 +const garbageTypeList = ref(["装修垃圾", "建筑垃圾"])
264 234 const paramFrom = ref({
265 235 carNumber: 0,
266 236 remark: "",
267 237 sureReadFlag: [],
268 238 carType: "",
269   - garbageType: ["装修垃圾"],
270   - garInCarStore: false
  239 + garbageType: "装修垃圾",
  240 + garInCarStore: false,
271 241 })
272 242 const dayTime = ref()
273 243  
... ... @@ -334,22 +304,22 @@ const initOptions = async (options) =&gt; {
334 304 }
335 305 queryCarList({ companyId: companyObj.value.id }).then(res => {
336 306 // 设置车辆类型
337   - candidates.value = [[...new Set(res.data.rows
  307 + candidates.value = [...new Set(res.data.rows
338 308 .filter(item => item.containerVolume)
339 309 .map(item => {
340 310 garCarLabelInfoList.value[item.containerVolume + "方车"] = item
341 311 return item.containerVolume + "方车"
342 312 }))
343   - ]];
  313 + ];
344 314 // 设置初始车辆数量
345   - candidates.value[0].forEach((item, index) => {
  315 + candidates.value.forEach((item, index) => {
346 316 garCarInfoList.value[item] = {
347 317 garOrderCarNumber: 0,
348 318 garOrderCarType: item
349 319 }
350 320 })
351 321 // 设置默认车辆
352   - paramFrom.value.carType = candidates.value[0][0];
  322 + paramFrom.value.carType = candidates.value[0];
353 323 garCarLabelInfoNow.value = garCarLabelInfoList.value[paramFrom.value.carType]
354 324 })
355 325 }
... ... @@ -411,11 +381,12 @@ const afterRead = async (event) =&gt; {
411 381  
412 382  
413 383 const handlePickerGarbageTypeConfirm = (e) => {
414   - paramFrom.value.garbageType = e.value
  384 + paramFrom.value.garbageType = e
415 385 garbageTypeShowFlag.value = false
416 386 }
417 387 const handlePickerCarInfoConfirm = (e) => {
418   - paramFrom.value.carType = e.value
  388 + console.log(e);
  389 + paramFrom.value.carType = e
419 390 garCarLabelInfoNow.value = garCarLabelInfoList.value[paramFrom.value.carType]
420 391 carTypeShowFlag.value = false
421 392 console.log(garCarLabelInfoNow.value);
... ... @@ -450,7 +421,7 @@ const handleOderSure = () =&gt; {
450 421 /**
451 422 * 垃圾类型
452 423 */
453   - garOrderTrashType: paramFrom.value.garbageType[0],
  424 + garOrderTrashType: paramFrom.value.garbageType,
454 425  
455 426 /**
456 427 * 订单人电话
... ... @@ -527,6 +498,11 @@ const handleOderSure = () =&gt; {
527 498 */
528 499 const validateParams = (params) => {
529 500  
  501 + if (params.garInCarStore && !params.garRemark) {
  502 + jumpPrompt('请输入限高')
  503 + return false;
  504 + }
  505 +
530 506 if (!paramFrom.value.sureReadFlag[0]) {
531 507 jumpPrompt('请勾选"本人已确认信息真实有效,并将上诉信息告知市容环境卫生主管部门"')
532 508 return false;
... ... @@ -736,6 +712,7 @@ $custom-bottom-height: 200rpx;
736 712 align-items: center;
737 713 color: $u-info;
738 714 white-space: nowrap;
  715 + width: 100%;
739 716 }
740 717 }
741 718  
... ...
garbage-removal/src/pages/home/index.vue
... ... @@ -25,7 +25,7 @@
25 25 </view>
26 26 </view>
27 27 <view class="company-container">
28   - <view class="company-list-box" v-if="addressInfo">
  28 + <view class="company-list-box" v-if="addressInfo && userType == '用户'">
29 29 <view class="company-list-header">
30 30 <view class="company-list-header-left">
31 31 <u-dropdown active-color="#19a97c">
... ... @@ -37,12 +37,6 @@
37 37 :title="dropdownOptions[2][sortValue].label" :options="dropdownOptions[2]"></u-dropdown-item>
38 38 </u-dropdown>
39 39 </view>
40   - <view class="company-list-header-right" @tap.stop="handleSearchClick">
41   - <view
42   - style="display: inline-block; width: 100%;pointer-events: none;margin: 10rpx 0rpx; box-sizing: border-box;">
43   - <u-search :searchIconSize="40" :disabled="true" :placeholder="'搜索'" :showAction="false"></u-search>
44   - </view>
45   - </view>
46 40 </view>
47 41 <view class="company-list-content">
48 42 <view class="company-list-content-box">
... ... @@ -84,7 +78,7 @@
84 78 </view>
85 79 <view class="company-list-item-main-right-price-number">
86 80 <view class="company-list-item-main-right-price">
87   - 报价:<text style="color: #fd5d00;">¥400起&nbsp;&nbsp;</text>
  81 + 报价:<text style="color: #fd5d00;">¥{{ item.offer }}起&nbsp;&nbsp;</text>
88 82 </view>
89 83 <view class="company-list-item-main-right-number">
90 84 清运数:<text class="company-list-item-main-right-number-text">{{ item.cleanNumber }}</text>
... ... @@ -107,9 +101,6 @@
107 101 </view>
108 102 </view>
109 103 </view>
110   - <!-- <view class="company-list-item-main-right-remark">
111   - {{ item.remark }}
112   - </view> -->
113 104 </view>
114 105 </view>
115 106 <view class="company-list-item-bottom">
... ... @@ -121,7 +112,7 @@
121 112 </view>
122 113 <view class="company-empty" v-else @click="handleCleanClick">
123 114 <view class="empty-text-title">
124   - 请先添加地址
  115 + {{ prompt }}
125 116 </view>
126 117 <view class="empty-text-content">
127 118 房屋装饰装修过程中产生的砖瓦、木材、熟料等废弃物
... ... @@ -140,8 +131,14 @@
140 131 <script setup>
141 132 import { queryAddress } from '@/apis/address.js';
142 133 import { queryEnterpriseList } from '@/apis/company.js';
  134 +import swiperImage1 from '@/static/image/freecompress-swiper-1.png';
  135 +import swiperImage2 from '@/static/image/freecompress-swiper-2.jpg';
  136 +import { useMainStore } from "@/stores/index.js";
143 137 import { onLoad, onShow } from '@dcloudio/uni-app';
144   -import { ref } from 'vue';
  138 +import { computed, ref } from 'vue';
  139 +const mainStore = useMainStore()
  140 +const userType = computed(() => mainStore.userType)
  141 +const prompt = computed(() => userType.value == '用户' ? "请先添加地址" : '非用户无法下单')
145 142 // 定义最大积分
146 143 let maxScore = 5
147 144 const maxStar = ref([])
... ... @@ -150,9 +147,9 @@ const topMargin = ref(null);//状态栏高度
150 147 const musicheadHeight = ref();
151 148 const paging = ref(null)
152 149 const swiperImageList = ref([{
153   - image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.o6VdtT8EY8mHjzoX7qAlrQAAAA?w=261&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7'
  150 + image: swiperImage1
154 151 }, {
155   - image: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.LwNUQLX3A3PIJ0Rzm4ATOwHaEQ?w=304&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
  152 + image: swiperImage2
156 153 }])
157 154  
158 155 const userAddress = ref({})
... ... @@ -310,19 +307,21 @@ const handleCleanClick = () =&gt; {
310 307 });
311 308 } else {
312 309 // 用户已登录但是没有清运地址的情况
313   - uni.showModal({
314   - title: '',
315   - content: '请先添加清运地址',
316   - success: function (res) {
317   - if (res.confirm) {
318   - uni.$u.route({
319   - url: `pages/home/address/index`,
320   - })
321   - } else if (res.cancel) {
322   - console.log('用户点击取消');
  310 + if (userType.value == '用户') {
  311 + uni.showModal({
  312 + title: '',
  313 + content: prompt.value,
  314 + success: function (res) {
  315 + if (res.confirm) {
  316 + uni.$u.route({
  317 + url: `pages/home/address/index`,
  318 + })
  319 + } else if (res.cancel) {
  320 + console.log('用户点击取消');
  321 + }
323 322 }
324   - }
325   - });
  323 + });
  324 + }
326 325 }
327 326 return
328 327  
... ...
garbage-removal/src/pages/home/search/index.vue deleted 100644 → 0
1   -<template>
2   - <view class="search-container">
3   - <view class="search-box">
4   - <u-search placeholder="请输入" :searchIconSize="40" :disabled="true" @click="handleSearchClick"
5   - :showAction="false"></u-search>
6   - </view>
7   - </view>
8   -</template>
9   -
10   -<script setup>
11   -
12   -</script>
13   -
14   -<style lang="scss" scoped></style>
garbage-removal/src/pages/login/index.vue
... ... @@ -44,7 +44,7 @@ import { userLogin } from &quot;@/apis/user.js&quot;;
44 44 export default {
45 45 data() {
46 46 return {
47   - tel: '18966667777',
  47 + tel: '13222222222',
48 48 agree: []
49 49 }
50 50 },
... ...
garbage-removal/src/pages/order/driver-home/detail/index.vue
... ... @@ -120,12 +120,6 @@
120 120 处理信息
121 121 </view>
122 122 <view v-if="putDownImages.length || putOnImages.length" style="width: 100%;">
123   - <!-- <view class="order-detail-container-header-item">
124   - <text class="order-detail-container-header-title">负责人:</text>
125   - <view class="order-detail-container-header-content">
126   - {{ dataGram.garOrderHandleName }}
127   - </view>
128   - </view> -->
129 123 <view class="order-detail-container-header-item">
130 124 <text class="order-detail-container-header-title">服务电话:</text>
131 125 <view class="order-detail-container-header-content">
... ... @@ -189,9 +183,6 @@
189 183 </view>
190 184 </view>
191 185 </view>
192   - <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose"
193   - @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消订单" :show="cancelShow">
194   - </u-action-sheet>
195 186 </view>
196 187 <view v-if="showUQRcode" class="mask-container" @click="showUQRcode = false">
197 188 <uqrcode :h5SaveIsDownload="true" ref="qrCodeRef" canvas-id="qrcode" :value="qrCodeText"
... ... @@ -223,35 +214,6 @@ const cancelShow = ref(false)
223 214 const currentCancelName = ref("")
224 215 const qrCodeRef = ref()
225 216 const qrCodeText = ref()
226   -const list = computed(() => {
227   - let reason = [
228   - {
229   - name: '订单信息填写有误',
230   - },
231   - {
232   - name: '线下协商有问题',
233   - },
234   - {
235   - name: '不需要清运了',
236   - },
237   - {
238   - name: '其他',
239   - },
240   - {
241   - name: '提交',
242   - }
243   - ]
244   - if (userType.value === '用户') {
245   - reason.unshift({
246   - name: '长时间无人接单',
247   - })
248   - } else {
249   - reason.unshift({
250   - name: '无修改权限'
251   - })
252   - }
253   - return reason
254   -})
255 217  
256 218 // 创建二维码
257 219 const createQrCodeLocal = (orderId) => {
... ... @@ -345,35 +307,6 @@ const handlerJumpOtherApp = (latitude, longitude, garCoordinate) =&gt; {
345 307 })
346 308 }
347 309  
348   -/**
349   - * 提交取消订单
350   - */
351   -const submitFunction = (otherReason) => {
352   - let reason = otherReason
353   - if (currentCancelName.value != "其他") {
354   - reason = currentCancelName.value
355   - }
356   - if (!reason) {
357   - uni.$u.toast("请提供取消订单的原因")
358   - return
359   - }
360   - let params = {
361   - garOrderId: orderId.value,
362   - garCancelFlag: 1,
363   - garReason: reason
364   - }
365   - updateOrder(params).then(res => {
366   - if (res.data.success) {
367   - cancelShow.value = false
368   - uni.$u.toast(res.data.data)
369   - uni.$u.route({
370   - type: "reLaunch",
371   - url: `pages/order/index`,
372   - })
373   - }
374   - })
375   -}
376   -
377 310 const handleEvaluate = (orderId, userType) => {
378 311 uni.$u.route(`pages/order/other-home/evaluate/index?orderId=${orderId}&userType=${userType}`)
379 312 }
... ... @@ -400,16 +333,11 @@ const handleOrder = (orderId) =&gt; {
400 333 const driverHandleOrder = (orderId) => {
401 334 updateOrder({ garOrderId: orderId, handleType: 0 }).then(res => {
402 335 if (res.data.success) {
403   - if (res.data.data === "订单已经被别人接受啦") {
404   - uni.$u.toast(res.data.data)
405   - uni.$u.route({
406   - type: "reLaunch",
407   - url: `pages/order/index`,
408   - })
409   - } else {
410   - uni.$u.toast(res.data.data)
411   - handleOrderDetail(orderId)
412   - }
  336 + uni.$u.toast(res.data.data)
  337 + uni.$u.route({
  338 + type: "reLaunch",
  339 + url: `pages/order/index`,
  340 + })
413 341 }
414 342 })
415 343 }
... ...
garbage-removal/src/pages/order/driver-home/swiper-list-item/index.vue
... ... @@ -15,7 +15,7 @@
15 15 style="font-size: small;color: #f56c6c;">订单已经完成了。</text> -->
16 16 <view v-if="item.garOrderHandlerStatus === 0 && item.garCancelFlag === 0" class="right">待清运 </view>
17 17 <view v-if="item.garOrderHandlerStatus === 1 && item.garCancelFlag === 0" class="right">清运中 </view>
18   - <view v-if="item.garOrderHandlerStatus === 3 && userType === '清运车辆驾驶员'" class="right">已完成 </view>
  18 + <view v-if="item.garOrderHandlerStatus === 3" class="right">已完成 </view>
19 19 </view>
20 20 </view>
21 21 <view class="item" @click="handleClick(item.garOrderId)">
... ... @@ -28,18 +28,9 @@
28 28 <view class="delivery-time">预约时间 {{ item.garOrderAgreementTime }}</view>
29 29 </view>
30 30 </view>
31   - <view class="bottom"
32   - v-if="item.garOrderHandlerStatus === 0 && item.garCancelFlag === 0 && userType != '清运车辆驾驶员'">
33   - <view class="more">
34   - <!-- <u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> -->
35   - </view>
36   - </view>
37 31 </view>
38 32 </view>
39 33 </z-paging>
40   - <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose"
41   - @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消订单" :show="cancelShow">
42   - </u-action-sheet>
43 34 </view>
44 35 </template>
45 36  
... ... @@ -62,40 +53,9 @@ const userType = computed(() =&gt; store.userType)
62 53 const currentCancelOrderId = ref("");
63 54 const currentCancelName = ref("");
64 55 const cancelShow = ref(false)
65   -const list = ref([
66   - {
67   - name: '长时间无人接单',
68   - },
69   - {
70   - name: '订单信息填写有误',
71   - },
72   - {
73   - name: '线下协商有问题',
74   - },
75   - {
76   - name: '不需要清运了',
77   - },
78   - {
79   - name: '其他',
80   - },
81   - {
82   - name: '提交',
83   - }
84   -])
85 56 const dataList = ref([]);
86 57 const paging = ref(null);
87 58 const firstLoaded = ref(false)
88   -/**
89   - * 取消订单
90   - * @param {string} orderId
91   - */
92   -const handleCancelOrder = (orderId) => {
93   - currentCancelOrderId.value = orderId
94   - cancelShow.value = true
95   -}
96   -const handleClose = (e) => {
97   - cancelShow.value = false
98   -}
99 59  
100 60 /**
101 61 * 跳转公司详情
... ...
garbage-removal/src/pages/order/handler-home/transport-detail/index.vue
... ... @@ -100,17 +100,16 @@
100 100 <view class="space-box">{{ spaceStr }}</view>
101 101 </view>
102 102 <!-- 占位符 -->
103   - <view class="order-detail-bottom">
  103 + <view class="order-detail-bottom" v-if="dataGram.garOrderDisposalStatus === 1">
104 104 <view class="order-detail-bottom-box">
105   - <view class=" order-detail-bottom-left">
106   - </view>
  105 + <u-button @click="handlerOrderSuccess(orderId)" shape="square" color="#19a97c" text="完成订单"></u-button>
107 106 </view>
108 107 </view>
109 108 </view>
110 109 </template>
111 110  
112 111 <script setup>
113   -import { queryOrderTransportDetail } from '@/apis/order.js';
  112 +import { queryOrderTransportDetail, successOrder } from '@/apis/order.js';
114 113 import zStatic from '@/components/z-paging/js/z-paging-static';
115 114 import { onLoad, onShow } from '@dcloudio/uni-app';
116 115 import { ref } from 'vue';
... ... @@ -132,6 +131,27 @@ const goTransportDetail = (val) =&gt; {
132 131 })
133 132 }
134 133  
  134 +const handlerOrderSuccess = (orderId) => {
  135 + // 提示
  136 + uni.showModal({
  137 + title: '提示',
  138 + content: '是否确认完成订单?',
  139 + success: function (res) {
  140 + if (res.confirm) {
  141 + // 确认
  142 + handlerOrderSuccessIn(orderId)
  143 + }
  144 + }
  145 + })
  146 +}
  147 +const handlerOrderSuccessIn = (orderId) => {
  148 + successOrder({ garOrderId: orderId }).then(res => {
  149 + //返回上一个页面
  150 + uni.navigateBack({
  151 + delta: 1
  152 + })
  153 + })
  154 +}
135 155 const handleOrderDetail = (orderId) => {
136 156 queryOrderTransportDetail(orderId).then(res => {
137 157 dataGram.value = res.data.data;
... ... @@ -340,4 +360,47 @@ $custom-bottom-height: 200rpx;
340 360 align-items: center;
341 361 justify-content: center;
342 362 }
  363 +
  364 +.order-detail-bottom {
  365 + position: absolute;
  366 + width: 100%;
  367 + // height: 100%;
  368 + bottom: 0;
  369 + left: 0;
  370 +
  371 + .movableAreaDetail {
  372 + pointer-events: none;
  373 + position: fixed;
  374 + left: 0;
  375 + top: 0;
  376 + width: 100%;
  377 + height: calc(100% - $custom-bottom-height);
  378 + z-index: 999;
  379 +
  380 + .movableView {
  381 + pointer-events: auto;
  382 + min-height: 60rpx;
  383 + min-width: 60rpx;
  384 +
  385 + .order-detail-call-box-container {
  386 + min-height: 60rpx;
  387 + min-width: 60rpx;
  388 + display: flex;
  389 + align-items: center;
  390 + justify-content: center;
  391 + background-color: #19a97c;
  392 + border-radius: 100%;
  393 + }
  394 + }
  395 + }
  396 +
  397 + .order-detail-bottom-box {
  398 + height: $custom-bottom-height;
  399 + padding: 50rpx;
  400 + box-sizing: border-box;
  401 + display: flex;
  402 + justify-content: space-between;
  403 + align-items: center;
  404 + }
  405 +}
343 406 </style>
... ...
garbage-removal/src/pages/order/other-home/detail/index.vue
... ... @@ -193,7 +193,8 @@
193 193 <view class=" order-detail-bottom-left">
194 194 <u-button v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.garCancelFlag === 0"
195 195 @click="handleOderCancelClick()" shape="square" color="#19a97c" text="取消订单"></u-button>
196   - <u-button v-if="dataGram.garOrderScanHandlerFlag === 0 && userType == '用户' && dataGram.garCancelFlag === 0"
  196 + <u-button
  197 + v-if="dataGram.garOrderScanHandlerFlag === 0 && userType == '用户' && dataGram.garOrderHandlerStatus != 3"
197 198 @click="handlerUpdateOrderClick()" shape="square" color="#19a97c" text="修改车辆信息"></u-button>
198 199 <u-button v-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人'"
199 200 @click="handleOrderDispatchClick(orderId)" shape="square" color="#19a97c" text="分配驾驶员"></u-button>
... ... @@ -292,10 +293,6 @@ const list = computed(() =&gt; {
292 293 reason.unshift({
293 294 name: '长时间无人接单',
294 295 })
295   - } else {
296   - reason.unshift({
297   - name: '无修改权限'
298   - })
299 296 }
300 297 return reason
301 298 })
... ...
garbage-removal/src/pages/order/other-home/swiper-list-item/index.vue
... ... @@ -17,6 +17,8 @@
17 17 </view>
18 18 <view v-if="item.garEvaluateFlag === 0 && userType === '用户'" class="right">待评价
19 19 </view>
  20 + <view v-if="item.garTimeOutFlag === 1" class="right" style="color: red;">超时取消
  21 + </view>
20 22 <view v-if="item.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人'" class="right">待评价
21 23 </view>
22 24 <view v-if="item.garEvaluateFlag === 1 && userType === '用户'" class="right">已评价
... ... @@ -88,26 +90,31 @@ const userType = computed(() =&gt; store.userType)
88 90 const currentCancelOrderId = ref("");
89 91 const currentCancelName = ref("");
90 92 const cancelShow = ref(false)
91   -const list = ref([
92   - {
93   - name: '长时间无人接单',
94   - },
95   - {
96   - name: '订单信息填写有误',
97   - },
98   - {
99   - name: '线下协商有问题',
100   - },
101   - {
102   - name: '不需要清运了',
103   - },
104   - {
105   - name: '其他',
106   - },
107   - {
108   - name: '提交',
  93 +const list = computed(() => {
  94 + let reason = [
  95 + {
  96 + name: '订单信息填写有误',
  97 + },
  98 + {
  99 + name: '线下协商有问题',
  100 + },
  101 + {
  102 + name: '不需要清运了',
  103 + },
  104 + {
  105 + name: '其他',
  106 + },
  107 + {
  108 + name: '提交',
  109 + }
  110 + ]
  111 + if (userType.value === '用户') {
  112 + reason.unshift({
  113 + name: '长时间无人接单',
  114 + })
109 115 }
110   -])
  116 + return reason
  117 +})
111 118 const dataList = ref([]);
112 119 const paging = ref(null);
113 120 const firstLoaded = ref(false)
... ...
garbage-removal/src/pages/order/other-home/user-message/index.vue
... ... @@ -5,12 +5,12 @@
5 5 <u-button color="#19a97c" size="mini" @click="handlerReadAllClick">全部删除</u-button>
6 6 </view>
7 7 </view>
8   - <z-paging ref="paging" v-model="messageList" :fixed="false" @query="queryList">
  8 + <z-paging ref="paging" v-model="messageList" :scrollable="false" :fixed="false" @query="queryList">
9 9 <empty-view slot:empty></empty-view>
10 10 <view class="message-list-item" v-for="(item, index) in messageList" :key="item.id">
11 11 <view class="message-list-item-main">
12 12 <view class="message-list-item-main-content">
13   - {{ item.garContent }}
  13 + <text selectable='true'>{{ item.garContent }}</text>
14 14 </view>
15 15 <u-icon name="close-circle" @click="handlerReadClick(item.garId)" color="red"></u-icon>
16 16 </view>
... ... @@ -83,14 +83,18 @@ onLoad(() =&gt; {
83 83 .message-container {
84 84 width: 100%;
85 85 height: 100%;
  86 + background-color: white;
86 87 box-sizing: border-box;
87   - background: linear-gradient(to bottom, #19a97c, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color, $u-bg-color);
88 88  
89 89 .message-list-item {
90   - line-height: 80rpx;
  90 + margin: 20rpx 0;
91 91 padding: 20rpx;
92 92 box-sizing: border-box;
93   -
  93 + color: $u-tips-color;
  94 + font-size: 23rpx;
  95 + line-height: 30rpx;
  96 + padding: 15rpx;
  97 + word-break: break-all;
94 98  
95 99 .message-list-item-main {
96 100 display: flex;
... ...
garbage-removal/src/static/image/freecompress-swiper-1.png 0 → 100644

8.79 KB

garbage-removal/src/static/image/freecompress-swiper-2.jpg 0 → 100644

15 KB

garbage-removal/src/uview-plus/components/u-picker-column/u-picker-column.vue
... ... @@ -7,23 +7,23 @@
7 7 </template>
8 8  
9 9 <script>
10   - import props from './props.js';
11   - import mpMixin from '../../libs/mixin/mpMixin.js';
12   - import mixin from '../../libs/mixin/mixin.js';
13   - /**
14   - * PickerColumn
15   - * @description
16   - * @tutorial url
17   - * @property {String}
18   - * @event {Function}
19   - * @example
20   - */
21   - export default {
22   - name: 'u-picker-column',
23   - mixins: [mpMixin, mixin, props],
24   - }
  10 +import mixin from '../../libs/mixin/mixin.js';
  11 +import mpMixin from '../../libs/mixin/mpMixin.js';
  12 +import props from './props.js';
  13 +/**
  14 + * PickerColumn
  15 + * @description
  16 + * @tutorial url
  17 + * @property {String}
  18 + * @event {Function}
  19 + * @example
  20 + */
  21 +export default {
  22 + name: 'u-picker-column',
  23 + mixins: [mpMixin, mixin, props],
  24 +}
25 25 </script>
26 26  
27 27 <style lang="scss" scoped>
28   - @import "../../libs/css/components.scss";
  28 +@import "../../libs/css/components.scss";
29 29 </style>
... ...
garbage-removal/src/uview-plus/components/u-picker/u-picker.vue
... ... @@ -5,15 +5,15 @@
5 5 :confirmText="confirmText" :title="title" @cancel="cancel" @confirm="confirm"></u-toolbar>
6 6 <picker-view class="u-picker__view" :indicatorStyle="`height: ${$u.addUnit(itemHeight)}`" :value="innerIndex"
7 7 :immediateChange="immediateChange" :style="{
8   - height: `${$u.addUnit(visibleItemCount * itemHeight)}`
9   - }" @change="changeHandler">
  8 + height: `${$u.addUnit(visibleItemCount * itemHeight)}`
  9 + }" @change="changeHandler">
10 10 <picker-view-column v-for="(item, index) in innerColumns" :key="index" class="u-picker__view__column">
11 11 <text v-if="$u.test.array(item)" class="u-picker__view__column__item u-line-1" v-for="(item1, index1) in item"
12 12 :key="index1" :style="{
13   - height: $u.addUnit(itemHeight),
14   - lineHeight: $u.addUnit(itemHeight),
15   - fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
16   - }">{{ getItemText(item1) }}</text>
  13 + height: $u.addUnit(itemHeight),
  14 + lineHeight: $u.addUnit(itemHeight),
  15 + fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
  16 + }">{{ getItemText(item1) }}</text>
17 17 </picker-view-column>
18 18 </picker-view>
19 19 <view v-if="loading" class="u-picker--loading">
... ...