Commit c43b7fbb4afb610f46138a77e1023dc0615d54be

Authored by zhangyan
1 parent 0b4eefb3

预定列表

... ... @@ -2,21 +2,19 @@ var util = require('../../../utils/util.js')
var uri=require('../../../utils/uri.js');
Component({
properties:{
item:Object
item:{
type:Object,
observer:function (v1,v2) {
console.log(v2);
console.log(this)
}
}
},
data:{
vitem:null
},
attached(){
let item=this.data.item;
item.table_ids=item.tid.split(',');
item.phone_mask='';
if(item.phone){
item.phone_mask=item.phone.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){
return $1+'**'+$3;
})
}
this.setData({vitem:item})
this.changeitem();
},
methods:{
detail:function(e){
... ... @@ -25,6 +23,17 @@ Component({
url:util.http_build_query(obj,'b_detail')
})
},
changeitem:function () {
let item=this.data.item;
item.table_ids=item.tid.split(',');
item.phone_mask='';
if(item.phone){
item.phone_mask=item.phone.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){
return $1+'**'+$3;
})
}
this.setData({vitem:item})
}
}
})
\ No newline at end of file
... ...
... ... @@ -56,8 +56,6 @@ Page({
},
onShow:function(){
this.book=this.selectComponent('#bookorder');
console.log(this.book)
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
... ... @@ -94,7 +92,12 @@ Page({
isloading:true,
bookList:json.data.length==0 ? null : json.data
})
console.log(that.data.bookList)
if(json.data.length>0){
that.boolists=that.selectAllComponents('.orderbook');
that.boolists.forEach(function(v,i){
v.changeitem();
})
}
}
})
},
... ... @@ -166,5 +169,5 @@ Page({
searchbook:function(e){
console.log(this.data.form)
this.getbooklist();
}
},
})
\ No newline at end of file
... ...
... ... @@ -45,7 +45,7 @@
<view class="book-list" style="padding-bottom:118rpx;">
<view class="book-list-body">
<block wx:for="{{bookList}}">
<bookList item="{{item}}" bind:changeitem="changeitem" id="bookorder"></bookList>
<bookList item="{{item}}" class="orderbook"></bookList>
</block>
</view>
</view>
... ...