Commit ffa9f27d19789171af09955de1d21c290c3aa7c2

Authored by liuxuqinfhp1220
1 parent 01b76797

no message

... ... @@ -17,15 +17,32 @@ Page({
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);
var oftenlabel=0,alllabel=this.data.alllabel;
alllabel.forEach(function(v,i){
if(v.often_use!=''){
oftenlabel++;
}
})
if(_target.type=='often'){
this.setlabel(_target.id,_target.type);
}else{
if(oftenlabel<10){
this.setlabel(_target.id,_target.type);
}else{
wx.showToast({
title:'最多可添加10个',
icon:'none',
duration:2000
})
}
}
},
getlabellist:function(){
App.User.GetCustomRemark({
uid:util.cache('enter_params')['manager_id']
uid:util.cache('enter_params')['manage_id']
}).then(res=>{
console.log(res)
this.setData({
... ... @@ -38,7 +55,7 @@ Page({
},
setlabel:function(id,flag){
App.User.GetCustomRemark({
uid:util.cache('enter_params')['manager_id'],
uid:util.cache('enter_params')['manage_id'],
kid:id,
flag:flag,
}).then(res=>{
... ... @@ -60,7 +77,7 @@ Page({
//添加自定义标签
addlabel:function(custom){
App.User.AddCustomRemark({
uid:util.cache('enter_params')['manager_id'],
uid:util.cache('enter_params')['manage_id'],
custom:custom,
}).then(res=>{
console.log(res)
... ... @@ -69,6 +86,15 @@ Page({
defineremark:null,
})
this.getlabellist();
}else{
this.setData({
defineremark:null,
})
wx.showToast({
title:'最多可添加20个备注',
icon:'none',
duration:2000
})
}
})
},
... ...
<nav id="nav">常用备注</nav>
<view class="cut"></view>
<view class="label">
<view class="label-title black-font font30r smooth" style="padding-bottom:40rpx;">我的常用备注</view>
<view class="label-title black-font font30r smooth" style="padding-bottom:40rpx;">我的常用备注<text class="font24r smooth gray-deep-font">(最多添加10个)</text></view>
<view class="label-list flex-rs me-label-list">
<block wx:for="{{alllabel}}">
<block wx:if="{{item.often_use!=''}}">
... ... @@ -13,7 +13,7 @@
</block>
<view style="min-width:176rpx;"><input class="black-font flex-cc font28r smooth label-input flex-cc" placeholder="添加备注" maxlength="10" style="width:{{defineremark && defineremark.length>4 ? (defineremark.length-4)*28+160 : 160}}rpx;" value="{{defineremark}}" bindinput="inputremark" focus="{{focus}}" cursor-spacing="160" bindblur="addinputlabel" placeholder-style="color:#999;font-size:28rpx;text-align:center;"/></view>
</view>
<view class="label-title black-font font30r smooth">所有备注</view>
<view class="label-title black-font font30r smooth">所有备注<text class="font24r smooth gray-deep-font">(最多添加20个)</text></view>
<view class="label-list flex-rs">
<block wx:for="{{alllabel}}">
<view class="label-single flex-cc font28r smooth {{item.often_use!='' ? 'bg_green white-font' : 'all-label green-font'}}" data-id="{{item.id}}" data-type="{{item.often_use!='' ? 'often' : 'custom'}}" bindtap="taplabel" style="margin:0 16rpx 20rpx 0;">{{item.custom}}</view>
... ...