- 创建 .editorconfig 文件统一代码风格配置 - 配置 .eslintrc 使用 taro/react 规则集 - 完善 .gitignore 忽略编译产物和敏感文件 - 添加 admin/article/add 页面实现文章管理功能 - 添加 dealer/apply/add 页面实现经销商申请功能 - 添加 dealer/bank/add 页面实现银行卡管理功能 - 添加 dealer/customer/add 页面实现客户管理功能 - 添加 user/address/add 页面实现用户地址管理功能 - 添加 user/chat/message/add 页面实现消息功能 - 添加 user/gift/add 页面实现礼品管理功能 - 配置各页面导航栏标题和样式 - 实现表单验证和数据提交功能 - 集成图片上传和头像选择功能 - 添加日期选择和数据校验逻辑 - 实现编辑和新增模式切换 - 集成用户权限和角色管理功能
30 lines
892 B
TypeScript
30 lines
892 B
TypeScript
import {useEffect, useState} from "react";
|
|
import {Input, Button} from '@nutui/nutui-react-taro'
|
|
import {copyText} from "@/utils/common";
|
|
import Taro from '@tarojs/taro'
|
|
|
|
const SiteUrl = (props: any) => {
|
|
const [siteUrl, setSiteUrl] = useState<string>('')
|
|
const reload = () => {
|
|
if(props.tenantId){
|
|
setSiteUrl(`https://${props.tenantId}.shoplnk.cn`)
|
|
}else {
|
|
setSiteUrl(`https://${Taro.getStorageSync('TenantId')}.shoplnk.cn`)
|
|
}
|
|
}
|
|
|
|
useEffect(() => {
|
|
reload()
|
|
}, [props])
|
|
|
|
return (
|
|
<div className={'px-3 mt-1 mb-4'}>
|
|
<div className={'flex justify-between items-center bg-gray-300 rounded-lg pr-2'}>
|
|
<Input type="text" value={siteUrl} disabled style={{backgroundColor: '#d1d5db', borderRadius: '8px'}}/>
|
|
<Button type={'info'} onClick={() => copyText(siteUrl)}>复制</Button>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
export default SiteUrl
|