From b58d9078ee7d84d7fd169c213c4a091863ec0334 Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Thu, 8 Jul 2021 19:18:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E5=86=99=E7=9A=84=E5=9B=BA=E5=AE=9A=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inviteFriendDialog/inviteFriendDialog.js | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/epdc-resident-mp-yushan/subpages/association/components/inviteFriendDialog/inviteFriendDialog.js b/epdc-resident-mp-yushan/subpages/association/components/inviteFriendDialog/inviteFriendDialog.js index 3aa3d07..7a903fd 100644 --- a/epdc-resident-mp-yushan/subpages/association/components/inviteFriendDialog/inviteFriendDialog.js +++ b/epdc-resident-mp-yushan/subpages/association/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,10 +51,34 @@ 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', - inviteUserId: '31f31a620399d18a39329f663437da72' + gridId: this.data.gridId, + inviteUserId: this.data.inviteUserId } createQRCode(para).then(res => { console.log('生成邀请二维码', res)