Commit 7a33255d by Denglingling

调整自助下单,已经缓存图片

parent 7f71a364
......@@ -758,7 +758,7 @@ class ProductModel extends Component {
})
}
// console.log('底部🉐️=====', localBottomContData)
console.log('底部🉐️=====', localBottomContData)
// localBottomContData = [{
// supplier_short_name: "嘉思特华剑医疗器材(天津)有限公司", // 测试
// supplier_code: "SU00000369", // 测试
......@@ -795,24 +795,54 @@ class ProductModel extends Component {
renderContColumnItem(item, index) {
let { topActiveIndex, leftActiveIndex } = this.state
let { global_domain_config } = this.props
let curTit = '', curTipOne = '', curTipTwo = '', curTipOneTit = '', curTipTwoTit = '', curIcon = ''
let curTit = '', curTipStr = '', curTipOne = '', curTipTwo = '', curTxtTit = '', curTipStrTit = '', curTipOneTit = '', curTipTwoTit = '', curImgIcon = ''
let curListMaxNum = ''
if (topActiveIndex === 0) {
curTit = 'superTit'
curTipOne = 'superTip'
} else if (topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3) {
curTxtTit='套包名'
curTipOneTit = '详情'
} else if(topActiveIndex === 1){
curTit = 'item_name'
curTipStr = 'general_name'
curTipOne = 'specification'
curTipTwo = 'item_code'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
curTipOneTit = '规格型号'
curTipTwoTit = '物料代码'
curIcon = 'photos'
if (topActiveIndex === 2) {
curListMaxNum = 1
}
} else {
curImgIcon = 'photos'
} else if(topActiveIndex === 2){
curTit = 'item_name'
curTipStr = 'general_name'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
curListMaxNum = 1
} else if(topActiveIndex === 3){
curTit = 'manufacturer_product_code'
curTipStr = 'item_name'
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
}
// else if (topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3) {
// curTit = 'item_name'
// curTipOne = 'specification'
// curTipTwo = 'item_code'
// curTxtTit='物料名称'
// curTipOneTit = '规格型号'
// curTipTwoTit = '物料代码'
// curImgIcon = 'photos'
// if (topActiveIndex === 2) {
// curListMaxNum = 1
// }
// }
else {
curTit = LocalVariable.SUPER_TITLE_NAME
curTipOne = LocalVariable.SUPER_TITLE_TIP
curTxtTit='耗材名'
curTipOneTit = '详情'
}
// let cur_supplier_icon = ["files/20201224/截屏2020-12-24 上午11.11.20_1608779494102.11.20.png"]
......@@ -834,6 +864,8 @@ class ProductModel extends Component {
}
}
console.log('哈👌===', bttom_options)
return (
<TouchableOpacity
......@@ -869,8 +901,11 @@ class ProductModel extends Component {
calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(ch_item, ch_index) => this.handleCalCallBack(ch_item, ch_index, index)}
titText={curTit}
tipTextStr={curTipStr}
tipTextOne={curTipOne}
tipTextTwo={curTipTwo}
titTextTit={curTxtTit}
tipTextStrTit={curTipStrTit}
tipTextOneTit={curTipOneTit}
tipTextTwoTit={curTipTwoTit}
listPicType={'SQUARE'}
......
......@@ -123,6 +123,11 @@ class PicTitDetaiCalcu extends Component {
cur_photos[0] = { url: global_domain_config + '/jeecg-boot/sys/common/view/' + listItem[listImgIcon] }
}
// console.log('cur_photos--', cur_photos)
console.log('cur_photos--', tipTextOneTit)
console.log('cur_photos--', listItem)
console.log('cur_photos--', tipTextOne)
return (
<View style={[styles.ri_inner, listStyleBox]}>
{(listImgIcon && cur_photos.length > 0) ?
......@@ -244,18 +249,29 @@ const styles = StyleSheet.create({
},
te_ot_str: {
fontFamily: font_family_semibold,
color: '#0CB4E8',
// color: '#0CB4E8',
// color: '#02a5ab'
// color: 'rgba(58, 58, 58, 100)'
color: text_default_color
// color: text_default_color
// color: text_return_color
},
te_ot_one:{
color: first_text_color
color: '#1B40B5',
// color: '#003BF5',
// color: text_return_color
// color: first_text_color
},
te_ot_two:{
color: first_text_color
color: '#1B40B5',
// color: '#3B4C82',
// color: '#0080FF',
// color: text_return_color
},
te_ot_thr:{
color: first_text_color
color: '#3B4C82',
// color: '#0CB4E8',
// color: text_return_color
},
oth_img_box: {
width: pxSize(58),
......
......@@ -21,7 +21,74 @@ class PictureZoom extends Component {
this.state = {
picZoomIsShow: false,
listPicTypeArr: ['ROUND', 'SQUARE', 'RECTANGLE'],
picStyleArr: ['round_pic', 'square_pic', 'rectan_pic']
picStyleArr: ['round_pic', 'square_pic', 'rectan_pic'],
curImgFail: false,
curImgUrl: ''
}
}
componentDidMount() {
// console.log('进====')
let { listImageUrls, listImageIndex } = this.props
let { curImgUrl, curImgFail } = this.state
let that = this
if (!listImageUrls[listImageIndex].url) {
that.setState({
curImgUrl: require('../../../images/not_img.png'),
curImgFail: false
})
} else {
that.setState({
curImgUrl: { uri: listImageUrls[listImageIndex].url },
curImgFail: true
}, () => {
// console.log('curImgUrl---', curImgUrl)
// console.log('curImgUrl---', listImageUrls[listImageIndex].url )
// console.log('curImgUrl---', that.state.curImgUrl )
Image.prefetch(that.state.curImgUrl.uri).then((result) => {
// console.log('缓存图片:',result)
}).catch((error) => {
console.log('缓存图片--err:', error)
that.setState({
curImgUrl: require('../../../images/not_img.png'),
curImgFail: false
})
})
})
}
}
componentWillReceiveProps(nextProps){
console.log('改变', nextProps)
// let { listImageUrls, listImageIndex } = this.nextProps
let { listImageUrls, listImageIndex } = this.props
let { curImgUrl, curImgFail } = this.state
let that = this
// console.log('改变', listImageUrls)
if(nextProps.listImageUrls){
if (!nextProps.listImageUrls[listImageIndex].url) {
that.setState({
curImgUrl: require('../../../images/not_img.png'),
curImgFail: false
})
} else {
that.setState({
curImgUrl: { uri: nextProps.listImageUrls[listImageIndex].url },
curImgFail: true
}, () => {
// console.log('curImgUrl---', curImgUrl)
// console.log('curImgUrl---', nextProps.listImageUrls[listImageIndex].url )
// console.log('curImgUrl---', that.state.curImgUrl )
Image.prefetch(that.state.curImgUrl.uri).then((result) => {
// console.log('缓存图片:',result)
}).catch((error) => {
that.setState({
curImgUrl: require('../../../images/not_img.png'),
curImgFail: false
})
})
})
}
}
}
......@@ -60,34 +127,87 @@ class PictureZoom extends Component {
render() {
let { listImageUrls, listImageIndex, listStyleImage, listPicType } = this.props
let { picZoomIsShow, listPicTypeArr, picStyleArr } = this.state
let { picZoomIsShow, listPicTypeArr, picStyleArr, curImgFail, curImgUrl } = this.state
let picOthStyle = ''
let that = this
if (listPicTypeArr.indexOf(listPicType) > -1) {
picOthStyle = picStyleArr[listPicTypeArr.indexOf(listPicType)]
}
let canShow = true
let cur_defalut = { uri: listImageUrls[listImageIndex].url }
if (!listImageUrls[listImageIndex].url) {
cur_defalut = require('../../../images/not_img.png')
canShow = false
}
// curImgUrl = { uri: listImageUrls[listImageIndex].url }
// if (!listImageUrls[listImageIndex].url) {
// // curImgUrl = require('../../../images/not_img.png')
// // curImgFail = false
// that.setState({
// curImgUrl: require('../../../images/not_img.png'),
// curImgFail: false
// })
// }
// if(curImgUrl.uri){
// Image.prefetch(curImgUrl.uri).then((result) => {
// console.log('lw---lh:',result)
// console.log('curImgUrl==:',curImgUrl)
// }).catch((error) => {
// console.log('lw---lh--err:',error)
// // curImgUrl = require('../../../images/not_img.png')
// // curImgFail = false
// that.setState({
// curImgUrl: require('../../../images/not_img.png'),
// curImgFail: false
// }, () => {
// console.log('curImgUrl==:',curImgUrl, curImgFail)
// })
// })
// }
// let canShow = true
// let cur_defalut = { uri: listImageUrls[listImageIndex].url }
// if (!listImageUrls[listImageIndex].url) {
// cur_defalut = require('../../../images/not_img.png')
// canShow = false
// }
// if(cur_defalut.uri){
// Image.prefetch(cur_defalut.uri).then((result) => {
// console.log('lw---lh:',result)
// console.log('cur_defalut==:',cur_defalut)
// }).catch((error) => {
// console.log('lw---lh--err:',error)
// cur_defalut = require('../../../images/not_img.png')
// canShow = false
// console.log('cur_defalut==:',cur_defalut, canShow)
// })
// // Image.getSize(cur_defalut.uri, (width, height) => {
// // console.log('lw---lh:',width, height)
// // },err => {
// // console.log('lw---lh--!!==err:',err)
// // cur_defalut = require('../../../images/not_img.png')
// // canShow = false
// // })
// }
return (
<View style={[styles.container]}>
<TouchableOpacity
activeOpacity={.8}
activeOpacity={curImgUrl.uri ? .8 : 1}
style={[styles.list_item_img, styles[picOthStyle], listStyleImage]}
onPress={() => this.handleShowZoomPic(true)}
onPress={curImgUrl.uri ? () => this.handleShowZoomPic(true) : null}
>
<Image
defaultSource={require('../../../images/not_img.png')}
// source={{uri: listImageUrls[listImageIndex].url}}
source={cur_defalut}
source={curImgUrl}
style={icon_style}
resizeMode="cover" />
resizeMode="cover"
defaultSource={require('../../../images/not_img.png')} />
</TouchableOpacity>
{
canShow ?
curImgFail ?
<Modal
visible={picZoomIsShow}
animationType={"slide"}
......
......@@ -487,9 +487,9 @@ class SelfOrderPage extends Component {
if (itemTitle === '组织') {
that.clearInitNameAndValue(1)
}
if (itemTitle === '客户名称') {
that.clearInitNameAndValue(2)
}
// if (itemTitle === '客户名称') {
// that.clearInitNameAndValue(2)
// }
if (itemTitle === '主治医生') {
if (item.name === '其他') {
chItem.showInput = true
......
......@@ -223,7 +223,8 @@ class ChooseProductPage extends Component {
}
} else if (leftIndex === 3) {
let params = {
access_token: token
access_token: token,
manufacturer_code: topItem.supplier_code
}
console.log('params=', params)
let scat_head_search = await reqScatEquipmentSearch(global_domain_config, params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment