|
@@ -50,13 +50,13 @@
|
|
|
<div class="tab-user-content">
|
|
|
<div class="user_info">
|
|
|
<div class="user_img">
|
|
|
- <img class="img-user" src="@/assets/icon/icon-user-2x.png" onerror="this.src='@/assets/icon/icon-user-2x.png'" />
|
|
|
+ <b-image v-if="loadImage" :file-ref-id="user.userID" :readonly="true" :is-single="true"></b-image>
|
|
|
</div>
|
|
|
<div class="user_text">
|
|
|
<h2>{{user.name}}</h2>
|
|
|
<p>驿站工作人员</p>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div class="qr_img">
|
|
|
<img :src="infoQrcodeUrl" :style="imgStyle">
|
|
|
</div>
|
|
|
</div>
|
|
@@ -88,10 +88,14 @@
|
|
|
import { alertController } from '@ionic/vue';
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
import router from '@/router';
|
|
|
-import {getCurrentInstance, onMounted, onUpdated, ref} from "vue";
|
|
|
+import {getCurrentInstance, onMounted, onUpdated, ref, watch} from "vue";
|
|
|
import {getConfig} from "@/utils/config";
|
|
|
import {getQRCodeUrlToBase64} from "@/api/wechat";
|
|
|
import {base64ToBlob} from "@/utils/imageUtils";
|
|
|
+import BImage from "@/components/bImage.vue";
|
|
|
+import {useRouter} from "vue-router";
|
|
|
+
|
|
|
+const $router = useRouter();
|
|
|
|
|
|
const infoQrcodeUrl = ref("");
|
|
|
const { appContext : { config: { globalProperties } } } = getCurrentInstance();
|
|
@@ -110,12 +114,13 @@ const imgStyle = ref({
|
|
|
height: '0px',
|
|
|
margin: '0px 0px 0px 40px'
|
|
|
});
|
|
|
+const loadImage = ref(true);
|
|
|
|
|
|
const updateBrowserWidth = () => {
|
|
|
const browserWidth = window.innerWidth;
|
|
|
imgStyle.value.width = (browserWidth - 130) / 3 + 'px';
|
|
|
imgStyle.value.height = (browserWidth - 130) / 3 + 'px';
|
|
|
- imgStyle.value.margin = '0px 0px 0px '+(browserWidth - 200) / 4 + 'px';
|
|
|
+ imgStyle.value.margin = '0px 0px 0px ' + (browserWidth - 200) / 15 + 'px';
|
|
|
}
|
|
|
// 设置初始浏览器宽度
|
|
|
updateBrowserWidth();
|
|
@@ -147,6 +152,16 @@ const presentAlert = async () => {
|
|
|
await alert.present();
|
|
|
}
|
|
|
|
|
|
+// 监听路由变化
|
|
|
+watch(() => $router.currentRoute.value.path, (to, form) => {
|
|
|
+ if (form == "/tabs/tabUser/myInfo" && to == "/tabs/tabUser") {
|
|
|
+ loadImage.value = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ loadImage.value = true;
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+}, {immediate: true});
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getConfig().then((res: any) => {
|
|
|
isDev.value = res.isDev;
|
|
@@ -249,6 +264,7 @@ onMounted(() => {
|
|
|
.user_info{
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
margin: 90px 10px 10px 10px;
|
|
|
padding: 10px;
|
|
|
border-radius: 10px;
|
|
@@ -301,5 +317,15 @@ onMounted(() => {
|
|
|
|
|
|
}
|
|
|
|
|
|
+.user_img {
|
|
|
+ .img-list {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .img-item {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
</style>
|