Commit cde0e172 by 王志慧
2 parents 1f4074d5 e25ac7b7
// packageOutput/pages/monthReport/monthReport.js
import ActivityApi from '~/api/activityApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
show: false,
date: '2023年4月10日',
navStyle: 'background-color: rgba(0,0,0,0);',
outputValue: [{
label:'发券量(总)/张',
name: 'avgQuotationPrice',
unit:''
},{
label:'升级订单/单',
name: 'avgQuotationPrice',
unit:''
},{
label:'营业额(总)/元',
name: 'avgQuotationPrice',
unit:''
},{
label:'客单价/元',
name: 'avgQuotationPrice',
unit:''
},{
label:'转化率',
name: 'avgQuotationPrice',
unit:''
}],
billboard: [{
sort:1,
name: 11,
value: 625000
},{
sort:2,
name: 11,
value: 625000
},{
sort:3,
name: 11,
value: 625000
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const {time,type} = options
this.setData({timeType:time,type})
},
onDisplay() {
this.setData({ show: true });
},
onClose() {
this.setData({ show: false });
},
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}年${date.getMonth() + 1}}月`;
},
onInput(event) {
this.setData({
currentDate: event.detail,
});
},
confirm(e) {
this.setData({ show: false });
},
onConfirm(event) {
this.setData({
show: false,
date: this.formatDate(event.detail),
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
/**
* 页面的初始数据
*/
data: {
show: false,
date: '2023年4月10日',
navStyle: 'background-color: rgba(0,0,0,0);',
currentDate: new Date().getTime(),
timeValue: new Date().format('yyyy-MM-dd'),
outputView: {
outputValue: [{
label: '报价量',
name: 'quotationCount',
unit: ''
}, {
label: '成交量',
name: 'successCount',
unit: ''
}, {
label: '产值',
name: 'outputValue',
unit: ''
}],
outputValueBoutique: [{
label: '发券量(总)/张',
name: 'sendCouponTotal',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountTotal',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotal',
unit: ''
}, {
label: '客单价/元',
name: 'averagePrice',
unit: ''
}, {
label: '转化率',
name: 'upgradeRatio',
unit: ''
}],
},
billboard: [{
sort: 1,
name: 11,
value: 625000
}, {
sort: 2,
name: 11,
value: 625000
}, {
sort: 3,
name: 11,
value: 625000
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { time, type, merchantId,merchantName } = options
this.setData({ timeType: time, type, merchantId,merchantName })
this.getReport()
},
onDisplay() {
this.setData({ show: true });
},
onClose() {
this.setData({ show: false });
},
//查看报表
getReport() {
const { type, timeType, merchantId,timeValue } = this.data
let apiName
let params;
const dataT = {
1: {
day: () => {
apiName = 'boutiquecouponQueryByDayReport',
params = {
merchantId,
reportDate: timeValue
}
},
month: () => {
apiName = 'boutiquecouponQueryByDayReport',
params = {
merchantId,
reportMonth: timeValue
}
}
},
2: {
day: () => {
apiName = 'merchantsOutputReport',
params = {
merchantIds: [merchantId],
startTime: timeValue + ' 00:00:00',
endTime: timeValue + ' 23:59:59',
}
},
month: () => {
apiName = 'merchantsOutputReport',
params = {
merchantIds: [merchantId],
startTime: timeValue + ' 00:00:00',
endTime: this.getNextMonth(timeValue) + ' 00:00:00',
}
}
}
}
dataT[type][timeType]()
ActivityApi[apiName](params).then(res => {
this.setData({
outputData: res||{},
triggered:false
})
})
},
//获取day后的
getNextMonth(time) {
const arr = time.split('-')
let year = arr[0]; //获取当前日期的年份
let month = +arr[1]; //获取当前日期的月份
let day = arr[2]; //获取当前日期的日
if (month == 13) {
year = parseInt(year) + 1;
month = 1;
}
if (month < 10) {
month = "0" + month;
}
const nextMonth = year + "-" + month +"-" + day;
return nextMonth;
},
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}年${date.getMonth() + 1}}月`;
},
onInput(event) {
console.log(event.detail)
this.setData({
currentDate: event.detail,
});
},
confirm() {
const { currentDate } = this.data
this.setData({
show: false,
timeValue: new Date(currentDate).format('yyyy-MM-dd')
});
this.getReport()
},
cancel() {
this.setData({ show: false });
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
<!--packageOutput/pages/monthReport/monthReport.wxml-->
<wxs src="time.wxs" module="formatTime" />
<view class="container">
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">产值{{timeType=='day'?'日':'月'}}报表</navigation-bar>
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">产值{{timeType=='day'?'日':'月'}}报表</navigation-bar>
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
......@@ -8,19 +9,19 @@
<glsx-image webp src="store-assistant/index_bg.webp"></glsx-image>
</view>
</view>
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" style="{{'height: calc(100% - 22rpx);'}}">
<scroll-view scroll-y class="content" class="content" refresher-triggered="{{triggered}}" refresher-enabled bindrefresherrefresh="getReport" bindscroll="scrollIng" style="{{'height: calc(100% - 22rpx);'}}">
<view class="store-box">
<view class="store-item">
<view class="store-logo">
<glsx-image class="store-logo" webp src="store-assistant-assemble/output/store-icon.png"></glsx-image>
</view>
<view class="store-content">
<view class="store-name">嘀加奥迪4s店</view>
<view class="store-name">{{merchantName}}</view>
<view class="store-desc">欢迎查看{{timeType=='day'?'日':'月'}}报表数据</view>
</view>
</view>
<view class="date-input" bindtap="onDisplay">
<view class="date-value">{{date}}</view>
<view class="date-value">{{formatTime.formatTime(timeValue,timeType=='day'?11:8)}}</view>
<view class="date-icon">
<glsx-image class="date-icon" webp src="store-assistant-assemble/output/date-icon.png"></glsx-image>
</view>
......@@ -31,8 +32,8 @@
当{{timeType=='day'?'日':'月'}}产值
</view>
<view class="output-value">
<view class="output-item" wx:for="{{outputValue}}">
<view class="output-num">444</view>
<view class="output-item" wx:for="{{outputView[type == 2?'outputValue':'outputValueBoutique']}}" wx:key="{{index}}">
<view class="output-num">{{outputData[item.name]||0}}</view>
<view class="output-label">{{item.label}}</view>
</view>
</view>
......@@ -40,7 +41,7 @@
<view class="billboard-box">
<view class="billboard-title">当{{timeType=='day'?'日':'月'}}员工龙虎榜</view>
<view class="billboard-border">
<view class="billboard-item" wx:for="{{billboard}}">
<view class="billboard-item" wx:for="{{billboard}}" wx:key="{{index}}">
<view class="billboard-item-bar">
<view class="bill-border">
<view class="bill-num" style="transform:translate({{index==1?-20:0}}rpx,0rpx)">¥{{item.value}}</view>
......@@ -51,10 +52,10 @@
</view>
</view>
</view>
</scroll-view>
</scroll-view>
</view>
<popup bind:hidePopup="confirm" bind:confirm="confirm" show="{{show}}" height="50vh">
<van-datetime-picker type="{{timeType=='day'?'date':'year-month'}}" bind:input="onInput" />
<popup bind:hidePopup="cancel" bind:confirm="confirm" show="{{show}}" height="50vh">
<van-datetime-picker value="{{ currentDate }}" type="{{timeType=='day'?'date':'year-month'}}" bind:input="onInput" />
</popup>
</view>
\ No newline at end of file
var formatTime = function(time,num = 8){
time = (time+'-').replace('-','年').replace('-','月').replace('-','日')
return time.substring(0,num)
}
module.exports = {
formatTime:formatTime
}
\ No newline at end of file
import ActivityApi from '~/api/activityApi/index'
let thisPage;
Component({
/**
* 组件的属性列表
......@@ -266,8 +267,8 @@ Component({
const {
entranceType
} = this.data
wx.redirectTo({
url: `/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}`,
wx.navigateTo({
url: `/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}&merchantId=${thisPage.data.merchantId}&merchantName=${thisPage.data.merchantName}`,
})
}
},
......
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{'height: calc(100% - 22rpx);'}}">
<scroll-view scroll-y class="content" class="content" refresher-triggered="{{triggered}}" refresher-enabled bindrefresherrefresh="activityRefresh" bindscroll="scrollIng" style="{{'height: calc(100% - 22rpx);'}}">
<view class="output-box">
<view class="output-title">产值总览</view>
<view class="output-value">
......
......@@ -63,7 +63,8 @@ Component({
},
onLoad(options) {
options.type = Number(options.tab)
const {merchantId,merchantName} = options;
this.setData({merchantId,merchantName})
this.getSubscribeConfig(options)
this.addEvent()
},
......@@ -73,11 +74,10 @@ Component({
{ serviceTypeName: '精品升级', serviceType: 1 },
{ serviceTypeName: '售后众筹', serviceType: 0 },
{ serviceTypeName: '会员权益/升级', serviceType: 2 }]
let currentServiceType = 1
this.setData({
tab,
fresh: obj && obj.fresh,
currentServiceType
currentServiceType:obj.type
})
setTimeout(() => {
this.configHttpCount = false
......
page {
background-color: #fff;
background-color: #fff;
}
.layout {
box-sizing: border-box;
position: relative;
// padding: 400rpx 16rpx 0;
padding-top: 400rpx;
font-size: 24rpx;
color: #8A8C90;
&::after {
content: '';
width: 100%;
height: 864rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/bg-top.webp') no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.tabContainer {
height: 100rpx;
}
box-sizing: border-box;
position: relative;
// padding: 400rpx 16rpx 0;
padding-top: 400rpx;
font-size: 24rpx;
color: #8A8C90;
&::after {
content: '';
width: 100%;
height: 750rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/logout-bg.png') no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.tabContainer {
height: 100rpx;
}
}
.logout-panel {
width: 686rpx;
height: 156rpx;
background-image: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
border-radius: 16rpx;
margin: 32rpx auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx;
box-sizing: border-box;
text {
font-size: 32rpx;
color: #282829;
font-weight: 600;
}
width: 686rpx;
height: 156rpx;
background-image: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
border-radius: 16rpx;
margin: 32rpx auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx;
box-sizing: border-box;
text {
font-size: 32rpx;
color: #282829;
font-weight: 600;
}
.logot {
width: 36rpx;
height: 36rpx;
}
}
\ No newline at end of file
......@@ -4,6 +4,6 @@
<view class="logout-panel" bindtap="logout">
<text>退出登录</text>
<view>1</view>
<view class="logot"><glsx-image class="logot" webp src="store-assistant-assemble/login/logout-icon.png"></glsx-image></view>
</view>
</view>
\ No newline at end of file
......@@ -38,8 +38,8 @@ page {
&::after {
content: '';
width: 100%;
height: 864rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/bg-top.webp') no-repeat;
height: 750rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/logout-bg.png') no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
......@@ -83,11 +83,9 @@ page {
color: #282829;
}
.createTime {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8A8C90;
margin-top: 16rpx;
.logot {
width: 16.7rpx;
height: 30.06rpx;
}
}
......
......@@ -10,7 +10,7 @@
<view class="id">{{userInfo.merchantId}}</view>
</view>
<view class="logot" bindtap="jumpLogout">
>
<glsx-image class="logot" webp src="store-assistant-assemble/login/arrow-left.png"></glsx-image>
</view>
</view>
</view>
\ No newline at end of file
......@@ -56,9 +56,10 @@ Component({
*/
methods: {
jumpDetail(e) {
const {item} = e.currentTarget.dataset
wx.switchTab({
url: '/packagesList/outDetail/index'
const {item:{type},info:{merchantId4s,merchantName4s}} = e.currentTarget.dataset
console.log(merchantName4s)
wx.navigateTo({
url: `/packagesList/outDetail/index?merchantId=${merchantId4s}&type=${type}&merchantName=${merchantName4s}`,
})
}
}
......
......@@ -13,7 +13,7 @@
<view class="title">{{info.merchantName || info.merchantName4s || ''}}</view>
</view>
<view class="content">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item" data-item="{{item}}" bindtap="jumpDetail">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item" data-info="{{info}}" data-item="{{item}}" bindtap="jumpDetail">
<view wx:if="{{info[item.name] == '未开通'}}" class="price">{{info[item.name]}}</view>
<view wx:else="" class="price">
{{item.prefix || ''}}
......
......@@ -10,17 +10,20 @@ const clientFormObj = {
label: '精品升级',
name: 'boutiqueUpgrade',
prefix: '¥',
isNum: true
isNum: true,
type: 1
}, {
label: '售后众筹',
name: 'afterSalesCrowdfunding',
prefix: '¥',
isNum: true
isNum: true,
type: 0
}, {
label: '会员权益/升级',
name: 'vdUpgrade',
prefix: '¥',
isNum: true
isNum: true,
type: 2
}],
'SC002': [{
label: '营业额',
......
......@@ -44,6 +44,7 @@ Component({
},
busiObj: {},
busiTotalList: [],
merchantName4s: '',
crowdOrderObj: {}
},
lifetimes: {
......@@ -128,7 +129,7 @@ Component({
let { userInfo } = wx.$storage.get()
let params = {
...sortSearchData,
merchantIds: [userInfo.subLoginUser.merchantId]
merchantIds: [userInfo.subLoginUser.merchantId],
}
outputApi.getBusiStatistics(params).then(res => {
this.resetBusiData()
......@@ -163,9 +164,11 @@ Component({
})
})
this.setData({
merchantName4s: '',
busiObj: res,
totalProfit: res.activityTotal,
busiTotalList: _list
busiTotalList: _list,
busiTotalListFirst: _list
})
})
},
......@@ -181,6 +184,13 @@ Component({
onBindRefresh() {
this.clientRefresh(true)
},
handleBlur(e) {
const merchantName4s = e.detail.value;
const {busiTotalListFirst} = this.data
this.setData({
busiTotalList: busiTotalListFirst.filter(item=>item.merchantName4s.includes(merchantName4s))
})
},
clientRefresh(isPull = false) {
this.getPMerchantInfo()
this.setData({
......
......@@ -9,7 +9,7 @@
<text>总产值</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(totalProfit || 0.00)}}</text>
</view>
<view class="input-box"><input type="text" placeholder="输入门店"/><icon class="icon-small" type="search" size="14"></icon></view>
<view class="input-box"><input value="{{merchantName4s}}" type="text" placeholder="输入门店" bind:blur="handleBlur"/><icon class="icon-small" type="search" size="14"></icon></view>
<view>
<sort-tab id="sortTab" class="{{stickyScrollTop > 74 ? 'sort-fix' : ''}}" style="top: {{stickyScrollTop - 16 + 'px'}}" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!