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
675f3776
authored
Dec 10, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善自助下单功能
(cherry picked from commit
0d182f54
)
parent
dab70cd1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
135 deletions
android/app/src/main/res/drawable-mdpi/app_images_rubbish.png
app/containers/common/ProductModel.js
app/containers/common/listDataComponent/PicTitDetaiCalcu.js
app/containers/selfOrder/module/ChooseProductPage.js
app/containers/selfOrder/module/EditThirdLevelPage.js
app/containers/selfOrder/module/ProductRightStyle.js
android/app/src/main/res/drawable-mdpi/app_images_rubbish.png
0 → 100644
View file @
675f3776
925 Bytes
app/containers/common/ProductModel.js
View file @
675f3776
...
...
@@ -54,82 +54,9 @@ class ProductModel extends Component {
this
.
state
=
{
isVisible
:
this
.
props
.
show
,
topProcOptionList
:
[],
// [
// {
// title: '编辑产品'
// },
// {
// title: '螺钉盒'
// },
// {
// title: '器械包'
// },
// {
// title: '工具'
// }
// ],
topActiveIndex
:
0
,
// allCountQuantity: 0,
// SELECTED_QUQNTITY: 'selectedQuantity', // 中类数量
// SELECTED_DATA_ARR: 'selectedDataArr', // 中类已选元素
// contOptionData: [ // 底部产品内容
// {
// "id": "0",
// title: '规格:JS-CGO PE 10',
// tip1: '型号:10',
// tip2: '物料代码:JUST00000104',
// value: 20,
// imgIcon: require('../../images/model_test.png'),
// select: false
// },
// {
// "id": "1",
// title: '规格:JS-CGO PE 10 11',
// tip1: '型号:10',
// tip2: '物料代码:JUST00000104',
// value: 0,
// imgIcon: require('../../images/model_test.png'),
// select: false
// },
// {
// "id": "2",
// title: '规格:JS-CGO PE 10 22',
// tip1: '型号:10',
// tip2: '物料代码:JUST00000104',
// value: 0,
// imgIcon: require('../../images/model_test.png'),
// select: false
// },
// {
// "id": "3",
// title: '规格:JS-CGO PE 10 33',
// tip1: '型号:10',
// tip2: '物料代码:JUST00000104',
// value: 0,
// imgIcon: require('../../images/model_test.png'),
// select: false
// },
// {
// "id": "4",
// title: '规格:JS-CGO PE 10 44',
// tip1: '型号:10',
// tip2: '物料代码:JUST00000104',
// value: 0,
// imgIcon: require('../../images/model_test.png'),
// select: false
// },
// {
// "id": "5",
// title: '规格:JS-CGO PE 10 55',
// tip1: '型号:10',
// tip2: '物料代码:JUST00000104',
// value: 0,
// imgIcon: require('../../images/model_test.png'),
// select: false
// }
// ]
}
}
...
...
@@ -172,25 +99,6 @@ class ProductModel extends Component {
this
.
props
.
closeModal
(
false
);
}
/**
* 点击当前产品加减
* @param {object} item 当前小类数据
* @param {number} index 当前角标
* @param {boolean} isPlus 默认减法 false,加法 true,
*/
handelCalculationList
(
item
,
index
,
isPlus
)
{
// let { contOptionData } = this.state
// let { value } = contOptionData[index]
// if(isPlus) {
// contOptionData[index].value += 1
// } else if(!isPlus && value > 0) {
// contOptionData[index].value -= 1
// }
// this.setState({
// contOptionData
// })
}
// 修改列表计算后数据
handleCalCallBack
(
item
,
index
,
dataName
){
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
...
...
@@ -346,7 +254,7 @@ class ProductModel extends Component {
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/PicTitDetaiCalcu.js
View file @
675f3776
...
...
@@ -24,7 +24,8 @@ class PicTitDetaiCalcu extends Component {
tipTextTwo
:
PropTypes
.
string
,
tipTextTwoTit
:
PropTypes
.
string
,
listImgIcon
:
PropTypes
.
string
,
listStyleImg
:
PropTypes
.
objec
listStyleImg
:
PropTypes
.
objec
,
plusCallBack
:
PropTypes
.
func
,
// 加法的回调函数
}
constructor
(
props
)
{
...
...
@@ -42,9 +43,13 @@ class PicTitDetaiCalcu extends Component {
* @param {boolean} isPlus 默认减法 false,加法 true,
*/
handelCalculation
(
item
,
index
,
isPlus
)
{
// let { thridOptionData } = this.state
// let { value } = thridOptionData[index]
let
{
calField
}
=
this
.
props
let
{
calField
,
plusCallBack
}
=
this
.
props
if
(
isPlus
&&
plusCallBack
){
console
.
log
(
'加法回调======'
,
item
,
index
)
plusCallBack
(
item
,
index
)
return
}
console
.
log
(
'加法======'
)
item
[
calField
]
=
Number
(
item
[
calField
])
if
(
Number
.
isNaN
(
item
[
calField
])){
item
[
calField
]
=
0
...
...
@@ -138,10 +143,6 @@ const styles = StyleSheet.create({
color
:
third_text_color
,
fontFamily
:
font_family_regular
},
// ri_img_box: {
// width: 18,
// height: 18
// },
oth_box
:
{
paddingBottom
:
2
},
...
...
@@ -191,8 +192,6 @@ const styles = StyleSheet.create({
fontSize
:
14
,
color
:
first_text_color
},
})
export
default
PicTitDetaiCalcu
;
\ No newline at end of file
app/containers/selfOrder/module/ChooseProductPage.js
View file @
675f3776
...
...
@@ -106,6 +106,7 @@ class ChooseProductPage extends Component {
let
{
leftActiveIndex
,
leftOptionList
,
defaultThridShow
,
rightSecondData
}
=
this
.
state
// console.log('计算中级数量===', count, leftActiveIndex, defaultThridShow, rightSecondData, coutFieName)
leftOptionList
[
leftActiveIndex
][
SELECTED_QUQNTITY
]
=
0
leftOptionList
[
leftActiveIndex
][
SELECTED_DATA_ARR
]
=
[]
leftOptionList
.
map
(
function
(
leItem
,
leIndex
)
{
...
...
app/containers/selfOrder/module/EditThirdLevelPage.js
View file @
675f3776
...
...
@@ -33,8 +33,13 @@ import StatusBarView from '../../common/StatusBarView';
import
ChooseCardList
from
'../../common/listDataComponent/ChooseCardList'
;
import
PicTitDetaiCalcu
from
'../../common/listDataComponent/PicTitDetaiCalcu'
;
import
PictureZoom
from
'../../common/listDataComponent/PictureZoom'
;
import
localMockData
from
'./mock/sen_mock'
;
import
{
cloneObject
}
from
'../../../utils/Utils'
;
import
localMockData
from
'./mock/sen_mock'
;
const
SELECTED_QUQNTITY
=
'selectedQuantity'
// 三级数量
const
SELECTED_DATA_ARR
=
'selectedDataArr'
// 三级已选元素
const
DEFAULT_SECOND_DATA
=
'localThridContData'
// 三级原本元素
const
DEFAULT_FIELD
=
'quantity'
// 计算的字段
class
EditThirdLevelPage
extends
Component
{
...
...
@@ -48,31 +53,60 @@ class EditThirdLevelPage extends Component {
componentDidMount
()
{
let
{
params
}
=
this
.
props
.
navigation
.
state
let
that
=
this
console
.
log
(
'本地测试数据====localMockData==='
,
localMockData
)
console
.
log
(
'本地测试数据====localMockData==='
,
localMockData
.
localThridOption
[
0
]
.
localThridContData
[
0
])
console
.
log
(
'本地测试数据====localMockData==='
,
localMockData
.
localThridOption
[
0
]
[
DEFAULT_SECOND_DATA
]
[
0
])
console
.
log
(
'父组件传递的值=='
,
params
)
// 赋值测试数据
this
.
setState
({
topProcOptionList
:
cloneObject
(
localMockData
.
localThridOption
)
},
()
=>
{
that
.
setAllSelectData
()
})
}
// 修改列表计算后数据
handleCalCallBack
(
item
,
index
,
dataName
){
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
that
=
this
// console.log('修改列表计算后数据',item, index, dataName)
if
(
dataName
&&
topProcOptionList
[
topActiveIndex
][
dataName
])
{
topProcOptionList
.
map
(
function
(
listItem
,
listIndex
)
{
if
(
listIndex
===
topActiveIndex
){
listItem
[
dataName
][
index
]
=
item
}
})
th
is
.
setState
({
th
at
.
setState
({
topProcOptionList
},()
=>
{
that
.
setAllSelectData
()
})
}
}
// 设置当前所有已选值
setAllSelectData
()
{
let
{
topProcOptionList
}
=
this
.
state
topProcOptionList
.
map
(
function
(
listItem
)
{
listItem
[
SELECTED_QUQNTITY
]
=
0
listItem
[
SELECTED_DATA_ARR
]
=
[]
if
(
listItem
[
DEFAULT_SECOND_DATA
].
length
){
listItem
[
DEFAULT_SECOND_DATA
].
forEach
(
function
(
chItem
)
{
if
(
chItem
[
DEFAULT_FIELD
]){
listItem
[
SELECTED_QUQNTITY
]
+=
Number
(
chItem
[
DEFAULT_FIELD
])
listItem
[
SELECTED_DATA_ARR
].
push
(
chItem
)
}
})
}
})
// console.log('设置当前所有已选值---', topProcOptionList)
this
.
setState
({
topProcOptionList
})
}
// 点击顶部菜单
handleTopNav
(
item
,
index
)
{
// console.log('item, index----', item, index)
...
...
@@ -88,7 +122,7 @@ class EditThirdLevelPage extends Component {
console
.
log
(
'编辑完成====>'
,
topProcOptionList
,
params
.
superData
.
superIndex
)
console
.
log
(
topProcOptionList
[
0
]
.
localThridContData
[
0
])
console
.
log
(
topProcOptionList
[
0
]
[
DEFAULT_SECOND_DATA
]
[
0
])
params
.
childrenPageCallBack
(
topProcOptionList
,
params
.
superData
.
superIndex
)
this
.
props
.
navigation
.
goBack
()
...
...
@@ -112,6 +146,8 @@ class EditThirdLevelPage extends Component {
cardItemTitle
=
{
'title'
}
curActIndex
=
{
topActiveIndex
}
cardCallBack
=
{(
item
,
index
)
=>
this
.
handleTopNav
(
item
,
index
)}
cardCountName
=
{
SELECTED_QUQNTITY
}
cardStyleType
=
{
'DEFAULT'
}
/
>
)
}
...
...
@@ -125,8 +161,8 @@ class EditThirdLevelPage extends Component {
let
localThridContData
=
[]
let
iconImg
=
''
if
(
curData
&&
curData
.
localThridContData
)
{
localThridContData
=
curData
.
localThridContData
if
(
curData
&&
curData
[
DEFAULT_SECOND_DATA
]
)
{
localThridContData
=
curData
[
DEFAULT_SECOND_DATA
]
}
if
(
curData
&&
curData
.
iconImg
){
iconImg
=
curData
.
iconImg
...
...
@@ -166,7 +202,7 @@ class EditThirdLevelPage extends Component {
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
'quantity'
}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
'localThridContData'
)}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
DEFAULT_SECOND_DATA
)}
titText
=
{
'title'
}
tipTextStr
=
{
'tip1'
}
tipTextOne
=
{
'tip2'
}
...
...
@@ -334,7 +370,7 @@ const styles = StyleSheet.create({
btom_btn_box
:
{
backgroundColor
:
foundation_color
,
paddingTop
:
14
,
shadowColor
:
btn_sub_color
,
shadowColor
:
'rgba(0, 0, 0, 0.12)'
,
shadowOffset
:
{
width
:
1
,
height
:
2
...
...
app/containers/selfOrder/module/ProductRightStyle.js
View file @
675f3776
...
...
@@ -22,9 +22,9 @@ import {
font_family_regular
,
icon_style
}
from
'../../../base/BaseStyle'
;
import
ShowModel
from
'../../common/ShowModel'
;
import
PicTitDetaiCalcu
from
'../../common/listDataComponent/PicTitDetaiCalcu'
;
import
PictureZoom
from
'../../common/listDataComponent/PictureZoom'
;
import
{
cloneObject
}
from
'../../../utils/Utils'
;
const
PropTypes
=
require
(
'prop-types'
);
import
localMockData
from
'./mock/sen_mock'
;
...
...
@@ -55,7 +55,7 @@ class ProductRightStyle extends Component {
// 赋值测试数据
this
.
setState
({
singleHeadData
:
localMockData
.
localSingleSeleHead
,
rowSingleData
:
localMockData
.
localSingleRowData
rowSingleData
:
cloneObject
(
localMockData
.
localSingleRowData
)
})
}
...
...
@@ -114,6 +114,8 @@ class ProductRightStyle extends Component {
// 传递函数,编辑完成时调用
})
}
else
{
// 单选耗材中级标题点击之后
this
.
changeThrShow
(
true
,
item
.
title
)
}
// else if ( superIndex > 0 && superIndex < 4) {
...
...
@@ -183,25 +185,6 @@ class ProductRightStyle extends Component {
// this.props.changeThrShow(show) ============????
}
/**
* 点击当前小类加减
* @param {object} item 当前小类数据
* @param {number} index 当前角标
* @param {boolean} isPlus 默认减法 false,加法 true,
*/
// handleCalculationThr(item, index, isPlus) {
// let { rowSingleData } = this.state
// let { value } = rowSingleData[index]
// if(isPlus) {
// rowSingleData[index].value += 1
// } else if(!isPlus && value > 0) {
// rowSingleData[index].value -= 1
// }
// this.setState({
// rowSingleData
// })
// }
// 单选耗材 - 头数据
handleHeadCalCallBack
(
item
,
index
)
{
let
{
singleHeadData
}
=
this
.
state
...
...
@@ -267,6 +250,7 @@ class ProductRightStyle extends Component {
tipTextTwo
=
{
'tip2'
}
listImgIcon
=
{
'imgIcon'
}
listPicType
=
{
'SQUARE'
}
plusCallBack
=
{(
item
,
index
)
=>
this
.
TitleClickEvent
(
item
,
index
)}
/
>
<
/SafeAreaView
>
)
...
...
@@ -296,7 +280,6 @@ class ProductRightStyle extends Component {
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
curCalField
}
// subCalCallBack={(item,index) => this.handleRowCalCallBack(item,index)}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
'rowSingleData'
)}
titText
=
{
'title'
}
tipTextOne
=
{
'tip1'
}
...
...
@@ -331,11 +314,11 @@ class ProductRightStyle extends Component {
listIndex
=
{
index
}
calField
=
{
curCalField
}
listPicType
=
{
'ROUND'
}
// subCalCallBack={(item,index) => this.handleHeadCalCallBack(item,index)}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
'singleHeadData'
,
curCalField
)}
titCallBack
=
{(
item
,
index
)
=>
this
.
TitleClickEvent
(
item
,
index
)}
titText
=
{
'title'
}
listImgIcon
=
{
'imgIcon'
}
plusCallBack
=
{(
item
,
index
)
=>
this
.
TitleClickEvent
(
item
,
index
)}
/
>
<
/SafeAreaView
>
)
...
...
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