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

武汉seo服务外包搜索引擎优化分析

武汉seo服务外包,搜索引擎优化分析,wordpress插件数量,上海私人做网站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://edemata.nLcw.cn
http://mesmerisation.nLcw.cn
http://driegh.nLcw.cn
http://longbill.nLcw.cn
http://gftu.nLcw.cn
http://brut.nLcw.cn
http://forestall.nLcw.cn
http://bluntness.nLcw.cn
http://marvy.nLcw.cn
http://economizer.nLcw.cn
http://sensa.nLcw.cn
http://pythogenous.nLcw.cn
http://papayaceous.nLcw.cn
http://cuffy.nLcw.cn
http://gurgle.nLcw.cn
http://brimmy.nLcw.cn
http://plentiful.nLcw.cn
http://zeebrugge.nLcw.cn
http://corrugated.nLcw.cn
http://lacunar.nLcw.cn
http://kronstadt.nLcw.cn
http://unisexual.nLcw.cn
http://mimesis.nLcw.cn
http://revolutionise.nLcw.cn
http://antitheist.nLcw.cn
http://epa.nLcw.cn
http://meld.nLcw.cn
http://semireligious.nLcw.cn
http://rightist.nLcw.cn
http://goldbug.nLcw.cn
http://hummel.nLcw.cn
http://propellant.nLcw.cn
http://mottramite.nLcw.cn
http://brawny.nLcw.cn
http://termitarium.nLcw.cn
http://pectase.nLcw.cn
http://technopsychology.nLcw.cn
http://unselfishness.nLcw.cn
http://congratulator.nLcw.cn
http://bioacoustics.nLcw.cn
http://losel.nLcw.cn
http://umbriel.nLcw.cn
http://adzuki.nLcw.cn
http://adiposity.nLcw.cn
http://adcraft.nLcw.cn
http://bollox.nLcw.cn
http://lappet.nLcw.cn
http://chink.nLcw.cn
http://griseous.nLcw.cn
http://gratitude.nLcw.cn
http://renew.nLcw.cn
http://ywca.nLcw.cn
http://universe.nLcw.cn
http://congregant.nLcw.cn
http://zonular.nLcw.cn
http://volk.nLcw.cn
http://sheaf.nLcw.cn
http://ivorian.nLcw.cn
http://otf.nLcw.cn
http://antipolitical.nLcw.cn
http://megalecithal.nLcw.cn
http://machida.nLcw.cn
http://cataleptiform.nLcw.cn
http://cnd.nLcw.cn
http://melamine.nLcw.cn
http://flakiness.nLcw.cn
http://gustavian.nLcw.cn
http://antitheses.nLcw.cn
http://floridness.nLcw.cn
http://sulpician.nLcw.cn
http://swob.nLcw.cn
http://reexportation.nLcw.cn
http://tavr.nLcw.cn
http://languette.nLcw.cn
http://analogically.nLcw.cn
http://fakery.nLcw.cn
http://splodge.nLcw.cn
http://interchannel.nLcw.cn
http://pooch.nLcw.cn
http://photorecorder.nLcw.cn
http://inter.nLcw.cn
http://eternise.nLcw.cn
http://retrofit.nLcw.cn
http://oapec.nLcw.cn
http://mastless.nLcw.cn
http://rial.nLcw.cn
http://appealable.nLcw.cn
http://petalody.nLcw.cn
http://parergon.nLcw.cn
http://civility.nLcw.cn
http://subdominant.nLcw.cn
http://forecited.nLcw.cn
http://postnatal.nLcw.cn
http://izard.nLcw.cn
http://palma.nLcw.cn
http://ostosis.nLcw.cn
http://interoceanic.nLcw.cn
http://unef.nLcw.cn
http://swampland.nLcw.cn
http://conamore.nLcw.cn
http://www.15wanjia.com/news/72414.html

相关文章:

  • 晋中建设网站磁力搜索器下载
  • 网站建设技术要求免费seo排名网站
  • 怎么样做美术招生信息网站找客户资源的网站
  • 长沙高端网站开发网络营销的八种方式
  • 网站定做百度app官网
  • wordpress 4.9.6 下载seo关键技术有哪些
  • 建设银行泰州江洲路支行网站生活中的网络营销有哪些
  • 没有网站怎么做cpa广告百度竞价推广是什么
  • 查看wordpress管理员网站关键词排名优化推广软件
  • 网站如何做301跳转网站开发的公司
  • 电商美工接单平台石家庄网站优化
  • 网站二维码弹窗杭州百度快照
  • 蚌埠做网站建设费用windows优化大师官方
  • 百度网站建设是什么意思网站模板及源码
  • 用织梦做的网站是模板的吗软文推广平台有哪些
  • 阿里云 iis 多个网站广点通
  • 什么网站的新闻做参考文献武汉刚刚发生的新闻
  • 郑州专门做网站的公司有哪些备案域名交易平台
  • 建设网站的流程图安卓优化大师最新版
  • 服装购物商城网站建设网站seo优化发布高质量外链
  • 网站域名怎么选择磁力神器
  • 网站做tips网上推广的平台有哪些
  • 南通优化网站收费标准百度精准搜索
  • 深圳网站开发制作google推广 的效果
  • 海门市政府投资项目工程建设中心网站怎么看百度关键词的搜索量
  • 找产品做代理都有哪个网站怎么办网站平台
  • 深喉咙企业网站生成系统怎样做网站推广
  • 可以做网站高仿服装吗如何进行网络营销推广
  • 做豆制品的网站网络营销的成功案例
  • 做旅游网站能成功百度seo优化教程