Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a6b86c18
authored
Dec 09, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加三级编辑后,中级数量的同步
parent
8c00faca
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
169 additions
and
137 deletions
app/containers/common/ProductModel.js
app/containers/common/listDataComponent/ChooseCardList.js
app/containers/common/listDataComponent/PictureZoom.js
app/containers/selfOrder/module/ChooseProductPage.js
app/containers/selfOrder/module/EditThirdLevelPage.js
app/containers/selfOrder/module/ProductRightStyle.js
app/containers/selfOrder/module/mock/sen_mock.js
app/containers/common/ProductModel.js
View file @
a6b86c18
...
...
@@ -134,20 +134,18 @@ class ProductModel extends Component {
}
componentDidMount
(){
console
.
log
(
'本地测试数据====localMockData==='
,
localMockData
)
// 赋值测试数据
this
.
setState
({
topProcOptionList
:
localMockData
.
localBottomOption
})
//
console.log('本地测试数据====localMockData===', localMockData)
//
//
赋值测试数据
//
this.setState({
//
topProcOptionList: localMockData.localBottomOption
//
})
}
componentWillReceiveProps
(
nextProps
)
{
if
(
this
.
state
.
isVisible
!=
nextProps
.
show
)
{
// console.log('父组件修改----', nextProps.show)
this
.
setState
({
isVisible
:
nextProps
.
show
});
}
if
(
nextProps
.
modelOption
)
{
console
.
log
(
'父组件修改---22-'
,
nextProps
.
modelOption
)
this
.
setState
({
topProcOptionList
:
nextProps
.
modelOption
});
}
}
...
...
@@ -196,20 +194,8 @@ class ProductModel extends Component {
// 修改列表计算后数据
handleCalCallBack
(
item
,
index
,
dataName
){
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
{
modelOption
}
=
this
.
props
console
.
log
(
'--已选==='
,
item
,
topActiveIndex
,
index
)
// if(dataName && topProcOptionList[topActiveIndex][dataName]) {
// topProcOptionList.map(function(listItem, listIndex) {
// if(listIndex === topActiveIndex){
// listItem[dataName][index] = item
// }
// })
// this.setState({
// topProcOptionList
// })
// }
// console.log('--已选===',item, topActiveIndex, index)
if
(
SELECTED_DATA_ARR
&&
topProcOptionList
[
topActiveIndex
][
SELECTED_DATA_ARR
])
{
topProcOptionList
.
map
(
function
(
listItem
,
listIndex
)
{
...
...
@@ -228,11 +214,11 @@ class ProductModel extends Component {
})
console
.
log
(
'---item[DEFAULT_FIELD] '
,
item
[
DEFAULT_FIELD
],
index
)
//
console.log('---item[DEFAULT_FIELD] ', item[DEFAULT_FIELD], index)
if
(
item
[
DEFAULT_FIELD
]
===
0
)
{
topProcOptionList
[
topActiveIndex
][
SELECTED_DATA_ARR
].
splice
(
index
,
1
)
console
.
log
(
'topProcOptionList[topActiveIndex][SELECTED_DATA_ARR]---'
,
topProcOptionList
[
topActiveIndex
][
SELECTED_DATA_ARR
])
//
console.log('topProcOptionList[topActiveIndex][SELECTED_DATA_ARR]---', topProcOptionList[topActiveIndex][SELECTED_DATA_ARR])
}
// 修改左侧分类汇总
...
...
@@ -258,11 +244,9 @@ class ProductModel extends Component {
}
allCountQuantity
+=
proItem
[
SELECTED_QUQNTITY
]
})
// this.setState({
// allCountQuantity
// })
// 回调函数
console
.
log
(
'---计算后 '
,
topProcOptionList
,
allCountQuantity
)
//
console.log('---计算后 ', topProcOptionList, allCountQuantity)
this
.
props
.
modelCallBack
(
topProcOptionList
)
if
(
allCountQuantity
===
0
){
...
...
@@ -281,7 +265,7 @@ class ProductModel extends Component {
// 清空
handleClearRubbish
()
{
console
.
log
(
'清空======'
)
//
console.log('清空======')
let
{
topProcOptionList
}
=
this
.
state
// 本地测试
let
curCalField
=
'quantity'
...
...
@@ -293,16 +277,12 @@ class ProductModel extends Component {
deIt
[
curCalField
]
=
0
})
})
// this.setState({
// allCountQuantity: 0
// })
// 回调函数
console
.
log
(
'---清空之后===== '
,
topProcOptionList
)
//
console.log('---清空之后===== ', topProcOptionList)
this
.
props
.
modelCallBack
(
topProcOptionList
)
this
.
closeModal
()
}
// 返回清空
...
...
@@ -326,7 +306,6 @@ class ProductModel extends Component {
// 返回顶部编辑选项
renderTopProItem
()
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
// let {modelOption} = this.props
return
(
<
ChooseCardList
...
...
@@ -346,34 +325,6 @@ class ProductModel extends Component {
cardCountName
=
{
SELECTED_QUQNTITY
}
cardStyleType
=
{
'DEFAULT'
}
/
>
// <View style={styles.top_box}>
// <ScrollView
// style={styles.top_scroll_cont}
// horizontal={true}
// showsHorizontalScrollIndicator={false}
// >
// {
// topProcOptionList.map((item, index) =>
// <TouchableOpacity
// activeOpacity={.8}
// style={styles.top_touch_cont}
// onPress={() => this.handleTopNav(item, index)}
// >
// <View style={[
// styles.top_inner,
// (index == 1 || index == 2) ? styles.se_thr_width : '',
// index == 3 ? styles.four_width : '',
// index == topActiveIndex ? styles.top_inner_act : ''
// ]}>
// <Text style={[styles.top_tit, index == topActiveIndex ? styles.top_tit_act : '']}>
// {item.title}
// </Text>
// </View>
// </TouchableOpacity>
// )
// }
// </ScrollView>
// </View>
)
}
...
...
@@ -388,18 +339,14 @@ class ProductModel extends Component {
// localBottomContData = curData.localBottomContData
// }
// let {modelOption} = this.props
let
curData
=
topProcOptionList
[
topActiveIndex
]
console
.
log
(
'已选展示信息 === curData---'
,
topProcOptionList
,
topActiveIndex
,
curData
)
//
console.log('已选展示信息 === curData---', topProcOptionList, topActiveIndex, curData)
let
localBottomContData
=
[]
if
(
curData
&&
curData
[
SELECTED_DATA_ARR
]){
localBottomContData
=
curData
[
SELECTED_DATA_ARR
]
}
console
.
log
(
'已选展示信息---'
,
curData
,
topActiveIndex
,
localBottomContData
)
// console.log('已选展示信息---',curData,topActiveIndex, localBottomContData)
return
(
<
View
style
=
{
styles
.
edit_cont
}
>
...
...
app/containers/common/listDataComponent/ChooseCardList.js
View file @
a6b86c18
...
...
@@ -41,8 +41,7 @@ class ChooseCardList extends Component {
cardStyleType
:
PropTypes
.
object
,
// 计数样式
cardCountArray
:
PropTypes
.
array
,
// 已选数组
// cardCountArray: PropTypes.array, // 已选数组
// cardListOptions: [
// {
...
...
@@ -79,25 +78,14 @@ class ChooseCardList extends Component {
render
()
{
let
{
cardScrollEnabled
,
cardHorizontal
,
cardShowsHorizontalScrollIndicator
,
cardShowsVerticalScrollIndicator
,
cardStyleBox
,
cardStyleScroll
,
cardListOptions
,
cardItemTitle
,
cardItemIcon
,
cardImgName
,
cardItemName
,
cardStyleListItem
,
cardStyleListItemAct
,
cardStyleItemIcon
,
cardStyleItemTit
,
cardStyleNotIconTit
,
cardStyleItemTitAct
,
cardCallBack
,
curActIndex
,
cardIsCount
,
cardCountName
,
cardStyleCount
,
cardStyleType
,
cardCountArray
,
...
props
}
=
this
.
props
let
{
countStyleType
,
countStyleName
}
=
this
.
state
// let count_style = ''
// if(countStyleType.includes(cardStyleType)){
// count_style = countStyleName[countStyleType.indexOf(cardStyleType)]
// }
cardStyleListItem
,
cardStyleListItemAct
,
cardStyleItemIcon
,
cardStyleItemTit
,
cardStyleNotIconTit
,
cardStyleItemTitAct
,
cardCallBack
,
curActIndex
,
cardIsCount
,
cardCountName
,
cardStyleCount
,
cardStyleType
,
...
props
}
=
this
.
props
let
{
countStyleType
}
=
this
.
state
let
localTestImageUrls
=
localMockData
.
localTestImageUrls
// 本地测试数据
cardListOptions
[
cardImgName
]
=
localTestImageUrls
// 本地测试
console
.
log
(
'cardStyleItemTit==='
,
cardStyleItemTit
)
// cardScrollEnabled 默认 true,是否可以滚动
// cardHorizontal=true 的时候,所有的子视图会在水平方向上排成一行,而不是默认的在垂直方向上排成一列
// showsHorizontalScrollIndicator 当此属性为 true 的时候,显示一个水平方向的滚动条
// showsVerticalScrollIndicator 当此属性为 true 的时候,显示一个垂直方向的滚动条
return
(
<
View
style
=
{[
styles
.
card_container
,
cardStyleBox
]}
>
...
...
@@ -128,11 +116,6 @@ class ChooseCardList extends Component {
{
(
item
[
cardCountName
]
&&
countStyleType
[
1
]
===
cardStyleType
)
?
<
View
style
=
{
styles
.
card_def_count
}
>
<
Text
style
=
{
styles
.
def_count_txt
}
>
{
item
[
cardCountName
]}
<
/Text
>
<
/View> : null
}
{
/* { (!!cardIsCount && item[cardCountArray].length) ? <View style={styles.card_def_count}>
<Text style={styles.def_count_txt}>{item[cardCountArray].length}</Text>
</View> : null} */
}
<
/View
>
)
}
...
...
app/containers/common/listDataComponent/PictureZoom.js
View file @
a6b86c18
...
...
@@ -66,15 +66,7 @@ class PictureZoom extends Component {
picOthStyle
=
picStyleArr
[
listPicTypeArr
.
indexOf
(
listPicType
)]
}
// console.log('listImageUrls----', typeof listImageUrls)
// if(typeof listImageUrls !== "array"){
// listImageUrls = [{url : listImageUrls}]
// listImageIndex = 0
// }
console
.
log
(
'listImageUrls----'
,
listImageUrls
,
typeof
listImageUrls
)
// console.log('图片放大----', listImageUrls, typeof listImageUrls)
return
(
<
View
style
=
{[
styles
.
container
]}
>
...
...
app/containers/selfOrder/module/ChooseProductPage.js
View file @
a6b86c18
This diff is collapsed.
Click to expand it.
app/containers/selfOrder/module/EditThirdLevelPage.js
View file @
a6b86c18
This diff is collapsed.
Click to expand it.
app/containers/selfOrder/module/ProductRightStyle.js
View file @
a6b86c18
...
...
@@ -92,17 +92,27 @@ class ProductRightStyle extends Component {
// this.handleRIghtStencil()
}
handleRIghtStencil
()
{
//
handleRIghtStencil() {
// console.warn(`选中了${JSON.stringify(this.state.selectItem)}`)
}
//
}
// 右侧标题点击事件
TitleClickEvent
(
item
,
index
)
{
let
{
superIndex
}
=
this
.
props
let
{
superIndex
}
=
this
.
props
let
{
rightSecondData
}
=
this
.
state
console
.
log
(
'右侧标题点击事件 '
,
superIndex
,
index
,
item
,
rightSecondData
[
index
])
console
.
warn
(
'右侧标题点击事件 '
,
superIndex
,
index
,
item
)
if
(
superIndex
>=
0
&&
superIndex
<
4
)
{
this
.
props
.
navigation
.
navigate
(
'EditThirdLevelPage'
,
{
title
:
'选择产品 - 编辑模板'
})
this
.
props
.
navigation
.
navigate
(
'EditThirdLevelPage'
,
{
title
:
'选择产品 - 编辑模板'
,
superData
:{
superItem
:
item
,
superIndex
:
index
},
childrenPageCallBack
:
this
.
childrenPageCallBack
.
bind
(
this
)
// 传递函数,编辑完成时调用
})
}
else
{
this
.
changeThrShow
(
true
,
item
.
title
)
}
...
...
@@ -110,8 +120,41 @@ class ProductRightStyle extends Component {
// this.handleIsShowDialog() // -- 之前版本
// }
}
// 编辑页面的回调
childrenPageCallBack
(
childData
,
index
)
{
let
{
rightSecondData
}
=
this
.
state
// 本地测试
let
childDataName
=
'childrenLineData'
let
curCalField
=
'quantity'
let
that
=
this
rightSecondData
.
forEach
(
function
(
rsdItem
,
rsdIndex
)
{
if
(
!
rsdItem
[
childDataName
])
{
rsdItem
[
childDataName
]
=
[]
}
if
(
!
rsdItem
[
curCalField
])
{
rsdItem
[
curCalField
]
=
0
}
if
(
rsdIndex
===
index
)
{
rsdItem
[
childDataName
]
=
childData
rsdItem
[
curCalField
]
=
Number
(
rsdItem
[
curCalField
])
+
1
console
.
log
(
'回调后的rsdItem===='
,
rsdItem
)
that
.
handleCalCallBack
(
rsdItem
,
rsdIndex
,
'rightSecondData'
,
curCalField
)
}
})
console
.
log
(
'回调后的数组===='
,
rightSecondData
)
this
.
setState
({
rightSecondData
})
}
// // 关闭当前弹窗
// handleCloseModal(show) {
...
...
@@ -183,6 +226,9 @@ class ProductRightStyle extends Component {
// 修改列表计算后数据 - 头/行
handleCalCallBack
(
item
,
index
,
dataName
,
coutFieName
){
console
.
log
(
'修改列表计=='
,
item
,
index
,
dataName
,
coutFieName
)
if
(
dataName
&&
this
.
state
[
dataName
])
{
let
curDataName
=
this
.
state
[
dataName
]
curDataName
[
index
]
=
item
...
...
@@ -192,17 +238,15 @@ class ProductRightStyle extends Component {
console
.
log
(
'计算==头/行==='
,
index
,
dataName
,
curDataName
)
if
(
coutFieName
)
{
let
temp
Count
=
0
let
sum
Count
=
0
curDataName
.
map
(
item
=>
{
if
(
item
[
coutFieName
]){
temp
Count
+=
Number
(
item
[
coutFieName
])
sum
Count
+=
Number
(
item
[
coutFieName
])
}
})
console
.
log
(
'计算==数量汇总=字段='
,
coutFieName
,
temp
Count
)
this
.
props
.
superCallBack
(
temp
Count
,
coutFieName
)
console
.
log
(
'计算==数量汇总=字段='
,
coutFieName
,
sum
Count
)
this
.
props
.
superCallBack
(
sum
Count
,
coutFieName
)
}
}
}
...
...
app/containers/selfOrder/module/mock/sen_mock.js
View file @
a6b86c18
...
...
@@ -350,46 +350,38 @@ const localLeftOption = [
]
// 三级编辑数据 - 底部
const
localThridContData
=
[
// 底部产品内容
// 三级编辑数据 - 底部
耗材
const
localThridContData
_1
=
[
{
"id"
:
"0"
,
title
:
'
规格:JS-CGO PE 10
'
,
title
:
'
耗材11111
'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
20
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
quantity
:
2
},
{
"id"
:
"1"
,
title
:
'规格:JS-CGO PE 10 11'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
quantity
:
1
},
{
"id"
:
"2"
,
title
:
'规格:JS-CGO PE 10 22'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
quantity
:
1
},
{
"id"
:
"3"
,
title
:
'规格:JS-CGO PE 10 33'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
},
{
...
...
@@ -397,9 +389,7 @@ const localThridContData = [ // 底部产品内容
title
:
'规格:JS-CGO PE 10 44'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
},
{
...
...
@@ -407,9 +397,7 @@ const localThridContData = [ // 底部产品内容
title
:
'规格:JS-CGO PE 10 55'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
},
{
...
...
@@ -417,9 +405,7 @@ const localThridContData = [ // 底部产品内容
title
:
'规格:JS-CGO PE 10 55'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
},
{
...
...
@@ -427,9 +413,7 @@ const localThridContData = [ // 底部产品内容
title
:
'规格:JS-CGO PE 10 55'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
},
{
...
...
@@ -437,38 +421,120 @@ const localThridContData = [ // 底部产品内容
title
:
'规格:JS-CGO PE 10 888'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
select
:
false
,
quantity
:
0
}
]
// 钉盒
const
localThridContData_2
=
[
{
"id"
:
"0"
,
title
:
'钉盒11111'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
1
},
{
"id"
:
"1"
,
title
:
'规格:JS-CGO PE 10 11'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
0
},
{
"id"
:
"2"
,
title
:
'规格:JS-CGO PE 10 22'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
0
}
]
// 器械包
const
localThridContData_3
=
[
{
"id"
:
"0"
,
title
:
'器械包11111'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
0
},
{
"id"
:
"1"
,
title
:
'规格:JS-CGO PE 10 11'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
2
},
{
"id"
:
"2"
,
title
:
'规格:JS-CGO PE 10 22'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
0
}
]
// 零散器械
const
localThridContData_4
=
[
{
"id"
:
"0"
,
title
:
'零散器械1111'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
0
},
{
"id"
:
"1"
,
title
:
'规格:JS-CGO PE 10 11'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
3
},
{
"id"
:
"2"
,
title
:
'规格:JS-CGO PE 10 22'
,
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
quantity
:
0
}
]
// 三级编辑数据 - 顶部
cons
t
localThridOption
=
[
le
t
localThridOption
=
[
{
title
:
'耗材'
,
iconImg
:
localTestImageUrls
,
localThridContData
localThridContData
:
localThridContData_1
},
{
title
:
'钉盒'
,
iconImg
:
localTestImageUrls
,
localThridContData
localThridContData
:
localThridContData_2
},
{
title
:
'器械包'
,
iconImg
:
localTestImageUrls
,
localThridContData
localThridContData
:
localThridContData_3
},
{
title
:
'零散器械'
,
iconImg
:
localTestImageUrls
,
localThridContData
localThridContData
:
localThridContData_4
}
]
// 已选数据 - 底部按钮
// 已选数据 - 底部按钮
测试
const
localBottomOption
=
[
{
title
:
'模板'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment