Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-12-20 18:21:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cec3d0d2a03b2a51ba6ccf664c9d07edb51173c9
cec3d0d2
1 parent
423ee345
fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
src/pages/myInfo/index.vue
src/pages/myInfo/index.vue
View file @
cec3d0d
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-20 18:
02:5
7
* @LastEditTime: 2023-12-20 18:
20:3
7
* @FilePath: /meihuaApp/src/pages/myInfo/index.vue
* @Description: 我的信息页面
-->
...
...
@@ -28,7 +28,7 @@
<nut-col span="4">电话</nut-col>
<nut-col span="20">
<view class="wrapper">
<nut-input v-model="tel" placeholder="请输入电话" :border="false" type="number" />
<nut-input v-model="tel" placeholder="请输入电话" :border="false" type="number"
max-length="11"
/>
</view>
</nut-col>
</nut-row>
...
...
@@ -68,13 +68,33 @@ const uploadImg = () => {
})
}
const isValidTel = (tel) => {
return /^1\d{10}$/.test(tel);
}
const save = () => {
console.warn(username.value, tel.value);
Taro.showToast({
title: '保存成功',
icon:'success',
duration: 2000
});
if (!isValidTel(tel.value) ||!username.value) {
Taro.showToast({
title: '请检查输入项',
icon: 'error',
duration: 2000
});
return;
} else {
Taro.showToast({
title: '保存成功',
icon: 'success',
duration: 1000,
success: () => {
setTimeout(() => {
Taro.reLaunch({
url: '/pages/my/index'
})
}, 1000);
}
});
}
}
</script>
...
...
Please
register
or
login
to post a comment