From 22603b2519b8dcb7f9a7c7d9ba636d9aba240a59 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 18 七月 2025 09:15:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
small-program/pages/index/index.vue | 193 ++++++++++++++++++++++++++++++++---------------
1 files changed, 130 insertions(+), 63 deletions(-)
diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 02cd67c..e775a3e 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -323,10 +323,10 @@
</view>
<view class="box-hz-list-item" @click="selectAddress(1)">
<view class="box-hz-list-item-label"><text>鐢ㄥ伐鍦扮偣锛�</text></view>
- <view :class="form.address ? 'box-hz-list-item-val active' :'box-hz-list-item-val'">
+ <view :class="form.location ? 'box-hz-list-item-val active' :'box-hz-list-item-val'">
<view class="box-hz-list-item-val-left">
<image class="icon" src="/static/icon/ic_location@2x.png" mode="widthFix"></image>
- <text>{{form.address ? form.address : '璇烽�夋嫨鐢ㄥ伐鍦扮偣'}}</text>
+ <text>{{form.location ? form.location : '璇烽�夋嫨鐢ㄥ伐鍦扮偣'}}</text>
</view>
<u-icon name="arrow-right" color="#111111" size="16"></u-icon>
</view>
@@ -337,65 +337,64 @@
<!-- 杩愯揣 -->
<template v-if="typeId === 1">
<view class="box-hz-cate">
- <view :class="carId === item.id ? 'box-hz-cate-item active' : 'box-hz-cate-item'" v-for="(item, index) in car" :key="index" @click="clickCar(item.id)">
+ <view :class="form.categoryId === item.id ? 'box-hz-cate-item active' : 'box-hz-cate-item'" v-for="(item, index) in car" :key="index" @click="clickCar(item)">
<text>{{item.name}}</text>
- <view class="box-hz-cate-item-x" v-if="carId === item.id"></view>
+ <view class="box-hz-cate-item-x" v-if="form.categoryId === item.id"></view>
</view>
</view>
<view class="box-hz-car">
<view class="box-hz-car-image">
- <image src="/static/image/ic_sanlunche@2x.png" mode="widthFix" v-if="carId === 1"></image>
- <image src="/static/image/ic_xiaohuoche@2x.png" mode="widthFix" v-else-if="carId === 2"></image>
+ <image :src="carImage" mode="widthFix"></image>
</view>
- <view class="box-hz-car-info" v-if="carId === 1">
- 鍘㈤暱3.8锝�4.0绫� 杞介噸1.5锝�2.0鍚� 杞芥柟12.3锝�18.4鏂�
- </view>
- <view class="box-hz-car-info" v-else-if="carId === 2">
- 鍘㈤暱3.8锝�4.0绫� 杞介噸1.5锝�2.0鍚� 杞芥柟12.3锝�18.4鏂�
+ <view class="box-hz-car-info" v-if="carRemark">
+ {{carRemark || ''}}
</view>
</view>
<view class="box-hz-list">
- <view class="box-hz-list-item">
+ <view class="box-hz-list-item" @click="show = true">
<view class="box-hz-list-item-label"><text>鐢ㄨ溅鏃堕棿锛�</text></view>
- <view class="box-hz-list-item-val">
+ <view :class="form.startDate ? 'box-hz-list-item-val active' : 'box-hz-list-item-val'">
<view class="box-hz-list-item-val-left">
<image class="icon" src="/static/icon/ic_time@2x.png" mode="widthFix"></image>
- <text>璇烽�夋嫨鐢ㄨ溅鏃堕棿</text>
+ <text>{{ form.startDate ? form.startDate + ' 鑷� ' + form.endDate : '璇烽�夋嫨鐢ㄥ伐鏃堕棿'}}</text>
</view>
- <image class="icon1" src="/static/icon/home_ar_next@2x.png" mode="widthFix"></image>
+ <u-icon name="arrow-right" color="#111111" size="16"></u-icon>
</view>
</view>
<view class="box-hz-list-item">
<view class="box-hz-list-item-label">
<text>鐢ㄨ溅鏃堕棿锛�</text>
- <text>+澧炲姞閫旂粡鐐�</text>
+ <text @click="addAddr">+澧炲姞閫旂粡鐐�</text>
</view>
<view class="item-d">
- <view class="item-d-row">
+ <view class="item-d-row" @click="selectAddress(2)">
<view class="item-d-row-icon">
<image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image>
</view>
<view class="item-d-row-val">
- <text>璇烽�夋嫨鐢ㄨ溅璧风偣</text>
- <image src="/static/icon/home_ar_next@2x.png" mode="widthFix"></image>
+ <text>{{form.address ? form.address : '璇烽�夋嫨鐢ㄨ溅璧风偣'}}</text>
+ <u-icon name="arrow-right" color="#111111" size="16"></u-icon>
</view>
</view>
- <view class="item-d-row">
+ <view class="item-d-row" v-for="(item, index) in form.wayInfoDTOList" :key="index" @click="selectAddress(4, index)">
<view class="item-d-row-icon">
<image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image>
</view>
<view class="item-d-row-val">
- <text style="color: #999999;">璇烽�夋嫨閫旂粡鍦扮偣</text>
- <image src="/static/icon/home_ar_next@2x.png" mode="widthFix"></image>
+ <text>{{item.location ? item.location : '璇烽�夋嫨閫旂粡鍦扮偣'}}</text>
+ <view style="display: flex; align-items: center; flex-shrink: 0;">
+ <image src="/static/icon/ic_delete@2x.png" style="margin-right: 22rpx; width: 32rpx; height: 32rpx;" @click.stop="form.wayInfoDTOList.splice(index, 1)" mode="widthFix"></image>
+ <u-icon name="arrow-right" color="#111111" size="16"></u-icon>
+ </view>
</view>
</view>
- <view class="item-d-row">
+ <view class="item-d-row" @click="selectAddress(3)">
<view class="item-d-row-icon">
<image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image>
</view>
<view class="item-d-row-val">
- <text>璇烽�夋嫨鐢ㄨ溅缁堢偣</text>
- <image src="/static/icon/home_ar_next@2x.png" mode="widthFix"></image>
+ <text>{{form.locationEnd ? form.locationEnd : '璇烽�夋嫨鐢ㄨ溅缁堢偣'}}</text>
+ <u-icon name="arrow-right" color="#111111" size="16"></u-icon>
</view>
</view>
</view>
@@ -439,7 +438,6 @@
show: false,
isLogin: false,
typeId: 0,
- carId: 1,
type: [
{ name: '鐢ㄥ伐', id: 0 },
{ name: '杩愯揣', id: 1 },
@@ -450,47 +448,62 @@
{ name: '鍒嗘嫞宸�', id: 1 },
{ name: '鍖呰宸�', id: 2 }
],
- car: [
- { name: '涓夎疆杞�', id: 1 },
- { name: '灏忚揣杞�', id: 2 }
- ],
+ car: [],
btn: require('@/static/image/btn.png'),
typeViewId: 0,
+ carImage: '',
+ carRemark: '',
form: {
startDate: '',
endDate: '',
latitude: '',
longitude: '',
- address: '',
+ location: '',
+ locationEnd: '',
+ wayInfoDTOList: [],
workType: 0,
+ categoryId: '',
+ categoryName: '',
days: ''
}
}
},
+ onLoad() {
+ this.getCategoryLists()
+ },
methods: {
+ addAddr() {
+ this.form.wayInfoDTOList.push({
+ lat: '',
+ lgt: '',
+ location: ''
+ })
+ },
confirmDate(e) {
this.form.startDate = e[0]
this.form.endDate = e[e.length - 1]
this.form.days = e.length;
this.show = false
},
- selectAddress(type) {
+ selectAddress(type, index) {
uni.chooseLocation({
success: (res) => {
- if (type === 1) {
+ if ([1,2].includes(type)) {
this.form.latitude = res.latitude
this.form.longitude = res.longitude
this.form.address = res.address
+ } else if (type === 3) {
+ this.form.locationEnd = res.address
+ this.form.latEnd = res.latitude
+ this.form.lgtEnd = res.longitude
+ } else if (type === 4) {
+ this.form.wayInfoDTOList[0].lat = res.latitude
+ this.form.wayInfoDTOList[0].lgt = res.longitude
+ this.form.wayInfoDTOList[0].location = res.address
}
}
});
- // uni.getLocation({
- // type: 'gcj02',
- // success: function (res) {
- // console.log(res)
- // }
- // });
},
clickType(e) {
this.typeId = e
@@ -498,8 +511,11 @@
clickTypeWork(e) {
this.form.workType = e
},
- clickCar(e) {
- this.carId = e
+ clickCar(item) {
+ this.form.categoryId = item.id
+ this.form.categoryName = item.name
+ this.carImage = item.iconFull
+ this.carRemark = item.remark
},
jump() {
if(!this.userInfo || !this.token){
@@ -511,31 +527,76 @@
const { form } = this;
- if (!form.startDate || !form.endDate) {
- return uni.showToast({ title: '璇烽�夋嫨鐢ㄥ伐鏃堕棿', icon: 'none' })
- } else if (!form.latitude || !form.longitude) {
- return uni.showToast({ title: '璇烽�夋嫨鐢ㄥ伐鍦扮偣', icon: 'none' })
- }
-
- // 閲囨憳宸�
- if (this.form.workType === 0) {
+ // 鐢ㄥ伐
+ if (this.typeId === 0) {
+
+ if (!form.startDate || !form.endDate) {
+ return uni.showToast({ title: '璇烽�夋嫨鐢ㄥ伐鏃堕棿', icon: 'none' })
+ } else if (!form.latitude || !form.longitude) {
+ return uni.showToast({ title: '璇烽�夋嫨鐢ㄥ伐鍦扮偣', icon: 'none' })
+ }
+
+ // 閲囨憳宸�
+ if (this.form.workType === 0) {
+ uni.navigateTo({
+ url: `/pages/using-workers/using-workers?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}`
+ })
+ // 鍒嗘嫞宸�
+ } else if (this.form.workType === 1) {
+ uni.navigateTo({
+ url: `/pages/sorting/sorting?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}`
+ })
+ // 鍖呰宸�
+ } else if (this.form.workType === 2) {
+ uni.navigateTo({
+ url: `/pages/packaging-worker/packaging-worker?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}`
+ })
+ }
+ // 杩愯揣
+ } else if (this.typeId === 1) {
+
+ if (!form.startDate || !form.endDate) {
+ return uni.showToast({ title: '璇烽�夋嫨鐢ㄨ溅鏃堕棿', icon: 'none' })
+ } else if (!form.latitude || !form.longitude) {
+ return uni.showToast({ title: '璇烽�夋嫨鐢ㄨ溅璧风偣', icon: 'none' })
+ } else if (!form.latEnd || !form.lgtEnd) {
+ return uni.showToast({ title: '璇烽�夋嫨鐢ㄨ溅缁堢偣', icon: 'none' })
+ }
+
+ let carData = {
+ startDate: form.startDate,
+ endDate: form.endDate,
+ lat: form.latitude,
+ lgt: form.longitude,
+ location: form.address,
+ latEnd: form.latEnd,
+ lgtEnd: form.lgtEnd,
+ locationEnd: form.locationEnd,
+ wayInfoDTOList: form.wayInfoDTOList,
+ categoryId: form.categoryId,
+ categoryName: form.categoryName,
+ days: form.days
+ }
+
+ uni.setStorageSync('carData', carData);
+
uni.navigateTo({
- url: `/pages/using-workers/using-workers?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}`
- })
- // 鍒嗘嫞宸�
- } else if (this.form.workType === 1) {
- uni.navigateTo({
- url: `/pages/sorting/sorting?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}`
- })
- // 鍖呰宸�
- } else if (this.form.workType === 2) {
- uni.navigateTo({
- url: `/pages/packaging-worker/packaging-worker?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}`
+ url: `/pages/freight/freight`
})
}
},
mverify(e){
console.log('楠岃瘉缁撴灉:',e);
+ },
+ getCategoryLists() {
+ this.$u.api.getCategoryList({ type: 1 })
+ .then(res => {
+ this.car = res.data
+ this.form.categoryId = res.data[0].id
+ this.form.categoryName = res.data[0].name
+ this.carRemark = res.data[0].remark
+ this.carImage = res.data[0].iconFull
+ })
}
}
}
@@ -1179,9 +1240,12 @@
.box-hz-car-image {
width: 432rpx;
height: 200rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
image {
width: 100%;
- height: 100%;
}
}
.box-hz-car-info {
@@ -1244,7 +1308,8 @@
border: 2rpx solid #FD9E24;
.item-d-row {
width: 100%;
- height: 100rpx;
+ // height: 100rpx;
+ height: auto;
display: flex;
align-items: center;
justify-content: space-between;
@@ -1260,7 +1325,9 @@
}
.item-d-row-val {
flex: 1;
- height: 100%;
+ // height: 100%;
+ padding: 30rpx 0;
+ box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
--
Gitblit v1.9.3