Commit d84edd32 by chenwq

联调

1 parent 4b7ed2a2
......@@ -32,5 +32,14 @@ class outputApi {
}
)
}
/** 查找可开通的产品 */
getNoOpenPro(data) {
return api.post(
{
method: 'scrm.api.busassistant.activity.findNotOpenProducts',
...data
}
)
}
}
export default outputApi
......@@ -17,82 +17,86 @@ Page({
// 活动内容
activityList: [],
sceneActivityObj: {
scene1: [{
name: '360实景导航',
price: 10
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}, {
name: 'AR实景导航',
price: 20
}],
scene2: [{
name: '座椅通风',
price: 30
}, {
name: '座椅通风',
price: 40
}],
scene3: [{
name: '氛围灯',
price: 50
}, {
name: '氛围灯',
price: 60
}],
scene4: [{
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80
}, {
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80
}, {
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80
}, {
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80
}]
scene1: [],
scene2: [],
scene3: [],
scene4: [],
// scene1: [{
// name: '360实景导航',
// price: 10
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// price: 20
// }],
// scene2: [{
// name: '座椅通风',
// price: 30
// }, {
// name: '座椅通风',
// price: 40
// }],
// scene3: [{
// name: '氛围灯',
// price: 50
// }, {
// name: '氛围灯',
// price: 60
// }],
// scene4: [{
// name: '数字化',
// price: 70
// }, {
// name: '数字化',
// price: 80
// }, {
// name: '数字化',
// price: 70
// }, {
// name: '数字化',
// price: 80
// }, {
// name: '数字化',
// price: 70
// }, {
// name: '数字化',
// price: 80
// }, {
// name: '数字化',
// price: 70
// }, {
// name: '数字化',
// price: 80
// }]
}
},
......
......@@ -28,15 +28,15 @@ Component({
name: 'totalOrderMoney'
}, {
label: '客单价',
name: '',
name: 'calCustomerUnitPrice',
prefix: '¥'
}, {
label: '引流体验量',
name: '',
name: 'calExperience',
suffix: '%'
}, {
label: '体验转化率',
name: '',
name: 'calTransform',
suffix: '%'
}]
},
......
......@@ -3,7 +3,7 @@
<view class="block" wx:for="{{formDataList}}" wx:key="index">
<view>
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{formData[item.name]}}
{{formData[item.name] || 0}}
<text wx:if="{{item.suffix}}">{{item.suffix}}</text>
</view>
<view class="label">{{item.label}}</view>
......
......@@ -7,7 +7,7 @@ Page({
*/
data: {
IMGURL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
merchantName: '',
sceneCodeList: ['SC001', 'SC002', 'SC003', 'SC004'],
merchantInfo: {},
sceneObj: {
scene1: null,
......@@ -15,94 +15,98 @@ Page({
scene3: null,
scene4: null
},
sceneActive: 1,
sceneActive: 2,
scenePriceList: [{
total: 0
}, {
total: 1000.45
total: 0
}, {
total: 0
}, {
total: 14580.45
total: 0
}],
// 活动内容
scrollLeft: 0,
activityActive: 0,
activityList: [],
sceneActivityObj: {
scene1: [{
name: '360实景导航',
price: 10
}, {
name: 'AR实景导航',
price: 20,
isOpen: true
}, {
name: 'AR实景导航',
price: 20,
isOpen: true
}, {
name: 'AR实景导航',
price: 20,
isOpen: true
}, {
name: 'AR实景导航',
price: 20,
isOpen: false
}, {
name: 'AR实景导航',
price: 20,
isOpen: true
}],
scene2: [{
name: '座椅通风',
price: 30,
isOpen: true,
toShopCount: 120,
experienceCount: 200,
upgradeCount: 300,
totalOrderMoney: 365
}, {
name: '座椅通风',
price: 40
}],
scene3: [{
name: '氛围灯',
price: 50
}, {
name: '氛围灯',
price: 60,
isOpen: true
}],
scene4: [{
name: '数字化',
price: 70,
isOpen: true
}, {
name: '数字化',
price: 80
}, {
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80,
isOpen: true
}, {
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80,
isOpen: true
}, {
name: '数字化',
price: 70
}, {
name: '数字化',
price: 80,
isOpen: true
}]
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
// }]
},
// 产值
searchForm: {
......@@ -123,6 +127,10 @@ Page({
sceneActive: idx,
activityActive: 0
})
if (!this.data.sceneActivityObj['scene' + this.data.sceneActive].length) {
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
return true
}
this.setCurActivity()
// console.log('换内容---')
},
......@@ -169,6 +177,24 @@ Page({
wx.$router.go('packageOutput.openBusiness')
},
getNoOpenPro(sceneCode) {
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
merchant4sId: this.data.merchantInfo.merchantId,
sceneCode: sceneCode
}
outputApi.getNoOpenPro(params).then(res => {
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: res
})
if ([2, 3].includes(+this.data.sceneActive)) {
this.getCustomerDetail()
} else {
this.setCurActivity()
}
})
},
dealSearchTime() {
var params = {}
switch (this.data.searchForm['scene' + this.data.sceneActive + 'Idx']) {
......@@ -190,10 +216,44 @@ Page({
return params
},
/** 1.1和1.2场景产品数据处理
* 调同一个接口,返回两个服务下面的全部产品的数据
*/
getCustomerDetail() {
var params = this.dealSearchTime()
outputApi.getCustomerDetail({ merchantId: 44209390, ...params }).then(res => {
console.log(res)
outputApi.getCustomerDetail({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
var actList = this.data.sceneActivityObj['scene' + this.data.sceneActive]
var actCodeList = actList.map(item => item.productCode)
console.log(actCodeList)
var curTotal = 0
var otherTotal = 0
var otherScene = this.data.sceneActive == 2 ? 3 : 2
res.forEach(item => {
var idx = actCodeList.findIndex(i => i == item.productCode)
if (idx != -1) {
var orderTotal = item.orderTotal
if(item.orderTotal) {
item.orderTotal.calCustomerUnitPrice = Math.round(orderTotal.totalSubOrderOrderMoney / orderTotal.upgradeCount).toFixed(0)
item.orderTotal.calExperience = Math.round((orderTotal.experienceCount * 100) / orderTotal.toShopCount).toFixed(0)
item.orderTotal.calTransform = Math.round((orderTotal.upgradeCount * 100) / orderTotal.experienceCount).toFixed(0)
}
actList[idx] = {
...actList[idx],
orderTotal: item.orderTotal
}
curTotal = curTotal + (item.orderTotal?.totalSubOrderOrderMoney || 0)
} else {
otherTotal = otherTotal + (item.orderTotal?.totalSubOrderOrderMoney || 0)
}
})
// 总金额
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: actList,
['scenePriceList[' + (this.data.sceneActive - 1) + '].total']: curTotal,
['scenePriceList[' + (otherScene - 1) + '].total']: otherTotal
})
console.log(this.data.sceneActivityObj['scene' + this.data.sceneActive])
this.setCurActivity()
})
},
......@@ -202,13 +262,21 @@ Page({
*/
onLoad(options) {
wx.$router.getData(obj => {
console.log(obj)
var scene = {}
Object.keys(this.data.sceneObj).forEach(item => {
scene[item] = obj[item]
})
this.setData({
merchantInfo: obj,
sceneObj: {}
sceneObj: scene,
sceneCodeList: obj.sceneCodeList
})
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
// this.getCustomerDetail()
// this.setCurActivity()
})
this.getCustomerDetail()
this.setCurActivity()
},
/**
......
<!--packageOutput/pages/summary/summary.wxml-->
<view class="summary">
<view class="layout {{ (sceneActive == 4 && activityList[activityActive].isOpen) ? 'bg-grey' : 'bg-white'}}">
<view class="layout {{ (sceneActive == 4 && activityList[activityActive].openFlag) ? '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.isOpen ? 'open' : 'no-open'}}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActChange" data-idx="{{index}}">{{item.name}}</view>
<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>
</scroll-view>
</view>
<!-- 活动内容 -->
<view class="activity-content">
<view wx:if="{{activityList[activityActive].isOpen && sceneActive != 1}}">
<view wx:if="{{activityList[activityActive].openFlag && sceneActive != 1}}">
<view class="activity-title title bg-white {{ sceneActive == 4 ? 'no-border' : ''}}">
<view>看产值</view>
<view class="select" bindtap="handleSearch">
......@@ -24,7 +24,7 @@
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}"></image>
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive]}}"></output-transform>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}"></output-transform>
<output-crowdfund wx:if="{{sceneActive == 4}}"></output-crowdfund>
</view>
<view wx:else class="content-empty bg-white">
......@@ -32,5 +32,5 @@
</view>
</view>
</view>
<view wx:if="{{!activityList[activityActive].isOpen}}" class="btn-blue" bindtap="handleJump">点击开通</view>
<view wx:if="{{!activityList[activityActive].openFlag}}" class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
\ No newline at end of file
......@@ -18,17 +18,72 @@ Component({
data: {
IMGURL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
pMerchantId: 44209845,
// pMerchantId: 41214,
totalProfit: 0,
pageObj: {
currentPage: 1,
pageSize: 3
},
totalPages: -1,
list: []
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
}]
},
lifetimes: {
attached() {
this.getClientApi()
// this.getClientApi()
}
},
......@@ -56,6 +111,11 @@ Component({
outputApi.getCustomerPageList({ merchantId: this.data.pMerchantId, ...this.data.pageObj }).then(res => {
var list = this.data.list
list = list.concat(res.list)
list.forEach((item, index) => {
item.sceneList.forEach((k, idx) => {
item['scene' + (idx + 1)] = item.sceneList[idx].flag
})
})
this.setData({
list: list,
totalPages: res.pages
......@@ -81,6 +141,7 @@ Component({
scene2: currentItem.scene2,
scene3: currentItem.scene3,
scene4: currentItem.scene4,
sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId
}
wx.$router.go('packageOutput.summary', params)
......
......@@ -4,6 +4,11 @@
height: calc(100vh - 170rpx);
color: #323436;
padding: 16rpx 0 60rpx;
background-color: #F2F3F7;
}
.client-box {
margin: 0 16rpx;
}
.flex {
......
<!--pages/tab/output/components/client/client.wxml-->
<scroll-view class="client" scroll-y="{{true}}" bindscrolltolower="onReachBottom" lower-threshold='50' scroll-top="{{scrollTop}}">
<view class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{totalProfit}}</text>
</view>
<view class="box" wx:for="{{list}}" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view class="head flex-between">
<view class="name text-hide">{{item.merchantName}}</view>
<view class="price-txt">¥{{item.totalMoney}}</view>
<scroll-view class="client" scroll-y="{{true}}" bindscrolltolower="onReachBottom" lower-threshold='50' scroll-top="{{scrollTop}}">
<view class="client-box">
<view class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{totalProfit}}</text>
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box formData="{{item}}"></scene-box>
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
<view class="tip-blue">最新</view>
<view class="bottom-content">
<view class="flex-between tip-row" wx:for="{{item.msgList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view>{{subItem.msg}}</view>
<view class="time">{{subItem.createTime}}</view>
<view class="box" wx:for="{{list}}" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view class="head flex-between">
<view class="name text-hide">{{item.merchantName}}</view>
<view class="price-txt">¥{{item.totalMoney}}</view>
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box formData="{{item}}"></scene-box>
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
<view class="tip-blue">最新</view>
<view class="bottom-content">
<view class="flex-between tip-row" wx:for="{{item.msgList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view>{{subItem.msg}}</view>
<view class="time">{{subItem.createTime}}</view>
</view>
</view>
</view>
</view>
<view wx:else class="flex">
<view class="tip-blue">通知</view>
<view class="bottom-content">
<view class="tip-row">
<view>运营建议:您的门店尚未开展活动,暂无产值。建议开通新产品拓展营收范围。</view>
<view wx:else class="flex">
<view class="tip-blue">通知</view>
<view class="bottom-content">
<view class="tip-row">
<view>运营建议:您的门店尚未开展活动,暂无产值。建议开通新产品拓展营收范围。</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view wx:if="{{totalPages != -1 && pageObj.currentPage == totalPages}}" class="end-txt">到底啦!</view>
</view>
<view wx:if="{{totalPages != -1 && pageObj.currentPage == totalPages}}" class="end-txt">到底啦!</view>
</scroll-view>
\ No newline at end of file
......@@ -53,7 +53,8 @@ const pathEnum = {
material: '/rop-scrm-marketing/', //素材
sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/'
drac: '/rop-scrm-entmicro/',
busassistant: '/rop-scrm-busassistant/'
}
const defaultMerchantId = {
ip: '44184606',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!