d第一次提交

This commit is contained in:
dt_2916866708
2024-02-28 17:34:03 +08:00
commit 0689cf2677
1234 changed files with 144804 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
.send-body {
width: 100vw;
height: 100vh;
background-color: #f1f2f7;
box-sizing: border-box;
padding: 30rpx;
.send-footer {
margin-bottom: 20rpx;
.cancel {
width: 194rpx;
height: 88rpx;
background: rgba(0, 125, 255, 0.5);
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
font-size: 32rpx;
color: #ffffff;
}
.submit {
width: 194rpx;
height: 88rpx;
background: #007dff;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
font-size: 32rpx;
color: #ffffff;
}
}
.upload-container {
.upload-tip {
width: 100rpx;
height: 100rpx;
background: #ffffff;
border-radius: 5rpx 5rpx 5rpx 5rpx;
opacity: 1;
// border: 1rpx solid #999999;
text {
font-size: 20rpx;
}
}
.upload-item {
width: 100rpx;
height: 100rpx;
margin-right: 20rpx;
position: relative;
.colse {
position: absolute;
background-color: #e0e0e0;
top: -15rpx;
right: -15rpx;
height: 35rpx;
width: 35rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
}
}
.send-form {
width: 690rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(132, 132, 132, 0.05);
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
padding: 20rpx;
box-sizing: border-box;
.send-form-item {
padding-bottom: 30rpx;
border-bottom: solid 1rpx #f3f5f7;
margin-top: 40rpx;
.send-form-item-value {
font-size: 28rpx;
}
.send-form-item-label {
width: 249rpx;
font-size: 28rpx;
color: #333333;
}
}
.send-form-title {
font-size: 28rpx;
color: #000000;
margin-bottom: 50rpx;
}
}
}

161
Enter/pages/send/index.vue Normal file
View File

@@ -0,0 +1,161 @@
<template>
<view class="send-body flex column">
<order-item v-if="orderData" :order-data='orderData' type="card"></order-item>
<view class="oneflex">
<view class="send-form">
<view class="send-form-title">信息录入</view>
<view class="send-form-item flex ac">
<view class="send-form-item-label"><text style="color: red;">*</text>发货日期</view>
<view class="send-form-item-value oneflex">
<uni-datetime-picker v-model="submitData.departureDate">
{{submitData.departureDate||'选择发货日期'}}
</uni-datetime-picker>
</view>
</view>
<view class="send-form-item flex ac">
<view class="send-form-item-label"><text style="color: red;">*</text>货物重量()</view>
<view class="send-form-item-value oneflex">
<input v-model="submitData.weight" placeholder="请输入货物重量" />
</view>
</view>
<view class="send-form-item flex ac">
<view class="send-form-item-label"> <text style="color: red;">*</text> 发货单</view>
<view class="send-form-item-value oneflex">
<view class="upload-container flex warp ">
<view class="upload-item" :key='index' v-for="(item,index) in submitData.proofsList">
<view @click="imageRemove(submitData.proofsList,index)" class="colse">
<uni-icons type="closeempty" size="15" color="#686868"></uni-icons>
</view>
<image style="width: 100%; height: 100%;" @click="previewImage(submitData.proofsList,index)"
:src="item.imageUrl"> </image>
</view>
<view v-if="submitData.proofsList.length<3" @click="uploadImagesFn"
class="upload-tip flex ac jc column">
<uni-icons type="camera" size="20" color=""></uni-icons>
<text> 最多三张</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="send-footer flex around">
<view @click="cancel" class="cancel flex jc ac">撤单</view>
<view @click="submit" class="submit flex jc ac">提交</view>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
import orderApi from '@/api/order.js'
import orderItem from "@/components/orderItem/orderItem.vue";
export default {
components: {
orderItem
},
data() {
return {
checkPage: {
departureDate: {
tacitly: '',
WrongText: '发货时间不能为空'
},
weight:{
tacitly: '',
custom:/^\d+(?=\.{0,1}\d+$|$)/,
WrongText: '重量不能为空且必须为数字'
},
proofsList:{
minLength:1,
WrongText: '图片不能为空'
}
},
submitData: {
"id": "",
"motion":'1',
"departureDate": "",
"unloadingDate": "",
"weight":"",
"proofsList": []
},
orderData: null,
}
},
onLoad(e) {
if (e.orderData){
this.orderData = JSON.parse(decodeURIComponent(e.orderData));
({id:this.submitData.id=""}=this.orderData);
}
},
methods: {
cancel(){
orderApi.cancelOrder({
"id": this.submitData.id
}).then(res=>{
if(res.code==20000){
uni.showToast({
title:'操作成功',
icon:"success"
});
setTimeout(()=>{
uni.navigateBack()
},1000)
}
})
},
submit() {
let chenkResult = this.tool.checkFn(this.submitData,[],this.checkPage);
if(chenkResult.result){
orderApi.cargoMotion(this.submitData).then(res=>{
if(res.code==20000){
uni.showToast({
icon:"success",
title:"操作成功"
})
setTimeout(()=>{
uni.navigateBack()
},1000)
}
})
}else{
this.$refs.uToast.show({
type: 'error',
icon: false,
title: 'error',
message: chenkResult.WrongText,
})
}
},
imageRemove(uploadImages = this.submitData.proofsList, index) {
this.submitData.proofsList.splice(index, 1);
},
previewImage(uploadImages = this.submitData.proofsList, index = undefined) {
if (index !== undefined && uploadImages[index] !== undefined) {
uni.previewImage({
current: index,
urls:uploadImages.map(item=>item.imageUrl),
longPressActions: {
success: function(data) { },
fail: function(err) { }
}
});
} else {
console.log('数据错误=>', ...arguments)
}
},
uploadImagesFn() {
this.tool.chooseImage((imageUrl) => {
this.submitData.proofsList.push({
imageUrl
});
})
},
}
}
</script>
<style scoped lang="scss">
@import 'index.scss';
</style>