Commit 9fb68234 by chenwq

汇总

1 parent 1076831d
......@@ -91,5 +91,13 @@ class outputApi {
...data
})
}
/**获取活动最新战报 */
getNewReportUrl(data) {
return api.post({
method: 'scrm.api.assistant.crowd.activity.newest.report',
...data
})
}
}
export default outputApi
......@@ -14,7 +14,7 @@ Component({
properties: {
orderObj: {
type: Object,
value: () => {},
value: () => { },
observer(n) {
n && this.dealStaffList()
}
......@@ -33,37 +33,45 @@ Component({
IMAGES,
isShowTip: true,
orderFormList: [{
label: '总场次',
name: 'totalNum'
},
label: '总场次',
name: 'totalNum'
},
{
label: '总订单',
name: 'totalOrderCount'
},
{
label: '成交金额',
name: 'totalAmount',
prefix: '¥'
}
],
merchantFormList: [
{
label: '总订单',
name: 'totalOrderCount'
label: '预计活动时间',
name: 'time'
},
{
label: '成交金额',
name: 'totalAmount',
prefix: '¥'
}
],
merchantFormList: [{
label: '活动时间',
name: 'time'
label: '实际活动时间',
name: 'realTime'
},
{
label: '订单数',
name: 'orderCount'
name: 'orderCount',
isNumber: true
},
{
label: '产值',
name: 'realAmount',
className: 'red',
prefix: '¥'
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
prefix: '¥'
prefix: '¥',
isNumber: true
}
],
tableHeadList: [
......@@ -94,34 +102,6 @@ Component({
prefix: '¥'
}
]
// tableHeadList: [
// {
// label: 'rankIdx',
// width: '40rpx'
// },
// {
// label: '业务员',
// name: 'shareName'
// },
// {
// label: '转发',
// name: 'shareCount'
// },
// {
// label: '浏览',
// name: 'browseCount'
// },
// {
// label: '成交',
// name: 'dealCount',
// width: '92rpx'
// },
// {
// label: '产值',
// name: 'totalAmount',
// prefix: '¥'
// }
// ]
},
/**
......@@ -186,7 +166,7 @@ Component({
path: obj.path
})
},
fail() {}
fail() { }
})
})
},
......@@ -199,7 +179,7 @@ Component({
item
} = e.currentTarget.dataset,
posterObj = this.selectComponent('#poster'),
{options} = wx.$router.getPageInstance()
{ options } = wx.$router.getPageInstance()
console.log(options)
try {
let flag = await posterObj.check(item)
......@@ -232,6 +212,22 @@ Component({
activityId
})
console.log(res)
},
/**战报 */
handleReport(e) {
const {
item
} = e.currentTarget.dataset
outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => {
console.log(res)
// item.posterUrl = res
// this.setData({
// posterItem: item,
// isShowTip: false
// })
}).catch(() => {
wx.$api.showToast('下载战报失败')
})
}
}
})
\ No newline at end of file
......@@ -116,7 +116,7 @@
}
&-label {
width: 104rpx;
width: 156rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
......
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="crowdfund-layout">
<view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{orderObj[item.name] || 0}}
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
......@@ -29,9 +30,9 @@
wx:for-index="idx"
wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt font-number {{subItem.className}}">
<view class="content-txt {{subItem.isNumber ? 'font-number': ''}} {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{item[subItem.name]}}
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
......@@ -118,7 +119,7 @@
</view>
<!-- 战报 -->
<view class="new-report">
<view class="report-left">
<view class="report-left" bindtap="handleReport" data-item="{{item}}">
<glsx-image class="icon-report" src="output/icon-report.webp"></glsx-image>
生成最新战报
</view>
......
/**设置千分位 */
var setPrice = function (n = 0.0) {
if ((typeof n == 'string' || typeof n == 'number') && !isNaN(n)) {
n = parseFloat(n).toFixed(2)
var r = getRegExp('(d{1,3})(?=(d{3})+(?:.))', 'g')
var p = n.replace(r, ',')
return p
// var r = getRegExp('/./', 'g')
// var p = n.replace(r, 'test')
// return n
} else {
console.log(n, '不是一个数字', !isNaN(n))
}
}
var threeNumForTwo = {
money_three_for_two_thousands: function (num) {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return d + (result + num2)
}
}
/*
* 导出
*/
module.exports = {
setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands //暴露接口调用
}
......@@ -71,7 +71,9 @@ Page({
handleActChange(e) {
var idx = e.currentTarget.dataset.idx
this.setData({
activityActive: idx
activityActive: idx,
// productStatus:0未申请;1申请中;2已开通;3:已结束
isShowData: [2, 3].includes(+this.data.activityList[idx].productStatus)
})
if ([2, 3].includes(this.data.sceneActive)) {
this.getCustomerDetail(false, false)
......@@ -80,7 +82,9 @@ Page({
setCurActivity() {
this.setData({
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + (this.data.sceneActive)]))
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + (this.data.sceneActive)])),
// productStatus:0未申请;1申请中;2已开通;3:已结束
isShowData: [2, 3].includes(+this.data.sceneActivityObj['scene' + (this.data.sceneActive)][this.data.activityActive].productStatus)
})
// activityActive为0时,触发置顶(左)
if (this.data.activityActive == 0) {
......@@ -298,28 +302,32 @@ Page({
curItem.totalNum = curItem.activityList.length
curItem.activityList.forEach(k => {
// 时间
k.time = k.startTime.slice(5).replace(/-/g, '/') + '~' + k.endTime.slice(5).replace(/-/g, '/')
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 = '-'
break
case 3:
k.interDays = parseInt((new Date(nowDateFormat).getTime() - new Date(k.endTime.replace(/-/g, '/')).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = '-'
break
}
k.suggestTxtList = []
k.suggestList = []
if (k.activityStatus == 2) {
k.suggestTxtList.push('距离活动结束剩余' + k.toEndDays + '天')
if (k.visitCount < 200) {
k.suggestTxtList.push('距离活动结束剩余' + k.toEndDays + '天')
k.suggestTxtList.push('低于200个独立访客')
k.suggestList.push('低于200个独立访客,触达车主的数量太少,建议与4S店关键人沟通注册员工的转发执行情况')
}
if (k.shareRate < 0.4) {
......
<!-- packageOutput/pages/summary/summary.wxml -->
<view class="summary">
<view class="layout {{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? 'm-rl-20' : ''}}">
<view class="layout {{ (sceneActive != 1 && isShowData) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'm-rl-20' : ''}}">
<view class="title bg-white">
选产品/活动
<view class="title-open" bindtap="handleJump">
......@@ -26,8 +26,8 @@
</scroll-view>
</view>
<!-- 活动内容 -->
<view class="activity-content {{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? '' : 'p-rl-20'}}">
<view wx:if="{{activityList[activityActive].productStatus == 2 && sceneActive != 1}}">
<view class="activity-content {{ (sceneActive != 1 && isShowData) ? '' : 'p-rl-20'}}">
<view wx:if="{{isShowData && sceneActive != 1}}">
<view class="activity-title title bg-white p-l-20 no-border">
<view>看产值</view>
<view class="select" bindtap="handleSearch">
......
......@@ -9,7 +9,7 @@ Page({
navStyle: 'background-color: rgba(0,0,0,0);',
loginType: 0,
agree: true,
tabIndx: 1,
tabIndx: 0,
tabList: ['我的客户', '我的门店', '我的员工'],
popupShow: false,
subIndex: -1,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!