| | |
| | | /* harmony import */ var _luggage_storage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./luggage-storage.vue?vue&type=script&lang=js& */ 207); |
| | | /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _luggage_storage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _luggage_storage_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); |
| | | /* harmony import */ var _luggage_storage_vue_vue_type_style_index_0_id_c13e4c60_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./luggage-storage.vue?vue&type=style&index=0&id=c13e4c60&lang=scss&scoped=true& */ 209); |
| | | /* harmony import */ var _HBuilderX_3_8_12_20230817_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../办公/HBuilderX.3.8.12.20230817/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 38); |
| | | /* harmony import */ var _HBuilderX_3_8_12_20230817_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../办公/HBuilderX.3.8.12.20230817/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 41); |
| | | |
| | | var renderjs |
| | | |
| | |
| | | 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 */ 233)) |
| | | 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 */ 297)) |
| | | }, |
| | | uDatetimePicker: function () { |
| | | return Promise.all(/*! import() | node-modules/uview-ui/components/u-datetime-picker/u-datetime-picker */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-datetime-picker/u-datetime-picker")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-datetime-picker/u-datetime-picker.vue */ 390)) |
| | | }, |
| | | uPopup: function () { |
| | | return Promise.all(/*! import() | node-modules/uview-ui/components/u-popup/u-popup */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-popup/u-popup.vue */ 242)) |
| | | return Promise.all(/*! import() | node-modules/uview-ui/components/u-popup/u-popup */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-popup/u-popup.vue */ 306)) |
| | | }, |
| | | } |
| | | } catch (e) { |
| | |
| | | var _vm = this |
| | | var _h = _vm.$createElement |
| | | var _c = _vm._self._c || _h |
| | | var l0 = _vm.__map(_vm.goodsOptions, function (item, __i4__) { |
| | | var $orig = _vm.__get_orig(item) |
| | | var g0 = _vm.tempSelectedGoodsIds.includes(item.id) |
| | | return { |
| | | $orig: $orig, |
| | | g0: g0, |
| | | } |
| | | }) |
| | | if (!_vm._isMounted) { |
| | | _vm.e0 = function ($event, item) { |
| | | _vm.e0 = function ($event) { |
| | | _vm.showArriveTimePicker = true |
| | | } |
| | | _vm.e1 = function ($event) { |
| | | _vm.showPickupTimePicker = true |
| | | } |
| | | _vm.e2 = function ($event) { |
| | | _vm.showArriveTimePicker = false |
| | | } |
| | | _vm.e3 = function ($event) { |
| | | _vm.showArriveTimePicker = false |
| | | } |
| | | _vm.e4 = function ($event) { |
| | | _vm.showPickupTimePicker = false |
| | | } |
| | | _vm.e5 = function ($event) { |
| | | _vm.showPickupTimePicker = false |
| | | } |
| | | _vm.e6 = function ($event) { |
| | | _vm.showGoodsPopup = true |
| | | } |
| | | _vm.e7 = function ($event, item) { |
| | | var _temp = arguments[arguments.length - 1].currentTarget.dataset, |
| | | _temp2 = _temp.eventParams || _temp["event-params"], |
| | | item = _temp2.item |
| | | var _temp, _temp2 |
| | | _vm.selectedServiceTime = item.id |
| | | } |
| | | _vm.e1 = function ($event) { |
| | | _vm.e8 = function ($event) { |
| | | _vm.showStorePopup = false |
| | | } |
| | | _vm.e2 = function ($event) { |
| | | _vm.e9 = function ($event) { |
| | | _vm.showStorePopup = false |
| | | } |
| | | _vm.e3 = function ($event, item) { |
| | | _vm.e10 = function ($event, index) { |
| | | var _temp3 = arguments[arguments.length - 1].currentTarget.dataset, |
| | | _temp4 = _temp3.eventParams || _temp3["event-params"], |
| | | item = _temp4.item |
| | | index = _temp4.index |
| | | var _temp3, _temp4 |
| | | _vm.tempSelectedStoreId = item.id |
| | | _vm.storeList.forEach(function (row, i) { |
| | | return (row.active = index === i) |
| | | }) |
| | | } |
| | | _vm.e4 = function ($event) { |
| | | _vm.e11 = function ($event) { |
| | | _vm.showGoodsPopup = false |
| | | } |
| | | _vm.e5 = function ($event) { |
| | | _vm.e12 = function ($event) { |
| | | _vm.showGoodsPopup = false |
| | | } |
| | | _vm.e6 = function ($event) { |
| | | _vm.e13 = function ($event, index) { |
| | | var _temp5 = arguments[arguments.length - 1].currentTarget.dataset, |
| | | _temp6 = _temp5.eventParams || _temp5["event-params"], |
| | | index = _temp6.index |
| | | var _temp5, _temp6 |
| | | _vm.goodsOptions.forEach(function (row, i) { |
| | | return (row.active = i === index) |
| | | }) |
| | | } |
| | | _vm.e14 = function ($event) { |
| | | _vm.showAmountPopup = false |
| | | } |
| | | _vm.e7 = function ($event) { |
| | | _vm.e15 = function ($event) { |
| | | _vm.showAmountPopup = false |
| | | } |
| | | } |
| | | _vm.$mp.data = Object.assign( |
| | | {}, |
| | | { |
| | | $root: { |
| | | l0: l0, |
| | | }, |
| | | } |
| | | ) |
| | | } |
| | | var recyclableRender = false |
| | | var staticRenderFns = [] |
| | |
| | | value: true |
| | | }); |
| | | exports.default = void 0; |
| | | var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 34)); |
| | | var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18)); |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 36)); |
| | | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11)); |
| | | var _vuex = __webpack_require__(/*! vuex */ 37); |
| | | 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 = { |
| | | data: function data() { |
| | | return { |
| | | showStorePopup: false, |
| | | showGoodsPopup: false, |
| | | showAmountPopup: false, |
| | | showArriveTimePicker: false, |
| | | showPickupTimePicker: false, |
| | | arriveTimeValue: Number(new Date()), |
| | | pickupTimeValue: Number(new Date()), |
| | | activeMode: 'local', |
| | | modeTabs: [{ |
| | | label: '就地寄存', |
| | |
| | | value: 'city' |
| | | }], |
| | | agreementChecked: true, |
| | | storeKeyword: '', |
| | | tempSelectedStoreId: 2, |
| | | selectedStoreId: 2, |
| | | tempSelectedGoodsIds: [1], |
| | | selectedGoodsIds: [1], |
| | | selectedLuggageId: 1, |
| | | selectedServiceTime: 1, |
| | | luggageCountMap: { |
| | | 1: 1, |
| | | 2: 1, |
| | | 3: 0 |
| | | }, |
| | | form: { |
| | | receiver: '蔡子瑄', |
| | | mobile: '18166525368', |
| | | arriveTime: '2026-04-15 16:30', |
| | | pickupTime: '2026-04-17 16:30', |
| | | insurance: '200', |
| | | remark: '' |
| | | receiver: '', |
| | | mobile: '', |
| | | arriveTime: '', |
| | | pickupTime: '', |
| | | goodType: '', |
| | | goodTypeName: '', |
| | | insurance: '', |
| | | remark: '', |
| | | goodsImages: [] |
| | | }, |
| | | luggageTypes: [{ |
| | | id: 1, |
| | | name: '大件行李箱', |
| | | size: '24-28寸' |
| | | }, { |
| | | id: 2, |
| | | name: '中件行李箱', |
| | | size: '24-28寸' |
| | | }, { |
| | | id: 3, |
| | | name: '小件行李箱', |
| | | size: '24-28寸' |
| | | }], |
| | | amountData: null, |
| | | luggageTypes: [], |
| | | serviceTimes: [{ |
| | | id: 1, |
| | | name: '标准达(预计6小时内送达)', |
| | |
| | | name: '急速达(预计4小时内送达)', |
| | | price: '¥70' |
| | | }], |
| | | storeList: [{ |
| | | id: 1, |
| | | name: '中铁快运南站旗舰店', |
| | | address: '合肥南站负一层100号', |
| | | time: '周一至周日 7:00~23:00', |
| | | distance: '239m' |
| | | }, { |
| | | id: 2, |
| | | name: '中铁快运合肥火车站', |
| | | address: '合肥火车站一层12号', |
| | | time: '周一至周日 7:00~23:00', |
| | | distance: '12.8km' |
| | | }, { |
| | | id: 3, |
| | | name: '合肥火车站北广场', |
| | | address: '合肥火车站一层12号', |
| | | time: '周一至周日 7:00~23:00', |
| | | distance: '13.1km' |
| | | }, { |
| | | id: 4, |
| | | name: '小铁无忧存', |
| | | address: '合肥火车站一层12号', |
| | | time: '周一至周日 7:00~23:00', |
| | | distance: '16.3km' |
| | | }, { |
| | | id: 5, |
| | | name: '中铁快运合肥火车站', |
| | | address: '合肥火车站一层12号', |
| | | time: '周一至周日 7:00~23:00', |
| | | distance: '20.8km' |
| | | }], |
| | | goodsOptions: [{ |
| | | id: 1, |
| | | name: '文件' |
| | | }, { |
| | | id: 2, |
| | | name: '衣服' |
| | | }, { |
| | | id: 3, |
| | | name: '滑雪板' |
| | | }, { |
| | | id: 4, |
| | | name: '发票' |
| | | }, { |
| | | id: 5, |
| | | name: '手机' |
| | | }, { |
| | | id: 6, |
| | | name: '电脑' |
| | | }, { |
| | | id: 7, |
| | | name: '鞋子' |
| | | }, { |
| | | id: 8, |
| | | name: '护肤品' |
| | | }, { |
| | | id: 9, |
| | | name: '白酒' |
| | | }, { |
| | | id: 10, |
| | | name: '鞋子' |
| | | }, { |
| | | id: 11, |
| | | name: '护肤品' |
| | | }, { |
| | | id: 12, |
| | | name: '白酒' |
| | | }, { |
| | | id: 13, |
| | | name: '鞋子' |
| | | }, { |
| | | id: 14, |
| | | name: '护肤品' |
| | | }, { |
| | | id: 15, |
| | | name: '白酒' |
| | | }], |
| | | amountDetails: [{ |
| | | label: '大件行李箱', |
| | | count: 1, |
| | | value: '¥35' |
| | | }, { |
| | | label: '中件行李箱', |
| | | count: 1, |
| | | value: '¥35' |
| | | }, { |
| | | label: '寄存天数', |
| | | count: '', |
| | | value: '2天' |
| | | }, { |
| | | label: '行李保价', |
| | | count: '', |
| | | value: '¥10' |
| | | }], |
| | | uploadedImages: [{ |
| | | url: '/static/icon/nav_home_sel@2x.png' |
| | | }, { |
| | | url: '/static/icon/nav_xingcheng_sel@2x.png' |
| | | }] |
| | | storeList: [], |
| | | selectedStore: null, |
| | | storeForm: { |
| | | keyword: '', |
| | | page: 1, |
| | | isSearch: true |
| | | }, |
| | | goodsOptions: [], |
| | | uploadedImages: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | selectedStore: function selectedStore() { |
| | | var _this = this; |
| | | return this.storeList.find(function (item) { |
| | | return item.id === _this.selectedStoreId; |
| | | }) || null; |
| | | }, |
| | | watch: { |
| | | 'form.insurance': { |
| | | handler: function handler() { |
| | | this.calculateLocalPrice(); |
| | | } |
| | | } |
| | | }, |
| | | computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(['latitude', 'longitude', 'cityId'])), {}, { |
| | | servicePointPlaceholder: function servicePointPlaceholder() { |
| | | return this.activeMode === 'city' ? '选择寄送服务点' : '选择寄存服务点'; |
| | | }, |
| | | filteredStores: function filteredStores() { |
| | | var keyword = (this.storeKeyword || '').trim(); |
| | | if (!keyword) { |
| | | return this.storeList; |
| | | } |
| | | return this.storeList.filter(function (item) { |
| | | return item.name.includes(keyword) || item.address.includes(keyword); |
| | | }); |
| | | }, |
| | | selectedGoodsText: function selectedGoodsText() { |
| | | var _this2 = this; |
| | | var _this = this; |
| | | if (!this.selectedGoodsIds.length) { |
| | | return '必选,请选择'; |
| | | } |
| | | var labels = this.goodsOptions.filter(function (item) { |
| | | return _this2.selectedGoodsIds.includes(item.id); |
| | | return _this.selectedGoodsIds.includes(item.id); |
| | | }).map(function (item) { |
| | | return item.name; |
| | | }); |
| | |
| | | totalPriceText: function totalPriceText() { |
| | | return '¥150.00'; |
| | | } |
| | | }), |
| | | onLoad: function onLoad() { |
| | | this.getNearbyShopList(); |
| | | this.getCategoryList(); |
| | | this.getCitySizeList(); |
| | | }, |
| | | methods: { |
| | | uploadFiles: function uploadFiles(filePaths) { |
| | | var _arguments = arguments, |
| | | _this2 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { |
| | | var maxCount, limitedPaths, uploadTasks, results; |
| | | return _regenerator.default.wrap(function _callee$(_context) { |
| | | while (1) { |
| | | switch (_context.prev = _context.next) { |
| | | case 0: |
| | | maxCount = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : 9; |
| | | if (!(!filePaths || filePaths.length === 0)) { |
| | | _context.next = 3; |
| | | break; |
| | | } |
| | | return _context.abrupt("return", []); |
| | | case 3: |
| | | limitedPaths = filePaths.slice(0, maxCount); |
| | | uploadTasks = limitedPaths.map(function (filePath) { |
| | | return new Promise(function (resolve, reject) { |
| | | uni.uploadFile({ |
| | | url: _this2.$baseUrl + '/web/public/upload', |
| | | filePath: filePath, |
| | | name: 'file', |
| | | formData: { |
| | | folder: 'orders' |
| | | }, |
| | | success: function success(res) { |
| | | if (res.statusCode === 200) { |
| | | var data = JSON.parse(res.data); |
| | | if (data.code === 200) { |
| | | resolve(data.data); |
| | | } else { |
| | | reject(new Error(data.msg || '上传失败')); |
| | | } |
| | | } else { |
| | | reject(new Error('上传失败')); |
| | | } |
| | | }, |
| | | fail: function fail(err) { |
| | | reject(err); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | _context.prev = 5; |
| | | _context.next = 8; |
| | | return Promise.all(uploadTasks); |
| | | case 8: |
| | | results = _context.sent; |
| | | return _context.abrupt("return", results); |
| | | case 12: |
| | | _context.prev = 12; |
| | | _context.t0 = _context["catch"](5); |
| | | uni.showToast({ |
| | | title: '上传失败', |
| | | icon: 'none' |
| | | }); |
| | | throw _context.t0; |
| | | case 16: |
| | | case "end": |
| | | return _context.stop(); |
| | | } |
| | | } |
| | | }, _callee, null, [[5, 12]]); |
| | | }))(); |
| | | }, |
| | | deleteImage: function deleteImage(index) { |
| | | this.uploadedImages.splice(index, 1); |
| | | this.form.goodsImages.splice(index, 1); |
| | | }, |
| | | chooseAndUploadImage: function chooseAndUploadImage() { |
| | | var _arguments2 = arguments, |
| | | _this3 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() { |
| | | var maxCount, currentCount, remainingCount; |
| | | return _regenerator.default.wrap(function _callee3$(_context3) { |
| | | while (1) { |
| | | switch (_context3.prev = _context3.next) { |
| | | case 0: |
| | | maxCount = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : 9; |
| | | currentCount = _this3.form.goodsImages.length; |
| | | remainingCount = maxCount - currentCount; |
| | | if (!(remainingCount <= 0)) { |
| | | _context3.next = 6; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: "\u6700\u591A\u4E0A\u4F20".concat(maxCount, "\u5F20\u56FE\u7247"), |
| | | icon: 'none' |
| | | }); |
| | | return _context3.abrupt("return"); |
| | | case 6: |
| | | uni.chooseImage({ |
| | | count: remainingCount, |
| | | sizeType: ['compressed'], |
| | | sourceType: ['album', 'camera'], |
| | | success: function () { |
| | | var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(res) { |
| | | var tempFilePaths, uploadResults, fullPaths; |
| | | return _regenerator.default.wrap(function _callee2$(_context2) { |
| | | while (1) { |
| | | switch (_context2.prev = _context2.next) { |
| | | case 0: |
| | | tempFilePaths = res.tempFilePaths; |
| | | uni.showLoading({ |
| | | title: '上传中...', |
| | | mask: true |
| | | }); |
| | | _context2.prev = 2; |
| | | _context2.next = 5; |
| | | return _this3.uploadFiles(tempFilePaths, maxCount); |
| | | case 5: |
| | | uploadResults = _context2.sent; |
| | | fullPaths = uploadResults.map(function (item) { |
| | | return item.url || item.path || item; |
| | | }); |
| | | _this3.uploadedImages = [].concat((0, _toConsumableArray2.default)(_this3.uploadedImages), (0, _toConsumableArray2.default)(fullPaths.map(function (url) { |
| | | return { |
| | | url: url |
| | | }; |
| | | }))); |
| | | _this3.form.goodsImages = [].concat((0, _toConsumableArray2.default)(_this3.form.goodsImages), (0, _toConsumableArray2.default)(fullPaths)); |
| | | uni.hideLoading(); |
| | | uni.showToast({ |
| | | title: '上传成功', |
| | | icon: 'success' |
| | | }); |
| | | _context2.next = 16; |
| | | break; |
| | | case 13: |
| | | _context2.prev = 13; |
| | | _context2.t0 = _context2["catch"](2); |
| | | uni.hideLoading(); |
| | | case 16: |
| | | case "end": |
| | | return _context2.stop(); |
| | | } |
| | | } |
| | | }, _callee2, null, [[2, 13]]); |
| | | })); |
| | | function success(_x) { |
| | | return _success.apply(this, arguments); |
| | | } |
| | | return success; |
| | | }() |
| | | }); |
| | | case 7: |
| | | case "end": |
| | | return _context3.stop(); |
| | | } |
| | | } |
| | | }, _callee3); |
| | | }))(); |
| | | }, |
| | | searchStore: function searchStore() { |
| | | this.storeList = []; |
| | | this.storeForm.page = 1; |
| | | this.storeForm.isSearch = true; |
| | | this.getNearbyShopList(); |
| | | }, |
| | | switchMode: function switchMode(mode) { |
| | | this.activeMode = mode; |
| | | }, |
| | |
| | | this.showAmountPopup = true; |
| | | }, |
| | | openStorePopup: function openStorePopup() { |
| | | this.tempSelectedStoreId = this.selectedStoreId; |
| | | this.tempSelectedStoreId = null; |
| | | this.showStorePopup = true; |
| | | }, |
| | | confirmStore: function confirmStore() { |
| | | this.selectedStoreId = this.tempSelectedStoreId; |
| | | this.selectedStore = this.storeList.find(function (item) { |
| | | return item.active; |
| | | }); |
| | | this.showStorePopup = false; |
| | | }, |
| | | openGoodsPopup: function openGoodsPopup() { |
| | | this.tempSelectedGoodsIds = (0, _toConsumableArray2.default)(this.selectedGoodsIds); |
| | | this.showGoodsPopup = true; |
| | | }, |
| | | toggleGoods: function toggleGoods(id) { |
| | | if (this.tempSelectedGoodsIds.includes(id)) { |
| | | this.tempSelectedGoodsIds = this.tempSelectedGoodsIds.filter(function (item) { |
| | | return item !== id; |
| | | }); |
| | | return; |
| | | } |
| | | this.tempSelectedGoodsIds = [].concat((0, _toConsumableArray2.default)(this.tempSelectedGoodsIds), [id]); |
| | | this.calculateLocalPrice(); |
| | | }, |
| | | confirmGoods: function confirmGoods() { |
| | | this.selectedGoodsIds = (0, _toConsumableArray2.default)(this.tempSelectedGoodsIds); |
| | | var _this$goodsOptions$fi, _this$goodsOptions$fi2; |
| | | this.form.goodTypeName = ((_this$goodsOptions$fi = this.goodsOptions.find(function (item) { |
| | | return item.active; |
| | | })) === null || _this$goodsOptions$fi === void 0 ? void 0 : _this$goodsOptions$fi.name) || ''; |
| | | this.form.goodType = ((_this$goodsOptions$fi2 = this.goodsOptions.find(function (item) { |
| | | return item.active; |
| | | })) === null || _this$goodsOptions$fi2 === void 0 ? void 0 : _this$goodsOptions$fi2.id) || ''; |
| | | this.showGoodsPopup = false; |
| | | }, |
| | | selectLuggage: function selectLuggage(id) { |
| | | this.selectedLuggageId = id; |
| | | confirmArriveTime: function confirmArriveTime(e) { |
| | | var date = new Date(e.value); |
| | | var year = date.getFullYear(); |
| | | var month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | var day = String(date.getDate()).padStart(2, '0'); |
| | | var hour = String(date.getHours()).padStart(2, '0'); |
| | | var minute = String(date.getMinutes()).padStart(2, '0'); |
| | | this.form.arriveTime = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hour, ":").concat(minute); |
| | | this.showArriveTimePicker = false; |
| | | this.calculateLocalPrice(); |
| | | }, |
| | | increaseCount: function increaseCount(id) { |
| | | var current = this.luggageCountMap[id] || 0; |
| | | this.$set(this.luggageCountMap, id, current + 1); |
| | | confirmPickupTime: function confirmPickupTime(e) { |
| | | var date = new Date(e.value); |
| | | var year = date.getFullYear(); |
| | | var month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | var day = String(date.getDate()).padStart(2, '0'); |
| | | var hour = String(date.getHours()).padStart(2, '0'); |
| | | var minute = String(date.getMinutes()).padStart(2, '0'); |
| | | this.form.pickupTime = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hour, ":").concat(minute); |
| | | this.showPickupTimePicker = false; |
| | | this.calculateLocalPrice(); |
| | | }, |
| | | decreaseCount: function decreaseCount(id) { |
| | | var current = this.luggageCountMap[id] || 0; |
| | | if (current <= 0) { |
| | | return; |
| | | // 物品分类 |
| | | getCategoryList: function getCategoryList() { |
| | | var _this4 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() { |
| | | var res; |
| | | return _regenerator.default.wrap(function _callee4$(_context4) { |
| | | while (1) { |
| | | switch (_context4.prev = _context4.next) { |
| | | case 0: |
| | | _context4.next = 2; |
| | | return _this4.$u.api.getCategoryList({ |
| | | type: 2 |
| | | }); |
| | | case 2: |
| | | res = _context4.sent; |
| | | if (res.code === 200) { |
| | | res.data.forEach(function (item) { |
| | | item.active = false; |
| | | }); |
| | | _this4.goodsOptions = res.data || []; |
| | | } |
| | | case 4: |
| | | case "end": |
| | | return _context4.stop(); |
| | | } |
| | | } |
| | | }, _callee4); |
| | | }))(); |
| | | }, |
| | | getCitySizeList: function getCitySizeList() { |
| | | var _this5 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() { |
| | | var res; |
| | | return _regenerator.default.wrap(function _callee5$(_context5) { |
| | | while (1) { |
| | | switch (_context5.prev = _context5.next) { |
| | | case 0: |
| | | _context5.next = 2; |
| | | return _this5.$u.api.getCitySizeList({ |
| | | cityId: _this5.cityId |
| | | }); |
| | | case 2: |
| | | res = _context5.sent; |
| | | if (res.code === 200) { |
| | | res.data.forEach(function (item) { |
| | | item.count = 0; |
| | | }); |
| | | _this5.luggageTypes = res.data || []; |
| | | } |
| | | case 4: |
| | | case "end": |
| | | return _context5.stop(); |
| | | } |
| | | } |
| | | }, _callee5); |
| | | }))(); |
| | | }, |
| | | getNearbyShopList: function getNearbyShopList() { |
| | | var _this6 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() { |
| | | var res; |
| | | return _regenerator.default.wrap(function _callee6$(_context6) { |
| | | while (1) { |
| | | switch (_context6.prev = _context6.next) { |
| | | case 0: |
| | | if (_this6.storeForm.isSearch) { |
| | | _context6.next = 2; |
| | | break; |
| | | } |
| | | return _context6.abrupt("return"); |
| | | case 2: |
| | | _context6.next = 4; |
| | | return _this6.$u.api.getNearbyShopList({ |
| | | capacity: 10, |
| | | page: _this6.storeForm.page, |
| | | model: { |
| | | latitude: _this6.latitude, |
| | | longitude: _this6.longitude, |
| | | cityId: _this6.cityId, |
| | | sortType: 1 |
| | | } |
| | | }); |
| | | case 4: |
| | | res = _context6.sent; |
| | | if (res.code === 200) { |
| | | res.data.records.forEach(function (item) { |
| | | item.active = false; |
| | | }); |
| | | _this6.storeList = [].concat((0, _toConsumableArray2.default)(_this6.storeList), (0, _toConsumableArray2.default)(res.data.records || [])); |
| | | _this6.storeForm.page++; |
| | | _this6.storeForm.isSearch = _this6.storeList.length <= res.data.total; |
| | | } |
| | | case 6: |
| | | case "end": |
| | | return _context6.stop(); |
| | | } |
| | | } |
| | | }, _callee6); |
| | | }))(); |
| | | }, |
| | | increaseCount: function increaseCount(index) { |
| | | this.luggageTypes[index].count++; |
| | | this.calculateLocalPrice(); |
| | | }, |
| | | decreaseCount: function decreaseCount(index) { |
| | | if (this.luggageTypes[index].count > 0) { |
| | | this.luggageTypes[index].count--; |
| | | } |
| | | this.$set(this.luggageCountMap, id, current - 1); |
| | | this.calculateLocalPrice(); |
| | | }, |
| | | calculateLocalPrice: function calculateLocalPrice() { |
| | | var _this7 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() { |
| | | var luggageList, res; |
| | | return _regenerator.default.wrap(function _callee7$(_context7) { |
| | | while (1) { |
| | | switch (_context7.prev = _context7.next) { |
| | | case 0: |
| | | if (!(!_this7.selectedStore || !_this7.form.arriveTime || !_this7.form.pickupTime)) { |
| | | _context7.next = 2; |
| | | break; |
| | | } |
| | | return _context7.abrupt("return"); |
| | | case 2: |
| | | luggageList = _this7.luggageTypes.filter(function (item) { |
| | | return item.count > 0; |
| | | }).map(function (item) { |
| | | return { |
| | | categoryId: item.id, |
| | | quantity: item.count |
| | | }; |
| | | }); |
| | | if (!(luggageList.length === 0)) { |
| | | _context7.next = 5; |
| | | break; |
| | | } |
| | | return _context7.abrupt("return"); |
| | | case 5: |
| | | _context7.next = 7; |
| | | return _this7.$u.api.calculateLocalPrice({ |
| | | cityId: _this7.cityId, |
| | | shopId: _this7.selectedStore.id, |
| | | depositStartTime: _this7.form.arriveTime + ':00', |
| | | depositEndTime: _this7.form.pickupTime + ':00', |
| | | items: luggageList, |
| | | declaredAmount: _this7.form.insurance || 0 |
| | | }); |
| | | case 7: |
| | | res = _context7.sent; |
| | | if (res.code === 200) { |
| | | res.data.itemList.forEach(function (item) { |
| | | item.unitPrice = item.unitPrice / 100; |
| | | }); |
| | | res.data.totalPrice = res.data.totalPrice / 100; |
| | | _this7.amountData = res.data; |
| | | } |
| | | case 9: |
| | | case "end": |
| | | return _context7.stop(); |
| | | } |
| | | } |
| | | }, _callee7); |
| | | }))(); |
| | | }, |
| | | createOrder: function createOrder() { |
| | | var _this8 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() { |
| | | var luggageList, items, res; |
| | | return _regenerator.default.wrap(function _callee8$(_context8) { |
| | | while (1) { |
| | | switch (_context8.prev = _context8.next) { |
| | | case 0: |
| | | if (_this8.selectedStore) { |
| | | _context8.next = 3; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请选择门店', |
| | | icon: 'none' |
| | | }); |
| | | return _context8.abrupt("return"); |
| | | case 3: |
| | | if (_this8.form.arriveTime) { |
| | | _context8.next = 6; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请选择预计到店时间', |
| | | icon: 'none' |
| | | }); |
| | | return _context8.abrupt("return"); |
| | | case 6: |
| | | if (_this8.form.pickupTime) { |
| | | _context8.next = 9; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请选择预计取件时间', |
| | | icon: 'none' |
| | | }); |
| | | return _context8.abrupt("return"); |
| | | case 9: |
| | | luggageList = _this8.luggageTypes.filter(function (item) { |
| | | return item.count > 0; |
| | | }).map(function (item) { |
| | | return { |
| | | categoryId: item.id, |
| | | quantity: item.count |
| | | }; |
| | | }); |
| | | if (!(luggageList.length === 0)) { |
| | | _context8.next = 13; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请选择行李类型', |
| | | icon: 'none' |
| | | }); |
| | | return _context8.abrupt("return"); |
| | | case 13: |
| | | items = luggageList.map(function (item) { |
| | | return { |
| | | categoryId: item.categoryId, |
| | | quantity: item.quantity |
| | | }; |
| | | }); |
| | | _context8.next = 16; |
| | | return _this8.$u.api.createOrder({ |
| | | cityId: _this8.cityId, |
| | | declaredAmount: _this8.form.insurance || 0, |
| | | depositShopId: _this8.selectedStore.id, |
| | | expectedDepositTime: _this8.form.arriveTime + ':00', |
| | | expectedTakeTime: _this8.form.pickupTime + ':00', |
| | | goodType: _this8.form.goodType, |
| | | goodsImages: _this8.form.goodsImages, |
| | | items: items, |
| | | remark: _this8.form.remark, |
| | | takePhone: _this8.form.mobile, |
| | | takeUser: _this8.form.receiver, |
| | | type: _this8.activeMode === 'local' ? 0 : 1 |
| | | }); |
| | | case 16: |
| | | res = _context8.sent; |
| | | if (res.code === 200) { |
| | | uni.showToast({ |
| | | title: '下单成功', |
| | | icon: 'success' |
| | | }); |
| | | if (res.data) { |
| | | _this8.processPayment(res.data.response); |
| | | } |
| | | } |
| | | case 18: |
| | | case "end": |
| | | return _context8.stop(); |
| | | } |
| | | } |
| | | }, _callee8); |
| | | }))(); |
| | | }, |
| | | processPayment: function processPayment(paymentData) { |
| | | uni.requestPayment({ |
| | | provider: 'wxpay', |
| | | timeStamp: paymentData.timeStamp || '', |
| | | nonceStr: paymentData.nonceStr || '', |
| | | package: paymentData.packageValue || '', |
| | | signType: paymentData.signType || 'MD5', |
| | | paySign: paymentData.paySign || '', |
| | | success: function success(res) { |
| | | uni.showToast({ |
| | | title: '支付成功', |
| | | icon: 'success' |
| | | }); |
| | | }, |
| | | fail: function fail(err) { |
| | | if (err.errMsg.includes('cancel')) { |
| | | uni.showToast({ |
| | | title: '已取消支付', |
| | | icon: 'none' |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: '支付失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |