From b444da33c9de750aec3724e8f1cb4efe8775b165 Mon Sep 17 00:00:00 2001
From: dminyi <1301963064@qq.com>
Date: Thu, 12 Sep 2024 20:50:09 +0800
Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master
---
gz-wxparty/components/vant/rate/index.js | 57 ++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/gz-wxparty/components/vant/rate/index.js b/gz-wxparty/components/vant/rate/index.js
index 23b7345..30a96de 100644
--- a/gz-wxparty/components/vant/rate/index.js
+++ b/gz-wxparty/components/vant/rate/index.js
@@ -1,13 +1,26 @@
-import { getAllRect } from '../common/utils';
-import { VantComponent } from '../common/component';
-import { canIUseModel } from '../common/version';
-VantComponent({
+"use strict";
+var __assign = (this && this.__assign) || function () {
+ __assign = Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var utils_1 = require("../common/utils");
+var component_1 = require("../common/component");
+var version_1 = require("../common/version");
+(0, component_1.VantComponent)({
field: true,
classes: ['icon-class'],
props: {
value: {
type: Number,
- observer(value) {
+ observer: function (value) {
if (value !== this.data.innerValue) {
this.setData({ innerValue: value });
}
@@ -31,7 +44,7 @@
count: {
type: Number,
value: 5,
- observer(value) {
+ observer: function (value) {
this.setData({ innerCountArray: Array.from({ length: value }) });
},
},
@@ -46,31 +59,33 @@
innerCountArray: Array.from({ length: 5 }),
},
methods: {
- onSelect(event) {
- const { data } = this;
- const { score } = event.currentTarget.dataset;
+ onSelect: function (event) {
+ var _this = this;
+ var data = this.data;
+ var score = event.currentTarget.dataset.score;
if (!data.disabled && !data.readonly) {
this.setData({ innerValue: score + 1 });
- if (canIUseModel()) {
+ if ((0, version_1.canIUseModel)()) {
this.setData({ value: score + 1 });
}
- wx.nextTick(() => {
- this.$emit('input', score + 1);
- this.$emit('change', score + 1);
+ wx.nextTick(function () {
+ _this.$emit('input', score + 1);
+ _this.$emit('change', score + 1);
});
}
},
- onTouchMove(event) {
- const { touchable } = this.data;
+ onTouchMove: function (event) {
+ var _this = this;
+ var touchable = this.data.touchable;
if (!touchable)
return;
- const { clientX } = event.touches[0];
- getAllRect(this, '.van-rate__icon').then((list) => {
- const target = list
- .sort((cur, next) => cur.dataset.score - next.dataset.score)
- .find((item) => clientX >= item.left && clientX <= item.right);
+ var clientX = event.touches[0].clientX;
+ (0, utils_1.getAllRect)(this, '.van-rate__icon').then(function (list) {
+ var target = list
+ .sort(function (cur, next) { return cur.dataset.score - next.dataset.score; })
+ .find(function (item) { return clientX >= item.left && clientX <= item.right; });
if (target != null) {
- this.onSelect(Object.assign(Object.assign({}, event), { currentTarget: target }));
+ _this.onSelect(__assign(__assign({}, event), { currentTarget: target }));
}
});
},
--
Gitblit v1.8.0