u-rate.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["uview-ui/components/u-rate/u-rate"],{
  2. /***/ 456:
  3. /*!*****************************************************************************!*\
  4. !*** D:/星火篮球维护/代码/小程序教练端/spark-coach/uview-ui/components/u-rate/u-rate.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_rate_vue_vue_type_template_id_533abf00_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./u-rate.vue?vue&type=template&id=533abf00&scoped=true& */ 457);
  11. /* harmony import */ var _u_rate_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./u-rate.vue?vue&type=script&lang=js& */ 459);
  12. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _u_rate_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_rate_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  13. /* harmony import */ var _u_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./u-rate.vue?vue&type=style&index=0&id=533abf00&scoped=true&lang=scss& */ 461);
  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_rate_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  19. _u_rate_vue_vue_type_template_id_533abf00_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  20. _u_rate_vue_vue_type_template_id_533abf00_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  21. false,
  22. null,
  23. "533abf00",
  24. null,
  25. false,
  26. _u_rate_vue_vue_type_template_id_533abf00_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
  27. renderjs
  28. )
  29. component.options.__file = "uview-ui/components/u-rate/u-rate.vue"
  30. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  31. /***/ }),
  32. /***/ 457:
  33. /*!************************************************************************************************************************!*\
  34. !*** D:/星火篮球维护/代码/小程序教练端/spark-coach/uview-ui/components/u-rate/u-rate.vue?vue&type=template&id=533abf00&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_rate_vue_vue_type_template_id_533abf00_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-rate.vue?vue&type=template&id=533abf00&scoped=true& */ 458);
  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_rate_vue_vue_type_template_id_533abf00_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_rate_vue_vue_type_template_id_533abf00_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_rate_vue_vue_type_template_id_533abf00_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_rate_vue_vue_type_template_id_533abf00_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
  45. /***/ }),
  46. /***/ 458:
  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-coach/uview-ui/components/u-rate/u-rate.vue?vue&type=template&id=533abf00&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. try {
  60. components = {
  61. uIcon: function() {
  62. return __webpack_require__.e(/*! import() | uview-ui/components/u-icon/u-icon */ "uview-ui/components/u-icon/u-icon").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-icon/u-icon.vue */ 309))
  63. }
  64. }
  65. } catch (e) {
  66. if (
  67. e.message.indexOf("Cannot find module") !== -1 &&
  68. e.message.indexOf(".vue") !== -1
  69. ) {
  70. console.error(e.message)
  71. console.error("1. 排查组件名称拼写是否正确")
  72. console.error(
  73. "2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
  74. )
  75. console.error(
  76. "3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
  77. )
  78. } else {
  79. throw e
  80. }
  81. }
  82. var render = function() {
  83. var _vm = this
  84. var _h = _vm.$createElement
  85. var _c = _vm._self._c || _h
  86. var l0 = _vm.__map(_vm.count, function(item, index) {
  87. var $orig = _vm.__get_orig(item)
  88. var a0 = {
  89. fontSize: _vm.size + "rpx",
  90. padding: "0 " + (_vm.gutter / 2 + "rpx")
  91. }
  92. var m0 = _vm.showDecimalIcon(index)
  93. return {
  94. $orig: $orig,
  95. a0: a0,
  96. m0: m0
  97. }
  98. })
  99. _vm.$mp.data = Object.assign(
  100. {},
  101. {
  102. $root: {
  103. l0: l0
  104. }
  105. }
  106. )
  107. }
  108. var recyclableRender = false
  109. var staticRenderFns = []
  110. render._withStripped = true
  111. /***/ }),
  112. /***/ 459:
  113. /*!******************************************************************************************************!*\
  114. !*** D:/星火篮球维护/代码/小程序教练端/spark-coach/uview-ui/components/u-rate/u-rate.vue?vue&type=script&lang=js& ***!
  115. \******************************************************************************************************/
  116. /*! no static exports found */
  117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118. "use strict";
  119. __webpack_require__.r(__webpack_exports__);
  120. /* 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_rate_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-rate.vue?vue&type=script&lang=js& */ 460);
  121. /* 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_rate_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_rate_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  122. /* 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_rate_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_rate_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  123. /* 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_rate_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  124. /***/ }),
  125. /***/ 460:
  126. /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  127. !*** ./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-coach/uview-ui/components/u-rate/u-rate.vue?vue&type=script&lang=js& ***!
  128. \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  129. /*! no static exports found */
  130. /***/ (function(module, exports, __webpack_require__) {
  131. "use strict";
  132. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; //
  133. //
  134. //
  135. //
  136. //
  137. //
  138. //
  139. //
  140. //
  141. //
  142. //
  143. //
  144. //
  145. //
  146. //
  147. //
  148. //
  149. //
  150. //
  151. /**
  152. * rate 评分
  153. * @description 该组件一般用于满意度调查,星型评分的场景
  154. * @tutorial https://www.uviewui.com/components/rate.html
  155. * @property {String Number} count 最多可选的星星数量(默认5)
  156. * @property {String Number} current 默认选中的星星数量(默认0)
  157. * @property {Boolean} disabled 是否禁止用户操作(默认false)
  158. * @property {String Number} size 星星的大小,单位rpx(默认32)
  159. * @property {String} inactive-color 未选中星星的颜色(默认#b2b2b2)
  160. * @property {String} active-color 选中的星星颜色(默认#FA3534)
  161. * @property {String} active-icon 选中时的图标名,只能为uView的内置图标(默认star-fill)
  162. * @property {String} inactive-icon 未选中时的图标名,只能为uView的内置图标(默认star)
  163. * @property {String} gutter 星星之间的距离(默认10)
  164. * @property {String Number} min-count 最少选中星星的个数(默认0)
  165. * @property {Boolean} allow-half 是否允许半星选择(默认false)
  166. * @event {Function} change 选中的星星发生变化时触发
  167. * @example <u-rate :count="count" :current="2"></u-rate>
  168. */var _default2 =
  169. {
  170. name: 'u-rate',
  171. props: {
  172. // 用于v-model双向绑定选中的星星数量
  173. // 1.4.5版新增
  174. value: {
  175. type: [Number, String],
  176. default: -1 },
  177. // 要显示的星星数量
  178. count: {
  179. type: [Number, String],
  180. default: 5 },
  181. // 当前需要默认选中的星星(选中的个数)
  182. // 1.4.5后通过value双向绑定,不再建议使用此参数
  183. current: {
  184. type: [Number, String],
  185. default: 0 },
  186. // 是否不可选中
  187. disabled: {
  188. type: Boolean,
  189. default: false },
  190. // 星星的大小,单位rpx
  191. size: {
  192. type: [Number, String],
  193. default: 32 },
  194. // 未选中时的颜色
  195. inactiveColor: {
  196. type: String,
  197. default: '#b2b2b2' },
  198. // 选中的颜色
  199. activeColor: {
  200. type: String,
  201. default: '#FA3534' },
  202. // 星星之间的间距,单位rpx
  203. gutter: {
  204. type: [Number, String],
  205. default: 10 },
  206. // 最少能选择的星星个数
  207. minCount: {
  208. type: [Number, String],
  209. default: 0 },
  210. // 是否允许半星(功能尚未实现)
  211. allowHalf: {
  212. type: Boolean,
  213. default: false },
  214. // 选中时的图标(星星)
  215. activeIcon: {
  216. type: String,
  217. default: 'star-fill' },
  218. // 未选中时的图标(星星)
  219. inactiveIcon: {
  220. type: String,
  221. default: 'star' },
  222. // 自定义扩展前缀,方便用户扩展自己的图标库
  223. customPrefix: {
  224. type: String,
  225. default: 'uicon' },
  226. colors: {
  227. type: Array,
  228. default: function _default() {
  229. return [];
  230. } },
  231. icons: {
  232. type: Array,
  233. default: function _default() {
  234. return [];
  235. } } },
  236. data: function data() {
  237. return {
  238. // 生成一个唯一id,否则一个页面多个评分组件,会造成冲突
  239. elId: this.$u.guid(),
  240. elClass: this.$u.guid(),
  241. starBoxLeft: 0, // 评分盒子左边到屏幕左边的距离,用于滑动选择时计算距离
  242. // 当前激活的星星的index,如果存在value,优先使用value,因为它可以双向绑定(1.4.5新增)
  243. activeIndex: this.value != -1 ? this.value : this.current,
  244. starWidth: 0, // 每个星星的宽度
  245. starWidthArr: [] //每个星星最右边到组件盒子最左边的距离
  246. };
  247. },
  248. watch: {
  249. current: function current(val) {
  250. this.activeIndex = val;
  251. },
  252. value: function value(val) {
  253. this.activeIndex = val;
  254. } },
  255. computed: {
  256. decimal: function decimal() {
  257. if (this.disabled) {
  258. return this.activeIndex * 100 % 100;
  259. } else if (this.allowHalf) {
  260. return 50;
  261. }
  262. },
  263. elActiveIcon: function elActiveIcon() {
  264. var len = this.icons.length;
  265. // 此处规则类似于下方的elActiveColor参数,都是根据一定的规则,显示不同的图标
  266. // 结果可能如此:icons参数传递了3个图标,当选中两个时,用第一个图标,4个时,用第二个图标
  267. // 第三个时,用第三个图标作为激活的图标
  268. if (len && len <= this.count) {
  269. var step = Math.round(this.activeIndex / Math.round(this.count / len));
  270. if (step < 1) return this.icons[0];
  271. if (step > len) return this.icons[len - 1];
  272. return this.icons[step - 1];
  273. }
  274. return this.activeIcon;
  275. },
  276. elActiveColor: function elActiveColor() {
  277. var len = this.colors.length;
  278. // 如果有设置colors参数(此参数用于将图标分段,比如一共5颗星,colors传3个颜色值,那么根据一定的规则,2颗星可能为第一个颜色
  279. // 4颗星为第二个颜色值,5颗星为第三个颜色值)
  280. if (len && len <= this.count) {
  281. var step = Math.round(this.activeIndex / Math.round(this.count / len));
  282. if (step < 1) return this.colors[0];
  283. if (step > len) return this.colors[len - 1];
  284. return this.colors[step - 1];
  285. }
  286. return this.activeColor;
  287. } },
  288. methods: {
  289. // 获取评分组件盒子的布局信息
  290. getElRectById: function getElRectById() {var _this = this;
  291. // uView封装的获取节点的方法,详见文档
  292. this.$u.getRect('#' + this.elId).then(function (res) {
  293. _this.starBoxLeft = res.left;
  294. });
  295. },
  296. // 获取单个星星的尺寸
  297. getElRectByClass: function getElRectByClass() {var _this2 = this;
  298. // uView封装的获取节点的方法,详见文档
  299. this.$u.getRect('.' + this.elClass).then(function (res) {
  300. _this2.starWidth = res.width;
  301. // 把每个星星右边到组件盒子左边的距离放入数组中
  302. for (var i = 0; i < _this2.count; i++) {
  303. _this2.starWidthArr[i] = (i + 1) * _this2.starWidth;
  304. }
  305. });
  306. },
  307. // 手指滑动
  308. touchMove: function touchMove(e) {
  309. if (this.disabled) {
  310. return;
  311. }
  312. if (!e.changedTouches[0]) {
  313. return;
  314. }
  315. var movePageX = e.changedTouches[0].pageX;
  316. // 滑动点相对于评分盒子左边的距离
  317. var distance = movePageX - this.starBoxLeft;
  318. // 如果滑动到了评分盒子的左边界,就设置为0星
  319. if (distance <= 0) {
  320. this.activeIndex = 0;
  321. }
  322. // 滑动的距离,相当于多少颗星星
  323. var index = Math.ceil(distance / this.starWidth);
  324. this.activeIndex = index > this.count ? this.count : index;
  325. // 对最少颗星星的限制
  326. if (this.activeIndex < this.minCount) this.activeIndex = this.minCount;
  327. this.emitEvent();
  328. },
  329. // 通过点击,直接选中
  330. click: function click(index, e) {
  331. if (this.disabled) {
  332. return;
  333. }
  334. // 半星选择,尚未实现
  335. if (this.allowHalf) {
  336. }
  337. // 对第一个星星特殊处理,只有一个的时候,点击可以取消,否则无法作0星评价
  338. if (index == 1) {
  339. if (this.activeIndex == 1) {
  340. this.activeIndex = 0;
  341. } else {
  342. this.activeIndex = 1;
  343. }
  344. } else {
  345. this.activeIndex = index;
  346. }
  347. // 对最少颗星星的限制
  348. if (this.activeIndex < this.minCount) this.activeIndex = this.minCount;
  349. this.emitEvent();
  350. },
  351. // 发出事件
  352. emitEvent: function emitEvent() {
  353. // 发出change事件
  354. this.$emit('change', this.activeIndex);
  355. // 同时修改双向绑定的value的值
  356. if (this.value != -1) {
  357. this.$emit('input', this.activeIndex);
  358. }
  359. },
  360. showDecimalIcon: function showDecimalIcon(index) {
  361. return this.disabled && parseInt(this.activeIndex) === index;
  362. } },
  363. mounted: function mounted() {
  364. this.getElRectById();
  365. this.getElRectByClass();
  366. } };exports.default = _default2;
  367. /***/ }),
  368. /***/ 461:
  369. /*!***************************************************************************************************************************************!*\
  370. !*** D:/星火篮球维护/代码/小程序教练端/spark-coach/uview-ui/components/u-rate/u-rate.vue?vue&type=style&index=0&id=533abf00&scoped=true&lang=scss& ***!
  371. \***************************************************************************************************************************************/
  372. /*! no static exports found */
  373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  374. "use strict";
  375. __webpack_require__.r(__webpack_exports__);
  376. /* 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_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___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-rate.vue?vue&type=style&index=0&id=533abf00&scoped=true&lang=scss& */ 462);
  377. /* 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_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___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_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
  378. /* 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_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___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_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  379. /* 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_rate_vue_vue_type_style_index_0_id_533abf00_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
  380. /***/ }),
  381. /***/ 462:
  382. /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  383. !*** ./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-coach/uview-ui/components/u-rate/u-rate.vue?vue&type=style&index=0&id=533abf00&scoped=true&lang=scss& ***!
  384. \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  385. /*! no static exports found */
  386. /***/ (function(module, exports, __webpack_require__) {
  387. // extracted by mini-css-extract-plugin
  388. if(false) { var cssReload; }
  389. /***/ })
  390. }]);
  391. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/uview-ui/components/u-rate/u-rate.js.map
  392. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  393. 'uview-ui/components/u-rate/u-rate-create-component',
  394. {
  395. 'uview-ui/components/u-rate/u-rate-create-component':(function(module, exports, __webpack_require__){
  396. __webpack_require__('1')['createComponent'](__webpack_require__(456))
  397. })
  398. },
  399. [['uview-ui/components/u-rate/u-rate-create-component']]
  400. ]);