Commit 70daa92d by chenwq

活动定位

1 parent 5abfcd7e
......@@ -127,6 +127,21 @@ Page({
return list
},
// 定位已开通的场景,默认定位至场景4
findOpenScene() {
let sceneActive = 4
const list = Object.values(this.data.sceneObj)
// 全场景都没开通或场景4开通,则默认定位至场景4
if (list[3] || !list.some(item => item == true)) {
return true
}
// 开通1.1和1.2场景:默认定位至1.1场景,否则定位至已开通的场景
sceneActive = list[1] ? 2 : 3
this.setData({
sceneActive: sceneActive
})
},
getSceneProStatus(sceneCode, isFirst = false) {
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
......@@ -142,7 +157,10 @@ Page({
['sceneActivityObj.scene4']: data[3].productList
})
if (isFirst) {
this.getCustomerDetail(isFirst)
this.findOpenScene()
if (![2, 3].includes(+this.data.sceneActive)) {
this.getCustomerDetail(isFirst)
}
}
if ([2, 3].includes(+this.data.sceneActive)) {
this.getCustomerDetail()
......@@ -268,7 +286,6 @@ Page({
wx.showLoading()
var params = this.dealSearchStatus()
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
// console.log(res, '0000000000')
// console.log(this.data.sceneActivityObj, '++++++')
var actList = this.data.sceneActivityObj['scene' + (isFirst ? 4 : this.data.sceneActive)]
var total = 0
......@@ -285,7 +302,6 @@ Page({
let startTimeFormat = k.startTime.slice(0, 10).replace(/-/g, '/') + ' 00:00:00'
let nowDateFormat = new Date().toLocaleDateString().replace(/-/g, '/') + ' 23:59:59'
// activityStatus 1:未开始 2:进行中 3:已结束
// 0-未开始;1-活动中;2-已结束
switch (k.activityStatus) {
case 1:
k.interDays = parseInt((new Date(startTimeFormat).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!