|
|
|
import util from '../../../utils/util';
|
|
|
|
import App from '../../../utils/api';
|
|
|
|
Page({
|
|
|
|
data:{
|
|
|
|
alllabel:[
|
|
|
|
|
|
|
|
],
|
|
|
|
focus:true
|
|
|
|
},
|
|
|
|
onLoad:function(){
|
|
|
|
this.getlabellist();
|
|
|
|
},
|
|
|
|
onShow:function(){
|
|
|
|
|
|
|
|
},
|
|
|
|
inputremark:function(e){
|
|
|
|
this.setData({
|
|
|
|
defineremark:util.trim(e.detail.value)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
taplabel:function(e){
|
|
|
|
var _target=e.currentTarget.dataset;
|
|
|
|
var mylabel=this.data.mylabel;
|
|
|
|
console.log(_target.id,_target.type);
|
|
|
|
this.setlabel(_target.id,_target.type);
|
|
|
|
},
|
|
|
|
getlabellist:function(){
|
|
|
|
App.User.GetCustomRemark({
|
|
|
|
uid:util.cache('enter_params')['manager_id']
|
|
|
|
}).then(res=>{
|
|
|
|
console.log(res)
|
|
|
|
this.setData({
|
|
|
|
alllabel:res.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
setlabel:function(id,flag){
|
|
|
|
App.User.GetCustomRemark({
|
|
|
|
uid:util.cache('enter_params')['manager_id'],
|
|
|
|
kid:id,
|
|
|
|
flag:flag,
|
|
|
|
}).then(res=>{
|
|
|
|
console.log(res)
|
|
|
|
this.setData({
|
|
|
|
alllabel:res.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
addinputlabel:function(e){
|
|
|
|
this.setData({
|
|
|
|
focus:false
|
|
|
|
})
|
|
|
|
if(util.trim(e.detail.value)!=''){
|
|
|
|
this.addlabel(util.trim(e.detail.value))
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
//添加自定义标签
|
|
|
|
addlabel:function(custom){
|
|
|
|
App.User.AddCustomRemark({
|
|
|
|
uid:util.cache('enter_params')['manager_id'],
|
|
|
|
custom:custom,
|
|
|
|
}).then(res=>{
|
|
|
|
console.log(res)
|
|
|
|
if(res.ret==200){
|
|
|
|
this.setData({
|
|
|
|
defineremark:'',
|
|
|
|
})
|
|
|
|
this.getlabellist();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|