Commit 40ec4276 by chenwq

看产值-全部,指定场景

1 parent 93233a2f
......@@ -15,5 +15,26 @@ class outputValueApi {
...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
// pages/tab/outputValue/components/merchant/merchant.js
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({
/**
* 组件的属性列表
......@@ -35,6 +36,10 @@ Component({
formData: {},
serviceName: '',
totalObj: {},
pageCof: {
startYearMonth: '',
endYearMonth: ''
},
// totalObj: {
// scene1Total: '72536',
// scene0Total: '76400',
......@@ -205,40 +210,69 @@ Component({
// })
// },
merchantRefresh(isReset = false) {
// wx.showLoading()
this.getTotal()
this.getMerchantList(isReset)
},
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) {
let { userInfo } = wx.$storage.get()
console.log(this.data.searchForm, 'searchForm---')
let { searchForm } = this.data
let { searchForm, merchantList } = this.data
this.setData({
serviceName: userInfo.subLoginUser.merchantName
})
this.dealMonth(isReset)
let params = {
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 => {
// if (isReset) {
// this.setData({
// busiScrollTop: 0
// })
// }
// this.setData({
// triggered: false
// })
// // let _list = []
// // _list = res || []
// // this.setData({
// // merchantList: _list
// // })
// })
},
console.log(params)
const paiName = searchForm.sceneType ? 'getQuerySceneList' : 'getAllSceneList'
outputValueApi[paiName](params).then(res => {
console.log(res, 'res---')
this.setData({
merchantList: isReset ? (res || []) : merchantList.push(res || [])
})
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
})
}
}
})
......@@ -9,7 +9,10 @@ Component({
type: Object,
value: () => { },
observer(n) {
n && this.dealCompare()
if(n) {
this.dealYearMonth()
this.dealCompare()
}
}
}
},
......@@ -27,6 +30,9 @@ Component({
* 组件的方法列表
*/
methods: {
dealYearMonth() {
let { merchantDataList } = this.data.curInfo
},
dealCompare() {
let { merchantDataList } = this.data.curInfo
let list = []
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!