Commit e791f32c authored by lizhan's avatar lizhan

📝 【TASK-20240812-02】TASK:个人信息必填校验

parent e68a29bc
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="start-bar"></view> <view class="start-bar"></view>
<view class="consultAdd"> <view class="consultAdd">
<view class="consult-item"> <view class="consult-item">
<view class="consult-item-label"> <view class="consult-item-label required-icon">
<text>{{ $lang.lang.myInfo.name }}</text> <text>{{ $lang.lang.myInfo.name }}</text>
</view> </view>
<view class="consult-item-put"> <view class="consult-item-put">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="consult-item"> <view class="consult-item">
<view class="consult-item-label"> <view class="consult-item-label required-icon">
<text>{{ $lang.lang.myInfo.nameEn }}</text> <text>{{ $lang.lang.myInfo.nameEn }}</text>
</view> </view>
<view class="consult-item-put"> <view class="consult-item-put">
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</view> </view>
</view> </view>
<view class="consult-item"> <view class="consult-item">
<view class="consult-item-label"> <view class="consult-item-label required-icon">
<text>{{ $lang.lang.myInfo.country }}</text> <text>{{ $lang.lang.myInfo.country }}</text>
</view> </view>
<view class="consult-item-put"> <view class="consult-item-put">
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</view> </view>
</view> </view>
<view class="consult-item"> <view class="consult-item">
<view class="consult-item-label"> <view class="consult-item-label required-icon">
<text>{{ $lang.lang.myInfo.city }}</text> <text>{{ $lang.lang.myInfo.city }}</text>
</view> </view>
<view class="consult-item-put"> <view class="consult-item-put">
...@@ -200,6 +200,34 @@ export default { ...@@ -200,6 +200,34 @@ export default {
}, },
methods: { methods: {
submitForm() { submitForm() {
if (!this.params.nickname) {
uni.showToast({
title: this.$lang.lang.notices.nickName,
icon: 'none'
})
return
}
if (!this.params.englishName) {
uni.showToast({
title: this.$lang.lang.notices.nameEn,
icon: 'none'
})
return
}
if (!this.params.country) {
uni.showToast({
title: this.$lang.lang.notices.country,
icon: 'none'
})
return
}
if (!this.params.city) {
uni.showToast({
title: this.$lang.lang.notices.city,
icon: 'none'
})
return
}
this.$request.put('/app-api/member/user/update', this.params).then((res) => { this.$request.put('/app-api/member/user/update', this.params).then((res) => {
if (res.code == 0) { if (res.code == 0) {
if (this.first) { if (this.first) {
...@@ -465,4 +493,14 @@ radio { ...@@ -465,4 +493,14 @@ radio {
.placeholder { .placeholder {
color: #666666; color: #666666;
} }
.required-icon {
position: relative;
}
.required-icon::after {
content: '*';
color: red;
position: absolute;
left: -14upx;
top: 16upx;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment