Browse Source

在会员编辑界面,当存在个人生平页时,二维码是个人生平页,否则是默认页

Alex 4 years ago
parent
commit
a768d9ee76
3 changed files with 26 additions and 3 deletions
  1. 8 0
      src/api/system/personalPage.js
  2. 16 1
      src/views/system/appUser/index.vue
  3. 2 2
      src/views/template/t.vue

+ 8 - 0
src/api/system/personalPage.js

@@ -80,4 +80,12 @@ export function getQrcode(param) {
     method: 'get',
     params: param
   })
+}
+
+// 根据干系人id获取总数
+export function getPersonalByUid(userId) {
+  return request({
+    url: '/system/personal/page/getByUid/' + userId,
+    method: 'get'
+  })
 }

+ 16 - 1
src/views/system/appUser/index.vue

@@ -254,6 +254,7 @@ import { listFriends } from "@/api/system/friends";
 import { listFamilyByUid } from "@/api/system/family";
 import qrcodeImg from '@/assets/image/qrcode_img.jpg'
 import { getQrcode } from "@/api/common";
+import { getPersonalByUid } from "@/api/system/personalPage";
 
 export default {
   name: "AppUser",
@@ -318,6 +319,8 @@ export default {
       },
       // 固定个人模板页
       templateRoute: "/template/t",
+      // 默认页模板
+      defaultRoute: "/template/index",
       codeImg: qrcodeImg,
       codeUrl: "",
       reFresh: 1,
@@ -497,7 +500,19 @@ export default {
     getQrcodeImg(id) {
       debugger
       const uid = id;
-      const url = window.location.origin + this.templateRoute+'/' + uid + '?type=profile'
+      var personal = {};
+      // 是否有个人生平数据
+      getPersonalByUid(uid).then(res => {
+        personal = res.data;
+      });
+      var url = null;
+
+      // 如果有则生成个人生平页,否则生成默认页
+      if(personal != null) {
+        url = window.location.origin + this.templateRoute+'/' + personal.id
+      }else {
+        url = window.location.origin + this.defaultRoute+'/' + uid
+      }
       const param = {url:url}
       getQrcode(param).then(res => {
         this.codeUrl = "data:image/gif;base64," + res.img;

+ 2 - 2
src/views/template/t.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="add-message" @click="handleOpen"> + </div>
+    <div class="add-message" @click="handleOpen"> 留言 </div>
 
     <el-form>
       
@@ -229,7 +229,7 @@ export default {
   -webkit-box-pack: center;
   -ms-flex-pack: center;
   justify-content: center;
-  font-size: 20px;
+  font-size: 12px;
   -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.12);
   box-shadow: 0 0 6px rgba(0, 0, 0, 0.12);
   cursor: pointer;