Commit 4dec32fd by 李伟康

Merge branch 'develop' of http://192.168.3.233:8090/saas_plus/business-assistant into develop

2 parents 05b82133 a68e9aa7
......@@ -56,5 +56,33 @@ class outputApi {
}
)
}
/**查询场景和产品的开通状态 */
getSceneProStatus(data) {
return api.post(
{
method: 'scrm.api.busassistant.activity.findSceneProductStatus',
...data
}
)
}
/** 申请开通活动*/
applyActivity(data) {
return api.post(
{
method: 'scrm.api.busassistant.activity.apply',
...data
}
)
}
/** 查询门店众筹活动产值 */
getActivityRevenue(data) {
return api.post(
{
method: 'scrm.api.busassistant.merchant.activity.Revenue',
...data
}
)
}
}
export default outputApi
......@@ -23,95 +23,21 @@ Page({
scene1: [],
scene2: [],
scene3: [],
scene4: [],
// scene1: [{
// productName: '360实景导航',
// price: 10
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }, {
// productName: 'AR实景导航',
// price: 20
// }],
// scene2: [{
// productName: '座椅通风',
// price: 30
// }, {
// productName: '座椅通风',
// price: 40
// }],
// scene3: [{
// productName: '氛围灯',
// price: 50
// }, {
// productName: '氛围灯',
// price: 60
// }],
// scene4: [{
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80
// }, {
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80
// }, {
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80
// }, {
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80
// }]
scene4: []
}
},
getNoOpenPro(sceneCode) {
getSceneProStatus(sceneCode) {
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
merchant4sId: this.data.merchantInfo.merchantId,
sceneCode: sceneCode
}
outputApi.getNoOpenPro(params).then(res => {
outputApi.getSceneProStatus(params).then(res => {
var proList = res.find(item => item.sceneCode == sceneCode)
console.log(proList, '??????')
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: res
['sceneActivityObj.scene' + this.data.sceneActive]: proList.productList.filter(item => !item.openFlag)
})
this.setCurActivity()
})
......@@ -124,7 +50,7 @@ Page({
sceneActive: idx
})
if (!this.data.sceneActivityObj['scene' + this.data.sceneActive].length) {
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
return true
}
this.setCurActivity()
......@@ -145,19 +71,36 @@ Page({
})
},
handleJump() {
clearTimeout(this.data.time)
this.data.time = new setTimeout(() => {
wx.$router.go('pages.output')
}, 3000)
},
handleConfirm() {
var params = {
sceneActive: this.data.sceneActive,
activityIdxList: this.data.activityList.filter(item => item.checked == true)
serviceMerchantId: this.data.merchantInfo.pMerchantId,
serviceMerchantName: this.data.merchantInfo.pMerchantName,
merchantId: this.data.merchantInfo.merchantId,
merchantName: this.data.merchantInfo.merchantName,
sceneCode: this.data.sceneCodeList[this.data.sceneActive - 1],
productCodes: this.data.activityList.filter(item => item.checked == true).map(item => item.productCode)
}
if (!params.activityIdxList.length) {
if (!params.productCodes.length) {
wx.$api.showToast('请选产品/活动')
return true
}
console.log(params)
wx.showToast({
title: '提交成功',
icon: 'success'
outputApi.applyActivity(params).then(res => {
wx.showToast({
title: '提交成功',
icon: 'success',
duration: 3000,
mask: true,
success: () => {
this.handleJump()
}
})
})
},
......@@ -166,14 +109,12 @@ Page({
*/
onLoad(options) {
wx.$router.getData(obj => {
console.log(obj)
this.setData({
merchantInfo: obj,
merchantInfo: obj.merchantInfo,
sceneActive: obj.sceneActive,
sceneCodeList: obj.sceneCodeList
})
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
})
},
......
......@@ -4,10 +4,10 @@ Component({
* 组件的属性列表
*/
properties: {
// orderObj: {
// type: Object,
// value: () => { }
// },
orderObj: {
type: Object,
value: () => { }
},
},
/**
......@@ -16,13 +16,13 @@ Component({
data: {
orderFormList: [{
label: '总场次',
name: 'zongcc'
name: 'totalNum'
}, {
label: '总订单',
name: 'orderNum'
name: 'totalAmount'
}, {
label: '成交金额',
name: 'price',
name: 'totalOrderCount',
prefix: '¥'
}],
merchantFormList: [{
......@@ -30,15 +30,15 @@ Component({
name: 'time'
}, {
label: '订单数',
name: 'orderNum'
name: 'orderCount'
}, {
label: '产值',
name: 'orderPrice',
name: 'realAmount',
className: 'red',
prefix: '¥'
}, {
label: '预估产值',
name: 'ygcz',
name: 'predictAmount',
prefix: '¥'
}],
tableHeadList: [{
......@@ -47,67 +47,28 @@ Component({
width: '24rpx'
}, {
label: '业务员',
name: 'ywy',
name: 'shareName',
}, {
label: '转发',
name: 'zf',
name: 'shareCount',
}, {
label: '浏览',
name: 'll'
name: 'browseCount'
}, {
label: '成交',
name: 'cj',
name: 'dealCount',
width: '92rpx'
}, {
label: '产值',
name: 'cz',
name: 'totalAmount',
prefix: '¥'
}],
// 数据--
orderObj: {
zongcc: 28,
orderNum: 198,
price: 12000
},
merchantDataList: [{
name: '嘀加鹏辉奥迪4S店(深圳)',
time: '09/28 11:19~09/30 12:39',
orderNum: '100',
orderPrice: '1280.00',
ygcz: '2280.00',
}]
},
rankList: [{
ywy: '隋瑗',
zf: '4897',
ll: '927',
cj: '166',
cz: '9991280.00'
}, {
ywy: '隋瑗',
zf: '4897',
ll: '927',
cj: '166',
cz: '9991280.00'
}, {
ywy: '隋瑗',
zf: '4897',
ll: '927',
cj: '166',
cz: '9991280.00'
}, {
ywy: '隋瑗',
zf: '4897',
ll: '927',
cj: '166',
cz: '9991280.00'
}, {
ywy: '隋瑗',
zf: '4897',
ll: '927',
cj: '166',
cz: '9991280.00'
}]
}],
lifetimes: {
attached() {
console.log(this.data.orderObj, '///////////')
},
},
/**
......
......@@ -9,9 +9,9 @@
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{merchantDataList}}" wx:key="index">
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<view class="text-hide head-title">{{item.name}}</view>
<view class="text-hide head-title">{{item.activityName}}</view>
<view class="head-link" bindtap="handleCopy">复制活动链接</view>
</view>
<view class="content">
......@@ -26,14 +26,16 @@
<view class="content-rank">
<view class="rank-head">
<view>员工转发数据排名</view>
<view class="activity-status">已开始3天</view>
<view class="activity-status" wx:if="{{item.actStatus == 0}}">距离开始{{item.interDays}}天</view>
<view class="activity-status" wx:if="{{item.actStatus == 1}}">已开始{{item.interDays}}天</view>
<view class="activity-status" wx:if="{{item.actStatus == 2 && 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 wx:if="{{item.rankList.length}}">
<block wx:for="{{item.rankList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view wx:if="{{item.staffList.length}}">
<block wx:for="{{item.staffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="tr">
<view class="td" style="width: {{i.width || ''}};" wx:for="{{tableHeadList}}" wx:for-item="i" wx:for-index="j" wx:key="j">
<text wx:if="{{i.prefix}}">{{i.prefix}}</text>
......@@ -48,18 +50,21 @@
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest">
<view class="content-suggest" wx:if="{{item.actStatus == 1 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">距离活动结束剩余8天,分享员工占比低于40%,点击转化率低于5%;推荐以下建议:</view>
<view class="suggest-txt">
<!-- <text wx:if="{{item.toEndDays < 8}}">距离活动结束剩余{{item.interDays}}天,</text> -->
{{item.suggestTxt}}
</view>
<view class="suggest-block">
<view class="suggest-step">
<view class="step-label">建议1</view>
<view class="step-txt">与4S店关键人沟通下注册员工的转发执行情况。</view>
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
<view class="suggest-step">
<!-- <view class="suggest-step">
<view class="step-label">建议2</view>
<view class="step-txt">触达车主人数太少,建议与4S店关键人沟通注册员工的转发执行情况。</view>
</view>
</view> -->
</view>
</view>
</view>
......
......@@ -13,9 +13,9 @@ Page({
scene1: null,
scene2: null,
scene3: null,
scene4: null
scene4: true
},
sceneActive: 2,
sceneActive: 4,
scenePriceList: [{
total: 0
}, {
......@@ -33,80 +33,7 @@ Page({
scene1: [],
scene2: [],
scene3: [],
scene4: [],
// [{
// productName: '360实景导航',
// price: 10
// }, {
// productName: 'AR实景导航',
// price: 20,
// openFlag: true
// }, {
// productName: 'AR实景导航',
// price: 20,
// openFlag: true
// }, {
// productName: 'AR实景导航',
// price: 20,
// openFlag: true
// }, {
// productName: 'AR实景导航',
// price: 20,
// openFlag: false
// }, {
// productName: 'AR实景导航',
// price: 20,
// openFlag: true
// }],
// scene2: [{
// productName: '座椅通风',
// price: 30,
// openFlag: true,
// toShopCount: 120,
// experienceCount: 200,
// upgradeCount: 300,
// totalOrderMoney: 365
// }, {
// productName: '座椅通风',
// price: 40
// }],
// scene3: [{
// productName: '氛围灯',
// price: 50
// }, {
// productName: '氛围灯',
// price: 60,
// openFlag: true
// }],
// scene4: [{
// productName: '数字化',
// price: 70,
// openFlag: true
// }, {
// productName: '数字化',
// price: 80
// }, {
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80,
// openFlag: true
// }, {
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80,
// openFlag: true
// }, {
// productName: '数字化',
// price: 70
// }, {
// productName: '数字化',
// price: 80,
// openFlag: true
// }]
scene4: []
},
// 产值
searchForm: {
......@@ -128,7 +55,7 @@ Page({
activityActive: 0
})
if (!this.data.sceneActivityObj['scene' + this.data.sceneActive].length) {
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
return true
}
this.setCurActivity()
......@@ -182,18 +109,23 @@ Page({
wx.$router.go('packageOutput.openBusiness', params)
},
getNoOpenPro(sceneCode) {
getSceneProStatus(sceneCode) {
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
merchant4sId: this.data.merchantInfo.merchantId,
sceneCode: sceneCode
}
outputApi.getNoOpenPro(params).then(res => {
outputApi.getSceneProStatus(params).then(res => {
var proList = res.find(item => item.sceneCode == sceneCode)
// 删----
proList.productList[1].productStatus = 2
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: res
['sceneActivityObj.scene' + this.data.sceneActive]: proList.productList
})
if ([2, 3].includes(+this.data.sceneActive)) {
this.getCustomerDetail()
} else if (this.data.sceneActive == 4) {
this.getActivityRevenue()
} else {
this.setCurActivity()
}
......@@ -262,10 +194,97 @@ Page({
})
},
dealSearchStatus() {
var params = {}
switch (this.data.searchForm['scene' + this.data.sceneActive + 'Idx']) {
case 0:
params.activityStatuList = [1, 2]
break
// 申请中
case 1:
params.activityStatuList = [1]
break
// 活动中
case 2:
params.activityStatuList = [2]
break
// 已结束
case 3:
params.activityStatuList = [3]
break
}
return params
},
/** 查询场景4的产值 */
getActivityRevenue() {
var params = this.dealSearchStatus()
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
console.log(res)
console.log(this.data.sceneActivityObj, '++++++')
var actList = this.data.sceneActivityObj['scene' + this.data.sceneActive]
actList.forEach((item, idx) => {
var curItem = res.find(k => k.goodsCategoryCode == item.productCode)
if (curItem) {
console.log(curItem)
curItem.totalNum = curItem.activityList.length
curItem.activityList.forEach(k => {
k.time = k.startTime.slice(5).replace(/-/g, '/') + '~' + k.endTime.slice(5).replace(/-/g, '/')
// 0-未开始;1-开始中;2-已结束
if (new Date(k.startTime) > new Date()) {
k.actStatus = 0
k.interDays = parseInt((new Date().getTime(k.startTime) - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
} else if (new Date(k.startTime) < new Date() < new Date(k.endTime)) {
k.actStatus = 1
k.interDays = parseInt((new Date().getTime() - new Date(k.startTime).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.toEndDays = parseInt((new Date(k.endTime).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
} else if (new Date(k.endTime) < new Date()) {
k.actStatus = 2
k.interDays = parseInt((new Date().getTime(k.endTime) - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
}
k.suggestTxtList = []
k.suggestList = []
if (k.visitCount < 200) {
if ((k.actStatus == 2 && k.interDays < 8) || k.actStatus != 2) {
k.suggestTxtList.push('距离活动结束剩余' + k.toEndDays + '天')
}
k.suggestList.push('触达车主的数量太少,建议与4S店关键人沟通下注册员工的转发执行情况')
}
if (k.shareRate < 0.4) {
k.suggestTxtList.push('分享员工占比低于40%')
k.suggestList.push('建议与4S店关键人沟通下注册员工的转发执行情况')
}
if (k.conversionRate < 0.05) {
k.suggestTxtList.push('点击转化率低于5%')
k.suggestList.push('建议调整该产品的品类话术和营销内容')
}
k.suggestTxt = k.suggestTxtList.join(',') + '。'
})
actList[idx].outputData = curItem
}
})
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: actList
})
this.setCurActivity()
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
merchantInfo: {
pMerchantId: 44209845,
merchantId: 44209390,
merchantName: '????'
},
sceneCodeList: ['SC001', 'SC002', 'SC003', 'SC004']
})
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
wx.$router.getData(obj => {
console.log(obj)
var scene = {}
......@@ -278,7 +297,7 @@ Page({
sceneCodeList: obj.sceneCodeList
})
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
// this.getCustomerDetail()
// this.setCurActivity()
})
......
<!--packageOutput/pages/summary/summary.wxml-->
<view class="summary">
<view class="layout {{ (sceneActive == 4 && activityList[activityActive].openFlag) ? 'bg-grey' : 'bg-white'}}">
<view class="layout {{ (sceneActive == 4 && activityList[activityActive].productStatus == 2) ? 'bg-grey' : 'bg-white'}}">
<view class="title bg-white">选产品/活动</view>
<view class="scene-box bg-white">
<scene-box formData="{{sceneObj}}" scenePriceList="{{scenePriceList}}" sceneActive="{{sceneActive}}" bindhandleSceneChange="handleSceneChange"></scene-box>
......@@ -9,13 +9,13 @@
<view class="p-rl-20 bg-white">
<scroll-view scroll-x="{{true}}" class="activity-box" scroll-left="{{scrollLeft}}">
<view class="flex">
<view class="activity-item {{ activityActive == index ? 'active' : ''}} {{item.openFlag ? 'open' : 'no-open'}}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActChange" data-idx="{{index}}">{{item.productName}}</view>
<view class="activity-item {{ activityActive == index ? 'active' : ''}} {{item.productStatus == 2 ? 'open' : 'no-open'}}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActChange" data-idx="{{index}}">{{item.productName}}</view>
</view>
</scroll-view>
</view>
<!-- 活动内容 -->
<view class="activity-content">
<view wx:if="{{activityList[activityActive].openFlag && sceneActive != 1}}">
<view wx:if="{{activityList[activityActive].productStatus == 2 && sceneActive != 1}}">
<view class="activity-title title bg-white {{ sceneActive == 4 ? 'no-border' : ''}}">
<view>看产值</view>
<view class="select" bindtap="handleSearch">
......@@ -25,12 +25,12 @@
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}"></output-transform>
<output-crowdfund wx:if="{{sceneActive == 4}}"></output-crowdfund>
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}"></output-crowdfund>
</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="{{!activityList[activityActive].openFlag}}" class="btn-blue" bindtap="handleJump">点击开通</view>
<view wx:if="{{activityList[activityActive].productStatus != 2}}" class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
\ No newline at end of file
......@@ -17,73 +17,19 @@ Component({
*/
data: {
IMGURL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
pMerchantId: 44209845,
// pMerchantId: 41214,
pMerchantId: '',
totalProfit: 0,
pageObj: {
currentPage: 1,
pageSize: 3
},
totalPages: -1,
list: [{
"totalMoney": 540967.00,
"merchantId": 44211468,
"merchantName": "明明长岭4s店A",
"sceneList": [{
"sceneCode": "SC001",
"flag": null
}, {
"sceneCode": "SC002",
"flag": true
}, {
"sceneCode": "SC003",
"flag": null
}, {
"sceneCode": "SC004",
"flag": null
}],
"msgList": null
}, {
"totalMoney": 67341.00,
"merchantId": 44211470,
"merchantName": "明明长岭4s店C",
"sceneList": [{
"sceneCode": "SC001",
"flag": null
}, {
"sceneCode": "SC002",
"flag": true
}, {
"sceneCode": "SC003",
"flag": null
}, {
"sceneCode": "SC004",
"flag": null
}],
"msgList": null
}, {
"totalMoney": 54146.00,
"merchantId": 44211469,
"merchantName": "明明长岭4s店B",
"sceneList": [{
"sceneCode": "SC001",
"flag": null
}, {
"sceneCode": "SC002",
"flag": true
}, {
"sceneCode": "SC003",
"flag": null
}, {
"sceneCode": "SC004",
"flag": null
}],
"msgList": null
}]
list: []
},
lifetimes: {
attached() {
// this.getClientApi()
this.getPMerchantInfo()
this.getClientApi()
}
},
......@@ -91,6 +37,13 @@ Component({
* 组件的方法列表
*/
methods: {
getPMerchantInfo() {
let { userInfo } = wx.$storage.get()
this.setData({
pMerchantInfo: userInfo,
pMerchantId: userInfo.subLoginUser.merchantId
})
},
getClientApi() {
this.getProfit()
this.getList()
......@@ -142,7 +95,8 @@ Component({
scene3: currentItem.scene3,
scene4: currentItem.scene4,
sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId
pMerchantId: this.data.pMerchantId,
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName
}
wx.$router.go('packageOutput.summary', params)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!