diff --git a/build/vue.config.js b/build/vue.config.js index 3e79d6a116004a34c8e58f17fa8d55940c9a2e53..863a9ba6a8399e46514c1378a56fe87d62c4532d 100644 --- a/build/vue.config.js +++ b/build/vue.config.js @@ -24,6 +24,7 @@ module.exports = { transpileDependencies: [], productionSourceMap: false, configureWebpack: webpackConfig, + parallel: process.env.UNI_PLATFORM !== 'h5' || process.env.UNI_WATCH !== 'false' || process.env.UNI_UI === 'true', chainWebpack: config => { config.devtool('source-map') @@ -44,4 +45,4 @@ module.exports = { css: { extract: true } -} +} diff --git a/packages/uni-app-plus/dist/view.css b/packages/uni-app-plus/dist/view.css index 8abb27c8436e5115990efaba03c8d184a3330395..315c509c7ebedfb066c58c0ee0aa10f15060da32 100644 --- a/packages/uni-app-plus/dist/view.css +++ b/packages/uni-app-plus/dist/view.css @@ -880,11 +880,6 @@ uni-picker-view[hidden] { } -uni-picker { - display: block; -} - - uni-progress { display: -webkit-flex; display: -webkit-box; diff --git a/packages/uni-app-plus/dist/view.umd.js b/packages/uni-app-plus/dist/view.umd.js index 513bdf76dc17716fbe518c0c6e981a48b2c97bc7..c1a6eecaa3a386d2c400ef369a43074389b012c4 100644 --- a/packages/uni-app-plus/dist/view.umd.js +++ b/packages/uni-app-plus/dist/view.umd.js @@ -10532,262 +10532,8 @@ function processTouches(target, touches) { /***/ }), -/* 27 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -// -// -// -// -// -// -// -// - -var _UniViewJSBridge = UniViewJSBridge, - subscribe = _UniViewJSBridge.subscribe, - unsubscribe = _UniViewJSBridge.unsubscribe, - publishHandler = _UniViewJSBridge.publishHandler; -var mode = { - SELECTOR: 'selector', - MULTISELECTOR: 'multiSelector', - TIME: 'time', - DATE: 'date' // 暂不支持城市选择 - // REGION: 'region' - -}; -var fields = { - YEAR: 'year', - MONTH: 'month', - DAY: 'day' -}; -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Picker', - mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"]], - props: { - name: { - type: String, - default: '' - }, - range: { - type: Array, - default: function _default() { - return []; - } - }, - rangeKey: { - type: String, - default: '' - }, - value: { - type: [Number, String, Array], - default: 0 - }, - mode: { - type: String, - default: mode.SELECTOR, - validator: function validator(val) { - return Object.values(mode).indexOf(val) >= 0; - } - }, - fields: { - type: String, - default: 'day', - validator: function validator(val) { - return Object.values(fields).indexOf(val) >= 0; - } - }, - start: { - type: String, - default: function _default() { - if (this.mode === mode.TIME) { - return '00:00'; - } - - if (this.mode === mode.DATE) { - var year = new Date().getFullYear() - 100; - - switch (this.fields) { - case fields.YEAR: - return year; - - case fields.MONTH: - return year + '-01'; - - case fields.DAY: - return year + '-01-01'; - } - } - - return ''; - } - }, - end: { - type: String, - default: function _default() { - if (this.mode === mode.TIME) { - return '23:59'; - } - - if (this.mode === mode.DATE) { - var year = new Date().getFullYear() + 100; - - switch (this.fields) { - case fields.YEAR: - return year; - - case fields.MONTH: - return year + '-12'; - - case fields.DAY: - return year + '-12-31'; - } - } - - return ''; - } - }, - disabled: { - type: [Boolean, String], - default: false - } - }, - data: function data() { - return { - valueSync: this.value || 0, - visible: false, - valueChangeSource: '' - }; - }, - watch: { - value: function value(val) { - var _this = this; - - if (Array.isArray(val)) { - if (!Array.isArray(this.valueSync)) { - this.valueSync = []; - } - - this.valueSync.length = val.length; - val.forEach(function (val, index) { - if (val !== _this.valueSync[index]) { - _this.$set(_this.valueSync, index, val); - } - }); - } else if (_typeof(val) !== 'object') { - this.valueSync = val; - } - }, - valueSync: function valueSync(val) { - if (!this.valueChangeSource) { - this._show(); - } else { - this.$emit('update:value', val); - } - } - }, - created: function created() { - var _this2 = this; - - this.$dispatch('Form', 'uni-form-group-update', { - type: 'add', - vm: this - }); - Object.keys(this.$props).forEach(function (key) { - if (key !== 'value' && key !== 'name') { - _this2.$watch(key, _this2._show); - } - }); - }, - beforeDestroy: function beforeDestroy() { - this.$dispatch('Form', 'uni-form-group-update', { - type: 'remove', - vm: this - }); - }, - destroyed: function destroyed() { - if (this.visible) { - var id = this.$page.id; - publishHandler('hidePicker', {}, id); - } - }, - methods: { - _click: function _click() { - if (this.disabled) { - return; - } - - var id = this.$page.id; - subscribe("".concat(id, "-picker-change"), this.change); - subscribe("".concat(id, "-picker-columnchange"), this.columnchange); - subscribe("".concat(id, "-picker-cancel"), this.cancel); - this.visible = true; - - this._show(); - }, - _show: function _show() { - if (this.visible) { - var id = this.$page.id; - var options = Object.assign({}, this.$props); - options.value = this.valueSync; - publishHandler('showPicker', options, id); - } - }, - change: function change(args) { - this.visible = false; - var id = this.$page.id; - unsubscribe("".concat(id, "-picker-change")); - unsubscribe("".concat(id, "-picker-columnchange")); - unsubscribe("".concat(id, "-picker-cancel")); - - if (!this.disabled) { - this.valueChangeSource = 'click'; - var value = args.value; - this.valueSync = Array.isArray(value) ? value.map(function (val) { - return val; - }) : value; - this.$trigger('change', {}, { - value: value - }); - } - }, - columnchange: function columnchange(args) { - this.$trigger('columnchange', {}, args); - }, - cancel: function cancel(args) { - this.visible = false; - var id = this.$page.id; - unsubscribe("".concat(id, "-picker-change")); - unsubscribe("".concat(id, "-picker-columnchange")); - unsubscribe("".concat(id, "-picker-cancel")); - this.$trigger('cancel', {}, {}); - }, - _getFormData: function _getFormData() { - return { - value: this.valueSync, - key: this.name - }; - }, - _resetFormData: function _resetFormData() { - this.valueSync = ''; - } - } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3))) - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - - -/***/ }), +/* 27 */, +/* 28 */, /* 29 */ /***/ (function(module, exports, __webpack_require__) { @@ -12076,7 +11822,7 @@ function destroyComponentObserver(_ref2) { /* 49 */ /***/ (function(module, exports) { -module.exports = ['uni-app', 'uni-tabbar', 'uni-page', 'uni-page-head', 'uni-page-wrapper', 'uni-page-body', 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', 'uni-picker', 'uni-toast', 'uni-resize-sensor', 'uni-ad', 'uni-audio', 'uni-button', 'uni-camera', 'uni-canvas', 'uni-checkbox', 'uni-checkbox-group', 'uni-cover-image', 'uni-cover-view', 'uni-form', 'uni-functional-page-navigator', 'uni-icon', 'uni-image', 'uni-input', 'uni-label', 'uni-live-player', 'uni-live-pusher', 'uni-map', 'uni-movable-area', 'uni-movable-view', 'uni-navigator', 'uni-official-account', 'uni-open-data', 'uni-picker', 'uni-picker-view', 'uni-picker-view-column', 'uni-progress', 'uni-radio', 'uni-radio-group', 'uni-rich-text', 'uni-scroll-view', 'uni-slider', 'uni-swiper', 'uni-swiper-item', 'uni-switch', 'uni-text', 'uni-textarea', 'uni-video', 'uni-view', 'uni-web-view']; +module.exports = ['uni-app', 'uni-tabbar', 'uni-page', 'uni-page-head', 'uni-page-wrapper', 'uni-page-body', 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', 'uni-toast', 'uni-resize-sensor', 'uni-ad', 'uni-audio', 'uni-button', 'uni-camera', 'uni-canvas', 'uni-checkbox', 'uni-checkbox-group', 'uni-cover-image', 'uni-cover-view', 'uni-form', 'uni-functional-page-navigator', 'uni-icon', 'uni-image', 'uni-input', 'uni-label', 'uni-live-player', 'uni-live-pusher', 'uni-map', 'uni-movable-area', 'uni-movable-view', 'uni-navigator', 'uni-official-account', 'uni-open-data', 'uni-picker', 'uni-picker-view', 'uni-picker-view-column', 'uni-progress', 'uni-radio', 'uni-radio-group', 'uni-rich-text', 'uni-scroll-view', 'uni-slider', 'uni-swiper', 'uni-swiper-item', 'uni-switch', 'uni-text', 'uni-textarea', 'uni-video', 'uni-view', 'uni-web-view']; /***/ }), /* 50 */ @@ -14294,7 +14040,6 @@ var map = { "./navigator/index.vue": 95, "./picker-view-column/index.vue": 119, "./picker-view/index.vue": 117, - "./picker/index.vue": 113, "./progress/index.vue": 108, "./radio-group/index.vue": 107, "./radio/index.vue": 105, @@ -14452,16 +14197,7 @@ webpackContext.id = 66; /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), -/* 79 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28); -/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__); -/* unused harmony reexport * */ - /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); - -/***/ }), +/* 79 */, /* 80 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -20229,73 +19965,7 @@ component.options.__file = "src/core/view/components/label/index.vue" /* harmony default export */ var label = __webpack_exports__["default"] = (component.exports); /***/ }), -/* 113 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"70784d34-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/picker/index.vue?vue&type=template&id=bcf74e32& -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "uni-picker", - { - on: { - click: function($event) { - $event.stopPropagation() - return _vm._click($event) - } - } - }, - [_c("div", [_vm._t("default")], 2)] - ) -} -var staticRenderFns = [] -render._withStripped = true - - -// CONCATENATED MODULE: ./src/core/view/components/picker/index.vue?vue&type=template&id=bcf74e32& - -// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/picker/index.vue?vue&type=script&lang=js& -var pickervue_type_script_lang_js_ = __webpack_require__(27); - -// CONCATENATED MODULE: ./src/core/view/components/picker/index.vue?vue&type=script&lang=js& - /* harmony default export */ var components_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_["a" /* default */]); -// EXTERNAL MODULE: ./src/core/view/components/picker/index.vue?vue&type=style&index=0&lang=css& -var pickervue_type_style_index_0_lang_css_ = __webpack_require__(79); - -// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js -var componentNormalizer = __webpack_require__(0); - -// CONCATENATED MODULE: ./src/core/view/components/picker/index.vue - - - - - - -/* normalize component */ - -var component = Object(componentNormalizer["a" /* default */])( - components_pickervue_type_script_lang_js_, - render, - staticRenderFns, - false, - null, - null, - null - -) - -/* hot reload */ -if (false) { var api; } -component.options.__file = "src/core/view/components/picker/index.vue" -/* harmony default export */ var picker = __webpack_exports__["default"] = (component.exports); - -/***/ }), +/* 113 */, /* 114 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { diff --git a/packages/uni-stat/dist/index.js b/packages/uni-stat/dist/index.js index e6123a3a2cb38838e9732f95ae9d5cd876c615f8..b157bc34836ffcfddfbf6517b039f10b797d899a 100644 --- a/packages/uni-stat/dist/index.js +++ b/packages/uni-stat/dist/index.js @@ -650,8 +650,8 @@ class Util { // }, data: optionsData, success: () => { - // if (process.env.NODE_ENV === 'development') { - // console.log('stat request success'); + // if (process.env.NODE_ENV === 'development') { + // console.log('stat request success'); // } }, fail: (e) => { @@ -699,7 +699,7 @@ class Stat extends Util { super(); this.instance = null; // 注册拦截器 - if (typeof uni.addInterceptor === 'function') { + if (typeof uni.addInterceptor === 'function' && process.env.NODE_ENV !== 'development') { this.addInterceptorInit(); this.interceptLogin(); this.interceptShare(true); @@ -776,7 +776,7 @@ class Stat extends Util { this.self = self; if (getPageTypes(self)) { this._pageShow(self); - } else { + } else { this._applicationShow(self); } } diff --git a/packages/uni-stat/src/stat.js b/packages/uni-stat/src/stat.js index 88a74f7b80562449a2b070b9e85fd5668bb9a9af..bf5d1490a9904036bb264a77607280575d28ef8c 100644 --- a/packages/uni-stat/src/stat.js +++ b/packages/uni-stat/src/stat.js @@ -382,8 +382,8 @@ class Util { // }, data: optionsData, success: () => { - // if (process.env.NODE_ENV === 'development') { - // console.log('stat request success'); + // if (process.env.NODE_ENV === 'development') { + // console.log('stat request success'); // } }, fail: (e) => { @@ -431,7 +431,7 @@ class Stat extends Util { super() this.instance = null; // 注册拦截器 - if (typeof uni.addInterceptor === 'function') { + if (typeof uni.addInterceptor === 'function' && process.env.NODE_ENV !== 'development') { this.addInterceptorInit(); this.interceptLogin(); this.interceptShare(true); @@ -508,7 +508,7 @@ class Stat extends Util { this.self = self; if (getPageTypes(self)) { this._pageShow(self); - } else { + } else { this._applicationShow(self); } } diff --git a/packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/component.js b/packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/component.js index 9b6edfc7ed5163e1c0bba62e00102232b85a0d9a..f8584d17309bf2c388ea218c2a97ea481a9f48f5 100644 --- a/packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/component.js +++ b/packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/component.js @@ -6,16 +6,26 @@ const { capitalize } = require('./util') -const platformTags = ['audio', 'map', 'video', 'web-view', 'cover-view', 'cover-image'] +const platformTags = ['audio', 'map', 'video', 'web-view', 'cover-view', 'cover-image', 'picker'] -//input 在 pageHead 中有使用,resize-sensor 在很多组件中有使用,暂时直接加载 -const autoloadTags = ['input', 'resize-sensor'] +const autoloadTags = { + // input 在 pageHead 中有使用,resize-sensor 在很多组件中有使用,暂时直接加载 + root: ['input', 'resize-sensor'], + other: { + picker: ['picker-view', 'picker-view-column'] + } +} module.exports = function updateComponents(tags) { - autoloadTags.forEach(tagName => { + autoloadTags.root.forEach(tagName => { tags.add(tagName) }) tags = [...tags] + Object.keys(autoloadTags.other).forEach(tagName => { + if (tags.includes(tagName)) { + tags.push(...autoloadTags.other[tagName]) + } + }) const importsStr = tags.map(tagName => { if (platformTags.indexOf(tagName) !== -1) { return `import ${capitalize(camelize(tagName))} from 'uni-platform/view/components/${tagName}'` @@ -44,4 +54,4 @@ ${componentsStr} fs.writeFileSync(path.resolve(dir, 'components.js'), content, 'utf8') -} +} diff --git a/packages/webpack-uni-pages-loader/lib/platforms/h5.js b/packages/webpack-uni-pages-loader/lib/platforms/h5.js index 8037667181a2a8c426fc667bd3a0e81337b6976c..73c5a47a30e5caf8bd7a2eb749cdf26489592799 100644 --- a/packages/webpack-uni-pages-loader/lib/platforms/h5.js +++ b/packages/webpack-uni-pages-loader/lib/platforms/h5.js @@ -93,9 +93,9 @@ const getPageComponents = function (inputDir, pagesJson) { let windowTop = 44 let pageStyle = Object.assign({}, globalStyle, props) - if (pageStyle.navigationStyle === 'custom' || (props.titleNView && props.titleNView.type === - 'transparent')) { - windowTop = 0 + if (pageStyle.navigationStyle === 'custom' || !pageStyle.titleNView || pageStyle.titleNView.type === + 'transparent' || pageStyle.titleNView.type === 'float') { + windowTop = 0 } // 删除 app-plus 平台配置 diff --git a/src/core/helpers/tags.js b/src/core/helpers/tags.js index 664a5779280ca10d9659514965296e0b745c927d..42b16a8c7579994d595e5ecd642170ff43c9a7cc 100644 --- a/src/core/helpers/tags.js +++ b/src/core/helpers/tags.js @@ -8,7 +8,6 @@ module.exports = [ 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', - 'uni-picker', 'uni-toast', 'uni-resize-sensor', diff --git a/src/core/view/components/picker/index.vue b/src/core/view/components/picker/index.vue deleted file mode 100644 index e53c382fdc06c309c010ea667c4ba13df91f02ec..0000000000000000000000000000000000000000 --- a/src/core/view/components/picker/index.vue +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - diff --git a/src/platforms/h5/components/app/index.vue b/src/platforms/h5/components/app/index.vue index 0a0e4b9ad37e0c0872e86c9ad8d98194cca06026..a79dd7dd39d50cd55eb7aac147769125e7063c14 100644 --- a/src/platforms/h5/components/app/index.vue +++ b/src/platforms/h5/components/app/index.vue @@ -10,21 +10,17 @@ v-if="hasTabBar" v-show="showTabBar" v-bind="tabBar" /> - - - - - + + + + + + + + + 取消 + 确定 + + + + {{ typeof item==='object'?item[rangeKey]||'':item }}{{ units[index0]||'' }} + + + + + + + + + + + + + + +