Showing
17 changed files
with
310 additions
and
23 deletions
components/reserve/invitation/ddate.js
0 → 100644
| 1 | +// components/reserve/invitation/ddate.js | ||
| 2 | +import util from '../../../utils/util' | ||
| 3 | +import App from '../../../utils/api' | ||
| 4 | +Component({ | ||
| 5 | + /** | ||
| 6 | + * 组件的属性列表 | ||
| 7 | + */ | ||
| 8 | + properties: { | ||
| 9 | + order:{ | ||
| 10 | + type:Object, | ||
| 11 | + value:{}, | ||
| 12 | + } | ||
| 13 | + }, | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 组件的初始数据 | ||
| 17 | + */ | ||
| 18 | + data: { | ||
| 19 | + timePickerMask:false, | ||
| 20 | + times:[], | ||
| 21 | + }, | ||
| 22 | + attached(){ | ||
| 23 | + let times=[],defTime='' | ||
| 24 | + let nt=parseInt(new Date()/1000) | ||
| 25 | + let rdate=parseInt(this.data.order.rdate),edate=parseInt(this.data.order.edate) | ||
| 26 | + for(let t=rdate;t<=edate;t+=1800){ | ||
| 27 | + times.push(t); | ||
| 28 | + if(!defTime && nt+1800>t){ | ||
| 29 | + defTime=t | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | + this.setData({ | ||
| 33 | + times:times, | ||
| 34 | + defTime:defTime, | ||
| 35 | + }) | ||
| 36 | + }, | ||
| 37 | + /** | ||
| 38 | + * 组件的方法列表 | ||
| 39 | + */ | ||
| 40 | + methods: { | ||
| 41 | + show(){ | ||
| 42 | + this.setData({ | ||
| 43 | + timePickerMask:true, | ||
| 44 | + }) | ||
| 45 | + }, | ||
| 46 | + calendarClose(){ | ||
| 47 | + this.setData({ | ||
| 48 | + timePickerMask:false, | ||
| 49 | + }) | ||
| 50 | + }, | ||
| 51 | + bindTimePickerChange(e){ | ||
| 52 | + let ddate=util.attr(e,'val') | ||
| 53 | + if(new Date()/1000>ddate){ | ||
| 54 | + return util.toast('请选择可用到店时间','none') | ||
| 55 | + } | ||
| 56 | + App.Customer.SetDdate({ | ||
| 57 | + rid:this.data.order.id, | ||
| 58 | + ddate:ddate | ||
| 59 | + }).then(res=>{ | ||
| 60 | + this.calendarClose() | ||
| 61 | + this.triggerEvent('event',{ddate:ddate}) | ||
| 62 | + }) | ||
| 63 | + }, | ||
| 64 | + } | ||
| 65 | +}) |
components/reserve/invitation/ddate.json
0 → 100644
components/reserve/invitation/ddate.wxml
0 → 100644
| 1 | +<!--components/reserve/invitation/ddate.wxml--> | ||
| 2 | +<wxs src="../../../utils/util.wxs" module="util" /> | ||
| 3 | +<view class="calendar-mask" bindtap="calendarClose" | ||
| 4 | + style="height:100%;" wx:if="{{timePickerMask}}"> | ||
| 5 | + <view class="timePicker"> | ||
| 6 | + <view class="flex-lr title Semibold"> | ||
| 7 | + <view> </view> | ||
| 8 | + <view bindtap="calendarClose">请选择您的到店时间</view> | ||
| 9 | + <image class="close" bindtap="calendarClose"></image> | ||
| 10 | + </view> | ||
| 11 | + <view class="flex-ll" style="flex-wrap:wrap"> | ||
| 12 | + <view class="time-item {{item==defTime?'checked':''}}" | ||
| 13 | + style="{{(index+1)%4==0?'margin-right:0;':''}}" | ||
| 14 | + wx:for="{{times}}" wx:key="" | ||
| 15 | + catchtap="bindTimePickerChange" | ||
| 16 | + data-val="{{item}}" | ||
| 17 | + >{{util.unixtoTime(item,'HH:II')}}</view> | ||
| 18 | + </view> | ||
| 19 | + </view> | ||
| 20 | +</view> |
components/reserve/invitation/ddate.wxss
0 → 100644
| 1 | +/* components/reserve/invitation/ddate.wxss */ | ||
| 2 | +@import "../../../app.wxss"; | ||
| 3 | +.calendar-mask{ | ||
| 4 | + position: fixed; | ||
| 5 | + z-index: 99; | ||
| 6 | + width: 100%; | ||
| 7 | + height: 100%; | ||
| 8 | + left:0; | ||
| 9 | + top:0; | ||
| 10 | + background-color: rgba(0,0,0,.5); | ||
| 11 | +} | ||
| 12 | +.timePicker{ | ||
| 13 | + width: calc(100% - 60rpx); | ||
| 14 | + overflow: hidden; | ||
| 15 | + position: absolute; | ||
| 16 | + bottom: 0; | ||
| 17 | + background-color: #FEFEFE; | ||
| 18 | + padding: 0rpx 30rpx 46rpx; | ||
| 19 | + border-radius: 10px 10px 0px 0px ; | ||
| 20 | +} | ||
| 21 | +.timePicker .time-item{ | ||
| 22 | + width: 150rpx; | ||
| 23 | + height: 80rpx; | ||
| 24 | + line-height: 80rpx; | ||
| 25 | + font-size: 36rpx; | ||
| 26 | + color:#8B5318; | ||
| 27 | + border: 2rpx solid #C0A369; | ||
| 28 | + background-color: #FFF5EB; | ||
| 29 | + border-radius: 4rpx; | ||
| 30 | + text-align: center; | ||
| 31 | + margin-right: 30rpx; | ||
| 32 | + margin-bottom: 40rpx; | ||
| 33 | + box-sizing: border-box; | ||
| 34 | +} | ||
| 35 | +.timePicker .time-item.checked{ | ||
| 36 | + | ||
| 37 | +} | ||
| 38 | +.timePicker .close{ | ||
| 39 | + width: 32rpx; | ||
| 40 | + height: 32rpx; | ||
| 41 | + background-image: url("http://qn.colorcun.com/reserve/images/ddate-close.png"); | ||
| 42 | + background-size: 100% 100%; | ||
| 43 | +} | ||
| 44 | +.title{ | ||
| 45 | + margin-top: 40rpx; | ||
| 46 | + margin-bottom: 40rpx; | ||
| 47 | + font-size: 32rpx; | ||
| 48 | + color: #353535; | ||
| 49 | + line-height: 44rpx; | ||
| 50 | + height: 44rpx; | ||
| 51 | +} |
| @@ -39,7 +39,13 @@ | @@ -39,7 +39,13 @@ | ||
| 39 | </view> | 39 | </view> |
| 40 | 40 | ||
| 41 | <block wx:if="{{detail.hasRunning}}"> | 41 | <block wx:if="{{detail.hasRunning}}"> |
| 42 | - <view class="flex-lr share-view" > | 42 | + <view class="flex-lr share-view" wx:if="{{detail.type==1}}"> |
| 43 | + <formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1" | ||
| 44 | + class="share-but-view"> | ||
| 45 | + <view class="share-but Regular">邀请同行的朋友</view> | ||
| 46 | + </formids> | ||
| 47 | + </view> | ||
| 48 | + <view class="flex-lr share-view" wx:else=""> | ||
| 43 | <userinfo-share | 49 | <userinfo-share |
| 44 | binduserinfo="userinfo" | 50 | binduserinfo="userinfo" |
| 45 | bindshare="share" | 51 | bindshare="share" |
| @@ -56,7 +62,7 @@ | @@ -56,7 +62,7 @@ | ||
| 56 | share="{{detail}}" | 62 | share="{{detail}}" |
| 57 | share-act="invitation" | 63 | share-act="invitation" |
| 58 | class="share-but-view"> | 64 | class="share-but-view"> |
| 59 | - <view class="share-but Regular">自带酒水</view> | 65 | + <view class="share-but Regular">订酒水</view> |
| 60 | </userinfo> | 66 | </userinfo> |
| 61 | <userinfo wx:if="{{detail.seller.is_open_order==1}}" | 67 | <userinfo wx:if="{{detail.seller.is_open_order==1}}" |
| 62 | binduserinfo="cookbook" | 68 | binduserinfo="cookbook" |
| @@ -118,6 +118,8 @@ Page({ | @@ -118,6 +118,8 @@ Page({ | ||
| 118 | addr:res.data.seller.real_address||res.data.seller.map_address, | 118 | addr:res.data.seller.real_address||res.data.seller.map_address, |
| 119 | image:res.data.image_url, | 119 | image:res.data.image_url, |
| 120 | hasOwner:true, | 120 | hasOwner:true, |
| 121 | + type:res.data.type, | ||
| 122 | + is_set_ddate:res.data.is_set_ddate | ||
| 121 | } | 123 | } |
| 122 | }) | 124 | }) |
| 123 | App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{ | 125 | App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{ |
| @@ -274,4 +276,11 @@ Page({ | @@ -274,4 +276,11 @@ Page({ | ||
| 274 | data: this.msgTpl | 276 | data: this.msgTpl |
| 275 | }) | 277 | }) |
| 276 | }, | 278 | }, |
| 279 | + upTime(){ | ||
| 280 | + this.selectComponent('#ddate').show(); | ||
| 281 | + }, | ||
| 282 | + ddateEvent(e){ | ||
| 283 | + console.log(e.detail.ddate) | ||
| 284 | + this.getDetail(true) | ||
| 285 | + }, | ||
| 277 | }) | 286 | }) |
| @@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
| 6 | "userinfo": "/components/userinfo/userinfo", | 6 | "userinfo": "/components/userinfo/userinfo", |
| 7 | "nav":"/components/nav/nav", | 7 | "nav":"/components/nav/nav", |
| 8 | "formids":"/components/formids/formids", | 8 | "formids":"/components/formids/formids", |
| 9 | + "ddate":"/components/reserve/invitation/ddate", | ||
| 9 | "userinfo-share": "/components/userinfo/share" | 10 | "userinfo-share": "/components/userinfo/share" |
| 10 | } | 11 | } |
| 11 | } | 12 | } |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | <view class="opt-view flex-vc"> | 6 | <view class="opt-view flex-vc"> |
| 7 | <block wx:if="{{!detail.hasOvered && !detail.hasCancel}}"> | 7 | <block wx:if="{{!detail.hasOvered && !detail.hasCancel}}"> |
| 8 | <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" catchtap="catchtap"> | 8 | <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" catchtap="catchtap"> |
| 9 | - <view class="buts-share animation"></view> | 9 | + <view class="buts-share"></view> |
| 10 | </userinfo-share> | 10 | </userinfo-share> |
| 11 | </block> | 11 | </block> |
| 12 | <block wx:elif="{{detail.hasCancel}}"> | 12 | <block wx:elif="{{detail.hasCancel}}"> |
| @@ -48,3 +48,4 @@ | @@ -48,3 +48,4 @@ | ||
| 48 | <template name="tpl-2"> | 48 | <template name="tpl-2"> |
| 49 | <template is="tpl-wenxin" data="{{...seller,options}}"></template> | 49 | <template is="tpl-wenxin" data="{{...seller,options}}"></template> |
| 50 | </template> | 50 | </template> |
| 51 | +<ddate id="ddate" order="{{detail}}" wx:if="{{detail}}" bindevent="ddateEvent"></ddate> |
| @@ -9,11 +9,15 @@ Page({ | @@ -9,11 +9,15 @@ Page({ | ||
| 9 | * 页面的初始数据 | 9 | * 页面的初始数据 |
| 10 | */ | 10 | */ |
| 11 | data: { | 11 | data: { |
| 12 | - success: [], | ||
| 13 | - padding: [], | 12 | + list: [], |
| 14 | total: 0, | 13 | total: 0, |
| 14 | + tabType:1, | ||
| 15 | + hasMore:true, | ||
| 15 | }, | 16 | }, |
| 16 | - | 17 | + tabType:1, |
| 18 | + offset:1, | ||
| 19 | + limit:10, | ||
| 20 | + hasMore:true, | ||
| 17 | /** | 21 | /** |
| 18 | * 生命周期函数--监听页面加载 | 22 | * 生命周期函数--监听页面加载 |
| 19 | */ | 23 | */ |
| @@ -51,14 +55,21 @@ Page({ | @@ -51,14 +55,21 @@ Page({ | ||
| 51 | getListData() { | 55 | getListData() { |
| 52 | App.Reserve.GetListFromScheAndRes({ | 56 | App.Reserve.GetListFromScheAndRes({ |
| 53 | flag: 1, | 57 | flag: 1, |
| 58 | + type: this.tabType, | ||
| 54 | openid: getApp().openid, | 59 | openid: getApp().openid, |
| 60 | + offset:this.offset, | ||
| 61 | + limit:this.limit, | ||
| 55 | }).then(res => { | 62 | }).then(res => { |
| 56 | - let total = res.data.success.length + res.data.padding.length | 63 | + let total = res.data.success.length |
| 57 | let data = this.formatList(res.data); | 64 | let data = this.formatList(res.data); |
| 65 | + | ||
| 66 | + this.hasMore=data.success.length>=this.limit | ||
| 67 | + if(this.hasMore){ | ||
| 68 | + this.offset+=this.limit | ||
| 69 | + } | ||
| 58 | this.setData({ | 70 | this.setData({ |
| 59 | - success: data.success, | ||
| 60 | - padding: data.padding, | ||
| 61 | - total: total | 71 | + list: data.success, |
| 72 | + hasMore:this.hasMore | ||
| 62 | }) | 73 | }) |
| 63 | }) | 74 | }) |
| 64 | }, | 75 | }, |
| @@ -110,4 +121,20 @@ Page({ | @@ -110,4 +121,20 @@ Page({ | ||
| 110 | url:url, | 121 | url:url, |
| 111 | }) | 122 | }) |
| 112 | }, | 123 | }, |
| 124 | + switchType(e){ | ||
| 125 | + this.tabType=util.attr(e,'type') | ||
| 126 | + this.setData({ | ||
| 127 | + tabType:this.tabType, | ||
| 128 | + }) | ||
| 129 | + this.getListData() | ||
| 130 | + }, | ||
| 131 | + /** | ||
| 132 | + * 页面上拉触底事件的处理函数 | ||
| 133 | + */ | ||
| 134 | + onReachBottom: function (e) { | ||
| 135 | + console.log(e) | ||
| 136 | + if(this.hasMore){ | ||
| 137 | + this.getListData(); | ||
| 138 | + } | ||
| 139 | + }, | ||
| 113 | }) | 140 | }) |
| 1 | <!--pages/customer/list.wxml--> | 1 | <!--pages/customer/list.wxml--> |
| 2 | <nav hasHome>我的订单</nav> | 2 | <nav hasHome>我的订单</nav> |
| 3 | +<view class="tabs flex-lr"> | ||
| 4 | + <view class="item {{tabType==1?'active':''}}" data-type="1" bindtap="switchType">等待确认</view> | ||
| 5 | + <view class="item {{tabType==2?'active':''}}" data-type="2" bindtap="switchType">预订成功</view> | ||
| 6 | + <view class="item {{tabType==3?'active':''}}" data-type="3" bindtap="switchType">历史订单</view> | ||
| 7 | + <view class="item {{tabType==4?'active':''}}" data-type="4" bindtap="switchType">无效预订</view> | ||
| 8 | +</view> | ||
| 3 | <view class="page"> | 9 | <view class="page"> |
| 4 | - <block wx:if="{{total==0}}"> | 10 | + <block wx:if="{{list.length==0}}"> |
| 5 | <view class="flex-vc empry"> | 11 | <view class="flex-vc empry"> |
| 6 | <image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image> | 12 | <image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image> |
| 7 | <view class="Medium">暂无订座</view> | 13 | <view class="Medium">暂无订座</view> |
| 8 | </view> | 14 | </view> |
| 9 | </block> | 15 | </block> |
| 10 | <block wx:else=""> | 16 | <block wx:else=""> |
| 11 | - <block wx:for="{{success}}" wx:key="success.key" wx:for-item="part" wx:for-index="dateIndex"> | 17 | + <block wx:for="{{list}}" wx:key="success.key" wx:for-item="part" wx:for-index="dateIndex"> |
| 12 | <view class="list-content" wx:if="{{part.length>0}}"> | 18 | <view class="list-content" wx:if="{{part.length>0}}"> |
| 13 | <block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail"> | 19 | <block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail"> |
| 14 | <view class="card"> | 20 | <view class="card"> |
| 1 | /* pages/customer/list.wxss */ | 1 | /* pages/customer/list.wxss */ |
| 2 | .page{ | 2 | .page{ |
| 3 | width: 90%; | 3 | width: 90%; |
| 4 | - margin: 30rpx 5% 0; | 4 | + margin: 90rpx 5% 0; |
| 5 | color:#353535; | 5 | color:#353535; |
| 6 | } | 6 | } |
| 7 | 7 | ||
| @@ -56,16 +56,29 @@ | @@ -56,16 +56,29 @@ | ||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | .tabs{ | 58 | .tabs{ |
| 59 | - margin: 56rpx 0 88rpx; | ||
| 60 | - font-size: 38rpx; | ||
| 61 | - color:#999999; | ||
| 62 | - font-weight: bold; | 59 | + font-size: 30rpx; |
| 60 | + color:##353535; | ||
| 61 | + position: fixed; | ||
| 62 | + width: 90%; | ||
| 63 | + padding: 0 5%; | ||
| 64 | + background-color: #fff; | ||
| 65 | + z-index: 9; | ||
| 63 | } | 66 | } |
| 64 | .tabs .item{ | 67 | .tabs .item{ |
| 65 | - | 68 | + width: 25%; |
| 69 | + border: 2rpx solid #E0E0E0; | ||
| 70 | + height: 56rpx; | ||
| 71 | + line-height: 56rpx; | ||
| 72 | + text-align: center; | ||
| 73 | + border-right-width: 0; | ||
| 74 | +} | ||
| 75 | +.tabs .item:last-child{ | ||
| 76 | + border-right-width: 2rpx; | ||
| 66 | } | 77 | } |
| 67 | .tabs .active{ | 78 | .tabs .active{ |
| 68 | - color:#353535; | 79 | + color:#FFFFFF; |
| 80 | + background-color: #C8B16D; | ||
| 81 | + border-color: #C8B16D; | ||
| 69 | } | 82 | } |
| 70 | .empry{ | 83 | .empry{ |
| 71 | font-size: 34rpx; | 84 | font-size: 34rpx; |
| @@ -20,7 +20,10 @@ | @@ -20,7 +20,10 @@ | ||
| 20 | 时间 | 20 | 时间 |
| 21 | <view class="title-right"></view> | 21 | <view class="title-right"></view> |
| 22 | </view> | 22 | </view> |
| 23 | - <view class="content">{{date}}</view> | 23 | + <view class="content flex-cc"> |
| 24 | + {{date}} | ||
| 25 | + <view class="upTime" bindtap="upTime" wx:if="{{is_set_ddate==0 && type==1}}">修改时间</view> | ||
| 26 | + </view> | ||
| 24 | <view class="title title-addr-view flex-cc" bindtap="lookLocation"> | 27 | <view class="title title-addr-view flex-cc" bindtap="lookLocation"> |
| 25 | <view class="title-addr"></view> | 28 | <view class="title-addr"></view> |
| 26 | 地址导航 | 29 | 地址导航 |
| @@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
| 51 | font-size: 36rpx; | 51 | font-size: 36rpx; |
| 52 | line-height: 50rpx; | 52 | line-height: 50rpx; |
| 53 | text-align: center; | 53 | text-align: center; |
| 54 | - align-items:flex-start; | 54 | + /*align-items:flex-start;*/ |
| 55 | width: 90%; | 55 | width: 90%; |
| 56 | } | 56 | } |
| 57 | .seller .content:last-child{ | 57 | .seller .content:last-child{ |
| @@ -254,4 +254,13 @@ | @@ -254,4 +254,13 @@ | ||
| 254 | .buts-text{ | 254 | .buts-text{ |
| 255 | height: 40rpx; | 255 | height: 40rpx; |
| 256 | line-height: 40rpx; | 256 | line-height: 40rpx; |
| 257 | +} | ||
| 258 | +.upTime{ | ||
| 259 | + width: 92rpx; | ||
| 260 | + height: 34rpx; | ||
| 261 | + line-height: 34rpx; | ||
| 262 | + font-size: 20rpx; | ||
| 263 | + background-color: #ECD9B7; | ||
| 264 | + color: #794F28; | ||
| 265 | + margin-left: 20rpx; | ||
| 257 | } | 266 | } |
| @@ -44,6 +44,10 @@ | @@ -44,6 +44,10 @@ | ||
| 44 | "currentL": -1, | 44 | "currentL": -1, |
| 45 | "list": [] | 45 | "list": [] |
| 46 | }, | 46 | }, |
| 47 | + "gamePlugin": { | ||
| 48 | + "current": -1, | ||
| 49 | + "list": [] | ||
| 50 | + }, | ||
| 47 | "miniprogram": { | 51 | "miniprogram": { |
| 48 | "current": 54, | 52 | "current": 54, |
| 49 | "list": [ | 53 | "list": [ |
| @@ -355,7 +359,7 @@ | @@ -355,7 +359,7 @@ | ||
| 355 | "id": 40, | 359 | "id": 40, |
| 356 | "name": "邀请Ren pages/customer/index ", | 360 | "name": "邀请Ren pages/customer/index ", |
| 357 | "pathName": "pages/customer/detail_owner_invitation", | 361 | "pathName": "pages/customer/detail_owner_invitation", |
| 358 | - "query": "id=7611&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", | 362 | + "query": "id=25569&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", |
| 359 | "scene": null | 363 | "scene": null |
| 360 | }, | 364 | }, |
| 361 | { | 365 | { |
| @@ -476,6 +480,13 @@ | @@ -476,6 +480,13 @@ | ||
| 476 | "pathName": "pages/customer/detail_owner", | 480 | "pathName": "pages/customer/detail_owner", |
| 477 | "query": "id=25569&hasFirstShow=1", | 481 | "query": "id=25569&hasFirstShow=1", |
| 478 | "scene": null | 482 | "scene": null |
| 483 | + }, | ||
| 484 | + { | ||
| 485 | + "id": -1, | ||
| 486 | + "name": "pages/me/list 我的订单", | ||
| 487 | + "pathName": "pages/me/list", | ||
| 488 | + "query": "id=1017&act=quanzi", | ||
| 489 | + "scene": null | ||
| 479 | } | 490 | } |
| 480 | ] | 491 | ] |
| 481 | } | 492 | } |
| @@ -279,6 +279,12 @@ export default { | @@ -279,6 +279,12 @@ export default { | ||
| 279 | host: 'https://cli.im/mina/', | 279 | host: 'https://cli.im/mina/', |
| 280 | alias:'generate_qrcode' | 280 | alias:'generate_qrcode' |
| 281 | }, | 281 | }, |
| 282 | + | ||
| 283 | + // 设置到店时间 rid=??&ddate=?? | ||
| 284 | + 'App.Customer.SetDdate':{ | ||
| 285 | + openid:'openid', | ||
| 286 | + silence:false, | ||
| 287 | + }, | ||
| 282 | 288 | ||
| 283 | //获取营业时间段满房接口 | 289 | //获取营业时间段满房接口 |
| 284 | 'App.Customer.GetHouseFullDateTimes':null, | 290 | 'App.Customer.GetHouseFullDateTimes':null, |
| @@ -14,7 +14,7 @@ export default { | @@ -14,7 +14,7 @@ export default { | ||
| 14 | //取消 | 14 | //取消 |
| 15 | detail.hasCancel=detail.status==4; | 15 | detail.hasCancel=detail.status==4; |
| 16 | //结束 | 16 | //结束 |
| 17 | - detail.hasOvered= ns > detail.ddate || (detail.status >= 2 && detail.status <= 3) | 17 | + detail.hasOvered= ns > detail.edate || (detail.status >= 2 && detail.status <= 3) |
| 18 | //正常运行已接单 | 18 | //正常运行已接单 |
| 19 | if(detail.type==0){//B端 | 19 | if(detail.type==0){//B端 |
| 20 | detail.hasRunning = !detail.hasOvered && !detail.hasCancel | 20 | detail.hasRunning = !detail.hasOvered && !detail.hasCancel |
utils/util.wxs
0 → 100644
| 1 | +//时间戳转为时间 | ||
| 2 | +function unixtoTime(ns,format="YYYY-MM-DD HH:II:SS") { | ||
| 3 | + var result; | ||
| 4 | + var time = getDate(ns*1000); | ||
| 5 | + //result=format || 'YYYY年MM月DD日 HH时II分SS秒 WW'; | ||
| 6 | + result=format || 'YYYY年MM月DD日'; | ||
| 7 | + //console.log(format); | ||
| 8 | + result=result.toUpperCase(); | ||
| 9 | + result=result.replace('YYYY',time.getFullYear()); | ||
| 10 | + var m=time.getMonth()+1; | ||
| 11 | + result=result.replace('MM',m>9?m:"0"+m); | ||
| 12 | + var d=time.getDate(); | ||
| 13 | + result=result.replace('DD',d>9?d:'0'+d); | ||
| 14 | + var hh=time.getHours(); | ||
| 15 | + result=result.replace('HH',hh>9?hh:'0'+hh); | ||
| 16 | + var ii=time.getMinutes(); | ||
| 17 | + result=result.replace('II',ii>9?ii:'0'+ii); | ||
| 18 | + var ss=time.getSeconds(); | ||
| 19 | + result=result.replace('SS',ss>9?ss:'0'+ss); | ||
| 20 | + var week; | ||
| 21 | + switch (time.getDay()) { | ||
| 22 | + case 0:week="日";break | ||
| 23 | + case 1:week="一";break | ||
| 24 | + case 2:week="二";break | ||
| 25 | + case 3:week="三";break | ||
| 26 | + case 4:week="四";break | ||
| 27 | + case 5:week="五";break | ||
| 28 | + case 6:week="六";break | ||
| 29 | + } | ||
| 30 | + result=result.replace('WW',week); | ||
| 31 | + if(format.indexOf('DAY')>0){ | ||
| 32 | + // 获取当天 0 点的时间戳 | ||
| 33 | + var timeStamp = getDate(getDate().setHours(0, 0, 0, 0)) / 1000; | ||
| 34 | + | ||
| 35 | + var day1 = timeStamp+86400//今天结束 | ||
| 36 | + var day2 = day1+86400//明天结束 | ||
| 37 | + | ||
| 38 | + //console.log('ns<day.getTime()',timeStamp,ns,day1,day2) | ||
| 39 | + | ||
| 40 | + if(ns>=timeStamp && ns<day1){ | ||
| 41 | + result=result.replace('DAY','今天'); | ||
| 42 | + }else{ | ||
| 43 | + if(ns>=day1 && ns<day2){ | ||
| 44 | + result=result.replace('DAY','明天'); | ||
| 45 | + }else{ | ||
| 46 | + result=result.replace('DAY',''); | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + return result; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +module.exports = { | ||
| 54 | + unixtoTime: unixtoTime, | ||
| 55 | +}; |
-
Please register or login to post a comment