From de1ef43c565e1666484d7d71203afd7526f4e3de Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 18 七月 2025 08:53:43 +0800
Subject: [PATCH] 用工运货接口对接

---
 small-program/unpackage/dist/dev/mp-weixin/pages/freight/freight.js |  475 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 318 insertions(+), 157 deletions(-)

diff --git a/small-program/unpackage/dist/dev/mp-weixin/pages/freight/freight.js b/small-program/unpackage/dist/dev/mp-weixin/pages/freight/freight.js
index d4d2a90..589ad5d 100644
--- a/small-program/unpackage/dist/dev/mp-weixin/pages/freight/freight.js
+++ b/small-program/unpackage/dist/dev/mp-weixin/pages/freight/freight.js
@@ -103,7 +103,13 @@
 try {
   components = {
     uIcon: function () {
-      return Promise.all(/*! import() | node-modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-icon/u-icon.vue */ 379))
+      return Promise.all(/*! import() | node-modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-icon/u-icon.vue */ 387))
+    },
+    uPicker: function () {
+      return Promise.all(/*! import() | node-modules/uview-ui/components/u-picker/u-picker */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-picker/u-picker")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-picker/u-picker.vue */ 423))
+    },
+    uCalendar: function () {
+      return Promise.all(/*! import() | node-modules/uview-ui/components/u-calendar/u-calendar */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-calendar/u-calendar")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-calendar/u-calendar.vue */ 396))
     },
   }
 } catch (e) {
@@ -127,6 +133,63 @@
   var _vm = this
   var _h = _vm.$createElement
   var _c = _vm._self._c || _h
+  if (!_vm._isMounted) {
+    _vm.e0 = function ($event) {
+      _vm.show = true
+    }
+    _vm.e1 = function ($event) {
+      _vm.show3 = true
+    }
+    _vm.e2 = function ($event) {
+      _vm.show2 = true
+    }
+    _vm.e3 = function ($event, index) {
+      var _temp = arguments[arguments.length - 1].currentTarget.dataset,
+        _temp2 = _temp.eventParams || _temp["event-params"],
+        index = _temp2.index
+      var _temp, _temp2
+      $event.stopPropagation()
+      return _vm.form.wayInfoDTOList.splice(index, 1)
+    }
+    _vm.e4 = function ($event) {
+      _vm.show1 = true
+    }
+    _vm.e5 = function ($event) {
+      _vm.show4 = true
+    }
+    _vm.e6 = function ($event, index) {
+      var _temp3 = arguments[arguments.length - 1].currentTarget.dataset,
+        _temp4 = _temp3.eventParams || _temp3["event-params"],
+        index = _temp4.index
+      var _temp3, _temp4
+      return _vm.form.multifileList.splice(index, 1)
+    }
+    _vm.e7 = function ($event) {
+      _vm.viewStatus = !_vm.viewStatus
+    }
+    _vm.e8 = function ($event, item) {
+      var _temp5 = arguments[arguments.length - 1].currentTarget.dataset,
+        _temp6 = _temp5.eventParams || _temp5["event-params"],
+        item = _temp6.item
+      var _temp5, _temp6
+      _vm.form.carType = item.id
+    }
+    _vm.e9 = function ($event) {
+      _vm.show = false
+    }
+    _vm.e10 = function ($event) {
+      _vm.show1 = false
+    }
+    _vm.e11 = function ($event) {
+      _vm.show3 = false
+    }
+    _vm.e12 = function ($event) {
+      _vm.show4 = false
+    }
+    _vm.e13 = function ($event) {
+      _vm.show2 = false
+    }
+  }
 }
 var recyclableRender = false
 var staticRenderFns = []
@@ -160,172 +223,270 @@
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
+/* WEBPACK VAR INJECTION */(function(uni) {
 
-
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.default = void 0;
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
+var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
+var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
+var _vuex = __webpack_require__(/*! vuex */ 33);
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
 var _default = {
+  computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(['userInfo'])), {}, {
+    totalPrice: function totalPrice() {
+      return this.form.estimatedAccount / 100;
+    }
+  }),
   data: function data() {
-    return {};
+    return {
+      show: false,
+      show1: false,
+      show2: false,
+      show3: false,
+      show4: false,
+      form: {
+        startDate: '',
+        endDate: '',
+        lat: '',
+        lgt: '',
+        location: '',
+        latEnd: '',
+        lgtEnd: '',
+        locationEnd: '',
+        carUnit: '',
+        categoryId: '',
+        categoryName: '',
+        wayInfoDTOList: [],
+        priceNum1: '',
+        priceNum2: 1,
+        transportNum: '',
+        transportTypeId: '',
+        transportTypeName: '',
+        carType: 0,
+        supplement: '',
+        multifileList: [],
+        priceUnit: '鍏�/澶�',
+        linkName: '',
+        linkPhone: '',
+        price: '',
+        type: 1,
+        transportUnit: '涓�',
+        estimatedAccount: ''
+      },
+      car: [],
+      variety: [],
+      ff: [{
+        name: '鎸夊ぉ浠樿垂',
+        id: 0
+      }, {
+        name: '鎸夋浠樿垂',
+        id: 1
+      }],
+      dw: [['涓�', '鏂�']],
+      carArr: [],
+      viewStatus: false
+    };
+  },
+  watch: {
+    'form.carType': {
+      handler: function handler(news, olds) {
+        if (news === 0) {
+          this.form.priceUnit = '鍏�/澶�';
+        } else if (news === 1) {
+          this.form.priceUnit = '鍏�/娆�';
+        }
+      }
+    }
+  },
+  onLoad: function onLoad() {
+    var res = uni.getStorageSync('carData');
+    this.form.linkPhone = this.userInfo.telephone;
+    this.form.startDate = res.startDate;
+    this.form.endDate = res.endDate;
+    this.form.lat = res.lat;
+    this.form.lgt = res.lgt;
+    this.form.priceNum1 = res.days;
+    this.form.categoryId = res.categoryId;
+    this.form.categoryName = res.categoryName;
+    this.form.location = res.location;
+    this.form.latEnd = res.latEnd;
+    this.form.lgtEnd = res.lgtEnd;
+    this.form.locationEnd = res.locationEnd;
+    this.form.wayInfoDTOList = res.wayInfoDTOList;
+    uni.removeStorageSync('carData');
+    this.getCategoryLists();
+  },
+  methods: {
+    confirmDw: function confirmDw(e) {
+      this.form.transportUnit = e.value[0];
+      this.show4 = false;
+    },
+    // 鎻愪氦璁㈠崟
+    submit: function submit() {
+      if (!this.form.transportTypeName) {
+        return uni.showToast({
+          title: '璇烽�夋嫨杩愯緭鍝佺',
+          icon: 'none'
+        });
+      }
+      if (!this.form.priceNum2) {
+        return uni.showToast({
+          title: '璇疯緭鍏ョ敤杞︽暟閲�',
+          icon: 'none'
+        });
+      }
+      if (!this.form.transportNum) {
+        return uni.showToast({
+          title: '璇疯緭鍏ヨ繍杈撻噸閲�/鏁伴噺',
+          icon: 'none'
+        });
+      }
+      if (!this.form.price) {
+        return uni.showToast({
+          title: '璇疯緭鍏ヨ垂鐢ㄦ爣鍑�',
+          icon: 'none'
+        });
+      }
+      if (!this.form.linkPhone) {
+        return uni.showToast({
+          title: '璇疯緭鍏ヨ仈绯荤數璇�',
+          icon: 'none'
+        });
+      }
+      this.$u.api.release(_objectSpread(_objectSpread({}, this.form), {}, {
+        price: Number(this.form.price) * 100,
+        wayInfoDTOList: [{
+          lat: this.form.lat,
+          lgt: this.form.lgt,
+          location: this.form.location
+        }].concat((0, _toConsumableArray2.default)(this.form.wayInfoDTOList), [{
+          lat: this.form.latEnd,
+          lgt: this.form.lgtEnd,
+          location: this.form.locationEnd
+        }])
+      })).then(function (res) {
+        if (res.code == 200) {
+          uni.navigateTo({
+            url: "/pages/success/success?orderId=".concat(res.data.id)
+          });
+        }
+      });
+    },
+    uploadImg: function uploadImg() {
+      var _this = this;
+      uni.chooseImage({
+        success: function success(chooseImageRes) {
+          var tempFilePaths = chooseImageRes.tempFilePaths;
+          uni.uploadFile({
+            url: _this.$baseUrl + '/web/public/upload',
+            filePath: tempFilePaths[0],
+            name: 'file',
+            formData: {
+              'folder': 'orders'
+            },
+            success: function success(uploadFileRes) {
+              var res = JSON.parse(uploadFileRes.data);
+              _this.form.multifileList.push({
+                fileurl: res.data.imgaddr,
+                name: res.data.originname,
+                url: res.data.url,
+                type: 0
+              });
+            }
+          });
+        }
+      });
+    },
+    // 璁$畻閲戦
+    getPrice: function getPrice() {
+      var _this2 = this;
+      if (this.form.price && this.form.priceNum1 && this.form.priceNum2) {
+        this.$u.api.getTotal({
+          price: Number(this.form.price) * 100,
+          priceUnit: this.form.priceUnit,
+          priceNum1: this.form.priceNum1,
+          priceNum2: this.form.priceNum2,
+          type: 1
+        }).then(function (res) {
+          _this2.form.estimatedAccount = res.data;
+        });
+      }
+    },
+    getCategoryLists: function getCategoryLists() {
+      var _this3 = this;
+      this.$u.api.getCategoryList({
+        type: 1
+      }).then(function (res) {
+        _this3.car = [res.data];
+        res.data.forEach(function (item) {
+          if (item.id === _this3.form.categoryId) {
+            _this3.carArr = [item.detailList];
+          }
+        });
+      });
+      this.$u.api.getCategoryList({
+        type: 0
+      }).then(function (res) {
+        _this3.variety = [res.data];
+      });
+    },
+    confirmCategary: function confirmCategary(e) {
+      this.form.categoryId = e.value[0].id;
+      this.form.categoryName = e.value[0].name;
+      this.carArr = [e.value[0].detailList];
+      this.form.carUnit = '';
+      this.show = false;
+    },
+    confirmVariety: function confirmVariety(e) {
+      this.form.transportTypeId = e.value[0].id;
+      this.form.transportTypeName = e.value[0].name;
+      this.show1 = false;
+    },
+    confirmCarArr: function confirmCarArr(e) {
+      this.form.carUnit = e.value[0];
+      this.show3 = false;
+    },
+    confirmDate: function confirmDate(e) {
+      this.form.startDate = e[0];
+      this.form.endDate = e[e.length - 1];
+      this.form.priceNum1 = e.length;
+      this.show2 = false;
+    },
+    addAddr: function addAddr() {
+      this.form.wayInfoDTOList.push({
+        lat: '',
+        lgt: '',
+        location: ''
+      });
+    },
+    selectAddress: function selectAddress(type, index) {
+      var _this4 = this;
+      uni.chooseLocation({
+        success: function success(res) {
+          if ([2].includes(type)) {
+            _this4.form.latitude = res.latitude;
+            _this4.form.longitude = res.longitude;
+            _this4.form.address = res.address;
+          } else if (type === 3) {
+            _this4.form.locationEnd = res.address;
+            _this4.form.latEnd = res.latitude;
+            _this4.form.lgtEnd = res.longitude;
+          } else if (type === 4) {
+            _this4.form.wayInfoDTOList[0].lat = res.latitude;
+            _this4.form.wayInfoDTOList[0].lgt = res.longitude;
+            _this4.form.wayInfoDTOList[0].location = res.address;
+          }
+        }
+      });
+    }
   }
 };
 exports.default = _default;
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
 
 /***/ }),
 

--
Gitblit v1.9.3