Commit 5ae474c7 by 前端

Merge branch 'SAAS+V5.8.0' into 'master'

上线合并

See merge request !7
2 parents 39453ee0 f2161946
......@@ -98,7 +98,8 @@
"nothing-tips": "/components/Nothing-tips/nothingTips",
"glsx-image": "/components/image/index",
"glsx-privacy": "glsx-applet-component/GlsxPrivacy/index",
"van-popup": "@vant/weapp/popup/index"
"van-popup": "@vant/weapp/popup/index",
"search-input": "/components/SearchInput/SearchInput"
},
"resolveAlias": {
"~/*": "/*"
......
// components/SearchInput/SearchInput.js
Component({
options: {
styleIsolation: 'shared' // 允许外部样式穿透组件
},
/**
* 组件的属性列表
*/
......@@ -7,7 +11,7 @@ Component({
maxlength: {
type: Number,
value: -1
},
},
placeholder: String,
disabled: Boolean,
value: String,
......
......@@ -35,18 +35,29 @@ var isDateWithin7Days = function (date) {
return diffDays >= -7
}
var isDateWithin1Days = function (date) {
// console.log(date, 'date');
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期
var currentDate = getDate() // 当前日期时间
var targetDate = getDate(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
var diffDays = Math.floor(diffMilliseconds / oneDay)
// console.log(diffDays, 'diffDays');
return diffDays >= -1
// 获取当前日期的零点
var currentMidnight = getDate(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()).getTime()
// 获取目标日期的零点
var targetMidnight = getDate(targetDate.getFullYear(), targetDate.getMonth(), targetDate.getDate()).getTime()
// 当天操作当天的记录,永远允许
if (currentMidnight === targetMidnight) {
return true;
}
// 如果目标日期是昨天
var oneDay = 24 * 60 * 60 * 1000;
if (currentMidnight - targetMidnight === oneDay) {
// 昨天的数据,判断当前时间是否在凌晨2点之前
var currentHour = currentDate.getHours();
return currentHour < 2;
}
// 目标日期是未来,或者昨天之前的数据,不允许
return false;
}
var isDateWithin60Days = function (date) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
......
......@@ -136,7 +136,7 @@ Page({
// reportTypeList: [-1]
})
.then(data => {
console.log(data, 'getStaffDailyReportDetailWeeklyList')
console.log(data, '🚀')
// let { code, data, message } = res
// if (code == 0) {
// console.log(data, 'data')
......
......@@ -8,6 +8,9 @@ const __CUR_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth(), 1).get
const __MIN_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth() - 23, 1).getTime()
Component({
options: {
styleIsolation: 'shared'
},
properties: {
showAddIcon: Boolean,
navBarHeight: Number,
......@@ -17,9 +20,10 @@ Component({
},
data: {
searchKeyword:'',
IMG_URL,
// 列表与分页(保持原有结构)
listTabs: ['全部', '跟进中', '已签约', '已绑定', '未签约'],
listTabs: ['全部', '跟进中', '已签约', '未签约'],
customerList: [],
currentPage: 1,
pageSize: 10,
......@@ -53,6 +57,16 @@ Component({
},
methods: {
onSearchConfirm(e){
let {value} = e.detail
this.setData({
searchKeyword:value
},()=>{
this.resetAndLoad(() => {
this.triggerEvent('needScrollTop', this.data.initialTabTop)
})
})
},
getPageData() {
// 获取数据看板数据
this.getStatic()
......@@ -65,10 +79,11 @@ Component({
0: 0, // 全部
1: 1, // 待跟进
2: 3, // 已签约
3: 4, // 已绑定
4: 2 // 未签约
3: 2, // 已绑定
// 4: 2 // 未签约
}
const obj = {
storeName:this.data.searchKeyword,
isAll: boardScopeActive ? 1 : 0,
year: boardScopeActive ? undefined : new Date(monthPickerValue).getFullYear(),
month: boardScopeActive ? undefined : new Date(monthPickerValue).getMonth() + 1,
......
/* pages/tab/customer/components/PotentialSection/PotentialSection.wxss */
.potential-page {
.data-board {
margin: 0 20rpx;
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.board-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
.board-title {
font-size: 32rpx;
font-weight: 600;
color: #181A1F;
}
.board-actions {
display: flex;
gap: 16rpx;
.board-action {
display: flex;
align-items: center;
height: 48rpx;
padding: 0 16rpx;
font-size: 28rpx;
border-radius: 4rpx;
opacity: 1;
border: 1rpx solid #e0e0e0;
color: #999EA8;
position: relative;
image {
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
transform: rotate(90deg);
}
&.active {
color: #292D33;
}
}
}
}
.board-grid {
display: flex;
flex-wrap: wrap;
.grid-item {
margin: 16rpx 0;
&.wid-128 {
width: 256rpx;
}
&.wid-67 {
width: 134rpx;
}
.label {
font-size: 24rpx;
color: #757B85;
}
.value {
font-family: "numberBold";
margin-top: 8rpx;
font-size: 40rpx;
font-weight: 700;
color: #292D33;
}
}
}
}
.tabbar-anchor {
width: 100%;
min-height: 88rpx;
margin-top: 24rpx;
position: sticky;
top: 0;
z-index: 99;
}
/* 列表卡片 */
.list-section {
padding: 24rpx 20rpx 0;
background: #F7F8FA;
.list-card {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 20rpx;
box-shadow: 0 8rpx 16rpx 0 rgba(0,0,0,0.04);
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8rpx;
.title {
font-size: 32rpx;
font-weight: 600;
color: #292D33;
}
.status-tag {
flex-shrink: 0;
font-size: 26rpx;
margin-left: 28rpx;
}
}
.card-row {
display: flex;
margin-top: 10rpx;
font-size: 28rpx;
.label {
margin-right: 24rpx;
color: #999EA8;
}
.value {
flex: 1;
color: #292D33;
}
}
.card-actions {
display: flex;
gap: 16rpx;
margin-top: 16rpx;
justify-content: flex-end;
.btn {
padding: 8rpx 16rpx;
border-radius: 12rpx;
background: #347BFF;
color: #fff;
font-size: 28rpx;
}
.ghost {
background: #347bff1a;
color: #347BFF;
}
}
}
.list-footer {
color: #999EA8;
padding-bottom: 20rpx;
font-size: 24rpx;
display: flex;
justify-content: center;
}
}
.loading {
pointer-events: none;
}
.fixed-btns {
position: fixed;
right: 20rpx;
bottom: 66rpx;
display: flex;
justify-content: center;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
.btn {
box-sizing: border-box;
padding: 20rpx 18rpx;
display: flex;
flex-flow: column;
align-items: center;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 24rpx;
color: #347BFF;
width: 136rpx;
height: 136rpx;
image {
width: 60rpx;
height: 60rpx;
flex-shrink: 0;
}
}
}
.arrowIcon {
position: fixed;
right: 0;
bottom: 66rpx;
width: 36rpx;
height: 136rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx 0 0 16rpx;
display: flex;
align-items: center;
justify-content: center;
.image {
width: 32rpx;
height: 32rpx;
}
}
.data-board {
margin: 0 20rpx;
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.board-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
.board-title {
font-size: 32rpx;
font-weight: 600;
color: #181A1F;
}
.board-actions {
display: flex;
gap: 16rpx;
.board-action {
display: flex;
align-items: center;
height: 48rpx;
padding: 0 16rpx;
font-size: 28rpx;
border-radius: 4rpx;
opacity: 1;
border: 1rpx solid #e0e0e0;
color: #999EA8;
position: relative;
image {
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
transform: rotate(90deg);
}
&.active {
color: #292D33;
}
}
}
}
.board-grid {
display: flex;
flex-wrap: wrap;
.grid-item {
margin: 16rpx 0;
&.wid-128 {
width: 256rpx;
}
&.wid-67 {
width: 134rpx;
}
.label {
font-size: 24rpx;
color: #757B85;
}
.value {
font-family: "numberBold";
margin-top: 8rpx;
font-size: 40rpx;
font-weight: 700;
color: #292D33;
}
}
}
}
.search-wrap {
padding: 16rpx 24rpx 0;
background: #fff;
margin-top:24rpx;
search-input {
display: block;
width: 100%;
.search-box {
margin: 0 !important;
padding: 0 !important;
border: none !important;
height: auto !important;
}
.search-input {
width: 100% !important;
background: #F7F8FA !important;
.input {
text-align: left !important;
padding-left: 72rpx !important;
box-sizing: border-box !important;
}
.placeholder {
text-align: left !important;
}
.icon {
left: 28rpx !important;
transform: translateY(-50%) !important;
}
}
}
}
.tabbar-anchor {
width: 100%;
min-height: 88rpx;
margin-top: 24rpx;
position: sticky;
top: 0;
z-index: 99;
}
/* 列表卡片 */
.list-section {
padding: 24rpx 20rpx 0;
background: #F7F8FA;
.list-card {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 20rpx;
box-shadow: 0 8rpx 16rpx 0 rgba(0, 0, 0, 0.04);
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8rpx;
.title {
font-size: 32rpx;
font-weight: 600;
color: #292D33;
}
.status-tag {
flex-shrink: 0;
font-size: 26rpx;
margin-left: 28rpx;
}
}
.card-row {
display: flex;
margin-top: 10rpx;
font-size: 28rpx;
.label {
margin-right: 24rpx;
color: #999EA8;
}
.value {
flex: 1;
color: #292D33;
}
}
.card-actions {
display: flex;
gap: 16rpx;
margin-top: 16rpx;
justify-content: flex-end;
.btn {
padding: 8rpx 16rpx;
border-radius: 12rpx;
background: #347BFF;
color: #fff;
font-size: 28rpx;
}
.ghost {
background: #347bff1a;
color: #347BFF;
}
}
}
.list-footer {
color: #999EA8;
padding-bottom: 20rpx;
font-size: 24rpx;
display: flex;
justify-content: center;
}
}
.loading {
pointer-events: none;
}
.fixed-btns {
position: fixed;
right: 20rpx;
bottom: 66rpx;
display: flex;
justify-content: center;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
.btn {
box-sizing: border-box;
padding: 20rpx 18rpx;
display: flex;
flex-flow: column;
align-items: center;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 24rpx;
color: #347BFF;
width: 136rpx;
height: 136rpx;
image {
width: 60rpx;
height: 60rpx;
flex-shrink: 0;
}
}
}
.arrowIcon {
position: fixed;
right: 0;
bottom: 66rpx;
width: 36rpx;
height: 136rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx 0 0 16rpx;
display: flex;
align-items: center;
justify-content: center;
.image {
width: 32rpx;
height: 32rpx;
}
}
}
\ No newline at end of file
......@@ -29,10 +29,6 @@
<view class="value">{{dashboard.signedCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">已绑定</view>
<view class="value">{{dashboard.bindCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">未签约</view>
<view class="value">{{dashboard.notSignedCount}}</view>
</view>
......@@ -40,6 +36,10 @@
</view>
</view>
</view>
<view class="search-wrap">
<search-input value="{{searchKeyword}}" bind:input="onSearchInput" placeholder="搜索" bind:search="onSearchConfirm" />
</view>
<view class="tabbar-anchor" >
<tab-bar tabList="{{ listTabs }}" notInitialLoading="{{true}}" bindclick="tabClick" activeIndex="{{ statusIndex }}" />
</view>
......
......@@ -8,6 +8,9 @@ const __CUR_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth(), 1).get
const __MIN_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth() - 23, 1).getTime()
Component({
options: {
styleIsolation: 'shared'
},
properties: {
navBarHeight: Number,
searchObj: Object,
......@@ -16,6 +19,7 @@ Component({
},
data: {
searchKeyword:'',
IMG_URL,
// 门店数据看板(示例数据)
boardMonthText: `${__NOW__.getMonth() + 1}月`,
......@@ -36,7 +40,7 @@ Component({
hasMore: true,
loading: false,
// 门店状态 TabBar
listTabs: ['全部', '新店', '老店'],
listTabs: ['全部', '新店', '老店','关店'],
statusIndex: 0
},
......@@ -46,6 +50,16 @@ Component({
},
methods: {
onSearchConfirm(e){
let {value} = e.detail
this.setData({
searchKeyword:value
},()=>{
this.resetAndLoad(() => {
this.triggerEvent('needScrollTop', this.data.initialTabTop)
})
})
},
getPageData() {
// 获取数据看板数据
this.getStatic()
......@@ -55,6 +69,7 @@ Component({
getParams() {
let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo, personParams } = this.data
const obj = {
merchantName:this.data.searchKeyword,
isAll: boardScopeActive ? 1 : 0,
year: boardScopeActive ? undefined : new Date(monthPickerValue).getFullYear(),
month: boardScopeActive ? undefined : new Date(monthPickerValue).getMonth() + 1,
......
......@@ -108,7 +108,11 @@
.old {
color: #347BFF;
background: #347bff14;
}
}
.close{
color: #666666;
background: #66666614;
}
.title {
font-size: 32rpx;
font-weight: 600;
......@@ -135,4 +139,40 @@
text-align: center;
color: #757B85;
padding-bottom: 20rpx;
}
.search-wrap {
padding: 16rpx 24rpx 0;
background: #fff;
margin-top:24rpx;
search-input {
display: block;
width: 100%;
.search-box {
margin: 0 !important;
padding: 0 !important;
border: none !important;
height: auto !important;
}
.search-input {
width: 100% !important;
background: #F7F8FA !important;
.input {
text-align: left !important;
padding-left: 72rpx !important;
box-sizing: border-box !important;
}
.placeholder {
text-align: left !important;
}
.icon {
left: 28rpx !important;
transform: translateY(-50%) !important;
}
}
}
}
\ No newline at end of file
<view class="store-layout">
<!-- 数据看板(门店) -->
<view class="data-board">
<view class="board">
<view class="board-header">
<view class="board-title">数据看板</view>
<view class="board-actions">
<view class="board-action {{boardMonthActive ? 'active' : ''}}" bindtap="chooseBoard" data-type="month">
<text>{{boardMonthText}}</text>
<image src="{{IMG_URL}}customer/arrow.png" mode=""/>
</view>
<view class="board-action {{boardScopeActive ? 'active' : ''}}" bindtap="chooseBoard" data-type="scope">
<text>{{boardScopeText}}</text>
</view>
</view>
</view>
<view class="board-grid">
<view class="grid-item wid-128">
<view class="label">门店总数</view>
<view class="value">{{dashboard.storeCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">新店</view>
<view class="value">{{dashboard.newStoreCount}}</view>
</view>
<view class="grid-item wid-67">
<view class="label">老店</view>
<view class="value">{{dashboard.oldStoreCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">未出单</view>
<view class="value">{{dashboard.notSignedCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">已出单</view>
<view class="value">{{dashboard.signedCount}}</view>
</view>
</view>
</view>
</view>
<!-- 数据看板(门店) -->
<view class="data-board">
<view class="board">
<view class="board-header">
<view class="board-title">数据看板</view>
<view class="board-actions">
<view class="board-action {{boardMonthActive ? 'active' : ''}}" bindtap="chooseBoard" data-type="month">
<text>{{boardMonthText}}</text>
<image src="{{IMG_URL}}customer/arrow.png" mode="" />
</view>
<view class="board-action {{boardScopeActive ? 'active' : ''}}" bindtap="chooseBoard" data-type="scope">
<text>{{boardScopeText}}</text>
</view>
</view>
</view>
<view class="board-grid">
<view class="grid-item wid-128">
<view class="label">门店总数</view>
<view class="value">{{dashboard.storeCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">新店</view>
<view class="value">{{dashboard.newStoreCount}}</view>
</view>
<view class="grid-item wid-67">
<view class="label">老店</view>
<view class="value">{{dashboard.oldStoreCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">未出单</view>
<view class="value">{{dashboard.notSignedCount}}</view>
</view>
<view class="grid-item wid-128">
<view class="label">已出单</view>
<view class="value">{{dashboard.signedCount}}</view>
</view>
<view class="grid-item wid-67">
<view class="label">关店</view>
<view class="value">{{dashboard.closedStoreCount}}</view>
</view>
</view>
</view>
</view>
<view class="search-wrap">
<search-input value="{{searchKeyword}}" bind:input="onSearchInput" placeholder="搜索" bind:search="onSearchConfirm" />
</view>
<!-- 列表状态筛选 TabBar(与父页吸顶逻辑保持一致类名) -->
<view class="tabbar-anchor" id="storeListTop">
<tab-bar tabList="{{ listTabs }}" notInitialLoading="{{true}}" bindclick="tabClick" activeIndex="{{ statusIndex }}" />
</view>
<!-- 列表状态筛选 TabBar(与父页吸顶逻辑保持一致类名) -->
<view class="tabbar-anchor" id="storeListTop">
<tab-bar tabList="{{ listTabs }}" notInitialLoading="{{true}}" bindclick="tabClick" activeIndex="{{ statusIndex }}" />
</view>
<!-- 列表(门店) -->
<view class="list-section" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);">
<block wx:if="{{storeList.length}}">
<block wx:for="{{storeList}}" wx:key="index">
<view class="list-card" bindtap="goDetail" data-item="{{item}}">
<view class="card-header">
<view class="status-tag {{item.storeType == 1 ? 'new': item.storeType == 2? 'old':'close'}}">{{ item.storeType == 1 ? '新店':item.storeType == 2?'老店' : '关店' }}</view>
<view class="title">{{item.merchantName || '-'}} </view>
</view>
<view class="card-row">
<view class="label">拜访次数</view>
<view class="value">{{item.visitTimes != null ? item.visitTimes + '次' : '-'}}</view>
</view>
<view class="card-row">
<view class="label">销售人员</view>
<view class="value">{{item.salesUser || '-'}} </view>
</view>
<view class="card-row">
<view class="label">门店地址</view>
<view class="value">{{item.address}}</view>
</view>
<view class="card-row">
<view class="label">签约时间</view>
<view class="value">{{item.signedTime || '-'}} </view>
</view>
<view class="card-row">
<view class="label">展业时间</view>
<view class="value">{{item.expectedOperationDate || '-'}} </view>
</view>
<block wx:if="{{item.status == 3}}">
<view class="card-row">
<view class="label">关店时间</view>
<view class="value">{{item.closeTime || '-'}} </view>
</view>
<view class="card-row">
<view class="label">关店原因</view>
<view class="value">{{item.confirmReason || '-'}} </view>
</view>
</block>
<!-- 列表(门店) -->
<view class="list-section" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);">
<block wx:if="{{storeList.length}}">
<block wx:for="{{storeList}}" wx:key="index">
<view class="list-card" bindtap="goDetail" data-item="{{item}}">
<view class="card-header">
<view class="status-tag {{item.storeType == 1 ? 'new' : 'old'}}">{{ item.storeType == 1 ? '新店' : '老店' }}</view>
<view class="title">{{item.merchantName || '-'}} </view>
</view>
<view class="card-row">
<view class="label">拜访次数</view>
<view class="value">{{item.visitTimes != null ? item.visitTimes + '次' : '-'}}</view>
</view>
<view class="card-row">
<view class="label">销售人员</view>
<view class="value">{{item.salesUser || '-'}} </view>
</view>
<view class="card-row">
<view class="label">门店地址</view>
<view class="value">{{item.address}}</view>
</view>
<view class="card-row">
<view class="label">签约时间</view>
<view class="value">{{item.signedTime || '-'}} </view>
</view>
<view class="card-row">
<view class="label">展业时间</view>
<view class="value">{{item.expectedOperationDate || '-'}} </view>
</view>
</view>
</block>
<view class="list-footer" wx:if="{{loading}}">加载中...</view>
<view class="list-footer" wx:if="{{!hasMore && storeList.length}}">到底了~</view>
</block>
<block wx:else>
<nothing-tips tips="暂无数据" bgColor="{{'#F7F8FA'}}" emptyDataStyle="height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);" />
</block>
</view>
</view>
</block>
<view class="list-footer" wx:if="{{loading}}">加载中...</view>
<view class="list-footer" wx:if="{{!hasMore && storeList.length}}">到底了~</view>
</block>
<block wx:else>
<nothing-tips tips="暂无数据" bgColor="{{'#F7F8FA'}}" emptyDataStyle="height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);" />
</block>
</view>
<!-- 月份选择弹窗(门店) -->
<popup bind:hidePopup="cancel" bind:confirm="popupConfirm" customPopupSlotStyle="{{'height: calc(100% - 210rpx)'}}" show="{{monthPickerShow}}" title="选择月份" height="50%">
<van-datetime-picker
type="year-month"
model:value="{{pendingMonthValue}}"
min-date="{{minMonthDate}}"
max-date="{{maxMonthDate}}"
show-toolbar="{{false}}"
bind:change="onMonthChange"
/>
</popup>
<!-- 月份选择弹窗(门店) -->
<popup bind:hidePopup="cancel" bind:confirm="popupConfirm" customPopupSlotStyle="{{'height: calc(100% - 210rpx)'}}" show="{{monthPickerShow}}" title="选择月份" height="50%">
<van-datetime-picker type="year-month" model:value="{{pendingMonthValue}}" min-date="{{minMonthDate}}" max-date="{{maxMonthDate}}" show-toolbar="{{false}}" bind:change="onMonthChange" />
</popup>
</view>
\ No newline at end of file
......@@ -21,7 +21,7 @@ const h5Obj = {
2测试
3生产
*/
let index = 2
let index =2
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!