Bladeren bron

修改会员编辑生成生平二维码

Alex 4 jaren geleden
bovenliggende
commit
a52bf5ad6a
1 gewijzigde bestanden met toevoegingen van 10 en 8 verwijderingen
  1. 10 8
      src/views/system/appUser/index.vue

+ 10 - 8
src/views/system/appUser/index.vue

@@ -317,6 +317,7 @@ export default {
         pageSize: 10,
         userId: null,
       },
+      personal: null,
       // 固定个人模板页
       templateRoute: "/template/t",
       // 默认页模板
@@ -439,7 +440,7 @@ export default {
       const id = row.userId || this.ids;
       getUser(id).then(response => {
         this.form = response.data;
-        this.getQrcodeImg(id);
+        this.getPersonal(id);
         this.open = true;
         this.title = "修改会员";
       });
@@ -495,21 +496,22 @@ export default {
         }).then(response => {
           this.download(response.msg);
         }).catch(function() {});
+    },
+    getPersonal(uid){
+      getPersonalByUid(uid).then(res => {
+        this.personal = res.data;
+        this.getQrcodeImg(uid);
+      });
     }
     ,
     getQrcodeImg(id) {
       debugger
       const uid = id;
-      var personal = {};
       // 是否有个人生平数据
-      getPersonalByUid(uid).then(res => {
-        personal = res.data;
-      });
       var url = null;
-
       // 如果有则生成个人生平页,否则生成默认页
-      if(personal != null) {
-        url = window.location.origin + this.templateRoute+'/' + personal.id
+      if(this.personal != null) {
+        url = window.location.origin + this.templateRoute+'/' + this.personal.id
       }else {
         url = window.location.origin + this.defaultRoute+'/' + uid
       }