MrShi
2025-07-19 e17698d3d99039b1c3532d490687f8492ca87704
small-program/pages/freight/freight.vue
@@ -6,6 +6,8 @@
               <view class="list-item-label-x"></view>
               <text>车辆及路线</text>
            </view>
            <template v-if="!(info.type !== 2 && info.status === 2)">
            <view class="list-item-row" @click="show = true">
               <view class="list-item-row-label">车辆类型<b>*</b></view>
               <view class="list-item-row-val">
@@ -20,6 +22,8 @@
                  <u-icon name="arrow-right" color="#111111" size="16"></u-icon>
               </view>
            </view>
            </template>
            <view class="list-item-row" @click="show2 = true">
               <view class="list-item-row-label">用车时间<b>*</b></view>
               <view class="list-item-row-val">
@@ -27,6 +31,8 @@
                  <u-icon name="arrow-right" color="#111111" size="16"></u-icon>
               </view>
            </view>
            <template v-if="!(info.type !== 2 && info.status === 2)">
            <view class="list-item-row">
               <view class="list-item-row-label">
                  运货地址<b>*</b>
@@ -59,7 +65,10 @@
                  </view>
               </view>
            </view>
            </template>
         </view>
         <template v-if="!(info.type !== 2 && info.status === 2)">
         <view class="list-item">
            <view class="list-item-label">
               <view class="list-item-label-x"></view>
@@ -97,7 +106,7 @@
               <view class="list-item-row-label">图片</view>
               <view class="list-item-row-upload">
                  <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index">
                     <image :src="item.url" mode="widthFix"></image>
                        <image :src="item.url || item.fileurlFull" mode="widthFix"></image>
                     <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image>
                  </view>
                  <view class="upload-item" @click="uploadImg">
@@ -153,6 +162,7 @@
               </view>
            </view>
         </view>
         </template>
      </view>
      <view style="width: 100%; height: calc(214rpx + env(safe-area-inset-bottom));"></view>
      <view class="footer">
@@ -228,12 +238,14 @@
      },
      data() {
         return {
            info: {},
            show: false,
            show1: false,
            show2: false,
            show3: false,
            show4: false,
            form: {
               id: null,
               startDate: '',
               endDate: '',
               lat: '',
@@ -284,7 +296,25 @@
            }
         }
      },
      onLoad() {
      onLoad(option) {
         if (option.id) {
            this.form.id = option.id
            this.$u.api.getDetail({
               orderId: option.id
            }).then(res => {
               this.info = res.data
               for (const key in this.form) {
                  this.form[key] = res.data[key]
               }
               this.form.price = Number(this.form.price) / 100
               if (!this.form.multifileList) {
                  this.form.multifileList = []
               }
               if (!this.form.wayInfoDTOList) {
                  this.form.wayInfoDTOList = []
               }
            })
         } else {
         const res = uni.getStorageSync('carData');
         this.form.linkPhone = this.userInfo.telephone
         this.form.startDate = res.startDate
@@ -300,6 +330,7 @@
         this.form.locationEnd = res.locationEnd
         this.form.wayInfoDTOList = res.wayInfoDTOList
         uni.removeStorageSync('carData');
         }
         this.getCategoryLists()
      },
      methods: {
@@ -349,6 +380,7 @@
            })
         },
         uploadImg() {
            var that = this;
            uni.chooseImage({
               success: (chooseImageRes) => {
                  const tempFilePaths = chooseImageRes.tempFilePaths;
@@ -361,7 +393,7 @@
                     },
                     success: (uploadFileRes) => {
                        const res = JSON.parse(uploadFileRes.data)
                        this.form.multifileList.push({
                        that.form.multifileList.push({
                           fileurl: res.data.imgaddr,
                           name: res.data.originname,
                           url: res.data.url,