Commit 2c7aca0a authored by 秦海涛's avatar 秦海涛

update

parent cb09d474
...@@ -118,6 +118,7 @@ Component({ ...@@ -118,6 +118,7 @@ Component({
type: "fail", type: "fail",
content: "最多选择20个宝贝", content: "最多选择20个宝贝",
}); });
return;
} }
const { item } = e.target.dataset; const { item } = e.target.dataset;
......
const { passUrlList } = require('../../../cmpUtils/const'); const { passUrlList } = require('../../../cmpUtils/const');
import { validateRangeNumber } from "../../../utils/validate";
Component({ Component({
mixins: [], mixins: [],
...@@ -87,7 +88,7 @@ Component({ ...@@ -87,7 +88,7 @@ Component({
}, },
onSaveTask() { onSaveTask() {
const { title, link, value, taskRateType, times, itemIds } = this.data; const { title, link, value, taskRateType, times, itemIds } = this.data;
if(!title) { if(!title.trim()) {
my.showToast({ my.showToast({
type: 'fail', type: 'fail',
content: '请输入任务标题' content: '请输入任务标题'
...@@ -111,7 +112,7 @@ Component({ ...@@ -111,7 +112,7 @@ Component({
return; return;
} }
if(!value || !Number.isInteger(+value)) { if(!value || !validateRangeNumber(value, [1, 999])) {
my.showToast({ my.showToast({
type: 'fail', type: 'fail',
content: '请输入正确的任务奖励' content: '请输入正确的任务奖励'
......
...@@ -12,7 +12,7 @@ Component({ ...@@ -12,7 +12,7 @@ Component({
didUpdate() {}, didUpdate() {},
methods: { methods: {
onChange(e) { onChange(e) {
this.props.onChange && this.props.onChange(e.detail.value, e.target.dataset.name); this.props.onChange && this.props.onChange(e);
}, },
async handleTapGeneralRule() { async handleTapGeneralRule() {
console.log(this.props.generateRuleInfo, 'this.props.generateRuleInfo') console.log(this.props.generateRuleInfo, 'this.props.generateRuleInfo')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment