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.
57 lines
1.0 KiB
57 lines
1.0 KiB
2 years ago
|
//answer.js
|
||
|
|
||
|
|
||
|
var app = getApp()
|
||
|
Page({
|
||
|
data: {
|
||
|
motto: '知乎--微信小程序版',
|
||
|
userInfo: {},
|
||
|
feed: [],
|
||
|
},
|
||
|
//事件处理函数
|
||
|
toQuestion: function() {
|
||
|
wx.navigateTo({
|
||
|
url: '../question/question'
|
||
|
})
|
||
|
},
|
||
|
onLoad: function (options) {
|
||
|
var aid=options.aid
|
||
|
console.log(options);
|
||
|
console.log(options.aid);
|
||
|
console.log('onLoad')
|
||
|
var that = this
|
||
|
//调用应用实例的方法获取全局数据
|
||
|
/*app.getUserInfo(function(userInfo){
|
||
|
//更新数据
|
||
|
that.setData({
|
||
|
userInfo:userInfo
|
||
|
})
|
||
|
})*/
|
||
|
wx.cloud.database().collection('tiezi')
|
||
|
.where({
|
||
|
_id:aid
|
||
|
})
|
||
|
.get({
|
||
|
success(res) {
|
||
|
console.log("请求成功", res)
|
||
|
that.setData({
|
||
|
feed:res.data
|
||
|
}),
|
||
|
console.log(res.data)
|
||
|
},
|
||
|
fail(res) {
|
||
|
console.log("请求失败", res)
|
||
|
}
|
||
|
})
|
||
|
|
||
|
},
|
||
|
/*
|
||
|
onLoad: function (options) {
|
||
|
|
||
|
},*/
|
||
|
tapName: function(event){
|
||
|
console.log(event)
|
||
|
},
|
||
|
|
||
|
})
|