Commit a8546000 by chenwq

日历预约bugfix,样式

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