打包修改
This commit is contained in:
parent
288ce04983
commit
7144a67989
|
@ -6,4 +6,5 @@
|
|||
npm run ios
|
||||
|
||||
打包: ./gradlew assembleRelease
|
||||
打Release包的时候如果报错 建议上传完代码重新安装依赖和其他内容
|
||||
|
||||
|
|
|
@ -93,6 +93,12 @@ android {
|
|||
keyAlias 'androiddebugkey'
|
||||
keyPassword 'android'
|
||||
}
|
||||
release {
|
||||
storeFile file('ct.keystore')
|
||||
storePassword 'jy888786'
|
||||
keyAlias 'ct'
|
||||
keyPassword 'jy888786'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
|
|
Binary file not shown.
|
@ -259,7 +259,7 @@ const DeviceControl: React.FC<DeviceControlProps> = ({ defaultDevice, onDeviceUp
|
|||
</View>
|
||||
<View style={styles.carBox}>
|
||||
<Image
|
||||
source={{ uri: 'https://lxnapi.ccttiot.com/bike/img/static/uVnIDwcwQP7oo12PeYVJ' }}
|
||||
source={{ uri: defaultDevice?.picture ? defaultDevice?.picture : 'https://lxnapi.ccttiot.com/bike/img/static/uVnIDwcwQP7oo12PeYVJ' }}
|
||||
style={{ width: rpx(440), height: rpx(340) }}
|
||||
/>
|
||||
<View style={styles.txtbox}>
|
||||
|
|
|
@ -153,7 +153,7 @@ const NormaIndex: React.FC = () => {
|
|||
|
||||
const response = await apiService.getDeviceList();
|
||||
console.log(response, 'response');
|
||||
if (response?.code === 200 && response.data) {
|
||||
if (response?.code == 200 && response.data) {
|
||||
const defaultDev = response.data.find((device: DeviceType) => device.isDefault == 1);
|
||||
if (defaultDev) {
|
||||
console.log(defaultDev.sn, 'defaultDev.sn');
|
||||
|
|
|
@ -112,11 +112,11 @@ const LoginScreen = () => {
|
|||
}
|
||||
} catch (error: any) {
|
||||
console.error('登录失败:', error);
|
||||
setModalConfig({
|
||||
title: '登录失败',
|
||||
message: error.message || '请稍后重试'
|
||||
});
|
||||
setModalVisible(true);
|
||||
// setModalConfig({
|
||||
// title: '登录失败',
|
||||
// message: error.message || '请稍后重试'
|
||||
// });
|
||||
// setModalVisible(true);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
@ -139,11 +139,11 @@ const LoginScreen = () => {
|
|||
}
|
||||
} catch (error: any) {
|
||||
console.error('获取验证码失败:', error);
|
||||
setModalConfig({
|
||||
title: '获取验证码失败',
|
||||
message: error.message || '请稍后重试'
|
||||
});
|
||||
setModalVisible(true);
|
||||
// setModalConfig({
|
||||
// title: '获取验证码失败',
|
||||
// message: error.message || '请稍后重试'
|
||||
// });
|
||||
// setModalVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ const deviceDetailSet = () => {
|
|||
try {
|
||||
const result = await uploadImageService.uploadImage();
|
||||
|
||||
if (!result || !Array.isArray(result) || result.length === 0) {
|
||||
if (!result || !Array.isArray(result) || result.length == 0) {
|
||||
Toast.show({
|
||||
type: 'error',
|
||||
text1: '上传失败',
|
||||
|
@ -109,13 +109,13 @@ const deviceDetailSet = () => {
|
|||
|
||||
const response = await apiService.updateDevice({
|
||||
sn: deviceInfo.sn,
|
||||
pricture: imageUrl
|
||||
picture: imageUrl
|
||||
});
|
||||
|
||||
if (response.code == 200) {
|
||||
setDeviceInfo(prevInfo => ({
|
||||
...prevInfo,
|
||||
pricture: imageUrl
|
||||
picture: imageUrl
|
||||
}));
|
||||
setModalVisible(false);
|
||||
Toast.show({
|
||||
|
@ -174,23 +174,29 @@ const deviceDetailSet = () => {
|
|||
|
||||
const fetchModelList = async () => {
|
||||
const response = await apiService.getModelList();
|
||||
if (response.code === 200) {
|
||||
if (response.code == 200) {
|
||||
setModelData(response.data);
|
||||
const brands = Array.from(new Set(response.data.map(item => item.brandName)));
|
||||
setBrandList(brands);
|
||||
// 先设置品牌列表,然后立即过滤对应的车型
|
||||
const initialBrand = brands[0];
|
||||
setSelectedBrandIndex(new IndexPath(0));
|
||||
filterModels(brands[0]);
|
||||
const models = response.data
|
||||
.filter(item => item.brandName === initialBrand)
|
||||
.map(item => item.model);
|
||||
setModelList(models);
|
||||
setSelectedModelIndex(new IndexPath(0));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const filterModels = (brand) => {
|
||||
const models = modelData.filter(item => item.brandName === brand).map(item => item.model);
|
||||
const models = modelData.filter(item => item.brandName == brand).map(item => item.model);
|
||||
setModelList(models);
|
||||
setSelectedModelIndex(new IndexPath(0));
|
||||
};
|
||||
|
||||
const getImageUrl = (brand, model) => {
|
||||
const selectedModel = modelData.find(item => item.brandName === brand && item.model === model);
|
||||
const selectedModel = modelData.find(item => item.brandName == brand && item.model == model);
|
||||
return selectedModel ? selectedModel.picture : null;
|
||||
};
|
||||
|
||||
|
@ -198,15 +204,16 @@ const deviceDetailSet = () => {
|
|||
const imageUrl = getImageUrl(brand, model);
|
||||
if (imageUrl && deviceInfo?.sn) {
|
||||
try {
|
||||
console.log(imageUrl,'imageUrl');
|
||||
const response = await apiService.updateDevice({
|
||||
sn: deviceInfo.sn,
|
||||
pricture: imageUrl
|
||||
picture: imageUrl
|
||||
});
|
||||
console.log(response,'图片上传');
|
||||
if (response.code == 200) {
|
||||
setDeviceInfo(prevInfo => ({
|
||||
...prevInfo,
|
||||
pricture: imageUrl
|
||||
picture: imageUrl
|
||||
}));
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
|
@ -302,7 +309,7 @@ const deviceDetailSet = () => {
|
|||
[currentEdit.type]: value
|
||||
});
|
||||
|
||||
if (response.code === 200) {
|
||||
if (response.code == 200) {
|
||||
setDeviceInfo(prevInfo => ({
|
||||
...prevInfo,
|
||||
[currentEdit.type]: value
|
||||
|
@ -372,7 +379,8 @@ const deviceDetailSet = () => {
|
|||
source={{ uri: 'https://lxnapi.ccttiot.com/FqAu65KgcylSRv1pD4008a_Ctpz-' }}
|
||||
style={styles.carInfo}
|
||||
>
|
||||
<Image source={{ uri: deviceInfo?.pricture ? deviceInfo?.pricture : 'https://lxnapi.ccttiot.com/bike/img/static/uVnIDwcwQP7oo12PeYVJ' }} style={{ width: rpx(440), height: rpx(340) }} />
|
||||
<Text style={styles.snText}>SN: {deviceInfo?.sn || ''}</Text>
|
||||
<Image source={{ uri: deviceInfo?.picture ? deviceInfo?.picture : 'https://lxnapi.ccttiot.com/bike/img/static/uVnIDwcwQP7oo12PeYVJ' }} style={{ width: rpx(440), height: rpx(340) }} />
|
||||
<View style={styles.carInfoButtons}>
|
||||
<TouchableOpacity style={styles.carInfoButton} onPress={upload} >
|
||||
<Text style={styles.carInfoButtonText}>上传图片</Text>
|
||||
|
@ -528,11 +536,18 @@ const styles = StyleSheet.create({
|
|||
height: '100%',
|
||||
},
|
||||
carInfo: {
|
||||
paddingTop: rpx(180),
|
||||
paddingTop: rpx(60),
|
||||
width: '100%',
|
||||
height: rpx(828),
|
||||
alignItems: 'center',
|
||||
},
|
||||
snText: {
|
||||
fontSize: rpx(28),
|
||||
color: '#333333',
|
||||
textAlign: 'center',
|
||||
marginTop: rpx(20),
|
||||
marginBottom: rpx(100),
|
||||
},
|
||||
carInfoButtons: {
|
||||
marginTop: rpx(160),
|
||||
flexDirection: 'row',
|
||||
|
@ -687,6 +702,7 @@ const styles = StyleSheet.create({
|
|||
marginBottom: rpx(20),
|
||||
},
|
||||
modalImage: {
|
||||
marginLeft: rpx(70),
|
||||
width: rpx(440),
|
||||
height: rpx(340),
|
||||
marginBottom: rpx(20),
|
||||
|
|
|
@ -39,7 +39,8 @@ export default function DeviceList() {
|
|||
try {
|
||||
setLoading(true);
|
||||
const response = await apiService.getDeviceList();
|
||||
if (response?.code === 200 && response.data) {
|
||||
if (response?.code == 200 && response.data) {
|
||||
console.log(response.data,'response.data');
|
||||
setDevices(response.data);
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -60,7 +61,7 @@ export default function DeviceList() {
|
|||
const selectCar = async (item: CarItem) => {
|
||||
try {
|
||||
const response = await apiService.toggleDefault(item.sn);
|
||||
if (response.code === 200) {
|
||||
if (response.code == 200) {
|
||||
console.log(response,'response');
|
||||
fetchDeviceList();
|
||||
// TODO: 添加成功提示
|
||||
|
|
Loading…
Reference in New Issue
Block a user