使用uinapp在<template> <view style="width: 480px;"> <div data-v-5f91e4be="" class="primary-color-bg card-header">批量下单</div> <uni-card title="" :isFull="true" style="background-color: #ecf5ff; margin-top: 10px; margin: 10px;"> <text> <ui style="color: #409eff;"> <span style="font-weight: bold; font-size: 17px;">批量下单简介</span> <li>批量下单自动检测地址是否激活,没激活自动激活。激活收费单价 </li> <li>如配置下面检测地址USDT大于指定值才激活代理资源,将根据地址USDT值有条件下单 </li> </ui> </text> </uni-card>在下面实现一个多行文本框不限字数,请输入批量提交的地址,一行一个地址,如下: TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ ......附加完整代码

2024-04-29by@3318235450-5bBcR&@GPT-4.Model: gpt-3.5
3318235450-5bBcR

使用uinapp在<template>
<view style="width: 480px;">
<div data-v-5f91e4be="" class="primary-color-bg card-header">批量下单</div>
<uni-card title="" :isFull="true" style="background-color: #ecf5ff; margin-top: 10px; margin: 10px;">
<text>
<ui style="color: #409eff;">
<span style="font-weight: bold; font-size: 17px;">批量下单简介</span>
<li>批量下单自动检测地址是否激活,没激活自动激活。激活收费单价 </li>
<li>如配置下面检测地址USDT大于指定值才激活代理资源,将根据地址USDT值有条件下单 </li>
</ui>
</text>
</uni-card>在下面实现一个多行文本框不限字数,请输入批量提交的地址,一行一个地址,如下:
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ
......附加完整代码

Avatar
Avatar

<template>
<view style="width: 480px;">
<div data-v-5f91e4be="" class="primary-color-bg card-header">批量下单</div>
<uni-card title="" :isFull="true" style="background-color: #ecf5ff; margin-top: 10px; margin: 10px;">
<text>
<ui style="color: #409eff;">
<span style="font-weight: bold; font-size: 17px;">批量下单简介</span>
<li>批量下单自动检测地址是否激活,没激活自动激活。激活收费单价 </li>
<li>如配置下面检测地址USDT大于指定值才激活代理资源,将根据地址USDT值有条件下单 </li>
</ui>
</text>
</uni-card>

<textarea placeholder="请输入批量提交的地址,一行一个地址" style="width: 100%; height: 200px;"></textarea>

</view>
</template>

3318235450-5bBcR

uinapp使用div搭建一个多行输入文本框无限换行输入地址:请输入批量提交的地址,一行一个地址,如下:
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ附加完整代码

Avatar
Avatar

<div style="width: 480px;">
<div class="address-input">
<label for="address-input">请输入批量提交的地址,一行一个地址:</label>
<div contenteditable="true" id="address-input" style="border: 1px solid #ccc; padding: 5px; min-height: 100px;"></div>
</div>
</div>

<style>
.address-input {
margin-top: 10px;
width: 100%;
}
</style>

3318235450-5bBcR
	<div contenteditable="true" v-model="addressList" type="textarea" @input="handleInput"   style="width: 94%; text-align: left; border: 1px solid #409eff; margin: 10px; padding: 5px; min-height: 100px;">
		</div> 在以上的div中显示"请输入批量提交的地址,一行一个地址,如下: 

TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ
......"颜色灰色附加完整带啊吗

Avatar
Avatar

<div contenteditable="true" v-model="addressList" type="textarea" @input="handleInput" style="width: 94%; text-align: left; border: 1px solid #409eff; margin: 10px; padding: 5px; min-height: 100px; color: grey;">
请输入批量提交的地址,一行一个地址,如下:<br>
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ<br>
TQE267x5xy94T4UnTwaEZbNm3t1FbTsqHZ<br>
......
</div>

3318235450-5bBcR

