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

13
src/pages/setter/passwordpage.vue

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

Loading…
Cancel
Save