MrShi
2025-08-21 a223d5e29e9384f720ae98c44cbe10f8fa4f73e7
small-program/pages/freight/freight.vue
@@ -126,7 +126,7 @@
                  <text>费用</text>
               </view>
               <view class="list-item-cate">
                  <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">按天付费</view>
                  <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">{{item.name}}</view>
               </view>
               <view class="list-item-row">
                  <view class="list-item-row-label">天数</view>
@@ -302,16 +302,18 @@
            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 = []
               if (res.code === 200) {
                  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 {
@@ -355,29 +357,63 @@
            if (!this.form.linkPhone) {
               return uni.showToast({ title: '请输入联系电话', icon: 'none' })
            }
            this.$u.api.release({
               ...this.form,
               price: Number(this.form.price) * 100,
               wayInfoDTOList: [
                  {
                     lat: this.form.lat,
                     lgt: this.form.lgt,
                     location: this.form.location
                  },
                  ...this.form.wayInfoDTOList,
                  {
                     lat: this.form.latEnd,
                     lgt: this.form.lgtEnd,
                     location: this.form.locationEnd
            if (!this.form.id) {
               this.$u.api.release({
                  ...this.form,
                  price: Number(this.form.price) * 100,
                  wayInfoDTOList: [
                     {
                        lat: this.form.lat,
                        lgt: this.form.lgt,
                        location: this.form.location
                     },
                     ...this.form.wayInfoDTOList,
                     {
                        lat: this.form.latEnd,
                        lgt: this.form.lgtEnd,
                        location: this.form.locationEnd
                     }
                  ]
               }).then(res => {
                  if (res.code == 200) {
                     uni.navigateTo({
                        url: `/pages/success/success?orderId=${res.data.id}`
                     })
                  }
               ]
            }).then(res => {
               if (res.code == 200) {
                  uni.navigateTo({
                     url: `/pages/success/success?orderId=${res.data.id}`
                  })
               }
            })
               })
            } else {
               this.$u.api.updateOrder({
                  ...this.form,
                  price: Number(this.form.price) * 100,
                  wayInfoDTOList: [
                     {
                        lat: this.form.lat,
                        lgt: this.form.lgt,
                        location: this.form.location
                     },
                     ...this.form.wayInfoDTOList,
                     {
                        lat: this.form.latEnd,
                        lgt: this.form.lgtEnd,
                        location: this.form.locationEnd
                     }
                  ]
               }).then(res => {
                  if (res.code == 200) {
                     uni.showToast({
                        title: '编辑成功',
                        icon: 'success',
                        mask: true,
                        duration: 2000
                     })
                     setTimeout(() => {
                        uni.navigateBack({ delta: 1 });
                        // uni.$emit('refresh')
                     }, 1500)
                  }
               })
            }
         },
         uploadImg() {
            var that = this;
@@ -414,23 +450,31 @@
                  priceNum2: this.form.priceNum2,
                  type: 1
               }).then(res => {
                  this.form.estimatedAccount = res.data
                  if (res.code === 200) {
                     this.form.estimatedAccount = res.data
                  }
               })
            }
         },
         getCategoryLists() {
            this.$u.api.getCategoryList({ type: 1 })
               .then(res => {
                  this.car = [res.data]
                  res.data.forEach(item => {
                     if (item.id === this.form.categoryId) {
                        this.carArr = [item.detailList]
                     }
                  })
                  if (res.code === 200) {
                     this.car = [res.data]
                     res.data.forEach(item => {
                        if (item.id === this.form.categoryId) {
                           this.carArr = [item.detailList]
                        }
                     })
                  }
               })
            this.$u.api.getCategoryList({ type: 0 })
               .then(res => {
                  this.variety = [res.data]
                  if (res.code === 200) {
                     this.variety = [res.data]
                  }
               })
         },
         confirmCategary(e) {