chenyc
2022-10-28 ae03ada5c6087adcddbfa0062b2c98317e9e9a42
add修改密码
2个文件已修改
1个文件已添加
101 ■■■■■ 已修改文件
src/App.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/myMine/imgs/serve6.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/myMine/index.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -10,8 +10,8 @@
    import { userInfoStore } from '@/stores/userInfo'
    import { ajaxPost} from '@/utils/axios'
    const userInfo = userInfoStore()
    const token =Session.get('token')
    // const token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJQQVRfU0ZfUEFUMjQ0MTUyMTM4MzcwMjgyN19TRl8iLCJhdXRoIjpbeyJhdXRob3JpdHkiOiJhZG1pbiJ9XSwiaWF0IjoxNjY2ODQ4OTI4LCJleHAiOjE2NjcyMDg5Mjh9.R7BtrJHJJFywW6bytMWB6EVVYdD5rpMZQAcVnQG-8t4'
    // const token =Session.get('token')
    const token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJQQVRfU0ZfUEFUMjQ0MTUyMTM4MzcwMjgyN19TRl8iLCJhdXRoIjpbeyJhdXRob3JpdHkiOiJhZG1pbiJ9XSwiaWF0IjoxNjY2ODQ4OTI4LCJleHAiOjE2NjcyMDg5Mjh9.R7BtrJHJJFywW6bytMWB6EVVYdD5rpMZQAcVnQG-8t4'
    if (token){
        Session.set('token', token)
        console.log('token='+Session.get('token '))
src/views/myMine/imgs/serve6.png
src/views/myMine/index.vue
@@ -61,7 +61,7 @@
                    <van-col span="6" class="serveItem">
                        <div>
                            <van-image
                                :src="serve1"
                                :src="serve2"
                            />
                        </div>
                        <div>
@@ -71,7 +71,7 @@
                    <van-col span="6" class="serveItem">
                        <div>
                            <van-image
                                :src="serve1"
                                :src="serve3"
                            />
                        </div>
                        <div>
@@ -81,7 +81,7 @@
                    <van-col span="6" class="serveItem">
                        <div>
                            <van-image
                                :src="serve1"
                                :src="serve4"
                            />
                        </div>
                        <div>
@@ -91,11 +91,21 @@
                    <van-col span="6" class="serveItem">
                        <div>
                            <van-image
                                :src="serve1"
                                :src="serve5"
                            />
                        </div>
                        <div>
                            智慧云客服
                        </div>
                    </van-col>
                    <van-col span="6" @click="show2 = true" class="serveItem">
                        <div>
                            <van-image
                                :src="serve6"
                            />
                        </div>
                        <div>
                            更改密码
                        </div>
                    </van-col>
                </van-row>
@@ -114,6 +124,38 @@
                />
            </div>
        </van-popup>
        <van-popup v-model:show="show2" :style="{ height: '30%' }">
            <div class="formbiaodan">
                <van-form @submit="onSubmitUpPssword" label-width="80px">
                    <van-cell-group inset>
                        <van-field
                            v-model="ruleForm.pass"
                            type="password"
                            label="密&nbsp&nbsp码"
                            placeholder="6-16位数字或者字母组合"
                            :rules="[{ required: true, message: '请填写密码' }]"
                        />
                        <van-field
                            v-model="ruleForm.newPassword"
                            type="password"
                            label="确认密码"
                            placeholder="6-16位数字或者字母组合"
                            :rules="[{ validator: asyncValidator, message: '密码输入不一致' }]"
                        />
                    </van-cell-group>
                    <div style="margin: 16px;">
                        <van-button :loading="loadingBUt" round block type="primary" native-type="submit">
                            提交
                        </van-button>
                    </div>
                    <div style="text-align: right; padding-right: 20px;">
                        <span type="primary" @click="show2 = false" native-type="submit">
                            取消
                        </span>
                    </div>
                </van-form>
            </div>
        </van-popup>
        <van-tabbar v-model="active" @change="tabChang">
            <van-tabbar-item name="home" icon="like">首页</van-tabbar-item>
            <van-tabbar-item name="my" icon="manager">我的</van-tabbar-item>
@@ -126,14 +168,28 @@
    import { Session } from '@/utils/storage'
    import { userInfoStore } from '@/stores/userInfo'
    import serve1 from './imgs/serve1.png'
    import serve2 from './imgs/serve2.png'
    import serve3 from './imgs/serve3.png'
    import serve4 from './imgs/serve4.png'
    import serve5 from './imgs/serve5.png'
    import serve6 from './imgs/serve6.png'
    import erweima from './imgs/erwm.png'
    // import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem} from 'vant'
    import {useRouter} from 'vue-router'
    import { Dialog } from 'vant'
    const router=useRouter()
    const userInfo = userInfoStore()
    const active=ref('my')
    const ruleForm=ref({
        newPassword:'',
        pass:'',
    })
    const loadingBUt= ref(false)
    const show=ref(false)
    const show2=ref(false)
    const erweiImg=ref('')
    const asyncValidator = (val:any) =>{
        return val===ruleForm.value.pass
    }
    const tabChang=(index:any)=>{
        if (index==='home'){
            router.push('/')
@@ -151,6 +207,33 @@
    const patientInfo=computed(()=>{
        return userInfo.patient
    })
    const onSubmitUpPssword=(values:any)=>{
        console.log('提交表单',ruleForm.value)
        console.log(values)
        const pams={
            patientCode:patientInfo.value.patientInfo.code,
            password:ruleForm.value.pass
        }
        loadingBUt.value=true
        ajaxPost('/patient/info/resetPassword',pams).then((re:any)=>{
            console.log(re)
            loadingBUt.value=false
            if (re==='OK'){
                show2.value=false
                Dialog.alert({
                    title: '提示',
                    message: '密码重置成功',
                }).then(() => {
                    // on close
                })
            }
        }).catch(err=>{
            loadingBUt.value=false
            console.log(err)
        })
    }
    const logOUT=()=>{
        ajaxPost('/patient/info/logout','').then((re:any)=>{
            console.log(re)
@@ -169,6 +252,10 @@
        min-height: 350px;
        border: #777777 1px solid;
    }
    .formbiaodan{
        padding-top: 30px;
        width: 350px;
    }
    background-color:#F6FAFF;
    position:relative;
    min-width: 375px;