update show news list for user not have project and unauthenticated

This commit is contained in:
kanyanat 2025-09-23 16:01:59 +07:00
parent 37021a723e
commit 9f7f2cebb8
5 changed files with 77 additions and 77 deletions

View File

@ -79,7 +79,7 @@ android {
applicationId "th.co.csasset.mobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 100
versionCode 101
versionName "2.50"
vectorDrawables.useSupportLibrary = true
missingDimensionStrategy 'react-native-camera', 'general'

Binary file not shown.

View File

@ -11,7 +11,7 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 100,
"versionCode": 101,
"versionName": "2.50",
"outputFile": "app-release.apk"
}

View File

@ -199,11 +199,6 @@ class NewsScreen extends Component {
this.initData = this.initData.bind(this)
}
componentDidMount () {
// this.initData()
// this.checkNotifiedPopup()
}
checkNotifiedPopup = () => {
if (this.props.user) {
checkPaymentMeter()
@ -260,7 +255,10 @@ class NewsScreen extends Component {
},async () => {
await this.getAllNewsByProject(res.data.project_id)
})
}else {
await this.getAllNewsList()
}
this.setState({
noti_count: res.data.count_noti,
user_point: res.data.point_balance,
@ -596,8 +594,6 @@ class NewsScreen extends Component {
}
}}
>
{
this.state.user_project_id ?
<View style={[styles.row]}>
<FlatList
data={this.state.news_head}
@ -615,8 +611,7 @@ class NewsScreen extends Component {
: <View></View>
}
</View>
</View> : <View></View>
}
</View>
{
this.state.auth !== null &&
@ -824,8 +819,6 @@ class NewsScreen extends Component {
}
{
this.state.user_project_id ?
<View style={{ padding: 10 }}>
<FlatList
extraData={this.state}
@ -850,9 +843,7 @@ class NewsScreen extends Component {
/>)
}}
/>
</View> : <View></View>
}
</View>
</ScrollView>
</BackgroundImage>
<IndicatorLoading loadingVisible={this.state.isLoading}/>

View File

@ -16,6 +16,7 @@ import {NavigationActions} from "react-navigation";
import Config from 'src/utils/Config'
import Carousel from "../room/RoomDetail";
import {sliderWidth} from "../../styles/SliderEntry.style";
import {connect} from "react-redux";
var uri = null;
const injectScript = `
(function () {
@ -27,7 +28,7 @@ const injectScript = `
}());
`;
export default class NewsDetailScreen extends Component {
class NewsDetailScreen extends Component {
constructor(props) {
super(props)
this.state = {
@ -97,7 +98,7 @@ export default class NewsDetailScreen extends Component {
source_webview = {
baseUrl: '',
// uri: `${Config.API_BASE_URL_POWER_CONDO_PROD}/news/${this.state.news_id}/detail`,
uri: `${Config.API_BASE_URL_POWER_CONDO_PROD}/news/${this.state.news_id}/detail`
uri: `${this.props.server_mode === 'production' ? Config.API_BASE_URL_POWER_CONDO_PROD : Config.API_BASE_URL_POWER_CONDO_DEV}/news/${this.state.news_id}/detail`
}
// if(Platform.OS === 'android'){
@ -219,6 +220,14 @@ export default class NewsDetailScreen extends Component {
}
}
const mapStateToProps = state => {
return {
server_mode: state.app.server_mode
}
}
export default connect(mapStateToProps)(NewsDetailScreen)
const styles = StyleSheet.create({
imgBg: {
width: '100%',