Commit f6402e8d by leiyongsheng

修正js showToast名称

parent 300f4e99
android @ 1587df5e
Subproject commit f03772da2d458c0a8286de448f7efd24ebfd3b75
Subproject commit 1587df5e459ddf3c7241bad88cd66613a4347939
ios @ 068d46e2
Subproject commit c3eceda86cf291fd0cf217b0d7c27a8a75a66b15
Subproject commit 068d46e210861b0b45160b9696df3031527cd46d
......@@ -9,7 +9,7 @@ import { TextInput, Text, TouchableHighlight, View, NativeModules, StatusBar, Pl
import { user as userServices } from '../../services';
import styles from './style';
const { BMCInfo: { getUserInfo }, BMCUI, BMCAction: { exit } } = NativeModules;
const { BMCInfo: { getUserInfo }, BMCUI, BMCAction: { exit, setNiceName } } = NativeModules;
const Equipment = () => {
const [nickname, setNickName] = useState('');
......@@ -26,10 +26,11 @@ const Equipment = () => {
const handleSave = async () => {
if (/^[a-zA-Z|0123456789|_\\-|\u4e00-\u9fa5]+$/.test(nickname)) {
const data = await userServices.setNickName({ nickname });
BMCUI.show('修改昵称成功!');
setNiceName(nickname)
BMCUI.showToast('修改昵称成功!');
exit();
} else {
BMCUI.show('请输入1-20个字符作为昵称');
BMCUI.showToast('请输入1-20个字符作为昵称');
}
};
......
......@@ -22,7 +22,7 @@ const Equipment = () => {
const data = await equimentServices.getArticleList();
setEquimentList(data[0].devices || []);
} catch (e) {
BMCUI.show('e');
BMCUI.showToast('e');
}
};
return (
......
......@@ -22,7 +22,7 @@ async function choosePic(openCamera, selectPic, callback) {
} = await ImagePicker.choosePic(openCamera, selectPic);
console.log("path:" + path + " / paths:" + paths);
BMCUI.show("path:" + path + " / paths:" + paths);
BMCUI.showToast("path:" + path + " / paths:" + paths);
if (path) {
callback(path)
} else if (paths && paths.length > 0) {
......
......@@ -28,7 +28,7 @@ async function choosePic(openCamera, selectPic, callback) {
} = await ImagePicker.choosePic(openCamera, selectPic);
console.log("path:" + path + " / paths:" + paths);
BMCUI.show("path:" + path + " / paths:" + paths);
BMCUI.showToast("path:" + path + " / paths:" + paths);
if (path) {
callback(path)
} else if (paths && paths.length > 0) {
......@@ -61,7 +61,7 @@ export default class CustomRoundImageView extends React.Component {
_onChange(event) {
console.log("onChange props:" + this.props + " / event:" + event);
if (event.nativeEvent.message) {
BMCUI.show("get event:" + event.nativeEvent.message);
BMCUI.showToast("get event:" + event.nativeEvent.message);
}
imageClick((path) => {
this.setState({
......
const { BMCUI } = NativeModules;
import { NativeModules } from 'react-native';
import appConfig from '../config'
......@@ -28,6 +29,7 @@ const errorProcess = (resp, reject, errorToast) => {
message = ERROR_CODE_MAP[status].message
}
if (errorToast) {
BMCUI.showToast('errorToast');
}
reject({ message, data: resData })
}
......@@ -39,7 +41,7 @@ const getRequestInfo = async (calback, requestInfo = {}) => {
console.log('deviceInfo', deviceInfo);
const result = {
'Pvt-Token': loginInfo.pvtToken || '',
'Token': loginInfo.token || '',
'Token': loginInfo.token || '',
'City-Code': loginInfo.cityCode || '',
'Device-Name': deviceInfo.deviceName || '',
'Device-Model': deviceInfo.deviceModel || '',
......
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 to comment