Commit a8546000 by chenwq

日历预约bugfix,样式

1 parent 3e0aa2e6
...@@ -41,6 +41,10 @@ module.exports = { ...@@ -41,6 +41,10 @@ module.exports = {
getStatByPeriod(data) { getStatByPeriod(data) {
return api.post('dj.api.smartcarlife.inviteStat.statByPeriod', data) return api.post('dj.api.smartcarlife.inviteStat.statByPeriod', data)
}, },
/** 预约总数 */
getiIviteRecord(data) {
return api.post('dj.api.smartcarlife.inviteRecord.count', data)
},
/** 编辑客户画像 */ /** 编辑客户画像 */
updateProfile(data) { updateProfile(data) {
return api.post('dj.api.smartcarlife.inviteRecord.updateCustomerProfile', data) return api.post('dj.api.smartcarlife.inviteRecord.updateCustomerProfile', data)
......
...@@ -400,11 +400,12 @@ Component({ ...@@ -400,11 +400,12 @@ Component({
now2.setDate(i - resetStartWeek + 1); now2.setDate(i - resetStartWeek + 1);
let obj = {}; let obj = {};
let _month = now2.getMonth() + 1 < 10 ? '0' + (now2.getMonth() + 1) : now2.getMonth() + 1 let _month = now2.getMonth() + 1 < 10 ? '0' + (now2.getMonth() + 1) : now2.getMonth() + 1
let _day = now2.getDate() < 10 ? '0' + now2.getDate() : now2.getDate()
obj = { obj = {
day: now2.getDate(), day: _day,
month: _month, month: _month,
year: now2.getFullYear(), year: now2.getFullYear(),
full: `${now2.getFullYear()}-${_month}-${now2.getDate()}` full: `${now2.getFullYear()}-${_month}-${_day}`
}; };
dateList[i] = obj; dateList[i] = obj;
} }
...@@ -413,6 +414,7 @@ Component({ ...@@ -413,6 +414,7 @@ Component({
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const now2 = new Date(now); const now2 = new Date(now);
let _month = now2.getMonth() + 1 < 10 ? '0' + (now2.getMonth() + 1) : now2.getMonth() + 1 let _month = now2.getMonth() + 1 < 10 ? '0' + (now2.getMonth() + 1) : now2.getMonth() + 1
let _day = now2.getDate() < 10 ? '0' + now2.getDate() : now2.getDate()
//当前周的7天 //当前周的7天
now2.setDate( now2.setDate(
Math.ceil((selectDay + (startWeek - 1)) / 7) * 7 - Math.ceil((selectDay + (startWeek - 1)) / 7) * 7 -
...@@ -422,10 +424,10 @@ Component({ ...@@ -422,10 +424,10 @@ Component({
); );
let obj = {}; let obj = {};
obj = { obj = {
day: now2.getDate(), day: _day,
month: _month, month: _month,
year: now2.getFullYear(), year: now2.getFullYear(),
full: `${now2.getFullYear()}-${_month}-${now2.getDate()}` full: `${now2.getFullYear()}-${_month}-${_day}`
}; };
dateList[i] = obj; dateList[i] = obj;
} }
...@@ -596,9 +598,9 @@ Component({ ...@@ -596,9 +598,9 @@ Component({
console.log(e) console.log(e)
console.log(this.data.currentSelect) console.log(this.data.currentSelect)
let n = this.data.currentSelect let n = this.data.currentSelect
let y = new Date(e.detail).format('YYYY') let y = new Date(e.detail).format('yyyy')
let m = new Date(e.detail).format('MM') let m = new Date(e.detail).format('MM')
let d = new Date(e.detail).format('D') let d = new Date(e.detail).format('dd')
let _day = { let _day = {
year: y, year: y,
month: m, month: m,
...@@ -609,7 +611,7 @@ Component({ ...@@ -609,7 +611,7 @@ Component({
this.setData({ this.setData({
showPopup: false, showPopup: false,
currentMonth: e.detail, currentMonth: e.detail,
showCurrentMonth: new Date(e.detail).format('YYYY年MM月'), showCurrentMonth: new Date(e.detail).format('yyyy年MM月'),
currentSelect: `${y}-${m}-${d}`, currentSelect: `${y}-${m}-${d}`,
selectDay: _day selectDay: _day
}) })
...@@ -690,7 +692,7 @@ Component({ ...@@ -690,7 +692,7 @@ Component({
new Date(); new Date();
let year = now.getFullYear() let year = now.getFullYear()
let month = now.getMonth() + 1 < 10 ? '0' + (now.getMonth() + 1) : now.getMonth() + 1 let month = now.getMonth() + 1 < 10 ? '0' + (now.getMonth() + 1) : now.getMonth() + 1
let day = now.getDate() let day = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
let today = `${year}-${month}-${day}` let today = `${year}-${month}-${day}`
// let selectDay = { // let selectDay = {
// year: year, // year: year,
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<view class="flex"> <view class="flex">
<view class="month"> <view class="month">
{{showCurrentMonth}} {{showCurrentMonth}}
<image src="../../images/icon-arrow.png"></image>
</view> </view>
</view> </view>
<view class="today" bindtap="openPicker">切换 <view class="today" bindtap="openPicker">切换
......
...@@ -36,6 +36,8 @@ Page({ ...@@ -36,6 +36,8 @@ Page({
if (code == '0') { if (code == '0') {
data.forEach(item => { data.forEach(item => {
item.remainNum = item.maxCount - (item.invitedCount || 0) item.remainNum = item.maxCount - (item.invitedCount || 0)
item.isInvite = new Date() < new Date(item.inviteDate + ' ' + item.endTime)
console.log(item, '???')
}) })
// toShopStatus - 到店状态(1:未到店,2:已到店,3:过期到店) // toShopStatus - 到店状态(1:未到店,2:已到店,3:过期到店)
this.setData({ this.setData({
...@@ -74,6 +76,7 @@ Page({ ...@@ -74,6 +76,7 @@ Page({
if (code == '0') { if (code == '0') {
wx.$util.showToast("预约成功") wx.$util.showToast("预约成功")
this.refresh() this.refresh()
wx.$refresh = true
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
...@@ -84,7 +87,6 @@ Page({ ...@@ -84,7 +87,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
}, },
/** /**
......
<!--tabDate/pages/apprManage/apprManage.wxml--> <!--tabDate/pages/apprManage/apprManage.wxml-->
<wxs src="apprManage.wxs" module="filter" />
<view class="appr-manage"> <view class="appr-manage">
<!-- <default-calendar></default-calendar> --> <!-- <default-calendar></default-calendar> -->
<calendar id="calendar" bindselectDay="getListByDay"></calendar> <calendar id="calendar" bindselectDay="getListByDay"></calendar>
...@@ -7,7 +8,7 @@ ...@@ -7,7 +8,7 @@
<view class="bar-point"></view> <view class="bar-point"></view>
<view>客户已预约</view> <view>客户已预约</view>
<view class="bar-point orange"></view> <view class="bar-point orange"></view>
<view>客户超时未到店</view> <view>客户超时未到店</view>
<view class="bar-point grey"></view> <view class="bar-point grey"></view>
<view>客户订单已施工</view> <view>客户订单已施工</view>
</view> </view>
...@@ -15,17 +16,26 @@ ...@@ -15,17 +16,26 @@
<view class="card-box" wx:for="{{list}}" wx:key="index"> <view class="card-box" wx:for="{{list}}" wx:key="index">
<view class="card-head"> <view class="card-head">
<view>{{item.startTime}}-{{item.endTime}}</view> <view>{{item.startTime}}-{{item.endTime}}</view>
<view wx:if="{{item.remainNum > 0}}">本轮时段还可预约<span class="orange-txt">{{item.remainNum}}</span>个客户</view> <view wx:if="{{item.remainNum > 0}}">
<view wx:if="{{item.isInvite}}">本轮时段还可预约<span class="orange-txt">{{item.remainNum}}</span>个客户</view>
<view wx:if="{{!item.isInvite}}" class="tip-txt">本轮时段不可预约</view>
</view>
<view wx:else class="tip-txt">本轮时段已约满</view> <view wx:else class="tip-txt">本轮时段已约满</view>
<view wx:if="{{item.maxNum < 0 && item.isInvite}}">本轮时段不可预约</view>
</view> </view>
<view class="content" wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view class="content" wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="flex"> <view>
<!-- toShopStatus - 到店状态(1:未到店,2:已到店,3:过期到店) --> <view class="flex card-name">
<view class="bar-point card-point {{subItem.toShopStatus == 2 ? 'grey' : ''}} {{subItem.toShopStatus == 3 ? 'orange' : ''}}"></view> <!-- toShopStatus - 到店状态(1:未到店,2:已到店,3:过期到店) -->
<view>{{subItem.customerName}}</view> <view class="bar-point card-point {{subItem.toShopStatus == 2 ? 'grey' : ''}} {{subItem.toShopStatus == 3 ? 'orange' : ''}}"></view>
<view>{{subItem.customerName}}</view>
</view>
<view wx:if="{{subItem.carSeriesName}}" class="text-hide card-car">{subItem.carSeriesName}}</view>
</view> </view>
</view> </view>
<view wx:if="{{item.remainNum > 0}}" class="content appr-btn" bindtap="handleInvite" data-item="{{item}}">+预约</view> <view wx:if="{{item.remainNum > 0 && item.isInvite}}" class="content appr-btn" bindtap="handleInvite" data-item="{{item}}">+预约</view>
<view wx:if="{{item.invitedCount == 0 && !item.isInvite}}" class="card-tip">过去的时间不可预约</view>
<view wx:if="{{item.maxNum < 0 && item.isInvite}}">请联系管理员开通预约工位</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
......
...@@ -38,6 +38,16 @@ ...@@ -38,6 +38,16 @@
margin: 0 8rpx 0 0; margin: 0 8rpx 0 0;
} }
.card-name {
font-size: 24rpx;
color: #333333;
}
.card-car {
font-size: 20rpx;
color: #666666;
}
.card-box { .card-box {
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
...@@ -76,4 +86,11 @@ ...@@ -76,4 +86,11 @@
.card-box .content.appr-btn { .card-box .content.appr-btn {
color: #3582EE; color: #3582EE;
border-style: dashed; border-style: dashed;
}
.card-tip {
font-size: 24rpx;
color: #666666;
text-align: center;
margin: 30rpx 0;
} }
\ No newline at end of file \ No newline at end of file
...@@ -296,6 +296,18 @@ Page({ ...@@ -296,6 +296,18 @@ Page({
phoneShow: app.globalData.YQorderSetting.yqPhoneConfig phoneShow: app.globalData.YQorderSetting.yqPhoneConfig
}) })
this.getStatByPeriod() this.getStatByPeriod()
this.getiIviteRecord()
},
getiIviteRecord() {
let params = {}
api.getiIviteRecord(params).then(res => {
let { data } = res
this.setData({
['tabList[0]']: this.data.tabList[0] + '(' + (data.inviteCount || 0) + ')',
['tabList[1]']: this.data.tabList[1] + '(' + (data.hadInvitedCount || 0) + ')',
['tabList[2]']: this.data.tabList[2] + '(' + (data.notInvitedCount || 0) + ')'
})
})
}, },
getStatByPeriod() { getStatByPeriod() {
let params = { let params = {
...@@ -381,6 +393,8 @@ Page({ ...@@ -381,6 +393,8 @@ Page({
dateItem: item, dateItem: item,
showDate: true showDate: true
}) })
this.getStatByPeriod()
this.getiIviteRecord()
}, },
setInviteDate() { setInviteDate() {
let { dateItem, inviteDateStr } = this.data let { dateItem, inviteDateStr } = this.data
...@@ -415,7 +429,11 @@ Page({ ...@@ -415,7 +429,11 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
if (wx.$refresh) this.search() if (wx.$refresh) {
this.search()
this.getStatByPeriod()
this.getiIviteRecord()
}
}, },
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!