You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { getAssociationDetail } from "../../utils/api"
|
|
|
|
|
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
associationInfo: {
|
|
|
|
groupAvatar: "",
|
|
|
|
nickname: "",
|
|
|
|
groupName: ""
|
|
|
|
},
|
|
|
|
state: 0,
|
|
|
|
description: ""
|
|
|
|
},
|
|
|
|
onShow () {
|
|
|
|
|
|
|
|
},
|
|
|
|
onLoad (options) {
|
|
|
|
this.getAssociationDetail(options.id)
|
|
|
|
this.setData({
|
|
|
|
state: options.state,
|
|
|
|
description: decodeURIComponent(options.description)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 获取社区详情
|
|
|
|
getAssociationDetail (id) {
|
|
|
|
getAssociationDetail(id).then( res => {
|
|
|
|
console.log("社群详情", res)
|
|
|
|
const associationInfo = {}
|
|
|
|
for (const key in this.data.associationInfo) {
|
|
|
|
associationInfo[key] = res.data[key]
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
associationInfo
|
|
|
|
})
|
|
|
|
}).catch(err => {
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|