render () {
const { errorStatus, tabFlag,flag, searchKey } = this.state;
const { productList, isLoading, totalSize_prod, fillingList } = learnStore;
return (
<View className="main">
{}
<view className="searchTitle">
<View className="search_top">
<View className="mainSearch" >
<View className="search_v" >
<Image className="searchIconInput" src={ImageKeys.icon_search} />
{flag == '1' ?
<Input value={searchKey}
className="input" placeholder='产品名称' type="search" onInput={(e) => this.onInput(e)} onConfirm={this.onSearchConfirm.bind(this)}></Input>
:
<Input value={searchKey}
className="input" placeholder='产品名称' type="search" onInput={(e) => this.onInput(e)} onConfirm={this.onSearchConfirm.bind(this)}></Input>
}
</View>
</View>
</View>
</view>
{}
<ScrollView className="scroll" >
{
productList && productList.length != 0 ? productList.map((item, index) => {
return <NotStartedList
item={item}
flag={item.flag}
preprocessflg={item.preprocessflg}
onClick={this.clickDepartList.bind(this, index)}/>
}) : <EmptyView isLoading={isLoading} />
}
</ScrollView>
<view className="empty" style="margin-top: 25%;"></view>
{}
<view className="tabar">
<view className="blue" onClick={this.onClickItem.bind(this)}>
<view className="sure" >确定</view>
</view>
</view>
</View>
)
}
clickDepartList (index) {
const { productList } = learnStore
let lable = false;
for (let i = 0; i < productList.length; i++) {
let lableFlag = productList[i].flag;
if (lableFlag == '2') {
if (i == index) {
productList[i].flag = '1'
lable = true;
this.setState({
flag: '1',
})
}
}
}
if (lable) {
return;
} else {
for (let i = 0; i < productList.length; i++) {
productList[i].flag = '1'
}
let checked = productList[index].flag;
if (checked == '1') {
productList[index].flag = '2'
this.setState({
flag: '2',
searchDepart: productList[index].labelCode,
})
} else {
productList[index].flag = '1'
this.setState({
flag: '1',
})
}
}
}
import React, { Component, } from 'react'
import { View, Image, Text, Input, } from '@tarojs/components'
import { observer, inject } from 'mobx-react'
import Taro from "@tarojs/taro";
import styles from './index.module.scss'
import { ImageKeys } from '../../../../assets';
const NotStartedList = (props) => {
const { item,preprocessflg='0',onClick,flag="1" } = props;
return <View className={styles.main} onClick={onClick} >
<view className={styles.one}>
{flag=="1"?
<Image className={styles.notselectPic} src={ImageKeys. icon_noSelectRedio} />
:
<Image className={styles.notselectPic} src={ImageKeys. icon_selectRedio} />
}
<Text className={styles.title} >{item.terminalno}</Text>
</view>
<View className={styles.line} />
</View>
}
export default React.memo(NotStartedList)