u-subsection.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["uview-ui/components/u-subsection/u-subsection"],{
  2. /***/ 402:
  3. /*!****************************************************************************************!*\
  4. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue ***!
  5. \****************************************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8. "use strict";
  9. __webpack_require__.r(__webpack_exports__);
  10. /* harmony import */ var _u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./u-subsection.vue?vue&type=template&id=b14d3440&scoped=true& */ 403);
  11. /* harmony import */ var _u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./u-subsection.vue?vue&type=script&lang=js& */ 405);
  12. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  13. /* harmony import */ var _u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./u-subsection.vue?vue&type=style&index=0&id=b14d3440&lang=scss&scoped=true& */ 407);
  14. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 10);
  15. var renderjs
  16. /* normalize component */
  17. var component = Object(_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  18. _u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  19. _u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  20. _u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  21. false,
  22. null,
  23. "b14d3440",
  24. null,
  25. false,
  26. _u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
  27. renderjs
  28. )
  29. component.options.__file = "uview-ui/components/u-subsection/u-subsection.vue"
  30. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  31. /***/ }),
  32. /***/ 403:
  33. /*!***********************************************************************************************************************************!*\
  34. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue?vue&type=template&id=b14d3440&scoped=true& ***!
  35. \***********************************************************************************************************************************/
  36. /*! exports provided: render, staticRenderFns, recyclableRender, components */
  37. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38. "use strict";
  39. __webpack_require__.r(__webpack_exports__);
  40. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./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--16-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!./u-subsection.vue?vue&type=template&id=b14d3440&scoped=true& */ 404);
  41. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  42. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  43. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
  44. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_template_id_b14d3440_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
  45. /***/ }),
  46. /***/ 404:
  47. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  48. !*** ./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--16-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!D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue?vue&type=template&id=b14d3440&scoped=true& ***!
  49. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  50. /*! exports provided: render, staticRenderFns, recyclableRender, components */
  51. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52. "use strict";
  53. __webpack_require__.r(__webpack_exports__);
  54. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  55. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  56. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
  57. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
  58. var components
  59. var render = function() {
  60. var _vm = this
  61. var _h = _vm.$createElement
  62. var _c = _vm._self._c || _h
  63. var s0 = _vm.__get_style([_vm.subsectionStyle])
  64. var l0 = _vm.__map(_vm.listInfo, function(item, index) {
  65. var $orig = _vm.__get_orig(item)
  66. var s1 = _vm.__get_style([_vm.itemStyle(index)])
  67. var m0 = _vm.noBorderRight(index)
  68. var s2 = _vm.__get_style([_vm.textStyle(index)])
  69. return {
  70. $orig: $orig,
  71. s1: s1,
  72. m0: m0,
  73. s2: s2
  74. }
  75. })
  76. var s3 = _vm.__get_style([_vm.itemBarStyle])
  77. _vm.$mp.data = Object.assign(
  78. {},
  79. {
  80. $root: {
  81. s0: s0,
  82. l0: l0,
  83. s3: s3
  84. }
  85. }
  86. )
  87. }
  88. var recyclableRender = false
  89. var staticRenderFns = []
  90. render._withStripped = true
  91. /***/ }),
  92. /***/ 405:
  93. /*!*****************************************************************************************************************!*\
  94. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue?vue&type=script&lang=js& ***!
  95. \*****************************************************************************************************************/
  96. /*! no static exports found */
  97. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98. "use strict";
  99. __webpack_require__.r(__webpack_exports__);
  100. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-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!./u-subsection.vue?vue&type=script&lang=js& */ 406);
  101. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  102. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  103. /* harmony default export */ __webpack_exports__["default"] = (_E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  104. /***/ }),
  105. /***/ 406:
  106. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  107. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-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!D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue?vue&type=script&lang=js& ***!
  108. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. "use strict";
  112. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; //
  113. //
  114. //
  115. //
  116. //
  117. //
  118. //
  119. //
  120. //
  121. //
  122. /**
  123. * subsection 分段器
  124. * @description 该分段器一般用于用户从几个选项中选择某一个的场景
  125. * @tutorial https://www.uviewui.com/components/subsection.html
  126. * @property {Array} list 选项的数组,形式见上方"基本使用"
  127. * @property {String Number} current 初始化时默认选中的选项索引值(默认0)
  128. * @property {String} active-color 激活时的颜色,mode为subsection时固定为白色(默认#303133)
  129. * @property {String} inactive-color 未激活时字体的颜色,mode为subsection时无效(默认#606266)
  130. * @property {String} mode 模式选择,见官网"模式选择"说明(默认button)
  131. * @property {String Number} font-size 字体大小,单位rpx(默认28)
  132. * @property {String Number} height 组件高度,单位rpx(默认70)
  133. * @property {Boolean} animation 是否开启动画效果,见上方说明(默认true)
  134. * @property {Boolean} bold 激活选项的字体是否加粗(默认true)
  135. * @property {String} bg-color 组件背景颜色,mode为button时有效(默认#eeeeef)
  136. * @property {String} button-color 按钮背景颜色,mode为button时有效(默认#ffffff)
  137. * @event {Function} change 分段器选项发生改变时触发
  138. * @example <u-subsection active-color="#ff9900"></u-subsection>
  139. */var _default2 =
  140. {
  141. name: "u-subsection",
  142. props: {
  143. // tab的数据
  144. list: {
  145. type: Array,
  146. default: function _default() {
  147. return [];
  148. } },
  149. // 当前活动的tab的index
  150. current: {
  151. type: [Number, String],
  152. default: 0 },
  153. // 激活的颜色
  154. activeColor: {
  155. type: String,
  156. default: '#303133' },
  157. // 未激活的颜色
  158. inactiveColor: {
  159. type: String,
  160. default: '#606266' },
  161. // 模式选择,mode=button为按钮形式,mode=subsection时为分段模式
  162. mode: {
  163. type: String,
  164. default: 'button' },
  165. // 字体大小,单位rpx
  166. fontSize: {
  167. type: [Number, String],
  168. default: 28 },
  169. // 是否开启动画效果
  170. animation: {
  171. type: Boolean,
  172. default: true },
  173. // 组件的高度,单位rpx
  174. height: {
  175. type: [Number, String],
  176. default: 70 },
  177. // 激活tab的字体是否加粗
  178. bold: {
  179. type: Boolean,
  180. default: true },
  181. // mode=button时,组件背景颜色
  182. bgColor: {
  183. type: String,
  184. default: '#eeeeef' },
  185. // mode = button时,滑块背景颜色
  186. buttonColor: {
  187. type: String,
  188. default: '#ffffff' },
  189. // 在切换分段器的时候,是否让设备震一下
  190. vibrateShort: {
  191. type: Boolean,
  192. default: false } },
  193. data: function data() {
  194. return {
  195. listInfo: [],
  196. itemBgStyle: {
  197. width: 0,
  198. left: 0,
  199. backgroundColor: '#ffffff',
  200. height: '100%',
  201. transition: '' },
  202. currentIndex: this.current,
  203. buttonPadding: 3, // mode = button 时,组件的内边距
  204. borderRadius: 5, // 圆角值
  205. firstTimeVibrateShort: true // 组件初始化时,会触发current变化,此时不应震动
  206. };
  207. },
  208. watch: {
  209. current: {
  210. immediate: true,
  211. handler: function handler(nVal) {
  212. this.currentIndex = nVal;
  213. this.changeSectionStatus(nVal);
  214. } } },
  215. created: function created() {
  216. // 将list的数据,传入listInfo数组,因为不能修改props传递的list值
  217. // 可以接受直接数组形式,或者数组元素为对象的形式,如:['简介', '评论'],或者[{name: '简介'}, {name: '评论'}]
  218. this.listInfo = this.list.map(function (val, index) {
  219. if (typeof val != 'object') {
  220. var obj = {
  221. width: 0,
  222. name: val };
  223. return obj;
  224. } else {
  225. val.width = 0;
  226. return val;
  227. }
  228. });
  229. },
  230. computed: {
  231. // 设置mode=subsection时,滑块特有的样式
  232. noBorderRight: function noBorderRight() {var _this = this;
  233. return function (index) {
  234. if (_this.mode != 'subsection') return;
  235. var classs = '';
  236. // 不显示右边的边框
  237. if (index < _this.list.length - 1) classs += ' u-none-border-right';
  238. // 显示整个组件的左右边圆角
  239. if (index == 0) classs += ' u-item-first';
  240. if (index == _this.list.length - 1) classs += ' u-item-last';
  241. return classs;
  242. };
  243. },
  244. // 文字的样式
  245. textStyle: function textStyle() {var _this2 = this;
  246. return function (index) {
  247. var style = {};
  248. // 设置字体颜色
  249. if (_this2.mode == 'subsection') {
  250. if (index == _this2.currentIndex) {
  251. style.color = '#ffffff';
  252. } else {
  253. style.color = _this2.activeColor;
  254. }
  255. } else {
  256. if (index == _this2.currentIndex) {
  257. style.color = _this2.activeColor;
  258. } else {
  259. style.color = _this2.inactiveColor;
  260. }
  261. }
  262. // 字体加粗
  263. if (index == _this2.currentIndex && _this2.bold) style.fontWeight = 'bold';
  264. // 文字大小
  265. style.fontSize = _this2.fontSize + 'rpx';
  266. return style;
  267. };
  268. },
  269. // 每个分段器item的样式
  270. itemStyle: function itemStyle() {var _this3 = this;
  271. return function (index) {
  272. var style = {};
  273. if (_this3.mode == 'subsection') {
  274. // 设置border的样式
  275. style.borderColor = _this3.activeColor;
  276. style.borderWidth = '1px';
  277. style.borderStyle = 'solid';
  278. }
  279. return style;
  280. };
  281. },
  282. // mode=button时,外层view的样式
  283. subsectionStyle: function subsectionStyle() {
  284. var style = {};
  285. style.height = uni.upx2px(this.height) + 'px';
  286. if (this.mode == 'button') {
  287. style.backgroundColor = this.bgColor;
  288. style.padding = "".concat(this.buttonPadding, "px");
  289. style.borderRadius = "".concat(this.borderRadius, "px");
  290. }
  291. return style;
  292. },
  293. // 滑块的样式
  294. itemBarStyle: function itemBarStyle() {
  295. var style = {};
  296. style.backgroundColor = this.activeColor;
  297. style.zIndex = 1;
  298. if (this.mode == 'button') {
  299. style.backgroundColor = this.buttonColor;
  300. style.borderRadius = "".concat(this.borderRadius, "px");
  301. style.bottom = "".concat(this.buttonPadding, "px");
  302. style.height = uni.upx2px(this.height) - this.buttonPadding * 2 + 'px';
  303. style.zIndex = 0;
  304. }
  305. return Object.assign(this.itemBgStyle, style);
  306. } },
  307. mounted: function mounted() {var _this4 = this;
  308. setTimeout(function () {
  309. _this4.getTabsInfo();
  310. }, 10);
  311. },
  312. methods: {
  313. // 改变滑块的样式
  314. changeSectionStatus: function changeSectionStatus(nVal) {var _this5 = this;
  315. if (this.mode == 'subsection') {
  316. // 根据滑块在最左边和最右边时,显示左边和右边的圆角
  317. if (nVal == this.list.length - 1) {
  318. this.itemBgStyle.borderRadius = "0 ".concat(this.buttonPadding, "px ").concat(this.buttonPadding, "px 0");
  319. }
  320. if (nVal == 0) {
  321. this.itemBgStyle.borderRadius = "".concat(this.buttonPadding, "px 0 0 ").concat(this.buttonPadding, "px");
  322. }
  323. if (nVal > 0 && nVal < this.list.length - 1) {
  324. this.itemBgStyle.borderRadius = '0';
  325. }
  326. }
  327. // 更新滑块的位置
  328. setTimeout(function () {
  329. _this5.itemBgLeft();
  330. }, 10);
  331. if (this.vibrateShort && !this.firstTimeVibrateShort) {
  332. // 使手机产生短促震动,微信小程序有效,APP(HX 2.6.8)和H5无效
  333. uni.vibrateShort();
  334. }
  335. // 第一次过后,设置firstTimeVibrateShort为false,让其下一次可以震动(如果允许震动的话)
  336. this.firstTimeVibrateShort = false;
  337. },
  338. click: function click(index) {
  339. // 不允许点击当前激活选项
  340. if (index == this.currentIndex) return;
  341. this.currentIndex = index;
  342. this.changeSectionStatus(index);
  343. this.$emit('change', Number(index));
  344. },
  345. // 获取各个tab的节点信息
  346. getTabsInfo: function getTabsInfo() {var _this6 = this;
  347. var view = uni.createSelectorQuery().in(this);
  348. for (var i = 0; i < this.list.length; i++) {
  349. view.select('.u-item-' + i).boundingClientRect();
  350. }
  351. view.exec(function (res) {
  352. if (!res.length) {
  353. setTimeout(function () {
  354. _this6.getTabsInfo();
  355. return;
  356. }, 10);
  357. }
  358. // 将分段器每个item的宽度,放入listInfo数组
  359. res.map(function (val, index) {
  360. _this6.listInfo[index].width = val.width;
  361. });
  362. // 初始化滑块的宽度
  363. if (_this6.mode == 'subsection') {
  364. _this6.itemBgStyle.width = _this6.listInfo[0].width + 'px';
  365. } else if (_this6.mode == 'button') {
  366. _this6.itemBgStyle.width = _this6.listInfo[0].width + 'px';
  367. }
  368. // 初始化滑块的位置
  369. _this6.itemBgLeft();
  370. });
  371. },
  372. itemBgLeft: function itemBgLeft() {var _this7 = this;
  373. // 根据是否开启动画效果,
  374. if (this.animation) {
  375. this.itemBgStyle.transition = 'all 0.35s';
  376. } else {
  377. this.itemBgStyle.transition = 'all 0s';
  378. }
  379. var left = 0;
  380. // 计算当前活跃item到组件左边的距离
  381. this.listInfo.map(function (val, index) {
  382. if (index < _this7.currentIndex) left += val.width;
  383. });
  384. // 根据mode不同模式,计算滑块需要移动的距离
  385. if (this.mode == 'subsection') {
  386. this.itemBgStyle.left = left + 'px';
  387. } else if (this.mode == 'button') {
  388. this.itemBgStyle.left = left + this.buttonPadding + 'px';
  389. }
  390. } } };exports.default = _default2;
  391. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  392. /***/ }),
  393. /***/ 407:
  394. /*!**************************************************************************************************************************************************!*\
  395. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue?vue&type=style&index=0&id=b14d3440&lang=scss&scoped=true& ***!
  396. \**************************************************************************************************************************************************/
  397. /*! no static exports found */
  398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  399. "use strict";
  400. __webpack_require__.r(__webpack_exports__);
  401. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-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--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-subsection.vue?vue&type=style&index=0&id=b14d3440&lang=scss&scoped=true& */ 408);
  402. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
  403. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  404. /* harmony default export */ __webpack_exports__["default"] = (_E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_subsection_vue_vue_type_style_index_0_id_b14d3440_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
  405. /***/ }),
  406. /***/ 408:
  407. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  408. !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-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--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-subsection/u-subsection.vue?vue&type=style&index=0&id=b14d3440&lang=scss&scoped=true& ***!
  409. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  410. /*! no static exports found */
  411. /***/ (function(module, exports, __webpack_require__) {
  412. // extracted by mini-css-extract-plugin
  413. if(false) { var cssReload; }
  414. /***/ })
  415. }]);
  416. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/uview-ui/components/u-subsection/u-subsection.js.map
  417. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  418. 'uview-ui/components/u-subsection/u-subsection-create-component',
  419. {
  420. 'uview-ui/components/u-subsection/u-subsection-create-component':(function(module, exports, __webpack_require__){
  421. __webpack_require__('1')['createComponent'](__webpack_require__(402))
  422. })
  423. },
  424. [['uview-ui/components/u-subsection/u-subsection-create-component']]
  425. ]);