onReady: function () {
var that = this
wx.cloud.callFunction({
name: 'getUserList',
data:{
id:that.data.pass_id
},
success: res => {
that.setData({
shop:res.result.list[0]
})
// console.log(that.data.shop)
const db = wx.cloud.database({})
db.collection('user_pic').where({
_openid:that.data.shop._openid
}).get({
success:function(res){
// console.log(res.data)
if(res.data.length != 0){
var devpic_str = res.data[0].devPic
devpic_str = devpic_str.substr(0,devpic_str.length-1);
var strs=devpic_str.split(","); //字符分割
that.setData({
user_pic:strs
})
}
}
})
}
})
//获取投递职位名称
wx.cloud.callFunction({
name: 'getmyTd2',
data:{
opid:that.data.pass_id
},
complete: res => {
var ls_list = res.result.list
var ep_list = []
ls_list.forEach(element => {
ep_list.push( element.job_detail[0].job_name)
});
that.setData({
sq_list:ep_list,
})
}
})
},
onLoad: function (options) {
var that = this
that.setData({
pass_id:options.id
})
console.log(that.data.pass_id)
wx.cloud.callFunction({
name: 'getmyTd',
complete: res => {
that.setData({
shop:res.result.list,
page: 1,
pages: 20,
title:'我的投递',
})
if(res.errMsg == "cloud.callFunction:ok"){
that.isLoading = false
wx.stopPullDownRefresh();
setTimeout(function(){
wx.hideLoading()
},500)
}
}
})
},
能渲染出来,就是不知道为什么会偶尔出现偶尔出现了又消失了,有时候干脆没有显示
检查下你的数据是否正常请求成功来了