Commit 6edf27d7 by 张立顺

Merge branch 'dev_v3.1' of 192.168.3.233:saas_plus/business-assistant into dev_v3.1

2 parents 8b8adcb5 86d5455d
......@@ -91,5 +91,13 @@ class outputApi {
...data
})
}
/**获取活动最新战报 */
getNewReportUrl(data) {
return api.post({
method: 'scrm.api.stoassistant.crowd.activity.newest.report',
...data
})
}
}
export default outputApi
......@@ -5,6 +5,8 @@
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
......
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<view class="flex scene">
<view
class="scene-item {{ (formData['scene' + (index + 1)] && hasOpenIcon) ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}"
wx:for="{{custSceneList}}"
wx:key="index"
bindtap="handleClick"
data-idx="{{index + 1}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image
webp
wx:if="{{formData['scene' + (index + 1)]}}"
class="scene-img"
src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" />
<view wx:else class="no-open-img">
<image
webp
wx:if="{{hasLockIcon}}"
class="lock-img"
src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}" />
<image
webp
wx:else=""
class="scene-img"
src="{{IMGURL}}output/car0{{index + 1}}.png?v={{img_version}}" />
</view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}">
{{item.title}}
</view>
<view>{{item.subTitle}}</view>
<view class="total-price " wx:if="{{scenePriceList.length}}">
¥ {{scenePriceList[index].total}}
</view>
</view>
</view>
<view class="scene-item {{ (formData['scene' + (index + 1)] && hasOpenIcon) ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}" wx:for="{{custSceneList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image webp wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 1}}.png?v={{img_version}}"></image>
<view wx:else class="no-open-img">
<image webp wx:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{index + 1}}.png?v={{img_version}}"></image>
</view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}">
{{item.title}}
</view>
<view>{{item.subTitle}}</view>
<view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{scenePriceList[index].total}}
</view>
</view>
</view>
\ No newline at end of file
......@@ -102,8 +102,8 @@
}
.scene-img {
width: 56rpx;
height: 56rpx;
width: 92rpx;
height: 64rpx;
}
.lock-img {
......
......@@ -267,7 +267,7 @@ Component({
} catch ({
errMsg
}) {
console.error(errMsg)
// console.error(errMsg)
this.reLogin()
}
},
......
......@@ -14,7 +14,7 @@ Component({
properties: {
orderObj: {
type: Object,
value: () => {},
value: () => { },
observer(n) {
n && this.dealStaffList()
}
......@@ -32,38 +32,48 @@ Component({
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
isShowPoster: false,
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',
className: 'font-number'
},
{
label: '产值',
name: 'realAmount',
className: 'red',
prefix: '¥'
className: 'red font-number',
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
prefix: '¥'
className: 'font-number',
prefix: '¥',
isNumber: true
}
],
tableHeadList: [
......@@ -94,34 +104,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 +168,7 @@ Component({
path: obj.path
})
},
fail() {}
fail() { }
})
})
},
......@@ -198,8 +180,8 @@ Component({
const {
item
} = e.currentTarget.dataset,
posterObj = this.selectComponent('#poster'),
{options} = wx.$router.getPageInstance()
posterObj = this.selectComponent('#crowdPoster'),
{ options } = wx.$router.getPageInstance()
console.log(options)
try {
let flag = await posterObj.check(item)
......@@ -214,7 +196,7 @@ Component({
}).then(res => {
item.posterUrl = res
this.setData({
posterItem: item,
crowdPosterItem: item,
isShowTip: false
})
}).catch(() => {
......@@ -231,7 +213,57 @@ Component({
const res = await outputApi.reportPosterTrack({
activityId
})
console.log(res)
},
/**长按战报/喜报 */
async handlePosterTouch(e) {
},
/**战报 */
handleReport(e) {
const {
item,
idx
} = e.currentTarget.dataset
wx.$api.showLoading("战报生成中")
outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => {
// console.log(res)
if(!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
posterUrl: res.url,
date: res.updatedDate
}
this.setData({
posterItem: posterItem,
isShowPoster: true
})
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
if(!item.goodUrl) {
wx.$api.showToast('喜报生成失败')
return true
}
var posterItem = {
posterUrl: item.goodUrl,
date: item.goodReportDate
}
this.setData({
posterItem: posterItem,
isShowPoster: true
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
"usingComponents": {
"poster": "../poster/poster"
}
}
......@@ -116,7 +116,7 @@
}
&-label {
width: 104rpx;
width: 156rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
......@@ -141,8 +141,9 @@
height: 72rpx;
line-height: 72rpx;
text-align: center;
font-size: 20rpx;
font-size: 26rpx;
color: #5A6066;
font-weight: 600;
border-bottom: 1rpx solid rgba(204, 206, 209, 0.50);
// .activity-status {
......@@ -195,6 +196,12 @@
margin-right: 12rpx;
}
.name-disabled {
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
}
&-dept {
color: #8A8C90;
}
......@@ -226,11 +233,15 @@
.rank-price {
text-align: right;
font-size: 26rpx;
color: #F35251;
color: #8A8C90;
height: 64rpx;
line-height: 64rpx;
}
.txt-red {
color: #F35251;
}
// .th,
// .td {
// width: calc((100% - 116rpx) / 4);
......
<!-- 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}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view
class="content-row"
wx:for="{{merchantFormList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt font-number {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view>
<!-- <view class="rank-head">
<view>员工任务排名</view>
<view class="activity-status" wx:if="{{item.activityStatus == 1}}">
距离开始{{item.interDays}}天
</view>
<view class="activity-status" wx:if="{{item.activityStatus == 2}}">
已开始{{item.interDays}}天
</view>
<view class="activity-status" wx:if="{{item.activityStatus == 3 && item.interDays < 8}}">
已结束{{item.interDays}}天
</view>
</view> -->
<!-- <view class="rank-table">
<view class="tr">
<view class="th" style="width: {{subItem.width || ''}};" wx:for="{{tableHeadList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
{{subItem.label}}
</view>
</view>
<view>
<block wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="tr">
<view class="td text-hide" style="width: {{i.width || ''}};" wx:for="{{tableHeadList}}" wx:for-item="i" wx:for-index="j" wx:key="j">
<view wx:if="{{j == 0 && idx < 3}}">
<image class="icon-rank" src="{{IMGURL}}output/rank0{{idx + 1}}.png?v={{img_version}}" />
</view>
<text wx:if="{{i.prefix}}">{{i.prefix}}</text>
{{subItem[i.name]}}
</view>
</view>
</block>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">
查看更多
</view>
</view>
</view> -->
<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>
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view>
<view class="rank-table">
<view wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="rank">
......@@ -80,21 +41,18 @@
<glsx-image class="rank-head" src="output/icon-head.webp"></glsx-image>
<view class="rank-content">
<view class="rank-row">
<text class="rank-row-name">{{subItem.shareName}}</text>
<text class="rank-row-dept">运营部</text>
<text wx:if="{{subItem.totalAmount}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text>
<text wx:else class="name-disabled">{{subItem.shareName}}</text>
<text class="rank-row-dept">{{subItem.departmentName}}</text>
</view>
<view class="rank-row">
<text class="rank-row-txt">访客136人</text>
<text class="rank-row-txt">成交</text>
<text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text>
<text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text>
</view>
</view>
</view>
<view class="rank-price">¥ {{subItem.totalAmount}}</view>
<!-- <view class="td text-hide" style="width: {{i.width || ''}};" wx:for="{{tableHeadList}}" wx:for-item="i" wx:for-index="j" wx:key="j">
<view wx:if="{{j == 0}}">{{idx + 1}}</view>
<text wx:if="{{i.prefix}}">{{i.prefix}}</text>
{{subItem[i.name]}}
</view> -->
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">¥ {{subItem.totalAmount}}</view>
<view wx:else class="rank-price">暂无业绩</view>
</view>
</view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">
......@@ -106,7 +64,6 @@
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">
<!-- <text wx:if="{{item.toEndDays < 8}}">距离活动结束剩余{{item.interDays}}天,</text> -->
{{item.suggestTxt}}推荐以下建议:
</view>
<view class="suggest-block">
......@@ -117,15 +74,15 @@
</view>
</view>
<!-- 战报 -->
<view class="new-report">
<view class="report-left">
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">
<glsx-image class="icon-report" src="output/icon-report.webp"></glsx-image>
生成最新战报
</view>
<view>最新更新:</view>
<view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</view>
</view>
</view>
</view>
</view>
<crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<poster posterItem="{{posterItem}}" id="poster" show="{{isShowPoster}}" bindlongtouch="handlePosterTouch" />
\ No newline at end of file
// packagesList/packageOutput/components/poster/poster.js
Component({
/**
* 组件的属性列表
*/
properties: {
posterItem: {
type: Object,
value: {}
},
show: {
type: Boolean,
value: false
},
scrollImg: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
hide() {
this.setData({
show: false,
poster: ''
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/packageOutput/components/poster/poster.wxss */
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0,0,0,.8);
}
.bg-white {
padding: 32rpx 32rpx 0 32rpx;
background-color: #FFFFFF;
}
.poster {
width: 500rpx;
height: 68%;
// height: 1108rpx;
overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 500rpx;
height: 90rpx;
background: #F7F8FA;
border-radius: 0 0 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #3666FE;
margin-top: -2rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
}
.tips {
margin: 40rpx 80rpx 0;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
.underline{
font-weight: 600;
text-decoration: underline;
}
}
}
\ No newline at end of file
<!--packagesList/packageOutput/components/poster/poster.wxml-->
<block wx:if="{{show}}">
<!-- catchtouchmove="noScroll" -->
<view class="layout">
<view class="bg" bindtap="hide" />
<block wx:if="{{scrollImg}}">
<view class="poster">
<!-- <scroll-view scroll-x="false" scroll-y="true" style="height: 100%"> -->
<image src="{{posterItem.posterUrl}}" mode="widthFix" show-menu-by-longpress />
<!-- </scroll-view> -->
</view>
</block>
<block wx:else>
<image src="{{posterItem.posterUrl}}" class="poster" mode="widthFix" show-menu-by-longpress bindlongpress="longpress" />
</block>
<view class="btn">
<glsx-image src="output/longtap.png" class="icon"></glsx-image>
长按图片转发
</view>
<view class="tips">最近更新时间:{{posterItem.date}} </view>
</view>
</block>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth" /> -->
/**设置千分位 */
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 //暴露接口调用
}
......@@ -65,6 +65,7 @@ page {
flex-wrap: wrap;
.activity-item {
position: relative;
box-sizing: border-box;
width: calc((100% - 40rpx) / 3);
height: 64rpx;
......@@ -74,6 +75,14 @@ page {
font-size: 28rpx;
margin: 0 20rpx 16rpx 0;
border-radius: 4rpx;
.icon-mark {
position: absolute;
top: 0;
right: 0;
width: 60rpx;
height: 60rpx;
}
}
.activity-item:nth-child(3n) {
......
......@@ -17,6 +17,11 @@
<view class="box-title">产品/活动<text class="title-tip">(可多选)</text></view>
<view class="activity-box" wx:if="{{sceneActive != 1}}">
<view wx:for="{{activityList}}" wx:key="index" class="activity-item">
<!-- productStatus:0未申请;1申请中;2已开通;3:已结束 -->
<view wx:if="{{item.openFlag != 0 && item.productStatus == 2}}">
<glsx-image wx:if="{{sceneActive == 4}}" src="output/mark-active.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{sceneActive == 2 || sceneActive == 3}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
</view>
<view wx:if="{{item.openFlag == 0}}" class="text-hide {{ item.checked ? 'active' : '' }}" bindtap="handleActClick" data-idx="{{index}}">{{item.productName}}</view>
<view class="text-hide item-disabled" wx:else>{{item.productName}}</view>
</view>
......
......@@ -71,7 +71,11 @@ 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)
// 删----
// isShowData: true
})
if ([2, 3].includes(this.data.sceneActive)) {
this.getCustomerDetail(false, false)
......@@ -80,7 +84,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) {
......@@ -114,7 +120,7 @@ Page({
},
// 将已开通的活动提前
// productStatus:0未申请;1申请中;2已开通
// productStatus:0未申请;1申请中;2已开通;3:已结束
dealOpenActivity(list) {
list.forEach(item => {
let tempList = []
......@@ -285,41 +291,55 @@ Page({
getActivityRevenue(isFirst = false) {
wx.showLoading()
var params = this.dealSearchStatus()
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
// 删----
// outputApi.getActivityRevenue({ merchantId: 44211227, ...params }).then(res => {
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
// console.log(this.data.sceneActivityObj, '++++++')
var actList = this.data.sceneActivityObj['scene' + (isFirst ? 4 : this.data.sceneActive)]
var total = 0
res.forEach(item => {
total = total + item.totalAmount
})
var activitingIdx = -1
actList.forEach((item, idx) => {
var curItem = res.find(k => k.goodsCategoryCode == item.productCode)
if (curItem) {
curItem.totalNum = curItem.activityList.length
curItem.activityList.forEach(k => {
curItem.shareBtnIdx = -1
let shareFlag = false
curItem.activityList.forEach((k, kIdx) => {
// 分享按钮判断shareStatus:活动分享状态 0:未分享 1:已分享
if (k.activityStatus == 2 && k.shareStatus == 0) {
curItem.shareBtnIdx = shareFlag ? -1 : kIdx
shareFlag = true
}
// 时间
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 = 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
}
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) {
......@@ -333,6 +353,10 @@ Page({
k.suggestTxt = k.suggestTxtList.join(',') + '。'
}
})
// 定位进行中的活动
if (activitingIdx == -1 && curItem.shareBtnIdx != -1) {
activitingIdx = idx
}
actList[idx].outputData = curItem
} else {
actList[idx].outputData = []
......@@ -342,16 +366,75 @@ Page({
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: actList
})
this.setCurActivity()
}
if (this.data.sceneActive == 4 && activitingIdx != -1) {
var params = {
currentTarget: {
dataset: {
idx: activitingIdx
}
}
}
this.handleActChange(params)
}
this.setData({
['scenePriceList[3].total']: total.toFixed(2)
})
!isFirst && this.setCurActivity()
}).finally(() => {
wx.hideLoading()
})
},
// 分享母链
async handleBtnShare(e) {
const idx = this.data.activityList[this.data.activityActive].outputData.shareBtnIdx
const item = this.data.activityList[this.data.activityActive].outputData.activityList[idx]
const posterObj = this.selectComponent('#crowdPoster')
const { options } = wx.$router.getPageInstance()
try {
let flag = await posterObj.check(item)
posterObj.setData({
poster: flag,
show: true
})
} catch (error) {
wx.$api.showLoading('加载中...')
outputApi.getPosterUrl({
id: item.activityId
}).then(res => {
item.posterUrl = res
this.setData({
crowdPosterItem: item,
isShowTip: false
})
}).catch(() => {
wx.$api.showToast('下载海报失败')
})
}
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
let {
activityId
} = e.detail
const res = await outputApi.reportPosterTrack({
activityId
})
// console.log(res)
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
},
// 战报
handleZhanReport(e) {
const { idx, posterItem } = e.detail
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive + '[' + this.data.activityActive + '].outputData.activityList[' + idx + '].reportDate']: posterItem.date
})
this.setCurActivity()
},
/**
* 生命周期函数--监听页面加载
*/
......
<!-- 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">
......@@ -41,15 +41,15 @@
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport"/>
</view>
<view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
</view>
</view>
</view>
<view wx:if="{{sceneActive != 1}}">
<view class="isFullSucreen btn-box" wx:if="{{ activityList[activityActive].productStatus != 2 && !merchantInfo.isSuper}}">
<view wx:if="{{sceneActive != 1 && activityList.length}}">
<view class="isFullSucreen btn-box" wx:if="{{ !isShowData && !merchantInfo.isSuper}}">
<view class="btn">
<view class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
......@@ -60,9 +60,10 @@
<view class="btn-disabled">点击开通</view>
</view>
</view>
<view wx:if="{{sceneActive == 4}}" class="isFullSucreen btn-box shadow">
<view wx:if="{{sceneActive == 4 && activityList.length && isShowData && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare">
<view class="btn">
<view class="btn-share">活动进行中,分享母链海报开展活动</view>
</view>
</view>
</view>
\ No newline at end of file
</view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
\ No newline at end of file
......@@ -103,10 +103,52 @@ Component({
handleJumpIdx() {
wx.$router.go('pages.index')
},
handleShare(e) {
async handleShare(e) {
let { idx } = e.currentTarget.dataset
var currentItem = this.data.list[idx]
console.log('分享----', currentItem)
var item = {
activityId: this.data.list[idx].activityLastUnSharedInfo.id,
activityName: this.data.list[idx].activityLastUnSharedInfo.activityName
}
// const {
// item
// } = e.currentTarget.dataset,
console.log(item)
const posterObj = this.selectComponent('#poster')
const {options} = wx.$router.getPageInstance()
console.log(options)
try {
let flag = await posterObj.check(item)
posterObj.setData({
poster: flag,
show: true
})
} catch (error) {
wx.$api.showLoading('加载中...')
outputApi.getPosterUrl({
id: item.activityId
}).then(res => {
item.posterUrl = res
this.setData({
posterItem: item,
isShowTip: false
})
}).catch(() => {
wx.$api.showToast('下载海报失败')
})
}
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
this.onBindRefresh()
let {
activityId
} = e.detail
const res = await outputApi.reportPosterTrack({
activityId
})
console.log(res)
},
handleJump(e) {
let { idx } = e.currentTarget.dataset
......
......@@ -7,7 +7,7 @@
<text class="price-txt">¥{{totalProfit}}</text>
</view>
<view wx:for="{{list}}" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view class="box share">
<view class="box {{item.activityLastUnSharedInfo ? 'share' : ''}}">
<view class="head flex-between">
<view class="name ">{{item.merchantName}}</view>
<view class="price-txt ">¥{{item.totalMoney}}</view>
......@@ -42,8 +42,8 @@
</view>
</view>
<!-- 分享海报 -->
<view class="box-share">
<view>360全景影像众筹活动正在进行,分享母链海报开展业务</view>
<view wx:if="{{item.activityLastUnSharedInfo}}" class="box-share">
<view>{{item.activityLastUnSharedInfo.activityName}}正在进行,分享母链海报开展业务</view>
<view class="btn-share" catchtap="handleShare" data-idx="{{index}}">去分享</view>
</view>
</view>
......@@ -51,4 +51,5 @@
到底啦!
</view>
</view>
</scroll-view>
\ No newline at end of file
</scroll-view>
<crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" />
......@@ -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!