first commit
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<view style="margin: 20rpx 20rpx; padding: 20rpx; ">
|
||||
<up-form v-if="type==1" labelPosition="left" labelWidth='90' :model="password" ref="form1">
|
||||
<up-form-item label="姓名" prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input clearable='true' placeholder="请输入联系人姓名" border="none"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item label="手机号" prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input clearable='true' placeholder="请输入手机号" border="none"></up-input>
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
<up-form v-else labelPosition="left" labelWidth='90' :model="password" ref="form1">
|
||||
|
||||
<up-form-item label="手机号" prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input clearable='true' placeholder="请输入手机号" border="none"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input clearable='true' placeholder="请输入手机号" border="none">
|
||||
<template #suffix>
|
||||
<up-code :seconds="seconds" @end="end" @start="start" ref="uCodeRef" @change="codeChange"></up-code>
|
||||
<up-button @tap="getCode">{{tips}}</up-button>
|
||||
</template>
|
||||
</up-input>
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
|
||||
|
||||
<view class="" style=" position: fixed; bottom: 0; left: 0; width: 100%; padding: 20rpx; ">
|
||||
<button @click="save()" :disabled='!password.password || !password.code ' class="logout-btn">确认修改</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { Service } from "../../Service/Service";
|
||||
|
||||
const tips = ref('');
|
||||
const seconds = ref(10);
|
||||
const uCodeRef = ref(null);
|
||||
|
||||
let password = ref({
|
||||
password: '',
|
||||
code: ''
|
||||
})
|
||||
|
||||
let type = ref(1)
|
||||
onLoad((data : any) => {
|
||||
if (data.type == 1) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改手机号'
|
||||
})
|
||||
}
|
||||
type.value = data.type
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
const save = () => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const codeChange = (text) => {
|
||||
tips.value = text;
|
||||
};
|
||||
|
||||
const getCode = () => {
|
||||
|
||||
if (uCodeRef.value.canGetCode) {
|
||||
// 模拟向后端请求验证码
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码',
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被start()方法中的提示覆盖
|
||||
Service.Msg('验证码已发送')
|
||||
uCodeRef.value.start();
|
||||
}, 2000);
|
||||
} else {
|
||||
Service.Msg('倒计时结束后再发送')
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
const end = () => {
|
||||
|
||||
};
|
||||
|
||||
const start = () => {
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.logout-btn {
|
||||
background-color: var(--nav-banbacor);
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
border-radius: 10rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.logout-btn:active {
|
||||
background-color: #f7f7f7;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user