remark.js
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import util from '../../utils/util';
import App from '../../utils/api';
Page({
data:{
remark:'',
buttonbottom:60
},
onLoad(opt){
this.setData({
remark:opt.remark,
})
this.remark=opt.remark;
this.getlabellist();
},
inputremark(e){
this.remark=util.trim(e.detail.value)
},
selectlabel(e){
let name=e.currentTarget.dataset.name;
if(this.remark!=''){
let str=this.remark+','+name
if(str.length>25){
console.log('rrrrrr')
return wx.showToast({
icon:'none',
title:'最多输入25个字符',
mask:true,
duration:1500
})
}
}
this.setData({
remark:this.remark=='' ? name : this.remark+','+name
})
this.remark=this.remark=='' ? name : this.remark+','+name
console.log(this.remark,this.remark.length)
},
inputblur(e){
console.log(e,'blur')
this.setData({
remark:this.remark,
buttonbottom:60
})
},
getlabellist(){
App.Customer.GetUserRemarkes().then((json)=>{
console.log('eeeee',json)
if(json.ret==200){
this.setData({
labellist:json.data
})
}
})
},
save(){
wx.setStorageSync('remark',this.remark);
wx.navigateBack();
},
getboardheight(e){
if(e.detail.height==0){
this.setData({
buttonbottom:30
})
}else{
this.setData({
buttonbottom:e.detail.height+20
})
}
}
})