(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages/photo-upload/index"],{

/***/ 339:
/*!*********************************************************************************************!*\
  !*** C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue ***!
  \*********************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=22102fb8&scoped=true& */ 340);
/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ 342);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _index_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 _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&id=22102fb8&scoped=true&lang=css& */ 345);
/* harmony import */ var _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 37);

var renderjs





/* normalize component */

var component = Object(_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  _index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  _index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  false,
  null,
  "22102fb8",
  null,
  false,
  _index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
  renderjs
)

component.options.__file = "pages/photo-upload/index.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 340:
/*!****************************************************************************************************************************************!*\
  !*** C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue?vue&type=template&id=22102fb8&scoped=true& ***!
  \****************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=template&id=22102fb8&scoped=true& */ 341);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_22102fb8_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });



/***/ }),

/***/ 341:
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue?vue&type=template&id=22102fb8&scoped=true& ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
try {
  components = {
    uPopup: function () {
      return Promise.all(/*! import() | uni_modules/uview-ui/components/u-popup/u-popup */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-popup/u-popup.vue */ 347))
    },
    uPicker: function () {
      return Promise.all(/*! import() | uni_modules/uview-ui/components/u-picker/u-picker */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-picker/u-picker")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-picker/u-picker.vue */ 355))
    },
    bcodeCamera: function () {
      return __webpack_require__.e(/*! import() | uni_modules/bcode-camera/components/bcode-camera/bcode-camera */ "uni_modules/bcode-camera/components/bcode-camera/bcode-camera").then(__webpack_require__.bind(null, /*! @/uni_modules/bcode-camera/components/bcode-camera/bcode-camera.vue */ 377))
    },
  }
} catch (e) {
  if (
    e.message.indexOf("Cannot find module") !== -1 &&
    e.message.indexOf(".vue") !== -1
  ) {
    console.error(e.message)
    console.error("1. 排查组件名称拼写是否正确")
    console.error(
      "2. 排查组件是否符合 easycom 规范，文档：https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
    )
    console.error(
      "3. 若组件不符合 easycom 规范，需手动引入，并在 components 中注册该组件"
    )
  } else {
    throw e
  }
}
var render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  var l0 =
    _vm.currentTab === "photo" &&
    !_vm.showBcodeCamera &&
    !_vm.isLoading &&
    !_vm.errorMsg &&
    _vm.authorDropdownVisible
      ? _vm.__map(_vm.authorOptions, function (item, idx) {
          var $orig = _vm.__get_orig(item)
          var g0 = _vm.authorOptions.length
          return {
            $orig: $orig,
            g0: g0,
          }
        })
      : null
  var l1 =
    _vm.currentTab === "photo" &&
    !_vm.showBcodeCamera &&
    !_vm.isLoading &&
    !_vm.errorMsg &&
    _vm.publisherDropdownVisible
      ? _vm.__map(_vm.publisherOptions, function (item, idx) {
          var $orig = _vm.__get_orig(item)
          var g1 = _vm.publisherOptions.length
          return {
            $orig: $orig,
            g1: g1,
          }
        })
      : null
  var l2 =
    _vm.currentTab === "photo" &&
    !_vm.showBcodeCamera &&
    !_vm.isLoading &&
    !_vm.errorMsg &&
    _vm.formatDropdownVisible
      ? _vm.__map(_vm.formatOptions, function (item, idx) {
          var $orig = _vm.__get_orig(item)
          var g2 = _vm.formatOptions.length
          return {
            $orig: $orig,
            g2: g2,
          }
        })
      : null
  var a0 = _vm.showBcodeCamera
    ? {
        scanBox: {
          borderColor: "#007AFF",
          backgroundColor: "rgba(0,0,0,0.1)",
        },
      }
    : null
  if (!_vm._isMounted) {
    _vm.e0 = function ($event) {
      $event.stopPropagation()
      _vm.authorDropdownVisible = !_vm.authorDropdownVisible
    }
    _vm.e1 = function ($event) {
      $event.stopPropagation()
      _vm.publisherDropdownVisible = !_vm.publisherDropdownVisible
    }
    _vm.e2 = function ($event) {
      $event.stopPropagation()
      _vm.formatDropdownVisible = !_vm.formatDropdownVisible
    }
    _vm.e3 = function ($event) {
      _vm.popupDialog.showPicker = true
    }
    _vm.e4 = function ($event) {
      _vm.popupDialog.showPicker = false
    }
    _vm.e5 = function ($event) {
      _vm.printTimeTab = "input"
    }
    _vm.e6 = function ($event) {
      _vm.printTimeTab = "year"
    }
    _vm.e7 = function ($event) {
      _vm.printTimeActiveInput = "year"
    }
    _vm.e8 = function ($event) {
      _vm.printTimeActiveInput = "month"
    }
  }
  _vm.$mp.data = Object.assign(
    {},
    {
      $root: {
        l0: l0,
        l1: l1,
        l2: l2,
        a0: a0,
      },
    }
  )
}
var recyclableRender = false
var staticRenderFns = []
render._withStripped = true



/***/ }),

/***/ 342:
/*!**********************************************************************************************************************!*\
  !*** C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue?vue&type=script&lang=js& ***!
  \**********************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=script&lang=js& */ 343);
/* harmony import */ var _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
 /* harmony default export */ __webpack_exports__["default"] = (_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

/***/ 343:
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue?vue&type=script&lang=js& ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {

var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
var _typeof3 = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 32));
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 34));
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 */ 39);
var selectBookImage = _interopRequireWildcard(__webpack_require__(/*! @/service/selectBookImage.js */ 232));
var bookRecords = _interopRequireWildcard(__webpack_require__(/*! @/service/bookRecords.js */ 233));
var _getAuthorAndPublisher = __webpack_require__(/*! @/service/getAuthorAndPublisher.js */ 344);
var _MemberBookCheck = __webpack_require__(/*! @/components/MemberBookCheck.js */ 218);
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 BookConditionSelect = function BookConditionSelect() {
  __webpack_require__.e(/*! require.ensure | components/BookConditionSelect */ "components/BookConditionSelect").then((function () {
    return resolve(__webpack_require__(/*! @/components/BookConditionSelect.vue */ 391));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var PriceStockControl = function PriceStockControl() {
  __webpack_require__.e(/*! require.ensure | components/PriceStockControl */ "components/PriceStockControl").then((function () {
    return resolve(__webpack_require__(/*! @/components/PriceStockControl.vue */ 384));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var BookProductList = function BookProductList() {
  Promise.all(/*! require.ensure | components/BookProductList */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/BookProductList")]).then((function () {
    return resolve(__webpack_require__(/*! @/components/BookProductList.vue */ 405));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var WarehouseSelector = function WarehouseSelector() {
  __webpack_require__.e(/*! require.ensure | components/WarehouserSelector */ "components/WarehouserSelector").then((function () {
    return resolve(__webpack_require__(/*! @/components/WarehouserSelector.vue */ 398));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var CameraUpload = function CameraUpload() {
  Promise.all(/*! require.ensure | components/CameraUpload */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/CameraUpload")]).then((function () {
    return resolve(__webpack_require__(/*! @/components/CameraUpload.vue */ 363));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var bcodeCamera = function bcodeCamera() {
  __webpack_require__.e(/*! require.ensure | uni_modules/bcode-camera/components/bcode-camera/bcode-camera */ "uni_modules/bcode-camera/components/bcode-camera/bcode-camera").then((function () {
    return resolve(__webpack_require__(/*! @/uni_modules/bcode-camera/components/bcode-camera/bcode-camera.vue */ 377));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var _default = {
  name: 'PhotoUpload',
  components: {
    'book-condition-select': BookConditionSelect,
    'price-stock-control': PriceStockControl,
    'on-sale-products': BookProductList,
    "warehouse-selector": WarehouseSelector,
    "camera-upload": CameraUpload,
    "bcode-camera": bcodeCamera // 注册bcode-camera组件
  },

  props: {
    selectedWarehouse: {
      type: Object,
      default: ''
    }
  },
  computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(['priceMode', 'priceType', 'averageRange', 'selectedPosition', 'freight', 'minValue'])), {}, {
    // 根据相机状态动态设置页面容器样式
    pageContainerStyle: function pageContainerStyle() {
      if (this.showBcodeCamera) {
        return {
          overflow: 'hidden',
          height: '100vh'
        };
      }
      return {};
    },
    hasNormalImages: function hasNormalImages() {
      return this.fileList1.some(function (file) {
        return !file.name || !file.name.startsWith('识图-');
      });
    }
  }),
  watch: {
    displayOnSaleProducts: {
      handler: function handler(newProducts) {
        if (newProducts && newProducts.length > 0) {
          // 更新最低价格
          this.lowestBookPrice = Math.min.apply(Math, (0, _toConsumableArray2.default)(newProducts.map(function (p) {
            return parseFloat(p.bookPrice) || 0;
          })));
          this.lowestTotalPrice = Math.min.apply(Math, (0, _toConsumableArray2.default)(newProducts.map(function (p) {
            return parseFloat(p.totalPrice) || 0;
          })));

          // 调用计算参考价格的方法
          this.calculateReferencePrice();
        }
      },
      immediate: true
    },
    // 监听价格模式和类型变化，重新计算价格
    priceMode: {
      handler: function handler() {
        this.calculateReferencePrice();
      }
    },
    priceType: {
      handler: function handler() {
        this.calculateReferencePrice();
      }
    },
    averageRange: {
      handler: function handler() {
        this.calculateReferencePrice();
      }
    },
    freight: {
      handler: function handler() {
        this.calculateReferencePrice();
      }
    },
    minValue: {
      handler: function handler() {
        this.calculateReferencePrice();
      }
    },
    selectedPosition: {
      handler: function handler() {
        this.calculateReferencePrice();
      }
    }
  },
  data: function data() {
    var _ref;
    return _ref = {
      currentTab: 'photo',
      imageUrl: '',
      isLoading: false,
      errorMsg: '',
      selectedStorage: '',
      warehouse: '',
      shelf: '',
      location: '',
      shelves: [],
      // 货架列表
      locations: [],
      // 货位列表
      LocalWarehouse: this.selectedWarehouse,
      selectedSheId: null,
      selectedFreId: null,
      goodUnifyIsbn: '',
      uploadedImages: [],
      // 存储上传成功的图片信息，用于提交表单时一并传递
      bookInfo: {
        bookName: '',
        author: '',
        publisher: '',
        format: '',
        printTime: '',
        isbn: '',
        price: '',
        wordage: '',
        unifyIsbn: ''
      },
      value4: 1.00,
      // 价格
      value3: 1,
      // 库存
      showSubmitButton: true,
      isSubmitting: false,
      isUploading: false,
      // 新增：用于跟踪图片是否正在上传
      fileList: [],
      fileList1: [],
      compareType: 'isbn',
      onSaleProducts: []
    }, (0, _defineProperty2.default)(_ref, "LocalWarehouse", this.selectedWarehouse), (0, _defineProperty2.default)(_ref, "displayOnSaleProducts", []), (0, _defineProperty2.default)(_ref, "marketTags", [{
      label: '在售:',
      value: 0
    }, {
      label: '旧:',
      value: 0
    }, {
      label: '新:',
      value: 0
    }, {
      label: '已售:',
      value: 0
    }]), (0, _defineProperty2.default)(_ref, "columns", [[], [], []]), (0, _defineProperty2.default)(_ref, "popupDialog", {
      show: false,
      title: '',
      content: '',
      confirmText: '',
      cancelText: '',
      imgSrc: '',
      count: 0,
      subFormData: null,
      showPicker: false,
      selectedSeries: '',
      seriesOptions: ['B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N']
    }), (0, _defineProperty2.default)(_ref, "authorDropdownVisible", false), (0, _defineProperty2.default)(_ref, "publisherDropdownVisible", false), (0, _defineProperty2.default)(_ref, "authorOptions", []), (0, _defineProperty2.default)(_ref, "publisherOptions", []), (0, _defineProperty2.default)(_ref, "formatDropdownVisible", false), (0, _defineProperty2.default)(_ref, "formatOptions", ['16', '32', '24', '36', '40', '42', '48', '50', '60', '64', '72', '2', '4', '6', '8', '12', '18', '20', '大16', '大32', '其他']), (0, _defineProperty2.default)(_ref, "showBcodeCamera", false), (0, _defineProperty2.default)(_ref, "showRecognizing", false), (0, _defineProperty2.default)(_ref, "previewImageUrl", ''), (0, _defineProperty2.default)(_ref, "hasShownUploadMessage", false), (0, _defineProperty2.default)(_ref, "printTimePopupVisible", false), (0, _defineProperty2.default)(_ref, "printTimeTab", 'input'), (0, _defineProperty2.default)(_ref, "printTimeYear", ''), (0, _defineProperty2.default)(_ref, "printTimeMonth", ''), (0, _defineProperty2.default)(_ref, "printTimeActiveInput", 'year'), (0, _defineProperty2.default)(_ref, "autoFillSelected", false), (0, _defineProperty2.default)(_ref, "decades", [{
      label: '1950年代',
      value: '195'
    }, {
      label: '1960年代',
      value: '196'
    }, {
      label: '1970年代',
      value: '197'
    }, {
      label: '1980年代',
      value: '198'
    }, {
      label: '1990年代',
      value: '199'
    }, {
      label: '2000年代',
      value: '200'
    }, {
      label: '2010年代',
      value: '201'
    }, {
      label: '2020年代',
      value: '202'
    }]), (0, _defineProperty2.default)(_ref, "isScanning", false), (0, _defineProperty2.default)(_ref, "categoryList", []), (0, _defineProperty2.default)(_ref, "categoryOptions2", []), (0, _defineProperty2.default)(_ref, "categoryOptions3", []), (0, _defineProperty2.default)(_ref, "categoryLevel1", null), (0, _defineProperty2.default)(_ref, "categoryLevel2", null), (0, _defineProperty2.default)(_ref, "categoryLevel3", null), (0, _defineProperty2.default)(_ref, "selectedCategoryId", ''), (0, _defineProperty2.default)(_ref, "categoryIndexes", []), (0, _defineProperty2.default)(_ref, "maxCategoryLevel", 6), (0, _defineProperty2.default)(_ref, "categoryPathText", ''), (0, _defineProperty2.default)(_ref, "categoryColumns", []), (0, _defineProperty2.default)(_ref, "categoryLevels", []), _ref;
  },
  created: function created() {
    this.$selectBookImage = selectBookImage;
  },
  onLoad: function onLoad() {
    var _this = this;
    return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
      var phoneNumber, warehouse;
      return _regenerator.default.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              phoneNumber = uni.getStorageSync('phoneNumber');
              warehouse = uni.getStorageSync("selectedWarehouse");
              console.log('选择仓库11111:', warehouse);

              // 加载保存的货区选择状态
              _this.loadStorageSelection();

              // 不再自动设置仓库、货架和货位
              if (warehouse) {
                // 只初始化仓库列，但不设置selectedStorage
                _this.selectedWarehouse = warehouse;
                _this.columns[0] = [warehouse.name]; // 假设仓库对象有name字段
              }

              // 获取图书分类数据
              _context.next = 7;
              return _this.fetchCategoryData();
            case 7:
              console.log("分类数据获取成功:", _this.categoryList);
            case 8:
            case "end":
              return _context.stop();
          }
        }
      }, _callee);
    }))();
  },
  // 添加Vue的mounted生命周期钩子，确保组件切换时能正确加载状态
  mounted: function mounted() {
    console.log('=== Photo组件 mounted 方法被调用 ===');
    // 加载保存的货区选择状态
    this.loadStorageSelection();
  },
  onReady: function onReady() {
    console.log('=== onReady 方法被调用 ===');
    // 在uni-app中，我们可以使用页面级别的点击事件
    // 这里不需要添加全局事件监听器，我们将在模板中使用@click事件

    // 手动触发分类数据获取
    console.log('onReady: 手动触发fetchCategoryData');
    this.fetchCategoryData().then(function () {
      console.log('onReady: fetchCategoryData执行完成');
    }).catch(function (error) {
      console.error('onReady: fetchCategoryData执行失败:', error);
    });
  },
  onShow: function onShow() {
    // 检查本地存储中是否有更新的仓库信息
    var warehouse = uni.getStorageSync("selectedWarehouse");
    if (warehouse) {
      console.log('从存储获取仓库信息:', warehouse);
      // 设置仓库对象以便传递给组件
      this.selectedWarehouse = warehouse;
    }

    // 加载保存的货区选择状态
    this.loadStorageSelection();

    // 每次页面显示都拉取分类数据
    console.log('onShow: 开始调用fetchCategoryData');
    this.fetchCategoryData().then(function () {
      console.log('onShow: fetchCategoryData执行完成');
    }).catch(function (error) {
      console.error('onShow: fetchCategoryData执行失败:', error);
    });
  },
  methods: {
    // 从本地存储加载货区选择状态
    loadStorageSelection: function loadStorageSelection() {
      var _this2 = this;
      try {
        // 只有在选择了仓库的情况下才加载货区状态
        if (!this.selectedWarehouse || !this.selectedWarehouse.id) {
          console.log('Photo页面：未选择仓库，不加载货区状态');
          return;
        }

        // 根据仓库ID加载对应的货区状态
        var storageKey = "selectedStorageData_".concat(this.selectedWarehouse.id);
        var storageData = uni.getStorageSync(storageKey);
        if (storageData) {
          console.log("Photo\u9875\u9762\u52A0\u8F7D\u4ED3\u5E93".concat(this.selectedWarehouse.id, "\u7684\u8D27\u533A\u9009\u62E9\u72B6\u6001:"), storageData);
          this.selectedStorage = storageData.selectedStorage || '';
          this.warehouse = storageData.warehouse || '';
          this.shelf = storageData.shelf || '';
          this.location = storageData.location || '';
          this.selectedSheId = storageData.selectedSheId || null;
          this.selectedFreId = storageData.selectedFreId || null;

          // 如果有完整的货区信息，通知仓库选择器组件更新
          if (this.selectedStorage && this.$refs.warehouseSelector) {
            this.$nextTick(function () {
              _this2.$refs.warehouseSelector.updateSelectedStorage({
                storage: _this2.selectedStorage,
                warehouse: _this2.warehouse,
                shelf: _this2.shelf,
                location: _this2.location,
                shelfId: _this2.selectedSheId,
                locationId: _this2.selectedFreId
              });
            });
          }
        } else {
          console.log("Photo\u9875\u9762\uFF1A\u4ED3\u5E93".concat(this.selectedWarehouse.id, "\u6CA1\u6709\u4FDD\u5B58\u7684\u8D27\u533A\u72B6\u6001"));
        }
      } catch (error) {
        console.error('Photo页面加载货区选择状态失败:', error);
      }
    },
    // 选择图片
    chooseImage: function chooseImage() {
      var _this3 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
        var canUpload, warehouse, shelf, location, currentStorage, currentWarehouse, currentShelf, currentLocation, currentSelectedSheId, currentSelectedFreId, currentCondition;
        return _regenerator.default.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.next = 2;
                return (0, _MemberBookCheck.checkMemberBooksCount)();
              case 2:
                canUpload = _context2.sent;
                if (canUpload) {
                  _context2.next = 5;
                  break;
                }
                return _context2.abrupt("return");
              case 5:
                warehouse = _this3.warehouse;
                console.log("warehouse", warehouse);
                shelf = _this3.shelf;
                console.log("shelf", shelf);
                location = _this3.location;
                console.log("location", location);
                // 验证仓库/货架/货位 - 确保三个值都必须存在
                if (!(!warehouse || !shelf || !location)) {
                  _context2.next = 14;
                  break;
                }
                uni.showToast({
                  title: '请完整选择仓库、货架和货位',
                  icon: 'none',
                  duration: 2500
                });
                return _context2.abrupt("return");
              case 14:
                // 保存当前的货区和品相数据
                currentStorage = _this3.selectedStorage;
                currentWarehouse = _this3.warehouse;
                currentShelf = _this3.shelf;
                currentLocation = _this3.location;
                currentSelectedSheId = _this3.selectedSheId;
                currentSelectedFreId = _this3.selectedFreId; // 保存当前的品相选择
                currentCondition = null;
                if (_this3.$refs.conditionSelect) {
                  currentCondition = _this3.$refs.conditionSelect.getSelectedCondition();
                }

                // 清空表单数据
                _this3.bookInfo = {
                  bookName: '',
                  author: '',
                  publisher: '',
                  format: '',
                  printTime: '',
                  isbn: '',
                  price: '',
                  wordage: '',
                  unifyIsbn: ''
                };

                // 清空图片列表和已上传图片
                _this3.fileList1 = [];
                _this3.uploadedImages = [];
                _this3.hasShownUploadMessage = false;

                // 重置在售商品列表
                _this3.onSaleProducts = [];
                _this3.displayOnSaleProducts = [];

                // 重置下拉选项
                _this3.authorOptions = [];
                _this3.publisherOptions = [];
                _this3.authorDropdownVisible = false;
                _this3.publisherDropdownVisible = false;
                _this3.formatDropdownVisible = false;

                // 重置分类选择
                _this3.categoryIndexes = [];
                _this3.categoryPathText = '';
                _this3.selectedCategoryId = '';
                _this3.categoryLevels = [];
                _this3.initCategoryPicker(); // 重新初始化选择器

                // 恢复货区数据
                _this3.selectedStorage = currentStorage;
                _this3.warehouse = currentWarehouse;
                _this3.shelf = currentShelf;
                _this3.location = currentLocation;
                _this3.selectedSheId = currentSelectedSheId;
                _this3.selectedFreId = currentSelectedFreId;

                // 恢复品相选择
                if (_this3.$refs.conditionSelect && currentCondition) {
                  _this3.$refs.conditionSelect.setSelection(currentCondition.name);
                }

                // 显示bcode-camera组件
                _this3.showBcodeCamera = true;
                // 隐藏提交按钮
                _this3.showSubmitButton = false;
                _this3.$emit('camera-status-change', true);
              case 48:
              case "end":
                return _context2.stop();
            }
          }
        }, _callee2);
      }))();
    },
    // 新增：更新作者和出版社信息的方法
    updateAuthorAndPublisher: function updateAuthorAndPublisher() {
      var _this4 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
        var cookies, result;
        return _regenerator.default.wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                _context3.prev = 0;
                cookies = uni.getStorageSync('cookies');
                if (!(!cookies || !_this4.bookInfo.bookName)) {
                  _context3.next = 4;
                  break;
                }
                return _context3.abrupt("return");
              case 4:
                _context3.next = 6;
                return (0, _getAuthorAndPublisher.getAuthorAndPublisher)(_this4.bookInfo.bookName, cookies);
              case 6:
                result = _context3.sent;
                _this4.authorOptions = result.authors || [];
                _this4.publisherOptions = result.publishers || [];

                // 如果OCR识别的作者在列表中，保持选中
                if (_this4.bookInfo.author && result.authors && result.authors.includes(_this4.bookInfo.author)) {
                  _this4.bookInfo.author = _this4.bookInfo.author;
                }
                _context3.next = 15;
                break;
              case 12:
                _context3.prev = 12;
                _context3.t0 = _context3["catch"](0);
                console.error('获取作者和出版社信息失败:', _context3.t0);
              case 15:
              case "end":
                return _context3.stop();
            }
          }
        }, _callee3, null, [[0, 12]]);
      }))();
    },
    handleFileChange: function handleFileChange(newFileList) {
      // 过滤出普通上传的图片(不包含识图上传的图片)
      var normalImages = newFileList.filter(function (file) {
        return !file.name || !file.name.startsWith('识图-');
      });
      // 过滤出识图上传的图片
      var ocrImages = this.fileList1.filter(function (file) {
        return file.name && file.name.startsWith('识图-');
      });

      // 合并两个数组
      this.fileList1 = [].concat((0, _toConsumableArray2.default)(normalImages), (0, _toConsumableArray2.default)(ocrImages));

      // 只有当有普通上传的图片时才显示提示并禁用输入框
      if (normalImages.length > 0 && !this.hasShownUploadMessage) {
        uni.showToast({
          title: '已上传图片，ISBN和书名不可修改',
          icon: 'none',
          duration: 2000
        });
        this.hasShownUploadMessage = true;
      } else if (normalImages.length === 0) {
        this.hasShownUploadMessage = false;
      }

      // 检查是否有文件正在上传
      this.isUploading = newFileList.some(function (file) {
        return file.status === 'uploading';
      });
      console.log("普通上传图片数量:", normalImages.length);
      console.log("识图上传图片数量:", ocrImages.length);
      console.log("fileList1", this.fileList1);
      console.log("文件上传状态:", this.isUploading ? "上传中" : "未上传");
    },
    // 删除图片
    deleteImage: function deleteImage() {
      this.imageUrl = '';
      this.bookInfo = {
        title: '',
        author: '',
        publisher: '',
        format: '',
        printTime: '',
        isbn: '',
        price: '',
        wordage: ''
      };
      this.errorMsg = '';
    },
    // 返回上一页并清除缓存
    navigateBack: function navigateBack() {
      // 清除相关缓存数据
      uni.removeStorageSync('lastSelectedStorage');
      uni.removeStorageSync('selectedWarehouse');
      uni.removeStorageSync('lastSelectedShelf');
      uni.removeStorageSync('lastSelectedLocation');
      // 清除三级货区选择状态
      uni.removeStorageSync('selectedStorageData');

      // 重置相关数据
      this.selectedStorage = '';
      this.warehouse = '';
      this.shelf = '';
      this.location = '';
      uni.navigateTo({
        url: '/pages/warehouse/warehouse-select'
      });
    },
    // 相机按钮
    handleCameraStatusChange: function handleCameraStatusChange(isCameraOpen) {
      // 当相机打开时隐藏提交按钮，关闭时显示
      this.showSubmitButton = !isCameraOpen;
    },
    // 处理上传状态变化
    handleUploadStatusChange: function handleUploadStatusChange(isUploading) {
      console.log('文件上传状态变化:', isUploading ? '上传中' : '未上传');
      this.isUploading = isUploading;
    },
    handleStorageSelected: function handleStorageSelected(data) {
      console.log('选择的货区数据:', data);
      this.selectedStorage = data.storage;
      this.warehouse = data.warehouse;
      this.shelf = data.shelf;
      this.location = data.location;
      this.selectedSheId = data.shelfId;
      this.selectedFreId = data.locationId;
      // 将ID存储到本地
      uni.setStorageSync('warehouseId', this.selectedWarehouse.id); // 仓库ID
      uni.setStorageSync('shelfId', data.shelfId); // 货架ID
      uni.setStorageSync('locationId', data.locationId); // 货位ID
    },
    // 品相选择变化
    onConditionChange: function onConditionChange(index, conditionName) {
      console.log('品相已选择:', index);
      console.log('选中的品相名称:', conditionName);
    },
    // 价格变化
    onPriceChange: function onPriceChange(value) {
      this.value4 = value;
    },
    // 库存变化
    onStockChange: function onStockChange(value) {
      this.value3 = value;
    },
    // 获取在售商品信息
    fetchOnSaleProducts: function fetchOnSaleProducts(keyword) {
      var _this5 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
        var conditionValue, sortType, cookies, mockData, blockedShopsStr, blockedShops, filteredData;
        return _regenerator.default.wrap(function _callee4$(_context4) {
          while (1) {
            switch (_context4.prev = _context4.next) {
              case 0:
                _context4.prev = 0;
                conditionValue = uni.getStorageSync("conditionValue");
                sortType = 7;
                cookies = uni.getStorageSync('UserInfoCookies');
                _context4.next = 6;
                return _this5.$selectBookImage.fetchOnSaleProducts(keyword, sortType, conditionValue, cookies);
              case 6:
                mockData = _context4.sent;
                blockedShopsStr = uni.getStorageSync('blockedShops') || '';
                blockedShops = blockedShopsStr.split(';').filter(function (shop) {
                  return shop.trim() !== '';
                });
                filteredData = mockData.filter(function (product) {
                  return !blockedShops.some(function (shop) {
                    return product.shopName && product.shopName.includes(shop.trim());
                  });
                });
                _this5.onSaleProducts = (0, _toConsumableArray2.default)(filteredData);
                _this5.extractAuthorsAndPublishers();
                if (_this5.$refs.onSaleProductsComponent) {
                  _this5.$refs.onSaleProductsComponent.updateProducts(_this5.onSaleProducts);
                }
                _this5.calculateReferencePrice();
                _context4.next = 20;
                break;
              case 16:
                _context4.prev = 16;
                _context4.t0 = _context4["catch"](0);
                console.error('获取在售商品信息失败:', _context4.t0);
                uni.showToast({
                  title: '获取在售商品信息失败',
                  icon: 'none',
                  duration: 2500
                });
              case 20:
              case "end":
                return _context4.stop();
            }
          }
        }, _callee4, null, [[0, 16]]);
      }))();
    },
    // 计算参考价格
    calculateReferencePrice: function calculateReferencePrice() {
      if (!this.displayOnSaleProducts || this.displayOnSaleProducts.length === 0) {
        this.value4 = 1.00;
        return;
      }
      var products = (0, _toConsumableArray2.default)(this.displayOnSaleProducts);
      // 永远使用总价
      var priceField = 'totalPrice';
      // 按总价排序
      products.sort(function (a, b) {
        return parseFloat(a[priceField]) - parseFloat(b[priceField]);
      });

      // 从Vuex store获取运费和最低值
      var shippingFee = this.freight;
      var minValue = this.minValue;
      console.log("priceMode111", this.priceMode);
      var priceMode = uni.getStorageSync("current1");
      console.log("priceMode", priceMode);
      var selectedPositionIndex = uni.getStorageSync("selectedPositionIndex");
      console.log("selectedPositionIndex", selectedPositionIndex);
      switch (priceMode) {
        case 0:
          // 最低价
          // 获取选择的位置索引（从store中获取）
          var positionIndex = this.selectedPosition || selectedPositionIndex || 0;
          console.log("索引", positionIndex);
          // 确保索引在有效范围内
          var validIndex = Math.min(positionIndex, products.length - 1);
          console.log("索引1", positionIndex);
          console.log('使用第' + (validIndex + 1) + '条数据的价格');

          // 获取选中位置的总价
          var selectedTotal = parseFloat(products[validIndex].totalPrice);
          this.lowestTotalPrice = parseFloat(products[0].totalPrice);

          // 计算新价格：选中位置的总价 - 运费 - 最低值
          var lowestPrice = selectedTotal - shippingFee - 0.01;

          // 如果总价减去运费后的价格小于0，则使用最低值设置的值
          if (lowestPrice <= minValue) {
            this.value4 = minValue;
          } else {
            this.value4 = parseFloat(lowestPrice.toFixed(2));
          }
          break;
        case 1:
          // 均价
          // 获取最低的N个价格并计算平均值
          var count = Math.min(this.averageRange, products.length);
          console.log("count", count);
          var sum = 0;
          for (var i = 0; i < count; i++) {
            sum += parseFloat(products[i][priceField]);
            console.log("sum+", sum);
          }

          // 计算平均总价后减去运费
          var averagePrice = sum / count - shippingFee - 0.01;
          console.log("averagePrice", averagePrice);
          // 如果计算结果小于等于0，则使用最低值
          if (averagePrice <= minValue) {
            this.value4 = minValue;
          } else {
            this.value4 = parseFloat(averagePrice.toFixed(2));
          }
          break;
        case 2:
          // 最新已售价
          // 使用最低总价
          this.value4 = parseFloat(products[0].totalPrice);
          break;
      }
    },
    // 处理比价类型变化
    handleCompareTypeChange: function handleCompareTypeChange(payload) {
      var _this6 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
        return _regenerator.default.wrap(function _callee5$(_context5) {
          while (1) {
            switch (_context5.prev = _context5.next) {
              case 0:
                _this6.compareType = payload.type;
                if (!(payload.type === 'isbn')) {
                  _context5.next = 6;
                  break;
                }
                _context5.next = 4;
                return _this6.fetchOnSaleProducts(_this6.bookInfo.isbn);
              case 4:
                _context5.next = 8;
                break;
              case 6:
                _context5.next = 8;
                return _this6.fetchOnSaleProducts(_this6.bookInfo.bookName);
              case 8:
              case "end":
                return _context5.stop();
            }
          }
        }, _callee5);
      }))();
    },
    // 处理筛选结果
    handleFiltersApplied: function handleFiltersApplied(filteredProducts) {
      this.filteredOnSaleProducts = filteredProducts;
      this.isFiltered = true;
    },
    // 处理筛选重置
    handleFiltersReset: function handleFiltersReset() {
      this.isFiltered = false;
    },
    // 处理产品数据更新
    handleProductsUpdated: function handleProductsUpdated(products) {
      this.displayOnSaleProducts = products;
      // 如果需要，可以在这里更新最低价格并重新计算参考价格
      this.calculateReferencePrice();
    },
    // 提交表单
    submitForm: function submitForm() {
      var _this7 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
        var lastSubmitTime, currentTime, timeDiff, twoHours, canUpload, warehouse, shelf, location, userId, selectedCondition, _canUpload, temporaryImages, i, file, result, formData;
        return _regenerator.default.wrap(function _callee6$(_context6) {
          while (1) {
            switch (_context6.prev = _context6.next) {
              case 0:
                // 检查提交时间间隔
                lastSubmitTime = uni.getStorageSync('lastSubmitTime');
                currentTime = Date.now();
                if (!lastSubmitTime) {
                  _context6.next = 9;
                  break;
                }
                timeDiff = currentTime - lastSubmitTime;
                twoHours = 2 * 60 * 60 * 1000; // 2小时的毫秒数
                if (!(timeDiff > twoHours)) {
                  _context6.next = 9;
                  break;
                }
                uni.showToast({
                  title: '登录已过期，请重新登录',
                  icon: 'none',
                  duration: 2000
                });
                setTimeout(function () {
                  uni.navigateTo({
                    url: '/pages/login/index'
                  });
                }, 2000);
                return _context6.abrupt("return");
              case 9:
                // 更新最后提交时间
                uni.setStorageSync('lastSubmitTime', currentTime);

                // 检查用户是否可以上传书籍
                _context6.next = 12;
                return (0, _MemberBookCheck.checkMemberBooksCount)();
              case 12:
                canUpload = _context6.sent;
                if (canUpload) {
                  _context6.next = 15;
                  break;
                }
                return _context6.abrupt("return");
              case 15:
                if (!_this7.isSubmitting) {
                  _context6.next = 17;
                  break;
                }
                return _context6.abrupt("return");
              case 17:
                _this7.isSubmitting = true;
                warehouse = _this7.warehouse;
                shelf = _this7.shelf;
                location = _this7.location;
                userId = uni.getStorageSync("userId");
                _context6.prev = 22;
                if (_this7.bookInfo.bookName) {
                  _context6.next = 27;
                  break;
                }
                uni.showToast({
                  title: '请输入书名',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 27:
                if (_this7.bookInfo.publisher) {
                  _context6.next = 31;
                  break;
                }
                uni.showToast({
                  title: '请输入出版社',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 31:
                if (_this7.bookInfo.author) {
                  _context6.next = 35;
                  break;
                }
                uni.showToast({
                  title: '请输入作者',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 35:
                if (_this7.bookInfo.printTime) {
                  _context6.next = 39;
                  break;
                }
                uni.showToast({
                  title: '请输入印刷时间',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 39:
                // 获取选中的品相
                selectedCondition = _this7.$refs.conditionSelect.getSelectedCondition();
                if (selectedCondition) {
                  _context6.next = 44;
                  break;
                }
                uni.showToast({
                  title: '请选择品相',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 44:
                if (!(!warehouse || !shelf || !location)) {
                  _context6.next = 48;
                  break;
                }
                uni.showToast({
                  title: '请选择仓库/货架/货位',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 48:
                _context6.next = 50;
                return (0, _MemberBookCheck.checkMemberBooksCount)();
              case 50:
                _canUpload = _context6.sent;
                if (_canUpload) {
                  _context6.next = 54;
                  break;
                }
                // 如果不能上传，则直接返回，不继续执行
                _this7.isSubmitting = false;
                return _context6.abrupt("return");
              case 54:
                if (!(_this7.fileList1.length > 0)) {
                  _context6.next = 102;
                  break;
                }
                if (!(_this7.fileList1.length > 0)) {
                  _context6.next = 63;
                  break;
                }
                // 检查是否有上传失败或者临时路径的图片
                temporaryImages = [];
                console.log("当前图片数据fileList1", _this7.fileList1);
                _this7.fileList1.forEach(function (file, index) {
                  // 检查图片状态是否为error或者路径是临时路径
                  if (file.status === 'error' || file.url && (file.url.startsWith('file://') || file.url.startsWith('blob:') || file.url.startsWith('wxfile://') || file.url.indexOf('tmp') !== -1)) {
                    temporaryImages.push(index + 1); // 索引从0开始，所以+1表示第几张
                  }
                });
                if (!(temporaryImages.length > 0)) {
                  _context6.next = 63;
                  break;
                }
                uni.showToast({
                  title: "\u7B2C".concat(temporaryImages.join('、'), "\u5F20\u56FE\u7247\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u62CD\u7167,\u82E5\u4ECD\u7136\u5931\u8D25\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458!"),
                  icon: 'none',
                  duration: 4000
                });
                _this7.isSubmitting = false; // 重置提交状态
                return _context6.abrupt("return");
              case 63:
                _context6.prev = 63;
                // 显示上传中提示
                uni.showLoading({
                  title: '正在上传图片...'
                });

                // 设置上传状态为true
                _this7.isUploading = true;

                // 上传所有图片
                i = 0;
              case 67:
                if (!(i < _this7.fileList1.length)) {
                  _context6.next = 90;
                  break;
                }
                file = _this7.fileList1[i]; // 只上传状态为ready的图片
                if (!(file.status === "ready")) {
                  _context6.next = 87;
                  break;
                }
                // 更新状态为上传中
                _this7.fileList1.splice(i, 1, _objectSpread(_objectSpread({}, file), {}, {
                  status: "uploading",
                  message: "上传中"
                }));
                _context6.prev = 71;
                _context6.next = 74;
                return _this7.uploadFilePromise(file.url, i);
              case 74:
                result = _context6.sent;
                // 更新状态为上传成功
                _this7.fileList1.splice(i, 1, _objectSpread(_objectSpread({}, file), {}, {
                  status: "success",
                  message: "",
                  url: result,
                  num: file.num || (i + 1).toString()
                }));
                _context6.next = 87;
                break;
              case 78:
                _context6.prev = 78;
                _context6.t0 = _context6["catch"](71);
                console.error('图片上传失败:', _context6.t0);
                // 更新状态为上传失败
                _this7.fileList1.splice(i, 1, _objectSpread(_objectSpread({}, file), {}, {
                  status: "error",
                  message: "上传失败"
                }));

                // 显示错误提示
                uni.showToast({
                  title: '图片上传失败',
                  icon: 'none',
                  duration: 2500
                });

                // 重置提交状态
                _this7.isSubmitting = false;
                _this7.isUploading = false;
                uni.hideLoading();
                return _context6.abrupt("return");
              case 87:
                i++;
                _context6.next = 67;
                break;
              case 90:
                // 所有图片上传完成后，设置上传状态为false
                _this7.isUploading = false;
                uni.hideLoading();
                _context6.next = 102;
                break;
              case 94:
                _context6.prev = 94;
                _context6.t1 = _context6["catch"](63);
                console.error('图片上传过程出错:', _context6.t1);
                uni.hideLoading();
                uni.showToast({
                  title: '图片上传失败',
                  icon: 'none',
                  duration: 2500
                });
                _this7.isSubmitting = false;
                _this7.isUploading = false;
                return _context6.abrupt("return");
              case 102:
                // 构建提交数据
                formData = {
                  userId: userId,
                  barcode: _this7.bookInfo.isbn,
                  name: _this7.bookInfo.bookName,
                  conditionCode: selectedCondition.name,
                  price: _this7.value4 * 100,
                  inventory: _this7.value3 || 1,
                  marketTags: _this7.marketTags,
                  // files: this.uploadedImages.length > 0 ? this.uploadedImages : this.fileList1.map(file => ({
                  // 	...file,
                  // 	num: file.num || '1'
                  // })),
                  files: _this7.fileList1,
                  author: _this7.bookInfo.author,
                  publisher: _this7.bookInfo.publisher,
                  format: _this7.bookInfo.format,
                  printTime: _this7.bookInfo.printTime,
                  wordage: _this7.bookInfo.wordage,
                  priceText: _this7.bookInfo.price,
                  goodUnifyIsbn: _this7.bookInfo.unifyIsbn,
                  selectedStorage: _this7.selectedStorage,
                  // 仓库ID
                  depotName: _this7.warehouse,
                  // 仓库名称（需与后端字段名一致）
                  shelvesName: _this7.shelf,
                  // 货架名称
                  freightName: _this7.location,
                  // 自由区名称
                  phoneNumber: uni.getStorageSync('phoneNumber'),
                  // 从本地存储获取用户
                  passWord: uni.getStorageSync('password'),
                  // 从本地存储获取用户
                  tenantId: uni.getStorageSync('tenantId'),
                  // 从本地存储获取租户ID
                  userName: uni.getStorageSync('userName'),
                  // 从本地存储获取手机号
                  categoryId: _this7.selectedCategoryId || '' // 添加分类ID
                }; // 调试日志，查看提交数据中的书名

                console.log('提交的数据:', formData);
                console.log('书名:', formData.name);
                console.log('作者:', formData.author);
                console.log('出版社:', formData.publisher);
                console.log('印刷时间:', formData.printTime);

                // 检查是否重复书籍
                uni.request({
                  url: 'https://api.buzhiyushu.cn/zhishu/shopGoods/repeatBook',
                  method: 'POST',
                  data: formData,
                  header: {
                    'Content-Type': 'application/json'
                  },
                  success: function success(res) {
                    if (res.data.data && res.data.data.count != 0) {
                      // 如果是重复书籍，弹出确认框
                      var bookName = res.data.data && res.data.data.name ? res.data.data.name.trim() : ''; // 添加空值检查
                      // 1. MD5 32位加密（小写）
                      var md5Hash = CryptoJS.MD5(bookName).toString(); // 输出 32 位小写十六进制字符串
                      // 2. 获取首字母并大写
                      var firstLetter = bookName ? md5Hash.charAt(0).toUpperCase() : '';
                      console.log('原始书名:', bookName);
                      console.log('MD5加密后（32位小写）:', md5Hash);
                      console.log('加密后字符串的首字母大写:', firstLetter);
                      var imagePath = res.data.data && res.data.data.image ? res.data.data.image : '';
                      console.log("图片", imagePath);
                      // 拼接图片地址
                      var fullImageUrl = "https://img.buzhiyushu.cn/zhishu1/".concat(firstLetter, "/").concat(imagePath);
                      console.log("fullImageUrl", fullImageUrl);
                      // 根据count值动态设置下拉框的起始字母
                      var count = res.data.data && res.data.data.count ? res.data.data.count : 0;
                      var allLetters = ['B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'];
                      // 如果count为1，从B开始；count为2，从C开始；以此类推
                      var startIndex = count > 0 ? count - 1 : 0;
                      if (startIndex >= 0 && startIndex < allLetters.length) {
                        // 从对应位置截取字母数组
                        _this7.popupDialog.seriesOptions = allLetters.slice(startIndex);
                        // 默认选中第一个字母（即对应count的字母）
                        _this7.popupDialog.selectedSeries = _this7.popupDialog.seriesOptions[0];
                      }
                      _this7.popupDialog.title = '提示';
                      _this7.popupDialog.content = '请仔细核对此书是否为套装书,一号多书等情况？请选择(否:增加库存   是:新增书籍)';
                      _this7.popupDialog.confirmText = '是';
                      _this7.popupDialog.cancelText = '否';
                      _this7.popupDialog.imgSrc = fullImageUrl;
                      _this7.popupDialog.show = true;
                      _this7.popupDialog.count = count || 0; // 添加默认值防止count为null
                      _this7.popupDialog.subFormData = formData;
                    } else {
                      // 不是重复书籍，直接提交
                      _this7.submitToServer(formData);
                    }
                  },
                  fail: function fail(err) {
                    console.error('检查重复书籍失败:', err);
                    uni.showToast({
                      title: '网络错误，请稍后重试',
                      icon: 'none',
                      duration: 2500
                    });
                    _this7.isSubmitting = false; // 重置提交状态
                  }
                });

                uni.showToast({
                  title: '提交成功',
                  icon: 'success',
                  duration: 2000
                });
                _context6.next = 116;
                break;
              case 112:
                _context6.prev = 112;
                _context6.t2 = _context6["catch"](22);
                console.error('提交失败:', _context6.t2);
                uni.showToast({
                  title: '提交失败',
                  icon: 'none',
                  duration: 2000
                });
              case 116:
                _context6.prev = 116;
                _this7.isSubmitting = false;
                return _context6.finish(116);
              case 119:
              case "end":
                return _context6.stop();
            }
          }
        }, _callee6, null, [[22, 112, 116, 119], [63, 94], [71, 78]]);
      }))();
    },
    onPopupConfirm: function onPopupConfirm() {
      // 直接使用选择的字母作为series参数
      this.popupDialog.subFormData.series = this.popupDialog.selectedSeries;
      console.log("字母", this.popupDialog.subFormData.series);
      // 继续提交流程
      this.submitToServer(this.popupDialog.subFormData);
      this.popupDialog.show = false;
    },
    // 处理字母选择确认事件
    onSeriesConfirm: function onSeriesConfirm(e) {
      this.popupDialog.selectedSeries = e.value[0];
      this.popupDialog.showPicker = false;
    },
    // 根据书名查询在售商品
    getBookName: function getBookName() {
      var _this8 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
        var canUpload, _canUpload2, res, responseData, resultData, isbnResponse;
        return _regenerator.default.wrap(function _callee7$(_context7) {
          while (1) {
            switch (_context7.prev = _context7.next) {
              case 0:
                _context7.next = 2;
                return (0, _MemberBookCheck.checkMemberBooksCount)();
              case 2:
                canUpload = _context7.sent;
                if (canUpload) {
                  _context7.next = 5;
                  break;
                }
                return _context7.abrupt("return");
              case 5:
                if (!_this8.hasNormalImages) {
                  _context7.next = 8;
                  break;
                }
                uni.showToast({
                  title: '已上传图片，不可修改书名',
                  icon: 'none',
                  duration: 2000
                });
                return _context7.abrupt("return");
              case 8:
                _context7.prev = 8;
                if (_this8.bookInfo.bookName) {
                  _context7.next = 12;
                  break;
                }
                uni.showToast({
                  title: '请输入书名',
                  icon: 'none',
                  duration: 2500
                });
                return _context7.abrupt("return");
              case 12:
                _context7.next = 14;
                return (0, _MemberBookCheck.checkMemberBooksCount)();
              case 14:
                _canUpload2 = _context7.sent;
                if (_canUpload2) {
                  _context7.next = 17;
                  break;
                }
                return _context7.abrupt("return");
              case 17:
                // 显示加载提示
                uni.showLoading({
                  title: '查询中...',
                  mask: true
                });

                // 获取书籍基本信息
                _context7.next = 20;
                return uni.request({
                  url: 'https://api.buzhiyushu.cn/zhishu/baseInfo/getBookByName',
                  method: 'POST',
                  header: {
                    'Content-Type': 'application/json'
                  },
                  data: {
                    bookName: _this8.bookInfo.bookName
                  }
                });
              case 20:
                res = _context7.sent;
                // 处理响应数据
                responseData = Array.isArray(res) ? res[1] : res;
                if (!(responseData.statusCode === 200 && responseData.data && responseData.data.data)) {
                  _context7.next = 46;
                  break;
                }
                resultData = responseData.data.data;
                console.log("获取到的书籍信息:", resultData);

                // 更新表单数据，保留已有数据
                if (resultData) {
                  _this8.bookInfo = _objectSpread(_objectSpread({}, _this8.bookInfo), {}, {
                    author: resultData.author || _this8.bookInfo.author || '',
                    publisher: resultData.publisher || _this8.bookInfo.publisher || '',
                    format: resultData.format || '32',
                    printTime: resultData.printTime || _this8.bookInfo.printTime || '',
                    unifyIsbn: resultData.isbn || _this8.bookInfo.unifyIsbn || '',
                    price: resultData.price ? String(resultData.price).replace('元', '') : _this8.bookInfo.price || '',
                    wordage: resultData.wordage || _this8.bookInfo.wordage || ''
                  });
                }

                // 处理ISBN
                if (_this8.bookInfo.isbn) {
                  _context7.next = 39;
                  break;
                }
                _context7.prev = 27;
                _context7.next = 30;
                return uni.request({
                  url: 'https://api.buzhiyushu.cn/zhishu/statistic/isbn',
                  method: 'GET'
                });
              case 30:
                isbnResponse = _context7.sent;
                if (Array.isArray(isbnResponse)) {
                  _this8.bookInfo.isbn = isbnResponse[1].data;
                } else {
                  _this8.bookInfo.isbn = isbnResponse.data;
                }
                console.log("生成的ISBN:", _this8.bookInfo.isbn);
                _context7.next = 39;
                break;
              case 35:
                _context7.prev = 35;
                _context7.t0 = _context7["catch"](27);
                console.error('获取ISBN失败，使用备用方案:', _context7.t0);
                _this8.bookInfo.isbn = _this8.generateRandomIsbn();
              case 39:
                _context7.next = 41;
                return _this8.updateAuthorAndPublisher();
              case 41:
                _context7.next = 43;
                return _this8.fetchOnSaleProducts(_this8.bookInfo.bookName);
              case 43:
                uni.showToast({
                  title: '查询成功',
                  icon: 'success',
                  duration: 1500
                });
                _context7.next = 50;
                break;
              case 46:
                // 如果没有查到数据，也获取ISBN和在售商品信息
                if (!_this8.bookInfo.isbn) {
                  _this8.bookInfo.isbn = _this8.generateRandomIsbn();
                }
                _context7.next = 49;
                return _this8.fetchOnSaleProducts(_this8.bookInfo.bookName);
              case 49:
                uni.showToast({
                  title: '未找到完整信息，已获取部分数据',
                  icon: 'none',
                  duration: 2000
                });
              case 50:
                _context7.next = 65;
                break;
              case 52:
                _context7.prev = 52;
                _context7.t1 = _context7["catch"](8);
                console.error('查询失败:', _context7.t1);
                // 即使请求失败，也尝试获取在售商品信息
                _context7.prev = 55;
                if (!_this8.bookInfo.isbn) {
                  _this8.bookInfo.isbn = _this8.generateRandomIsbn();
                }
                _context7.next = 59;
                return _this8.fetchOnSaleProducts(_this8.bookInfo.bookName);
              case 59:
                _context7.next = 64;
                break;
              case 61:
                _context7.prev = 61;
                _context7.t2 = _context7["catch"](55);
                console.error('获取在售商品信息失败:', _context7.t2);
              case 64:
                uni.showToast({
                  title: '查询失败，已获取部分数据',
                  icon: 'none',
                  duration: 2000
                });
              case 65:
                _context7.prev = 65;
                uni.hideLoading();
                return _context7.finish(65);
              case 68:
              case "end":
                return _context7.stop();
            }
          }
        }, _callee7, null, [[8, 52, 65, 68], [27, 35], [55, 61]]);
      }))();
    },
    // 图片上传到服务器
    uploadFilePromise: function uploadFilePromise(url, index) {
      var _this9 = this;
      console.log("uploadFilePromise\u88AB\u8C03\u7528: url=".concat(url, ", index=").concat(index));
      console.log("fileList1", this.fileList1);
      console.log("\u5F53\u524DfileList1\u72B6\u6001:", JSON.stringify(this.fileList1.map(function (f) {
        return {
          status: f.status,
          hidden: f.hidden,
          name: f.name,
          num: f.num
        };
      })));
      return new Promise(function (resolve, reject) {
        // 检查参数
        if (!url) {
          console.error('上传失败: url参数为空');
          reject(new Error('url参数为空'));
          return;
        }

        // 获取当前选项卡下的书名和ISBN
        var bookName = _this9.bookInfo.bookName;
        var isbn = _this9.bookInfo.isbn;
        // 获取存储的仓库相关ID
        var warehouseId = uni.getStorageSync('warehouseId');
        var shelfId = uni.getStorageSync('shelfId');
        var locationId = uni.getStorageSync('locationId');
        // 检查书名和ISBN
        if (!bookName || !isbn) {
          console.error("\u4E0A\u4F20\u5931\u8D25: \u4E66\u540D\u6216ISBN\u4E3A\u7A7A, \u4E66\u540D=".concat(bookName, ", ISBN=").concat(isbn));
          reject(new Error('书名或ISBN为空'));
          return;
        }
        console.log("\u5F00\u59CB\u4E0A\u4F20\u56FE\u7247: \u4E66\u540D=".concat(bookName, ", ISBN=").concat(isbn, ", \u7D22\u5F15=").concat(index));

        // 图片编号，从1开始，使用传入的索引+1或者找到对应文件的num值
        var num = (index + 1).toString();
        // 查找对应的文件是否已有num值
        var fileWithUrl = _this9.fileList1.find(function (f) {
          return f.url === url;
        });
        if (fileWithUrl && fileWithUrl.num) {
          num = fileWithUrl.num;
        }
        console.log("\u4E0A\u4F20\u56FE\u7247\u7F16\u53F7: ".concat(num));
        uni.uploadFile({
          url: "https://api.buzhiyushu.cn/zhishu/shopGoods/uploadImages",
          // 后端接口地址
          filePath: url,
          name: "file",
          // formData: {
          // 	bookName: bookName,
          // 	isbn: isbn,
          // 	num: num,
          // 	warehouseId: warehouseId,
          // 	shelfId: shelfId,
          // 	locationId: locationId,
          // },
          success: function success(res) {
            console.log('图片上传成功:', res);
            // 解析返回结果
            var data = JSON.parse(res.data);
            var imageUrl = data.url || url;

            // 将上传成功的图片信息存储到数组中
            _this9.uploadedImages.push({
              url: imageUrl,
              bookName: bookName,
              isbn: isbn,
              num: num,
              warehouseId: warehouseId,
              shelfId: shelfId,
              locationId: locationId,
              originalUrl: url
            });
            console.log("\u56FE\u7247\u4E0A\u4F20\u6210\u529F\uFF0C\u8FD4\u56DEURL: ".concat(imageUrl));
            resolve(imageUrl); // 如果返回了URL则使用，否则使用原URL
          },

          fail: function fail(err) {
            console.error('图片上传失败:', err);
            reject(err);
          }
        });
      });
    },
    onPopupCancel: function onPopupCancel() {
      // 继续提交流程
      this.submitToServer(this.popupDialog.subFormData);
      this.popupDialog.show = false;
    },
    // 提交到服务器的方法
    submitToServer: function submitToServer(formData) {
      var _this10 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
        var validateFormData, response, responseData, idsToPass, newFormData;
        return _regenerator.default.wrap(function _callee8$(_context8) {
          while (1) {
            switch (_context8.prev = _context8.next) {
              case 0:
                validateFormData = function validateFormData(data) {
                  var requiredFields = {
                    name: '书名',
                    publisher: '出版社',
                    author: '作者',
                    printTime: '印刷时间'
                  };
                  for (var _i = 0, _Object$entries = Object.entries(requiredFields); _i < _Object$entries.length; _i++) {
                    var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
                      field = _Object$entries$_i[0],
                      label = _Object$entries$_i[1];
                    if (!data[field]) {
                      throw new Error("\u8BF7\u8F93\u5165".concat(label));
                    }
                  }
                  if (!data.conditionCode) {
                    throw new Error('请选择品相');
                  }
                  if (!data.depotName || !data.shelvesName || !data.freightName) {
                    throw new Error('请选择仓库/货架/货位');
                  }
                };
                _context8.prev = 1;
                // 调试日志，检查提交的数据
                console.log('submitToServer数据检查:', formData);
                console.log('书名字段:', formData.name);
                validateFormData(formData);
                _context8.next = 7;
                return new Promise(function (resolve, reject) {
                  uni.request({
                    // url: 'https://api.buzhiyushu.cn/zhishu/shopGoods/submitFromCopyrightPage',
                    url: 'http://192.168.101.127:8080/zhishu/shopGoods/submitFromCopyrightPage',
                    method: 'POST',
                    data: formData,
                    header: {
                      'Content-Type': 'application/json'
                    },
                    success: function success(res) {
                      if (res.statusCode === 200) {
                        resolve(res);
                      } else {
                        reject(new Error('服务器响应错误'));
                      }
                    },
                    fail: function fail(err) {
                      return reject(new Error('网络请求失败'));
                    }
                  });
                });
              case 7:
                response = _context8.sent;
                // 保存相关信息到本地存储
                uni.setStorageSync('lastSelectedStorage', _this10.selectedStorage);
                uni.setStorageSync('lastSelectedWarehouse', _this10.warehouse);
                uni.setStorageSync('lastSelectedShelf', _this10.shelf);
                uni.setStorageSync('lastSelectedLocation', _this10.location);

                // 从第一个API响应中提取ID
                responseData = response.data.data;
                idsToPass = {
                  depotId: responseData.depotId,
                  freightId: responseData.freightId,
                  goodsId: responseData.goodsId,
                  shelvesId: responseData.shelvesId,
                  userId: responseData.userId,
                  artNo: responseData.artNo
                }; // 创建包含ID的新formData
                newFormData = _objectSpread(_objectSpread({}, formData), idsToPass); // 调用newadmin API
                _context8.prev = 15;
                _context8.next = 18;
                return new Promise(function (resolve, reject) {
                  uni.request({
                    url: 'https://newadmin.buzhiyushu.cn/zhishu/shopGoods/submitFromCopyrightPage',
                    // url: 'http://localhost:8089/zhishu/shopGoods/submitFromCopyrightPage',
                    method: 'POST',
                    data: newFormData,
                    header: {
                      'Content-Type': 'application/json'
                    },
                    success: function success(newAdminRes) {
                      console.log('newadmin API请求成功:', newAdminRes);
                      resolve(newAdminRes);
                    },
                    fail: function fail(newAdminErr) {
                      console.error('newadmin API请求失败:', newAdminErr);
                      reject(newAdminErr);
                    }
                  });
                });
              case 18:
                _context8.next = 23;
                break;
              case 20:
                _context8.prev = 20;
                _context8.t0 = _context8["catch"](15);
                console.error('newadmin API调用失败:', _context8.t0);
                // 不影响主流程，只记录错误
              case 23:
                // 清空表单数据，但保留货区和品相
                _this10.resetFormData();
                uni.showToast({
                  title: '提交成功',
                  icon: 'success',
                  duration: 2000
                });
                return _context8.abrupt("return", response.data);
              case 28:
                _context8.prev = 28;
                _context8.t1 = _context8["catch"](1);
                console.error('提交失败:', _context8.t1);
                uni.showToast({
                  title: _context8.t1.message || '提交失败',
                  icon: 'none',
                  duration: 2500
                });
                throw _context8.t1;
              case 33:
              case "end":
                return _context8.stop();
            }
          }
        }, _callee8, null, [[1, 28], [15, 20]]);
      }))();
    },
    // 新增：重置表单数据的方法
    resetFormData: function resetFormData() {
      // 保存当前的货区和品相数据
      var currentStorage = this.selectedStorage;
      var currentWarehouse = this.warehouse;
      var currentShelf = this.shelf;
      var currentLocation = this.location;
      var currentSelectedSheId = this.selectedSheId;
      var currentSelectedFreId = this.selectedFreId;

      // 清空表单数据
      this.bookInfo = {
        bookName: '',
        author: '',
        publisher: '',
        format: '',
        printTime: '',
        isbn: '',
        price: '',
        wordage: ''
      };
      this.imageUrl = '';
      this.uploadedImages = [];
      this.fileList1 = [];
      this.value3 = 1;
      this.errorMsg = '';
      this.onSaleProducts = [];
      this.displayOnSaleProducts = [];

      // 恢复货区数据
      this.selectedStorage = currentStorage;
      this.warehouse = currentWarehouse;
      this.shelf = currentShelf;
      this.location = currentLocation;
      this.selectedSheId = currentSelectedSheId;
      this.selectedFreId = currentSelectedFreId;
      if (this.$refs.onSaleProductsComponent) {
        this.$refs.onSaleProductsComponent.setCompareType('isbn');
      }
    },
    // 获取上书记录
    getBookRecords: function getBookRecords() {
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
        var phoneNumber, records;
        return _regenerator.default.wrap(function _callee9$(_context9) {
          while (1) {
            switch (_context9.prev = _context9.next) {
              case 0:
                _context9.prev = 0;
                // 从本地存储获取手机号
                phoneNumber = uni.getStorageSync('phoneNumber');
                if (phoneNumber) {
                  _context9.next = 5;
                  break;
                }
                uni.showToast({
                  title: '请先登录',
                  icon: 'none',
                  duration: 2500
                });
                return _context9.abrupt("return");
              case 5:
                // 显示加载提示
                uni.showLoading({
                  title: '加载中...'
                });
                _context9.prev = 6;
                _context9.next = 9;
                return bookRecords.fetchBookRecords(phoneNumber);
              case 9:
                records = _context9.sent;
                console.log("1111", records);
                if (!(!records || records.length === 0)) {
                  _context9.next = 14;
                  break;
                }
                uni.showToast({
                  title: '暂无上书记录',
                  icon: 'none',
                  duration: 2500
                });
                return _context9.abrupt("return");
              case 14:
                // 跳转到上书记录页面并传递数据
                uni.navigateTo({
                  url: '/pages/scan/book-records',
                  success: function success(res) {
                    // 向打开的页面传递数据
                    res.eventChannel.emit('bookRecordsData', {
                      records: records
                    });
                  }
                });
              case 15:
                _context9.prev = 15;
                // 确保在任何情况下都隐藏加载提示
                uni.hideLoading();
                return _context9.finish(15);
              case 18:
                _context9.next = 24;
                break;
              case 20:
                _context9.prev = 20;
                _context9.t0 = _context9["catch"](0);
                console.error('获取上书记录失败:', _context9.t0);
                uni.showToast({
                  title: _context9.t0.message || '获取上书记录失败',
                  icon: 'none',
                  duration: 2500
                });
              case 24:
              case "end":
                return _context9.stop();
            }
          }
        }, _callee9, null, [[0, 20], [6,, 15, 18]]);
      }))();
    },
    extractAuthorsAndPublishers: function extractAuthorsAndPublishers() {
      var authors = new Set();
      var publishers = new Set();
      this.onSaleProducts.forEach(function (item) {
        if (item.author) authors.add(item.author);
        if (item.publisher) publishers.add(item.publisher);
      });
      this.authorOptions = Array.from(authors).slice(0, 10);
      this.publisherOptions = Array.from(publishers).slice(0, 10);
    },
    selectAuthor: function selectAuthor(author) {
      this.bookInfo.author = author;
      this.authorDropdownVisible = false;
    },
    selectPublisher: function selectPublisher(publisher) {
      this.bookInfo.publisher = publisher;
      this.publisherDropdownVisible = false;
    },
    selectFormat: function selectFormat(format) {
      this.bookInfo.format = format;
      this.formatDropdownVisible = false;
    },
    closeAllDropdowns: function closeAllDropdowns(e) {
      // 如果点击事件来自下拉按钮或下拉内容本身，则不关闭
      var path = e && (e.path || e.composedPath && e.composedPath());
      if (path) {
        if (path.some(function (el) {
          return el && el.classList && (el.classList.contains('dropdown-btn') || el.classList.contains('dropdown-list'));
        })) {
          return;
        }
      }
      this.authorDropdownVisible = false;
      this.publisherDropdownVisible = false;
      this.formatDropdownVisible = false;
    },
    // 添加处理版权页比价的方法
    handleCopyrightCompare: function handleCopyrightCompare(payload) {
      var _this11 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
        var conditionValue, sortType, cookies, mockData, blockedShopsStr, blockedShops, filteredData;
        return _regenerator.default.wrap(function _callee10$(_context10) {
          while (1) {
            switch (_context10.prev = _context10.next) {
              case 0:
                _context10.prev = 0;
                conditionValue = uni.getStorageSync("conditionValue");
                sortType = 7;
                cookies = uni.getStorageSync('cookies'); // 调用获取在售商品的方法，传入 options 对象
                _context10.next = 6;
                return _this11.$selectBookImage.fetchOnSaleProducts(_this11.bookInfo.bookName, sortType, conditionValue, cookies, {
                  publisher: _this11.bookInfo.publisher,
                  author: _this11.bookInfo.author
                });
              case 6:
                mockData = _context10.sent;
                // 过滤黑名单店铺
                blockedShopsStr = uni.getStorageSync('blockedShops') || '';
                blockedShops = blockedShopsStr.split(';').filter(function (shop) {
                  return shop.trim() !== '';
                });
                filteredData = mockData.filter(function (product) {
                  return !blockedShops.some(function (shop) {
                    return product.shopName && product.shopName.includes(shop.trim());
                  });
                }); // 新增：如果没有数据，提示暂无在售商品数据
                if (!filteredData || filteredData.length === 0) {
                  uni.showToast({
                    title: '暂无在售商品数据',
                    icon: 'none',
                    duration: 2500
                  });
                }

                // 更新数据
                _this11.onSaleProducts = (0, _toConsumableArray2.default)(filteredData);
                _this11.extractAuthorsAndPublishers();
                if (_this11.$refs.onSaleProductsComponent) {
                  _this11.$refs.onSaleProductsComponent.updateProducts(_this11.onSaleProducts);
                }
                _this11.calculateReferencePrice();
                _context10.next = 21;
                break;
              case 17:
                _context10.prev = 17;
                _context10.t0 = _context10["catch"](0);
                console.error('获取在售商品信息失败:', _context10.t0);
                uni.showToast({
                  title: '获取在售商品信息失败',
                  icon: 'none',
                  duration: 2500
                });
              case 21:
              case "end":
                return _context10.stop();
            }
          }
        }, _callee10, null, [[0, 17]]);
      }))();
    },
    // 下拉刷新钩子
    onPullDownRefresh: function onPullDownRefresh() {
      // 重新识别图片（如果有图片）
      if (this.imageUrl) {
        // this.recognizeImage();
      } else {
        // 没有图片时，重置识别结果
        this.bookInfo = {
          bookName: '',
          author: '',
          publisher: '',
          format: '',
          printTime: '',
          isbn: '',
          price: '',
          wordage: ''
        };
        this.onSaleProducts = [];
        this.displayOnSaleProducts = [];
      }
      // 结束下拉刷新动画
      setTimeout(function () {
        uni.stopPullDownRefresh();
      }, 800);
    },
    // 处理bcode-camera组件拍照结果的方法
    handleBcodeCameraResult: function handleBcodeCameraResult(data) {
      var _this12 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
        var tempFilePath, currentStorage, currentWarehouse, currentShelf, currentLocation, currentSelectedSheId, currentSelectedFreId, currentCondition, fileInfo, finalFilePath, MAX_RETRIES, RETRY_DELAY, retryCount, performOCR, ocrData, currentBookInfo, formatValue, isbn, isbnRes, newFile;
        return _regenerator.default.wrap(function _callee12$(_context12) {
          while (1) {
            switch (_context12.prev = _context12.next) {
              case 0:
                console.log('handleBcodeCameraResult被调用，data:', data);

                // 获取拍照结果
                tempFilePath = data.url; // 如果没有拍照结果，按取消处理
                if (tempFilePath) {
                  _context12.next = 5;
                  break;
                }
                _this12.handleBcodeCameraCancel();
                return _context12.abrupt("return");
              case 5:
                // 新增：显示图片预览和动画
                _this12.previewImageUrl = tempFilePath;
                _this12.showRecognizing = true;
                _context12.prev = 7;
                // 保存当前的货区和品相数据
                currentStorage = _this12.selectedStorage;
                currentWarehouse = _this12.warehouse;
                currentShelf = _this12.shelf;
                currentLocation = _this12.location;
                currentSelectedSheId = _this12.selectedSheId;
                currentSelectedFreId = _this12.selectedFreId; // 保存当前的品相选择
                currentCondition = null;
                if (_this12.$refs.conditionSelect) {
                  currentCondition = _this12.$refs.conditionSelect.getSelectedCondition();
                  console.log('保存当前品相:', currentCondition);
                }

                // 显示自定义识别中动画
                _this12.showRecognizing = true;

                // 获取图片信息
                _context12.next = 19;
                return new Promise(function (resolve, reject) {
                  uni.getFileInfo({
                    filePath: tempFilePath,
                    success: function success(info) {
                      console.log('【当前图片体积】', info.size, '字节', (info.size / 1024).toFixed(2) + 'KB');
                      resolve(info);
                    },
                    fail: function fail(err) {
                      reject(err);
                    }
                  });
                });
              case 19:
                fileInfo = _context12.sent;
                // 如果图片大于500KB，进行压缩
                finalFilePath = tempFilePath;
                if (!(fileInfo.size > 500 * 1024)) {
                  _context12.next = 34;
                  break;
                }
                _context12.prev = 22;
                _context12.next = 25;
                return _this12.compressImage(tempFilePath);
              case 25:
                finalFilePath = _context12.sent;
                _context12.next = 34;
                break;
              case 28:
                _context12.prev = 28;
                _context12.t0 = _context12["catch"](22);
                console.error('图片压缩失败:', _context12.t0);
                _this12.showRecognizing = false;
                uni.showToast({
                  title: '图片压缩失败',
                  icon: 'none',
                  duration: 2500
                });
                return _context12.abrupt("return");
              case 34:
                // OCR识别重试逻辑
                MAX_RETRIES = 3;
                RETRY_DELAY = 7000; // 7秒重试延迟
                retryCount = 0;
                performOCR = /*#__PURE__*/function () {
                  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
                    var ocrResult, _ocrData;
                    return _regenerator.default.wrap(function _callee11$(_context11) {
                      while (1) {
                        switch (_context11.prev = _context11.next) {
                          case 0:
                            _context11.prev = 0;
                            _context11.next = 3;
                            return new Promise(function (resolve, reject) {
                              uni.uploadFile({
                                // url: 'https://book.ocr.buzhiyushu.cn/ocr',
                                url: 'https://book.xcx.ocr.buzhiyushu.cn/ocr',
                                filePath: finalFilePath,
                                name: 'file',
                                success: function success(res) {
                                  console.log("res", res);
                                  if (res.statusCode === 200) {
                                    resolve(res);
                                  } else {
                                    reject(new Error('OCR服务器响应错误'));
                                  }
                                },
                                fail: function fail(err) {
                                  return reject(new Error('OCR请求失败'));
                                }
                              });
                            });
                          case 3:
                            ocrResult = _context11.sent;
                            _ocrData = JSON.parse(ocrResult.data);
                            if (!(!_ocrData || !_ocrData.texts)) {
                              _context11.next = 7;
                              break;
                            }
                            throw new Error('OCR识别结果无效');
                          case 7:
                            return _context11.abrupt("return", _ocrData);
                          case 10:
                            _context11.prev = 10;
                            _context11.t0 = _context11["catch"](0);
                            if (!(retryCount < MAX_RETRIES)) {
                              _context11.next = 20;
                              break;
                            }
                            retryCount++;
                            console.log("OCR\u8BC6\u522B\u5931\u8D25\uFF0C\u7B2C".concat(retryCount, "\u6B21\u91CD\u8BD5\uFF0C\u7B49\u5F85").concat(RETRY_DELAY / 1000, "\u79D2..."));
                            _context11.next = 17;
                            return new Promise(function (resolve) {
                              return setTimeout(resolve, RETRY_DELAY);
                            });
                          case 17:
                            _context11.next = 19;
                            return performOCR();
                          case 19:
                            return _context11.abrupt("return", _context11.sent);
                          case 20:
                            throw _context11.t0;
                          case 21:
                          case "end":
                            return _context11.stop();
                        }
                      }
                    }, _callee11, null, [[0, 10]]);
                  }));
                  return function performOCR() {
                    return _ref2.apply(this, arguments);
                  };
                }(); // 开始OCR识别
                _context12.next = 40;
                return performOCR();
              case 40:
                ocrData = _context12.sent;
                console.log("ocrData", ocrData);
                // 处理OCR结果
                if (!ocrData.texts) {
                  _context12.next = 76;
                  break;
                }
                // 保存当前的bookInfo，只更新识别到的字段
                currentBookInfo = _objectSpread({}, _this12.bookInfo); // 处理开本数据，如果不在预设列表中或者OCR结果中没有开本字段，则设置为默认值"32"
                formatValue = ocrData.texts.开本 || currentBookInfo.format || '32';
                if (formatValue && !_this12.formatOptions.includes(formatValue)) {
                  formatValue = "32";
                }

                // 更新识别到的字段，保留未识别到的原有值
                _this12.bookInfo = {
                  bookName: ocrData.texts.书名 || currentBookInfo.bookName || '',
                  author: ocrData.texts.作者 || currentBookInfo.author || '',
                  publisher: ocrData.texts.出版社 || currentBookInfo.publisher || '',
                  unifyIsbn: ocrData.texts.书号 || ocrData.texts.ISBN || currentBookInfo.unifyIsbn || '',
                  printTime: ocrData.texts.出版时间 || currentBookInfo.printTime || '',
                  price: ocrData.texts.定价 ? ocrData.texts.定价.replace('元', '') : currentBookInfo.price || '',
                  format: formatValue,
                  wordage: _this12.processWordage(ocrData.texts.字数) || currentBookInfo.wordage || ''
                };
                console.log("this.bookInfo", _this12.bookInfo);

                // 检查isbn
                isbn = _this12.bookInfo.isbn;
                if (!(!isbn || !/^\d{13}$/.test(isbn))) {
                  _context12.next = 60;
                  break;
                }
                _context12.prev = 50;
                _context12.next = 53;
                return new Promise(function (resolve, reject) {
                  uni.request({
                    url: 'https://api.buzhiyushu.cn/zhishu/statistic/isbn',
                    method: 'GET',
                    success: function success(res) {
                      resolve(res);
                    },
                    fail: function fail(err) {
                      reject(err);
                    }
                  });
                });
              case 53:
                isbnRes = _context12.sent;
                _this12.bookInfo.isbn = isbnRes.data;
                _context12.next = 60;
                break;
              case 57:
                _context12.prev = 57;
                _context12.t1 = _context12["catch"](50);
                console.error('获取随机ISBN失败:', _context12.t1);
              case 60:
                // 将拍摄的照片添加到fileList1中，但不上传
                newFile = {
                  url: tempFilePath,
                  status: "ready",
                  message: "待上传",
                  name: "\u8BC6\u56FE-".concat(Date.now(), ".jpg"),
                  // 使用时间戳确保唯一性
                  hidden: true,
                  // 添加hidden属性，表示不在UI中显示
                  num: "2" // 设置为第二张图片
                }; // 移除之前的识图上传图片（如果存在）

                _this12.fileList1 = _this12.fileList1.filter(function (file) {
                  return !file.name || !file.name.startsWith('识图-');
                });

                // 添加新的识图上传图片（不上传，仅保存）
                _this12.fileList1.push(newFile);
                console.log('识图图片已添加到fileList1:', _this12.fileList1);

                // 不再调用uploadFilePromise方法上传图片

                // 隐藏识别中动画
                _this12.showRecognizing = false;
                // 新增：隐藏图片预览
                _this12.previewImageUrl = '';

                // 显示识别成功提示

                uni.showToast({
                  title: '识别成功',
                  icon: 'success',
                  duration: 1500
                });

                // 隐藏相机组件
                _this12.showBcodeCamera = false;
                // 恢复显示提交按钮
                _this12.showSubmitButton = true;
                _this12.$emit('camera-status-change', false);
                // 获取在售商品信息
                if (!_this12.bookInfo.bookName) {
                  _context12.next = 75;
                  break;
                }
                _context12.next = 73;
                return _this12.fetchOnSaleProducts(_this12.bookInfo.bookName);
              case 73:
                _context12.next = 75;
                return _this12.updateAuthorAndPublisher();
              case 75:
                // 使用 setTimeout 确保在 DOM 更新后恢复数据
                setTimeout(function () {
                  // 恢复货区数据
                  _this12.selectedStorage = currentStorage;
                  _this12.warehouse = currentWarehouse;
                  _this12.shelf = currentShelf;
                  _this12.location = currentLocation;
                  _this12.selectedSheId = currentSelectedSheId;
                  _this12.selectedFreId = currentSelectedFreId;

                  // 通过 emit 事件更新 WarehouseSelector 组件
                  if (_this12.$refs.warehouseSelector) {
                    _this12.$refs.warehouseSelector.$emit('storage-selected', {
                      storage: currentStorage,
                      warehouse: currentWarehouse,
                      shelf: currentShelf,
                      location: currentLocation,
                      shelfId: currentSelectedSheId,
                      locationId: currentSelectedFreId
                    });
                  }

                  // 恢复品相选择
                  if (_this12.$refs.conditionSelect && currentCondition) {
                    _this12.$refs.conditionSelect.setSelection(currentCondition.name);
                  }
                  console.log('已恢复货区数据:', _this12.selectedStorage, _this12.warehouse, _this12.shelf, _this12.location);

                  // 强制更新整个表单
                  _this12.$forceUpdate();
                }, 300);
              case 76:
                _context12.next = 87;
                break;
              case 78:
                _context12.prev = 78;
                _context12.t2 = _context12["catch"](7);
                console.error('OCR识别失败:', _context12.t2);
                uni.showToast({
                  title: '识别失败，请重试',
                  icon: 'none',
                  duration: 2500
                });

                // 隐藏相机组件
                _this12.showBcodeCamera = false;
                // 隐藏识别中动画和图片预览
                _this12.showRecognizing = false;
                _this12.previewImageUrl = '';
                // 恢复显示提交按钮
                _this12.showSubmitButton = true;
                _this12.$emit('camera-status-change', false);
              case 87:
              case "end":
                return _context12.stop();
            }
          }
        }, _callee12, null, [[7, 78], [22, 28], [50, 57]]);
      }))();
    },
    // 取消bcode-camera
    handleBcodeCameraCancel: function handleBcodeCameraCancel() {
      var _this13 = this;
      // 保存当前的货区和品相数据
      var currentStorage = this.selectedStorage;
      var currentWarehouse = this.warehouse;
      var currentShelf = this.shelf;
      var currentLocation = this.location;
      var currentSelectedSheId = this.selectedSheId;
      var currentSelectedFreId = this.selectedFreId;

      // 保存当前的品相选择
      var currentCondition = null;
      if (this.$refs.conditionSelect) {
        currentCondition = this.$refs.conditionSelect.getSelectedCondition();
        console.log('取消时保存当前品相:', currentCondition);
      }

      // 隐藏相机组件和识别动画
      this.showBcodeCamera = false;
      this.showRecognizing = false;
      this.previewImageUrl = '';

      // 恢复显示提交按钮
      this.showSubmitButton = true;
      this.$emit('camera-status-change', false);

      // 使用 setTimeout 确保在 DOM 更新后恢复数据
      setTimeout(function () {
        // 恢复货区数据
        _this13.selectedStorage = currentStorage;
        _this13.warehouse = currentWarehouse;
        _this13.shelf = currentShelf;
        _this13.location = currentLocation;
        _this13.selectedSheId = currentSelectedSheId;
        _this13.selectedFreId = currentSelectedFreId;

        // 通过 emit 事件更新 WarehouseSelector 组件
        if (_this13.$refs.warehouseSelector) {
          _this13.$refs.warehouseSelector.$emit('storage-selected', {
            storage: currentStorage,
            warehouse: currentWarehouse,
            shelf: currentShelf,
            location: currentLocation,
            shelfId: currentSelectedSheId,
            locationId: currentSelectedFreId
          });
        }

        // 恢复品相选择
        if (_this13.$refs.conditionSelect && currentCondition) {
          _this13.$refs.conditionSelect.setSelection(currentCondition.name);
        }
        console.log('取消时已恢复货区数据:', _this13.selectedStorage, _this13.warehouse, _this13.shelf, _this13.location);

        // 强制更新整个表单
        _this13.$forceUpdate();
      }, 300);
    },
    // 添加生成ISBN的公共方法
    generateIsbn: function generateIsbn() {
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
        var response;
        return _regenerator.default.wrap(function _callee13$(_context13) {
          while (1) {
            switch (_context13.prev = _context13.next) {
              case 0:
                _context13.prev = 0;
                _context13.next = 3;
                return uni.request({
                  url: 'https://api.buzhiyushu.cn/zhishu/statistic/isbn',
                  method: 'GET'
                });
              case 3:
                response = _context13.sent;
                return _context13.abrupt("return", response.data);
              case 7:
                _context13.prev = 7;
                _context13.t0 = _context13["catch"](0);
                console.error('获取随机ISBN失败:', _context13.t0);
                throw _context13.t0;
              case 11:
              case "end":
                return _context13.stop();
            }
          }
        }, _callee13, null, [[0, 7]]);
      }))();
    },
    // 添加一个生成随机ISBN的备用方法
    generateRandomIsbn: function generateRandomIsbn() {
      // 生成符合ISBN-13格式的随机号码
      // 978是图书的EAN前缀
      var isbn = "978";

      // 添加9位随机数字
      for (var i = 0; i < 9; i++) {
        isbn += Math.floor(Math.random() * 10).toString();
      }

      // 计算校验位
      var sum = 0;
      for (var _i2 = 0; _i2 < 12; _i2++) {
        sum += parseInt(isbn[_i2]) * (_i2 % 2 === 0 ? 1 : 3);
      }
      var checkDigit = (10 - sum % 10) % 10;

      // 添加校验位
      isbn += checkDigit;
      return isbn;
    },
    // 压缩图片方法
    compressImage: function compressImage(filePath) {
      return new Promise(function (resolve, reject) {
        uni.compressImage({
          src: filePath,
          quality: 80,
          // 压缩质量，范围0-100
          compressedWidth: 800,
          // 压缩图片的宽度
          compressedHeight: 800,
          // 压缩图片的高度
          success: function success(res) {
            console.log('图片压缩成功:', res.tempFilePath);
            resolve(res.tempFilePath);
          },
          fail: function fail(err) {
            console.error('图片压缩失败:', err);
            // 如果压缩失败，返回原图
            resolve(filePath);
          }
        });
      });
    },
    // 显示印刷时间键盘
    showPrintTimeKeyboard: function showPrintTimeKeyboard() {
      // 先隐藏可能的系统键盘
      uni.hideKeyboard();
      // 显示自定义时间选择器
      this.printTimePopupVisible = true;

      // 如果已有值，解析到年月字段
      if (this.bookInfo.printTime) {
        var parts = this.bookInfo.printTime.split('/');
        if (parts.length >= 1) {
          this.printTimeYear = parts[0];
        }
        if (parts.length >= 2) {
          this.printTimeMonth = parts[1];
        }
      }
      this.printTimeActiveInput = 'year';
    },
    // 关闭印刷时间弹窗
    closePrintTimePopup: function closePrintTimePopup() {
      this.printTimePopupVisible = false;
    },
    // 输入数字
    inputPrintTimeDigit: function inputPrintTimeDigit(digit) {
      if (this.printTimeActiveInput === 'year') {
        // 年份限制为4位
        if (this.printTimeYear.length < 4) {
          this.printTimeYear += digit;
        }

        // 当年份输入完成后自动切换到月份
        if (this.printTimeYear.length === 4) {
          this.printTimeActiveInput = 'month';
        }
      } else {
        // 月份限制为2位
        if (this.printTimeMonth.length < 2) {
          this.printTimeMonth += digit;

          // 如果输入的第一位大于1，自动补0
          if (this.printTimeMonth.length === 1 && parseInt(this.printTimeMonth) > 1) {
            this.printTimeMonth = '0' + this.printTimeMonth;
          }

          // 如果输入的值大于12，设为12
          if (parseInt(this.printTimeMonth) > 12) {
            this.printTimeMonth = '12';
          }
        }
      }
    },
    // 删除数字
    deletePrintTimeDigit: function deletePrintTimeDigit() {
      if (this.printTimeActiveInput === 'month') {
        if (this.printTimeMonth.length > 0) {
          this.printTimeMonth = this.printTimeMonth.slice(0, -1);
        } else {
          // 如果月份已经为空，切换到年份
          this.printTimeActiveInput = 'year';
        }
      }
      if (this.printTimeActiveInput === 'year') {
        if (this.printTimeYear.length > 0) {
          this.printTimeYear = this.printTimeYear.slice(0, -1);
        }
      }
    },
    // 使用当前日期
    useCurrentDate: function useCurrentDate() {
      this.autoFillSelected = !this.autoFillSelected;
      if (this.autoFillSelected) {
        var now = new Date();
        this.printTimeYear = now.getFullYear().toString();
        this.printTimeMonth = (now.getMonth() + 1).toString().padStart(2, '0');
        this.printTimeActiveInput = 'month';
      } else {
        // 如果取消自动填充，清空输入
        this.printTimeYear = '';
        this.printTimeMonth = '';
        this.printTimeActiveInput = 'year';
      }
    },
    // 确认印刷时间
    confirmPrintTime: function confirmPrintTime() {
      var printTime = '';
      if (this.printTimeYear) {
        printTime = this.printTimeYear;
        if (this.printTimeMonth) {
          printTime += '/' + this.printTimeMonth;
        }
      }
      this.bookInfo.printTime = printTime;
      this.closePrintTimePopup();
    },
    // 添加选择年代的方法
    selectDecade: function selectDecade(decadePrefix) {
      // 切换到填写时间选项卡
      this.printTimeTab = 'input';
      // 自动填充年份为选择的年代中间年份（如1950年代填充为1955）
      this.printTimeYear = decadePrefix + '5';
      // 清空月份
      this.printTimeMonth = '';
      // 焦点切换到月份
      this.printTimeActiveInput = 'month';
      // 取消自动填充选择
      this.autoFillSelected = false;
    },
    // 添加resetData方法用于下拉刷新
    resetData: function resetData() {
      var _this14 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
        var currentStorage, currentWarehouse, currentShelf, currentLocation, currentSelectedSheId, currentSelectedFreId;
        return _regenerator.default.wrap(function _callee14$(_context14) {
          while (1) {
            switch (_context14.prev = _context14.next) {
              case 0:
                // 保存当前的货区数据
                currentStorage = _this14.selectedStorage;
                currentWarehouse = _this14.warehouse;
                currentShelf = _this14.shelf;
                currentLocation = _this14.location;
                currentSelectedSheId = _this14.selectedSheId;
                currentSelectedFreId = _this14.selectedFreId; // 重置表单数据
                _this14.bookInfo = {
                  bookName: '',
                  author: '',
                  publisher: '',
                  format: '',
                  printTime: '',
                  isbn: '',
                  price: '',
                  wordage: '',
                  unifyIsbn: ''
                };

                // 重置其他数据
                _this14.value4 = 1.00; // 重置价格
                _this14.value3 = 1; // 重置库存
                _this14.fileList1 = []; // 清空图片列表
                _this14.uploadedImages = []; // 清空已上传图片
                _this14.hasShownUploadMessage = false;

                // 重置市场标签
                _this14.marketTags = [{
                  label: '在售:',
                  value: 0
                }, {
                  label: '旧:',
                  value: 0
                }, {
                  label: '新:',
                  value: 0
                }, {
                  label: '已售:',
                  value: 0
                }];

                // 重置在售商品列表
                _this14.onSaleProducts = [];
                _this14.displayOnSaleProducts = [];

                // 重置下拉选项
                _this14.authorOptions = [];
                _this14.publisherOptions = [];
                _this14.authorDropdownVisible = false;
                _this14.publisherDropdownVisible = false;
                _this14.formatDropdownVisible = false;

                // 重置分类选择
                _this14.categoryIndexes = [];
                _this14.categoryPathText = '';
                _this14.selectedCategoryId = '';
                _this14.categoryLevels = [];
                _this14.initCategoryPicker(); // 重新初始化选择器

                // 等待DOM更新
                _context14.next = 27;
                return _this14.$nextTick();
              case 27:
                // 恢复货区数据
                _this14.selectedStorage = currentStorage;
                _this14.warehouse = currentWarehouse;
                _this14.shelf = currentShelf;
                _this14.location = currentLocation;
                _this14.selectedSheId = currentSelectedSheId;
                _this14.selectedFreId = currentSelectedFreId;

                // 重置品相选择
                if (_this14.$refs.conditionSelect) {
                  _this14.$refs.conditionSelect.resetSelection();
                }

                // 重置在售商品组件
                if (_this14.$refs.onSaleProductsComponent) {
                  _this14.$refs.onSaleProductsComponent.updateProducts([]);
                }

                // 通过emit事件更新WarehouseSelector组件
                if (_this14.$refs.warehouseSelector) {
                  _this14.$refs.warehouseSelector.$emit('storage-selected', {
                    storage: currentStorage,
                    warehouse: currentWarehouse,
                    shelf: currentShelf,
                    location: currentLocation,
                    shelfId: currentSelectedSheId,
                    locationId: currentSelectedFreId
                  });
                }

                // 强制更新视图
                _this14.$forceUpdate();
              case 37:
              case "end":
                return _context14.stop();
            }
          }
        }, _callee14);
      }))();
    },
    // 处理OCR识别的字数，将"千字"转换为实际数字
    processWordage: function processWordage(wordage) {
      if (!wordage) return '';

      // 检查是否包含"千字"
      if (typeof wordage === 'string' && wordage.includes('千字')) {
        // 提取数字部分
        var numMatch = wordage.match(/(\d+(\.\d+)?)/);
        if (numMatch && numMatch[1]) {
          // 将数字乘以1000
          var num = parseFloat(numMatch[1]) * 1000;
          return Math.round(num).toString(); // 四舍五入并转为字符串
        }
      }

      return wordage;
    },
    // 获取图书分类数据
    fetchCategoryData: function fetchCategoryData() {
      var _this15 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
        var cookies, res, responseData;
        return _regenerator.default.wrap(function _callee15$(_context15) {
          while (1) {
            switch (_context15.prev = _context15.next) {
              case 0:
                _context15.prev = 0;
                console.log('开始获取分类数据...');
                // 获取cookies作为token
                cookies = uni.getStorageSync('cookies');
                console.log('获取到的cookies:', cookies);

                // if (!cookies) {
                // 	console.error('获取分类失败: 未找到cookies');
                // 	uni.showToast({
                // 		title: '请先登录获取授权',
                // 		icon: 'none',
                // 		duration: 2000
                // 	});
                // 	return;
                // }

                console.log('使用token获取分类数据...');
                uni.showLoading({
                  title: '加载分类...'
                });

                // 调用后端接口获取分类数据
                console.log('发起API请求到:', 'https://api.buzhiyushu.cn/api/kongfz/getCategory');
                _context15.next = 9;
                return uni.request({
                  url: 'https://api.buzhiyushu.cn/api/kongfz/getCategory',
                  method: 'GET',
                  data: {
                    token: cookies
                  },
                  header: {
                    'Content-Type': 'application/json'
                  }
                });
              case 9:
                res = _context15.sent;
                uni.hideLoading();
                console.log('分类数据API响应:', res);
                console.log('响应状态码:', res.statusCode);

                // 处理返回的数据，兼容不同格式
                responseData = Array.isArray(res) ? res[1].data : res.data;
                console.log('处理后的responseData:', responseData);
                if (responseData && responseData.successResponse) {
                  // 保存完整的分类数据
                  _this15.categoryList = responseData.successResponse;
                  console.log('分类数据获取成功，开始初始化选择器');
                  _this15.initCategoryPicker();
                  console.log('分类数据获取成功:', _this15.categoryList);
                } else {
                  console.error('获取分类数据失败, 响应不符合预期:', responseData);
                  console.log('responseData类型:', (0, _typeof2.default)(responseData));
                  console.log('responseData内容:', JSON.stringify(responseData));
                  uni.showToast({
                    title: '获取分类数据失败',
                    icon: 'none',
                    duration: 2000
                  });
                }
                _context15.next = 24;
                break;
              case 18:
                _context15.prev = 18;
                _context15.t0 = _context15["catch"](0);
                uni.hideLoading();
                console.error('获取分类数据异常:', _context15.t0);
                console.error('错误详情:', _context15.t0.message);
                uni.showToast({
                  title: '获取分类数据失败',
                  icon: 'none',
                  duration: 2000
                });
              case 24:
              case "end":
                return _context15.stop();
            }
          }
        }, _callee15, null, [[0, 18]]);
      }))();
    },
    // 分类数据初始化
    initCategoryPicker: function initCategoryPicker() {
      console.log('initCategoryPicker开始执行');
      console.log('原始categoryList:', this.categoryList);

      // 初始化分类选择器数据
      this.categoryColumns = []; // 清空所有列
      this.categoryLevels = []; // 清空选中的分类对象
      this.categoryIndexes = []; // 清空索引

      // 过滤出一级分类
      var level1Categories = (this.categoryList || []).filter(function (item) {
        return item.level === 1;
      });

      // 如果没有数据，提供默认值
      if (level1Categories.length === 0) {
        // 设置一个默认的空分类
        this.categoryColumns = Array(this.maxCategoryLevel).fill([{
          name: '暂无数据',
          id: ''
        }]);
        this.categoryIndexes = Array(this.maxCategoryLevel).fill(0);
        this.categoryPathText = '';
        this.selectedCategoryId = '';
        console.log('没有分类数据，使用默认空分类');
        return;
      }

      // 设置第一列(一级分类)
      this.categoryColumns[0] = level1Categories;
      this.categoryIndexes[0] = 0;

      // 递归初始化所有可能的列
      var currentParent = level1Categories[0];
      var currentLevel = 1;
      this.categoryLevels[0] = currentParent; // 保存一级分类

      while (currentLevel < this.maxCategoryLevel) {
        // 检查当前选中分类是否有子分类
        var children = currentParent.children || [];

        // 如果没有子分类或者已经到达最大级别，就中断循环
        if (children.length === 0) {
          break;
        }

        // 设置下一列数据
        this.categoryColumns[currentLevel] = children;
        this.categoryIndexes[currentLevel] = 0;
        this.categoryLevels[currentLevel] = children[0];

        // 继续下一级
        currentParent = children[0];
        currentLevel++;
      }

      // 填充剩余的列（如果需要）
      while (this.categoryColumns.length < this.maxCategoryLevel) {
        this.categoryColumns.push([{
          name: '暂无数据',
          id: ''
        }]);
        this.categoryIndexes.push(0);
        this.categoryLevels.push({
          name: '暂无数据',
          id: ''
        });
      }

      // 设置分类路径文本
      this.updateCategoryPathText();

      // 设置选中的分类ID（叶子节点的ID）
      this.updateSelectedCategoryId();
      console.log('初始化后的分类数据:', {
        categoryColumns: this.categoryColumns,
        categoryIndexes: this.categoryIndexes,
        categoryLevels: this.categoryLevels,
        categoryPathText: this.categoryPathText,
        selectedCategoryId: this.selectedCategoryId
      });
      console.log('initCategoryPicker执行完成');
    },
    // 处理多列选择器的列变化
    onCategoryColumnChange: function onCategoryColumnChange(e) {
      // 获取当前变化的列和选中的值
      var _e$detail = e.detail,
        column = _e$detail.column,
        value = _e$detail.value;
      console.log("\u5217\u53D8\u5316: \u7B2C".concat(column, "\u5217, \u503C=").concat(value));

      // 更新对应列的索引
      this.categoryIndexes[column] = value;

      // 更新选中的分类对象
      this.categoryLevels[column] = this.categoryColumns[column][value];

      // 如果不是最后一列，需要级联更新后续列
      if (column < this.maxCategoryLevel - 1) {
        // 从当前列的下一列开始，重置所有后续列
        this.updateSubsequentColumns(column + 1);
      }

      // 更新分类路径和选中ID
      this.updateCategoryPathText();
      this.updateSelectedCategoryId();
      console.log('列变化后的分类数据:', {
        categoryColumns: this.categoryColumns,
        categoryIndexes: this.categoryIndexes,
        categoryLevels: this.categoryLevels
      });
    },
    // 更新后续列的数据
    updateSubsequentColumns: function updateSubsequentColumns(startColumn) {
      // 获取前一列选中的分类对象
      var parentCategory = this.categoryLevels[startColumn - 1];

      // 如果父分类不存在或没有子分类，则清空后续所有列
      if (!parentCategory || !parentCategory.children || parentCategory.children.length === 0) {
        // 从startColumn开始，设置所有后续列为空数据
        for (var i = startColumn; i < this.maxCategoryLevel; i++) {
          this.categoryColumns[i] = [{
            name: '暂无数据',
            id: ''
          }];
          this.categoryIndexes[i] = 0;
          this.categoryLevels[i] = {
            name: '暂无数据',
            id: ''
          };
        }
        return;
      }

      // 设置当前列的数据为父分类的子分类
      this.categoryColumns[startColumn] = parentCategory.children;
      this.categoryIndexes[startColumn] = 0;
      this.categoryLevels[startColumn] = parentCategory.children[0];

      // 如果当前列不是最后一列，继续递归更新后续列
      if (startColumn < this.maxCategoryLevel - 1) {
        this.updateSubsequentColumns(startColumn + 1);
      }
    },
    // 处理多列选择器最终选择确认
    onCategoryChange: function onCategoryChange(e) {
      var values = e.detail.value;
      console.log('分类选择确认:', values);

      // 更新所有列的索引
      this.categoryIndexes = (0, _toConsumableArray2.default)(values);

      // 更新每个级别选中的分类对象
      for (var i = 0; i < values.length; i++) {
        // 确保该列存在数据
        if (this.categoryColumns[i] && this.categoryColumns[i][values[i]]) {
          this.categoryLevels[i] = this.categoryColumns[i][values[i]];
        }
      }

      // 更新分类路径和选中ID
      this.updateCategoryPathText();
      this.updateSelectedCategoryId();
      console.log('已选择分类路径:', this.categoryPathText);
      console.log('已选择分类ID:', this.selectedCategoryId);
    },
    // 更新分类路径显示文本
    updateCategoryPathText: function updateCategoryPathText() {
      // 过滤出有效的分类名称（排除"暂无数据"）
      var validLevels = this.categoryLevels.filter(function (level) {
        return level && level.name && level.name !== '暂无数据';
      });

      // 用斜杠连接所有级别的名称
      this.categoryPathText = validLevels.map(function (level) {
        return level.name;
      }).join(' / ');
      console.log('更新分类路径文本:', this.categoryPathText);
    },
    // 更新选中的分类ID（最终叶子节点的ID）
    updateSelectedCategoryId: function updateSelectedCategoryId() {
      // 获取有效的分类级别（排除"暂无数据"）
      var validLevels = this.categoryLevels.filter(function (level) {
        return level && level.id && level.id !== '';
      });

      // 如果没有有效级别，则返回空字符串
      if (validLevels.length === 0) {
        this.selectedCategoryId = '';
        return;
      }

      // 选择最后一个有效级别的ID作为选中的分类ID
      this.selectedCategoryId = validLevels[validLevels.length - 1].id;
      console.log('更新选中的分类ID:', this.selectedCategoryId);
    }
  }
};
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))

/***/ }),

/***/ 345:
/*!******************************************************************************************************************************************************!*\
  !*** C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue?vue&type=style&index=0&id=22102fb8&scoped=true&lang=css& ***!
  \******************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_2_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--6-oneOf-1-2!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src??ref--6-oneOf-1-3!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../uni-app/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=style&index=0&id=22102fb8&scoped=true&lang=css& */ 346);
/* harmony import */ var _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_2_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_2_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_2_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _uni_app_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_2_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
 /* harmony default export */ __webpack_exports__["default"] = (_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_2_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_uni_app_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_22102fb8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

/***/ 346:
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--6-oneOf-1-2!./node_modules/postcss-loader/src??ref--6-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/Administrator/Documents/HBuilderProjects/zhizhu/pages/photo-upload/index.vue?vue&type=style&index=0&id=22102fb8&scoped=true&lang=css& ***!
  \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

// extracted by mini-css-extract-plugin
    if(false) { var cssReload; }
  

/***/ })

}]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/photo-upload/index.js.map
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/photo-upload/index-create-component',
    {
        'pages/photo-upload/index-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('2')['createComponent'](__webpack_require__(339))
        })
    },
    [['pages/photo-upload/index-create-component']]
]);
