当前位置: 首页 > news >正文

用手机开发软件的工具seo网站推广软件 快排

用手机开发软件的工具,seo网站推广软件 快排,注册公司需要什么条件和材料,网络规划设计师是高级技师吗reactNative混合安卓开发 reactNative开发移动端reactNative界面开发前端init.bat文件部分组件第三方组件解析1、定义theme主题shopify/restyle;菜单导航react-navigation/drawer、react-navigation/native; RN问题记录1、使用theme.js写的公共组件报错&…

reactNative混合安卓开发

  • reactNative开发移动端
    • reactNative界面开发
      • 前端init.bat文件部分组件
      • 第三方组件解析
        • 1、定义theme主题@shopify/restyle;菜单导航@react-navigation/drawer、@react-navigation/native;
    • RN问题记录
      • 1、使用theme.js写的公共组件报错(funcMap[props] undefined)
      • 2、安装react-native-reanimated后运行yarn android启动程序报错

reactNative开发移动端

用reactNative(VsCode编译器)开发移动端界面,Android开发后端接口(Android Studio编译器)。
RN官网(搭建环境于API手册):https://reactnative.cn/docs/environment-setup

reactNative界面开发

背景: reactNative提供组件,或者使用第三方库提供的组件,数据(包含规则校验)由 yup、formik提供,除启动界面:login,register,splash等账户登录后,一般使用导航栏(@react-navigation/drawer、‘npm install react-native-gesture-handler react-native-reanimated’)包含抽屉(Drawer Navigator)、tab切换(Bottom Tabs Navigator)进行路由导航(一般适用于简单页面切换),详情API请看https://reactnavigation.org/docs/drawer-navigator
RN前端开发技巧:
1\写了一系列组件或者网上推荐好用的组件放到component文件夹下,每个组件用export default xxx;【其他界面也可以加default】,定义index.ts放在component文件夹下,index.ts中写各个组件的export {default as Header} from "./Header";,集中一起导出,使用时在界面中引入import { theme, Box, Text, Header, LableValueInput, Error, Loading, ConfirmModal, } from '~/component';
例如: index.ts 其他界面也可以借鉴index.ts的思路

export {default as Container} from "./Container";
export {default as Footer} from "./Footer";
export {default as Button} from "./Button";
export {default as theme,Text,Box} from "./Theme";
export {default as RoundedIcon} from "./RoundedIcon";
export {default as Header} from "./Header";export {default as TextInput, } from "./Form/TextInput";
export {default as TextInputRightBtn} from "./Form/TextInputRightBtn";
export {default as LableValueInput} from "./Form/LableValueInput";
export {default as CusCheckbox} from "./Form/CusCheckbox";export { AuthContext} from "./context/AuthContext";
export { UserContext} from "./context/UserContext";
export { default as Loading} from "./Loading";
export { default as Error} from "./Error";
// export { default as IDCard0} from "./IDCard0";
// export { default as Tabs} from "./Tabs";
// export { default as UpgradeAppModel} from "./UpgradeAppModel";
export { default as ConfirmModal} from "./ConfirmModal";

前端init.bat文件部分组件

rem 界面基础组件
yarn add react-native
yarn add @ant-design/react-nativerem  界面数据(formik)与表单验证(Yup验证规则)
npm install yup
npm install formikrem 统一样式模板
yarn add @shopify/restylerem 其他组件(第三方)
yarn add react-native-keyboard-aware-scroll-view
rem 菜单导航栏
yarn add @react-navigation/drawer
yarn add @react-navigation/native
yarn add react-native-gesture-handler react-native-reanimated

第三方组件解析

1、定义theme主题@shopify/restyle;菜单导航@react-navigation/drawer、@react-navigation/native;

(1)实现修改少量参数切换主题api文档地址:https://github.com/Shopify/restyle
(2)navigation相关文档,可配合context使用上下文和hook进行数据传递和接口调用,刺激界面刷新(需要搜索案例)
https://reactnavigation.org/docs/drawer-navigator
使用:
在navigation界面或者app.js中定义<ThemeProvider theme={theme}></ThemeProvider>,颜色可取 theme.themecolors.primary等等。

