榆山数据端小程序
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.
 
 

62 lines
1.5 KiB

// miniprogram/subpages/leaderModel/pages/commentDetail/commentDetail.js
import { getOfficerEvaDetail } from '../../../../api/leaderComment'
import {formatTimestamp} from '../../../../utils/common'
Page({
data: {
evaluateType:'',//统计类型:1.点赞,2.吐槽
officerid:'',
someMonthsType:'',
name:'',
dataTime:"",
nowTime:formatTimestamp().slice(0,11),
position:'',
timesTotal:'',//次数
numberTotal:'',//人数
optionList:[],
loadVisible: false,
loadType: 'more',
showDetail:true
},
onLoad: function (options) {
console.log(options)
this.setData({
evaluateType:options.evaluateType,
officerid:options.officerId,
someMonthsType:options.someMonthsType
})
this.getOfficerEvaDetail()
},
async getOfficerEvaDetail(){
this.setData({
loadVisible:true,
showDetail:false
})
let obj = {
officerId:this.data.officerid,
someMonthsType:this.data.someMonthsType,
evaluateType:this.data.evaluateType
}
try{
let res:any= await getOfficerEvaDetail(obj)
this.setData({
name:res.data.name,
dataTime:res.data.dataTime.slice(0,11),
position:res.data.position,
timesTotal:res.data.timesTotal,
numberTotal:res.data.numberTotal,
optionList:res.data.optionList,
loadVisible:false,
showDetail:true
})
}catch{
this.setData({
loadVisible:false,
showDetail:true
})
}
}
})