import { WKApp, WKViewQueueHeader, QRCodeMy, Search } from "@tsdaodao/base"; import {WKBase, WKBaseContext } from "@tsdaodao/base"; import React from "react"; import { Component, ReactNode } from "react"; import { Spin,Toast } from '@douyinfe/semi-ui'; import "./index.css" export interface FriendAddProps { onBack?: () => void } export class FriendAddState { spinning!:boolean keyword?:string result?:any } export class FriendAdd extends Component { baseContext!:WKBaseContext constructor(props:any) { super(props) this.state = { spinning: false, } } async searchUser() { const { keyword } = this.state if(!keyword) { return } this.setState({ spinning: true, }) const result = await WKApp.dataSource.commonDataSource.searchUser(keyword).catch((err)=>{ Toast.error(err.msg) }) if(result) { this.setState({ result: result, spinning: false, }) if(result.exist !== 1) { Toast.error("用户不存在!") }else { WKApp.shared.baseContext.showUserInfo(result.data.uid,undefined,result.data.vercode) } } } render(): ReactNode { const { onBack } = this.props const { spinning } = this.state return { this.baseContext = ctx }}>
{ this.setState({ keyword: v }) }} onEnterPress={()=>{ this.searchUser() }}>
我的{WKApp.config.appName}号:{WKApp.loginInfo.shortNo} { WKApp.routeLeft.push() }} src={require("./assets/icon_qrcode.png")}>
} }