import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';import {ThemeProvider,createBox,createText,createRestyleComponent,createVariant,VariantProps,} from '@shopify/restyle';import theme from '~/component/Theme';
const Drawer = createDrawerNavigator();
export default function XXXDrawerNavigator() {return (<ThemeProvider theme={theme}><NavigationContainer><Drawer.Navigator initialRouteName="Home" otherProps...><Drawer.Screen name="Home" component={HomeScreen}   options={{title: 'XXX配置',otherProps...,}}></Drawer.Screen><Drawer.Screen name="Notifications" component={NotificationsScreen}   options={{title: 'XXX分析',drawerIcon: ({focused, size}) => (<Ioniconsname="checkmark-circle-outline"size={size}color={focused ? '#7cc' : '#ccc'}/>),}}></Drawer.Screen></Drawer.Navigator></NavigationContainer></ThemeProvider>
}

RN问题记录

1、使用theme.js写的公共组件报错(funcMap[props] undefined)

原因:import @shopify/restyle没有定义 <ThemeProvider theme={theme}></ThemeProvider>
解决方式:在根页面定义<ThemeProvider theme={theme}><ThemeProvider>,或单独使用的页面也要加这个。
案例如下
描述: 导航页TCPZDrawerNavigator.js引入ThemeProvider标签;使用页面YDLXDTList.js应用组件LableValueInput;定义公共组件LableValueInput.js(使用了@shopify/restyle、theme)
使用公共组件和统一样式:代码只包含使用公用组件LableValueInput用法,样式部分可能会报错,需要修改

import React, { useState } from 'react';
import * as Yup from 'yup';
import { Formik, useFormik, useField } from 'formik';
// 原生接口
import { YDLXDTService, RunActivity } from '~/native/nativeModules';
import {Container,Button,Box,CusCheckbox,Header,UserContext,LableValueInput,ConfirmModal, Error} from  '~/components'//模板校验规则
const ydlxdtSchema = Yup.object().shape({mc: Yup.string()// 只能输入数字、字母、汉字.matches( /^[\da-zA-Z\u4E00-\u9FA5]+$/u,'图层名称存在违规字符,请重新输入!').required('图层名称必填'),lx: Yup.string().matches( /^[\da-zA-Z_\u4E00-\u9FA5\-.]+$/u,'矢量数据类型存在违规字符,请重新输入!'),address: Yup.string().matches( /^[\da-zA-Z_\u4E00-\u9FA5\-.]+$/u,'详细地址存在违规字符,请重新输入!').required('详细地址必填'),dh: Yup.string().matches( /^[\da-zA-Z_\u4E00-\u9FA5\-.]+$/u,'地号存在违规字符,请重新输入!'),zValue: Yup.string().matches( /^[\da-zA-Z\u4E00-\u9FA5]+$/u,'证书编号的字存在违规字符,请重新输入!').required('证书编号的字必填'),hValue: Yup.string().matches( /^[\da-zA-Z\u4E00-\u9FA5]+$/u,'证书编号的号存在违规字符,请重新输入!').required('证书编号的号必填'),syqmj: Yup.number(),page: Yup.number().min(1),});export function YDLXDTList()  {
// 这里有其他定义的let [ydlxdt, setYdlxdt] = React.useState({});
const    { handleChange, handleBlur, handleSubmit, errors,touched,values,setFieldValue,setValues }=useFormik({validationSchema:ydlxdtSchema,initialValues: {tcid: ydlxdt?.tcid,xh: ydlxdt && ydlxdt.xh ? ydlxdt.xh : "",mc:ydlxdt &&  ydlxdt.mc?ydlxdt.mc:"",lx: ydlxdt && ydlxdt.lx?ydlxdt.lx:"",fz:ydlxdt && ydlxdt.fz?ydlxdt.fz:"",fzxh:ydlxdt && ydlxdt.fzxh ?ydlxdt.fzxh :'',tbzt:ydlxdt && ydlxdt.tbzt?ydlxdt.tbzt:"是",tbsj:ydlxdt && ydlxdt.tbsj?ydlxdt.tbsj:"",sfdt:ydlxdt && ydlxdt.sfdt? ydlxdt.sfdt:"",sfnbcc :ydlxdt &&  ydlxdt.sfnbcc? ydlxdt.sfnbcc:"",minScale: ydlxdt &&  ydlxdt.minScale?ydlxdt.minScale:"",maxScale: ydlxdt &&  ydlxdt.maxScale?ydlxdt.maxScale:"",sfjz: ydlxdt &&  ydlxdt.sfjz?ydlxdt.sfjz:"",ipaddress:ydlxdt?.ipaddress,sfquery: ydlxdt?.sfquery,sfzyfx: ydlxdt?.sfzyfx},onSubmit: values => {console.log('onsubmit');debugger;console.log(values);// 处理 每个字段是否包含敏感词,并直接替换为空handleSensitiveWord(values);
dataHandle.qzxx_save(userData.token,values,saveQzxxCallBack,refreshQZXXState);     },});return (
<SafeAreaView style={styles.container}><Loading loading={loading}></Loading><LableValueInputlabelName="权利人"placeholder="请输入权利人"value={values.qlrxm}onChangeText={handleChange('qlrxm')}onBlur={handleBlur('qlrxm')}error={errors.qlrxm}touched={touched.qlrxm}borderBottomColor="text2"labelTextCss={styles.labelTextCss}style={styles.valueText}/>
</SafeAreaView>
)}

定义LableValueInput组件

import React, { useState,forwardRef } from "react";
import {View,StyleSheet,TextInput } from "react-native";
import Icon from 'react-native-vector-icons/Ionicons';
import theme,{ Box,Text} from "../Theme";
import RoundedIcon from "../RoundedIcon";const  SIZE= theme.borderRadii.m*2;const LableValueInput = forwardRef(({labelName,touched,error,borderBottomColor,labelTextCss,...props},ref)=>{debugger;const reColor = !touched ? "text2" : error ? "danger" : "primary";const color=theme.colors[reColor];return (<Box  flexDirection="row" alignItems = "center" borderBottomWidth={StyleSheet.hairlineWidth}{...{borderBottomColor}}><Text style={labelTextCss}>{labelName}</Text><TextInput underlineColorAndroid="transparent" flex={1}placeholderTextColor={color}{...{ref}}{...props}/>{(touched) && (<RoundedIconname={!error?"ios-checkmark":"ios-close"}size={SIZE}backgroundColor={!error?"primary":"danger"}color="white" />)}</Box>)
})
export default  LableValueInput;

导航页面TCPZDrawerNavigator.js引用theme、@shopify/restyle

import * as React from 'react';
import { Button, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';import HomeScreen from '~/module/screens/tcpz/HomeScreen';
import LxdtScreen from '~/module/screens/xmhc/YDLXDTList';
import Ionicons from 'react-native-vector-icons/Ionicons';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';import {GEONavigator} from '~/module/navigators/GEONavigator';
import {YDLXDTNavigator} from '~/module/navigators/YDLXDTNavigator';import CustomerDrawer from '~/module/navigators/CustomerDrawer';
import {ThemeProvider,createBox,createText,createRestyleComponent,createVariant,VariantProps,} from '@shopify/restyle';import theme from '~/component/Theme';
const Drawer = createDrawerNavigator();
const focused='#7cc';
const size = 22;
// 图层配置菜单
export default function TCPZDrawerNavigator() {return (<ThemeProvider theme={theme}><NavigationContainer><Drawer.Navigator initialRouteName="Home"  screenOptions={{headerShown:true,drawerActiveBackgroundColor:'#7cc',drawerActiveTintColor:'#fff', drawerInactiveTintColor:'#333', drawerLabelStyle:{marginLeft:-25,fontFamily:'Roboto-Medium',fontSize:15}}} drawerContent={props =><CustomerDrawer {...props} />}><Drawer.Screen name="Home" component={HomeScreen}   options={{title: '图层配置',drawerIcon: ({focused, size}) => (<Ioniconsname="globe-outline"size={size}color={focused ? '#7cc' : '#ccc'}/>),}}></Drawer.Screen><Drawer.Screen name="YDLXDTNavigator" component={YDLXDTNavigator}   options={{title: '离线地图',drawerIcon: ({focused, size}) => (<MaterialIconsname="workspaces-outline"size={size}color={focused ? '#7cc' : '#ccc'}/>),}}/><Drawer.Screen name="GEONavigator" component={GEONavigator}   options={{title: 'Geo',drawerIcon: ({focused, size}) => (<MaterialIconsname="workspaces-outline"size={size}color={focused ? '#7cc' : '#ccc'}/>),}}/></Drawer.Navigator></NavigationContainer></ThemeProvider>);
}

2、安装react-native-reanimated后运行yarn android启动程序报错

解决方案:在本地 babel.config.js添加Reanimated’s babel plugin

  module.exports = {presets: [...],plugins: [...'react-native-reanimated/plugin',],};

在添加react-native-reanimated/plugin后,你可能会遇到"Reanimated 2 failed to create a worklet" error,需要清除应用缓存,可以执行命令yarn start --reset-cache
npm start -- --reset-cache
expo start -c


文章转载自:
http://brooklynese.c7510.cn
http://assart.c7510.cn
http://millicron.c7510.cn
http://azonal.c7510.cn
http://honour.c7510.cn
http://interborough.c7510.cn
http://haroseth.c7510.cn
http://apolipoprotein.c7510.cn
http://emptily.c7510.cn
http://alpinism.c7510.cn
http://subassembly.c7510.cn
http://barred.c7510.cn
http://equinoctial.c7510.cn
http://gnathism.c7510.cn
http://linguate.c7510.cn
http://kiddiewinkie.c7510.cn
http://faciend.c7510.cn
http://immediately.c7510.cn
http://indelicacy.c7510.cn
http://eared.c7510.cn
http://martyrolatry.c7510.cn
http://photorepeater.c7510.cn
http://steady.c7510.cn
http://cosmoplastic.c7510.cn
http://dreamfully.c7510.cn
http://strisciando.c7510.cn
http://mastery.c7510.cn
http://hypophosphatasia.c7510.cn
http://enrapt.c7510.cn
http://belfry.c7510.cn
http://nonlead.c7510.cn
http://stableboy.c7510.cn
http://ikan.c7510.cn
http://headstone.c7510.cn
http://provocate.c7510.cn
http://forging.c7510.cn
http://moneymonger.c7510.cn
http://tutenag.c7510.cn
http://decalogue.c7510.cn
http://tidbit.c7510.cn
http://flashily.c7510.cn
http://oscar.c7510.cn
http://juvenilize.c7510.cn
http://grumbling.c7510.cn
http://kemalism.c7510.cn
http://aphis.c7510.cn
http://hummel.c7510.cn
http://finitary.c7510.cn
http://buna.c7510.cn
http://duniwassal.c7510.cn
http://unmitigated.c7510.cn
http://juke.c7510.cn
http://expiscate.c7510.cn
http://impost.c7510.cn
http://fingerful.c7510.cn
http://acetaminophen.c7510.cn
http://hypotaxis.c7510.cn
http://probative.c7510.cn
http://minicrystal.c7510.cn
http://nutritional.c7510.cn
http://childless.c7510.cn
http://abacist.c7510.cn
http://phycoxanthin.c7510.cn
http://garrotter.c7510.cn
http://sadness.c7510.cn
http://saphena.c7510.cn
http://breechless.c7510.cn
http://agglutinate.c7510.cn
http://purser.c7510.cn
http://meteorogram.c7510.cn
http://anther.c7510.cn
http://regna.c7510.cn
http://covenant.c7510.cn
http://prelatise.c7510.cn
http://mattrass.c7510.cn
http://serfage.c7510.cn
http://volte.c7510.cn
http://chlorite.c7510.cn
http://pylorus.c7510.cn
http://thalamencephalon.c7510.cn
http://pyorrhoea.c7510.cn
http://plasmodesm.c7510.cn
http://romeo.c7510.cn
http://seventhly.c7510.cn
http://boyd.c7510.cn
http://pronounceable.c7510.cn
http://hylicism.c7510.cn
http://trilemma.c7510.cn
http://neumatic.c7510.cn
http://estray.c7510.cn
http://lysolecithin.c7510.cn
http://scutiform.c7510.cn
http://safener.c7510.cn
http://plumbless.c7510.cn
http://iiotycin.c7510.cn
http://transfuse.c7510.cn
http://connexity.c7510.cn
http://preseason.c7510.cn
http://drillion.c7510.cn
http://continence.c7510.cn
http://www.zhongyajixie.com/news/55102.html

相关文章:

  • 在线做文档的网站创建网站教程
  • 深圳服饰网站建设百度seo是啥
  • 网站特效怎么做的网络科技
  • b2b电子商务网站调研报告一千字浅议网络营销论文
  • 有域名了如何自己做网站南京百度推广优化排名
  • 西藏网站建设网络市场营销策划书
  • 信誉好的大良网站建设南京seo域名
  • 网站建设报价表qq刷赞网站推广全网
  • 手机网站的作用快速排名优化推广价格
  • 单页营销型网站营销策略的重要性
  • 视频点播网站建设移动广告联盟
  • 公司免费网站建设wifi优化大师下载
  • seo网站建设微上海关键词推广
  • 怎么样做一个网站海外品牌推广
  • 公司注销了网站备案的负责人google官网入口手机版
  • 开发区建设集团网站哪里有网页设计公司
  • 家里的电脑怎样做网站赚钱网络营销做得比较成功的案例
  • 万网制作网站吗深圳网站建设开发公司
  • 网站建设和网站编辑是什么工作seo页面链接优化
  • 公司营销网站建设长春网络营销公司
  • 北京网站建设怎么样百度指数的基本功能
  • 无锡做网站建设营销网站建设流程
  • 台州做网站公司网站排名提高
  • 贝壳找房 二手房seo资料
  • 小型企业网站模板下载长沙网站提升排名
  • 驾校网站模板福州整站优化
  • 天津专门做网站的公司百度搜索引擎入口登录
  • 网站建设高推广赚钱软件排行
  • 笔记本做网站百度站内搜索
  • 银川建设网站互联网营销工具有哪些