| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <template>
- <view class="container">
- <view class="login-wrap">
- <view class="login-form">
- <u--form
- labelPosition="left"
- :model="userInfo"
- :rules="rules"
- ref="form1"
- >
- <u-form-item
- label="手机号"
- prop="phonenumber"
- borderBottom
- labelWidth="auto"
- labelAlign="right"
- >
- <u--input
- v-model="userInfo.phonenumber"
- placeholder="请输入账号绑定的手机号"
- border="bottom"
- type="number"
- maxlength="11"
- ></u--input>
- </u-form-item>
- </u--form>
- </view>
- </view>
- <view @click="gotoRetrieveMethod()" class="op-btn-wrap">
- <view class="h-btn">
- <text>下一步</text>
- </view>
- </view>
- <!-- 密码正确 -->
- <u-popup :show="show" :round="10" mode="center" >
- <view class="h-popo-content">
- <view class="h-img">
- <u-icon name="/static/login/u01.png" color="red" size="50"></u-icon>
- </view>
- <view class="text">
- <text>找回失败</text>
- </view>
- <view class="text">
- <text>未查询到该手机号绑定的账号</text>
- </view>
- <view class="h-btn-wrap">
- <view @click="sureClose" class="h-right-btn">
- <text>确定</text>
- </view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- show: false,
- userInfo: {
- phonenumber: ''
- },
- rules: {
- phonenumber:{
- required: true,
- min: 10,
- max: 12,
- message: '请输入11位电话号码',
- trigger: ['blur', 'change'],
- },
- },
- }
- },
- onLoad() {
- },
- onReady() {
- this.$refs.form1.setRules(this.rules)
- },
- methods: {
- // 去选择找回方式
- gotoRetrieveMethod(){
- let that = this;
- this.$refs.form1.validate().then(res => {
- that.phoneIsExist();
- }).catch(errors => {
- uni.$u.toast('校验失败,请认真填写')
- })
- },
- sureClose(){
- this.show = false;
- uni.$u.route({
- url: '/pages/login/login',
- params: {
- name: 'lisa'
- }
- })
- },
- // 验证电话号码是否存在
- phoneIsExist(){
- let that = this;
- // 验证电话号码是否存在
- phoneIsExist(null,{data:this.userInfo}).then((res)=>{
- console.log(res)
- if(res.phoneIsExist){ // 存在
- uni.$u.route({
- url: '/pages/login/retrieve-method',
- params: {
- data: that.userInfo.phonenumber
- }
- })
- } else {
- that.show = true;
- }
- }).catch(() =>{
- uni.showToast({
- title: "操作失败"
- })
- });
- },
- }
- }
- </script>
- <style lang="scss">
- page,body{
- background: #fff;
- }
- .container{
- background: #fff;
- height: 300px;
- .login-wrap {
- display: flex;
- justify-content: center;
- .login-form{
- width: 90%;
- }
- .account{
- display: flex;
- }
- .identifying-code{
- }
- }
- .op-btn-wrap{
- margin-top: 30px;
- display: flex;
- justify-content: center;
- align-items: center;
- .h-btn{
- text-align: center;
- width: 343px;
- height: 42px;
- background: #FFE05C;
- border-radius: 27px;
- line-height: 42px;
- }
- }
- }
- .h-popo-content{
- height: 170px;
- padding: 12px;
- width: 300px;
- text-align: center;
- font-size: 14px;
- font-family: PingFangSC-Semibold, PingFang SC;
- .h-img{
- display: flex;
- justify-content: center;
- }
- .h-text{
- margin-top: 12px;
- font-weight: 400;
- color: #666666;
- }
- .text{
- margin-top: 6px;
- font-weight: 400;
- color: #666666;
- }
- .h-btn-wrap{
- display: flex;
- justify-content: space-between;
- color: #333333;
- text-align: center;
- margin-top: 14px;
- .h-left-btn{
- height: 32px;
- line-height: 30px;
- background: #EEEEEE;
- width: 100px;
- text-align: center;
- border-radius: 16px;
- margin: 0 auto;
- }
- .h-right-btn{
- height: 32px;
- line-height: 30px;
- background: #FFE05C;
- width: 100px;
- border-radius: 16px;
- margin: 0 auto;
- }
- }
- }
- </style>
|