//注册方法
scsenrollTo() {
const reg = /^(?=.[a-zA-Z])(?=.\d).{10,18}$/;
if (!this.registerForm.username) {
uni.showToast({
title: '请输入账号!',
icon: 'none'
});
return false;
}

			if (!this.registerForm.password) {
				uni.showToast({
					title: '请输入密码!',
					icon: 'none'
				});
				return false;
			}

			if (this.registerForm.confirmPassword) {
				if (this.registerForm.confirmPassword !== this.registerForm.password) {
					uni.showToast({
						title: '你的密码不一致!',
						icon: 'none'
					});
					return false;
				}
			}

			if (password.length < 6) {
				uni.showToast({
					title: '密码长度不能少于6位!',
					icon: 'none'
				});
				return false;
			}
			axios.post("http://localhost:8080/register", registerForm)
				.then(res => {
					console.log(res);
					if (res.data.code === 200) {
						uni.showToast({
							title: '注册成功',
							icon: 'none'
						});
					} else {
						uni.showToast({
							title: '注册失败',
							icon: 'none'
						});
					}
				})
				.catch(error => {
					console.error("Registration error:", error);

					// Handle error, show appropriate message
				});

			return true;
		},优化以上的代码,实现非空验证密码不能为空、密码长度不能少于6位,密码不一致、验证码不能为空、验证码输入错误附加完整代码
Avatar
Avatar

//注册方法
scsenrollTo() {
const reg = /^(?=.[a-zA-Z])(?=.\d).{10,18}$/;

if (!this.registerForm.username || !this.registerForm.password || !this.registerForm.confirmPassword || !this.registerForm.captcha) {
uni.showToast({
title: '请输入完整信息!',
icon: 'none'
});
return false;
}

if (this.registerForm.password !== this.registerForm.confirmPassword) {
uni.showToast({
title: '密码不一致!',
icon: 'none'
});
return false;
}

if (this.registerForm.password.length < 6) {
uni.showToast({
title: '密码长度不能少于6位!',
icon: 'none'
});
return false;
}

axios.post("http://localhost:8080/register", this.registerForm)
.then(res => {
console.log(res);
if (res.data.code === 200) {
uni.showToast({
title: '注册成功',
icon: 'none'
});
} else {
uni.showToast({
title: '注册失败',
icon: 'none'
});
}
})
.catch(error => {
console.error("Registration error:", error);

  // Handle error, show appropriate message
});

return true;
}

3318235450-5bBcR

scsenrollTo() {
if (!this.registerForm.username || !this.registerForm.password) {
uni.showToast({
title: '请输入账号或密码!',
icon: 'none'
});
return false;
}

			if (this.registerForm.password !== this.registerForm.confirmPassword) {
				uni.showToast({
					title: '密码不一致!',
					icon: 'none'
				});
				return false;
			}
			if (this.registerForm.password.length < 6) {
				uni.showToast({
					title: '密码长度不能少于6位!',
					icon: 'none'
				});
				return false;
			}
			if (this.registerForm.code === '') {
				uni.showToast({
					title: '请输入验证码',
					icon: 'none'
				});
				return;
			}
			axios.post("http://localhost:8080/register", this.registerForm)
				.then(res => {
					console.log(res);
					if (res.data.code === 200) {
						uni.showToast({

							title: '注册成功',
							icon: 'none'
						});
					} else {
						uni.showToast({
							title: '注册失败',
							icon: 'none'
						});
					}
				})
				.catch(error => {
					console.error("Registration error:", error);
				});
			this.emptys();
			return true;
		},在以上的代码中实现注册成功后跳转到登录页面去附加完整代码
Avatar
Avatar

scsenrollTo() {
if (!this.registerForm.username || !this.registerForm.password) {
uni.showToast({
title: '请输入账号或密码!',
icon: 'none'
});
return false;
}

if (this.registerForm.password !== this.registerForm.confirmPassword) {
uni.showToast({
title: '密码不一致!',
icon: 'none'
});
return false;
}

if (this.registerForm.password.length < 6) {
uni.showToast({
title: '密码长度不能少于6位!',
icon: 'none'
});
return false;
}

if (this.registerForm.code === '') {
uni.showToast({
title: '请输入验证码',
icon: 'none'
});
return;
}

axios.post("http://localhost:8080/register", this.registerForm)
.then(res => {
console.log(res);
if (res.data.code === 200) {
uni.showToast({
title: '注册成功',
icon: 'none'
});

    setTimeout(() => {
      uni.navigateTo({
        url: '/pages/login/login'
      });
    }, 2000); // 2 second delay before navigating to login page
  } else {
    uni.showToast({
      title: '注册失败',
      icon: 'none'
    });
  }
})
.catch(error => {
  console.error("Registration error:", error);
});

this.emptys();
return true;
}