From 24a00e0d1c1503d5c403d4775e36d3dbb414362f Mon Sep 17 00:00:00 2001 From: chenzhiqing01 Date: Mon, 16 Aug 2021 23:46:57 +0800 Subject: [PATCH] feat: rm home input --- src/pages/apis/pages/device/network/index.tsx | 12 +++++-- .../apis/pages/network/request/index.scss | 3 +- .../apis/pages/network/request/index.tsx | 23 +++++++++----- src/pages/home/index.scss | 18 ++++------- src/pages/home/index.tsx | 31 ++----------------- 5 files changed, 35 insertions(+), 52 deletions(-) diff --git a/src/pages/apis/pages/device/network/index.tsx b/src/pages/apis/pages/device/network/index.tsx index 75bb5cb467cb..f007e0717ca6 100644 --- a/src/pages/apis/pages/device/network/index.tsx +++ b/src/pages/apis/pages/device/network/index.tsx @@ -7,17 +7,23 @@ */ import Taro from "@tarojs/taro-rn"; import { Button, View } from "@tarojs/components"; +import { useState } from "react"; +import JSONTree from '../../../../components/jsontree'; import "./index.scss"; const Index = () => { + const [networkStatus1, setNetworkStatus1] = useState({}); + const [networkStatus2, setNetworkStatus2] = useState({}); - const _handleCallback1 = (...res) => { + const _handleCallback1 = (res) => { console.log("回调函数 C1", res); + setNetworkStatus1(res); } - const _handleCallback2 = (...res) => { + const _handleCallback2 = (res) => { console.log("回调函数 C2", res); + setNetworkStatus2(res) } return ( @@ -32,6 +38,7 @@ const Index = () => { > Taro.onNetworkStatusChange(C1) + + + ) } diff --git a/src/pages/home/index.scss b/src/pages/home/index.scss index 983a10a50bda..8ff7678f10cb 100644 --- a/src/pages/home/index.scss +++ b/src/pages/home/index.scss @@ -2,7 +2,7 @@ .index { flex: 1; - padding-top: 120px; + padding-top: 200px; padding-bottom: 200px; } @@ -39,19 +39,13 @@ .load { padding: 32px; &-header { - flex-direction: row; - align-items: center; + flex-direction: column; + align-items: flex-end; padding-left: 20px; padding-right: 20px; - background-color: #ffffff; - &-input { - flex: 1; - margin-right: 50px; - font-size: $font-size-xl; - } &-icon { - height: 40px; - width: 40px; + height: 60px; + width: 60px; /* #ifdef rn */ tint-color: $color-brand; /* #endif */ @@ -71,7 +65,7 @@ justify-content: space-between; padding: 32px; } - + &-item { padding: 28px 32px; background-color: #ffffff; diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index d274cbb0dfed..e98c66b77ad9 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -8,7 +8,7 @@ import { Component, Fragment } from 'react'; import Taro from '@tarojs/taro'; import { NativeModules } from 'react-native'; -import { View, Text, Image, Input, Button } from '@tarojs/components' +import { View, Text, Image } from '@tarojs/components' import './index.scss' const DevManager = NativeModules.RNDevManager; @@ -18,7 +18,6 @@ export default class Index extends Component { constructor(props: any) { super(props); this.state = { - inputValue: 'localhost:8081', list: [], }; } @@ -88,19 +87,6 @@ export default class Index extends Component { }) } - _onInputChange = e => { - const value = e.detail.value; - this.setState({ - inputValue: value - }); - } - - _onPressLoad = e => { - const { inputValue } = this.state; - this._loadBundleByUrl(inputValue); - this._saveUrlToStorage(inputValue); - } - _clearBundles = async () => { try { const res = await Taro.showModal({ title: '确定清空吗?', content: '清空后历史数据将不再保存', confirmColor: '#6190E8' }); @@ -118,7 +104,7 @@ export default class Index extends Component { } render() { - const { list = [], inputValue } = this.state; + const { list = [] } = this.state; return ( @@ -130,25 +116,12 @@ export default class Index extends Component { - - {list.length > 0 && (