45
chenyc
2022-10-27 ec62e93bf5570acc20eaa71b11b7c33e5d162f89
src/views/myMine/index.vue
@@ -7,7 +7,7 @@
                        round
                        width="50px"
                        height="50px"
                        src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
                        :src="patientInfo.patientInfo.patientAvatarIcon"
                    />
                </div>
                <div class="rowtext">
@@ -32,13 +32,14 @@
                    <div class="div3">{{patientInfo.patientInfo.patientCardNo}} </div>
                </van-col>
                <van-col span="8" class="info8">
                    <div class="img">
                    <div class="img" @click="imgShow">
                        <img
                            preview="1"
                            style=" width: 55px;height: 55px;margin-left: 8%; margin-top: 15px;"
                            referrerpolicy="no-referrer"
                            :src="patientInfo.patientInfo.patientAvatarIcon"
                            :src="erweima"
                        />
                        <div class="devcc">出示称重码</div>
                        <div class="devcc">出示患者码</div>
                    </div>
                </van-col>
            </van-row>
@@ -101,8 +102,18 @@
            </div>
        </div>
        <div class="ButtonBody">
            <van-button type="primary" round block>退出登录</van-button>
            <van-button type="primary" @click="logOUT" round block>退出登录</van-button>
        </div>
        <van-popup v-model:show="show">
            <div class="imgcla">
                <img
                    preview="1"
                    style=" width: 350px;height: 350px;"
                    referrerpolicy="no-referrer"
                    :src="erweiImg"
                />
            </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>
@@ -111,13 +122,18 @@
</template>
<script lang="ts" setup>
    import { ref,computed } from 'vue'
    import {ajaxPost} from '@/utils/axios'
    import { Session } from '@/utils/storage'
    import { userInfoStore } from '@/stores/userInfo'
    import serve1 from './imgs/serve1.png'
    import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem} from 'vant'
    import erweima from './imgs/erwm.png'
    // import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem} from 'vant'
    import {useRouter} from 'vue-router'
    const router=useRouter()
    const userInfo = userInfoStore()
    const active=ref('my')
    const show=ref(false)
    const erweiImg=ref('')
    const tabChang=(index:any)=>{
        if (index==='home'){
            router.push('/')
@@ -125,15 +141,34 @@
            router.push('my')
        }
    }
    const imgShow=()=>{
        show.value=true
        ajaxPost('/patient/info/showQRCode',`patientCode=${patientInfo.value.patientInfo.code}&isForceLoad=1`).then((res:any)=>{
            show.value=true
            erweiImg.value=res
        })
    }
    const patientInfo=computed(()=>{
        return userInfo.patient
    })
    const logOUT=()=>{
        ajaxPost('/patient/info/logout','').then((re:any)=>{
            console.log(re)
            Session.clear() // 清除缓存/token等
            router.push('login')
        })
    }
</script>
<style lang="scss" scoped>
    body{
        background-color:#166bd3;
    }
.page{
    .imgcla{
        width: 350px;
        min-height: 350px;
        border: #777777 1px solid;
    }
    background-color:#F6FAFF;
    position:relative;
    min-width: 375px;