Commit d6150e43 by chenwq

联调

1 parent 782741df
...@@ -141,6 +141,22 @@ class outputApi { ...@@ -141,6 +141,22 @@ class outputApi {
}) })
} }
/** 业务经营汇总列表查询-次新车转化-总收益 */
getActivityTotal(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.expanded.gold.activity.total.output.value',
...data
})
}
/** 业务经营汇总列表查询-详情页-次新车转化-总收益 */
getActivityStatistics(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.expanded.gold.activity.statistics',
...data
})
}
// 我的员工 // 我的员工
/** 服务商查询园区店员工产值统计 */ /** 服务商查询园区店员工产值统计 */
getStaffList(data) { getStaffList(data) {
......
...@@ -18,6 +18,10 @@ Component({ ...@@ -18,6 +18,10 @@ Component({
n && this.dealStaffList() n && this.dealStaffList()
} }
}, },
sceneCode: {
type: String,
value: 'SC004'
},
hasReport: { hasReport: {
type: Boolean, type: Boolean,
value: true value: true
...@@ -63,11 +67,13 @@ Component({ ...@@ -63,11 +67,13 @@ Component({
{ {
label: '订单数', label: '订单数',
name: 'orderCount', name: 'orderCount',
SC003Name: 'totalOrderCount',
className: 'font-number' className: 'font-number'
}, },
{ {
label: '产值', label: '产值',
name: 'realAmount', name: 'realAmount',
SC003Name: 'totalOutputValue',
className: 'red font-number', className: 'red font-number',
prefix: '¥', prefix: '¥',
isNumber: true isNumber: true
...@@ -77,7 +83,8 @@ Component({ ...@@ -77,7 +83,8 @@ Component({
name: 'predictAmount', name: 'predictAmount',
className: 'font-number', className: 'font-number',
prefix: '¥', prefix: '¥',
isNumber: true isNumber: true,
isHide: false
} }
], ],
tableHeadList: [ tableHeadList: [
...@@ -110,11 +117,27 @@ Component({ ...@@ -110,11 +117,27 @@ Component({
] ]
}, },
lifetimes: {
attached() {
let { sceneCode, merchantFormList } = this.data
if (sceneCode == 'SC003') {
let idx = merchantFormList.findIndex(item => item.name == 'predictAmount')
this.setData({
[`merchantFormList[${idx}].isHide`]: true
})
}
}
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
dealStaffList() { dealStaffList() {
let { sceneCode } = this.data
if (sceneCode != 'SC004') {
return true
}
var list = this.data.orderObj var list = this.data.orderObj
list && list &&
list.activityList?.forEach(item => { list.activityList?.forEach(item => {
...@@ -300,6 +323,18 @@ Component({ ...@@ -300,6 +323,18 @@ Component({
// crowdPosterItem: posterItem, // crowdPosterItem: posterItem,
// isShowTip: false // isShowTip: false
// }) // })
},
// 活动详情-跳转门店助手
toActivity(e) {
const { item } = e.currentTarget.dataset
wx.navigateToMiniProgram({
appId: 'wxe10067a63c1856ac',
path: 'packageShopmall/packageExpandedGold/pages/activity/index/index?id=' + item.activityId + '&noOperate=true',
envVersion: 'trial',
success(res) {
// 打开成功
}
})
} }
} }
}) })
...@@ -24,11 +24,13 @@ ...@@ -24,11 +24,13 @@
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view> <view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view> </view>
<view class="content"> <view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view> <view class="content-row" wx:if="{{!subItem.isHide}}">
<view class="content-txt {{subItem.className}}"> <view class="content-label">{{subItem.label}}</view>
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text> <view class="content-txt {{subItem.className}}">
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}} <text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[sceneCode == 'SC003' ? (subItem.SC003Name || subItem.name) : subItem.name]) : item[sceneCode == 'SC003' ? (subItem.SC003Name || subItem.name) : subItem.name]}}
</view>
</view> </view>
</view> </view>
<!-- 排名 --> <!-- 排名 -->
...@@ -83,6 +85,7 @@ ...@@ -83,6 +85,7 @@
<view class="new-report" wx:if="{{item.activityStatus != 1 && hasReport}}"> <view class="new-report" wx:if="{{item.activityStatus != 1 && hasReport}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view> <view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view> <view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
<view wx:if="{{sceneCode == 'SC003'}}" class="report-left" bindtap="toActivity" data-item="{{item}}" data-idx="{{index}}">活动详情</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -196,7 +196,7 @@ Page({ ...@@ -196,7 +196,7 @@ Page({
if (idx != -1) { if (idx != -1) {
this.data.sceneInfo.sceneList[idx].flag = item.sceneStatus == 1 this.data.sceneInfo.sceneList[idx].flag = item.sceneStatus == 1
item.sceneIsOpen = item.sceneStatus == 1 item.sceneIsOpen = item.sceneStatus == 1
sceneActivityObj['scene' + idx] = data[index].productList sceneActivityObj['scene' + idx] = item.sceneCode == 'SC003' ? [data[index].productList.find(k => k.productCode == 'PC012')] : data[index].productList
} }
}) })
console.log(sceneActivityObj, 'sceneActivityObj--') console.log(sceneActivityObj, 'sceneActivityObj--')
...@@ -313,17 +313,89 @@ Page({ ...@@ -313,17 +313,89 @@ Page({
}) })
}, },
dealToTime(list, sceneCode = 'SC004') {
list.forEach(k => {
// 特殊处理
if (sceneCode == 'SC003') {
k.totalOutputValue = (k.totalOutputValue / 100).toFixed(2)
}
// 时间
k.time = k.startTime.slice(0, 16).replace(/-/g, '.') + ' - ' + k.endTime.slice(0, 16).replace(/-/g, '.')
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:已结束
switch (k.activityStatus) {
case 1:
k.interDays = parseInt((new Date(startTimeFormat).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = '-'
break
case 2:
let endTimeFormat = k.endTime.slice(0, 10).replace(/-/g, '/') + ' 23:59:59'
k.interDays = parseInt((new Date().getTime() - new Date(startTimeFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.toEndDays = parseInt((new Date(endTimeFormat).getTime() - new Date(nowDateFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = k.realStartTime?.slice(0, 16).replace(/-/g, '.') + ' - ' + '已开始' + k.interDays + '天'
break
case 3:
k.interDays = parseInt((new Date(nowDateFormat).getTime() - new Date(k.endTime.replace(/-/g, '/')).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = (k.realStartTime?.slice(0, 16).replace(/-/g, '.') || '') + ' - ' + (k.realEndTime?.slice(0, 16).replace(/-/g, '.') || '')
break
}
})
return list
},
// 次新车转化-总收益
getActivityTotal(isFirst) {
let params = {
...this.dealSC003SearchStatus(),
serviceMerchantId: this.data.merchantInfo.pMerchantId,
merchantId: this.data.merchantInfo.merchantId,
}
outputApi.getActivityStatistics(params).then(res => {
this.setData({
['scenePriceList[' + this.findSceneIdx('SC003') + '].total']: (res.totalOutputValue / 100).toFixed(2)
})
this.getBusiStatistics(isFirst, res)
})
},
// SC003
getBusiStatistics(isFirst, totalObj) {
let { userInfo } = wx.$storage.get()
let params = {
...this.dealSC003SearchStatus(),
serviceMerchantId: userInfo.subLoginUser.merchantId
}
outputApi.getActivityList(params).then(res => {
let list = this.dealToTime(res?.list || [], 'SC003')
let _obj = {
activityList: list,
totalAmount: (totalObj.totalOutputValue / 100).toFixed(2),
totalNum: totalObj.totalActivityCount,
totalOrderCount: totalObj.totalOrderCount
}
this.setData({
['sceneActivityObj.scene' + this.findSceneIdx('SC003') + '[0].outputData']: _obj
})
if (!isFirst) {
this.setCurActivity()
}
}).finally(function () {
})
},
/** sc002和sc003场景产品数据处理 /** sc002和sc003场景产品数据处理
* 调同一个接口,返回两个场景下面的全部产品的数据 * 调同一个接口,返回两个场景下面的全部产品的数据
*/ */
getCustomerDetail(isFirst = false, isChangeOtherTotal = true) { getCustomerDetail(isFirst = false, isChangeOtherTotal = true) {
var params = this.dealSearchTime() var params = this.dealSearchTime()
outputApi.getCustomerDetail({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => { outputApi.getCustomerDetail({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
var actList = this.data.sceneActivityObj['scene' + (isFirst ? this.findSceneIdx('SC002') : this.findSceneIdx())] // var actList = this.data.sceneActivityObj['scene' + (isFirst ? this.findSceneIdx('SC002') : this.findSceneIdx())]
var actList = this.data.sceneActivityObj['scene' + this.findSceneIdx('SC002')]
var actCodeList = actList.map(item => item.productCode) var actCodeList = actList.map(item => item.productCode)
var curTotal = 0 var curTotal = 0
var otherTotal = 0 // var otherTotal = 0
var otherSceneIdx = isFirst ? this.findSceneIdx('SC002') : this.data.sceneCodeActive == 'SC002' ? this.findSceneIdx('SC003') : this.findSceneIdx('SC002') // var otherSceneIdx = isFirst ? this.findSceneIdx('SC002') : this.data.sceneCodeActive == 'SC002' ? this.findSceneIdx('SC003') : this.findSceneIdx('SC002')
let obj = this.judgeUpgrade() let obj = this.judgeUpgrade()
res.forEach(item => { res.forEach(item => {
var idx = actCodeList.findIndex(i => i == item.productCode) var idx = actCodeList.findIndex(i => i == item.productCode)
...@@ -342,29 +414,51 @@ Page({ ...@@ -342,29 +414,51 @@ Page({
orderTotal: item.orderTotal orderTotal: item.orderTotal
} }
curTotal = curTotal + (+item.orderTotal?.totalSubOrderOrderMoney || 0) curTotal = curTotal + (+item.orderTotal?.totalSubOrderOrderMoney || 0)
} else {
otherTotal = otherTotal + (+item.orderTotal?.totalSubOrderOrderMoney || 0)
} }
// else {
// otherTotal = otherTotal + (+item.orderTotal?.totalSubOrderOrderMoney || 0)
// }
}) })
if (!isFirst) { if (!isFirst) {
this.setData({ this.setData({
['sceneActivityObj.scene' + this.findSceneIdx()]: actList ['sceneActivityObj.scene' + this.findSceneIdx('SC002')]: actList
}) })
} }
// 总金额 // 总金额
this.setData({ this.setData({
['scenePriceList[' + (isFirst ? this.findSceneIdx('SC002') : this.findSceneIdx()) + '].total']: curTotal.toFixed(2) // ['scenePriceList[' + (isFirst ? this.findSceneIdx('SC002') : this.findSceneIdx()) + '].total']: curTotal.toFixed(2)
['scenePriceList[' + this.findSceneIdx('SC002') + '].total']: curTotal.toFixed(2)
}) })
if (isChangeOtherTotal) { // if (isChangeOtherTotal) {
this.setData({ // this.setData({
['scenePriceList[' + (isFirst ? this.findSceneIdx('SC003') : otherSceneIdx) + '].total']: otherTotal.toFixed(2) // ['scenePriceList[' + (isFirst ? this.findSceneIdx('SC003') : otherSceneIdx) + '].total']: otherTotal.toFixed(2)
}) // })
} // }
//sceneActivityObj //sceneActivityObj
this.getActivityTotal(isFirst)
!isFirst && this.setCurActivity() !isFirst && this.setCurActivity()
}) })
}, },
dealSC003SearchStatus() {
var params = {}
switch (this.data.searchForm['scene' + this.data.sceneCodeActive]) {
// 申请中
case 1:
params.activityStatus = '1'
break
// 活动中
case 2:
params.activityStatus = '2'
break
// 已结束
case 3:
params.activityStatus = '3'
break
}
return params
},
dealSearchStatus() { dealSearchStatus() {
var params = {} var params = {}
switch (this.data.searchForm['scene' + this.data.sceneCodeActive]) { switch (this.data.searchForm['scene' + this.data.sceneCodeActive]) {
...@@ -663,7 +757,7 @@ Page({ ...@@ -663,7 +757,7 @@ Page({
this.setData({ this.setData({
merchantInfo: obj, merchantInfo: obj,
}) })
if(obj.fixSceneCode) { if (obj.fixSceneCode) {
this.setData({ this.setData({
sceneCodeActive: obj.fixSceneCode, sceneCodeActive: obj.fixSceneCode,
fixScenceCode: obj.fixSceneCode fixScenceCode: obj.fixSceneCode
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
</view> </view>
</view> </view>
<!-- 产品 --> <!-- 产品 -->
<!-- <view wx:if="{{sceneCodeActive != 'SC003'}}" class="p-rl-20 bg-white"> --> <view wx:if="{{sceneCodeActive != 'SC003'}}" class="p-rl-20 bg-white">
<view class="p-rl-20 bg-white"> <!-- <view class="p-rl-20 bg-white"> -->
<scroll-view scroll-x="{{true}}" enable-flex class="activity-box" scroll-with-animation scroll-left="{{scrollLeft}}"> <scroll-view scroll-x="{{true}}" enable-flex class="activity-box" scroll-with-animation scroll-left="{{scrollLeft}}">
<view class="flex"> <view class="flex">
<view class="activity-item {{ activityActive == index ? 'active' : ''}} {{(item.productStatus == 2 || item.productStatus == 3) ? 'open' : 'no-open'}}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActChange" data-idx="{{index}}"> <view class="activity-item {{ activityActive == index ? 'active' : ''}} {{(item.productStatus == 2 || item.productStatus == 3) ? 'open' : 'no-open'}}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActChange" data-idx="{{index}}">
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<view>看产值</view> <view>看产值</view>
<view wx:if="{{sceneCodeActive != 'SC001'}}" class="select" bindtap="handleSearch"> <view wx:if="{{sceneCodeActive != 'SC001'}}" class="select" bindtap="handleSearch">
<view wx:if="{{(sceneCodeActive == 'SC002') && !isMock.SC002}}" class="select-txt"> <view wx:if="{{(sceneCodeActive == 'SC002') && !isMock.SC002}}" class="select-txt">
<!-- {{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}} --> {{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}}
{{baseData.timeList[searchForm.sceneSC002]}} <!-- {{baseData.timeList[searchForm.sceneSC002]}} -->
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" /> <image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view> </view>
<view wx:if="{{(sceneCodeActive == 'SC004' || sceneCodeActive == 'SC003') && !isMock.SC004}}" class="select-txt"> <view wx:if="{{(sceneCodeActive == 'SC004' || sceneCodeActive == 'SC003') && !isMock.SC004}}" class="select-txt">
...@@ -43,8 +43,9 @@ ...@@ -43,8 +43,9 @@
</view> </view>
</view> </view>
</view> </view>
<output-transform wx:if="{{sceneCodeActive != 'SC004'}}" formData="{{activityList[activityActive].orderTotal}}" hasNavigate="{{sceneCodeActive != 'SC001' && !isMock.SC002}}" sceneCode="{{sceneCodeActive}}" /> <output-transform wx:if="{{sceneCodeActive != 'SC004' && sceneCodeActive != 'SC003'}}" formData="{{activityList[activityActive].orderTotal}}" hasNavigate="{{sceneCodeActive != 'SC001' && !isMock.SC002}}" sceneCode="{{sceneCodeActive}}" />
<output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack" hasReport="{{!isMock.SC004}}" /> <output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack" hasReport="{{!isMock.SC004}}" />
<output-crowdfund wx:if="{{sceneCodeActive == 'SC003'}}" sceneCode="SC003" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack" hasReport="{{!isMock.SC004}}" />
</view> </view>
<view wx:else class="content-empty bg-white"> <view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" /> <image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
......
...@@ -150,6 +150,18 @@ const staffFormObj = { ...@@ -150,6 +150,18 @@ const staffFormObj = {
label: '转化率', label: '转化率',
name: 'convertRate', name: 'convertRate',
suffix: '%' suffix: '%'
}],
'SC003': [{
label: '营业额',
name: 'totalOutputValue',
prefix: '¥',
isNum: true
}, {
label: '订单',
name: 'totalOrderCount'
}, {
label: '访客',
name: 'totalFansCount'
}] }]
} }
......
...@@ -217,6 +217,7 @@ Component({ ...@@ -217,6 +217,7 @@ Component({
dealSearchStatus() { dealSearchStatus() {
let { formData } = this.data let { formData } = this.data
var activityStatuList = [] var activityStatuList = []
let activityStatus = ''
switch (formData.statusIdx) { switch (formData.statusIdx) {
case 0: case 0:
activityStatuList = [1, 2, 3] activityStatuList = [1, 2, 3]
...@@ -224,17 +225,23 @@ Component({ ...@@ -224,17 +225,23 @@ Component({
// 申请中 // 申请中
case 1: case 1:
activityStatuList = [1] activityStatuList = [1]
activityStatus = '1'
break break
// 活动中 // 活动中
case 2: case 2:
activityStatuList = [2] activityStatuList = [2]
activityStatus = '2'
break break
// 已结束 // 已结束
case 3: case 3:
activityStatuList = [3] activityStatuList = [3]
activityStatus = '3'
break break
} }
return activityStatuList return {
activityStatuList,
activityStatus
}
}, },
dealSearchCrowd() { dealSearchCrowd() {
...@@ -248,10 +255,10 @@ Component({ ...@@ -248,10 +255,10 @@ Component({
'PC009': 5 'PC009': 5
} }
if (formData.sceneCode == 'SC003') { if (formData.sceneCode == 'SC003') {
params.activityStatusList = this.dealSearchStatus() params.activityStatus = this.dealSearchStatus().activityStatus
} else if (formData.busiIdx == 2 && formData?.proIdx) { } else if (formData.busiIdx == 2 && formData?.proIdx) {
params.categoryList = [attrToNum[proList[formData?.proIdx].productCode] || '-1'] params.categoryList = [attrToNum[proList[formData?.proIdx].productCode] || '-1']
params.activityStatusList = this.dealSearchStatus() params.activityStatusList = this.dealSearchStatus().activityStatusList
} }
return params return params
}, },
......
...@@ -86,10 +86,13 @@ Component({ ...@@ -86,10 +86,13 @@ Component({
// 升降序 // 升降序
handleSort(e) { handleSort(e) {
let { detail } = e let { detail } = e
let sortTabModule = this.selectComponent("#sortTab") let { formData } = this.data
let sortTabFixModule = this.selectComponent("#sortTabFix") if (!['SC003', 'SC004'].includes(formData.sceneCode)) {
sortTabModule.syncVal(detail) let sortTabModule = this.selectComponent("#sortTab")
sortTabFixModule.syncVal(detail) let sortTabFixModule = this.selectComponent("#sortTabFix")
sortTabModule.syncVal(detail)
sortTabFixModule.syncVal(detail)
}
this.getBusiStatistics(true) this.getBusiStatistics(true)
}, },
...@@ -127,7 +130,7 @@ Component({ ...@@ -127,7 +130,7 @@ Component({
dealToTime(list, sceneCode = 'SC004') { dealToTime(list, sceneCode = 'SC004') {
list.forEach(k => { list.forEach(k => {
// 特殊处理 // 特殊处理
if(sceneCode == 'SC003') { if (sceneCode == 'SC003') {
k.totalOutputValue = (k.totalOutputValue / 100).toFixed(2) k.totalOutputValue = (k.totalOutputValue / 100).toFixed(2)
} }
// 时间 // 时间
...@@ -155,6 +158,22 @@ Component({ ...@@ -155,6 +158,22 @@ Component({
return list return list
}, },
// 次新车转化-总收益
getActivityTotal() {
let { userInfo } = wx.$storage.get()
let totalTabModule = this.selectComponent('#totalTab')
let busiSearchData = totalTabModule ? totalTabModule.dealParams() : {}
let params = {
...busiSearchData,
serviceMerchantId: userInfo.subLoginUser.merchantId
}
outputApi.getActivityTotal(params).then(res => {
this.setData({
['crowdOrderObj.totalAmount']: (res / 100).toFixed(2)
})
})
},
// 众筹数据处理 // 众筹数据处理
dealCrowdObj(data) { dealCrowdObj(data) {
let _obj = { let _obj = {
...@@ -206,11 +225,11 @@ Component({ ...@@ -206,11 +225,11 @@ Component({
this.setData({ this.setData({
triggered: false triggered: false
}) })
console.log(res, 'res----')
if (formData.sceneCode == 'SC004') { if (formData.sceneCode == 'SC004') {
this.dealCrowdObj(res) this.dealCrowdObj(res)
} else if(formData.sceneCode == 'SC003') { } else if (formData.sceneCode == 'SC003') {
let list = this.dealToTime(res?.list || [], 'SC003') let list = this.dealToTime(res?.list || [], 'SC003')
this.getActivityTotal()
this.setData({ this.setData({
['crowdOrderObj.activityList']: list ['crowdOrderObj.activityList']: list
}) })
...@@ -401,7 +420,7 @@ Component({ ...@@ -401,7 +420,7 @@ Component({
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName, pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper isSuper: this.data.pMerchantInfo.isSuper
} }
if(sceneCode == 'SC003') { if (sceneCode == 'SC003') {
params.fixSceneCode = sceneCode params.fixSceneCode = sceneCode
} }
wx.$router.go('/packagesList/packageOutput/pages/summary', params) wx.$router.go('/packagesList/packageOutput/pages/summary', params)
......
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js // packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index'
import { deleteSecond } from '~/utils/format'
const IMAGES = Object.freeze({ const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp` download: `${IMG_URL}/output/download.webp`
}) })
...@@ -90,7 +92,7 @@ Component({ ...@@ -90,7 +92,7 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
let { sceneCode, merchantFormList } = this.data let { sceneCode, merchantFormList } = this.data
if(sceneCode == 'SC003') { if (sceneCode == 'SC003') {
let idx = merchantFormList.findIndex(item => item.name == 'predictAmount') let idx = merchantFormList.findIndex(item => item.name == 'predictAmount')
this.setData({ this.setData({
[`merchantFormList[${idx}].isHide`]: true [`merchantFormList[${idx}].isHide`]: true
...@@ -102,5 +104,78 @@ Component({ ...@@ -102,5 +104,78 @@ Component({
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: {} methods: {
/**战报 */
handleReport(e) {
const { item, idx } = e.currentTarget.dataset
wx.$api.showLoading('战报生成中')
outputApi
.getNewReportUrl({ activityId: item.activityId })
.then(res => {
if (!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
...item,
posterUrl: res.url,
updatedTime: deleteSecond(res.updatedDate),
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem,
isShowTip: false
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
})
.catch(() => {
wx.$api.showToast('下载战报失败')
})
.finally(() => {
wx.$api.hideLoading()
})
},
/**喜报 */
handleXiReport(e) {
const { item } = e.currentTarget.dataset
wx.$api.showLoading('喜报生成中')
outputApi
.getNewGoodUrl({ activityId: item.activityId })
.then(res => {
if (!res.goodUrl) {
wx.$api.showToast('暂无喜报')
return true
}
var posterItem = {
...item,
posterUrl: res.goodUrl,
updatedTime: res.goodReportDate ? deleteSecond(res.goodReportDate) : '',
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem
})
wx.$api.hideLoading()
})
.catch(() => {
wx.$api.showToast('下载喜报失败')
})
.finally(() => {
})
},
// 活动详情-跳转门店助手
toActivity(e) {
const { item } = e.currentTarget.dataset
wx.navigateToMiniProgram({
appId: 'wxe10067a63c1856ac',
path: 'packageShopmall/packageExpandedGold/pages/activity/index/index?id=' + item.activityId + '&noOperate=true',
envVersion: 'trial',
success(res) {
// 打开成功
}
})
},
}
}) })
...@@ -413,22 +413,21 @@ ...@@ -413,22 +413,21 @@
.new-report { .new-report {
display: flex; display: flex;
margin-top: 20rpx; margin-top: 20rpx;
height: 52rpx; height: 54rpx;
line-height: 52rpx; line-height: 54rpx;
font-size: 20rpx; font-size: 20rpx;
color: #5A6066; color: #5A6066;
.report-left { .report-left {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
font-size: 20rpx; font-size: 24rpx;
color: #3666FE; color: #3666FE;
padding: 0 20rpx; padding: 0 20rpx;
height: 100%; height: 100%;
background: rgba(54, 102, 254, 0.06);
border: 2rpx solid rgba(62, 113, 254, 0.70); border: 2rpx solid rgba(62, 113, 254, 0.70);
border-radius: 30rpx; border-radius: 30rpx;
margin-right: 4rpx; margin-right: 32rpx;
.icon-report { .icon-report {
width: 32rpx; width: 32rpx;
......
...@@ -34,6 +34,13 @@ ...@@ -34,6 +34,13 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1 && sceneCode == 'SC003'}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
<view class="report-left" bindtap="toActivity" data-item="{{item}}" data-idx="{{index}}">活动详情</view>
</view>
</view> </view>
</view> </view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
\ No newline at end of file \ No newline at end of file
...@@ -61,9 +61,15 @@ Component({ ...@@ -61,9 +61,15 @@ Component({
let attrToNum = { let attrToNum = {
'': 'totalStat', '': 'totalStat',
'1': 'vdStat', '1': 'vdStat',
'2': 'boutiqueStat' '2': 'boutiqueStat',
'3': 'carTransformStat'
} }
_list = res[attrToNum[staffSearchData.sceneType || '']] || [] _list = res[attrToNum[staffSearchData.sceneType || '']] || []
if(staffSearchData.sceneType == '3') {
_list.forEach(item => {
item.totalOutputValue = (item.totalOutputValue / 100).toFixed(2)
})
}
this.setData({ this.setData({
staffList: _list staffList: _list
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!