diff --git a/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.js b/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.js index 3aa3d07..dd2eea6 100644 --- a/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.js +++ b/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.js @@ -1,5 +1,5 @@ import { createQRCode } from '../../utils/api' - +var api = require('../../../../utils/api.js') Component({ data: { qrcodeValue: 'https://www.baidu.com', @@ -28,7 +28,7 @@ Component({ }, pageLifetimes: { show () { - this.createQRCode() + this.getGridList() } }, methods: { @@ -51,6 +51,30 @@ Component({ visible: false }) }, + // 获取当前用户所有网格 + getGridList() { + api.getGridList().then(res => { + res.data.forEach((item,index) => { + if(index==0){ + this.setData({ + gridId:item.gridId + }) + } + }) + this.getUserInfo() + }).catch(err => { + }) + }, + // 获取用户信息 + getUserInfo () { + api.getUserInfo().then(res => { + this.setData({ + inviteUserId:res.data.id + }) + this.createQRCode() + }).catch(err => { + }) + }, createQRCode () { const para = { gridId: '1169158285790900226', diff --git a/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.wxml b/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.wxml index 203b6d2..ecf8a1f 100644 --- a/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.wxml +++ b/epdc-resident-mp-yushan/subpages/property/components/inviteFriendDialog/inviteFriendDialog.wxml @@ -10,7 +10,7 @@ - 邀请您的好友,好友扫码注册现代榆山,再邀请好友进入社群 + 邀请您的好友,好友扫码注册现代榆山,再邀请好友进入物业群