Commit b0a92bf4 by chenwq

场景值组件,看产值-我的客户;产值计算;开通业务

1 parent 6ece6502
// pages/tab/output/components/sceneBox/sceneBox.js // pages/tab/output/components/sceneBox/sceneBox.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import { scenceList } from '~/pages/tab/index/constant/data'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -12,6 +13,10 @@ Component({ ...@@ -12,6 +13,10 @@ Component({
type: Number, type: Number,
value: -1 value: -1
}, },
sceneCodeActive: {
type: String,
value: ''
},
hasOpenIcon: { hasOpenIcon: {
type: Boolean, type: Boolean,
value: true value: true
...@@ -20,9 +25,14 @@ Component({ ...@@ -20,9 +25,14 @@ Component({
type: Boolean, type: Boolean,
value: true value: true
}, },
formData: { sceneInfo: {
type: Object, type: Object,
value: () => {} value: () => {},
observer(n) {
if(n.hasOwnProperty('sceneList')) {
this.findIsOpen()
}
}
}, },
scenePriceList: { scenePriceList: {
type: Array, type: Array,
...@@ -36,33 +46,51 @@ Component({ ...@@ -36,33 +46,51 @@ Component({
data: { data: {
IMGURL: IMG_URL, IMGURL: IMG_URL,
openedIcon: `${IMG_URL}/output/openedIcon.png`, openedIcon: `${IMG_URL}/output/openedIcon.png`,
custSceneList: [ scenceList
{ // custSceneList: [
title: '新车洽谈场景', // {
subTitle: '1.0新车权益升级' // title: '新车洽谈场景',
}, // subTitle: '1.0新车权益升级'
{ // },
title: '新车交付场景', // {
subTitle: '1.1新车精品升级' // title: '新车交付场景',
// subTitle: '1.1新车精品升级'
// },
// {
// title: '0-6个月',
// subTitle: '1.2次新车膨胀金活动'
// },
// {
// title: '6个月以上',
// subTitle: '1.3售后直播众筹活动'
// }
// ]
}, },
{
title: '0-6个月', lifetimes: {
subTitle: '1.2次新车膨胀金活动' attached() {
}, // console.log(this.data.sceneInfo, 'sceneInfo--')
{ // console.log(this.data.scenceList, 'scenceList--')
title: '6个月以上',
subTitle: '1.3售后直播众筹活动'
} }
]
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
findIsOpen() {
let list = JSON.parse(JSON.stringify(this.data.scenceList))
list.forEach(item => {
let obj = this.data.sceneInfo?.sceneList.find(k => k.sceneCode == item.sceneCode) || {}
item.isOpen = obj.flag || false
})
this.setData({
scenceList: list
})
},
handleClick(e) { handleClick(e) {
let { idx } = e.currentTarget.dataset let { idx, scenecode } = e.currentTarget.dataset
this.triggerEvent('handleSceneChange', { sceneIdx: idx }) this.triggerEvent('handleSceneChange', { sceneIdx: idx, sceneCode: scenecode })
} }
} }
}) })
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml --> <!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="/pages/tab/output/index.wxs" module="filter" /> <wxs src="/pages/tab/output/index.wxs" module="filter" />
<view class="flex scene"> <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 class="scene-item {{ (item.isOpen && hasOpenIcon) ? 'open' : ''}} {{sceneCodeActive && (sceneCodeActive == item.sceneCode) ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}" data-scenecode="{{item.sceneCode}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon"> <view wx:if="{{hasOpenIcon && item.isOpen}}" class="open-icon">
<image src="{{openedIcon}}" webp></image> <image src="{{openedIcon}}" webp></image>
</view> </view>
<image webp wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 1}}.png?v={{img_version}}"></image> <image webp wx:if="{{item.isOpen}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view wx:else class="no-open-img"> <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:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{item.sceneid + 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> <image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
</view> </view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}"> <view class="scene-title {{item.isOpen ? '' : 'on-open'}}">
{{item.title}} {{item.name}}
</view> </view>
<view>{{item.subTitle}}</view> <!-- <view>{{item.subTitle}}</view> -->
<view class="total-price" wx:if="{{scenePriceList.length}}"> <view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{filter.money_three_for_two_thousands(scenePriceList[index].total || 0.00)}} ¥ {{filter.money_three_for_two_thousands(scenePriceList[index].total || 0.00)}}
</view> </view>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
.scene-title { .scene-title {
font-size: 24rpx; font-size: 24rpx;
height: 44rpx; /* height: 44rpx; */
line-height: 44rpx; line-height: 44rpx;
margin: 10rpx 0 4rpx; margin: 10rpx 0 4rpx;
font-weight: 600; font-weight: 600;
......
...@@ -10,23 +10,38 @@ Page({ ...@@ -10,23 +10,38 @@ Page({
merchantInfo: {}, merchantInfo: {},
sceneCodeList: [], sceneCodeList: [],
// 场景业务 // 场景业务
formData: { sceneInfo: {
scene1: true, sceneList: [{
scene2: true, sceneCode: 'SC001',
scene3: true, flag: true
scene4: true }, {
sceneCode: 'SC002',
flag: true
}, {
sceneCode: 'SC003',
flag: true
}, {
sceneCode: 'SC004',
flag: true
}]
}, },
sceneActive: 1, sceneActive: 1,
sceneCodeActive: 'SC001',
// 活动内容 // 活动内容
activityList: [], activityList: [],
sceneActivityObj: { sceneActivityObj: {
scene0: [],
scene1: [], scene1: [],
scene2: [], scene2: [],
scene3: [], scene3: []
scene4: []
} }
}, },
// 查找当前高亮场景的idx
findSceneIdx(sceneCode = this.data.sceneCodeActive) {
return this.data.sceneCodeList.findIndex(item => item == sceneCode)
},
getSceneProStatus(sceneCode) { getSceneProStatus(sceneCode) {
var params = { var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId, serviceMerchantId: this.data.merchantInfo.pMerchantId,
...@@ -36,7 +51,7 @@ Page({ ...@@ -36,7 +51,7 @@ Page({
outputApi.getSceneProStatus(params).then(res => { outputApi.getSceneProStatus(params).then(res => {
var proList = res.find(item => item.sceneCode == sceneCode) var proList = res.find(item => item.sceneCode == sceneCode)
this.setData({ this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: proList.productList ['sceneActivityObj.scene' + this.findSceneIdx()]: proList.productList
}) })
this.setCurActivity() this.setCurActivity()
}) })
...@@ -44,12 +59,13 @@ Page({ ...@@ -44,12 +59,13 @@ Page({
// 场景切换 // 场景切换
handleSceneChange(e) { handleSceneChange(e) {
var idx = e.detail.sceneIdx // var idx = e.detail.sceneIdx
var sceneCode = e.detail.sceneCode
this.setData({ this.setData({
sceneActive: idx sceneCodeActive: sceneCode,
}) })
if (!this.data.sceneActivityObj['scene' + this.data.sceneActive].length) { if (!this.data.sceneActivityObj['scene' + this.findSceneIdx()].length) {
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1]) this.getSceneProStatus(this.data.sceneCodeList[this.findSceneIdx()])
return true return true
} }
this.setCurActivity() this.setCurActivity()
...@@ -58,7 +74,7 @@ Page({ ...@@ -58,7 +74,7 @@ Page({
setCurActivity() { setCurActivity() {
this.setData({ this.setData({
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.data.sceneActive])) activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.findSceneIdx()]))
}) })
}, },
...@@ -92,7 +108,7 @@ Page({ ...@@ -92,7 +108,7 @@ Page({
serviceMerchantName: this.data.merchantInfo.pMerchantName, serviceMerchantName: this.data.merchantInfo.pMerchantName,
merchantId: this.data.merchantInfo.merchantId, merchantId: this.data.merchantInfo.merchantId,
merchantName: this.data.merchantInfo.merchantName, merchantName: this.data.merchantInfo.merchantName,
sceneCode: this.data.sceneCodeList[this.data.sceneActive - 1], sceneCode: this.data.sceneCodeList[this.findSceneIdx()],
productCodes: this.data.activityList.filter(item => item.checked == true).map(item => item.productCode), productCodes: this.data.activityList.filter(item => item.checked == true).map(item => item.productCode),
clueId: this.data.clueId clueId: this.data.clueId
} }
...@@ -120,11 +136,12 @@ Page({ ...@@ -120,11 +136,12 @@ Page({
wx.$router.getData(obj => { wx.$router.getData(obj => {
this.setData({ this.setData({
merchantInfo: obj.merchantInfo, merchantInfo: obj.merchantInfo,
sceneActive: obj.sceneActive, // sceneActive: obj.sceneActive,
sceneCodeList: obj.sceneCodeList || ['SC001', 'SC002', 'SC003', 'SC004'], sceneCodeList: obj.sceneCodeList || ['SC002', 'SC003', 'SC004', 'SC001'],
sceneCodeActive: obj.sceneCodeActive,
clueId: obj.clueId clueId: obj.clueId
}) })
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1]) this.getSceneProStatus(this.data.sceneCodeList[this.findSceneIdx()])
}) })
}, },
......
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
<!-- 场景活动 --> <!-- 场景活动 -->
<view class="box"> <view class="box">
<view class="box-title">业务场景</view> <view class="box-title">业务场景</view>
<scene-box formData="{{formData}}" scenePriceList="{{scenePriceList}}" sceneActive="{{sceneActive}}" hasOpenIcon="{{false}}" bindhandleSceneChange="handleSceneChange"></scene-box> <scene-box sceneInfo="{{sceneInfo}}" scenePriceList="{{scenePriceList}}" sceneCodeActive="{{sceneCodeActive}}" hasOpenIcon="{{false}}" bindhandleSceneChange="handleSceneChange"></scene-box>
</view> </view>
<!-- 活动 --> <!-- 活动 -->
<view class="box"> <view class="box">
<view class="box-title">产品/活动<text class="title-tip">(可多选)</text></view> <view class="box-title">产品/活动<text class="title-tip">(可多选)</text></view>
<view class="activity-box" wx:if="{{sceneActive != 1}}"> <view class="activity-box" wx:if="{{sceneCodeActive != 'SC001'}}">
<view wx:for="{{activityList}}" wx:key="index" class="activity-item"> <view wx:for="{{activityList}}" wx:key="index" class="activity-item">
<!-- productStatus:0未申请;1申请中;2已开通;3:已结束 --> <!-- productStatus:0未申请;1申请中;2已开通;3:已结束 -->
<view wx:if="{{item.openFlag != 0 && item.productStatus == 2}}"> <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="{{sceneCodeActive == 'SC004'}}" 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> <glsx-image wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
</view> </view>
<view wx:if="{{item.openFlag == 0}}" class="text-hide {{ item.checked ? 'active' : '' }}" bindtap="handleActClick" data-idx="{{index}}">{{item.productName}}</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 class="text-hide item-disabled" wx:else>{{item.productName}}</view>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</view> </view>
</view> </view>
<view class="isFullSucreen btn"> <view class="isFullSucreen btn">
<view wx:if="{{sceneActive != 1}}" class="btn-blue" bindtap="handleConfirm">申请开通</view> <view wx:if="{{sceneCodeActive != 'SC001'}}" class="btn-blue" bindtap="handleConfirm">申请开通</view>
<view wx:else class="btn-disabled">申请开通</view> <view wx:else class="btn-disabled">申请开通</view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<!-- packageOutput/pages/summary/summary.wxml --> <!-- packageOutput/pages/summary/summary.wxml -->
<view class="summary"> <view class="summary">
<view class="layout {{ (sceneActive != 1 && isShowData) ? 'bg-grey' : 'bg-white'}}"> <view class="layout {{ (sceneCodeActive != 'SC001' && isShowData) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'bg-white' : 'p-rl-20'}}"> <view class="{{ (sceneCodeActive != 'SC001' && isShowData) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'm-rl-20' : ''}}"> <view class="{{ (sceneCodeActive != 'SC001' && 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">
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</view> </view>
</view> </view>
<view class="scene-box bg-white"> <view class="scene-box bg-white">
<scene-box formData="{{sceneObj}}" scenePriceList="{{scenePriceList}}" sceneActive="{{sceneActive}}" bindhandleSceneChange="handleSceneChange" /> <scene-box sceneInfo="{{sceneInfo}}" scenePriceList="{{scenePriceList}}" sceneCodeActive="{{sceneCodeActive}}" bindhandleSceneChange="handleSceneChange" />
</view> </view>
</view> </view>
</view> </view>
...@@ -26,41 +26,41 @@ ...@@ -26,41 +26,41 @@
</scroll-view> </scroll-view>
</view> </view>
<!-- 活动内容 --> <!-- 活动内容 -->
<view class="activity-content {{ (sceneActive != 1 && isShowData) ? '' : 'p-rl-20'}}"> <view class="activity-content {{ (sceneCodeActive != 'SC001' && isShowData) ? '' : 'p-rl-20'}}">
<view wx:if="{{isShowData && sceneActive != 1}}"> <view wx:if="{{isShowData && sceneCodeActive != 'SC001'}}">
<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 class="select" bindtap="handleSearch">
<view wx:if="{{sceneActive == 2 || sceneActive == 3}}" class="select-txt"> <view wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" class="select-txt">
{{baseData.timeList[sceneActive == 2 ? searchForm.scene2Idx : searchForm.scene3Idx]}} {{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}}
</view> </view>
<view wx:if="{{sceneActive == 4}}" class="select-txt"> <view wx:if="{{sceneCodeActive == 'SC004'}}" class="select-txt">
{{baseData.actStatusList[searchForm.scene4Idx]}} {{baseData.actStatusList[searchForm.sceneSC004]}}
</view> </view>
<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="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" /> <output-transform wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" formData="{{activityList[activityActive].orderTotal}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" 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">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" /> <image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{sceneActive != 1 && activityList.length}}"> <view wx:if="{{sceneCodeActive != 'SC001' && 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="{{sceneActive == 1}}" class="isFullSucreen btn-box"> <view wx:if="{{sceneCodeActive == 'SC001'}}" class="isFullSucreen btn-box">
<view class="btn"> <view class="btn">
<view class="btn-disabled">点击开通</view> <view class="btn-disabled">点击开通</view>
</view> </view>
</view> </view>
<view wx:if="{{sceneActive == 4 && activityList.length && isShowData && activityList[activityActive].outputData.shareBtnIdx && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare"> <view wx:if="{{sceneCodeActive == 'SC004' && activityList.length && isShowData && activityList[activityActive].outputData.shareBtnIdx && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare">
<view class="btn"> <view class="btn">
<view class="btn-share">活动进行中,分享母链海报开展活动</view> <view class="btn-share">活动进行中,分享母链海报开展活动</view>
</view> </view>
......
...@@ -149,11 +149,12 @@ Component({ ...@@ -149,11 +149,12 @@ Component({
var params = { var params = {
merchantId: currentItem.merchantId, merchantId: currentItem.merchantId,
merchantName: currentItem.merchantName, merchantName: currentItem.merchantName,
scene1: currentItem.scene1, // scene1: currentItem.scene1,
scene2: currentItem.scene2, // scene2: currentItem.scene2,
scene3: currentItem.scene3, // scene3: currentItem.scene3,
scene4: currentItem.scene4, // scene4: currentItem.scene4,
sceneCodeList: currentItem.sceneList.map(item => item.sceneCode), sceneList: currentItem.sceneList,
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId, pMerchantId: this.data.pMerchantId,
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName, pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper isSuper: this.data.pMerchantInfo.isSuper
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
<!-- 场景内容 --> <!-- 场景内容 -->
<view class="box-content"> <view class="box-content">
<scene-box formData="{{item}}" hasLockIcon="{{false}}" /> <scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" />
<!-- 通知 --> <!-- 通知 -->
<view class="box-bottom"> <view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex"> <view wx:if="{{item.msgList.length}}" class="flex">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!