Browse Source

二维码生成之前写的固定字段

feature/societyOrg
zhaoyongnian 4 years ago
parent
commit
b58d9078ee
  1. 32
      epdc-resident-mp-yushan/subpages/association/components/inviteFriendDialog/inviteFriendDialog.js

32
epdc-resident-mp-yushan/subpages/association/components/inviteFriendDialog/inviteFriendDialog.js

@ -1,5 +1,5 @@
import { createQRCode } from '../../utils/api' import { createQRCode } from '../../utils/api'
var api = require('../../../../utils/api.js')
Component({ Component({
data: { data: {
qrcodeValue: 'https://www.baidu.com', qrcodeValue: 'https://www.baidu.com',
@ -28,7 +28,7 @@ Component({
}, },
pageLifetimes: { pageLifetimes: {
show () { show () {
this.createQRCode() this.getGridList()
} }
}, },
methods: { methods: {
@ -51,10 +51,34 @@ Component({
visible: false 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 () { createQRCode () {
const para = { const para = {
gridId: '1169158285790900226', gridId: this.data.gridId,
inviteUserId: '31f31a620399d18a39329f663437da72' inviteUserId: this.data.inviteUserId
} }
createQRCode(para).then(res => { createQRCode(para).then(res => {
console.log('生成邀请二维码', res) console.log('生成邀请二维码', res)

Loading…
Cancel
Save