<script>
var uid = ('#order_user_type').val();
let list = document.querySelectorAll('.list');
let menu_a = document.querySelectorAll('.menu a');
let data,newData;
let render = (data,renderindex)=>{
let inner = '';
let wnezi;
data.forEach((item,index)=>{
switch(renderindex){
case 0:
switch(item.order_status) {
case 0:
wnezi = '待审核'
break;
case 1:
wnezi ='已审核'
break;
case 2:
wnezi ='财务已审核'
break;
case 3:
wnezi ='已出库'
break;
case 4:
wnezi ='已发货'
break;
case 5:
wnezi ='已收货'
break;
case 5:
wnezi ='已完成'
break;
default:
wnezi ='正在加载'
}
break;
case 1:
switch(item.order_status) {
case 0:
wnezi = '待审核'
break;
case 1:
wnezi ='已审核'
break;
default:
wnezi ='正在加载'
}
break;
case 2:
switch(item.order_status) {
case 0:
wnezi = '待审核'
break;
case 1:
wnezi ='待财务审核'
break;
case 2:
wnezi ='财务已审核'
break;
default:
wnezi ='正在加载'
}
break;
case 3:
switch(item.order_status) {
case 0:
wnezi = '待审核'
break;
case 1:
wnezi ='已审核'
break;
case 2:
wnezi ='财务已审核'
break;
case 3:
wnezi ='已出库'
break;
case 4:
wnezi ='待收货'
break;
case 5:
wnezi ='已收货'
break;
case 5:
wnezi ='已完成'
break;
default:
wnezi ='正在加载'
}
break;
case 4:
switch(item.complete_status) {
case 0:
wnezi = '未完成'
break;
case 1:
wnezi ='已完成'
break;
default:
wnezi ='正在加载'
}
break;
}
let html = <li> <div class="con"> <a href="//www.greatytc.com/wx/FactoryOrderDetails?id=${item.order_id}"> <div class="orderState"><span>${item.order_sn}</span> <font>${wnezi}</font> </div> <div class="orderGoods"> <ul> <li>时间:${item.created_at}</li> <li>客户:${item.user_name}</li> <li>电话:${item.logistics_info&&JSON.parse(item.logistics_info).contact_phone}</li> <li>金额:¥${item.order_money}</li> </ul> </div> </a> <div class="hjPrice"> <font>共2件商品</font> 实付款:¥388.00 </div> <div class="orderOperation"> <a class="payBut" href="javascript:void(0)" >审核</a> </div> </div> </li>
;
inner+=html
})
let list_ul = list[renderindex].querySelector('ul');
list_ul.innerHTML = inner;
}
//.ajax({
url:"{{ Config::get('url.api_url').'order'}}"+"?uid="+uid+'&order_user_type='+order_user_type+"&key[order_status]={{@$_GET['order_status']??''}}",
type:"GET",
success:function(data){
console.log(data);
if(data.code ==0 ){
data = data.data;
render(data,0);
menu_a.forEach((item,index)=>{
let list_ul = list[index].querySelector('ul');
item.onclick = ()=>{
switch(index){
case 0:
newData = data.filter((item)=>{
return true;
})
break;
case 1:
newData = data.filter((item)=>{
return item.order_status == 0;
})
break;
case 2:
newData = data.filter((item)=>{
return item.order_status == 1;
})
break;
case 3:
newData = data.filter((item)=>{
return item.order_status == 4;
})
break;
case 4:
newData = data.filter((item)=>{
return item.complete_status == 1;
})
break;
}
// console.log(newData.length);
render(newData,index);
}
})
}
}
});
}
</script>
h5页面渲染js
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...