Commit 9b66c2c5 by chenwq

产品开通

1 parent 6aa357bd
......@@ -39,10 +39,10 @@ Page({
}
let list = []
outputApi.findProByScene(params).then(res => {
console.log(res)
console.log(this.data.scenceList)
sceneCodeList.forEach(item => {
let target = res.find(k => k.sceneCode == item)
let proList = res.find(k => k.sceneCode == item)?.productList
let target = scenceList.find(k => k.sceneCode == item)
target.proList = proList
list.push(target)
})
this.setData({
......@@ -59,10 +59,10 @@ Page({
})
},
handleSceneClick(e) {
let { idx } = e.currentTarget.dataset
handleProClick(e) {
let { sceneidx, proidx } = e.currentTarget.dataset
this.setData({
['scenceList[' + idx + '].isCheck']: !this.data.scenceList[idx].isCheck
[`scenceList[${sceneidx}].proList[${proidx}].isCheck`]: !this.data.scenceList[sceneidx].proList[proidx].isCheck
})
},
......@@ -101,13 +101,15 @@ Page({
})
},
dealScene() {
dealPro() {
let arr = []
let { scenceList } = this.data
scenceList.forEach(item => {
if (item.isCheck) {
arr.push(item.sceneCode)
}
item.proList.forEach(k => {
if(k.isCheck) {
arr.push(k.productCode)
}
})
})
return arr
},
......@@ -119,14 +121,14 @@ Page({
if (isConfirm) {
return true
}
formData.sceneList = this.dealScene()
formData.productCodeList = this.dealPro()
let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
}
if (!formData.sceneList.length) {
wx.$api.showToast('请选择场景')
if (!formData.productCodeList.length) {
wx.$api.showToast('请至少选择一个产品')
return
}
let message = addOrEdit == 'add' ? '是否确定客户?' : '是否确定修改客户?'
......
/* packageMine/pages/customerManagement/editCustomer/editCustomer.wxss */
.create-service-page {
margin: 20rpx;
padding-bottom: 200rpx;
.tips {
padding: 12rpx;
......@@ -89,16 +90,36 @@
.scene-item {
display: flex;
align-items: center;
box-sizing: border-box;
background: #F7F8FC;
background: #FFFFFF;
font-size: 24rpx;
padding: 8rpx 28rpx;
font-weight: 500;
border: 2rpx solid #F2F3F7;
border-radius: 12rpx;
margin-bottom: 16rpx;
}
.scene-item:last-child {
.pro-box {
display: flex;
flex-wrap: wrap;
}
.pro-item {
position: relative;
box-sizing: border-box;
width: calc((100% - 20rpx) / 2);
margin-right: 20rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
background: #F2F3F7;
border-radius: 8rpx;
margin-bottom: 16rpx;
}
.pro-item:nth-child(2n) {
margin-right: 0;
}
......@@ -111,16 +132,16 @@
}
/* 选中 - start */
.active.scene-item {
background-image: linear-gradient(144deg, #F0F7FF 0%, #FFFFFF 73%);
border: 2rpx solid #3666FE;
border-radius: 12rpx;
.active.pro-item {
color: #3666FE;
background: #F0F7FF;
border: 2rpx solid #3E71FE;
}
/* 选中 - end */
.scene-img {
width: 92rpx;
height: 64rpx;
width: 81rpx;
height: 56rpx;
}
/* .notOpened {
......
......@@ -13,19 +13,18 @@
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view wx:if="{{item.type == 'business'}}">
<!-- <view class="scene"> -->
<!-- <view class="scene-item {{item.isCheck ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleSceneClick" data-idx="{{index}}" data-scenecode="{{item.sceneCode}}"> -->
<view wx:for="{{scenceList}}" wx:key="index" class="scene">
<!-- <glsx-image wx:if="{{item.isCheck}}" src="personal/scene-check.png" class="check-icon" /> -->
<view class="scene-item">
<image webp class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view>{{item.name}}</view>
</view>
<view wx:for="{{item.productList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
{{subItem.productName}}
<view class="pro-box">
<view wx:for="{{item.proList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="pro-item {{subItem.isCheck ? 'active' : ''}}" bindtap="handleProClick" data-sceneIdx="{{index}}" data-proIdx="{{idx}}">
<glsx-image wx:if="{{subItem.isCheck}}" src="personal/scene-check.png" class="check-icon" />
{{subItem.productName}}
</view>
</view>
</view>
<!-- </view> -->
</view>
</block>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!