Commit 848c7cf2 by chenwq

详情页,详情1.0;文案

1 parent dbaa9cb0
...@@ -77,6 +77,14 @@ class outputApi { ...@@ -77,6 +77,14 @@ class outputApi {
}) })
} }
/** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) {
return api.post({
method: 'scrm.api.busassistant.merchant.equity.statistics',
...data
})
}
/** 店面汇总-下载海报 */ /** 店面汇总-下载海报 */
getPosterUrl(data) { getPosterUrl(data) {
return api.post({ return api.post({
......
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
} }
.scene-title { .scene-title {
width: 90rpx; width: 100rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
color: #323436; color: #323436;
} }
.scene-item:nth-child(2) .scene-title, .scene-item:nth-child(3) .scene-title { .scene-item:nth-child(2) .scene-title {
width: 110rpx; width: 120rpx;
} }
/* 已开通 - start */ /* 已开通 - start */
......
...@@ -142,16 +142,15 @@ ...@@ -142,16 +142,15 @@
} }
.name { .name {
width: 90rpx; width: 100rpx;
font-weight: 500; font-weight: 500;
font-size: 12px; font-size: 12px;
color: #323436; color: #323436;
text-align: center; text-align: center;
} }
.item-wrap:nth-child(2) .name, .item-wrap:nth-child(2) .name {
.item-wrap:nth-child(3) .name { width: 120rpx;
width: 110rpx;
} }
.msg { .msg {
......
const formList = [{
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '体验量',
name: 'experienceCount'
}, {
label: '成交订单',
name: 'upgradeCount'
}, {
label: '营业额',
name: 'totalSubOrderOrderMoney'
}, {
label: '客单价',
name: 'calCustomerUnitPrice',
prefix: '¥'
}, {
label: '引流体验率',
name: 'calExperience',
suffix: '%'
}, {
label: '体验转化率',
name: 'calTransform',
suffix: '%'
}]
const formObj = {
SC001: [{
label: '总单量',
name: 'totalCount'
}, {
label: '总产值',
name: 'totalAmount',
prefix: '¥'
}, {
label: '当月单量',
name: 'monthCount'
}, {
label: '当月产值',
name: 'monthAmount',
prefix: '¥'
}, {
label: '转化率',
name: 'conversionRate',
suffix: '%'
}, {
label: '单价',
name: 'price',
prefix: '¥'
}],
SC002: formList,
SC003: formList
}
module.exports = {
formObj
}
\ No newline at end of file \ No newline at end of file
// packageOutput/pages/summary/components/outputTransform/outputTransform.js // packageOutput/pages/summary/components/outputTransform/outputTransform.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import { formObj } from './constant/data'
const defaultSceneCode = 'SC002'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -8,6 +10,19 @@ Component({ ...@@ -8,6 +10,19 @@ Component({
formData: { formData: {
type: Object, type: Object,
value: () => { } value: () => { }
},
sceneCode: {
type: String,
value: 'SC002',
observer(n) {
this.setData({
formDataList: formObj[n || 'defaultSceneCode']
})
}
},
hasNavigate: {
type: Boolean,
value: true
} }
}, },
...@@ -16,31 +31,7 @@ Component({ ...@@ -16,31 +31,7 @@ Component({
*/ */
data: { data: {
IMGURL: IMG_URL, IMGURL: IMG_URL,
formDataList: [{ formDataList: formObj[defaultSceneCode]
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '体验量',
name: 'experienceCount'
}, {
label: '成交订单',
name: 'upgradeCount'
}, {
label: '营业额',
name: 'totalSubOrderOrderMoney'
}, {
label: '客单价',
name: 'calCustomerUnitPrice',
prefix: '¥'
}, {
label: '引流体验率',
name: 'calExperience',
suffix: '%'
}, {
label: '体验转化率',
name: 'calTransform',
suffix: '%'
}]
}, },
/** /**
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
</view> </view>
</view> </view>
<navigator version="trial" class="link" target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release"> <navigator wx:if="{{hasNavigate}}" version="trial" class="link" target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">
<view class="link-btn"> <view class="link-btn">
<image class="icon-link" src="{{IMGURL}}output/icon-link.png?v={{img_version}}" /> <image class="icon-link" src="{{IMGURL}}output/icon-link.png?v={{img_version}}" />
查看订单详情 查看订单详情
......
...@@ -89,7 +89,7 @@ Page({ ...@@ -89,7 +89,7 @@ Page({
}, },
setCurActivity() { setCurActivity() {
console.log('setCurActivity---') // console.log('setCurActivity---')
this.setData({ this.setData({
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.findSceneIdx()])), activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.findSceneIdx()])),
// productStatus:0未申请;1申请中;2已开通;3:已结束 // productStatus:0未申请;1申请中;2已开通;3:已结束
...@@ -154,6 +154,9 @@ Page({ ...@@ -154,6 +154,9 @@ Page({
} }
// 开通sc002和sc003场景:默认定位至sc002场景,否则定位至已开通的场景 // 开通sc002和sc003场景:默认定位至sc002场景,否则定位至已开通的场景
sceneCodeActive = list[this.findSceneIdx('SC002')] ? 'SC002' : 'SC003' sceneCodeActive = list[this.findSceneIdx('SC002')] ? 'SC002' : 'SC003'
if (!list[this.findSceneIdx('SC002')] && !list[this.findSceneIdx('SC002')]) {
sceneCodeActive = 'SC001'
}
this.setData({ this.setData({
sceneCodeActive: sceneCodeActive sceneCodeActive: sceneCodeActive
}) })
...@@ -166,8 +169,6 @@ Page({ ...@@ -166,8 +169,6 @@ Page({
sceneCode: sceneCode sceneCode: sceneCode
} }
outputApi.getSceneProStatus(params).then(res => { outputApi.getSceneProStatus(params).then(res => {
console.log(res, 'res-------')
console.log(this.data.sceneInfo, 'sceneInfo---')
var data = this.dealOpenActivity(res) var data = this.dealOpenActivity(res)
// var sceneObj = {} // var sceneObj = {}
var sceneActivityObj = {} var sceneActivityObj = {}
...@@ -189,17 +190,21 @@ Page({ ...@@ -189,17 +190,21 @@ Page({
// ['sceneActivityObj.scene2']: data[2].productList, // ['sceneActivityObj.scene2']: data[2].productList,
// ['sceneActivityObj.scene3']: data[3].productList // ['sceneActivityObj.scene3']: data[3].productList
}) })
console.log(sceneActivityObj, 'sceneActivityObj----')
// 首次进入,默认定位至SC004场景;需要调获取SC002和SC003场景的接口,以计算这两个场景的总额 // 首次进入,默认定位至SC004场景;需要调获取SC002和SC003场景的接口,以计算这两个场景的总额
if (isFirst) { if (isFirst) {
this.findOpenScene() this.findOpenScene()
if (!['SC002', 'SC003'].includes(this.data.sceneCodeActive)) { if (!['SC002', 'SC003'].includes(this.data.sceneCodeActive)) {
this.getCustomerDetail(isFirst) this.getCustomerDetail(isFirst)
} }
if (!['SC001'].includes(this.data.sceneCodeActive)) {
this.getEquityRevenue(isFirst)
}
} }
console.log(this.data.sceneCodeActive == defaultSceneCode) // console.log(this.data.sceneCodeActive == defaultSceneCode)
if (['SC002', 'SC003'].includes(this.data.sceneCodeActive)) { if (['SC002', 'SC003'].includes(this.data.sceneCodeActive)) {
this.getCustomerDetail() this.getCustomerDetail()
} else if (this.data.sceneCodeActive == 'SC001') {
this.getEquityRevenue()
} else if (this.data.sceneCodeActive == defaultSceneCode) { } else if (this.data.sceneCodeActive == defaultSceneCode) {
this.getActivityRevenue() this.getActivityRevenue()
} else { } else {
...@@ -248,6 +253,43 @@ Page({ ...@@ -248,6 +253,43 @@ Page({
return params return params
}, },
/**
* 查询SC001场景值
*/
getEquityRevenue(isFirst = false) {
outputApi.getEquityRevenue({ merchantId: this.data.merchantInfo.merchantId }).then(res => {
if (res.length) {
var actList = this.data.sceneActivityObj['scene' + this.findSceneIdx('SC001')]
var actCodeList = actList.map(item => item.productCode)
var total = 0
res.forEach(item => {
var idx = actCodeList.findIndex(i => i == item.productCode)
var orderTotal = item.orderTotal
if (item.orderTotal) {
item.orderTotal.totalAmount = Number(orderTotal.totalAmount).toFixed(2)
item.orderTotal.monthAmount = Number(orderTotal.monthAmount).toFixed(2)
item.orderTotal.conversionRate = Number(orderTotal.conversionRate).toFixed(0)
item.orderTotal.price = Number(orderTotal.price).toFixed(2)
total = (total + Number(item.orderTotal?.totalAmount)).toFixed(2)
}
actList[idx] = {
...actList[idx],
orderTotal: item.orderTotal
}
})
if (!isFirst) {
this.setData({
['sceneActivityObj.scene' + this.findSceneIdx()]: actList
})
this.setCurActivity()
}
this.setData({
['scenePriceList[' + this.findSceneIdx('SC001') + '].total']: total
})
}
})
},
/** sc002和sc003场景产品数据处理 /** sc002和sc003场景产品数据处理
* 调同一个接口,返回两个场景下面的全部产品的数据 * 调同一个接口,返回两个场景下面的全部产品的数据
*/ */
...@@ -291,6 +333,7 @@ Page({ ...@@ -291,6 +333,7 @@ Page({
['scenePriceList[' + (isFirst ? this.findSceneIdx('SC003') : otherSceneIdx) + '].total']: otherTotal.toFixed(2) ['scenePriceList[' + (isFirst ? this.findSceneIdx('SC003') : otherSceneIdx) + '].total']: otherTotal.toFixed(2)
}) })
} }
//sceneActivityObj
!isFirst && this.setCurActivity() !isFirst && this.setCurActivity()
}) })
}, },
......
<!-- packageOutput/pages/summary/summary.wxml --> <!-- packageOutput/pages/summary/summary.wxml -->
<view class="summary"> <view class="summary">
<view class="layout {{ (sceneCodeActive != 'SC001' && isShowData) ? 'bg-grey' : 'bg-white'}}"> <view class="layout {{ (isShowData) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneCodeActive != 'SC001' && isShowData) ? 'bg-white' : 'p-rl-20'}}"> <view class="{{ (isShowData) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneCodeActive != 'SC001' && isShowData) ? 'm-rl-20' : ''}}"> <view class="{{ (isShowData) ? 'm-rl-20' : ''}}">
<view class="title bg-white"> <view class="title bg-white">
选产品/活动 选产品/活动
<view class="title-open" bindtap="handleJump"> <view class="title-open" bindtap="handleJump">
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
</scroll-view> </scroll-view>
</view> </view>
<!-- 活动内容 --> <!-- 活动内容 -->
<view class="activity-content {{ (sceneCodeActive != 'SC001' && isShowData) ? '' : 'p-rl-20'}}"> <view class="activity-content {{ (isShowData) ? '' : 'p-rl-20'}}">
<view wx:if="{{isShowData && sceneCodeActive != 'SC001'}}"> <view wx:if="{{isShowData}}">
<view class="activity-title title bg-white p-l-20 no-border"> <view class="activity-title title bg-white p-l-20 no-border">
<view>看产值</view> <view>看产值</view>
<view class="select" bindtap="handleSearch"> <view wx:if="{{sceneCodeActive != 'SC001'}}" class="select" bindtap="handleSearch">
<view wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" class="select-txt"> <view wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" class="select-txt">
{{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}} {{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}}
</view> </view>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<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> </view>
<output-transform wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" formData="{{activityList[activityActive].orderTotal}}" /> <output-transform wx:if="{{sceneCodeActive != 'SC004'}}" formData="{{activityList[activityActive].orderTotal}}" hasNavigate="{{sceneCodeActive != 'SC001'}}" sceneCode="{{sceneCodeActive}}"/>
<output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack"/> <output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack"/>
</view> </view>
<view wx:else class="content-empty bg-white"> <view wx:else class="content-empty bg-white">
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{sceneCodeActive != 'SC001' && activityList.length}}"> <view wx:if="{{activityList.length}}">
<view class="isFullSucreen btn-box" wx:if="{{ !isShowData && !merchantInfo.isSuper}}"> <view class="isFullSucreen btn-box" wx:if="{{ !isShowData && !merchantInfo.isSuper}}">
<view class="btn"> <view class="btn">
<view class="btn-blue" bindtap="handleJump">点击开通</view> <view class="btn-blue" bindtap="handleJump">点击开通</view>
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{sceneCodeActive == 'SC001'}}" class="isFullSucreen btn-box"> <view wx:if="{{sceneCodeActive == 'SC001' && !isShowData}}" class="isFullSucreen btn-box">
<view class="btn"> <view class="btn">
<view class="btn-disabled">点击开通</view> <view class="btn-disabled">点击开通</view>
</view> </view>
......
var measureList = Object.freeze([ var measureList = Object.freeze([
{ {
// name: '新车交付场景', // name: '新车交付场景',
name: '膜升级驻店', name: '精品升级',
// tips: '精品升级', // tips: '精品升级',
iconName: 'icon2', iconName: 'icon2',
product: [ product: [
{ {
name: '太阳膜升级', name: '太阳膜升级',
parentName: '膜升级驻店', parentName: '精品升级',
// tips: '精品升级', // tips: '精品升级',
// value: '1-0', // value: '1-0',
typeIndex: '1.1', typeIndex: '1.1',
...@@ -21,13 +21,13 @@ var measureList = Object.freeze([ ...@@ -21,13 +21,13 @@ var measureList = Object.freeze([
] ]
}, },
{ {
name: '次新车二次转化', name: '次新车转化',
iconName: 'icon3', iconName: 'icon3',
// tips: '膨胀金活动', // tips: '膨胀金活动',
product: [ product: [
{ {
name: '膨胀金活动-车衣', name: '膨胀金活动-车衣',
parentName: '次新车二次转化', parentName: '次新车转化',
// tips: '膨胀金活动', // tips: '膨胀金活动',
// value: '2-0', // value: '2-0',
typeIndex: '1.2', typeIndex: '1.2',
...@@ -40,7 +40,7 @@ var measureList = Object.freeze([ ...@@ -40,7 +40,7 @@ var measureList = Object.freeze([
}, },
{ {
name: '膨胀金活动-改色膜', name: '膨胀金活动-改色膜',
parentName: '次新车二次转化', parentName: '次新车转化',
// tips: '膨胀金活动', // tips: '膨胀金活动',
// value: '2-1', // value: '2-1',
typeIndex: '1.2', typeIndex: '1.2',
...@@ -126,13 +126,13 @@ var measureList = Object.freeze([ ...@@ -126,13 +126,13 @@ var measureList = Object.freeze([
] ]
}, },
{ {
name: '车损险升级', name: '会员权益/升级',
// tips: '车损升级', // tips: '车损升级',
iconName: 'icon1', iconName: 'icon1',
product: [ product: [
{ {
name: '车损升级', name: '车损升级',
parentName: '车损险升级', parentName: '会员权益/升级',
// tips: '车损升级', // tips: '车损升级',
// value: '0-0', // value: '0-0',
typeIndex: '1.0', typeIndex: '1.0',
......
...@@ -298,7 +298,7 @@ const scenceList = [ ...@@ -298,7 +298,7 @@ const scenceList = [
// }, // },
{ {
sceneid: 1, sceneid: 1,
name: '膜升级驻店', name: '精品升级',
sceneCode:'SC002', sceneCode:'SC002',
sceneImgs: sceneImgs1, sceneImgs: sceneImgs1,
productImgs: productImgs1, productImgs: productImgs1,
...@@ -330,7 +330,7 @@ const scenceList = [ ...@@ -330,7 +330,7 @@ const scenceList = [
}, },
{ {
sceneid: 2, sceneid: 2,
name: '次新车二次转化', name: '次新车转化',
sceneCode:'SC003', sceneCode:'SC003',
sceneImgs: sceneImgs2, sceneImgs: sceneImgs2,
productImgs: productImgs2, productImgs: productImgs2,
...@@ -507,7 +507,7 @@ const scenceList = [ ...@@ -507,7 +507,7 @@ const scenceList = [
}, },
{ {
sceneid: 0, sceneid: 0,
name: '车损险升级', name: '会员权益/升级',
sceneCode:'SC001', sceneCode:'SC001',
sceneImgs:sceneImgs0, sceneImgs:sceneImgs0,
productImgs: productImgs0, productImgs: productImgs0,
......
...@@ -34,11 +34,11 @@ Component({ ...@@ -34,11 +34,11 @@ Component({
openedIcon: `${IMG_URL}/output/openedIcon.png`, openedIcon: `${IMG_URL}/output/openedIcon.png`,
custSceneList: [ custSceneList: [
{ {
title: '膜升级驻点', title: '精品升级',
// subTitle: '1.0新车权益升级' // subTitle: '1.0新车权益升级'
}, },
{ {
title: '次新车二次转化', title: '次新车转化',
// subTitle: '1.1新车精品升级' // subTitle: '1.1新车精品升级'
}, },
{ {
...@@ -46,7 +46,7 @@ Component({ ...@@ -46,7 +46,7 @@ Component({
// subTitle: '1.2次新车膨胀金活动' // subTitle: '1.2次新车膨胀金活动'
}, },
{ {
title: '车险损升级', title: '会员权益/升级',
// subTitle: '1.3售后直播众筹活动' // subTitle: '1.3售后直播众筹活动'
} }
] ]
......
...@@ -38,15 +38,15 @@ ...@@ -38,15 +38,15 @@
} }
.scene-title { .scene-title {
width: 90rpx; width: 100rpx;
font-weight: 600; font-weight: 600;
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
color: #323436; color: #323436;
} }
.scene-item:nth-child(2) .scene-title, .scene-item:nth-child(3) .scene-title { .scene-item:nth-child(2) .scene-title {
width: 110rpx; width: 120rpx;
} }
/* 已开通 - start */ /* 已开通 - start */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!