Commit 40ec4276 by chenwq

看产值-全部,指定场景

1 parent 93233a2f
...@@ -15,5 +15,26 @@ class outputValueApi { ...@@ -15,5 +15,26 @@ class outputValueApi {
...data ...data
}) })
} }
/** 获取服务商(生意助手看产值)全场景我的门店数据 */
getAllSceneList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchantTotal.allSceneShopList',
...data
})
}
/** 获取服务商(生意助手看产值)我的门店页总累计产值 */
getMerchantTotal(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchantTotal.getMerchantTotal',
...data
})
}
/** 获取服务商(生意助手看产值)指定场景我的门店数据 */
getQuerySceneList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchantTotal.querySceneShopList',
...data
})
}
} }
export default outputValueApi export default outputValueApi
// pages/tab/outputValue/components/merchant/merchant.js // pages/tab/outputValue/components/merchant/merchant.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index' // import outputApi from '~/api/outputApi/index'
import outputValueApi from '~/api/outputValueApi/index'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -35,6 +36,10 @@ Component({ ...@@ -35,6 +36,10 @@ Component({
formData: {}, formData: {},
serviceName: '', serviceName: '',
totalObj: {}, totalObj: {},
pageCof: {
startYearMonth: '',
endYearMonth: ''
},
// totalObj: { // totalObj: {
// scene1Total: '72536', // scene1Total: '72536',
// scene0Total: '76400', // scene0Total: '76400',
...@@ -205,40 +210,69 @@ Component({ ...@@ -205,40 +210,69 @@ Component({
// }) // })
// }, // },
merchantRefresh(isReset = false) { merchantRefresh(isReset = false) {
// wx.showLoading()
this.getTotal() this.getTotal()
this.getMerchantList(isReset) this.getMerchantList(isReset)
}, },
getTotal() { getTotal() {
let { searchForm } = this.data
let params = {
merchantId: searchForm.shopMerchantIds.length ? searchForm.shopMerchantIds[0] : ''
}
outputValueApi.getMerchantTotal(params).then(res => {
this.setData({
totalObj: res || {}
})
})
},
// month作为分页参数
dealMonth(isReset = false, monthInterval = 2) {
let { startTime, endTime } = this.data.searchForm
let { startYearMonth, endYearMonth } = this.data.pageCof
// 起始为空
if (!startTime && !endTime) {
// 获取当前日期
var _currentDate = new Date()
// 获取前n个月的日期
var _endMonthDate = new Date()
_endMonthDate.setMonth(_currentDate.getMonth() - monthInterval)
var _startMonthDate = new Date()
_startMonthDate.setMonth(isReset ? _currentDate.getMonth() - monthInterval : _endMonthDate.getMonth() - monthInterval)
endYearMonth = isReset ? _currentDate.format('yyyy-MM') : _endMonthDate.format('yyyy-MM')
startYearMonth = _startMonthDate.format('yyyy-MM')
}
this.setData({
['pageCof.startYearMonth']: startYearMonth,
['pageCof.endYearMonth']: endYearMonth
})
}, },
getMerchantList(isReset = false) { getMerchantList(isReset = false) {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
console.log(this.data.searchForm, 'searchForm---') let { searchForm, merchantList } = this.data
let { searchForm } = this.data
this.setData({ this.setData({
serviceName: userInfo.subLoginUser.merchantName serviceName: userInfo.subLoginUser.merchantName
}) })
this.dealMonth(isReset)
let params = { let params = {
partnerMerchantId: userInfo.subLoginUser.merchantId, partnerMerchantId: userInfo.subLoginUser.merchantId,
merchantId: searchForm.shopMerchantIds.length ? searchForm.shopMerchantIds[0] : '' merchantId: searchForm.shopMerchantIds.length ? searchForm.shopMerchantIds[0] : '',
sceneType: searchForm.sceneType,
...this.data.pageCof
} }
// outputApi.getStaffList(params).then(res => { console.log(params)
// if (isReset) { const paiName = searchForm.sceneType ? 'getQuerySceneList' : 'getAllSceneList'
// this.setData({ outputValueApi[paiName](params).then(res => {
// busiScrollTop: 0 console.log(res, 'res---')
// }) this.setData({
// } merchantList: isReset ? (res || []) : merchantList.push(res || [])
// this.setData({ })
// triggered: false if (isReset) {
// }) this.setData({
// // let _list = [] busiScrollTop: 0
// // _list = res || [] })
// // this.setData({ }
// // merchantList: _list })
// // }) }
// })
},
} }
}) })
...@@ -9,7 +9,10 @@ Component({ ...@@ -9,7 +9,10 @@ Component({
type: Object, type: Object,
value: () => { }, value: () => { },
observer(n) { observer(n) {
n && this.dealCompare() if(n) {
this.dealYearMonth()
this.dealCompare()
}
} }
} }
}, },
...@@ -27,6 +30,9 @@ Component({ ...@@ -27,6 +30,9 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
dealYearMonth() {
let { merchantDataList } = this.data.curInfo
},
dealCompare() { dealCompare() {
let { merchantDataList } = this.data.curInfo let { merchantDataList } = this.data.curInfo
let list = [] let list = []
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!