Commit 991ddfcc by chenwq

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

在referralCountList页面onShow中自动加载筛选配置并搜索,确保页面显示时数据正确
优化referraCountEdit页面提交逻辑,直接使用传入对象而非从列表查找,并改进成功提示信息
1 parent e39e3ddf
...@@ -75,17 +75,15 @@ Page({ ...@@ -75,17 +75,15 @@ Page({
if (loading) { if (loading) {
return return
} }
const list = this.data.detailInfo.sceneTypeEffectiveReferrals; // const targetItem = updatedItem.sceneTypeEffectiveReferrals;
const index = list.findIndex(item => item.sceneType === updatedItem.sceneType); // const index = list.findIndex(item => item.sceneType === updatedItem.sceneType);
const tipsObj = { const tipsObj = {
'draft': '草稿', 'draft': '数据保存成功,未提交复核。',
'submit': '提交', 'submit': '有效引荐数提交成功。',
} }
console.log(list, 'list----')
console.log(index, 'index----')
const params = { const params = {
// 1-草稿,2-已提交 // 1-草稿,2-已提交
...list[index], ...updatedItem,
status: typeStatus == 'submit' ? 2 : 1 status: typeStatus == 'submit' ? 2 : 1
} }
console.log(params, 'params---') console.log(params, 'params---')
...@@ -94,11 +92,7 @@ Page({ ...@@ -94,11 +92,7 @@ Page({
loading: true loading: true
}) })
api.referralSubmit(params).then(res => { api.referralSubmit(params).then(res => {
wx.showToast({ wx.$util.showToast(`${tipsObj[typeStatus]}`);
// title: `${tipsObj[typeStatus]}`,
title: '操作成功',
icon: 'success'
});
this.getDetail() this.getDetail()
}).finally(() => { }).finally(() => {
wx.hideLoading(); wx.hideLoading();
......
...@@ -189,7 +189,10 @@ Page({ ...@@ -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!