@ -0,0 +1,33 @@ |
||||
import proxy from "../proxy"; |
||||
|
||||
const qr = { |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("qr/list", data, { dispatch }), |
||||
info: |
||||
(data = {}) => |
||||
async (dispatch) => { |
||||
await proxy.get("qr/info", data, { dispatch }); |
||||
}, |
||||
add: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.post("qr/add", data); |
||||
await proxy.get("qr/list", data2, { dispatch }); |
||||
}, |
||||
del: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.delete("ar/delete", data); |
||||
await proxy.get("ar/list", data2, { dispatch }); |
||||
}, |
||||
update: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.put("ar/update", data); |
||||
await proxy.get("ar/list", data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default qr; |
@ -0,0 +1,33 @@ |
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
list: null, |
||||
}; |
||||
|
||||
export default function qr(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case "qr/list": |
||||
return { ...state, loading: false, error: null }; |
||||
case "qr/update": |
||||
return { ...state, loading: false, error: null }; |
||||
case "qr/add": |
||||
return { ...state, loading: false, error: null }; |
||||
case "qr/delete": |
||||
return { ...state, loading: false, error: null }; |
||||
case "qr/info": |
||||
return { |
||||
...state, |
||||
loading: false, |
||||
list: data, |
||||
error: null, |
||||
}; |
||||
/////////////
|
||||
case "loading": |
||||
return { ...state, loading: true }; |
||||
case "error": |
||||
return { ...state, loading: false, error: data.message }; |
||||
default: |
||||
return state; |
||||
} |
||||
} |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 93 KiB |
@ -1,6 +1,7 @@ |
||||
import React from "react"; |
||||
import { View, Text, Image, Dimensions } from "react-native"; |
||||
import tw from "tailwind-rn"; |
||||
|
||||
import pdfIcon from "../../../assets/icons/pdf.png"; |
||||
|
||||
const {width} = Dimensions.get("window"); |
@ -0,0 +1,70 @@ |
||||
import React, { useState,useEffect } from "react"; |
||||
import { |
||||
StyleSheet, |
||||
ScrollView, |
||||
SafeAreaView, |
||||
Dimensions, |
||||
StatusBar, |
||||
} from "react-native"; |
||||
import { connect } from "react-redux"; |
||||
import {qr} from '../../redux/actions' |
||||
import Content from "./Content"; |
||||
import Navbar from "../../components/Navbar"; |
||||
|
||||
function QRContent({ route, getQrData, data }) { |
||||
useEffect(() => { |
||||
getQrData({tail : 'zist10_14'}); |
||||
},[]); |
||||
|
||||
useEffect(() => { |
||||
console.log(data); |
||||
},[data]); |
||||
return ( |
||||
<SafeAreaView |
||||
style={{ |
||||
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, |
||||
}} |
||||
> |
||||
<Navbar |
||||
headerOptions={{ |
||||
logo: false, |
||||
menu: true, |
||||
hamburgerMenu: false, |
||||
title: "", |
||||
bookmark: true, |
||||
qr: false, |
||||
back: true, |
||||
}} |
||||
/> |
||||
<ScrollView |
||||
contentContainerStyle={styles.contentContainerStyle} |
||||
style={styles.container} |
||||
> |
||||
<Content /> |
||||
</ScrollView> |
||||
</SafeAreaView> |
||||
); |
||||
} |
||||
|
||||
const mapStateToProps = (state) => ({ |
||||
data : state.qr.list |
||||
}); |
||||
|
||||
const mapDispatchToProps = { |
||||
getQrData : qr.info |
||||
} |
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(QRContent); |
||||
|
||||
const styles = StyleSheet.create({ |
||||
contentContainerStyle: { |
||||
paddingBottom: 0, |
||||
}, |
||||
container: { |
||||
width: Dimensions.get("window").width, |
||||
backgroundColor: "white", |
||||
flexDirection: "column", |
||||
paddingVertical: 5, |
||||
paddingHorizontal: 0, |
||||
}, |
||||
}); |
Before Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 684 B |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 3.1 KiB |