1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <view class="OutermostLayer">
- <h4>登录密码修改</h4>
- <view class="xgmy">
- <u--form labelPosition="left" labelWidth='180' :model="model1" :rules="rules" ref="form1">
- <u-form-item label="旧登录密码" prop="userInfo.oldpasswoed" borderBottom ref="item1">
- <u--input v-model="model1.userInfo.oldpasswoed" border="surround"></u--input>
- </u-form-item>
- <u-form-item label="新登录密码" prop="userInfo.mewpasswoed1" borderBottom ref="item1">
- <u--input v-model="model1.userInfo.mewpasswoed1" border="surround"></u--input>
- </u-form-item>
- </u-form-item>
- <u-form-item label="请再次输入" prop="userInfo.mewpasswoed2" borderBottom ref="item1">
- <u--input v-model="model1.userInfo.mewpasswoed2" border="surround"></u--input>
- </u-form-item>
-
- </u--form>
- <view class="tijiao">
- <u-button type="primary" @click="submit">确定修改</u-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- model1: {
- userInfo: {
- oldpasswoed: '',
- mewpasswoed1: '',
- mewpasswoed2: '',
- },
- },
- rules: {
- 'userInfo.oldpasswoed': {
- type: 'string',
- required: true,
- message: '请填写旧登录密码',
- trigger: ['blur', 'change']
- },
- 'userInfo.mewpasswoed1': {
- type: 'string',
- required: true,
- message: '请填写新登录密码',
- trigger: ['blur', 'change']
- },
- 'userInfo.mewpasswoed2': {
- type: 'string',
- required: true,
- message: '请填写新登录密码',
- trigger: ['blur', 'change']
- },
- },
- };
- },
- onReady() {
- //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
- this.$refs.form1.setRules(this.rules)
- },
- methods: {
- submit() {
- this.$refs.form1.validate().then(res => {
- if(this.model1.userInfo.mewpasswoed1!=this.model1.userInfo.mewpasswoed2){
- uni.$u.toast('您的新密码不一致,请重新输入')
- }else{
- uni.$u.toast('校验通过')
- }
-
- }).catch(errors => {
- uni.$u.toast('校验失败')
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .tijiao {
- margin-top: 50rpx;
- padding-bottom: 30rpx;
- }
- .xgmy{
- padding: 20rpx;
- }
- .OutermostLayer h4 {
- font-size: 35rpx;
- margin-bottom: 10rpx;
- padding-top: 20rpx;
- text-align: center;
- }
- </style>
|