Commit 034f1721 by 前端

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

上线合并

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