Showing
8 changed files
with
73 additions
and
79 deletions
| @@ -37,7 +37,7 @@ Component({ | @@ -37,7 +37,7 @@ Component({ | ||
| 37 | if(this.data.detail && this.data.detail.rdate){ | 37 | if(this.data.detail && this.data.detail.rdate){ |
| 38 | this.setData({ | 38 | this.setData({ |
| 39 | rdateStr:util.unixtoTime(this.data.detail.rdate,'MM月DD日 HH:II'), | 39 | rdateStr:util.unixtoTime(this.data.detail.rdate,'MM月DD日 HH:II'), |
| 40 | - tableSubInfo:this.data.detail.tableFirst+' '+this.data.detail.tableSubInfo, | 40 | + tableSubInfo:(this.data.detail.tableFirst||'')+' '+(this.data.detail.tableSubInfo||''), |
| 41 | }) | 41 | }) |
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | class="share-but-view"> | 15 | class="share-but-view"> |
| 16 | <view class="share-but Regular">邀请同行的朋友</view> | 16 | <view class="share-but Regular">邀请同行的朋友</view> |
| 17 | </userinfo-share> | 17 | </userinfo-share> |
| 18 | + <view style="height: 40rpx;"></view> | ||
| 18 | <card seller="{{detail.seller}}" detail="{{detail}}"></card> | 19 | <card seller="{{detail.seller}}" detail="{{detail}}"></card> |
| 19 | <view class="detail-info Medium" style="margin-top: 56rpx;"> | 20 | <view class="detail-info Medium" style="margin-top: 56rpx;"> |
| 20 | <view class="flex-lr"> | 21 | <view class="flex-lr"> |
| @@ -8,14 +8,9 @@ Page({ | @@ -8,14 +8,9 @@ Page({ | ||
| 8 | * 页面的初始数据 | 8 | * 页面的初始数据 |
| 9 | */ | 9 | */ |
| 10 | data: { | 10 | data: { |
| 11 | - tabFlag:0, | ||
| 12 | - list:[{ | ||
| 13 | - success:[], | ||
| 14 | - padding:[] | ||
| 15 | - },{ | ||
| 16 | - success:[], | ||
| 17 | - padding:[] | ||
| 18 | - }] | 11 | + success:[], |
| 12 | + padding:[], | ||
| 13 | + total:0, | ||
| 19 | }, | 14 | }, |
| 20 | 15 | ||
| 21 | /** | 16 | /** |
| @@ -58,23 +53,27 @@ Page({ | @@ -58,23 +53,27 @@ Page({ | ||
| 58 | openid:getApp().openid, | 53 | openid:getApp().openid, |
| 59 | }).then(res => { | 54 | }).then(res => { |
| 60 | let data=this.formatList(res.data); | 55 | let data=this.formatList(res.data); |
| 61 | - let list=this.data.list; | ||
| 62 | - list[this.data.tabFlag]=data; | ||
| 63 | this.setData({ | 56 | this.setData({ |
| 64 | - list:list | 57 | + success:data.success, |
| 58 | + padding:data.padding, | ||
| 59 | + total:res.data.success.length+res.data.padding.length | ||
| 65 | }) | 60 | }) |
| 66 | }) | 61 | }) |
| 67 | }, | 62 | }, |
| 68 | _formatList(list){ | 63 | _formatList(list){ |
| 69 | - if(!list) return []; | 64 | + if(!list) return {}; |
| 65 | + let dlist={}; | ||
| 70 | if(list.length>0){ | 66 | if(list.length>0){ |
| 71 | let openid=getApp().openid; | 67 | let openid=getApp().openid; |
| 72 | list.forEach(row=>{ | 68 | list.forEach(row=>{ |
| 73 | row.rdateStr=util.unixtoTime(row.rdate,'MM月DD日 WW HH:II'); | 69 | row.rdateStr=util.unixtoTime(row.rdate,'MM月DD日 WW HH:II'); |
| 74 | - row.navigator=row.openid==openid?'detail_owner':'detail_customer' | 70 | + row.navigator=row.openid==openid?'detail_owner':'detail_customer'; |
| 71 | + let d=util.unixtoTime(row.rdate,'MM月DD日 DAY 星期WW'); | ||
| 72 | + typeof dlist[d]=='undefined'?dlist[d]=[]:''; | ||
| 73 | + dlist[d].push(row); | ||
| 75 | }) | 74 | }) |
| 76 | } | 75 | } |
| 77 | - return list; | 76 | + return dlist; |
| 78 | }, | 77 | }, |
| 79 | formatList(res){ | 78 | formatList(res){ |
| 80 | res.success=this._formatList(res.success); | 79 | res.success=this._formatList(res.success); |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "userinfo": "/components/userinfo/userinfo", | 6 | "userinfo": "/components/userinfo/userinfo", |
| 7 | "formids":"/components/formids/formids", | 7 | "formids":"/components/formids/formids", |
| 8 | - "nav":"/components/nav/nav" | 8 | + "nav":"/components/nav/nav", |
| 9 | + "card":"/components/seller-card/seller-card" | ||
| 9 | } | 10 | } |
| 10 | } | 11 | } |
| 1 | <!--pages/customer/list.wxml--> | 1 | <!--pages/customer/list.wxml--> |
| 2 | <nav hasHome>订个座儿</nav> | 2 | <nav hasHome>订个座儿</nav> |
| 3 | <view class="page"> | 3 | <view class="page"> |
| 4 | + <!-- | ||
| 4 | <view class="tabs flex-cc"> | 5 | <view class="tabs flex-cc"> |
| 5 | <view class="item {{0==tabFlag?'active':''}}" | 6 | <view class="item {{0==tabFlag?'active':''}}" |
| 6 | bindtap="switchTab" data-index="0">我的日程</view> | 7 | bindtap="switchTab" data-index="0">我的日程</view> |
| @@ -8,53 +9,37 @@ | @@ -8,53 +9,37 @@ | ||
| 8 | <view class="item {{1==tabFlag?'active':''}}" | 9 | <view class="item {{1==tabFlag?'active':''}}" |
| 9 | bindtap="switchTab" data-index="1">我的订座</view> | 10 | bindtap="switchTab" data-index="1">我的订座</view> |
| 10 | </view> | 11 | </view> |
| 11 | - <block wx:for="{{list}}" wx:key="list.key" wx:for-item="parts" wx:for-index="tabindex"> | ||
| 12 | - <block wx:if="{{parts.success.length>0 || parts.padding.length>0}}"> | ||
| 13 | - <block wx:for="{{parts}}" wx:key="partskey" wx:for-item="part" wx:for-index="partIndex"> | ||
| 14 | - <view class="list-content" wx:if="{{tabindex==tabFlag && part.length>0}}"> | ||
| 15 | - <view class="cate-class">{{partIndex=='success'?'即将开始':'待处理'}}<text>({{part.length}}条)</text></view> | ||
| 16 | - <block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail"> | ||
| 17 | - | ||
| 18 | - <view class="card" style="width: 100%;"> | ||
| 19 | - <navigator url="/pages/customer/{{detail.navigator}}?id={{detail.id}}"> | ||
| 20 | - <view class="bottom"> | ||
| 21 | - <view class="rdateStr Medium">{{detail.rdateStr}}</view> | ||
| 22 | - <view class="seller flex-lr" bindtap="lookLocation"> | ||
| 23 | - <view class="seller-info"> | ||
| 24 | - <view class="name Medium">{{detail.seller.sellername}}</view> | ||
| 25 | - <view class="addr">{{detail.seller.map_address}}</view> | ||
| 26 | - </view> | ||
| 27 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/success.png" | ||
| 28 | - style="width:160rpx;height: 94rpx;" | ||
| 29 | - wx:if="{{tabFlag==1}}"></image> | ||
| 30 | - </view> | ||
| 31 | - </view> | ||
| 32 | - </navigator> | ||
| 33 | - <view class="top"> | ||
| 34 | - <view class="customers flex-ll" wx:if="{{detail.customers.length>0}}"> | ||
| 35 | - <block wx:for="{{detail.customers}}"> | ||
| 36 | - <image src="{{item.headimgurl}}" wx:if="{{index<5}}"></image> | ||
| 37 | - </block> | ||
| 38 | - <view>等{{detail.customers.length}}人已参加</view> | ||
| 39 | - </view> | ||
| 40 | - <view class="flex-lr"> | ||
| 41 | - <view class="title">{{detail.topic?'#'+detail.topic+'#':''}}</view> | ||
| 42 | - <userinfo binduserinfo="userinfo" | ||
| 43 | - class="share-but-view" data-id="{{detail.id}}" data-type="{{partIndex}}"> | ||
| 44 | - <view class="share-but{{partIndex=='success'?'':'-write'}} Regular">{{partIndex=='success'?'邀请':'接受'}}</view> | ||
| 45 | - </userinfo> | ||
| 46 | - </view> | ||
| 47 | - </view> | ||
| 48 | - </view> | ||
| 49 | - | ||
| 50 | - </block> | ||
| 51 | - </view> | ||
| 52 | - </block> | 12 | + --> |
| 13 | + <block wx:if="{{total==0}}"> | ||
| 14 | + <view wx:if="{{tabindex==tabFlag}}" class="flex-vc empry"> | ||
| 15 | + <image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image> | ||
| 16 | + <view class="Medium">{{0==tabFlag?'暂无日程':'暂无订座'}}</view> | ||
| 17 | + </view> | ||
| 18 | + </block> | ||
| 19 | + <block wx:else=""> | ||
| 20 | + <block wx:for="{{success}}" wx:key="success.key" wx:for-item="part" wx:for-index="dateIndex"> | ||
| 21 | + <view class="list-content" wx:if="{{part.length>0}}"> | ||
| 22 | + <view class="cate-class" style="margin-bottom: 40rpx;margin-left: 44rpx;">{{dateIndex}}</view> | ||
| 23 | + <block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail"> | ||
| 24 | + <navigator url="/pages/customer/{{detail.navigator}}?id={{detail.id}}"> | ||
| 25 | + <view class="card"> | ||
| 26 | + <card seller="{{detail.seller}}" detail="{{detail}}"></card> | ||
| 27 | + </view> | ||
| 28 | + </navigator> | ||
| 29 | + </block> | ||
| 30 | + </view> | ||
| 53 | </block> | 31 | </block> |
| 54 | - <block wx:else> | ||
| 55 | - <view wx:if="{{tabindex==tabFlag}}" class="flex-vc empry"> | ||
| 56 | - <image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image> | ||
| 57 | - <view class="Medium">{{0==tabFlag?'暂无日程':'暂无订座'}}</view> | 32 | + <block wx:for="{{padding}}" wx:key="padding.key" wx:for-item="part" wx:for-index="dateIndex"> |
| 33 | + <view class="list-content" wx:if="{{part.length>0}}"> | ||
| 34 | + <view class="cate-class" style="margin-bottom: 26rpx;">待处理<text>({{part.length}}条)</text></view> | ||
| 35 | + <view class="cate-class" style="margin-bottom: 40rpx;margin-top: 0;margin-left: 44rpx;">{{dateIndex}}</view> | ||
| 36 | + <block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail"> | ||
| 37 | + <navigator url="/pages/customer/{{detail.navigator}}?id={{detail.id}}"> | ||
| 38 | + <view class="card"> | ||
| 39 | + <card seller="{{detail.seller}}" detail="{{detail}}"></card> | ||
| 40 | + </view> | ||
| 41 | + </navigator> | ||
| 42 | + </block> | ||
| 58 | </view> | 43 | </view> |
| 59 | </block> | 44 | </block> |
| 60 | </block> | 45 | </block> |
| @@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
| 73 | "id": 6, | 73 | "id": 6, |
| 74 | "name": "pages/customer/index", | 74 | "name": "pages/customer/index", |
| 75 | "pathName": "pages/customer/index", | 75 | "pathName": "pages/customer/index", |
| 76 | - "query": "id=17", | 76 | + "query": "id=21", |
| 77 | "scene": "1044", | 77 | "scene": "1044", |
| 78 | "shareInfo": { | 78 | "shareInfo": { |
| 79 | "groupName": "测试模拟群1", | 79 | "groupName": "测试模拟群1", |
| @@ -96,13 +96,6 @@ | @@ -96,13 +96,6 @@ | ||
| 96 | }, | 96 | }, |
| 97 | { | 97 | { |
| 98 | "id": -1, | 98 | "id": -1, |
| 99 | - "name": "预定本-无参数", | ||
| 100 | - "pathName": "pages/book/b_index", | ||
| 101 | - "query": "", | ||
| 102 | - "scene": "1001" | ||
| 103 | - }, | ||
| 104 | - { | ||
| 105 | - "id": -1, | ||
| 106 | "name": "pages/customer/index 无产进列表", | 99 | "name": "pages/customer/index 无产进列表", |
| 107 | "pathName": "pages/customer/index", | 100 | "pathName": "pages/customer/index", |
| 108 | "query": "", | 101 | "query": "", |
| @@ -46,15 +46,30 @@ function unixtoTime(ns,format) { | @@ -46,15 +46,30 @@ function unixtoTime(ns,format) { | ||
| 46 | result=result.replace('SS',ss>9?ss:'0'+ss); | 46 | result=result.replace('SS',ss>9?ss:'0'+ss); |
| 47 | var week; | 47 | var week; |
| 48 | switch (time.getDay()) { | 48 | switch (time.getDay()) { |
| 49 | - case 0:week="周日";break | ||
| 50 | - case 1:week="周一";break | ||
| 51 | - case 2:week="周二";break | ||
| 52 | - case 3:week="周三";break | ||
| 53 | - case 4:week="周四";break | ||
| 54 | - case 5:week="周五";break | ||
| 55 | - case 6:week="周六";break | 49 | + case 0:week="日";break |
| 50 | + case 1:week="一";break | ||
| 51 | + case 2:week="二";break | ||
| 52 | + case 3:week="三";break | ||
| 53 | + case 4:week="四";break | ||
| 54 | + case 5:week="五";break | ||
| 55 | + case 6:week="六";break | ||
| 56 | } | 56 | } |
| 57 | result=result.replace('WW',week); | 57 | result=result.replace('WW',week); |
| 58 | + if(format.indexOf('DAY')>0){ | ||
| 59 | + var day = new Date(); | ||
| 60 | + //day.setDate(day.getDate());//今天 | ||
| 61 | + console.log('ns<day.getTime()',ns,day.getTime(),ns<day.getTime()) | ||
| 62 | + if(ns<day.getTime()){ | ||
| 63 | + result=result.replace('DAY','今天'); | ||
| 64 | + }else{ | ||
| 65 | + day.setDate(day.getDate() +1);//明天 | ||
| 66 | + if(ns<day.getTime()){ | ||
| 67 | + result=result.replace('DAY','明天'); | ||
| 68 | + }else{ | ||
| 69 | + result=result.replace('DAY',''); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + } | ||
| 58 | return result; | 73 | return result; |
| 59 | } | 74 | } |
| 60 | 75 |
-
Please register or login to post a comment