Commit 959cc32d authored by 和慭琛's avatar 和慭琛

下单列表页 页面搭建 100%

parent d39ffb32
<template>
<view class="">
下单列表页
<view class="topView">
<view :class="activeTop == 0 ? 'topItemView activeColor' : 'topItemView' " @click="topClick(0)">
<text class="topItemText">未完成</text>
</view>
<view :class="activeTop == 1 ? 'topItemView activeColor' : 'topItemView' " @click="topClick(1)">
<text class="topItemText">已完成</text>
</view>
</view>
<view class="listView">
<view class="itemView" v-for="(item,ikey) in unfinishList":key="ikey" v-if="activeTop == 0">
<view class="nameView">
<text class="u-font-24 u-m-l-24">{{item.name}} {{item.phone}}</text>
<text class="u-font-24 u-m-r-24">{{item.type}}</text>
</view>
<text class="u-font-24 u-m-l-24 u-m-r-24">{{item.address}}</text>
<view class="nameView">
<text class="u-font-24 u-m-l-24 underLine" @click="callClick(item.worker_phone)">{{item.worker_name}} {{item.worker_phone}}</text>
<text class="u-font-24 u-m-r-24">{{item.status}}</text>
</view>
</view>
<view class="itemView" v-for="(item,ikey) in finishList":key="ikey" v-if="activeTop == 1">
<view class="nameView">
<text class="u-font-24 u-m-l-24">{{item.name}} {{item.phone}}</text>
<text class="u-font-24 u-m-r-24">{{item.type}}</text>
</view>
<text class="u-font-24 u-m-l-24 u-m-r-24">{{item.address}}</text>
<view class="nameView">
<text class="u-font-24 u-m-l-24 underLine" @click="callClick(item.worker_phone)">{{item.worker_name}} {{item.worker_phone}}</text>
<text class="u-font-24 u-m-r-24">{{item.status}}</text>
</view>
</view>
</view>
</view>
</template>
......@@ -8,20 +39,111 @@
export default {
data() {
return {
name: '',
activeTop:0,
unfinishList:[
{
name:'未完工',
phone:'15811112222',
type:'米家-新风机-安装',
address:'广东省深圳市宝安区新安街道庭威产业园10C',
status:'待抢单',
worker_name:'范师傅',
worker_phone:'15933334444'
},
{
name:'许三多',
phone:'15811112222',
type:'TCL-空调-清洗',
address:'广西壮族自治区北海市海城区高德街道北海大道东延线5号和苑12幢203号',
status:'待完工',
worker_name:'范师傅',
worker_phone:'15933334444'
},
],
finishList:[
{
name:'已完工',
phone:'15811112222',
type:'米家-新风机-安装',
address:'广东省深圳市宝安区新安街道庭威产业园10C',
status:'待抢单',
worker_name:'范师傅',
worker_phone:'15933334444'
}
]
}
},
onLoad() {
},
methods: {
productTypeClick: function (item) {
console.log(item.title)
topClick: function (active) {
if(this.activeTop!=active){
this.activeTop = active
}
},
callClick: function (phone) {
console.log(phone)
uni.makePhoneCall({
phoneNumber: phone
});
}
}
}
</script>
<style>
.topView{
display: flex;
flex-direction: row;
}
.topItemView{
background-color: #FFFFFF;
width: 50%;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #999999;
}
.topItemText{
font-size: 28rpx;
}
.activeColor{
background-color: #999999;
}
.listView{
width: 100%;
display: flex;
flex-direction: column;
}
.itemView{
width: 100%;
height: 200rpx;
display: flex;
flex-direction: column;
border-bottom: 2rpx solid #999999;
}
.nameView{
width: 100%;
height: 80rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.underLine{
text-decoration:underline;
}
</style>
<view>下单列表页</view>
\ No newline at end of file
<view><view class="topView"><view data-event-opts="{{[['tap',[['topClick',[0]]]]]}}" class="{{[activeTop==0?'topItemView activeColor':'topItemView']}}" bindtap="__e"><text class="topItemText">未完成</text></view><view data-event-opts="{{[['tap',[['topClick',[1]]]]]}}" class="{{[activeTop==1?'topItemView activeColor':'topItemView']}}" bindtap="__e"><text class="topItemText">已完成</text></view></view><view class="listView"><block wx:for="{{unfinishList}}" wx:for-item="item" wx:for-index="ikey" wx:key="ikey"><block wx:if="{{activeTop==0}}"><view class="itemView"><view class="nameView"><text class="u-font-24 u-m-l-24">{{item.name+" "+item.phone}}</text><text class="u-font-24 u-m-r-24">{{item.type}}</text></view><text class="u-font-24 u-m-l-24 u-m-r-24">{{item.address}}</text><view class="nameView"><text data-event-opts="{{[['tap',[['callClick',['$0'],[[['unfinishList','',ikey,'worker_phone']]]]]]]}}" class="u-font-24 u-m-l-24 underLine" bindtap="__e">{{item.worker_name+" "+item.worker_phone}}</text><text class="u-font-24 u-m-r-24">{{item.status}}</text></view></view></block></block><block wx:for="{{finishList}}" wx:for-item="item" wx:for-index="ikey" wx:key="ikey"><block wx:if="{{activeTop==1}}"><view class="itemView"><view class="nameView"><text class="u-font-24 u-m-l-24">{{item.name+" "+item.phone}}</text><text class="u-font-24 u-m-r-24">{{item.type}}</text></view><text class="u-font-24 u-m-l-24 u-m-r-24">{{item.address}}</text><view class="nameView"><text data-event-opts="{{[['tap',[['callClick',['$0'],[[['finishList','',ikey,'worker_phone']]]]]]]}}" class="u-font-24 u-m-l-24 underLine" bindtap="__e">{{item.worker_name+" "+item.worker_phone}}</text><text class="u-font-24 u-m-r-24">{{item.status}}</text></view></view></block></block></view></view>
\ No newline at end of file
.topView{
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
flex-direction: row;
}
.topItemView{
background-color: #FFFFFF;
width: 50%;
height: 80rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
border: 2rpx solid #999999;
}
.topItemText{
font-size: 28rpx;
}
.activeColor{
background-color: #999999;
}
.listView{
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
}
.itemView{
width: 100%;
height: 200rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
border-bottom: 2rpx solid #999999;
}
.nameView{
width: 100%;
height: 80rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
flex-direction: row;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.underLine{
text-decoration:underline;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment