优化
This commit is contained in:
@@ -36,7 +36,7 @@ Page({
|
||||
onReachBottom() {
|
||||
console.log('===触底了!!===');
|
||||
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
|
||||
this.getDoctorEvaluationList()
|
||||
this.getDoctorEvaluationList(this.data.evaluation_type)
|
||||
}
|
||||
},
|
||||
onLoad(option){
|
||||
@@ -48,7 +48,7 @@ Page({
|
||||
},
|
||||
onShow(){
|
||||
console.log("onShow");
|
||||
this.getDoctorEvaluationList();
|
||||
this.getDoctorEvaluationList(1);
|
||||
},
|
||||
onTabsChange(e){
|
||||
console.log(e);
|
||||
@@ -59,18 +59,17 @@ Page({
|
||||
last_page: 0,
|
||||
[list_name]: []
|
||||
})
|
||||
this.getDoctorEvaluationList()
|
||||
this.getDoctorEvaluationList(e.detail.name)
|
||||
},
|
||||
getDoctorEvaluationList(){
|
||||
getDoctorEvaluationList(evaluation_type){
|
||||
//获取评价列表
|
||||
let params = {};
|
||||
params.page = this.data.current_page + 1;
|
||||
params.doctor_id = this.data.doctor_id;
|
||||
params.evaluation_type = this.data.evaluation_type;
|
||||
params.evaluation_type = evaluation_type;
|
||||
api.getDoctorEvaluation(params).then(response => {
|
||||
console.log(response);
|
||||
if(response.data.total > 0){
|
||||
let list_name = "appraise_list_" + this.data.evaluation_type;
|
||||
let list_name = "appraise_list_" + evaluation_type;
|
||||
console.log(list_name);
|
||||
let apprise_list = this.data[list_name];
|
||||
this.setData({
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
"t-rate": "tdesign-miniprogram/rate/rate",
|
||||
"van-divider": "@vant/weapp/divider/index"
|
||||
},
|
||||
"enablePullDownRefresh": true,
|
||||
"onReachBottomDistance": 100
|
||||
}
|
||||
Reference in New Issue
Block a user