Browse Source

page/setter 文件迁移 8/8-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
91140e285a
  1. 2
      src/pages/setter/index.vue
  2. 13
      src/pages/setter/passwordpage.vue

2
src/pages/setter/index.vue

@ -22,7 +22,7 @@
</u-cell-group>
</view>
<view>
<view style="padding-bottom: 120rpx;">
<button class="footbtn" @click="handlerlogout">退出登录</button>
</view>
</view>

13
src/pages/setter/passwordpage.vue

@ -14,6 +14,7 @@
<view class="new_btn_bot">
<button class="new_save_btn" @click="submit">确认修改</button>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -21,12 +22,13 @@
import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import { updateUserPwd } from '@/api/request2.js'
import {navigateBack,} from '@/common/basic.js';
const formData = ref({
oldpassword: '',
newpassword: '',
newpassword2: ''
})
const comMessage = ref(null)
const rules = ref({
oldpassword: [{ required: true, message: '请输入密码', trigger: ['change', 'blur'] }],
// name
@ -68,13 +70,22 @@ const submit = () => {
console.log(valid)
if (valid) {
updateUserPwd(formData.value.oldpassword, formData.value.newpassword).then((ress) => {
if(ress.data){
this.showCommitSuccessMessage("修改成功")
}
console.log('返回结果:', ress)
})
} else {
console.log('表单错误信息:', err)
}
})
}
const showCommitSuccessMessage = (hint)=> {
comMessage.value.showSuccessMessage(hint, res => {
navigateBack(1)
})
}
onReady(() => {
form.value.setRules(rules.value)
})

Loading…
Cancel
Save