Commit 0b707cb7 by chenwq

看产值,汇总筛选

1 parent 7e07a26b
...@@ -115,5 +115,13 @@ class outputApi { ...@@ -115,5 +115,13 @@ class outputApi {
...data ...data
}) })
} }
/** 根据场景查询产品 */
findProByScene(data) {
return api.post({
method: 'scrm.api.busassistant.activity.productByscene',
...data
})
}
} }
export default outputApi export default outputApi
// pages/tab/output/components/TotalTab/TotalTab.js
import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC002', 'SC004', 'SC001']
import outputApi from '~/api/outputApi/index'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
busiOptSceneCode,
tabActive: 'store',
// tabActive: 'business',
formData: {
busiIdx: 0,
// 全部,精品升级,会员权益
timeIdx: 0,
// 售后众筹
proIdx: 0,
statusIdx: 0
},
// 众筹-筛选
isCrowdPopupShow: false,
crowdFormData: {
proIdx: 0,
statusIdx: 0
},
baseData: {
busiList: [],
proList: [],
timeList: ['全部', '本月', '本日'],
actStatusList: ['全部', '申请中', '活动中', '已结束']
}
},
lifetimes: {
attached() {
this.dealBusiList()
this.getProList('SC004')
}
},
/**
* 组件的方法列表
*/
methods: {
resetAllSearch() {
this.setData({
formData: {
busiIdx: 0,
// 全部,精品升级,会员权益
timeIdx: 0,
// 售后众筹
proIdx: 0,
statusIdx: 0
}
})
},
resetBusiSearch() {
this.setData({
['formData.timeIdx']: 0,
['formData.proIdx']: 0,
['formData.statusIdx']: 0
})
},
getProList(sceneCode) {
var params = {
sceneCode: sceneCode
}
outputApi.findProByScene(params).then(res => {
let list = res[0]?.productList || []
list.unshift({
productCode: '',
productName: '全部'
})
this.setData({
['baseData.proList']: list
})
})
},
dealBusiList() {
let list = [{
name: '全部',
sceneCode: '-1'
}]
scenceList.forEach(item => {
if (busiOptSceneCode.includes(item.sceneCode)) {
list.push({
name: item.name,
sceneCode: item.sceneCode
})
}
})
this.setData({
['baseData.busiList']: list
})
},
handleSet(e) {
let { attr, val } = e.currentTarget.dataset
this.setData({
[attr]: val
})
},
handleClickTab(e) {
let { tabActive, baseData: { busiList } } = this.data
// 切换tab
if (tabActive != 'business') {
this.handleSet(e)
return true
}
// 筛选
wx.showActionSheet({
itemList: busiList.map(item => item.name),
success: res => {
this.setData({
['formData.busiIdx']: res.tapIndex
})
}
})
},
handleTimeChange() {
let { baseData: { timeList } } = this.data
wx.showActionSheet({
itemList: timeList,
success: res => {
this.setData({
['formData.timeIdx']: res.tapIndex
})
}
})
},
// 众筹-筛选
handlePopupConChange(e) {
let { idx, attr } = e.currentTarget.dataset
this.setData({
[`crowdFormData.${attr}`]: idx
})
},
handleCrowdPopup() {
let { formData: { proIdx, statusIdx } } = this.data
this.setData({
['crowdFormData.proIdx']: proIdx,
['crowdFormData.statusIdx']: statusIdx,
isCrowdPopupShow: !this.data.isCrowdPopupShow
})
},
handleCrowdConfirm() {
let { crowdFormData: { proIdx, statusIdx } } = this.data
this.setData({
['formData.proIdx']: proIdx,
['formData.statusIdx']: statusIdx,
isCrowdPopupShow: !this.data.isCrowdPopupShow
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/TotalTab/TotalTab.wxss */
.total-tab {
box-sizing: border-box;
background: #FFFFFF;
display: flex;
justify-content: space-between;
height: 92rpx;
padding: 16rpx;
.flex {
display: flex;
flex-shrink: 0;
}
.tab {
box-sizing: border-box;
height: 60rpx;
background: #F2F3F7;
border-radius: 32rpx;
padding: 13rpx 18rpx;
font-size: 24rpx;
color: #8A8C90;
}
.tab.active {
background: #3666fe1a;
color: #3666FE;
}
.tab:first-child {
margin-right: 16rpx;
}
.icon {
width: 32rpx;
height: 32rpx;
}
.right-box {
display: flex;
box-sizing: border-box;
height: 60rpx;
color: #8A8C90;
padding: 13rpx 0;
}
}
.popup-fix {
bottom: 110rpx !important;
}
.popup {
padding: 32rpx;
.title {
font-weight: 600;
font-size: 28rpx;
color: #000000;
margin-bottom: 16rpx;
}
.content {
display: flex;
flex-wrap: wrap;
}
.popup-tab {
box-sizing: border-box;
height: 60rpx;
background: #F5F3F3;
color: #8A8C90;
border-radius: 32rpx;
padding: 12rpx 20rpx;
margin: 0 16rpx 16rpx 0;
}
.popup-tab.active {
background: #3666fe1a;
color: #3666FE;
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/components/TotalTab/TotalTab.wxml-->
<view class="total-tab">
<view class="flex">
<view class="tab {{tabActive =='store' ? 'active' : ''}}" data-attr="tabActive" data-val="store" bindtap="handleSet">门店经营汇总</view>
<view class="tab {{tabActive =='business' ? 'active' : ''}}" data-attr="tabActive" data-val="business" bindtap="handleClickTab">
业务经营汇总 | {{baseData.busiList[formData.busiIdx || 0].name}}
<glsx-image src="{{tabActive =='business' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
</view>
<view class="right-box" wx:if="{{tabActive =='business'}}">
<view wx:if="{{busiOptSceneCode[formData.busiIdx] == 'SC004'}}" bindtap="handleCrowdPopup">{{baseData.proList[formData.proIdx].productName}}</view>
<view wx:else bindtap="handleTimeChange">{{baseData.timeList[formData.timeIdx]}}</view>
<glsx-image src="output/icon-arrow.png" class="icon" />
</view>
</view>
<!-- 众筹-筛选 -->
<popup show="{{isCrowdPopupShow}}" title="筛选" height="784rpx" bindconfirm="handleCrowdConfirm" bindhidePopup="handleCrowdPopup" custom-class="popup-fix">
<view class="popup">
<view class="title">产品筛选</view>
<view class="content">
<view class="popup-tab {{crowdFormData.proIdx == index ? 'active' : ''}}" wx:for="{{baseData.proList}}" wx:key="index" bindtap="handlePopupConChange" data-attr="proIdx" data-idx="{{index}}">{{item.productName}}</view>
</view>
<view class="title">活动状态</view>
<view class="content">
<view class="popup-tab {{crowdFormData.statusIdx == index ? 'active' : ''}}" wx:for="{{baseData.actStatusList}}" wx:key="index" bindtap="handlePopupConChange" data-attr="statusIdx" data-idx="{{index}}">{{item}}</view>
</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
...@@ -42,6 +42,9 @@ Component({ ...@@ -42,6 +42,9 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
// tab切换
// 门店经营汇总-start
getPMerchantInfo() { getPMerchantInfo() {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
this.setData({ this.setData({
...@@ -149,17 +152,12 @@ Component({ ...@@ -149,17 +152,12 @@ Component({
var params = { var params = {
merchantId: currentItem.merchantId, merchantId: currentItem.merchantId,
merchantName: currentItem.merchantName, merchantName: currentItem.merchantName,
// scene1: currentItem.scene1,
// scene2: currentItem.scene2,
// scene3: currentItem.scene3,
// scene4: currentItem.scene4,
// sceneList: currentItem.sceneList,
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId, pMerchantId: this.data.pMerchantId,
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName, pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper isSuper: this.data.pMerchantInfo.isSuper
} }
wx.$router.go('/packagesList/packageOutput/pages/summary', params) wx.$router.go('/packagesList/packageOutput/pages/summary', params)
} }
// 门店经营汇总-end
} }
}) })
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"scene-box": "../../../../../components/SceneBox/SceneBox" "scene-box": "../../../../../components/SceneBox/SceneBox",
"total-tab": "../TotalTab/TotalTab"
} }
} }
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/client/client.wxml --> <!-- pages/tab/output/components/client/client.wxml -->
<wxs src="../../index.wxs" module="filter" /> <wxs src="../../index.wxs" module="filter" />
<total-tab></total-tab>
<scroll-view class="client" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindscrolltolower="onReachBottom" bindrefresherrefresh="onBindRefresh" lower-threshold='50' scroll-top="{{scrollTop}}"> <scroll-view class="client" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindscrolltolower="onReachBottom" bindrefresherrefresh="onBindRefresh" lower-threshold='50' scroll-top="{{scrollTop}}">
<!-- <view class="test">1234567890</view> -->
<view class="client-box"> <view class="client-box">
<view class="profit-box flex-between"> <view class="profit-box flex-between">
<text>总收益</text> <text>总收益</text>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!