Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wandouchengzhang_coach
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
石盼盼
wandouchengzhang_coach
Commits
efef03e6
Commit
efef03e6
authored
Nov 19, 2020
by
石盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存运动评价条件判断
parent
9decfc16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
32 deletions
+13
-32
evaluation.js
pages/index/evaluation/evaluation.js
+11
-29
evaluation.wxml
pages/index/evaluation/evaluation.wxml
+2
-3
No files found.
pages/index/evaluation/evaluation.js
View file @
efef03e6
...
...
@@ -7,10 +7,6 @@ Page({
* 页面的初始数据
*/
data
:
{
texts
:
"
已输入
"
,
min
:
0
,
//最少字数
max
:
300
,
//最多字数
currentWordNumber
:
0
,
chooseBadge
:
true
,
imgBox
:
[],
scoreArr
:
[],
...
...
@@ -35,28 +31,6 @@ Page({
})
},
// inputs: function (e) {
// var value = e.detail.value;
// console.log(value)
// var len = parseInt(value.length);
// // console.log(len)
// if (len <= this.data.min)
// this.setData({
// texts: "已输入",
// num: this.data.min - len
// })
// else if (len > this.data.min)
// this.setData({
// texts: " ",
// textss: " ",
// num: ''
// })
// this.setData({
// currentWordNumber: len //当前字数
// });
// if (len > this.data.max) return;
// console.log(this.data)
// },
inputs
:
function
(
e
)
{
this
.
setData
({
value
:
e
.
detail
.
value
...
...
@@ -65,13 +39,11 @@ Page({
},
onDrag
(
event
)
{
// console.log(event)
let
index
=
event
.
currentTarget
.
dataset
.
index
this
.
data
.
scoreArr
[
index
].
score
=
event
.
detail
.
value
this
.
setData
({
scoreArr
:
this
.
data
.
scoreArr
});
// console.log(this.data.scoreArr)
},
gobadgelist
:
function
(
e
)
{
var
model
=
JSON
.
stringify
(
this
.
data
.
imgBox
)
...
...
@@ -118,9 +90,19 @@ Page({
},
// 保存
save
:
function
()
{
this
.
data
.
scoreArr
.
map
((
e
)
=>
{
obj
[
e
.
id
]
=
e
.
score
;
if
(
e
.
score
==
0
){
base
.
toast
(
'
运动表现分值不能为0
'
)
return
}
});
if
(
this
.
data
.
value
==
''
)
{
base
.
toast
(
'
教练评语不能为空
'
)
return
}
let
obj
=
{};
this
.
data
.
scoreArr
.
map
((
e
)
=>
{
console
.
log
(
e
)
obj
[
e
.
id
]
=
e
.
score
;
});
//如果其中存在某一条评分未评则不能保存成功 必须全部评分完毕
...
...
pages/index/evaluation/evaluation.wxml
View file @
efef03e6
...
...
@@ -14,9 +14,8 @@
<view class="coach">
<view class="title">教练评语</view>
<view class="text">
<textarea placeholder="请输入对学生的评价" minlength="{{min}}" maxlength="{{max}}" bindinput="inputs" value="{{value}}">
<!-- <text class="currentWordNumber">{{currentWordNumber}}/{{max}}</text>
<text class="hint">{{texts}}{{num}}</text> -->
<textarea placeholder="请输入对学生的评价" maxlength="300" bindinput="inputs" value="{{value}}">
<text class="currentWordNumber">已输入{{value.length > 0 ? value.length: 0 }}/300</text>
</textarea>
</view>
</view>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment