1234567891011 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-rate/u-rate"],{1119:function(t,e,n){"use strict";n.r(e);var i=n(1120),a=n(1122);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n(1125);var o,u=n(37),c=Object(u["default"])(a["default"],i["render"],i["staticRenderFns"],!1,null,"533abf00",null,!1,i["components"],o);c.options.__file="uview-ui/components/u-rate/u-rate.vue",e["default"]=c.exports},1120:function(t,e,n){"use strict";n.r(e);var i=n(1121);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},1121:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return a})),n.d(e,"staticRenderFns",(function(){return o})),n.d(e,"recyclableRender",(function(){return r})),n.d(e,"components",(function(){return i}));try{i={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-icon/u-icon")]).then(n.bind(null,860))}}}catch(u){if(-1===u.message.indexOf("Cannot find module")||-1===u.message.indexOf(".vue"))throw u;console.error(u.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__get_style([t.$u.addStyle(t.customStyle)])),i=Math.floor(t.activeIndex),a=t.disabled?null:Math.floor(t.activeIndex),r=t.allowHalf?t.$u.addUnit(t.rateWidth/2):null,o=t.allowHalf?Math.ceil(t.activeIndex):null,u=t.allowHalf&&!t.disabled?Math.ceil(t.activeIndex):null,c=t.__map(Number(t.count),(function(e,n){var i=t.__get_orig(e),a={"padding-left":t.$u.addUnit(t.gutter/2),"padding-right":t.$u.addUnit(t.gutter/2)},r=t.allowHalf?{"padding-left":t.$u.addUnit(t.gutter/2),"padding-right":t.$u.addUnit(t.gutter/2)}:null;return{$orig:i,a0:a,a1:r}}));t._isMounted||(t.e0=function(e,n){var i=arguments[arguments.length-1].currentTarget.dataset,a=i.eventParams||i["event-params"];n=a.index;return e.stopPropagation(),t.clickHandler(e,n+1)},t.e1=function(e,n){var i=arguments[arguments.length-1].currentTarget.dataset,a=i.eventParams||i["event-params"];n=a.index;return e.stopPropagation(),t.clickHandler(e,n+1)}),t.$mp.data=Object.assign({},{$root:{s0:n,g0:i,g1:a,g2:r,g3:o,g4:u,l0:c}})},r=!1,o=[];a._withStripped=!0},1122:function(t,e,n){"use strict";n.r(e);var i=n(1123),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},1123:function(t,e,n){"use strict";(function(t){var i=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n(61)),r=i(n(63)),o=i(n(1124)),u={name:"u-rate",mixins:[t.$u.mpMixin,t.$u.mixin,o.default],data:function(){return{elId:t.$u.guid(),elClass:t.$u.guid(),rateBoxLeft:0,activeIndex:this.value,rateWidth:0,moving:!1}},watch:{value:function(t){this.activeIndex=t},activeIndex:"emitEvent"},methods:{init:function(){var e=this;t.$u.sleep().then((function(){e.getRateItemRect(),e.getRateIconWrapRect()}))},getRateItemRect:function(){var e=this;return(0,r.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$u.sleep();case 2:e.$uGetRect("#"+e.elId).then((function(t){e.rateBoxLeft=t.left}));case 3:case"end":return n.stop()}}),n)})))()},getRateIconWrapRect:function(){var t=this;this.$uGetRect("."+this.elClass).then((function(e){t.rateWidth=e.width}))},touchMove:function(t){if(this.touchable){this.preventEvent(t);var e=t.changedTouches[0].pageX;this.getActiveIndex(e)}},touchEnd:function(t){if(this.touchable){this.preventEvent(t);var e=t.changedTouches[0].pageX;this.getActiveIndex(e)}},clickHandler:function(e,n){if("ios"!==t.$u.os()||!this.moving){this.preventEvent(e);var i=0;i=e.changedTouches[0].pageX,this.getActiveIndex(i,!0)}},emitEvent:function(){this.$emit("change",this.activeIndex),this.$emit("input",this.activeIndex)},getActiveIndex:function(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.disabled&&!this.readonly){var a=this.rateWidth*this.count+this.rateBoxLeft;e=t.$u.range(this.rateBoxLeft,a,e)-this.rateBoxLeft;var r,o=e;if(this.allowHalf){r=Math.floor(o/this.rateWidth);var u=o%this.rateWidth;u<=this.rateWidth/2&&u>0?r+=.5:u>this.rateWidth/2&&r++}else{r=Math.floor(o/this.rateWidth);var c=o%this.rateWidth;i?c>0&&r++:c>this.rateWidth/2&&r++}this.activeIndex=Math.min(r,this.count),this.activeIndex<this.minCount&&(this.activeIndex=this.minCount),setTimeout((function(){n.moving=!0}),10),setTimeout((function(){n.moving=!1}),10)}}},mounted:function(){this.init()}};e.default=u}).call(this,n(2)["default"])},1125:function(t,e,n){"use strict";n.r(e);var i=n(1126),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},1126:function(t,e,n){}}]);
- //# sourceMappingURL=../../../../.sourcemap/mp-weixin/uview-ui/components/u-rate/u-rate.js.map
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'uview-ui/components/u-rate/u-rate-create-component',
- {
- 'uview-ui/components/u-rate/u-rate-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('2')['createComponent'](__webpack_require__(1119))
- })
- },
- [['uview-ui/components/u-rate/u-rate-create-component']]
- ]);
|