Commit 034f1721 by 前端

Merge branch 'SAAS+V4.36.0' into 'master'

上线合并

See merge request !11
2 parents e2d5a6dd d7bcbfa1
......@@ -31,11 +31,10 @@
}
.searchTime {
margin-top: 24rpx;
padding: 24rpx 0rpx;
display: flex;
align-items: center;
z-index: 9999;
margin-bottom: 20rpx;
position: relative;
.time {
......@@ -43,7 +42,7 @@
// border: 2rpx solid #EBEBEB;
// border-radius: 32rpx;
background: #FFFFFF;
border: 1rpx solid #C3C3C3;
border: 2rpx solid #C3C3C3;
border-radius: 6rpx;
font-weight: 400;
font-size: 20rpx;
......@@ -57,7 +56,7 @@
// color: #4466F0;
color: #fff;
background: #3582EE;
border: 1prx solid #3582EE;
border: 2rpx solid #3582EE;
}
.time+.time {
......
......@@ -91,7 +91,7 @@
<view wx:if="{{calendarLoading}}">
<van-calendar
max-range="{{ 30 }}"
max-range="{{ 31 }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
show="{{ isShow }}"
......
......@@ -6,6 +6,22 @@ Page({
* 页面的初始数据
*/
data: {
typeShow: true,
selectTxt: '产值',
selectValue: 1,
dataType: [{
label: '产值',
value: 1
}, {
label: '成交量',
value: 2
}, {
label: '报价量',
value: 3
}, {
label: '转化率',
value: 4
}],
show: false,
date: '2023年4月10日',
maxDate: new Date().getTime(),
......@@ -17,48 +33,48 @@ Page({
label: '报价量(单)',
name: 'quotationCount',
unit: '',
iconUrl:'store-assistant-assemble/output/icon02.png'
iconUrl: 'store-assistant-assemble/output/icon02.png'
}, {
label: '成交量(单)',
name: 'successCount',
unit: '',
iconUrl:'store-assistant-assemble/output/icon07.png'
iconUrl: 'store-assistant-assemble/output/icon07.png'
}, {
label: '产值(元)',
name: 'outputValue',
_unit: '¥',
iconUrl:'store-assistant-assemble/output/icon05.png'
iconUrl: 'store-assistant-assemble/output/icon05.png'
}],
outputValueBoutique: [
// {
// label: '发券量(总)/张',
// name: 'sendCouponTotal',
// unit: ''
// },
// {
// label: '营业额(总)/元',
// name: 'orderMoneyTotal',
// _unit: '¥'
// },
{
label: '升级订单(单)',
name: 'upgradeCountTotal',
unit: '',
iconUrl:'store-assistant-assemble/output/icon02.png'
},
{
label: '转化率',
name: 'upgradeRatio',
unit_: '%',
iconUrl:'store-assistant-assemble/output/icon07.png'
},
{
label: '客单价(元)',
name: 'averagePrice',
_unit: '¥',
iconUrl:'store-assistant-assemble/output/icon05.png'
},
],
// {
// label: '发券量(总)/张',
// name: 'sendCouponTotal',
// unit: ''
// },
// {
// label: '营业额(总)/元',
// name: 'orderMoneyTotal',
// _unit: '¥'
// },
{
label: '升级订单(单)',
name: 'upgradeCountTotal',
unit: '',
iconUrl: 'store-assistant-assemble/output/icon02.png'
},
{
label: '转化率',
name: 'upgradeRatio',
unit_: '%',
iconUrl: 'store-assistant-assemble/output/icon07.png'
},
{
label: '客单价(元)',
name: 'averagePrice',
_unit: '¥',
iconUrl: 'store-assistant-assemble/output/icon05.png'
},
],
}
},
......@@ -66,11 +82,28 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { time, type, merchantId,merchantName } = options
this.setData({ timeType: time, type, merchantId,merchantName })
const { time, type, merchantId, merchantName } = options
this.setData({ timeType: time, type, merchantId, merchantName })
this.getReport()
},
//选择排序
selectType(e) {
const {
value,
label
} = e.target.dataset
this.setData({
selectValue: value,
typeShow: true,
selectTxt: label
})
this.getReport()
},
showUp() {
this.setData({
typeShow: false
})
},
onDisplay() {
this.setData({ show: true });
},
......@@ -79,8 +112,8 @@ Page({
},
//查看报表
getReport() {
const { type, timeType, merchantId,timeValue } = this.data
let apiName,params
const { type, timeType, merchantId, timeValue, selectValue } = this.data
let apiName, params
const dataT = {
1: {
day: () => {
......@@ -94,7 +127,7 @@ Page({
apiName = 'boutiquecouponQueryByMonthReport',
params = {
merchantId,
reportMonth: timeValue.substring(0,7)
reportMonth: timeValue.substring(0, 7)
}
}
},
......@@ -110,28 +143,40 @@ Page({
month: () => {
apiName = 'merchantsOutputReport',
params = {
orderBy: selectValue,
merchantIds: [merchantId],
startTime: new Date(timeValue).format('yyyy-MM')+'-01' + ' 00:00:00',
endTime: new Date(this.getNextMonth(timeValue)).format('yyyy-MM')+'-01' + ' 00:00:00',
startTime: new Date(timeValue).format('yyyy-MM') + '-01' + ' 00:00:00',
endTime: new Date(this.getNextMonth(timeValue)).format('yyyy-MM') + '-01' + ' 00:00:00',
}
}
}
}
let orderValue = {
1: {
unit: '¥',
value: 'outputValue',mult:1
}, 2: {
unit: '',
value: 'successCount',mult:1
}, 3: { unit: '', value: 'quotationCount',mult:1 }, 4: { sign: '%', value: 'conversionRate',mult:100 }
}
dataT[type][timeType]()
ActivityApi[apiName](params).then(res => {
const list = res.employeeOutputList || res.staffList
const arr = []
const staffList = list.length?Object.assign(arr,list.splice(0,3)):arr
const billboard = staffList.map((item,idx)=>{
const staffList = list.length ? Object.assign(arr, list.splice(0, 3)) : arr
const billboard = staffList.map((item, idx) => {
return {
sort: idx+1,
value:item.outputValue || item.orderMoneyTotal || 0,
name: item.transferName||item.employeeName
sort: idx + 1,
unit: (type == 2 && timeType == 'month')?orderValue[selectValue].unit:'¥',
sign: (type == 2 && timeType == 'month')?orderValue[selectValue].sign:'',
value: (type == 2 && timeType == 'month') ? item[orderValue[selectValue].value]*orderValue[selectValue].mult : (item.outputValue || item.orderMoneyTotal || 0),
name: item.transferName || item.employeeName
}
})
this.setData({
outputData: res||{},
triggered:false,
outputData: res || {},
triggered: false,
billboard
})
})
......@@ -149,7 +194,7 @@ Page({
if (month < 10) {
month = "0" + month;
}
const nextMonth = year + "-" + month +"-" + day;
const nextMonth = year + "-" + month + "-" + day;
return nextMonth;
},
formatDate(date) {
......
......@@ -248,11 +248,52 @@
line-height: 48rpx;
margin-bottom: 22rpx;
display: flex;
justify-content: space-between;
}
.select-up {
font-weight: 400;
font-size: 24rpx;
color: #666666;
position: relative;
.unit {
margin-left: auto;
font-size: 22rpx;
color: #5A6066;
text-align: center;
.staff-type {
width: 160rpx;
text {
display: inline-block;
width: 120rpx;
text-align: right;
}
.up-icon {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
}
}
.up-box {
position: absolute;
width: 128rpx;
left: 20rpx;
background: #FFFFFF;
box-shadow: 0 0 18rpx 0 #3a596a1c;
border-radius: 8rpx;
z-index: 100;
.up-item {
flex: auto;
font-weight: 400;
font-size: 22rpx;
color: #666666;
line-height: 53rpx;
&.checked {
color: #708CFF;
}
}
}
}
}
......
......@@ -58,7 +58,17 @@
<view class="billboard-box">
<view class="billboard-title">
<text>当{{timeType=='day'?'日':'月'}}员工龙虎榜</text>
<text class="unit">累计产值(元)</text>
<view class="select-up" wx:if="{{type == 2 && timeType!='day'}}">
<view catchtap="showUp" class="staff-type">
<text>{{dataType[selectValue-1].label}}</text>
<glsx-image webp custom-class="up-icon" src="store-assistant-assemble/output/down.png"></glsx-image>
</view>
<view class="up-box" hidden="{{typeShow}}">
<view class="up-item {{selectValue == item.value? 'checked':''}}" wx:for="{{dataType}}" wx:key="index" data-label="{{item.label}}" data-value="{{item.value}}" catchtap="selectType">
{{item.label}}
</view>
</view>
</view>
</view>
<view class="billboard-border">
<block wx:if="{{billboard.length}}">
......@@ -66,7 +76,7 @@
<view class="billboard-item-bar">
<view class="bill-border">
<view class="bill-name">{{item.name}}</view>
<view class="bill-num" wx:if="{{item.name}}"><text class="unit">¥</text>{{item.value}}</view>
<view class="bill-num" wx:if="{{item.name}}"><text class="unit" wx:if="{{item.unit}}">{{item.unit}}</text>{{item.value}}<text class="unit" wx:if="{{item.sign}}">{{item.sign}}</text></view>
</view>
<glsx-image webp custom-class="bill-bg" src="store-assistant-assemble/output/bill0{{item.sort}}.png"></glsx-image>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!