Commit 991ddfcc by chenwq

fix(validReferralCount): 修复页面显示和提交逻辑问题

在referralCountList页面onShow中自动加载筛选配置并搜索,确保页面显示时数据正确
优化referraCountEdit页面提交逻辑,直接使用传入对象而非从列表查找,并改进成功提示信息
1 parent e39e3ddf
......@@ -75,17 +75,15 @@ Page({
if (loading) {
return
}
const list = this.data.detailInfo.sceneTypeEffectiveReferrals;
const index = list.findIndex(item => item.sceneType === updatedItem.sceneType);
// const targetItem = updatedItem.sceneTypeEffectiveReferrals;
// const index = list.findIndex(item => item.sceneType === updatedItem.sceneType);
const tipsObj = {
'draft': '草稿',
'submit': '提交',
'draft': '数据保存成功,未提交复核。',
'submit': '有效引荐数提交成功。',
}
console.log(list, 'list----')
console.log(index, 'index----')
const params = {
// 1-草稿,2-已提交
...list[index],
...updatedItem,
status: typeStatus == 'submit' ? 2 : 1
}
console.log(params, 'params---')
......@@ -94,11 +92,7 @@ Page({
loading: true
})
api.referralSubmit(params).then(res => {
wx.showToast({
// title: `${tipsObj[typeStatus]}`,
title: '操作成功',
icon: 'success'
});
wx.$util.showToast(`${tipsObj[typeStatus]}`);
this.getDetail()
}).finally(() => {
wx.hideLoading();
......
......@@ -189,7 +189,10 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() {
this.getOptionsList("filterConfig");
this.search();
},
/**
* 生命周期函数--监听页面隐藏
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!